@capillaryjs/capillary-viz 1.1.0 → 1.3.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/dist/index.js CHANGED
@@ -1,23 +1,23 @@
1
1
  var Ft = Object.defineProperty;
2
- var qt = (t, e, r) => e in t ? Ft(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
- var c = (t, e, r) => qt(t, typeof e != "symbol" ? e + "" : e, r);
4
- import { Emitter as D, DerivedEmitter as j, BaseEmitter as Pe, FetchState as S, combineFetchStates as Ut, defaultDiagnosticScope as Ht, Diagnostics as m, diagnosticInfo as Vt, EventBubble as Ge } from "@capillaryjs/capillary";
5
- import { Component as Ne, Placeholder as xe, Button as he, css as re, OptionGroup as Wt, readDeclarativeRegions as Yt, OptionGroupHeaderEnd as Gt, OptionsBox as Xt, Checkbox as fe, GroupBox as Ce } from "@capillaryjs/capillary-ui";
6
- function ct([t, e, r]) {
2
+ var Ut = (e, t, r) => t in e ? Ft(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var c = (e, t, r) => Ut(e, typeof t != "symbol" ? t + "" : t, r);
4
+ import { Emitter as D, DerivedEmitter as L, WritableProjection as Ht, BaseEmitter as ct, FetchState as S, combineFetchStates as Vt, defaultDiagnosticScope as Wt, Diagnostics as m, diagnosticInfo as Yt, EventBubble as Ye } from "@capillaryjs/capillary";
5
+ import { Component as Ne, Placeholder as Ce, Button as fe, css as ne, OptionGroup as Gt, readDeclarativeRegions as Xt, OptionGroupHeaderEnd as Zt, OptionsBox as Jt, Checkbox as me, GroupBox as ze } from "@capillaryjs/capillary-ui";
6
+ function ut([e, t, r]) {
7
7
  return {
8
- "--c1": t,
9
- "--c2": e,
8
+ "--c1": e,
9
+ "--c2": t,
10
10
  "--c3": r,
11
- ...Te(t, "--colored-dark") ? {} : { "--colored-dark": t },
12
- ...Te(e, "--colored-base") ? {} : { "--colored-base": e },
11
+ ...Te(e, "--colored-dark") ? {} : { "--colored-dark": e },
12
+ ...Te(t, "--colored-base") ? {} : { "--colored-base": t },
13
13
  ...Te(r, "--colored-light") ? {} : { "--colored-light": r }
14
14
  };
15
15
  }
16
- function Te(t, e) {
17
- return t.trim().replaceAll(" ", "") === `var(${e})`;
16
+ function Te(e, t) {
17
+ return e.trim().replaceAll(" ", "") === `var(${t})`;
18
18
  }
19
- class H {
20
- constructor(e) {
19
+ class V {
20
+ constructor(t) {
21
21
  c(this, "key");
22
22
  c(this, "label");
23
23
  c(this, "categories$");
@@ -30,10 +30,10 @@ class H {
30
30
  c(this, "visibilityEmitters", /* @__PURE__ */ new Map());
31
31
  c(this, "releaseCategoryDefaults");
32
32
  c(this, "disposed", !1);
33
- ie(e, "Criterion options"), this.key = F(e.key, "Criterion key"), this.label = Ke(e.label, "Criterion label"), ve(e.categories$, "Criterion categories$"), this.categories$ = e.categories$, this.allowResorting = e.allowResorting ?? !1, this.ownedCategories = e.ownedCategories, this.hidden$ = new D(
34
- new Set(e.initialHiddenKeys ?? []),
35
- { owner: this, purpose: `${this.key} hidden categories`, equals: Jt }
36
- ), this.visibleCategoriesEmitter = new j(
33
+ se(t, "Criterion options"), this.key = F(t.key, "Criterion key"), this.label = Ke(t.label, "Criterion label"), ke(t.categories$, "Criterion categories$"), this.categories$ = t.categories$, this.allowResorting = t.allowResorting ?? !1, this.ownedCategories = t.ownedCategories, this.hidden$ = new D(
34
+ new Set(t.initialHiddenKeys ?? []),
35
+ { owner: this, purpose: `${this.key} hidden categories`, equals: er }
36
+ ), this.visibleCategoriesEmitter = new L(
37
37
  [this.categories$, this.hidden$],
38
38
  ([r, i]) => Object.freeze(
39
39
  r.filter(({ key: n }) => !i.has(n))
@@ -43,37 +43,37 @@ class H {
43
43
  Array.isArray(r) && this.applyFirstSeenDefaults(r);
44
44
  });
45
45
  }
46
- visibility(e) {
46
+ visibility(t) {
47
47
  this.assertActive();
48
- const r = F(e, "Category key");
48
+ const r = F(t, "Category key");
49
49
  let i = this.visibilityEmitters.get(r);
50
- return i == null && (i = new Qt(this.hidden$, r, this), this.visibilityEmitters.set(r, i)), i;
50
+ return i == null && (i = new tr(this.hidden$, r, this), this.visibilityEmitters.set(r, i)), i;
51
51
  }
52
- setAllVisible(e, r) {
52
+ setAllVisible(t, r) {
53
53
  this.assertActive();
54
54
  const i = new Set(this.categories$.get().map(({ key: s }) => s)), n = new Set(this.hidden$.get());
55
55
  for (const s of i)
56
- e ? n.delete(s) : n.add(s);
56
+ t ? n.delete(s) : n.add(s);
57
57
  return this.hidden$.set(n, r ?? `${this.key} category visibility changed`);
58
58
  }
59
- pruneHidden(e) {
59
+ pruneHidden(t) {
60
60
  this.assertActive();
61
61
  const r = new Set(this.categories$.get().map(({ key: n }) => n)), i = new Set([...this.hidden$.get()].filter((n) => r.has(n)));
62
- return this.hidden$.set(i, e ?? `${this.key} hidden categories pruned`);
62
+ return this.hidden$.set(i, t ?? `${this.key} hidden categories pruned`);
63
63
  }
64
64
  dispose() {
65
- var e;
65
+ var t;
66
66
  if (!this.disposed) {
67
67
  this.disposed = !0, this.releaseCategoryDefaults();
68
68
  for (const r of this.visibilityEmitters.values()) r.dispose();
69
- this.visibilityEmitters.clear(), this.visibleCategoriesEmitter.dispose(), this.hidden$.dispose(), (e = this.ownedCategories) == null || e.dispose();
69
+ this.visibilityEmitters.clear(), this.visibleCategoriesEmitter.dispose(), this.hidden$.dispose(), (t = this.ownedCategories) == null || t.dispose();
70
70
  }
71
71
  }
72
- applyFirstSeenDefaults(e) {
73
- dt(e, `${this.label} categories`);
72
+ applyFirstSeenDefaults(t) {
73
+ pt(t, `${this.label} categories`);
74
74
  const r = new Set(this.hidden$.get());
75
75
  let i = !1;
76
- for (const n of e)
76
+ for (const n of t)
77
77
  this.seenKeys.has(n.key) || (this.seenKeys.add(n.key), n.hiddenByDefault === !0 && !r.has(n.key) && (r.add(n.key), i = !0));
78
78
  i && this.hidden$.set(r, `${this.key} first-seen defaults applied`);
79
79
  }
@@ -81,82 +81,82 @@ class H {
81
81
  if (this.disposed) throw new Error(`Criterion "${this.key}" is disposed`);
82
82
  }
83
83
  }
84
- function Si(t) {
85
- ie(t, "Static criterion options");
86
- const e = ut(t.categories, `${t.label} categories`), r = new D(e, {
87
- purpose: `${t.key} static categories`
84
+ function $i(e) {
85
+ se(e, "Static criterion options");
86
+ const t = dt(e.categories, `${e.label} categories`), r = new D(t, {
87
+ purpose: `${e.key} static categories`
88
88
  });
89
- return new H({ ...t, categories$: r, ownedCategories: r });
89
+ return new V({ ...e, categories$: r, ownedCategories: r });
90
90
  }
91
- function Ei(t) {
92
- if (ie(t, "Derived criterion options"), ve(t.source$, "Derived criterion source$"), typeof t.extractKeys != "function")
91
+ function xi(e) {
92
+ if (se(e, "Derived criterion options"), ke(e.source$, "Derived criterion source$"), typeof e.extractKeys != "function")
93
93
  throw new TypeError("Derived criterion extractKeys must be a function");
94
- if (typeof t.describe != "function")
94
+ if (typeof e.describe != "function")
95
95
  throw new TypeError("Derived criterion describe must be a function");
96
- const e = new j(
97
- [t.source$],
98
- ([r]) => Zt(r, t),
99
- { purpose: `${t.key} derived categories` }
96
+ const t = new L(
97
+ [e.source$],
98
+ ([r]) => Qt(r, e),
99
+ { purpose: `${e.key} derived categories` }
100
100
  );
101
- return new H({
102
- ...t,
103
- allowResorting: t.allowResorting ?? !0,
104
- categories$: e,
105
- ownedCategories: e
101
+ return new V({
102
+ ...e,
103
+ allowResorting: e.allowResorting ?? !0,
104
+ categories$: t,
105
+ ownedCategories: t
106
106
  });
107
107
  }
108
- function Zt(t, e) {
109
- if (!Array.isArray(t)) throw new TypeError("Derived category items must be an array");
108
+ function Qt(e, t) {
109
+ if (!Array.isArray(e)) throw new TypeError("Derived category items must be an array");
110
110
  const r = /* @__PURE__ */ new Map();
111
111
  let i = 0;
112
- for (const o of t) {
113
- const a = ze(e.extractKeys(o));
112
+ for (const o of e) {
113
+ const a = Oe(t.extractKeys(o));
114
114
  if (a.length === 0) {
115
115
  i += 1;
116
116
  continue;
117
117
  }
118
118
  for (const l of a) r.set(l, (r.get(l) ?? 0) + 1);
119
119
  }
120
- const n = [...r].filter(([, o]) => o > 0).map(([o, a]) => ({ key: o, count: a, label: e.describe(o, a).label }));
121
- n.sort(e.compare ?? ((o, a) => a.count - o.count || o.label.localeCompare(a.label) || o.key.localeCompare(a.key)));
120
+ const n = [...r].filter(([, o]) => o > 0).map(([o, a]) => ({ key: o, count: a, label: t.describe(o, a).label }));
121
+ n.sort(t.compare ?? ((o, a) => a.count - o.count || o.label.localeCompare(a.label) || o.key.localeCompare(a.key)));
122
122
  const s = n.map(({ key: o, count: a }) => {
123
- const l = e.describe(o, a);
124
- return Le({
123
+ const l = t.describe(o, a);
124
+ return Me({
125
125
  key: o,
126
126
  ...l,
127
127
  generated: !0,
128
- predicate: (u) => ze(e.extractKeys(u)).includes(o)
128
+ predicate: (u) => Oe(t.extractKeys(u)).includes(o)
129
129
  }, "Derived category");
130
130
  });
131
- if (i > 0 && e.unmatched != null) {
132
- const { key: o, ...a } = e.unmatched;
133
- s.push(Le({
131
+ if (i > 0 && t.unmatched != null) {
132
+ const { key: o, ...a } = t.unmatched;
133
+ s.push(Me({
134
134
  key: o,
135
135
  ...a,
136
136
  generated: !0,
137
- predicate: (l) => ze(e.extractKeys(l)).length === 0
137
+ predicate: (l) => Oe(t.extractKeys(l)).length === 0
138
138
  }, "Derived unmatched category"));
139
139
  }
140
- return ut(s, "Derived categories");
140
+ return dt(s, "Derived categories");
141
141
  }
142
- function $i(t, e) {
143
- ve(t, "filterByHidden items$"), er(e);
144
- const r = [t];
145
- for (const i of e) r.push(i.categories$, i.hidden$);
146
- return new j(
142
+ function Ci(e, t) {
143
+ ke(e, "filterByHidden items$"), rr(t);
144
+ const r = [e];
145
+ for (const i of t) r.push(i.categories$, i.hidden$);
146
+ return new L(
147
147
  r,
148
- (i) => i[0].filter((s) => !e.some((o, a) => {
148
+ (i) => i[0].filter((s) => !t.some((o, a) => {
149
149
  const l = i[a * 2 + 1], u = i[a * 2 + 2];
150
150
  return l.some((d) => u.has(d.key) && d.predicate(s));
151
151
  })),
152
152
  { purpose: "items filtered by hidden visualization categories" }
153
153
  );
154
154
  }
155
- function xi(t, e) {
156
- if (ve(t, "categoryCounts items$"), !(e instanceof H))
155
+ function zi(e, t) {
156
+ if (ke(e, "categoryCounts items$"), !(t instanceof V))
157
157
  throw new TypeError("categoryCounts criterion must be a GroupingCriterion");
158
- return new j(
159
- [t, e.categories$],
158
+ return new L(
159
+ [e, t.categories$],
160
160
  (r) => {
161
161
  const i = r[0], n = r[1];
162
162
  return new Map(n.map((s) => [
@@ -164,116 +164,102 @@ function xi(t, e) {
164
164
  i.filter((o) => s.predicate(o)).length
165
165
  ]));
166
166
  },
167
- { purpose: `${e.key} unfiltered category counts` }
167
+ { purpose: `${t.key} unfiltered category counts` }
168
168
  );
169
169
  }
170
- function Jt(t, e) {
171
- return t === e || t.size === e.size && [...t].every((r) => e.has(r));
172
- }
173
- class Qt extends Pe {
174
- constructor(r, i, n) {
175
- super(r.get().has(i) ? "hidden" : "visible", {
176
- owner: n,
177
- purpose: `${i} category visibility`,
178
- fetchState: r.getFetchState(),
179
- error: r.getError()
180
- });
181
- c(this, "release");
182
- this.source = r, this.categoryKey = i, this.release = r.subscribe((s) => this.updateFromSource(s), {
183
- emitCurrent: !1
170
+ function er(e, t) {
171
+ return e === t || e.size === t.size && [...e].every((r) => t.has(r));
172
+ }
173
+ class tr extends Ht {
174
+ constructor(t, r, i) {
175
+ super(t, {
176
+ owner: i,
177
+ purpose: `${r} category visibility`,
178
+ read: (n) => n.has(r) ? "hidden" : "visible",
179
+ write: (n, s) => {
180
+ if (s !== "hidden" && s !== "visible")
181
+ throw new TypeError("Category visibility must be hidden or visible");
182
+ const o = new Set(n);
183
+ return s === "hidden" ? o.add(r) : o.delete(r), o;
184
+ }
184
185
  });
185
186
  }
186
- set(r, i) {
187
- if (r !== "hidden" && r !== "visible")
188
- throw new TypeError("Category visibility must be hidden or visible");
189
- const n = new Set(this.source.get());
190
- return r === "hidden" ? n.add(this.categoryKey) : n.delete(this.categoryKey), this.source.set(n, i ?? `${this.categoryKey} visibility changed`);
191
- }
192
- dispose() {
193
- this.release(), super.dispose();
194
- }
195
- updateFromSource(r) {
196
- this.setSnapshot({
197
- value: r.value.has(this.categoryKey) ? "hidden" : "visible",
198
- fetchState: r.fetchState,
199
- error: r.error,
200
- parentEvent: r.event,
201
- cause: "hidden category membership changed"
202
- });
187
+ set(t, r) {
188
+ return super.set(t, r);
203
189
  }
204
190
  }
205
- function ze(t) {
206
- const r = (t == null ? [] : typeof t == "string" ? [t] : [...t]).map((i) => F(i, "Extracted category key"));
191
+ function Oe(e) {
192
+ const r = (e == null ? [] : typeof e == "string" ? [e] : [...e]).map((i) => F(i, "Extracted category key"));
207
193
  return [...new Set(r)];
208
194
  }
209
- function ut(t, e) {
210
- return dt(t, e), Object.freeze(t.map((r) => Le(r, e)));
195
+ function dt(e, t) {
196
+ return pt(e, t), Object.freeze(e.map((r) => Me(r, t)));
211
197
  }
212
- function Le(t, e) {
213
- ie(t, e);
198
+ function Me(e, t) {
199
+ se(e, t);
214
200
  const r = {
215
- ...t,
216
- key: F(t.key, `${e} key`),
217
- label: Ke(t.label, `${e} label`),
218
- colors: pt(t.colors, `${e} colors`)
201
+ ...e,
202
+ key: F(e.key, `${t} key`),
203
+ label: Ke(e.label, `${t} label`),
204
+ colors: ht(e.colors, `${t} colors`)
219
205
  };
220
- if (typeof t.predicate != "function")
221
- throw new TypeError(`${e} predicate must be a function`);
222
- return t.colorKey !== void 0 && F(t.colorKey, `${e} colorKey`), Object.freeze(r);
206
+ if (typeof e.predicate != "function")
207
+ throw new TypeError(`${t} predicate must be a function`);
208
+ return e.colorKey !== void 0 && F(e.colorKey, `${t} colorKey`), Object.freeze(r);
223
209
  }
224
- function dt(t, e) {
225
- if (!Array.isArray(t)) throw new TypeError(`${e} must be an array`);
210
+ function pt(e, t) {
211
+ if (!Array.isArray(e)) throw new TypeError(`${t} must be an array`);
226
212
  const r = /* @__PURE__ */ new Set();
227
- for (const i of t) {
228
- ie(i, e);
229
- const n = F(i.key, `${e} key`);
230
- if (r.has(n)) throw new Error(`${e} contains duplicate key "${n}"`);
231
- if (r.add(n), Ke(i.label, `${e} label`), pt(i.colors, `${e} colors`), typeof i.predicate != "function")
232
- throw new TypeError(`${e} predicate must be a function`);
233
- }
234
- }
235
- function er(t) {
236
- if (!Array.isArray(t)) throw new TypeError("Criteria must be an array");
237
- const e = /* @__PURE__ */ new Set();
238
- for (const r of t) {
239
- if (!(r instanceof H))
213
+ for (const i of e) {
214
+ se(i, t);
215
+ const n = F(i.key, `${t} key`);
216
+ if (r.has(n)) throw new Error(`${t} contains duplicate key "${n}"`);
217
+ if (r.add(n), Ke(i.label, `${t} label`), ht(i.colors, `${t} colors`), typeof i.predicate != "function")
218
+ throw new TypeError(`${t} predicate must be a function`);
219
+ }
220
+ }
221
+ function rr(e) {
222
+ if (!Array.isArray(e)) throw new TypeError("Criteria must be an array");
223
+ const t = /* @__PURE__ */ new Set();
224
+ for (const r of e) {
225
+ if (!(r instanceof V))
240
226
  throw new TypeError("Criteria must contain GroupingCriterion instances");
241
- if (e.has(r.key)) throw new Error(`Duplicate criterion key "${r.key}"`);
242
- e.add(r.key);
227
+ if (t.has(r.key)) throw new Error(`Duplicate criterion key "${r.key}"`);
228
+ t.add(r.key);
243
229
  }
244
230
  }
245
- function pt(t, e) {
246
- if (!Array.isArray(t) || t.length !== 3 || t.some((r) => typeof r != "string" || r.trim() === ""))
247
- throw new TypeError(`${e} must contain three non-empty CSS color values`);
248
- return Object.freeze([...t]);
231
+ function ht(e, t) {
232
+ if (!Array.isArray(e) || e.length !== 3 || e.some((r) => typeof r != "string" || r.trim() === ""))
233
+ throw new TypeError(`${t} must contain three non-empty CSS color values`);
234
+ return Object.freeze([...e]);
249
235
  }
250
- function ve(t, e) {
251
- if (t == null || typeof t != "object" && typeof t != "function" || typeof Reflect.get(t, "get") != "function" || typeof Reflect.get(t, "getFetchState") != "function" || typeof Reflect.get(t, "getError") != "function" || typeof Reflect.get(t, "subscribe") != "function")
252
- throw new TypeError(`${e} must be a readable emitter`);
236
+ function ke(e, t) {
237
+ if (e == null || typeof e != "object" && typeof e != "function" || typeof Reflect.get(e, "get") != "function" || typeof Reflect.get(e, "getFetchState") != "function" || typeof Reflect.get(e, "getError") != "function" || typeof Reflect.get(e, "subscribe") != "function")
238
+ throw new TypeError(`${t} must be a readable emitter`);
253
239
  }
254
- function ie(t, e) {
255
- if (t == null || typeof t != "object" || Array.isArray(t))
256
- throw new TypeError(`${e} must be an object`);
240
+ function se(e, t) {
241
+ if (e == null || typeof e != "object" || Array.isArray(e))
242
+ throw new TypeError(`${t} must be an object`);
257
243
  }
258
- function F(t, e) {
259
- if (typeof t != "string" || t.trim() === "")
260
- throw new TypeError(`${e} must be a non-empty string`);
261
- return t;
244
+ function F(e, t) {
245
+ if (typeof e != "string" || e.trim() === "")
246
+ throw new TypeError(`${t} must be a non-empty string`);
247
+ return e;
262
248
  }
263
- function Ke(t, e) {
264
- if (typeof t != "string" || t.trim() === "")
265
- throw new TypeError(`${e} must be a non-empty string`);
266
- return t;
249
+ function Ke(e, t) {
250
+ if (typeof e != "string" || e.trim() === "")
251
+ throw new TypeError(`${t} must be a non-empty string`);
252
+ return e;
267
253
  }
268
- function Re(t, e, r = {}) {
269
- if (!Array.isArray(t)) throw new TypeError("Block layout items must be an array");
270
- if (!Array.isArray(e)) throw new TypeError("Block layout splits must be an array");
254
+ function Re(e, t, r = {}) {
255
+ if (!Array.isArray(e)) throw new TypeError("Block layout items must be an array");
256
+ if (!Array.isArray(t)) throw new TypeError("Block layout splits must be an array");
271
257
  const i = r.readabilityThreshold ?? 0.02;
272
258
  if (!Number.isFinite(i) || i < 0 || i > 1)
273
259
  throw new RangeError("Block readability threshold must be between zero and one");
274
- const n = [], s = Object.freeze([...t]), o = ht({
260
+ const n = [], s = Object.freeze([...e]), o = ft({
275
261
  items: s,
276
- splits: e,
262
+ splits: t,
277
263
  splitIndex: 0,
278
264
  path: Object.freeze([]),
279
265
  criterion: null,
@@ -286,28 +272,28 @@ function Re(t, e, r = {}) {
286
272
  });
287
273
  return Object.freeze({ valid: n.length === 0, root: o, issues: Object.freeze(n) });
288
274
  }
289
- function tr(t) {
290
- if (!(t instanceof H))
275
+ function ir(e) {
276
+ if (!(e instanceof V))
291
277
  throw new TypeError("criterionSnapshot requires a GroupingCriterion");
292
278
  return Object.freeze({
293
- key: t.key,
294
- label: t.label,
295
- categories: t.categories$.get(),
296
- allowResorting: t.allowResorting
279
+ key: e.key,
280
+ label: e.label,
281
+ categories: e.categories$.get(),
282
+ allowResorting: e.allowResorting
297
283
  });
298
284
  }
299
- function I(t, e) {
300
- if (e == null) return null;
301
- let r = t;
302
- for (const i of e) {
285
+ function _(e, t) {
286
+ if (t == null) return null;
287
+ let r = e;
288
+ for (const i of t) {
303
289
  const n = r.children.find((s) => s.criterionKey === i.criterionKey && s.categoryKey === i.categoryKey);
304
290
  if (n == null) return null;
305
291
  r = n;
306
292
  }
307
293
  return r;
308
294
  }
309
- class rr {
310
- constructor(e, r, i = {}) {
295
+ class nr {
296
+ constructor(t, r, i = {}) {
311
297
  c(this, "layout$");
312
298
  c(this, "selectedPath$");
313
299
  c(this, "selectedBlock$");
@@ -317,15 +303,15 @@ class rr {
317
303
  c(this, "selectedItemsEmitter");
318
304
  c(this, "releases", []);
319
305
  c(this, "disposed", !1);
320
- this.options = i, this.layoutEmitter = new ir(e, r, i), this.layout$ = this.layoutEmitter, this.selectedPath$ = new D(null, {
306
+ this.options = i, this.layoutEmitter = new sr(t, r, i), this.layout$ = this.layoutEmitter, this.selectedPath$ = new D(null, {
321
307
  owner: this,
322
308
  purpose: "selected block path",
323
- equals: sr
324
- }), this.selectedBlockEmitter = new j(
309
+ equals: ar
310
+ }), this.selectedBlockEmitter = new L(
325
311
  [this.layout$, this.selectedPath$],
326
- ([n, s]) => I(n.root, s),
312
+ ([n, s]) => _(n.root, s),
327
313
  { owner: this, purpose: "selected block" }
328
- ), this.selectedBlock$ = this.selectedBlockEmitter, this.selectedItemsEmitter = new j(
314
+ ), this.selectedBlock$ = this.selectedBlockEmitter, this.selectedItemsEmitter = new L(
329
315
  [this.selectedBlock$],
330
316
  ([n]) => (n == null ? void 0 : n.items) ?? Object.freeze([]),
331
317
  { owner: this, purpose: "selected block items" }
@@ -334,35 +320,35 @@ class rr {
334
320
  this.selectedPath$.subscribe(() => this.reconcileSelection(), { emitCurrent: !1 })
335
321
  );
336
322
  }
337
- select(e, r) {
323
+ select(t, r) {
338
324
  this.assertActive();
339
- const i = ft(e);
340
- if (I(this.layout$.get().root, i) == null)
325
+ const i = mt(t);
326
+ if (_(this.layout$.get().root, i) == null)
341
327
  throw new Error("Cannot select a path absent from the current block layout");
342
328
  return this.selectedPath$.set(i, r ?? "block selected");
343
329
  }
344
- clear(e) {
345
- return this.assertActive(), this.selectedPath$.set(null, e ?? "block selection cleared");
330
+ clear(t) {
331
+ return this.assertActive(), this.selectedPath$.set(null, t ?? "block selection cleared");
346
332
  }
347
333
  dispose() {
348
334
  if (!this.disposed) {
349
335
  this.disposed = !0;
350
- for (const e of this.releases.splice(0)) e();
336
+ for (const t of this.releases.splice(0)) t();
351
337
  this.selectedItemsEmitter.dispose(), this.selectedBlockEmitter.dispose(), this.selectedPath$.dispose(), this.layoutEmitter.dispose();
352
338
  }
353
339
  }
354
340
  reconcileSelection() {
355
- const e = this.selectedPath$.get();
356
- e == null || I(this.layout$.get().root, e) != null || this.selectedPath$.set(null, "block selection no longer exists");
341
+ const t = this.selectedPath$.get();
342
+ t == null || _(this.layout$.get().root, t) != null || this.selectedPath$.set(null, "block selection no longer exists");
357
343
  }
358
344
  assertActive() {
359
345
  if (this.disposed) throw new Error("Block selection model is disposed");
360
346
  }
361
347
  }
362
- function Ci(t, e, r = {}) {
363
- return new rr(t, e, r);
348
+ function Ti(e, t, r = {}) {
349
+ return new nr(e, t, r);
364
350
  }
365
- class ir extends Pe {
351
+ class sr extends ct {
366
352
  constructor(r, i, n) {
367
353
  super(Re([], [], n), {
368
354
  purpose: "reactive block layout",
@@ -370,7 +356,7 @@ class ir extends Pe {
370
356
  });
371
357
  c(this, "releases", []);
372
358
  c(this, "categoryReleases", []);
373
- this.items$ = r, this.splits$ = i, this.options = n, Xe(r, "Block selection items$"), Xe(i, "Block selection splits$"), this.releases.push(
359
+ this.items$ = r, this.splits$ = i, this.options = n, Ge(r, "Block selection items$"), Ge(i, "Block selection splits$"), this.releases.push(
374
360
  r.subscribe(({ event: s }) => this.recompute(s), { emitCurrent: !1 }),
375
361
  i.subscribe(({ event: s }) => {
376
362
  this.subscribeCategories(), this.recompute(s);
@@ -394,19 +380,19 @@ class ir extends Pe {
394
380
  const i = this.splits$.get(), n = [
395
381
  this.items$,
396
382
  this.splits$,
397
- ...i.map(({ categories$: h }) => h)
398
- ], s = n.map((h) => h.getFetchState()), o = n.map((h) => h.getError()).filter(ar);
383
+ ...i.map(({ categories$: p }) => p)
384
+ ], s = n.map((p) => p.getFetchState()), o = n.map((p) => p.getError()).filter(cr);
399
385
  let a, l = null;
400
386
  try {
401
387
  a = Re(
402
388
  this.items$.get(),
403
- i.map(tr),
389
+ i.map(ir),
404
390
  this.options
405
391
  );
406
- } catch (h) {
407
- l = h, a = Re([], [], this.options);
392
+ } catch (p) {
393
+ l = p, a = Re([], [], this.options);
408
394
  }
409
- const u = l == null ? o : [...o, l], d = u.length > 0 ? S.Error : Ut(s);
395
+ const u = l == null ? o : [...o, l], d = u.length > 0 ? S.Error : Vt(s);
410
396
  this.setSnapshot({
411
397
  value: a,
412
398
  fetchState: d,
@@ -416,9 +402,9 @@ class ir extends Pe {
416
402
  });
417
403
  }
418
404
  }
419
- function ht(t) {
405
+ function ft(e) {
420
406
  const {
421
- items: e,
407
+ items: t,
422
408
  splits: r,
423
409
  splitIndex: i,
424
410
  path: n,
@@ -428,45 +414,45 @@ function ht(t) {
428
414
  totalShare: l,
429
415
  readabilityThreshold: u,
430
416
  issues: d,
431
- rootLabel: h
432
- } = t, k = r[i], b = k != null && n.length > 0 && l < u, y = k == null || b ? [] : nr({
433
- items: e,
417
+ rootLabel: p
418
+ } = e, b = r[i], w = b != null && n.length > 0 && l < u, g = b == null || w ? [] : or({
419
+ items: t,
434
420
  splits: r,
435
421
  splitIndex: i,
436
422
  path: n,
437
- criterion: k,
423
+ criterion: b,
438
424
  totalShare: l,
439
425
  readabilityThreshold: u,
440
426
  issues: d,
441
- rootLabel: h
442
- }), f = a === 0 ? 0 : e.length / a;
427
+ rootLabel: p
428
+ }), f = a === 0 ? 0 : t.length / a;
443
429
  return Object.freeze({
444
- key: or(n),
430
+ key: lr(n),
445
431
  path: n,
446
432
  criterionKey: (s == null ? void 0 : s.key) ?? null,
447
433
  criterionLabel: (s == null ? void 0 : s.label) ?? null,
448
434
  categoryKey: (o == null ? void 0 : o.key) ?? null,
449
- label: (o == null ? void 0 : o.label) ?? h,
435
+ label: (o == null ? void 0 : o.label) ?? p,
450
436
  colors: (o == null ? void 0 : o.colors) ?? null,
451
437
  colorKey: (o == null ? void 0 : o.colorKey) ?? null,
452
- count: e.length,
438
+ count: t.length,
453
439
  share: f,
454
440
  totalShare: l,
455
441
  depth: n.length - 1,
456
- items: e,
457
- children: Object.freeze(y),
442
+ items: t,
443
+ children: Object.freeze(g),
458
444
  childOrientation: n.length % 2 === 0 ? "horizontal" : "vertical",
459
- childrenSuppressed: b
445
+ childrenSuppressed: w
460
446
  });
461
447
  }
462
- function nr(t) {
463
- const { items: e, criterion: r, path: i, issues: n } = t, s = new Map(r.categories.map((l) => [l.key, {
448
+ function or(e) {
449
+ const { items: t, criterion: r, path: i, issues: n } = e, s = new Map(r.categories.map((l) => [l.key, {
464
450
  category: l,
465
451
  items: []
466
452
  }]));
467
453
  let o = !0;
468
- if (e.forEach((l, u) => {
469
- const d = r.categories.filter((h) => h.predicate(l));
454
+ if (t.forEach((l, u) => {
455
+ const d = r.categories.filter((p) => p.predicate(l));
470
456
  if (d.length !== 1) {
471
457
  o = !1, n.push(Object.freeze({
472
458
  kind: d.length === 0 ? "unmatched" : "multiple-matches",
@@ -475,7 +461,7 @@ function nr(t) {
475
461
  parentPath: i,
476
462
  item: l,
477
463
  itemIndex: u,
478
- matchedCategoryKeys: Object.freeze(d.map(({ key: h }) => h))
464
+ matchedCategoryKeys: Object.freeze(d.map(({ key: p }) => p))
479
465
  }));
480
466
  return;
481
467
  }
@@ -483,68 +469,68 @@ function nr(t) {
483
469
  }), !o) return [];
484
470
  let a = [...s.values()].filter((l) => l.items.length > 0);
485
471
  return r.allowResorting && (a = a.sort((l, u) => u.items.length - l.items.length || l.category.label.localeCompare(u.category.label) || l.category.key.localeCompare(u.category.key))), a.map(({ category: l, items: u }) => {
486
- const d = ft([...i, {
472
+ const d = mt([...i, {
487
473
  criterionKey: r.key,
488
474
  categoryKey: l.key
489
- }]), h = e.length === 0 ? 0 : u.length / e.length;
490
- return ht({
491
- ...t,
475
+ }]), p = t.length === 0 ? 0 : u.length / t.length;
476
+ return ft({
477
+ ...e,
492
478
  items: Object.freeze(u),
493
- splitIndex: t.splitIndex + 1,
479
+ splitIndex: e.splitIndex + 1,
494
480
  path: d,
495
481
  criterion: r,
496
482
  category: l,
497
- parentCount: e.length,
498
- totalShare: t.totalShare * h
483
+ parentCount: t.length,
484
+ totalShare: e.totalShare * p
499
485
  });
500
486
  });
501
487
  }
502
- function ft(t) {
503
- if (!Array.isArray(t)) throw new TypeError("Block path must be an array");
504
- return Object.freeze(t.map((e) => {
505
- if (e == null || typeof e != "object")
488
+ function mt(e) {
489
+ if (!Array.isArray(e)) throw new TypeError("Block path must be an array");
490
+ return Object.freeze(e.map((t) => {
491
+ if (t == null || typeof t != "object")
506
492
  throw new TypeError("Block path segments must be objects");
507
- if (typeof e.criterionKey != "string" || e.criterionKey === "" || typeof e.categoryKey != "string" || e.categoryKey === "")
493
+ if (typeof t.criterionKey != "string" || t.criterionKey === "" || typeof t.categoryKey != "string" || t.categoryKey === "")
508
494
  throw new TypeError("Block path keys must be non-empty strings");
509
- return Object.freeze({ ...e });
495
+ return Object.freeze({ ...t });
510
496
  }));
511
497
  }
512
- function sr(t, e) {
513
- return t === e || t != null && e != null && t.length === e.length && t.every((r, i) => {
514
- const n = e[i];
498
+ function ar(e, t) {
499
+ return e === t || e != null && t != null && e.length === t.length && e.every((r, i) => {
500
+ const n = t[i];
515
501
  return r.criterionKey === (n == null ? void 0 : n.criterionKey) && r.categoryKey === n.categoryKey;
516
502
  });
517
503
  }
518
- function or(t) {
519
- return t.length === 0 ? "root" : t.map(({ criterionKey: e, categoryKey: r }) => `${encodeURIComponent(e)}=${encodeURIComponent(r)}`).join("/");
504
+ function lr(e) {
505
+ return e.length === 0 ? "root" : e.map(({ criterionKey: t, categoryKey: r }) => `${encodeURIComponent(t)}=${encodeURIComponent(r)}`).join("/");
520
506
  }
521
- function ar(t) {
522
- return t != null;
507
+ function cr(e) {
508
+ return e != null;
523
509
  }
524
- function Xe(t, e) {
525
- if (t == null || typeof t != "object" && typeof t != "function" || typeof Reflect.get(t, "get") != "function" || typeof Reflect.get(t, "getFetchState") != "function" || typeof Reflect.get(t, "getError") != "function" || typeof Reflect.get(t, "subscribe") != "function")
526
- throw new TypeError(`${e} must be a readable emitter`);
510
+ function Ge(e, t) {
511
+ if (e == null || typeof e != "object" && typeof e != "function" || typeof Reflect.get(e, "get") != "function" || typeof Reflect.get(e, "getFetchState") != "function" || typeof Reflect.get(e, "getError") != "function" || typeof Reflect.get(e, "subscribe") != "function")
512
+ throw new TypeError(`${t} must be a readable emitter`);
527
513
  }
528
- const Ze = "data-cap-structural-styles";
529
- let lr = 1;
530
- class mt {
531
- constructor(e = `runtime-${lr++}`) {
514
+ const Xe = "data-cap-structural-styles";
515
+ let ur = 1;
516
+ class yt {
517
+ constructor(t = `runtime-${ur++}`) {
532
518
  c(this, "id");
533
519
  c(this, "cssFragments", /* @__PURE__ */ new Map());
534
- if (typeof e != "string") throw new TypeError("StyleRegistry id must be a string");
535
- this.id = e;
520
+ if (typeof t != "string") throw new TypeError("StyleRegistry id must be a string");
521
+ this.id = t;
536
522
  }
537
- registerCSS(e) {
538
- if (typeof e != "string") throw new TypeError("Component CSS must be a string");
539
- const r = e.trim();
523
+ registerCSS(t) {
524
+ if (typeof t != "string") throw new TypeError("Component CSS must be a string");
525
+ const r = t.trim();
540
526
  return r.length > 0 && this.cssFragments.set(`raw:${r}`, { kind: "raw", css: r }), this;
541
527
  }
542
528
  /** @internal Collect a host-relative component template without resolving it yet. */
543
- registerHostCSS(e, r) {
544
- if (typeof e != "string") throw new TypeError("Component CSS must be a string");
529
+ registerHostCSS(t, r) {
530
+ if (typeof t != "string") throw new TypeError("Component CSS must be a string");
545
531
  if (typeof r != "string" || r.trim().length === 0)
546
532
  throw new TypeError("Component CSS host must be a non-empty selector");
547
- const i = e.trim();
533
+ const i = t.trim();
548
534
  if (i.length === 0) return this;
549
535
  if (!i.includes("&")) return this.registerCSS(i);
550
536
  const n = `host:${i}`, s = this.cssFragments.get(n);
@@ -555,16 +541,16 @@ class mt {
555
541
  }) : s.kind === "host" && s.hosts.add(r.trim()), this;
556
542
  }
557
543
  generateCSS() {
558
- return [...this.cssFragments.values()].map((e) => e.kind === "raw" ? e.css : yt(e.css, [...e.hosts])).join(`
544
+ return [...this.cssFragments.values()].map((t) => t.kind === "raw" ? t.css : gt(t.css, [...t.hosts])).join(`
559
545
 
560
546
  `);
561
547
  }
562
- injectAll(e = globalThis.document) {
563
- if ((e == null ? void 0 : e.head) == null)
548
+ injectAll(t = globalThis.document) {
549
+ if ((t == null ? void 0 : t.head) == null)
564
550
  throw new TypeError("StyleRegistry.injectAll requires a document with a head");
565
- const r = `style[${Ze}="${dr(this.id)}"]`;
566
- let i = e.head.querySelector(r);
567
- i == null && (i = e.createElement("style"), i.setAttribute(Ze, this.id), e.head.prepend(i));
551
+ const r = `style[${Xe}="${hr(this.id)}"]`;
552
+ let i = t.head.querySelector(r);
553
+ i == null && (i = t.createElement("style"), i.setAttribute(Xe, this.id), t.head.prepend(i));
568
554
  const n = this.generateCSS();
569
555
  return i.textContent !== n && (i.textContent = n), i;
570
556
  }
@@ -572,66 +558,66 @@ class mt {
572
558
  this.cssFragments.clear();
573
559
  }
574
560
  }
575
- function cr() {
576
- return new mt();
561
+ function dr() {
562
+ return new yt();
577
563
  }
578
- const ur = new mt("");
579
- function dr(t) {
580
- return t.replaceAll("\\", "\\\\").replaceAll('"', '\\"');
564
+ const pr = new yt("");
565
+ function hr(e) {
566
+ return e.replaceAll("\\", "\\\\").replaceAll('"', '\\"');
581
567
  }
582
- function yt(t, e) {
568
+ function gt(e, t) {
583
569
  let r = "", i = 0;
584
- for (; i < t.length; ) {
585
- const n = fr(t, i);
586
- if (n < 0) return r + t.slice(i);
587
- const s = mr(t, n);
588
- if (s < 0) return r + t.slice(i);
589
- const o = t.slice(i, n), a = t.slice(n + 1, s), l = o.trim();
590
- r += l.startsWith("@") ? `${o}{${yt(a, e)}}` : `${pr(o, e)}{${a}}`, i = s + 1;
570
+ for (; i < e.length; ) {
571
+ const n = yr(e, i);
572
+ if (n < 0) return r + e.slice(i);
573
+ const s = gr(e, n);
574
+ if (s < 0) return r + e.slice(i);
575
+ const o = e.slice(i, n), a = e.slice(n + 1, s), l = o.trim();
576
+ r += l.startsWith("@") ? `${o}{${gt(a, t)}}` : `${fr(o, t)}{${a}}`, i = s + 1;
591
577
  }
592
578
  return r;
593
579
  }
594
- function pr(t, e) {
580
+ function fr(e, t) {
595
581
  var o, a, l;
596
- if (e.length === 1 || !t.includes("&"))
597
- return e.length === 1 ? t.replaceAll("&", e[0]) : t;
598
- const r = ((o = t.match(/^\s*/)) == null ? void 0 : o[0]) ?? "", i = ((a = t.match(/\s*$/)) == null ? void 0 : a[0]) ?? "", n = hr(t.trim()), s = ((l = r.match(/(?:^|\n)([ \t]*)$/)) == null ? void 0 : l[1]) ?? "";
599
- return r + n.flatMap((u) => u.includes("&") ? e.map((d) => u.replaceAll("&", d)) : [u]).join(`,
582
+ if (t.length === 1 || !e.includes("&"))
583
+ return t.length === 1 ? e.replaceAll("&", t[0]) : e;
584
+ const r = ((o = e.match(/^\s*/)) == null ? void 0 : o[0]) ?? "", i = ((a = e.match(/\s*$/)) == null ? void 0 : a[0]) ?? "", n = mr(e.trim()), s = ((l = r.match(/(?:^|\n)([ \t]*)$/)) == null ? void 0 : l[1]) ?? "";
585
+ return r + n.flatMap((u) => u.includes("&") ? t.map((d) => u.replaceAll("&", d)) : [u]).join(`,
600
586
  ${s}`) + i;
601
587
  }
602
- function hr(t) {
603
- const e = [];
588
+ function mr(e) {
589
+ const t = [];
604
590
  let r = 0, i = 0, n = 0, s = null;
605
- for (let o = 0; o < t.length; o += 1) {
606
- const a = t[o];
591
+ for (let o = 0; o < e.length; o += 1) {
592
+ const a = e[o];
607
593
  if (s != null) {
608
594
  a === "\\" ? o += 1 : a === s && (s = null);
609
595
  continue;
610
596
  }
611
- a === '"' || a === "'" ? s = a : a === "(" ? i += 1 : a === ")" ? i -= 1 : a === "[" ? n += 1 : a === "]" ? n -= 1 : a === "," && i === 0 && n === 0 && (e.push(t.slice(r, o).trim()), r = o + 1);
597
+ a === '"' || a === "'" ? s = a : a === "(" ? i += 1 : a === ")" ? i -= 1 : a === "[" ? n += 1 : a === "]" ? n -= 1 : a === "," && i === 0 && n === 0 && (t.push(e.slice(r, o).trim()), r = o + 1);
612
598
  }
613
- return e.push(t.slice(r).trim()), e.filter(Boolean);
599
+ return t.push(e.slice(r).trim()), t.filter(Boolean);
614
600
  }
615
- function fr(t, e) {
616
- for (let r = e; r < t.length; r += 1) {
617
- const i = t[r];
601
+ function yr(e, t) {
602
+ for (let r = t; r < e.length; r += 1) {
603
+ const i = e[r];
618
604
  if (i === '"' || i === "'")
619
- r = gt(t, r);
620
- else if (i === "/" && t[r + 1] === "*")
621
- r = bt(t, r);
605
+ r = bt(e, r);
606
+ else if (i === "/" && e[r + 1] === "*")
607
+ r = wt(e, r);
622
608
  else if (i === "{")
623
609
  return r;
624
610
  }
625
611
  return -1;
626
612
  }
627
- function mr(t, e) {
613
+ function gr(e, t) {
628
614
  let r = 1;
629
- for (let i = e + 1; i < t.length; i += 1) {
630
- const n = t[i];
615
+ for (let i = t + 1; i < e.length; i += 1) {
616
+ const n = e[i];
631
617
  if (n === '"' || n === "'")
632
- i = gt(t, i);
633
- else if (n === "/" && t[i + 1] === "*")
634
- i = bt(t, i);
618
+ i = bt(e, i);
619
+ else if (n === "/" && e[i + 1] === "*")
620
+ i = wt(e, i);
635
621
  else if (n === "{")
636
622
  r += 1;
637
623
  else if (n === "}" && --r === 0)
@@ -639,29 +625,29 @@ function mr(t, e) {
639
625
  }
640
626
  return -1;
641
627
  }
642
- function gt(t, e) {
643
- const r = t[e];
644
- for (let i = e + 1; i < t.length; i += 1)
645
- if (t[i] === "\\") i += 1;
646
- else if (t[i] === r) return i;
647
- return t.length;
628
+ function bt(e, t) {
629
+ const r = e[t];
630
+ for (let i = t + 1; i < e.length; i += 1)
631
+ if (e[i] === "\\") i += 1;
632
+ else if (e[i] === r) return i;
633
+ return e.length;
648
634
  }
649
- function bt(t, e) {
650
- const r = t.indexOf("*/", e + 2);
651
- return r < 0 ? t.length : r + 1;
635
+ function wt(e, t) {
636
+ const r = e.indexOf("*/", t + 2);
637
+ return r < 0 ? e.length : r + 1;
652
638
  }
653
- const yr = /* @__PURE__ */ new WeakSet(), gr = /* @__PURE__ */ new WeakSet();
654
- class wt {
655
- constructor(e = []) {
639
+ const br = /* @__PURE__ */ new WeakSet(), wr = /* @__PURE__ */ new WeakSet();
640
+ class vt {
641
+ constructor(t = []) {
656
642
  c(this, "providers", /* @__PURE__ */ new Map());
657
643
  c(this, "instances", /* @__PURE__ */ new Map());
658
644
  c(this, "creationOrder", []);
659
645
  c(this, "resolving", []);
660
646
  c(this, "disposed", !1);
661
- if (!Array.isArray(e))
647
+ if (!Array.isArray(t))
662
648
  throw new TypeError("ServiceScope providers must be an array");
663
- for (const r of e) {
664
- if (vr(r), this.providers.has(r.key))
649
+ for (const r of t) {
650
+ if (Sr(r), this.providers.has(r.key))
665
651
  throw new Error(`Service "${r.key.name}" is registered more than once`);
666
652
  this.providers.set(r.key, r);
667
653
  }
@@ -669,22 +655,22 @@ class wt {
669
655
  get isDisposed() {
670
656
  return this.disposed;
671
657
  }
672
- has(e) {
673
- return this.assertActive(), Je(e), this.providers.has(e);
658
+ has(t) {
659
+ return this.assertActive(), Ze(t), this.providers.has(t);
674
660
  }
675
- require(e) {
676
- if (this.assertActive(), Je(e), this.instances.has(e)) return this.instances.get(e);
677
- const r = this.providers.get(e);
678
- if (r == null) throw new Error(`Service "${e.name}" is not registered`);
679
- const i = this.resolving.indexOf(e);
661
+ require(t) {
662
+ if (this.assertActive(), Ze(t), this.instances.has(t)) return this.instances.get(t);
663
+ const r = this.providers.get(t);
664
+ if (r == null) throw new Error(`Service "${t.name}" is not registered`);
665
+ const i = this.resolving.indexOf(t);
680
666
  if (i >= 0) {
681
- const n = [...this.resolving.slice(i), e].map((s) => s.name).join(" -> ");
667
+ const n = [...this.resolving.slice(i), t].map((s) => s.name).join(" -> ");
682
668
  throw new Error(`Circular service dependency: ${n}`);
683
669
  }
684
- this.resolving.push(e);
670
+ this.resolving.push(t);
685
671
  try {
686
672
  const n = r.create(this);
687
- return this.instances.set(e, n), this.creationOrder.push(e), n;
673
+ return this.instances.set(t, n), this.creationOrder.push(t), n;
688
674
  } finally {
689
675
  this.resolving.pop();
690
676
  }
@@ -692,46 +678,46 @@ class wt {
692
678
  dispose() {
693
679
  if (this.disposed) return;
694
680
  this.disposed = !0;
695
- const e = [];
681
+ const t = [];
696
682
  for (const r of [...this.creationOrder].reverse()) {
697
683
  const i = this.instances.get(r);
698
684
  try {
699
- const n = kr(i);
685
+ const n = Er(i);
700
686
  n != null && n.call(i);
701
687
  } catch (n) {
702
- e.push(n);
688
+ t.push(n);
703
689
  }
704
690
  }
705
- if (this.instances.clear(), this.creationOrder.length = 0, this.resolving.length = 0, e.length === 1) throw e[0];
706
- if (e.length > 1)
707
- throw new AggregateError(e, "Several services failed during disposal");
691
+ if (this.instances.clear(), this.creationOrder.length = 0, this.resolving.length = 0, t.length === 1) throw t[0];
692
+ if (t.length > 1)
693
+ throw new AggregateError(t, "Several services failed during disposal");
708
694
  }
709
695
  assertActive() {
710
696
  if (this.disposed) throw new Error("ServiceScope has been disposed");
711
697
  }
712
698
  }
713
- function br(t = []) {
714
- return new wt(t);
699
+ function vr(e = []) {
700
+ return new vt(e);
715
701
  }
716
- function wr(t) {
717
- return t != null && (typeof t == "object" || typeof t == "function") && yr.has(t);
702
+ function kr(e) {
703
+ return e != null && (typeof e == "object" || typeof e == "function") && br.has(e);
718
704
  }
719
- function Je(t) {
720
- if (!wr(t)) throw new TypeError("Expected a service key created by defineService()");
705
+ function Ze(e) {
706
+ if (!kr(e)) throw new TypeError("Expected a service key created by defineService()");
721
707
  }
722
- function vr(t) {
723
- if (t == null || typeof t != "object" && typeof t != "function" || !gr.has(t))
708
+ function Sr(e) {
709
+ if (e == null || typeof e != "object" && typeof e != "function" || !wr.has(e))
724
710
  throw new TypeError("Expected a service provider created by provideService()");
725
711
  }
726
- function kr(t) {
727
- if (t == null || typeof t != "object" && typeof t != "function") return null;
728
- const e = Reflect.get(t, "dispose");
729
- return typeof e == "function" ? e : null;
712
+ function Er(e) {
713
+ if (e == null || typeof e != "object" && typeof e != "function") return null;
714
+ const t = Reflect.get(e, "dispose");
715
+ return typeof t == "function" ? t : null;
730
716
  }
731
- const pe = Object.freeze({
717
+ const he = Object.freeze({
732
718
  breadcrumbLabel: "Breadcrumb",
733
719
  checkboxOptionLabel: "Option",
734
- checkboxStateLabel: (t, e) => `${t}: ${e}`,
720
+ checkboxStateLabel: (e, t) => `${e}: ${t}`,
735
721
  colorOptionGrayLabel: "Gray",
736
722
  colorOptionGreenLabel: "Green",
737
723
  colorOptionIceBlueLabel: "Ice blue",
@@ -763,8 +749,8 @@ const pe = Object.freeze({
763
749
  radioOptionLabel: "Option",
764
750
  splitViewSeparatorLabel: "Resize panes",
765
751
  tabLineLabel: "Sections",
766
- tableFilterColumnLabel: (t) => `Filter ${t}`,
767
- tableSortColumnLabel: (t) => `Sort ${t}`,
752
+ tableFilterColumnLabel: (e) => `Filter ${e}`,
753
+ tableSortColumnLabel: (e) => `Sort ${e}`,
768
754
  themeOptionCapillaryLabel: "Capillary",
769
755
  themeOptionMinimalLabel: "Minimal",
770
756
  themeOptionShinyLabel: "Shiny",
@@ -773,49 +759,49 @@ const pe = Object.freeze({
773
759
  treeViewLoadError: "Unable to load tree items",
774
760
  treeViewLoading: "Loading tree items…"
775
761
  });
776
- class vt {
777
- constructor(e, r) {
762
+ class kt {
763
+ constructor(t, r) {
778
764
  c(this, "locale");
779
765
  c(this, "messages");
780
- this.locale = e, this.messages = r, Object.freeze(this);
766
+ this.locale = t, this.messages = r, Object.freeze(this);
781
767
  }
782
- message(e) {
783
- return this.messages[e];
768
+ message(t) {
769
+ return this.messages[t];
784
770
  }
785
771
  }
786
- const Sr = new vt(
772
+ const $r = new kt(
787
773
  void 0,
788
- pe
774
+ he
789
775
  );
790
- function Er(t) {
791
- if (t == null) return Sr;
792
- if (typeof t != "object" || Array.isArray(t))
776
+ function xr(e) {
777
+ if (e == null) return $r;
778
+ if (typeof e != "object" || Array.isArray(e))
793
779
  throw new TypeError("Capillary UI localization must be an object");
794
- const e = $r(t.locale), r = t.messages;
780
+ const t = Cr(e.locale), r = e.messages;
795
781
  if (r != null && (typeof r != "object" || Array.isArray(r)))
796
782
  throw new TypeError("Capillary UI localization messages must be an object");
797
- const i = { ...pe };
783
+ const i = { ...he };
798
784
  if (r != null)
799
- for (const n of Object.keys(pe)) {
785
+ for (const n of Object.keys(he)) {
800
786
  const s = r[n];
801
787
  if (s === void 0) continue;
802
- const o = pe[n];
788
+ const o = he[n];
803
789
  if (typeof s != typeof o)
804
790
  throw new TypeError(`Capillary UI localization message "${n}" has the wrong type`);
805
791
  Object.assign(i, { [n]: s });
806
792
  }
807
- return new vt(e, Object.freeze(i));
793
+ return new kt(t, Object.freeze(i));
808
794
  }
809
- function $r(t) {
810
- if (typeof t != "string" || t.trim() === "")
795
+ function Cr(e) {
796
+ if (typeof e != "string" || e.trim() === "")
811
797
  throw new TypeError("Capillary UI localization locale must be a non-empty BCP 47 language tag");
812
798
  try {
813
- return Intl.getCanonicalLocales(t)[0];
814
- } catch (e) {
815
- throw new RangeError(`Invalid Capillary UI localization locale: ${t}`, { cause: e });
799
+ return Intl.getCanonicalLocales(e)[0];
800
+ } catch (t) {
801
+ throw new RangeError(`Invalid Capillary UI localization locale: ${e}`, { cause: t });
816
802
  }
817
803
  }
818
- const xr = /* @__PURE__ */ new Set([
804
+ const zr = /* @__PURE__ */ new Set([
819
805
  "annotation-xml",
820
806
  "color-profile",
821
807
  "font-face",
@@ -825,71 +811,71 @@ const xr = /* @__PURE__ */ new Set([
825
811
  "font-face-name",
826
812
  "missing-glyph"
827
813
  ]);
828
- class kt {
829
- constructor(e = {}, r = cr()) {
814
+ class St {
815
+ constructor(t = {}, r = dr()) {
830
816
  c(this, "styleRegistry");
831
817
  c(this, "services");
832
818
  c(this, "router");
833
819
  c(this, "localization");
834
820
  c(this, "diagnosticScope");
835
821
  c(this, "routedRoots", /* @__PURE__ */ new WeakSet());
836
- if (e == null || typeof e != "object" || Array.isArray(e))
822
+ if (t == null || typeof t != "object" || Array.isArray(t))
837
823
  throw new TypeError("CapillaryUiRuntime options must be an object");
838
- if (Object.hasOwn(e, "elementNames"))
824
+ if (Object.hasOwn(t, "elementNames"))
839
825
  throw new TypeError("CapillaryUiRuntime no longer supports configurable element names");
840
- if (this.styleRegistry = r, this.diagnosticScope = e.diagnosticScope ?? Ht, this.localization = Er(e.localization), this.services = e.services ?? br(), !(this.services instanceof wt))
826
+ if (this.styleRegistry = r, this.diagnosticScope = t.diagnosticScope ?? Wt, this.localization = xr(t.localization), this.services = t.services ?? vr(), !(this.services instanceof vt))
841
827
  throw new TypeError("Capillary UI services must be a ServiceScope");
842
- if (this.router = e.router ?? null, this.router != null && (typeof this.router != "object" || typeof this.router.openScope != "function" || typeof this.router.completeScope != "function"))
828
+ if (this.router = t.router ?? null, this.router != null && (typeof this.router != "object" || typeof this.router.openScope != "function" || typeof this.router.completeScope != "function"))
843
829
  throw new TypeError("Capillary UI router must be a BrowserRouter");
844
830
  }
845
831
  /** Resolve a fixed one-hyphen public host name for a built-in component. */
846
- resolveElementName(e) {
847
- St(e, "Capillary UI component host name");
848
- const r = `cap-${e.replaceAll("-", "")}`;
849
- return Cr(r), r;
832
+ resolveElementName(t) {
833
+ Et(t, "Capillary UI component host name");
834
+ const r = `cap-${t.replaceAll("-", "")}`;
835
+ return Tr(r), r;
850
836
  }
851
- resolveHostSelector(e, r) {
852
- if (typeof e != "string") throw new TypeError("Host selector must be a string");
853
- return e.replaceAll("&", this.resolveElementName(r));
837
+ resolveHostSelector(t, r) {
838
+ if (typeof t != "string") throw new TypeError("Host selector must be a string");
839
+ return t.replaceAll("&", this.resolveElementName(r));
854
840
  }
855
- resolveHostCSS(e, r) {
856
- if (typeof e != "string") throw new TypeError("Host CSS must be a string");
857
- return e.replaceAll("&", this.resolveElementName(r));
841
+ resolveHostCSS(t, r) {
842
+ if (typeof t != "string") throw new TypeError("Host CSS must be a string");
843
+ return t.replaceAll("&", this.resolveElementName(r));
858
844
  }
859
- create(e, ...r) {
860
- const i = m.withScope(this.diagnosticScope, () => new e(...r));
845
+ create(t, ...r) {
846
+ const i = m.withScope(this.diagnosticScope, () => new t(...r));
861
847
  return i._setRuntime(this), i;
862
848
  }
863
- mount(e, r, i = null) {
864
- e._setRuntime(this);
849
+ mount(t, r, i = null) {
850
+ t._setRuntime(this);
865
851
  let n = null;
866
- this.router != null && !this.routedRoots.has(e) && (this.routedRoots.add(e), n = this.router.openScope(this.router.root, e), e.onCleanup(n));
852
+ this.router != null && !this.routedRoots.has(t) && (this.routedRoots.add(t), n = this.router.openScope(this.router.root, t), t.onCleanup(n));
867
853
  try {
868
- e.mount(r, i), this.router != null && n != null && this.router.completeScope(this.router.root, e);
854
+ t.mount(r, i), this.router != null && n != null && this.router.completeScope(this.router.root, t);
869
855
  } catch (s) {
870
856
  throw n == null || n(), s;
871
857
  }
872
- return e;
858
+ return t;
873
859
  }
874
- registerStyles(e) {
875
- if (e == null || typeof e.registerStyles != "function")
860
+ registerStyles(t) {
861
+ if (t == null || typeof t.registerStyles != "function")
876
862
  throw new TypeError("registerStyles requires a Capillary UI component dependency");
877
- return e.registerStyles(this), this;
863
+ return t.registerStyles(this), this;
878
864
  }
879
- injectStyles(e = globalThis.document) {
880
- return this.styleRegistry.injectAll(e);
865
+ injectStyles(t = globalThis.document) {
866
+ return this.styleRegistry.injectAll(t);
881
867
  }
882
868
  }
883
- const Qe = new kt({}, ur);
884
- function St(t, e) {
885
- if (typeof t != "string" || !/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(t))
886
- throw new TypeError(`${e} must be a lowercase kebab-case name`);
869
+ const Je = new St({}, pr);
870
+ function Et(e, t) {
871
+ if (typeof e != "string" || !/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(e))
872
+ throw new TypeError(`${t} must be a lowercase kebab-case name`);
887
873
  }
888
- function Cr(t) {
889
- if (St(t, "Capillary UI element name"), !t.includes("-") || xr.has(t))
890
- throw new TypeError(`Capillary UI element name must be a non-reserved name containing a hyphen: ${t}`);
874
+ function Tr(e) {
875
+ if (Et(e, "Capillary UI element name"), !e.includes("-") || zr.has(e))
876
+ throw new TypeError(`Capillary UI element name must be a non-reserved name containing a hyphen: ${e}`);
891
877
  }
892
- const ee = Symbol.for("@capillaryjs/capillary-ui.Fragment"), Tr = /* @__PURE__ */ new WeakSet(), zr = /* @__PURE__ */ new Set([
878
+ const re = Symbol.for("@capillaryjs/capillary-ui.Fragment"), Or = /* @__PURE__ */ new WeakSet(), Rr = /* @__PURE__ */ new Set([
893
879
  "allowFullScreen",
894
880
  "async",
895
881
  "autoFocus",
@@ -913,7 +899,7 @@ const ee = Symbol.for("@capillaryjs/capillary-ui.Fragment"), Tr = /* @__PURE__ *
913
899
  "required",
914
900
  "reversed",
915
901
  "selected"
916
- ]), Rr = /* @__PURE__ */ new Set([
902
+ ]), Ar = /* @__PURE__ */ new Set([
917
903
  "checked",
918
904
  "defaultChecked",
919
905
  "defaultValue",
@@ -927,13 +913,13 @@ const ee = Symbol.for("@capillaryjs/capillary-ui.Fragment"), Tr = /* @__PURE__ *
927
913
  "selectedIndex",
928
914
  "tabIndex",
929
915
  "value"
930
- ]), et = "data-cap";
931
- let C = null;
932
- function E() {
933
- C && (C.count += 1);
916
+ ]), Qe = "data-cap";
917
+ let z = null;
918
+ function $() {
919
+ z && (z.count += 1);
934
920
  }
935
- function me(t, e = null, ...r) {
936
- const i = e ?? {};
921
+ function ye(e, t = null, ...r) {
922
+ const i = t ?? {};
937
923
  if (typeof i != "object" || Array.isArray(i))
938
924
  throw new TypeError("VNode props must be an object or null");
939
925
  const {
@@ -942,19 +928,19 @@ function me(t, e = null, ...r) {
942
928
  ...o
943
929
  } = i;
944
930
  return {
945
- type: t,
931
+ type: e,
946
932
  key: s,
947
933
  props: {
948
934
  ...o,
949
- children: Et([n, r])
935
+ children: $t([n, r])
950
936
  }
951
937
  };
952
938
  }
953
- function Ar(t, ...e) {
954
- return t.reduce((r, i, n) => r + i + String(e[n] ?? ""), "");
939
+ function Lr(e, ...t) {
940
+ return e.reduce((r, i, n) => r + i + String(t[n] ?? ""), "");
955
941
  }
956
- const x = class x {
957
- constructor(e = {}) {
942
+ const C = class C {
943
+ constructor(t = {}) {
958
944
  c(this, "props");
959
945
  c(this, "dom", null);
960
946
  /** @internal */
@@ -973,51 +959,51 @@ const x = class x {
973
959
  c(this, "renderReadSubscriptions", /* @__PURE__ */ new Map());
974
960
  c(this, "collectingRenderReads", null);
975
961
  /** @internal */
976
- c(this, "_runtime", Qe);
962
+ c(this, "_runtime", Je);
977
963
  /** @internal Route lineage inherited by nested routed components. */
978
964
  c(this, "_routeContext", null);
979
965
  /** JSX component for this instance's runtime-configured custom host. */
980
966
  c(this, "Host", ({
981
- children: e = [],
967
+ children: t = [],
982
968
  ...r
983
- }) => this.host(r, e));
984
- if (e == null || typeof e != "object" || Array.isArray(e))
969
+ }) => this.host(r, t));
970
+ if (t == null || typeof t != "object" || Array.isArray(t))
985
971
  throw new TypeError(`${this.constructor.name} props must be an object`);
986
- this.props = e;
972
+ this.props = t;
987
973
  }
988
- static new(...e) {
989
- const r = new this(...e);
990
- if (!(r instanceof x))
974
+ static new(...t) {
975
+ const r = new this(...t);
976
+ if (!(r instanceof C))
991
977
  throw new TypeError("Component.new() requires a Component constructor");
992
978
  return r.mount();
993
979
  }
994
- static registerStyles(e = Qe, r = /* @__PURE__ */ new Set()) {
980
+ static registerStyles(t = Je, r = /* @__PURE__ */ new Set()) {
995
981
  if (r.has(this)) return;
996
982
  r.add(this);
997
- const i = this.hostName ?? null, n = Wr(this);
983
+ const i = this.hostName ?? null, n = Gr(this);
998
984
  for (const s of n)
999
- Object.hasOwn(s, "css") && s.css && (i == null ? e.styleRegistry.registerCSS(s.css) : e.styleRegistry.registerHostCSS(
985
+ Object.hasOwn(s, "css") && s.css && (i == null ? t.styleRegistry.registerCSS(s.css) : t.styleRegistry.registerHostCSS(
1000
986
  s.css,
1001
- e.resolveElementName(i)
987
+ t.resolveElementName(i)
1002
988
  ));
1003
989
  for (const s of n)
1004
990
  if (Object.hasOwn(s, "dependencies"))
1005
991
  for (const o of s.dependencies ?? [])
1006
- o.registerStyles(e, r);
992
+ o.registerStyles(t, r);
1007
993
  }
1008
994
  get diagnosticScope() {
1009
- var e;
1010
- return this.constructor.diagnosticScope ?? ((e = this._parentComponent) == null ? void 0 : e.diagnosticScope) ?? this._runtime.diagnosticScope;
995
+ var t;
996
+ return this.constructor.diagnosticScope ?? ((t = this._parentComponent) == null ? void 0 : t.diagnosticScope) ?? this._runtime.diagnosticScope;
1011
997
  }
1012
998
  /** Stable instance label, captured when this component is first observed. */
1013
999
  get diagnosticLabel() {
1014
- const e = this.constructor;
1015
- return e.diagnosticLabel ?? e.hostName ?? e.name;
1000
+ const t = this.constructor;
1001
+ return t.diagnosticLabel ?? t.hostName ?? t.name;
1016
1002
  }
1017
- [Vt]() {
1003
+ [Yt]() {
1018
1004
  return {
1019
1005
  kind: "component",
1020
- label: _(this),
1006
+ label: B(this),
1021
1007
  scope: this.diagnosticScope,
1022
1008
  sources: [...this.watched.keys(), ...this.renderReadSubscriptions.keys()],
1023
1009
  targets: [...this._childComponents]
@@ -1030,7 +1016,7 @@ const x = class x {
1030
1016
  throw new Error(`${this.constructor.name} must implement render()`);
1031
1017
  }
1032
1018
  /** Render this component's configured custom host element. */
1033
- host(e = null, ...r) {
1019
+ host(t = null, ...r) {
1034
1020
  const i = this.constructor, n = i.hostName;
1035
1021
  if (n == null)
1036
1022
  throw new Error(`${this.constructor.name} does not declare a custom host name`);
@@ -1038,8 +1024,8 @@ const x = class x {
1038
1024
  class: s,
1039
1025
  className: o,
1040
1026
  ...a
1041
- } = e ?? {}, l = o ?? s, u = this.props.island === !0 ? Yr(l, "island") : l;
1042
- return me(this._runtime.resolveElementName(n), {
1027
+ } = t ?? {}, l = o ?? s, u = this.props.island === !0 ? Xr(l, "island") : l;
1028
+ return ye(this._runtime.resolveElementName(n), {
1043
1029
  ...a,
1044
1030
  ...u == null ? {} : { className: u },
1045
1031
  "data-cap-component": n,
@@ -1047,54 +1033,54 @@ const x = class x {
1047
1033
  }, ...r);
1048
1034
  }
1049
1035
  /** @internal Assign an immutable application runtime before initialization or mounting. */
1050
- _setRuntime(e) {
1036
+ _setRuntime(t) {
1051
1037
  var r;
1052
- if (!(e instanceof kt))
1038
+ if (!(t instanceof St))
1053
1039
  throw new TypeError("Component runtime must be a CapillaryUiRuntime");
1054
- if (e === this._runtime) return this;
1040
+ if (t === this._runtime) return this;
1055
1041
  if (this.initialized || this.mounted || this._rendered != null)
1056
1042
  throw new Error("Cannot change a component runtime after initialization");
1057
- return this._runtime = e, this._routeContext == null && (this._routeContext = ((r = e.router) == null ? void 0 : r.root) ?? null), this;
1043
+ return this._runtime = t, this._routeContext == null && (this._routeContext = ((r = t.router) == null ? void 0 : r.root) ?? null), this;
1058
1044
  }
1059
1045
  /** @internal Assign contextual route lineage before initialization. */
1060
- _setRouteContext(e) {
1046
+ _setRouteContext(t) {
1061
1047
  if (this.initialized || this.mounted || this._rendered != null)
1062
1048
  throw new Error("Cannot change a component route context after initialization");
1063
- return this._routeContext = e, this;
1049
+ return this._routeContext = t, this;
1064
1050
  }
1065
1051
  /** @internal Route lineage inherited by component children. */
1066
1052
  _routeContextForChildren() {
1067
1053
  return this._routeContext;
1068
1054
  }
1069
1055
  /** @internal Assign the renderer-owned component ancestry. */
1070
- _setParentComponent(e) {
1071
- if (this._parentComponent != null && this._parentComponent !== e)
1056
+ _setParentComponent(t) {
1057
+ if (this._parentComponent != null && this._parentComponent !== t)
1072
1058
  throw new Error("A component instance cannot move between component owners");
1073
- return this._parentComponent = e, this.validateIslandAncestry(this.props), this;
1059
+ return this._parentComponent = t, this.validateIslandAncestry(this.props), this;
1074
1060
  }
1075
- mount(e = null, r = null) {
1061
+ mount(t = null, r = null) {
1076
1062
  if (this.destroyed) throw new Error("Cannot mount a destroyed component");
1077
1063
  this.validateIslandAncestry(this.props);
1078
1064
  let i = !1;
1079
- return this.initialized || (this.validateRequiredServices(), this.initialized = !0, m.withScope(this.diagnosticScope, () => this.initialize())), this.mounted || (this.mounted = !0, this.update(), i = !0), e != null && (Vr(e), Fe(e, this._rendered, r)), i && this.afterMount(this.dom), this;
1065
+ return this.initialized || (this.validateRequiredServices(), this.initialized = !0, m.withScope(this.diagnosticScope, () => this.initialize())), this.mounted || (this.mounted = !0, this.update(), i = !0), t != null && (Yr(t), qe(t, this._rendered, r)), i && this.afterMount(this.dom), this;
1080
1066
  }
1081
- attachTo(e) {
1082
- return this.mount(e), this;
1067
+ attachTo(t) {
1068
+ return this.mount(t), this;
1083
1069
  }
1084
- update(e, r = e instanceof Ge ? "dependency" : "explicit") {
1070
+ update(t, r = t instanceof Ye ? "dependency" : "explicit") {
1085
1071
  if (this.destroyed) return this;
1086
1072
  if (!this.mounted) return this.mount();
1087
1073
  if (this.updating)
1088
1074
  return this.updateRequested = !0, this;
1089
1075
  this.updating = !0;
1090
1076
  const i = m.event(this, "consumer", {
1091
- parent: e instanceof Ge ? e : m.currentEvent,
1077
+ parent: t instanceof Ye ? t : m.currentEvent,
1092
1078
  cause: "component render",
1093
1079
  outcome: "started",
1094
1080
  consumer: { trigger: r }
1095
- }), n = C, s = i ? { count: 0 } : null;
1081
+ }), n = z, s = i ? { count: 0 } : null;
1096
1082
  let o = 0;
1097
- C = s;
1083
+ z = s;
1098
1084
  try {
1099
1085
  m.withEvent(i, () => {
1100
1086
  do {
@@ -1103,7 +1089,7 @@ const x = class x {
1103
1089
  this.collectingRenderReads = a;
1104
1090
  let l;
1105
1091
  try {
1106
- l = m.withScope(this.diagnosticScope, () => J(this.render()));
1092
+ l = m.withScope(this.diagnosticScope, () => ee(this.render()));
1107
1093
  } finally {
1108
1094
  this.collectingRenderReads = null;
1109
1095
  }
@@ -1124,25 +1110,25 @@ const x = class x {
1124
1110
  consumer: { trigger: r, domWrites: s.count, renderPasses: o }
1125
1111
  }), a;
1126
1112
  } finally {
1127
- C = n, this.updating = !1;
1113
+ z = n, this.updating = !1;
1128
1114
  }
1129
1115
  return this;
1130
1116
  }
1131
- setProps(e) {
1117
+ setProps(t) {
1132
1118
  var r, i;
1133
- if (e == null || typeof e != "object" || Array.isArray(e))
1119
+ if (t == null || typeof t != "object" || Array.isArray(t))
1134
1120
  throw new TypeError(`${this.constructor.name} props must be an object`);
1135
- return this.validateIslandAncestry(e), this.props = e, this.mounted && this.update(
1121
+ return this.validateIslandAncestry(t), this.props = t, this.mounted && this.update(
1136
1122
  void 0,
1137
1123
  ((i = (r = m.currentEvent) == null ? void 0 : r.diagnostic) == null ? void 0 : i.node.kind) === "binding" ? "dependency" : "parent"
1138
1124
  ), this;
1139
1125
  }
1140
- afterMount(e) {
1126
+ afterMount(t) {
1141
1127
  }
1142
- afterUpdate(e) {
1128
+ afterUpdate(t) {
1143
1129
  }
1144
- watch(...e) {
1145
- for (const r of e) {
1130
+ watch(...t) {
1131
+ for (const r of t) {
1146
1132
  if (r == null || typeof r.subscribe != "function")
1147
1133
  throw new TypeError("watch requires emitter-like values");
1148
1134
  if (this.watched.has(r)) continue;
@@ -1155,61 +1141,61 @@ const x = class x {
1155
1141
  }
1156
1142
  return this;
1157
1143
  }
1158
- watchFutureValues(...e) {
1159
- return this.watch(...e);
1144
+ watchFutureValues(...t) {
1145
+ return this.watch(...t);
1160
1146
  }
1161
1147
  /** Read an emitter during render and rerender when that dependency changes. */
1162
- read(e) {
1163
- return this.trackRenderRead(e), e.get();
1148
+ read(t) {
1149
+ return this.trackRenderRead(t), t.get();
1164
1150
  }
1165
1151
  /** Read a Capillary value, fetch state, and error as one tracked render dependency. */
1166
- snapshot(e) {
1167
- return this.trackRenderRead(e), Object.freeze({
1168
- value: e.get(),
1169
- fetchState: e.getFetchState(),
1170
- error: e.getError()
1152
+ snapshot(t) {
1153
+ return this.trackRenderRead(t), Object.freeze({
1154
+ value: t.get(),
1155
+ fetchState: t.getFetchState(),
1156
+ error: t.getError()
1171
1157
  });
1172
1158
  }
1173
- onCleanup(e) {
1174
- if (typeof e != "function") throw new TypeError("cleanup must be a function");
1159
+ onCleanup(t) {
1160
+ if (typeof t != "function") throw new TypeError("cleanup must be a function");
1175
1161
  if (this.destroyed)
1176
- return e(), () => {
1162
+ return t(), () => {
1177
1163
  };
1178
- this.cleanupFunctions.add(e);
1164
+ this.cleanupFunctions.add(t);
1179
1165
  let r = !0;
1180
1166
  return () => {
1181
- r && (r = !1, this.cleanupFunctions.delete(e), e());
1167
+ r && (r = !1, this.cleanupFunctions.delete(t), t());
1182
1168
  };
1183
1169
  }
1184
1170
  /** Resolve one explicitly declared application service from this component's runtime. */
1185
- requireService(e) {
1171
+ requireService(t) {
1186
1172
  if (!this.initialized)
1187
1173
  throw new Error("Components may resolve services during initialize() or later");
1188
1174
  const r = this.constructor;
1189
- if (!r.requiredServices.includes(e))
1175
+ if (!r.requiredServices.includes(t))
1190
1176
  throw new Error(
1191
- `${r.name} must declare service "${e.name}" in requiredServices`
1177
+ `${r.name} must declare service "${t.name}" in requiredServices`
1192
1178
  );
1193
- return this._runtime.services.require(e);
1179
+ return this._runtime.services.require(t);
1194
1180
  }
1195
1181
  /** Read the immutable Capillary UI localization selected for this component's runtime. */
1196
1182
  get localization() {
1197
1183
  return this._runtime.localization;
1198
1184
  }
1199
1185
  /** Resolve one Capillary UI-authored message with the runtime's English fallback. */
1200
- capillaryUiMessage(e) {
1201
- return this.localization.message(e);
1186
+ capillaryUiMessage(t) {
1187
+ return this.localization.message(t);
1202
1188
  }
1203
- listen(e, r, i, n) {
1204
- if (e == null || typeof e.addEventListener != "function")
1189
+ listen(t, r, i, n) {
1190
+ if (t == null || typeof t.addEventListener != "function")
1205
1191
  throw new TypeError("listen target must be an EventTarget");
1206
1192
  const s = {};
1207
1193
  m.configure(s, {
1208
1194
  kind: "interaction",
1209
- label: `${_(this)}: ${r}`,
1195
+ label: `${B(this)}: ${r}`,
1210
1196
  scope: this.diagnosticScope
1211
1197
  });
1212
- const o = (a) => ge(
1198
+ const o = (a) => be(
1213
1199
  s,
1214
1200
  this.diagnosticScope,
1215
1201
  a,
@@ -1217,8 +1203,8 @@ const x = class x {
1217
1203
  r,
1218
1204
  () => i(a)
1219
1205
  );
1220
- return e.addEventListener(r, o, n), this.onCleanup(() => {
1221
- e.removeEventListener(r, o, n), m.dispose(s);
1206
+ return t.addEventListener(r, o, n), this.onCleanup(() => {
1207
+ t.removeEventListener(r, o, n), m.dispose(s);
1222
1208
  }), this;
1223
1209
  }
1224
1210
  /**
@@ -1229,16 +1215,16 @@ const x = class x {
1229
1215
  * runs through the same traced native-event coalescing as listen(), and
1230
1216
  * is removed on destroy if it is still attached.
1231
1217
  */
1232
- listenWhile(e, r, i, n) {
1233
- if (e == null || typeof e.addEventListener != "function")
1218
+ listenWhile(t, r, i, n) {
1219
+ if (t == null || typeof t.addEventListener != "function")
1234
1220
  throw new TypeError("listen target must be an EventTarget");
1235
1221
  const s = {};
1236
1222
  m.configure(s, {
1237
1223
  kind: "interaction",
1238
- label: `${_(this)}: ${r}`,
1224
+ label: `${B(this)}: ${r}`,
1239
1225
  scope: this.diagnosticScope
1240
1226
  });
1241
- const o = (d) => ge(
1227
+ const o = (d) => be(
1242
1228
  s,
1243
1229
  this.diagnosticScope,
1244
1230
  d,
@@ -1248,57 +1234,57 @@ const x = class x {
1248
1234
  );
1249
1235
  let a = !1;
1250
1236
  const l = () => {
1251
- a && (a = !1, e.removeEventListener(r, o, n), m.dispose(s));
1237
+ a && (a = !1, t.removeEventListener(r, o, n), m.dispose(s));
1252
1238
  }, u = this.onCleanup(l);
1253
- return this.destroyed || (a = !0, e.addEventListener(r, o, n)), u;
1239
+ return this.destroyed || (a = !0, t.addEventListener(r, o, n)), u;
1254
1240
  }
1255
- registerChild(e) {
1256
- if (!(e instanceof x))
1241
+ registerChild(t) {
1242
+ if (!(t instanceof C))
1257
1243
  throw new TypeError("registerChild requires a Component");
1258
- return this._childComponents.add(e), m.active && m.inspect(this), e;
1244
+ return this._childComponents.add(t), m.active && m.inspect(this), t;
1259
1245
  }
1260
1246
  destroy() {
1261
1247
  if (!this.destroyed) {
1262
1248
  this.destroyed = !0, this.mounted = !1, m.dispose(this);
1263
- for (const e of [...this.cleanupFunctions]) e();
1249
+ for (const t of [...this.cleanupFunctions]) t();
1264
1250
  this.cleanupFunctions.clear(), this.watched.clear();
1265
- for (const e of this.renderReadSubscriptions.values()) e();
1251
+ for (const t of this.renderReadSubscriptions.values()) t();
1266
1252
  this.renderReadSubscriptions.clear(), this.collectingRenderReads = null, this._rendered && M(this._rendered, !0), this._rendered = null, this.dom = null, this._childComponents.clear(), this.onDestroy();
1267
1253
  }
1268
1254
  }
1269
1255
  validateRequiredServices() {
1270
- const e = this.constructor;
1271
- for (const r of e.requiredServices)
1256
+ const t = this.constructor;
1257
+ for (const r of t.requiredServices)
1272
1258
  if (!this._runtime.services.has(r))
1273
- throw new Error(`${e.name} requires unregistered service "${r.name}"`);
1259
+ throw new Error(`${t.name} requires unregistered service "${r.name}"`);
1274
1260
  }
1275
- validateIslandAncestry(e) {
1276
- if (!Oe(e)) return;
1261
+ validateIslandAncestry(t) {
1262
+ if (!Le(t)) return;
1277
1263
  if (this.hasIslandDescendant())
1278
1264
  throw new Error("An island component cannot contain another island");
1279
1265
  let r = this._parentComponent;
1280
1266
  for (; r != null; ) {
1281
- if (Oe(r.props))
1267
+ if (Le(r.props))
1282
1268
  throw new Error("An island component cannot be nested inside another island");
1283
1269
  r = r._parentComponent;
1284
1270
  }
1285
1271
  }
1286
1272
  hasIslandDescendant() {
1287
- for (const e of this._childComponents)
1288
- if (Oe(e.props) || e.hasIslandDescendant()) return !0;
1273
+ for (const t of this._childComponents)
1274
+ if (Le(t.props) || t.hasIslandDescendant()) return !0;
1289
1275
  return !1;
1290
1276
  }
1291
1277
  onDestroy() {
1292
1278
  }
1293
- trackRenderRead(e) {
1294
- if (Mt(e, "Component.read"), this.collectingRenderReads == null)
1279
+ trackRenderRead(t) {
1280
+ if (Dt(t, "Component.read"), this.collectingRenderReads == null)
1295
1281
  throw new Error("Component.read() and snapshot() may only be called during render()");
1296
- this.collectingRenderReads.add(e);
1282
+ this.collectingRenderReads.add(t);
1297
1283
  }
1298
- reconcileRenderReads(e) {
1284
+ reconcileRenderReads(t) {
1299
1285
  for (const [r, i] of this.renderReadSubscriptions)
1300
- e.has(r) || (i(), this.renderReadSubscriptions.delete(r));
1301
- for (const r of e) {
1286
+ t.has(r) || (i(), this.renderReadSubscriptions.delete(r));
1287
+ for (const r of t) {
1302
1288
  if (this.watched.has(r) || this.renderReadSubscriptions.has(r)) continue;
1303
1289
  const i = r.subscribe(({ event: n }) => {
1304
1290
  this.mounted && !this.destroyed && this.update(n);
@@ -1307,8 +1293,8 @@ const x = class x {
1307
1293
  }
1308
1294
  }
1309
1295
  };
1310
- c(x, "dependencies", []), c(x, "requiredServices", []), /** Component `live()` bindings are opt-in; subclasses declare their allowlist. */
1311
- c(x, "liveProps", []), c(x, "css", Ar`
1296
+ c(C, "dependencies", []), c(C, "requiredServices", []), /** Component `live()` bindings are opt-in; subclasses declare their allowlist. */
1297
+ c(C, "liveProps", []), c(C, "css", Lr`
1312
1298
  .cap-fill-horizontal,
1313
1299
  .cap-fill-vertical {
1314
1300
  box-sizing: border-box;
@@ -1455,71 +1441,71 @@ c(x, "liveProps", []), c(x, "css", Ar`
1455
1441
  label[data-cap] {
1456
1442
  user-select: none;
1457
1443
  }
1458
- `), c(x, "hostName", null), /** Override for a diagnostic-tool subtree; ordinary components inherit their owner/runtime. */
1459
- c(x, "diagnosticScope", null), /** Optional stable display name for bundled application components. Built-ins use their host name. */
1460
- c(x, "diagnosticLabel", null), /** Optional host-level data surface marker for parent composition. */
1461
- c(x, "dataSurface", null);
1462
- let T = x;
1463
- function J(t) {
1464
- return Array.isArray(t) ? me(ee, null, t) : t == null || typeof t == "boolean" ? me(ee) : t;
1444
+ `), c(C, "hostName", null), /** Override for a diagnostic-tool subtree; ordinary components inherit their owner/runtime. */
1445
+ c(C, "diagnosticScope", null), /** Optional stable display name for bundled application components. Built-ins use their host name. */
1446
+ c(C, "diagnosticLabel", null), /** Optional host-level data surface marker for parent composition. */
1447
+ c(C, "dataSurface", null);
1448
+ let O = C;
1449
+ function ee(e) {
1450
+ return Array.isArray(e) ? ye(re, null, e) : e == null || typeof e == "boolean" ? ye(re) : e;
1465
1451
  }
1466
- function Et(t) {
1467
- const e = [], r = (i) => {
1452
+ function $t(e) {
1453
+ const t = [], r = (i) => {
1468
1454
  if (Array.isArray(i))
1469
1455
  for (const n of i) r(n);
1470
- else i != null && typeof i != "boolean" && e.push(i);
1456
+ else i != null && typeof i != "boolean" && t.push(i);
1471
1457
  };
1472
- return r(t), e;
1458
+ return r(e), t;
1473
1459
  }
1474
- function te(t, e) {
1475
- if (typeof t == "string" || typeof t == "number")
1460
+ function ie(e, t) {
1461
+ if (typeof e == "string" || typeof e == "number")
1476
1462
  return {
1477
1463
  kind: "text",
1478
1464
  key: null,
1479
- value: t,
1480
- node: document.createTextNode(String(t)),
1481
- owner: e
1465
+ value: e,
1466
+ node: document.createTextNode(String(e)),
1467
+ owner: t
1482
1468
  };
1483
- if (Se(t)) {
1484
- const s = document.createComment("cap-emitter-start"), o = document.createComment("cap-emitter-end"), a = t.get();
1485
- if (Object.is(a, t))
1469
+ if (Ee(e)) {
1470
+ const s = document.createComment("cap-emitter-start"), o = document.createComment("cap-emitter-end"), a = e.get();
1471
+ if (Object.is(a, e))
1486
1472
  throw new TypeError("A Capillary UI emitter child cannot render itself");
1487
1473
  const l = document.createDocumentFragment();
1488
- l.append(s, o), E(), E();
1489
- const u = te(J(a), e);
1490
- Fe(l, u, o);
1474
+ l.append(s, o), $(), $();
1475
+ const u = ie(ee(a), t);
1476
+ qe(l, u, o);
1491
1477
  const d = {
1492
1478
  kind: "emitter",
1493
1479
  key: null,
1494
- source: t,
1480
+ source: e,
1495
1481
  start: s,
1496
1482
  end: o,
1497
1483
  child: u,
1498
1484
  unsubscribe: () => {
1499
1485
  },
1500
- owner: e
1486
+ owner: t
1501
1487
  };
1502
- return d.unsubscribe = ke(t, d, e, "reactive child", (h) => {
1503
- if (Object.is(h, t))
1488
+ return d.unsubscribe = Se(e, d, t, "reactive child", (p) => {
1489
+ if (Object.is(p, e))
1504
1490
  throw new TypeError("A Capillary UI emitter child cannot render itself");
1505
- d.child = Ie(d.child, J(h), e);
1491
+ d.child = Ie(d.child, ee(p), t);
1506
1492
  }), d;
1507
1493
  }
1508
- if (t instanceof T)
1509
- return t._setRuntime(e._runtime), t._setRouteContext(e._routeContextForChildren()), t._setParentComponent(e), t.mount(), e.registerChild(t), {
1494
+ if (e instanceof O)
1495
+ return e._setRuntime(t._runtime), e._setRouteContext(t._routeContextForChildren()), e._setParentComponent(t), e.mount(), t.registerChild(e), {
1510
1496
  kind: "component",
1511
- key: Ot(t.props),
1512
- type: t.constructor,
1513
- instance: t,
1497
+ key: Lt(e.props),
1498
+ type: e.constructor,
1499
+ instance: e,
1514
1500
  prebuilt: !0,
1515
- props: t.props,
1501
+ props: e.props,
1516
1502
  liveProps: /* @__PURE__ */ new Map(),
1517
- owner: e
1503
+ owner: t
1518
1504
  };
1519
- if (!O(t))
1520
- throw new TypeError(`Invalid Capillary UI child: ${st(t)}`);
1521
- const { type: r, key: i = null, props: n } = t;
1522
- if (r === ee) {
1505
+ if (!A(e))
1506
+ throw new TypeError(`Invalid Capillary UI child: ${nt(e)}`);
1507
+ const { type: r, key: i = null, props: n } = e;
1508
+ if (r === re) {
1523
1509
  const s = document.createComment("cap-fragment-start"), o = document.createComment("cap-fragment-end"), a = {
1524
1510
  kind: "fragment",
1525
1511
  key: i,
@@ -1527,13 +1513,13 @@ function te(t, e) {
1527
1513
  start: s,
1528
1514
  end: o,
1529
1515
  children: [],
1530
- owner: e
1516
+ owner: t
1531
1517
  }, l = document.createDocumentFragment();
1532
- return l.append(s, o), E(), E(), a.children = ye(
1518
+ return l.append(s, o), $(), $(), a.children = ge(
1533
1519
  l,
1534
1520
  [],
1535
1521
  n.children,
1536
- e,
1522
+ t,
1537
1523
  o,
1538
1524
  s
1539
1525
  ), a;
@@ -1550,18 +1536,18 @@ function te(t, e) {
1550
1536
  nativeBindings: /* @__PURE__ */ new Map(),
1551
1537
  ref: null,
1552
1538
  children: [],
1553
- owner: e
1539
+ owner: t
1554
1540
  };
1555
- return zt(o, n), o.children = ye(s, [], n.children, e), o;
1541
+ return Ot(o, n), o.children = ge(s, [], n.children, t), o;
1556
1542
  }
1557
- if (Lt(r)) {
1543
+ if (Mt(r)) {
1558
1544
  const s = n;
1559
- Ct(r, s);
1560
- const o = tt(s), a = m.withScope(
1561
- r.diagnosticScope ?? e.diagnosticScope,
1545
+ zt(r, s);
1546
+ const o = et(s), a = m.withScope(
1547
+ r.diagnosticScope ?? t.diagnosticScope,
1562
1548
  () => new r(o)
1563
1549
  );
1564
- a._setRuntime(e._runtime), a._setRouteContext(e._routeContextForChildren()), a._setParentComponent(e);
1550
+ a._setRuntime(t._runtime), a._setRouteContext(t._routeContextForChildren()), a._setParentComponent(t);
1565
1551
  const l = {
1566
1552
  kind: "component",
1567
1553
  key: i,
@@ -1570,19 +1556,19 @@ function te(t, e) {
1570
1556
  prebuilt: !1,
1571
1557
  props: o,
1572
1558
  liveProps: /* @__PURE__ */ new Map(),
1573
- owner: e
1559
+ owner: t
1574
1560
  };
1575
- return xt(l, s), a.mount(), e.registerChild(a), l;
1561
+ return Ct(l, s), a.mount(), t.registerChild(a), l;
1576
1562
  }
1577
1563
  if (typeof r == "function") {
1578
- const s = r, o = n, a = tt(o), l = s === Reflect.get(e, "Host") ? null : {};
1564
+ const s = r, o = n, a = et(o), l = s === Reflect.get(t, "Host") ? null : {};
1579
1565
  l && m.configure(l, {
1580
1566
  kind: "component",
1581
1567
  label: String(Reflect.get(s, "diagnosticLabel") ?? s.name ?? "Function component"),
1582
- scope: e.diagnosticScope,
1583
- sources: [e]
1568
+ scope: t.diagnosticScope,
1569
+ sources: [t]
1584
1570
  });
1585
- const u = Tt(l, () => te(J(s(a)), e)), d = {
1571
+ const u = Tt(l, () => ie(ee(s(a)), t)), d = {
1586
1572
  kind: "function",
1587
1573
  key: i,
1588
1574
  type: s,
@@ -1591,200 +1577,200 @@ function te(t, e) {
1591
1577
  liveProps: /* @__PURE__ */ new Map(),
1592
1578
  child: u,
1593
1579
  diagnosticSubject: l,
1594
- owner: e
1580
+ owner: t
1595
1581
  };
1596
- return jr(d), d;
1582
+ return Mr(d), d;
1597
1583
  }
1598
- throw new TypeError(`Unsupported vnode type: ${st(r)}`);
1584
+ throw new TypeError(`Unsupported vnode type: ${nt(r)}`);
1599
1585
  }
1600
- function Ie(t, e, r) {
1601
- if (t == null) return te(e, r);
1602
- if (jt(t, e)) return $t(t, e, r);
1603
- const i = te(e, r), n = At(t), s = (n == null ? void 0 : n.parentNode) ?? null;
1604
- return s && Fe(s, i, n), M(t, !0), i;
1586
+ function Ie(e, t, r) {
1587
+ if (e == null) return ie(t, r);
1588
+ if (jt(e, t)) return xt(e, t, r);
1589
+ const i = ie(t, r), n = At(e), s = (n == null ? void 0 : n.parentNode) ?? null;
1590
+ return s && qe(s, i, n), M(e, !0), i;
1605
1591
  }
1606
- function $t(t, e, r) {
1607
- return t.kind === "text" ? (typeof e != "string" && typeof e != "number" || Object.is(t.value, e) || (t.value = e, t.node.data = String(e), E()), t) : t.kind === "emitter" ? (!Se(e) || t.source !== e, t) : t.kind === "component" ? (e instanceof T || O(e) && Or(t, e.props), t) : O(e) ? t.kind === "function" ? (Lr(t, e.props), t) : t.kind === "fragment" ? (t.children = ye(
1608
- t.start.parentNode,
1609
- t.children,
1610
- e.props.children,
1592
+ function xt(e, t, r) {
1593
+ return e.kind === "text" ? (typeof t != "string" && typeof t != "number" || Object.is(e.value, t) || (e.value = t, e.node.data = String(t), $()), e) : e.kind === "emitter" ? (!Ee(t) || e.source !== t, e) : e.kind === "component" ? (t instanceof O || A(t) && jr(e, t.props), e) : A(t) ? e.kind === "function" ? (Dr(e, t.props), e) : e.kind === "fragment" ? (e.children = ge(
1594
+ e.start.parentNode,
1595
+ e.children,
1596
+ t.props.children,
1611
1597
  r,
1612
- t.end,
1613
- t.start
1614
- ), t) : (zt(t, e.props), t.children = ye(
1615
- t.node,
1616
- t.children,
1617
- e.props.children,
1598
+ e.end,
1599
+ e.start
1600
+ ), e) : (Ot(e, t.props), e.children = ge(
1601
+ e.node,
1602
+ e.children,
1603
+ t.props.children,
1618
1604
  r
1619
- ), t) : t;
1605
+ ), e) : e;
1620
1606
  }
1621
- function tt(t) {
1622
- return Object.fromEntries(Object.entries(t).map(([e, r]) => [
1623
- e,
1624
- q(r) ? r.emitter.get() : r
1607
+ function et(e) {
1608
+ return Object.fromEntries(Object.entries(e).map(([t, r]) => [
1609
+ t,
1610
+ U(r) ? r.emitter.get() : r
1625
1611
  ]));
1626
1612
  }
1627
- function xt(t, e) {
1628
- _e(t.liveProps, e, t.instance, _(t.instance), (r, i) => {
1629
- t.props = { ...t.props, [r]: i }, t.instance.setProps(t.props);
1630
- }), t.props = Be(t.liveProps, e), t.instance.setProps(t.props);
1613
+ function Ct(e, t) {
1614
+ _e(e.liveProps, t, e.instance, B(e.instance), (r, i) => {
1615
+ e.props = { ...e.props, [r]: i }, e.instance.setProps(e.props);
1616
+ }), e.props = Be(e.liveProps, t), e.instance.setProps(e.props);
1631
1617
  }
1632
- function Or(t, e) {
1633
- Ct(t.type, e), xt(t, e);
1618
+ function jr(e, t) {
1619
+ zt(e.type, t), Ct(e, t);
1634
1620
  }
1635
- function Ct(t, e) {
1636
- const r = Reflect.get(t, "liveProps");
1621
+ function zt(e, t) {
1622
+ const r = Reflect.get(e, "liveProps");
1637
1623
  if (r == null) return;
1638
1624
  if (!Array.isArray(r) || r.some((n) => typeof n != "string"))
1639
- throw new TypeError(`${t.name || "Component"}.liveProps must be an array`);
1625
+ throw new TypeError(`${e.name || "Component"}.liveProps must be an array`);
1640
1626
  const i = new Set(r);
1641
- for (const [n, s] of Object.entries(e))
1642
- if (q(s) && !i.has(n))
1627
+ for (const [n, s] of Object.entries(t))
1628
+ if (U(s) && !i.has(n))
1643
1629
  throw new TypeError(
1644
- `${t.name || "Component"} prop "${n}" does not support live()`
1630
+ `${e.name || "Component"} prop "${n}" does not support live()`
1645
1631
  );
1646
1632
  }
1647
- function jr(t) {
1648
- _e(t.liveProps, t.sourceProps, t.owner, t.type.diagnosticLabel ?? t.type.name, (e, r) => {
1649
- t.props = { ...t.props, [e]: r }, Me(t, "dependency");
1650
- }), t.props = Be(t.liveProps, t.sourceProps);
1651
- }
1652
- function Lr(t, e) {
1653
- t.sourceProps = e, _e(t.liveProps, e, t.owner, t.type.diagnosticLabel ?? t.type.name, (r, i) => {
1654
- t.props = { ...t.props, [r]: i }, Me(t, "dependency");
1655
- }), t.props = Be(t.liveProps, e), Me(t);
1656
- }
1657
- function Me(t, e = "parent") {
1658
- Tt(t.diagnosticSubject, () => {
1659
- const r = J(t.type(t.props));
1660
- t.child = Ie(t.child, r, t.owner);
1661
- }, e);
1662
- }
1663
- function Tt(t, e, r = "parent") {
1664
- if (!t) return e();
1665
- const i = m.event(t, "consumer", { cause: "function component render", outcome: "started", consumer: { trigger: r } }), n = C, s = i ? { count: 0 } : null;
1666
- C = s;
1633
+ function Mr(e) {
1634
+ _e(e.liveProps, e.sourceProps, e.owner, e.type.diagnosticLabel ?? e.type.name, (t, r) => {
1635
+ e.props = { ...e.props, [t]: r }, De(e, "dependency");
1636
+ }), e.props = Be(e.liveProps, e.sourceProps);
1637
+ }
1638
+ function Dr(e, t) {
1639
+ e.sourceProps = t, _e(e.liveProps, t, e.owner, e.type.diagnosticLabel ?? e.type.name, (r, i) => {
1640
+ e.props = { ...e.props, [r]: i }, De(e, "dependency");
1641
+ }), e.props = Be(e.liveProps, t), De(e);
1642
+ }
1643
+ function De(e, t = "parent") {
1644
+ Tt(e.diagnosticSubject, () => {
1645
+ const r = ee(e.type(e.props));
1646
+ e.child = Ie(e.child, r, e.owner);
1647
+ }, t);
1648
+ }
1649
+ function Tt(e, t, r = "parent") {
1650
+ if (!e) return t();
1651
+ const i = m.event(e, "consumer", { cause: "function component render", outcome: "started", consumer: { trigger: r } }), n = z, s = i ? { count: 0 } : null;
1652
+ z = s;
1667
1653
  try {
1668
- const o = i ? m.withEvent(i, e) : e();
1669
- return i && m.event(t, "consumer", { parent: i, cause: "function component rendered", outcome: "succeeded", consumer: { trigger: r, domWrites: s.count, renderPasses: 1 } }), o;
1654
+ const o = i ? m.withEvent(i, t) : t();
1655
+ return i && m.event(e, "consumer", { parent: i, cause: "function component rendered", outcome: "succeeded", consumer: { trigger: r, domWrites: s.count, renderPasses: 1 } }), o;
1670
1656
  } catch (o) {
1671
- throw i && m.event(t, "consumer", { parent: i, cause: "function component failed", outcome: "failed", error: o, consumer: { trigger: r, domWrites: s.count, renderPasses: 1 } }), o;
1657
+ throw i && m.event(e, "consumer", { parent: i, cause: "function component failed", outcome: "failed", error: o, consumer: { trigger: r, domWrites: s.count, renderPasses: 1 } }), o;
1672
1658
  } finally {
1673
- C = n;
1659
+ z = n;
1674
1660
  }
1675
1661
  }
1676
- function _e(t, e, r, i, n) {
1677
- for (const [s, o] of t) {
1678
- const a = e[s];
1679
- q(a) && a.emitter === o.source || (o.unsubscribe(), t.delete(s));
1662
+ function _e(e, t, r, i, n) {
1663
+ for (const [s, o] of e) {
1664
+ const a = t[s];
1665
+ U(a) && a.emitter === o.source || (o.unsubscribe(), e.delete(s));
1680
1666
  }
1681
- for (const [s, o] of Object.entries(e)) {
1682
- if (!q(o) || t.has(s)) continue;
1667
+ for (const [s, o] of Object.entries(t)) {
1668
+ if (!U(o) || e.has(s)) continue;
1683
1669
  const a = {
1684
1670
  source: o.emitter,
1685
1671
  value: o.emitter.get(),
1686
1672
  unsubscribe: () => {
1687
1673
  }
1688
1674
  };
1689
- a.unsubscribe = ke(o.emitter, a, r, `${i}.${s}`, (l) => {
1690
- t.get(s) === a && (a.value = l, n(s, l));
1691
- }), t.set(s, a);
1675
+ a.unsubscribe = Se(o.emitter, a, r, `${i}.${s}`, (l) => {
1676
+ e.get(s) === a && (a.value = l, n(s, l));
1677
+ }), e.set(s, a);
1692
1678
  }
1693
1679
  }
1694
- function Be(t, e) {
1695
- return Object.fromEntries(Object.entries(e).map(([r, i]) => {
1680
+ function Be(e, t) {
1681
+ return Object.fromEntries(Object.entries(t).map(([r, i]) => {
1696
1682
  var n;
1697
1683
  return [
1698
1684
  r,
1699
- q(i) ? ((n = t.get(r)) == null ? void 0 : n.value) ?? i.emitter.get() : i
1685
+ U(i) ? ((n = e.get(r)) == null ? void 0 : n.value) ?? i.emitter.get() : i
1700
1686
  ];
1701
1687
  }));
1702
1688
  }
1703
- function ye(t, e, r, i, n = null, s = null) {
1704
- if (t == null) throw new Error("Cannot patch a detached fragment range");
1705
- const o = Et(r), a = /* @__PURE__ */ new Map(), l = [];
1706
- for (const y of e)
1707
- y.key == null ? l.push(y) : a.has(y.key) || a.set(y.key, y);
1708
- const u = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set(), h = [];
1709
- let k = 0;
1710
- for (const y of o) {
1711
- const f = Z(y);
1689
+ function ge(e, t, r, i, n = null, s = null) {
1690
+ if (e == null) throw new Error("Cannot patch a detached fragment range");
1691
+ const o = $t(r), a = /* @__PURE__ */ new Map(), l = [];
1692
+ for (const g of t)
1693
+ g.key == null ? l.push(g) : a.has(g.key) || a.set(g.key, g);
1694
+ const u = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set(), p = [];
1695
+ let b = 0;
1696
+ for (const g of o) {
1697
+ const f = Q(g);
1712
1698
  if (f != null) {
1713
1699
  if (u.has(f)) throw new Error(`Duplicate sibling key: ${String(f)}`);
1714
1700
  u.add(f);
1715
1701
  }
1716
- const z = f == null ? l[k++] : a.get(f);
1717
- z && jt(z, y) ? (d.add(z), h.push($t(z, y, i))) : h.push(te(y, i));
1718
- }
1719
- for (const y of e)
1720
- d.has(y) || M(y, !0);
1721
- let b = s ? s.nextSibling : t.firstChild;
1722
- for (const y of h)
1723
- for (const f of P(y))
1724
- f === b ? b = b.nextSibling : (t.insertBefore(f, b ?? n), E(), b = f.nextSibling);
1725
- return h;
1726
- }
1727
- function zt(t, e) {
1728
- const r = Object.fromEntries(Object.entries(e).filter(
1729
- ([s]) => s !== "children" && X(s) !== et
1730
- )), i = t.props, n = /* @__PURE__ */ new Set([...Object.keys(i), ...Object.keys(r)]);
1702
+ const E = f == null ? l[b++] : a.get(f);
1703
+ E && jt(E, g) ? (d.add(E), p.push(xt(E, g, i))) : p.push(ie(g, i));
1704
+ }
1705
+ for (const g of t)
1706
+ d.has(g) || M(g, !0);
1707
+ let w = s ? s.nextSibling : e.firstChild;
1708
+ for (const g of p)
1709
+ for (const f of P(g))
1710
+ f === w ? w = w.nextSibling : (e.insertBefore(f, w ?? n), $(), w = f.nextSibling);
1711
+ return p;
1712
+ }
1713
+ function Ot(e, t) {
1714
+ const r = Object.fromEntries(Object.entries(t).filter(
1715
+ ([s]) => s !== "children" && J(s) !== Qe
1716
+ )), i = e.props, n = /* @__PURE__ */ new Set([...Object.keys(i), ...Object.keys(r)]);
1731
1717
  for (const s of ["value", "checked"])
1732
1718
  if (Object.hasOwn(r, s) && Object.hasOwn(r, `bind:${s}`))
1733
1719
  throw new Error(`${s} and bind:${s} cannot be used together`);
1734
1720
  for (const s of n) {
1735
1721
  const o = i[s], a = r[s];
1736
- if (Fr(s))
1737
- Dr(t, s, a);
1722
+ if (Ur(s))
1723
+ Nr(e, s, a);
1738
1724
  else if (s === "ref")
1739
- o !== a && Nr(t, a);
1740
- else if (Br(s))
1741
- Pr(t, s, a);
1742
- else if (q(a))
1743
- Mr(t, s, a);
1725
+ o !== a && Ir(e, a);
1726
+ else if (Fr(s))
1727
+ Kr(e, s, a);
1728
+ else if (U(a))
1729
+ Pr(e, s, a);
1744
1730
  else {
1745
- const l = t.liveProps.get(s);
1746
- l && (l.unsubscribe(), t.liveProps.delete(s));
1731
+ const l = e.liveProps.get(s);
1732
+ l && (l.unsubscribe(), e.liveProps.delete(s));
1747
1733
  const u = (l == null ? void 0 : l.value) ?? o;
1748
- Object.is(u, a) || B(t.node, s, u, a);
1734
+ Object.is(u, a) || q(e.node, s, u, a);
1749
1735
  }
1750
1736
  }
1751
- L(t.node, et, ""), t.props = { ...r };
1737
+ j(e.node, Qe, ""), e.props = { ...r };
1752
1738
  }
1753
- function Mr(t, e, r) {
1754
- const i = t.liveProps.get(e);
1739
+ function Pr(e, t, r) {
1740
+ const i = e.liveProps.get(t);
1755
1741
  if ((i == null ? void 0 : i.source) === r.emitter) return;
1756
1742
  i == null || i.unsubscribe();
1757
1743
  const n = r.emitter.get();
1758
- B(t.node, e, (i == null ? void 0 : i.value) ?? t.props[e], n);
1744
+ q(e.node, t, (i == null ? void 0 : i.value) ?? e.props[t], n);
1759
1745
  const s = {
1760
1746
  source: r.emitter,
1761
1747
  value: n,
1762
1748
  unsubscribe: () => {
1763
1749
  }
1764
1750
  };
1765
- s.unsubscribe = ke(r.emitter, s, t.owner, `${t.type}.${e}`, (o) => {
1751
+ s.unsubscribe = Se(r.emitter, s, e.owner, `${e.type}.${t}`, (o) => {
1766
1752
  const a = s.value;
1767
- s.value = o, Object.is(a, o) || B(t.node, e, a, o);
1768
- }), t.liveProps.set(e, s);
1753
+ s.value = o, Object.is(a, o) || q(e.node, t, a, o);
1754
+ }), e.liveProps.set(t, s);
1769
1755
  }
1770
- function Dr(t, e, r) {
1771
- const i = e.slice(5), n = t.nativeBindings.get(e);
1756
+ function Nr(e, t, r) {
1757
+ const i = t.slice(5), n = e.nativeBindings.get(t);
1772
1758
  if (r == null) {
1773
- n && (n.unsubscribe(), t.node.removeEventListener(n.eventName, n.listener), t.nativeBindings.delete(e), B(t.node, i, n.value, void 0));
1759
+ n && (n.unsubscribe(), e.node.removeEventListener(n.eventName, n.listener), e.nativeBindings.delete(t), q(e.node, i, n.value, void 0));
1774
1760
  return;
1775
1761
  }
1776
- if (qr(r, e), (n == null ? void 0 : n.source) === r) return;
1777
- n && (n.unsubscribe(), t.node.removeEventListener(n.eventName, n.listener)), Ur(t.node, i);
1778
- const s = Hr(t.node, i), o = r.get();
1779
- B(t.node, i, n == null ? void 0 : n.value, o);
1762
+ if (Hr(r, t), (n == null ? void 0 : n.source) === r) return;
1763
+ n && (n.unsubscribe(), e.node.removeEventListener(n.eventName, n.listener)), Vr(e.node, i);
1764
+ const s = Wr(e.node, i), o = r.get();
1765
+ q(e.node, i, n == null ? void 0 : n.value, o);
1780
1766
  const a = (u) => {
1781
- ge(
1782
- Rt(t, s),
1783
- t.owner.diagnosticScope,
1767
+ be(
1768
+ Rt(e, s),
1769
+ e.owner.diagnosticScope,
1784
1770
  u,
1785
1771
  a,
1786
- `${e} changed`,
1787
- () => r.set(Reflect.get(t.node, i), `${e} changed`)
1772
+ `${t} changed`,
1773
+ () => r.set(Reflect.get(e.node, i), `${t} changed`)
1788
1774
  );
1789
1775
  }, l = {
1790
1776
  source: r,
@@ -1794,490 +1780,578 @@ function Dr(t, e, r) {
1794
1780
  unsubscribe: () => {
1795
1781
  }
1796
1782
  };
1797
- l.unsubscribe = ke(r, l, t.owner, `${t.type}.${e}`, (u) => {
1783
+ l.unsubscribe = Se(r, l, e.owner, `${e.type}.${t}`, (u) => {
1798
1784
  const d = l.value;
1799
- l.value = u, Object.is(d, u) || B(t.node, i, d, u);
1800
- }), t.node.addEventListener(s, a), t.nativeBindings.set(e, l);
1785
+ l.value = u, Object.is(d, u) || q(e.node, i, d, u);
1786
+ }), e.node.addEventListener(s, a), e.nativeBindings.set(t, l);
1801
1787
  }
1802
- function Pr(t, e, r) {
1803
- const i = e.slice(2).toLowerCase(), n = t.listeners.get(e), s = n ? it.get(n) ?? n : null;
1804
- if (n && s !== r && (t.node.removeEventListener(i, n), t.listeners.delete(e)), r != null && typeof r != "function")
1805
- throw new TypeError(`${e} must be a function or null`);
1788
+ function Kr(e, t, r) {
1789
+ const i = t.slice(2).toLowerCase(), n = e.listeners.get(t), s = n ? rt.get(n) ?? n : null;
1790
+ if (n && s !== r && (e.node.removeEventListener(i, n), e.listeners.delete(t)), r != null && typeof r != "function")
1791
+ throw new TypeError(`${t} must be a function or null`);
1806
1792
  if (typeof r == "function" && s !== r) {
1807
- const o = (a) => ge(
1808
- Rt(t, i),
1809
- t.owner.diagnosticScope,
1793
+ const o = (a) => be(
1794
+ Rt(e, i),
1795
+ e.owner.diagnosticScope,
1810
1796
  a,
1811
1797
  o,
1812
1798
  i,
1813
- () => r.call(t.node, a)
1799
+ () => r.call(e.node, a)
1814
1800
  );
1815
- it.set(o, r), t.node.addEventListener(i, o), t.listeners.set(e, o);
1801
+ rt.set(o, r), e.node.addEventListener(i, o), e.listeners.set(t, o);
1816
1802
  }
1817
1803
  }
1818
- const rt = /* @__PURE__ */ new WeakMap(), it = /* @__PURE__ */ new WeakMap(), Ae = /* @__PURE__ */ new WeakMap();
1819
- function ge(t, e, r, i, n, s) {
1820
- return m.withScope(e, () => {
1804
+ const tt = /* @__PURE__ */ new WeakMap(), rt = /* @__PURE__ */ new WeakMap(), Ae = /* @__PURE__ */ new WeakMap();
1805
+ function be(e, t, r, i, n, s) {
1806
+ return m.withScope(t, () => {
1821
1807
  if (!m.active) return s();
1822
1808
  let o = Ae.get(r);
1823
- return (!o || o.listeners.has(i)) && (o = { event: m.event(t, "interaction", { cause: n, outcome: "started" }), listeners: /* @__PURE__ */ new Set() }, Ae.set(r, o), queueMicrotask(() => Ae.delete(r))), o.listeners.add(i), m.withEvent(o.event, s);
1809
+ return (!o || o.listeners.has(i)) && (o = { event: m.event(e, "interaction", { cause: n, outcome: "started" }), listeners: /* @__PURE__ */ new Set() }, Ae.set(r, o), queueMicrotask(() => Ae.delete(r))), o.listeners.add(i), m.withEvent(o.event, s);
1824
1810
  });
1825
1811
  }
1826
- function Rt(t, e) {
1812
+ function Rt(e, t) {
1827
1813
  var n;
1828
- let r = rt.get(t);
1829
- r || (r = /* @__PURE__ */ new Map(), rt.set(t, r));
1830
- let i = r.get(e);
1814
+ let r = tt.get(e);
1815
+ r || (r = /* @__PURE__ */ new Map(), tt.set(e, r));
1816
+ let i = r.get(t);
1831
1817
  if (!i) {
1832
1818
  i = {};
1833
- const s = t.node.getAttribute("aria-label") ?? t.node.getAttribute("name") ?? ((n = t.node.textContent) == null ? void 0 : n.trim().slice(0, 80)) ?? "";
1819
+ const s = e.node.getAttribute("aria-label") ?? e.node.getAttribute("name") ?? ((n = e.node.textContent) == null ? void 0 : n.trim().slice(0, 80)) ?? "";
1834
1820
  m.configure(i, {
1835
1821
  kind: "interaction",
1836
- label: `${_(t.owner)}: ${t.type} ${s} ${e}`.trim(),
1837
- scope: t.owner.diagnosticScope
1838
- }), r.set(e, i);
1822
+ label: `${B(e.owner)}: ${e.type} ${s} ${t}`.trim(),
1823
+ scope: e.owner.diagnosticScope
1824
+ }), r.set(t, i);
1839
1825
  }
1840
1826
  return i;
1841
1827
  }
1842
- function ke(t, e, r, i, n) {
1843
- m.configure(e, {
1828
+ function Se(e, t, r, i, n) {
1829
+ m.configure(t, {
1844
1830
  kind: "binding",
1845
- label: `${_(r)}: ${i}`,
1831
+ label: `${B(r)}: ${i}`,
1846
1832
  scope: r.diagnosticScope,
1847
- sources: [t]
1833
+ sources: [e]
1848
1834
  });
1849
- const s = t.subscribe(({ value: o, event: a }) => {
1850
- const l = m.event(e, "consumer", {
1835
+ const s = e.subscribe(({ value: o, event: a }) => {
1836
+ const l = m.event(t, "consumer", {
1851
1837
  parent: a,
1852
1838
  cause: "binding update",
1853
1839
  value: o,
1854
1840
  outcome: "started",
1855
1841
  consumer: { trigger: "dependency" }
1856
- }), u = C, d = l ? { count: 0 } : null;
1857
- C = d;
1842
+ }), u = z, d = l ? { count: 0 } : null;
1843
+ z = d;
1858
1844
  try {
1859
- m.withEvent(l, () => n(o)), l && m.event(e, "consumer", {
1845
+ m.withEvent(l, () => n(o)), l && m.event(t, "consumer", {
1860
1846
  parent: l,
1861
1847
  cause: "binding updated",
1862
1848
  value: o,
1863
1849
  outcome: "succeeded",
1864
1850
  consumer: { trigger: "dependency", domWrites: d.count }
1865
1851
  });
1866
- } catch (h) {
1867
- throw l && m.event(e, "consumer", {
1852
+ } catch (p) {
1853
+ throw l && m.event(t, "consumer", {
1868
1854
  parent: l,
1869
1855
  cause: "binding update failed",
1870
1856
  outcome: "failed",
1871
- error: h,
1857
+ error: p,
1872
1858
  consumer: { trigger: "dependency", domWrites: d.count }
1873
- }), h;
1859
+ }), p;
1874
1860
  } finally {
1875
- C = u;
1861
+ z = u;
1876
1862
  }
1877
- }, { emitCurrent: !1, diagnosticTarget: e });
1863
+ }, { emitCurrent: !1, diagnosticTarget: t });
1878
1864
  return () => {
1879
- s(), m.dispose(e);
1865
+ s(), m.dispose(t);
1880
1866
  };
1881
1867
  }
1882
- function _(t) {
1883
- return t.diagnosticLabel;
1868
+ function B(e) {
1869
+ return e.diagnosticLabel;
1884
1870
  }
1885
- function Nr(t, e) {
1886
- if (De(t.ref, null), e != null && typeof e != "function" && typeof e != "object")
1871
+ function Ir(e, t) {
1872
+ if (Pe(e.ref, null), t != null && typeof t != "function" && typeof t != "object")
1887
1873
  throw new TypeError("ref must be a function, object, or null");
1888
- t.ref = e, De(t.ref, t.node);
1874
+ e.ref = t, Pe(e.ref, e.node);
1889
1875
  }
1890
- function B(t, e, r, i) {
1891
- if (e === "class" || e === "className") {
1892
- L(t, "class", i);
1876
+ function q(e, t, r, i) {
1877
+ if (t === "class" || t === "className") {
1878
+ j(e, "class", i);
1893
1879
  return;
1894
1880
  }
1895
- if (e === "for" || e === "htmlFor") {
1896
- L(t, "for", i);
1881
+ if (t === "for" || t === "htmlFor") {
1882
+ j(e, "for", i);
1897
1883
  return;
1898
1884
  }
1899
- if (e === "dataset") {
1900
- Kr(t, r, i);
1885
+ if (t === "dataset") {
1886
+ _r(e, r, i);
1901
1887
  return;
1902
1888
  }
1903
- if (e === "style") {
1904
- Ir(t, r, i);
1889
+ if (t === "style") {
1890
+ Br(e, r, i);
1905
1891
  return;
1906
1892
  }
1907
- if (e === "dangerouslySetInnerHTML")
1893
+ if (t === "dangerouslySetInnerHTML")
1908
1894
  throw new Error("dangerouslySetInnerHTML is not supported");
1909
- const n = _r(e);
1910
- if (zr.has(n)) {
1895
+ const n = qr(t);
1896
+ if (Rr.has(n)) {
1911
1897
  const s = !!i;
1912
- n in t && Reflect.get(t, n) !== s && (Reflect.set(t, n, s), E()), L(t, X(e), s);
1898
+ n in e && Reflect.get(e, n) !== s && (Reflect.set(e, n, s), $()), j(e, J(t), s);
1913
1899
  return;
1914
1900
  }
1915
- if (n === "value" && t.localName === "option") {
1916
- L(t, X(e), i);
1901
+ if (n === "value" && e.localName === "option") {
1902
+ j(e, J(t), i);
1917
1903
  return;
1918
1904
  }
1919
- if (Rr.has(n) && n in t) {
1905
+ if (Ar.has(n) && n in e) {
1920
1906
  const s = i ?? (n === "value" ? "" : !1);
1921
- Object.is(Reflect.get(t, n), s) || (Reflect.set(t, n, s), E()), i == null && L(t, X(e), null);
1907
+ Object.is(Reflect.get(e, n), s) || (Reflect.set(e, n, s), $()), i == null && j(e, J(t), null);
1922
1908
  return;
1923
1909
  }
1924
- L(t, X(e), i);
1910
+ j(e, J(t), i);
1925
1911
  }
1926
- function Kr(t, e, r) {
1927
- const i = be(e, "dataset"), n = be(r, "dataset");
1912
+ function _r(e, t, r) {
1913
+ const i = we(t, "dataset"), n = we(r, "dataset");
1928
1914
  for (const s of /* @__PURE__ */ new Set([...Object.keys(i), ...Object.keys(n)])) {
1929
1915
  const o = n[s];
1930
- t.dataset[s] !== (o == null ? void 0 : String(o)) && (o == null ? delete t.dataset[s] : t.dataset[s] = String(o), E());
1916
+ e.dataset[s] !== (o == null ? void 0 : String(o)) && (o == null ? delete e.dataset[s] : e.dataset[s] = String(o), $());
1931
1917
  }
1932
1918
  }
1933
- function Ir(t, e, r) {
1919
+ function Br(e, t, r) {
1934
1920
  if (typeof r == "string") {
1935
- t.style.cssText !== r && (t.style.cssText = r, E());
1921
+ e.style.cssText !== r && (e.style.cssText = r, $());
1936
1922
  return;
1937
1923
  }
1938
- const i = typeof e == "string" ? {} : be(e, "style"), n = be(r, "style");
1939
- typeof e == "string" && t.style.cssText !== "" && (t.style.cssText = "", E());
1924
+ const i = typeof t == "string" ? {} : we(t, "style"), n = we(r, "style");
1925
+ typeof t == "string" && e.style.cssText !== "" && (e.style.cssText = "", $());
1940
1926
  for (const s of /* @__PURE__ */ new Set([...Object.keys(i), ...Object.keys(n)])) {
1941
1927
  const o = n[s];
1942
1928
  if (s.startsWith("--")) {
1943
- if (t.style.getPropertyValue(s) === (o == null ? "" : String(o))) continue;
1944
- o == null ? t.style.removeProperty(s) : t.style.setProperty(s, String(o));
1929
+ if (e.style.getPropertyValue(s) === (o == null ? "" : String(o))) continue;
1930
+ o == null ? e.style.removeProperty(s) : e.style.setProperty(s, String(o));
1945
1931
  } else {
1946
- if (Reflect.get(t.style, s) === (o == null ? "" : String(o))) continue;
1947
- Reflect.set(t.style, s, o == null ? "" : String(o));
1932
+ if (Reflect.get(e.style, s) === (o == null ? "" : String(o))) continue;
1933
+ Reflect.set(e.style, s, o == null ? "" : String(o));
1948
1934
  }
1949
- E();
1935
+ $();
1950
1936
  }
1951
1937
  }
1952
- function be(t, e) {
1953
- if (t == null) return {};
1954
- if (typeof t != "object" || Array.isArray(t))
1955
- throw new TypeError(`${e} must be an object or null`);
1956
- return t;
1938
+ function we(e, t) {
1939
+ if (e == null) return {};
1940
+ if (typeof e != "object" || Array.isArray(e))
1941
+ throw new TypeError(`${t} must be an object or null`);
1942
+ return e;
1957
1943
  }
1958
- function L(t, e, r) {
1944
+ function j(e, t, r) {
1959
1945
  const i = r == null || r === !1 ? null : r === !0 ? "" : String(r);
1960
- t.getAttribute(e) !== i && (i === null ? t.removeAttribute(e) : t.setAttribute(e, i), E());
1946
+ e.getAttribute(t) !== i && (i === null ? e.removeAttribute(t) : e.setAttribute(t, i), $());
1961
1947
  }
1962
- function _r(t) {
1963
- return t === "readonly" ? "readOnly" : t === "autofocus" ? "autoFocus" : t;
1948
+ function qr(e) {
1949
+ return e === "readonly" ? "readOnly" : e === "autofocus" ? "autoFocus" : e;
1964
1950
  }
1965
- function X(t) {
1966
- return t === "className" ? "class" : t === "htmlFor" ? "for" : t === "minLength" ? "minlength" : t === "maxLength" ? "maxlength" : t === "autoComplete" ? "autocomplete" : t === "inputMode" ? "inputmode" : /^aria[A-Z]/.test(t) || /^data[A-Z]/.test(t) ? nt(t) : t.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
1951
+ function J(e) {
1952
+ return e === "className" ? "class" : e === "htmlFor" ? "for" : e === "minLength" ? "minlength" : e === "maxLength" ? "maxlength" : e === "autoComplete" ? "autocomplete" : e === "inputMode" ? "inputmode" : /^aria[A-Z]/.test(e) || /^data[A-Z]/.test(e) ? it(e) : e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`);
1967
1953
  }
1968
- function nt(t) {
1969
- return t.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
1954
+ function it(e) {
1955
+ return e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`);
1970
1956
  }
1971
- function De(t, e) {
1972
- t != null && (typeof t == "function" ? t(e) : t.current = e);
1957
+ function Pe(e, t) {
1958
+ e != null && (typeof e == "function" ? e(t) : e.current = t);
1973
1959
  }
1974
- function M(t, e) {
1975
- if (t.kind === "emitter") {
1976
- if (t.unsubscribe(), M(t.child, !1), e)
1977
- for (const r of P(t)) le(r);
1960
+ function M(e, t) {
1961
+ if (e.kind === "emitter") {
1962
+ if (e.unsubscribe(), M(e.child, !1), t)
1963
+ for (const r of P(e)) ce(r);
1978
1964
  return;
1979
1965
  }
1980
- if (t.kind === "component") {
1981
- for (const r of t.liveProps.values()) r.unsubscribe();
1982
- t.liveProps.clear(), t.owner._childComponents.delete(t.instance), t.instance.destroy();
1966
+ if (e.kind === "component") {
1967
+ for (const r of e.liveProps.values()) r.unsubscribe();
1968
+ e.liveProps.clear(), e.owner._childComponents.delete(e.instance), e.instance.destroy();
1983
1969
  return;
1984
1970
  }
1985
- if (t.kind === "function") {
1986
- for (const r of t.liveProps.values()) r.unsubscribe();
1987
- t.liveProps.clear(), t.diagnosticSubject && m.dispose(t.diagnosticSubject), M(t.child, e);
1971
+ if (e.kind === "function") {
1972
+ for (const r of e.liveProps.values()) r.unsubscribe();
1973
+ e.liveProps.clear(), e.diagnosticSubject && m.dispose(e.diagnosticSubject), M(e.child, t);
1988
1974
  return;
1989
1975
  }
1990
- if (t.kind === "element") {
1991
- De(t.ref, null);
1992
- for (const [r, i] of t.listeners)
1993
- t.node.removeEventListener(r.slice(2).toLowerCase(), i);
1994
- t.listeners.clear();
1995
- for (const r of t.liveProps.values()) r.unsubscribe();
1996
- t.liveProps.clear();
1997
- for (const r of t.nativeBindings.values())
1998
- r.unsubscribe(), t.node.removeEventListener(r.eventName, r.listener);
1999
- t.nativeBindings.clear();
2000
- for (const r of t.children) M(r, !1);
2001
- e && le(t.node);
1976
+ if (e.kind === "element") {
1977
+ Pe(e.ref, null);
1978
+ for (const [r, i] of e.listeners)
1979
+ e.node.removeEventListener(r.slice(2).toLowerCase(), i);
1980
+ e.listeners.clear();
1981
+ for (const r of e.liveProps.values()) r.unsubscribe();
1982
+ e.liveProps.clear();
1983
+ for (const r of e.nativeBindings.values())
1984
+ r.unsubscribe(), e.node.removeEventListener(r.eventName, r.listener);
1985
+ e.nativeBindings.clear();
1986
+ for (const r of e.children) M(r, !1);
1987
+ t && ce(e.node);
2002
1988
  return;
2003
1989
  }
2004
- if (t.kind === "fragment") {
2005
- for (const r of t.children) M(r, !1);
2006
- if (e)
2007
- for (const r of P(t)) le(r);
1990
+ if (e.kind === "fragment") {
1991
+ for (const r of e.children) M(r, !1);
1992
+ if (t)
1993
+ for (const r of P(e)) ce(r);
2008
1994
  return;
2009
1995
  }
2010
- e && le(t.node);
1996
+ t && ce(e.node);
2011
1997
  }
2012
- function le(t) {
2013
- t.parentNode && (t.remove(), E());
1998
+ function ce(e) {
1999
+ e.parentNode && (e.remove(), $());
2014
2000
  }
2015
- function Fe(t, e, r = null) {
2016
- if (e != null)
2017
- for (const i of P(e))
2018
- i.parentNode === t && i.nextSibling === r || (t.insertBefore(i, r), E());
2001
+ function qe(e, t, r = null) {
2002
+ if (t != null)
2003
+ for (const i of P(t))
2004
+ i.parentNode === e && i.nextSibling === r || (e.insertBefore(i, r), $());
2019
2005
  }
2020
- function P(t) {
2021
- if (t == null) return [];
2022
- if (t.kind === "text" || t.kind === "element") return [t.node];
2023
- if (t.kind === "component") return P(t.instance._rendered);
2024
- if (t.kind === "function") return P(t.child);
2025
- const e = [];
2026
- let r = t.start;
2027
- for (; r && (e.push(r), r !== t.end); )
2006
+ function P(e) {
2007
+ if (e == null) return [];
2008
+ if (e.kind === "text" || e.kind === "element") return [e.node];
2009
+ if (e.kind === "component") return P(e.instance._rendered);
2010
+ if (e.kind === "function") return P(e.child);
2011
+ const t = [];
2012
+ let r = e.start;
2013
+ for (; r && (t.push(r), r !== e.end); )
2028
2014
  r = r.nextSibling;
2029
- return e;
2015
+ return t;
2030
2016
  }
2031
- function At(t) {
2032
- return P(t)[0] ?? null;
2017
+ function At(e) {
2018
+ return P(e)[0] ?? null;
2033
2019
  }
2034
- function Z(t) {
2035
- return t instanceof T ? Ot(t.props) : O(t) ? t.key : null;
2020
+ function Q(e) {
2021
+ return e instanceof O ? Lt(e.props) : A(e) ? e.key : null;
2036
2022
  }
2037
- function Ot(t) {
2038
- const e = t.key;
2039
- return typeof e == "string" || typeof e == "number" ? e : null;
2023
+ function Lt(e) {
2024
+ const t = e.key;
2025
+ return typeof t == "string" || typeof t == "number" ? t : null;
2040
2026
  }
2041
- function jt(t, e) {
2042
- return t.kind === "text" ? typeof e == "string" || typeof e == "number" : t.kind === "emitter" ? Se(e) && t.source === e : t.kind === "component" ? e instanceof T ? t.instance === e : O(e) && Lt(e.type) && t.type === e.type && t.key === Z(e) : t.kind === "function" ? O(e) && t.type === e.type && t.key === Z(e) : t.kind === "fragment" ? O(e) && e.type === ee && t.key === Z(e) : O(e) && typeof e.type == "string" && t.type === e.type && t.key === Z(e);
2027
+ function jt(e, t) {
2028
+ return e.kind === "text" ? typeof t == "string" || typeof t == "number" : e.kind === "emitter" ? Ee(t) && e.source === t : e.kind === "component" ? t instanceof O ? e.instance === t : A(t) && Mt(t.type) && e.type === t.type && e.key === Q(t) : e.kind === "function" ? A(t) && e.type === t.type && e.key === Q(t) : e.kind === "fragment" ? A(t) && t.type === re && e.key === Q(t) : A(t) && typeof t.type == "string" && e.type === t.type && e.key === Q(t);
2043
2029
  }
2044
- function O(t) {
2045
- return t != null && typeof t == "object" && Object.hasOwn(t, "type");
2030
+ function A(e) {
2031
+ return e != null && typeof e == "object" && Object.hasOwn(e, "type");
2046
2032
  }
2047
- function Lt(t) {
2048
- return typeof t == "function" && (t === T || t.prototype instanceof T);
2033
+ function Mt(e) {
2034
+ return typeof e == "function" && (e === O || e.prototype instanceof O);
2049
2035
  }
2050
- function Br(t) {
2051
- return /^on[A-Z]/.test(t);
2036
+ function Fr(e) {
2037
+ return /^on[A-Z]/.test(e);
2052
2038
  }
2053
- function Fr(t) {
2054
- return t === "bind:value" || t === "bind:checked";
2039
+ function Ur(e) {
2040
+ return e === "bind:value" || e === "bind:checked";
2055
2041
  }
2056
- function q(t) {
2057
- return t != null && typeof t == "object" && Tr.has(t);
2042
+ function U(e) {
2043
+ return e != null && typeof e == "object" && Or.has(e);
2058
2044
  }
2059
- function Se(t) {
2060
- return (typeof t != "object" || t == null) && typeof t != "function" ? !1 : typeof Reflect.get(t, "get") == "function" && typeof Reflect.get(t, "getFetchState") == "function" && typeof Reflect.get(t, "getError") == "function" && typeof Reflect.get(t, "subscribe") == "function";
2045
+ function Ee(e) {
2046
+ return (typeof e != "object" || e == null) && typeof e != "function" ? !1 : typeof Reflect.get(e, "get") == "function" && typeof Reflect.get(e, "getFetchState") == "function" && typeof Reflect.get(e, "getError") == "function" && typeof Reflect.get(e, "subscribe") == "function";
2061
2047
  }
2062
- function Mt(t, e) {
2063
- if (!Se(t)) throw new TypeError(`${e} requires a readable emitter`);
2048
+ function Dt(e, t) {
2049
+ if (!Ee(e)) throw new TypeError(`${t} requires a readable emitter`);
2064
2050
  }
2065
- function qr(t, e) {
2066
- if (Mt(t, e), typeof Reflect.get(t, "set") != "function")
2067
- throw new TypeError(`${e} requires a writable emitter`);
2051
+ function Hr(e, t) {
2052
+ if (Dt(e, t), typeof Reflect.get(e, "set") != "function")
2053
+ throw new TypeError(`${t} requires a writable emitter`);
2068
2054
  }
2069
- function Ur(t, e) {
2070
- const r = t.localName;
2071
- if (!(e === "checked" ? r === "input" : r === "input" || r === "textarea" || r === "select")) throw new TypeError(`bind:${e} is not supported on ${r}`);
2055
+ function Vr(e, t) {
2056
+ const r = e.localName;
2057
+ if (!(t === "checked" ? r === "input" : r === "input" || r === "textarea" || r === "select")) throw new TypeError(`bind:${t} is not supported on ${r}`);
2072
2058
  }
2073
- function Hr(t, e) {
2074
- return e === "value" && t.localName !== "select" ? "input" : "change";
2059
+ function Wr(e, t) {
2060
+ return t === "value" && e.localName !== "select" ? "input" : "change";
2075
2061
  }
2076
- function Vr(t) {
2077
- if (t == null || typeof t != "object" && typeof t != "function" || typeof Reflect.get(t, "insertBefore") != "function")
2062
+ function Yr(e) {
2063
+ if (e == null || typeof e != "object" && typeof e != "function" || typeof Reflect.get(e, "insertBefore") != "function")
2078
2064
  throw new TypeError("Component parent must be a DOM ParentNode");
2079
2065
  }
2080
- function st(t) {
2066
+ function nt(e) {
2081
2067
  try {
2082
- return String(t);
2068
+ return String(e);
2083
2069
  } catch {
2084
- return Object.prototype.toString.call(t);
2070
+ return Object.prototype.toString.call(e);
2085
2071
  }
2086
2072
  }
2087
- function Wr(t) {
2088
- const e = [];
2089
- let r = t;
2090
- for (; r != null && typeof r == "function" && (e.unshift(r), r !== T); )
2073
+ function Gr(e) {
2074
+ const t = [];
2075
+ let r = e;
2076
+ for (; r != null && typeof r == "function" && (t.unshift(r), r !== O); )
2091
2077
  r = Object.getPrototypeOf(r);
2092
- return e;
2078
+ return t;
2093
2079
  }
2094
- function Yr(...t) {
2095
- return [...new Set(t.flatMap((e) => typeof e == "string" ? e.split(/\s+/) : []).filter(Boolean))].join(" ");
2080
+ function Xr(...e) {
2081
+ return [...new Set(e.flatMap((t) => typeof t == "string" ? t.split(/\s+/) : []).filter(Boolean))].join(" ");
2096
2082
  }
2097
- function Oe(t) {
2098
- if (t.island === !0) return !0;
2099
- const e = t.className ?? t.class;
2100
- return typeof e == "string" && e.split(/\s+/).includes("island");
2083
+ function Le(e) {
2084
+ if (e.island === !0) return !0;
2085
+ const t = e.className ?? e.class;
2086
+ return typeof t == "string" && t.split(/\s+/).includes("island");
2101
2087
  }
2102
- function p(t, e, r) {
2103
- const i = e == null ? {} : { ...e };
2104
- return r !== void 0 && (i.key = r), me(t, i);
2088
+ function h(e, t, r) {
2089
+ const i = t == null ? {} : { ...t };
2090
+ return r !== void 0 && (i.key = r), ye(e, i);
2105
2091
  }
2106
- const g = p, Gr = [
2092
+ const y = h, Zr = [
2107
2093
  "var(--colored-dark)",
2108
2094
  "var(--colored-base)",
2109
2095
  "var(--colored-light)"
2110
2096
  ];
2111
- class Y extends Ne {
2097
+ class X extends Ne {
2098
+ constructor() {
2099
+ super(...arguments);
2100
+ c(this, "labelResizeObserver", null);
2101
+ c(this, "measuredLabelOrientations", /* @__PURE__ */ new Map());
2102
+ }
2112
2103
  render() {
2113
- var b;
2104
+ var f;
2114
2105
  const {
2115
- model: e,
2116
- label: r = "Block graph",
2117
- description: i = "Area is proportional to item count.",
2118
- emptyMessage: n = "No items are available."
2119
- } = this.props, s = this.snapshot(e.layout$), o = s.fetchState === S.Initial || s.fetchState === S.Loading, a = this.read(e.selectedPath$), l = s.value, u = I(l.root, a), d = l.root.children.length === 0 ? [l.root] : l.root.children, h = (b = d[0]) == null ? void 0 : b.key, k = this.Host;
2120
- return /* @__PURE__ */ g(
2121
- k,
2106
+ model: r,
2107
+ label: i = "Block graph",
2108
+ description: n = "Area is proportional to item count.",
2109
+ emptyMessage: s = "No items are available.",
2110
+ labelOrientation: o = "auto"
2111
+ } = this.props;
2112
+ st(o);
2113
+ const a = this.snapshot(r.layout$), l = a.fetchState === S.Initial || a.fetchState === S.Loading, u = this.read(r.selectedPath$), d = a.value, p = _(d.root, u), b = d.root.children.length === 0 ? [d.root] : d.root.children, w = (f = b[0]) == null ? void 0 : f.key, g = this.Host;
2114
+ return /* @__PURE__ */ y(
2115
+ g,
2122
2116
  {
2123
2117
  className: (this.props.className ?? this.props.class ?? "") || null,
2124
- "aria-label": r,
2125
- "aria-busy": o ? "true" : null,
2118
+ "aria-label": i,
2119
+ "aria-busy": l ? "true" : null,
2126
2120
  children: [
2127
- /* @__PURE__ */ g("header", { children: [
2128
- /* @__PURE__ */ g("cap-summary", { children: [
2129
- /* @__PURE__ */ p("h2", { children: r }),
2130
- /* @__PURE__ */ g("p", { children: [
2131
- i,
2121
+ /* @__PURE__ */ y("header", { children: [
2122
+ /* @__PURE__ */ y("cap-summary", { children: [
2123
+ /* @__PURE__ */ h("h2", { children: i }),
2124
+ /* @__PURE__ */ y("p", { children: [
2125
+ n,
2132
2126
  " ",
2133
- o ? null : `${l.root.count} items.`
2127
+ l ? null : `${d.root.count} items.`
2134
2128
  ] }),
2135
- o ? /* @__PURE__ */ p(xe, { width: 45 }) : /* @__PURE__ */ g("output", { children: [
2136
- /* @__PURE__ */ p("strong", { children: "Selection:" }),
2129
+ l ? /* @__PURE__ */ h(Ce, { width: 45 }) : /* @__PURE__ */ y("output", { children: [
2130
+ /* @__PURE__ */ h("strong", { children: "Selection:" }),
2137
2131
  " ",
2138
- u == null ? "None" : u.path.length === 0 ? u.label : u.path.map((y, f) => {
2139
- var R;
2140
- const z = u.path.slice(0, f + 1);
2141
- return ((R = I(l.root, z)) == null ? void 0 : R.label) ?? y.categoryKey;
2132
+ p == null ? "None" : p.path.length === 0 ? p.label : p.path.map((E, T) => {
2133
+ var W;
2134
+ const N = p.path.slice(0, T + 1);
2135
+ return ((W = _(d.root, N)) == null ? void 0 : W.label) ?? E.categoryKey;
2142
2136
  }).join(" → ")
2143
2137
  ] })
2144
2138
  ] }),
2145
- /* @__PURE__ */ p(
2146
- he,
2139
+ /* @__PURE__ */ h(
2140
+ fe,
2147
2141
  {
2148
2142
  label: "Clear selection",
2149
- disabled: o || a == null,
2150
- onClick: () => e.clear()
2143
+ disabled: l || u == null,
2144
+ onClick: () => r.clear()
2151
2145
  }
2152
2146
  )
2153
2147
  ] }),
2154
- s.fetchState === S.Error ? /* @__PURE__ */ p("p", { role: "alert", children: "The block graph could not be calculated." }) : o ? /* @__PURE__ */ g(ee, { children: [
2155
- /* @__PURE__ */ p("p", { role: "status", "aria-live": "polite", children: "Loading block graph…" }),
2156
- /* @__PURE__ */ p("cap-blockskeleton", { "aria-hidden": "true", children: [0, 1, 2].map((y) => /* @__PURE__ */ p("cap-blockskeletoncolumn", { children: [0, 1].map((f) => /* @__PURE__ */ p(xe, { width: 100 }, f)) }, y)) })
2157
- ] }) : l.valid ? l.root.count === 0 ? /* @__PURE__ */ p("p", { role: "status", children: n }) : /* @__PURE__ */ p(
2148
+ a.fetchState === S.Error ? /* @__PURE__ */ h("p", { role: "alert", children: "The block graph could not be calculated." }) : l ? /* @__PURE__ */ y(re, { children: [
2149
+ /* @__PURE__ */ h("p", { role: "status", "aria-live": "polite", children: "Loading block graph…" }),
2150
+ /* @__PURE__ */ h("cap-blockskeleton", { "aria-hidden": "true", children: [0, 1, 2].map((E) => /* @__PURE__ */ h("cap-blockskeletoncolumn", { children: [0, 1].map((T) => /* @__PURE__ */ h(Ce, { width: 100 }, T)) }, E)) })
2151
+ ] }) : d.valid ? d.root.count === 0 ? /* @__PURE__ */ h("p", { role: "status", children: s }) : /* @__PURE__ */ h(
2158
2152
  "cap-scroller",
2159
2153
  {
2160
2154
  tabIndex: 0,
2161
- "aria-label": `Scrollable ${r}`,
2162
- children: /* @__PURE__ */ p(
2155
+ "aria-label": `Scrollable ${i}`,
2156
+ children: /* @__PURE__ */ h(
2163
2157
  "cap-blocks",
2164
2158
  {
2165
2159
  role: "tree",
2166
- "aria-label": r,
2167
- className: l.root.childOrientation,
2168
- onClick: (y) => {
2169
- y.target === y.currentTarget && e.clear();
2160
+ "aria-label": i,
2161
+ className: d.root.childOrientation,
2162
+ onClick: (E) => {
2163
+ E.target === E.currentTarget && r.clear();
2170
2164
  },
2171
- children: d.map((y) => this.renderBlock(
2172
- y,
2173
- a,
2174
- (u == null ? void 0 : u.key) ?? h ?? null
2165
+ children: b.map((E) => this.renderBlock(
2166
+ E,
2167
+ u,
2168
+ (p == null ? void 0 : p.key) ?? w ?? null
2175
2169
  ))
2176
2170
  }
2177
2171
  )
2178
2172
  }
2179
- ) : this.renderPartitionError(l.issues)
2173
+ ) : this.renderPartitionError(d.issues)
2180
2174
  ]
2181
2175
  }
2182
2176
  );
2183
2177
  }
2184
- renderBlock(e, r, i) {
2185
- const n = Xr(e.path, r), s = e.colors, o = ct(s ?? Gr);
2186
- return /* @__PURE__ */ g(
2178
+ afterMount() {
2179
+ this.reconcileLabelOrientation();
2180
+ }
2181
+ afterUpdate() {
2182
+ this.reconcileLabelOrientation();
2183
+ }
2184
+ onDestroy() {
2185
+ var r;
2186
+ (r = this.labelResizeObserver) == null || r.disconnect(), this.labelResizeObserver = null, this.measuredLabelOrientations.clear();
2187
+ }
2188
+ renderBlock(r, i, n) {
2189
+ const s = Jr(r.path, i), o = r.colors, a = ut(o ?? Zr);
2190
+ return /* @__PURE__ */ y(
2187
2191
  "article",
2188
2192
  {
2189
2193
  role: "treeitem",
2190
2194
  className: "colored",
2191
- tabIndex: n || r == null && e.key === i ? 0 : -1,
2192
- "aria-level": Math.max(1, e.depth + 1),
2193
- "aria-selected": n ? "true" : "false",
2194
- "aria-label": `${e.criterionLabel ?? "Items"}: ${e.label}, ${e.count} ${e.count === 1 ? "item" : "items"}`,
2195
- "data-block-key": e.key,
2196
- onClick: (a) => {
2197
- a.target.closest('[role="treeitem"]') === a.currentTarget && this.props.model.select(e.path);
2195
+ tabIndex: s || i == null && r.key === n ? 0 : -1,
2196
+ "aria-level": Math.max(1, r.depth + 1),
2197
+ "aria-selected": s ? "true" : "false",
2198
+ "aria-label": `${r.criterionLabel ?? "Items"}: ${r.label}, ${r.count} ${r.count === 1 ? "item" : "items"}`,
2199
+ "data-block-key": r.key,
2200
+ onClick: (l) => {
2201
+ l.target.closest('[role="treeitem"]') === l.currentTarget && this.props.model.select(r.path);
2198
2202
  },
2199
- onKeyDown: (a) => this.blockKeyDown(a, e),
2203
+ onKeyDown: (l) => this.blockKeyDown(l, r),
2200
2204
  style: {
2201
- flexGrow: e.count,
2202
- ...o,
2203
- ...s == null ? {} : {
2204
- borderColor: s[0]
2205
+ flexGrow: r.count,
2206
+ ...a,
2207
+ ...o == null ? {} : {
2208
+ borderColor: o[0]
2205
2209
  }
2206
2210
  },
2207
2211
  children: [
2208
- /* @__PURE__ */ g("cap-blocklabel", { children: [
2209
- /* @__PURE__ */ g("cap-blockname", { children: [
2210
- /* @__PURE__ */ g("small", { children: [
2211
- e.criterionLabel ?? "Items",
2212
- ":"
2213
- ] }),
2214
- /* @__PURE__ */ p("strong", { children: e.label })
2212
+ /* @__PURE__ */ h("cap-blocklabel", { children: /* @__PURE__ */ y("cap-blockname", { children: [
2213
+ /* @__PURE__ */ y("small", { children: [
2214
+ r.criterionLabel ?? "Items",
2215
+ ":"
2215
2216
  ] }),
2216
- /* @__PURE__ */ p("data", { value: String(e.count), children: e.count })
2217
- ] }),
2218
- e.children.length === 0 ? null : /* @__PURE__ */ p(
2217
+ /* @__PURE__ */ h("strong", { children: r.label }),
2218
+ /* @__PURE__ */ y("data", { value: String(r.count), children: [
2219
+ "(",
2220
+ r.count,
2221
+ ")"
2222
+ ] })
2223
+ ] }) }),
2224
+ r.children.length === 0 ? null : /* @__PURE__ */ h(
2219
2225
  "cap-blockgroup",
2220
2226
  {
2221
2227
  role: "group",
2222
- className: e.childOrientation,
2223
- children: e.children.map((a) => this.renderBlock(
2224
- a,
2225
- r,
2226
- i
2228
+ className: r.childOrientation,
2229
+ children: r.children.map((l) => this.renderBlock(
2230
+ l,
2231
+ i,
2232
+ n
2227
2233
  ))
2228
2234
  }
2229
2235
  )
2230
2236
  ]
2231
2237
  },
2232
- e.key
2238
+ r.key
2233
2239
  );
2234
2240
  }
2235
- renderPartitionError(e) {
2236
- const r = e[0], i = r == null ? "The selected criteria do not form a complete partition." : r.kind === "unmatched" ? `${r.criterionLabel} has an item with no category.` : `${r.criterionLabel} has an item matching multiple categories.`;
2237
- return /* @__PURE__ */ g("div", { role: "alert", children: [
2238
- /* @__PURE__ */ p("strong", { children: "Invalid block partition" }),
2239
- /* @__PURE__ */ g("p", { children: [
2240
- i,
2241
+ renderPartitionError(r) {
2242
+ const i = r[0], n = i == null ? "The selected criteria do not form a complete partition." : i.kind === "unmatched" ? `${i.criterionLabel} has an item with no category.` : `${i.criterionLabel} has an item matching multiple categories.`;
2243
+ return /* @__PURE__ */ y("div", { role: "alert", children: [
2244
+ /* @__PURE__ */ h("strong", { children: "Invalid block partition" }),
2245
+ /* @__PURE__ */ y("p", { children: [
2246
+ n,
2241
2247
  " ",
2242
- e.length,
2248
+ r.length,
2243
2249
  " partition issue",
2244
- e.length === 1 ? "" : "s",
2250
+ r.length === 1 ? "" : "s",
2245
2251
  " detected."
2246
2252
  ] })
2247
2253
  ] });
2248
2254
  }
2249
- blockKeyDown(e, r) {
2250
- if (e.key === "Enter" || e.key === " ") {
2251
- e.preventDefault(), this.props.model.select(r.path, "block selected by keyboard");
2255
+ reconcileLabelOrientation() {
2256
+ var s;
2257
+ if ((s = this.labelResizeObserver) == null || s.disconnect(), this.labelResizeObserver = null, !(this.dom instanceof Element)) return;
2258
+ const r = this.props.labelOrientation ?? "auto";
2259
+ st(r);
2260
+ const i = [...this.dom.querySelectorAll('[role="treeitem"]')], n = new Set(i.map((o) => o.dataset.blockKey).filter(
2261
+ (o) => o != null
2262
+ ));
2263
+ for (const o of this.measuredLabelOrientations.keys())
2264
+ n.has(o) || this.measuredLabelOrientations.delete(o);
2265
+ if (r !== "auto") {
2266
+ for (const o of i) this.setLabelOrientation(o, r);
2252
2267
  return;
2253
2268
  }
2254
- if (e.key === "Escape") {
2255
- e.preventDefault(), this.props.model.clear("block selection cleared by keyboard");
2269
+ for (const o of i)
2270
+ this.setLabelOrientation(
2271
+ o,
2272
+ this.measuredLabelOrientations.get(o.dataset.blockKey ?? "") ?? "horizontal"
2273
+ );
2274
+ if (typeof globalThis.ResizeObserver == "function") {
2275
+ this.labelResizeObserver = new ResizeObserver((o) => {
2276
+ for (const a of o) {
2277
+ const l = a.target;
2278
+ if (!(l instanceof HTMLElement)) continue;
2279
+ const u = l.dataset.blockKey;
2280
+ if (u == null) continue;
2281
+ const d = this.resolveAutoLabelOrientation(l, a.contentRect);
2282
+ this.measuredLabelOrientations.set(u, d), this.setLabelOrientation(l, d);
2283
+ }
2284
+ });
2285
+ for (const o of i) this.labelResizeObserver.observe(o);
2286
+ }
2287
+ }
2288
+ setLabelOrientation(r, i) {
2289
+ var n;
2290
+ (n = r.querySelector("cap-blocklabel")) == null || n.setAttribute("data-label-orientation", i);
2291
+ }
2292
+ resolveAutoLabelOrientation(r, i) {
2293
+ this.setLabelOrientation(r, "horizontal");
2294
+ const n = this.measureHorizontalLabelWidth(r);
2295
+ return n > 0 && i.width >= n ? "horizontal" : i.height > i.width ? "vertical" : "horizontal";
2296
+ }
2297
+ measureHorizontalLabelWidth(r) {
2298
+ var l;
2299
+ const i = r.querySelector("cap-blocklabel"), n = (l = r.ownerDocument) == null ? void 0 : l.body;
2300
+ if (i == null || n == null) return 0;
2301
+ const s = i.cloneNode(!0);
2302
+ s.style.cssText = [
2303
+ "position:fixed",
2304
+ "visibility:hidden",
2305
+ "pointer-events:none",
2306
+ "inset:auto",
2307
+ "display:flex",
2308
+ "width:max-content",
2309
+ "max-width:none",
2310
+ "height:auto",
2311
+ "overflow:visible",
2312
+ "white-space:nowrap",
2313
+ "writing-mode:horizontal-tb",
2314
+ "transform:none"
2315
+ ].join(";");
2316
+ for (const u of s.querySelectorAll("cap-blockname, small, strong"))
2317
+ u.style.overflow = "visible", u.style.minWidth = "auto";
2318
+ const o = s.querySelector("cap-blockname");
2319
+ o != null && (o.style.flex = "0 0 auto"), n.append(s);
2320
+ const a = s.getBoundingClientRect().width;
2321
+ return s.remove(), a;
2322
+ }
2323
+ blockKeyDown(r, i) {
2324
+ if (r.key === "Enter" || r.key === " ") {
2325
+ r.preventDefault(), this.props.model.select(i.path, "block selected by keyboard");
2256
2326
  return;
2257
2327
  }
2258
- const i = this.props.model.layout$.get().root, n = Dt(i.children.length === 0 ? [i] : i.children), s = n.findIndex(({ key: a }) => a === r.key);
2259
- let o;
2260
- if (e.key === "ArrowDown") o = n[s + 1];
2261
- else if (e.key === "ArrowUp") o = n[s - 1];
2262
- else if (e.key === "Home") o = n[0];
2263
- else if (e.key === "End") o = n.at(-1);
2264
- else if (e.key === "ArrowRight") o = r.children[0] ?? n[s + 1];
2265
- else if (e.key === "ArrowLeft")
2266
- o = r.path.length <= 1 ? n[s - 1] : I(i, r.path.slice(0, -1)) ?? void 0;
2328
+ if (r.key === "Escape") {
2329
+ r.preventDefault(), this.props.model.clear("block selection cleared by keyboard");
2330
+ return;
2331
+ }
2332
+ const n = this.props.model.layout$.get().root, s = Pt(n.children.length === 0 ? [n] : n.children), o = s.findIndex(({ key: l }) => l === i.key);
2333
+ let a;
2334
+ if (r.key === "ArrowDown") a = s[o + 1];
2335
+ else if (r.key === "ArrowUp") a = s[o - 1];
2336
+ else if (r.key === "Home") a = s[0];
2337
+ else if (r.key === "End") a = s.at(-1);
2338
+ else if (r.key === "ArrowRight") a = i.children[0] ?? s[o + 1];
2339
+ else if (r.key === "ArrowLeft")
2340
+ a = i.path.length <= 1 ? s[o - 1] : _(n, i.path.slice(0, -1)) ?? void 0;
2267
2341
  else return;
2268
- o != null && (e.preventDefault(), this.focusBlock(o.key));
2342
+ a != null && (r.preventDefault(), this.focusBlock(a.key));
2269
2343
  }
2270
- focusBlock(e) {
2344
+ focusBlock(r) {
2271
2345
  if (this.dom instanceof Element) {
2272
- for (const r of this.dom.querySelectorAll('[role="treeitem"]'))
2273
- if (r.dataset.blockKey === e) {
2274
- r.focus();
2346
+ for (const i of this.dom.querySelectorAll('[role="treeitem"]'))
2347
+ if (i.dataset.blockKey === r) {
2348
+ i.focus();
2275
2349
  return;
2276
2350
  }
2277
2351
  }
2278
2352
  }
2279
2353
  }
2280
- c(Y, "liveProps", []), c(Y, "hostName", "block-graph"), c(Y, "dataSurface", "data"), c(Y, "dependencies", [he, xe]), c(Y, "css", re`
2354
+ c(X, "liveProps", []), c(X, "hostName", "block-graph"), c(X, "dataSurface", "data"), c(X, "dependencies", [fe, Ce]), c(X, "css", ne`
2281
2355
  & {
2282
2356
  display: flex;
2283
2357
  min-width: 0;
@@ -2381,8 +2455,8 @@ c(Y, "liveProps", []), c(Y, "hostName", "block-graph"), c(Y, "dataSurface", "dat
2381
2455
  & [role="treeitem"] > cap-blocklabel {
2382
2456
  position: absolute;
2383
2457
  z-index: 1;
2384
- inset-block-start: 0;
2385
- inset-inline-start: 0;
2458
+ top: 0;
2459
+ left: 0;
2386
2460
  box-sizing: border-box;
2387
2461
  display: flex;
2388
2462
  flex-flow: row nowrap;
@@ -2396,6 +2470,26 @@ c(Y, "liveProps", []), c(Y, "hostName", "block-graph"), c(Y, "dataSurface", "dat
2396
2470
  cursor: pointer;
2397
2471
  }
2398
2472
 
2473
+ & [role="treeitem"] > cap-blocklabel[data-label-orientation="vertical"] {
2474
+ z-index: 4;
2475
+ top: 0;
2476
+ left: 0;
2477
+ right: auto;
2478
+ bottom: auto;
2479
+ width: 1.6em;
2480
+ height: max-content;
2481
+ writing-mode: vertical-rl;
2482
+ transform: none;
2483
+ justify-content: flex-start;
2484
+ align-items: flex-end;
2485
+ padding: 0.2rem;
2486
+ }
2487
+
2488
+ & [role="treeitem"] > cap-blocklabel[data-label-orientation="horizontal"] {
2489
+ writing-mode: horizontal-tb;
2490
+ transform: none;
2491
+ }
2492
+
2399
2493
  & [role="treeitem"][aria-selected="true"] {
2400
2494
  z-index: 3;
2401
2495
  outline: 3px solid var(--viz-selection-color, var(--colored-contrast, Highlight));
@@ -2429,19 +2523,22 @@ c(Y, "liveProps", []), c(Y, "hostName", "block-graph"), c(Y, "dataSurface", "dat
2429
2523
  }
2430
2524
 
2431
2525
  & cap-blockname > strong {
2432
- flex: 1 1 auto;
2526
+ flex: 0 1 auto;
2433
2527
  min-width: 0;
2434
2528
  overflow: hidden;
2435
2529
  text-overflow: ellipsis;
2436
2530
  white-space: nowrap;
2437
2531
  }
2438
2532
 
2439
- & cap-blocklabel > data {
2533
+ & cap-blockname > data {
2440
2534
  flex: 0 0 auto;
2441
- align-self: center;
2442
2535
  font-weight: 750;
2443
2536
  }
2444
2537
 
2538
+ & [role="treeitem"] > cap-blocklabel[data-label-orientation="vertical"] > cap-blockname {
2539
+ transform: rotate(180deg);
2540
+ }
2541
+
2445
2542
  & cap-blockgroup {
2446
2543
  position: relative;
2447
2544
  z-index: 1;
@@ -2468,16 +2565,20 @@ c(Y, "liveProps", []), c(Y, "hostName", "block-graph"), c(Y, "dataSurface", "dat
2468
2565
  }
2469
2566
  }
2470
2567
  `);
2471
- function Dt(t) {
2472
- return t.flatMap((e) => [e, ...Dt(e.children)]);
2568
+ function st(e) {
2569
+ if (e !== "auto" && e !== "horizontal" && e !== "vertical")
2570
+ throw new TypeError(`Unknown block label orientation: ${e}`);
2473
2571
  }
2474
- function Xr(t, e) {
2475
- return e != null && t.length === e.length && t.every((r, i) => {
2572
+ function Pt(e) {
2573
+ return e.flatMap((t) => [t, ...Pt(t.children)]);
2574
+ }
2575
+ function Jr(e, t) {
2576
+ return t != null && e.length === t.length && e.every((r, i) => {
2476
2577
  var n, s;
2477
- return r.criterionKey === ((n = e[i]) == null ? void 0 : n.criterionKey) && r.categoryKey === ((s = e[i]) == null ? void 0 : s.categoryKey);
2578
+ return r.criterionKey === ((n = t[i]) == null ? void 0 : n.criterionKey) && r.categoryKey === ((s = t[i]) == null ? void 0 : s.categoryKey);
2478
2579
  });
2479
2580
  }
2480
- class we extends Wt {
2581
+ class ve extends Gt {
2481
2582
  constructor(r) {
2482
2583
  super(r);
2483
2584
  c(this, "contentId");
@@ -2489,10 +2590,10 @@ class we extends Wt {
2489
2590
  throw new Error(
2490
2591
  "CollapsibleOptionGroup trailing header content must use a direct OptionGroupHeaderEnd child"
2491
2592
  );
2492
- const { content: r, regions: i } = Yt(
2593
+ const { content: r, regions: i } = Xt(
2493
2594
  "CollapsibleOptionGroup",
2494
2595
  this.props.children,
2495
- { headerEnd: Gt }
2596
+ { headerEnd: Zt }
2496
2597
  );
2497
2598
  return this.renderOptionGroup(r, i.headerEnd ?? null);
2498
2599
  }
@@ -2508,8 +2609,8 @@ class we extends Wt {
2508
2609
  busy: u = !1,
2509
2610
  error: d = null
2510
2611
  } = this.props;
2511
- return /* @__PURE__ */ g(n, { className: this.props.className ?? this.props.class ?? null, children: [
2512
- /* @__PURE__ */ g(
2612
+ return /* @__PURE__ */ y(n, { className: this.props.className ?? this.props.class ?? null, children: [
2613
+ /* @__PURE__ */ y(
2513
2614
  "fieldset",
2514
2615
  {
2515
2616
  id: this.groupId,
@@ -2520,8 +2621,8 @@ class we extends Wt {
2520
2621
  "aria-invalid": d == null ? null : "true",
2521
2622
  "aria-describedby": d == null ? null : this.errorId,
2522
2623
  children: [
2523
- /* @__PURE__ */ g("legend", { children: [
2524
- /* @__PURE__ */ p(
2624
+ /* @__PURE__ */ y("legend", { children: [
2625
+ /* @__PURE__ */ h(
2525
2626
  "button",
2526
2627
  {
2527
2628
  type: "button",
@@ -2532,10 +2633,10 @@ class we extends Wt {
2532
2633
  children: this.collapsed ? "▸" : "▾"
2533
2634
  }
2534
2635
  ),
2535
- s != null ? /* @__PURE__ */ p("span", { children: s }) : null,
2636
+ s != null ? /* @__PURE__ */ h("span", { children: s }) : null,
2536
2637
  i
2537
2638
  ] }),
2538
- /* @__PURE__ */ p("div", { id: this.contentId, hidden: this.collapsed, children: r })
2639
+ /* @__PURE__ */ h("div", { id: this.contentId, hidden: this.collapsed, children: r })
2539
2640
  ]
2540
2641
  }
2541
2642
  ),
@@ -2543,7 +2644,7 @@ class we extends Wt {
2543
2644
  ] });
2544
2645
  }
2545
2646
  }
2546
- c(we, "hostName", "collapsible-option-group"), c(we, "css", re`
2647
+ c(ve, "hostName", "collapsible-option-group"), c(ve, "css", ne`
2547
2648
  & > fieldset > legend > button.cap-collapse-toggle {
2548
2649
  display: inline-flex;
2549
2650
  align-items: center;
@@ -2578,50 +2679,50 @@ c(we, "hostName", "collapsible-option-group"), c(we, "css", re`
2578
2679
  display: none;
2579
2680
  }
2580
2681
  `);
2581
- const Zr = [
2682
+ const Qr = [
2582
2683
  ["☐", "hidden"],
2583
2684
  ["✓", "visible"]
2584
2685
  ];
2585
- class ce extends Xt {
2686
+ class ue extends Jt {
2586
2687
  render() {
2587
2688
  const {
2588
- criteria: e,
2689
+ criteria: t,
2589
2690
  label: r = "Show or hide categories",
2590
2691
  description: i = ""
2591
2692
  } = this.props, n = this.snapshot(this.props.items$), s = Array.isArray(n.value) ? n.value : [];
2592
2693
  return this.renderGroupBox(
2593
2694
  r,
2594
- /* @__PURE__ */ g("cap-categoryhidecontent", { children: [
2595
- /* @__PURE__ */ p("p", { children: i }),
2596
- n.fetchState === S.Error ? /* @__PURE__ */ p("p", { role: "alert", children: "Category counts are unavailable." }) : null,
2597
- /* @__PURE__ */ p("cap-criteriongroups", { children: e.map((o) => {
2695
+ /* @__PURE__ */ y("cap-categoryhidecontent", { children: [
2696
+ /* @__PURE__ */ h("p", { children: i }),
2697
+ n.fetchState === S.Error ? /* @__PURE__ */ h("p", { role: "alert", children: "Category counts are unavailable." }) : null,
2698
+ /* @__PURE__ */ h("cap-criteriongroups", { children: t.map((o) => {
2598
2699
  const a = this.snapshot(o.categories$), l = Array.isArray(a.value) ? a.value : [];
2599
- return /* @__PURE__ */ g(
2600
- we,
2700
+ return /* @__PURE__ */ y(
2701
+ ve,
2601
2702
  {
2602
2703
  label: o.label,
2603
2704
  children: [
2604
- a.fetchState === S.Error ? /* @__PURE__ */ g("p", { role: "alert", children: [
2705
+ a.fetchState === S.Error ? /* @__PURE__ */ y("p", { role: "alert", children: [
2605
2706
  o.label,
2606
2707
  " categories are unavailable."
2607
2708
  ] }) : null,
2608
- a.fetchState !== S.Ready ? /* @__PURE__ */ g("p", { role: "status", "aria-live": "polite", children: [
2709
+ a.fetchState !== S.Ready ? /* @__PURE__ */ y("p", { role: "status", "aria-live": "polite", children: [
2609
2710
  "Loading ",
2610
2711
  o.label,
2611
2712
  "…"
2612
2713
  ] }) : null,
2613
- /* @__PURE__ */ p("cap-categories", { children: l.map((u) => {
2614
- const d = Jr(s, u.predicate);
2615
- return /* @__PURE__ */ g(
2714
+ /* @__PURE__ */ h("cap-categories", { children: l.map((u) => {
2715
+ const d = ei(s, u.predicate);
2716
+ return /* @__PURE__ */ y(
2616
2717
  "cap-categoryoption",
2617
2718
  {
2618
- style: { ...ct(u.colors) },
2719
+ style: { ...ut(u.colors) },
2619
2720
  children: [
2620
- /* @__PURE__ */ p("cap-categoryswatch", { "aria-hidden": "true" }),
2621
- /* @__PURE__ */ p(
2622
- fe,
2721
+ /* @__PURE__ */ h("cap-categoryswatch", { "aria-hidden": "true" }),
2722
+ /* @__PURE__ */ h(
2723
+ me,
2623
2724
  {
2624
- symbols: Zr,
2725
+ symbols: Qr,
2625
2726
  label: `${u.label} (${d})`,
2626
2727
  valueEmitter: o.visibility(u.key)
2627
2728
  }
@@ -2640,7 +2741,7 @@ class ce extends Xt {
2640
2741
  );
2641
2742
  }
2642
2743
  }
2643
- c(ce, "liveProps", []), c(ce, "hostName", "category-hide-panel"), c(ce, "dependencies", [fe, we]), c(ce, "css", re`
2744
+ c(ue, "liveProps", []), c(ue, "hostName", "category-hide-panel"), c(ue, "dependencies", [me, ve]), c(ue, "css", ne`
2644
2745
  & {
2645
2746
  flex: 0 0 auto;
2646
2747
  min-width: 0;
@@ -2717,80 +2818,80 @@ c(ce, "liveProps", []), c(ce, "hostName", "category-hide-panel"), c(ce, "depende
2717
2818
  white-space: nowrap;
2718
2819
  }
2719
2820
  `);
2720
- function Jr(t, e) {
2821
+ function ei(e, t) {
2721
2822
  let r = 0;
2722
- for (const i of t)
2723
- e(i) && (r += 1);
2823
+ for (const i of e)
2824
+ t(i) && (r += 1);
2724
2825
  return r;
2725
2826
  }
2726
- const Pt = 864e5, Qr = /^(\d{4})-(\d{2})-(\d{2})$/;
2727
- function $(t) {
2728
- const e = Qr.exec(t);
2729
- if (e == null) throw new TypeError(`Invalid civil date "${t}"; expected YYYY-MM-DD`);
2730
- const r = Number(e[1]), i = Number(e[2]), n = Number(e[3]), s = Date.UTC(r, i - 1, n), o = new Date(s);
2827
+ const Nt = 864e5, ti = /^(\d{4})-(\d{2})-(\d{2})$/;
2828
+ function x(e) {
2829
+ const t = ti.exec(e);
2830
+ if (t == null) throw new TypeError(`Invalid civil date "${e}"; expected YYYY-MM-DD`);
2831
+ const r = Number(t[1]), i = Number(t[2]), n = Number(t[3]), s = Date.UTC(r, i - 1, n), o = new Date(s);
2731
2832
  if (o.getUTCFullYear() !== r || o.getUTCMonth() !== i - 1 || o.getUTCDate() !== n)
2732
- throw new TypeError(`Invalid civil date "${t}"`);
2733
- return Math.floor(s / Pt);
2833
+ throw new TypeError(`Invalid civil date "${e}"`);
2834
+ return Math.floor(s / Nt);
2734
2835
  }
2735
- function U(t) {
2736
- if (!Number.isInteger(t)) throw new TypeError("Civil day must be an integer");
2737
- return new Date(t * Pt).toISOString().slice(0, 10);
2836
+ function H(e) {
2837
+ if (!Number.isInteger(e)) throw new TypeError("Civil day must be an integer");
2838
+ return new Date(e * Nt).toISOString().slice(0, 10);
2738
2839
  }
2739
- function ei(t, e) {
2740
- if (!Number.isInteger(e)) throw new TypeError("Civil date offset must be an integer");
2741
- return U($(t) + e);
2840
+ function ri(e, t) {
2841
+ if (!Number.isInteger(t)) throw new TypeError("Civil date offset must be an integer");
2842
+ return H(x(e) + t);
2742
2843
  }
2743
- function ti(t = /* @__PURE__ */ new Date()) {
2744
- if (!(t instanceof Date) || Number.isNaN(t.getTime()))
2844
+ function ii(e = /* @__PURE__ */ new Date()) {
2845
+ if (!(e instanceof Date) || Number.isNaN(e.getTime()))
2745
2846
  throw new TypeError("todayCivilDate requires a valid Date");
2746
- return `${String(t.getUTCFullYear()).padStart(4, "0")}-${String(
2747
- t.getUTCMonth() + 1
2748
- ).padStart(2, "0")}-${String(t.getUTCDate()).padStart(2, "0")}`;
2749
- }
2750
- function ri(t, e) {
2751
- return $(t) - $(e);
2752
- }
2753
- function ii(t, e = {}) {
2754
- var He, Ve, We, Ye;
2755
- ci(t);
2756
- const r = ot(e.width ?? 960, "Chart width"), i = ot(e.height ?? 420, "Chart height"), n = Math.min(72, r * 0.18), s = 24, o = Math.max(1, r - n - 24), a = Math.max(1, i - s - 58), l = t.flatMap((w) => Object.keys(w.values)), u = e.today ?? ti(), d = ((He = e.range) == null ? void 0 : He.minX) ?? ui(l) ?? u, h = ((Ve = e.range) == null ? void 0 : Ve.maxX) ?? u, k = $(d), b = $(h);
2757
- if (k > b) throw new RangeError("Line graph minX must not be after maxX");
2758
- const y = ai(t, k, b), f = e.stacked ?? !1, z = t.map((w) => ({
2759
- shape: w,
2760
- values: y.map((V) => Kt(w, V))
2847
+ return `${String(e.getUTCFullYear()).padStart(4, "0")}-${String(
2848
+ e.getUTCMonth() + 1
2849
+ ).padStart(2, "0")}-${String(e.getUTCDate()).padStart(2, "0")}`;
2850
+ }
2851
+ function ni(e, t) {
2852
+ return x(e) - x(t);
2853
+ }
2854
+ function si(e, t = {}) {
2855
+ var Ue, He, Ve, We;
2856
+ di(e);
2857
+ const r = ot(t.width ?? 960, "Chart width"), i = ot(t.height ?? 420, "Chart height"), n = Math.min(72, r * 0.18), s = 24, o = Math.max(1, r - n - 24), a = Math.max(1, i - s - 58), l = e.flatMap((v) => Object.keys(v.values)), u = t.today ?? ii(), d = ((Ue = t.range) == null ? void 0 : Ue.minX) ?? pi(l) ?? u, p = ((He = t.range) == null ? void 0 : He.maxX) ?? u, b = x(d), w = x(p);
2858
+ if (b > w) throw new RangeError("Line graph minX must not be after maxX");
2859
+ const g = ci(e, b, w), f = t.stacked ?? !1, E = e.map((v) => ({
2860
+ shape: v,
2861
+ values: g.map((Y) => It(v, Y))
2761
2862
  }));
2762
- let R = ((We = e.range) == null ? void 0 : We.minY) ?? 0, ne = R;
2763
- const qe = Array.from({ length: y.length }, () => 0), It = z.map(({ shape: w, values: V }) => {
2764
- const W = V.map((se, K) => {
2765
- const oe = f ? qe[K] : 0, ae = oe + se;
2766
- return f && (qe[K] = ae), R = Math.min(R, oe, ae), ne = Math.max(ne, oe, ae), { value: se, baseValue: oe, displayValue: ae };
2863
+ let T = ((Ve = t.range) == null ? void 0 : Ve.minY) ?? 0, N = T;
2864
+ const W = Array.from({ length: g.length }, () => 0), _t = E.map(({ shape: v, values: Y }) => {
2865
+ const G = Y.map((oe, I) => {
2866
+ const ae = f ? W[I] : 0, le = ae + oe;
2867
+ return f && (W[I] = le), T = Math.min(T, ae, le), N = Math.max(N, ae, le), { value: oe, baseValue: ae, displayValue: le };
2767
2868
  });
2768
- return { shape: w, entries: W };
2769
- }), _t = Math.max(1, ne - R), N = ne + _t * 0.05, Ee = ((Ye = e.range) == null ? void 0 : Ye.minY) ?? R, $e = Math.max(1, N - Ee), Ue = Math.max(1, b - k), Bt = It.map(({ shape: w, entries: V }) => ({
2770
- key: w.key,
2771
- label: w.label,
2772
- color: w.color,
2773
- ...w.colorKey === void 0 ? {} : { colorKey: w.colorKey },
2774
- shape: w,
2775
- points: Object.freeze(V.map((W, se) => {
2776
- const K = y[se];
2869
+ return { shape: v, entries: G };
2870
+ }), Bt = Math.max(1, N - T), K = N + Bt * 0.05, $e = ((We = t.range) == null ? void 0 : We.minY) ?? T, xe = Math.max(1, K - $e), Fe = Math.max(1, w - b), qt = _t.map(({ shape: v, entries: Y }) => ({
2871
+ key: v.key,
2872
+ label: v.label,
2873
+ color: v.color,
2874
+ ...v.colorKey === void 0 ? {} : { colorKey: v.colorKey },
2875
+ shape: v,
2876
+ points: Object.freeze(Y.map((G, oe) => {
2877
+ const I = g[oe];
2777
2878
  return Object.freeze({
2778
- date: U(K),
2779
- day: K,
2780
- ...W,
2781
- x: n + (K - k) / Ue * o,
2782
- y: s + (N - W.displayValue) / $e * a,
2783
- baseY: s + (N - W.baseValue) / $e * a
2879
+ date: H(I),
2880
+ day: I,
2881
+ ...G,
2882
+ x: n + (I - b) / Fe * o,
2883
+ y: s + (K - G.displayValue) / xe * a,
2884
+ baseY: s + (K - G.baseValue) / xe * a
2784
2885
  });
2785
2886
  }))
2786
2887
  }));
2787
2888
  return Object.freeze({
2788
2889
  minDate: d,
2789
- maxDate: h,
2790
- minDay: k,
2791
- maxDay: b,
2792
- minY: Ee,
2793
- maxY: N,
2890
+ maxDate: p,
2891
+ minDay: b,
2892
+ maxDay: w,
2893
+ minY: $e,
2894
+ maxY: K,
2794
2895
  width: r,
2795
2896
  height: i,
2796
2897
  plotLeft: n,
@@ -2798,110 +2899,110 @@ function ii(t, e = {}) {
2798
2899
  plotWidth: o,
2799
2900
  plotHeight: a,
2800
2901
  stacked: f,
2801
- series: Object.freeze(Bt),
2802
- dateMarks: Object.freeze(li(k, b, e.maxDateMarks ?? 8).map((w) => ({
2803
- date: U(w),
2804
- day: w,
2805
- x: n + (w - k) / Ue * o
2902
+ series: Object.freeze(qt),
2903
+ dateMarks: Object.freeze(ui(b, w, t.maxDateMarks ?? 8).map((v) => ({
2904
+ date: H(v),
2905
+ day: v,
2906
+ x: n + (v - b) / Fe * o
2806
2907
  }))),
2807
- valueTicks: Object.freeze(oi(Ee, N).map((w) => ({
2808
- value: w,
2809
- y: s + (N - w) / $e * a
2908
+ valueTicks: Object.freeze(li($e, K).map((v) => ({
2909
+ value: v,
2910
+ y: s + (K - v) / xe * a
2810
2911
  })))
2811
2912
  });
2812
2913
  }
2813
- function ni(t, e) {
2814
- return Kt(t, $(e));
2914
+ function oi(e, t) {
2915
+ return It(e, x(t));
2815
2916
  }
2816
- function Nt(t, e) {
2817
- const r = t[0];
2917
+ function Kt(e, t) {
2918
+ const r = e[0];
2818
2919
  if (r == null) return "";
2819
- let i = `M ${v(r.x)} ${v(r.y)}`;
2820
- for (let n = 1; n < t.length; n += 1) {
2821
- const s = t[n - 1], o = t[n];
2822
- if (e) {
2920
+ let i = `M ${k(r.x)} ${k(r.y)}`;
2921
+ for (let n = 1; n < e.length; n += 1) {
2922
+ const s = e[n - 1], o = e[n];
2923
+ if (t) {
2823
2924
  const a = (s.x + o.x) / 2;
2824
- i += ` C ${v(a)} ${v(s.y)}, ${v(a)} ${v(o.y)}, ${v(o.x)} ${v(o.y)}`;
2925
+ i += ` C ${k(a)} ${k(s.y)}, ${k(a)} ${k(o.y)}, ${k(o.x)} ${k(o.y)}`;
2825
2926
  } else
2826
- i += ` H ${v(o.x)} V ${v(o.y)}`;
2927
+ i += ` H ${k(o.x)} V ${k(o.y)}`;
2827
2928
  }
2828
2929
  return i;
2829
2930
  }
2830
- function si(t, e) {
2831
- if (t.length === 0) return "";
2832
- const r = Nt(t, e), i = [...t].reverse();
2931
+ function ai(e, t) {
2932
+ if (e.length === 0) return "";
2933
+ const r = Kt(e, t), i = [...e].reverse();
2833
2934
  let n = "";
2834
2935
  for (let s = 0; s < i.length; s += 1) {
2835
2936
  const o = i[s];
2836
- if (s === 0) n += ` L ${v(o.x)} ${v(o.baseY)}`;
2837
- else if (e) {
2937
+ if (s === 0) n += ` L ${k(o.x)} ${k(o.baseY)}`;
2938
+ else if (t) {
2838
2939
  const a = i[s - 1], l = (a.x + o.x) / 2;
2839
- n += ` C ${v(l)} ${v(a.baseY)}, ${v(l)} ${v(o.baseY)}, ${v(o.x)} ${v(o.baseY)}`;
2940
+ n += ` C ${k(l)} ${k(a.baseY)}, ${k(l)} ${k(o.baseY)}, ${k(o.x)} ${k(o.baseY)}`;
2840
2941
  } else
2841
- n += ` H ${v(o.x)} V ${v(o.baseY)}`;
2942
+ n += ` H ${k(o.x)} V ${k(o.baseY)}`;
2842
2943
  }
2843
2944
  return `${r}${n} Z`;
2844
2945
  }
2845
- function oi(t, e, r = 6) {
2846
- if (!Number.isFinite(t) || !Number.isFinite(e) || t > e)
2946
+ function li(e, t, r = 6) {
2947
+ if (!Number.isFinite(e) || !Number.isFinite(t) || e > t)
2847
2948
  throw new RangeError("Tick range must contain finite ascending values");
2848
2949
  if (!Number.isInteger(r) || r < 2) throw new RangeError("Tick target must be at least two");
2849
- const n = Math.max(1, e - t) / (r - 1), s = 10 ** Math.floor(Math.log10(n)), o = n / s, a = o <= 1 ? 1 : o <= 2 ? 2 : o <= 5 ? 5 : 10, l = Math.max(1, a * s), u = Math.ceil(t / l) * l, d = [];
2850
- for (let h = u; h <= e + l / 1e3; h += l)
2851
- d.push(Number(h.toFixed(10)));
2852
- return d.length === 0 && d.push(Math.ceil(t)), d;
2853
- }
2854
- function ai(t, e, r) {
2855
- const i = /* @__PURE__ */ new Set([e, r]);
2856
- for (const n of t)
2950
+ const n = Math.max(1, t - e) / (r - 1), s = 10 ** Math.floor(Math.log10(n)), o = n / s, a = o <= 1 ? 1 : o <= 2 ? 2 : o <= 5 ? 5 : 10, l = Math.max(1, a * s), u = Math.ceil(e / l) * l, d = [];
2951
+ for (let p = u; p <= t + l / 1e3; p += l)
2952
+ d.push(Number(p.toFixed(10)));
2953
+ return d.length === 0 && d.push(Math.ceil(e)), d;
2954
+ }
2955
+ function ci(e, t, r) {
2956
+ const i = /* @__PURE__ */ new Set([t, r]);
2957
+ for (const n of e)
2857
2958
  for (const s of Object.keys(n.values)) {
2858
- const o = $(s);
2859
- o >= e && o <= r && i.add(o);
2959
+ const o = x(s);
2960
+ o >= t && o <= r && i.add(o);
2860
2961
  }
2861
2962
  return [...i].sort((n, s) => n - s);
2862
2963
  }
2863
- function Kt(t, e) {
2864
- const r = t.values[U(e)];
2964
+ function It(e, t) {
2965
+ const r = e.values[H(t)];
2865
2966
  if (r !== void 0) return r;
2866
- if (t.carryForward !== !0) return 0;
2967
+ if (e.carryForward !== !0) return 0;
2867
2968
  let i = Number.NEGATIVE_INFINITY, n = 0;
2868
- for (const [s, o] of Object.entries(t.values)) {
2869
- const a = $(s);
2870
- a <= e && a > i && (i = a, n = o);
2969
+ for (const [s, o] of Object.entries(e.values)) {
2970
+ const a = x(s);
2971
+ a <= t && a > i && (i = a, n = o);
2871
2972
  }
2872
2973
  return n;
2873
2974
  }
2874
- function li(t, e, r) {
2975
+ function ui(e, t, r) {
2875
2976
  if (!Number.isInteger(r) || r < 2)
2876
2977
  throw new RangeError("Maximum date marks must be at least two");
2877
- const i = Math.max(0, e - t), n = i <= 62 ? 7 : i <= 730 ? 30 : 365, s = Math.max(n, Math.ceil(Math.max(1, i) / (r - 1))), o = [t];
2878
- for (let a = t + s; a < e; a += s) o.push(a);
2879
- return e !== t && o.push(e), o;
2880
- }
2881
- function ci(t) {
2882
- if (!Array.isArray(t)) throw new TypeError("History shapes must be an array");
2883
- const e = /* @__PURE__ */ new Set();
2884
- for (const r of t) {
2978
+ const i = Math.max(0, t - e), n = i <= 62 ? 7 : i <= 730 ? 30 : 365, s = Math.max(n, Math.ceil(Math.max(1, i) / (r - 1))), o = [e];
2979
+ for (let a = e + s; a < t; a += s) o.push(a);
2980
+ return t !== e && o.push(t), o;
2981
+ }
2982
+ function di(e) {
2983
+ if (!Array.isArray(e)) throw new TypeError("History shapes must be an array");
2984
+ const t = /* @__PURE__ */ new Set();
2985
+ for (const r of e) {
2885
2986
  if (r == null || typeof r != "object") throw new TypeError("History shape must be an object");
2886
- if (typeof r.key != "string" || r.key.trim() === "" || e.has(r.key))
2987
+ if (typeof r.key != "string" || r.key.trim() === "" || t.has(r.key))
2887
2988
  throw new Error("History shape keys must be non-empty and unique");
2888
- if (e.add(r.key), typeof r.label != "string" || r.label.trim() === "")
2989
+ if (t.add(r.key), typeof r.label != "string" || r.label.trim() === "")
2889
2990
  throw new TypeError("History shape label must be a non-empty string");
2890
2991
  if (typeof r.color != "string" || r.color.trim() === "")
2891
2992
  throw new TypeError("History shape color must be a non-empty CSS value");
2892
2993
  for (const [i, n] of Object.entries(r.values))
2893
- if ($(i), !Number.isFinite(n)) throw new TypeError("History shape values must be finite");
2994
+ if (x(i), !Number.isFinite(n)) throw new TypeError("History shape values must be finite");
2894
2995
  }
2895
2996
  }
2896
- function ui(t) {
2897
- return t.length === 0 ? void 0 : t.reduce((e, r) => $(e) <= $(r) ? e : r);
2997
+ function pi(e) {
2998
+ return e.length === 0 ? void 0 : e.reduce((t, r) => x(t) <= x(r) ? t : r);
2898
2999
  }
2899
- function ot(t, e) {
2900
- if (!Number.isFinite(t) || t <= 0) throw new RangeError(`${e} must be positive`);
2901
- return t;
3000
+ function ot(e, t) {
3001
+ if (!Number.isFinite(e) || e <= 0) throw new RangeError(`${t} must be positive`);
3002
+ return e;
2902
3003
  }
2903
- function v(t) {
2904
- return Number(t.toFixed(3)).toString();
3004
+ function k(e) {
3005
+ return Number(e.toFixed(3)).toString();
2905
3006
  }
2906
3007
  class je extends Ne {
2907
3008
  constructor(r) {
@@ -2926,7 +3027,7 @@ class je extends Ne {
2926
3027
  let u = null;
2927
3028
  if (this.currentModel = null, l === S.Ready)
2928
3029
  try {
2929
- this.currentModel = ii(r.value, {
3030
+ this.currentModel = si(r.value, {
2930
3031
  stacked: i.value,
2931
3032
  range: s.value,
2932
3033
  width: Math.max(480, this.observedWidth),
@@ -2935,17 +3036,17 @@ class je extends Ne {
2935
3036
  } catch (f) {
2936
3037
  u = f;
2937
3038
  }
2938
- const d = this.currentModel, h = d == null ? null : o ?? d.maxDate, k = this.props.formatDate ?? ((f) => f), b = this.props.formatValue ?? ((f) => String(f)), y = this.Host;
2939
- return /* @__PURE__ */ g(
2940
- y,
3039
+ const d = this.currentModel, p = d == null ? null : o ?? d.maxDate, b = this.props.formatDate ?? ((f) => f), w = this.props.formatValue ?? ((f) => String(f)), g = this.Host;
3040
+ return /* @__PURE__ */ y(
3041
+ g,
2941
3042
  {
2942
3043
  className: (this.props.className ?? this.props.class ?? "") || null,
2943
3044
  "aria-label": a,
2944
3045
  "aria-busy": l !== S.Ready ? "true" : null,
2945
3046
  children: [
2946
- /* @__PURE__ */ g("header", { children: [
2947
- /* @__PURE__ */ p("h2", { children: a }),
2948
- /* @__PURE__ */ g("p", { children: [
3047
+ /* @__PURE__ */ y("header", { children: [
3048
+ /* @__PURE__ */ h("h2", { children: a }),
3049
+ /* @__PURE__ */ y("p", { children: [
2949
3050
  i.value ? "Stacked area" : "Individual line",
2950
3051
  " chart;",
2951
3052
  " ",
@@ -2953,7 +3054,7 @@ class je extends Ne {
2953
3054
  " rendering."
2954
3055
  ] })
2955
3056
  ] }),
2956
- l === S.Error || u != null ? /* @__PURE__ */ p("p", { role: "alert", children: "The history chart could not be calculated." }) : l !== S.Ready ? /* @__PURE__ */ p("p", { role: "status", "aria-live": "polite", children: "Loading history chart…" }) : r.value.length === 0 ? /* @__PURE__ */ p("p", { role: "status", children: this.props.emptyMessage ?? "No history values are available." }) : /* @__PURE__ */ p(
3057
+ l === S.Error || u != null ? /* @__PURE__ */ h("p", { role: "alert", children: "The history chart could not be calculated." }) : l !== S.Ready ? /* @__PURE__ */ h("p", { role: "status", "aria-live": "polite", children: "Loading history chart…" }) : r.value.length === 0 ? /* @__PURE__ */ h("p", { role: "status", children: this.props.emptyMessage ?? "No history values are available." }) : /* @__PURE__ */ h(
2957
3058
  "cap-chart",
2958
3059
  {
2959
3060
  tabIndex: 0,
@@ -2964,18 +3065,18 @@ class je extends Ne {
2964
3065
  ref: (f) => this.chartHost = f
2965
3066
  }
2966
3067
  ),
2967
- d == null || h == null ? null : /* @__PURE__ */ g("cap-readout", { children: [
2968
- /* @__PURE__ */ p("p", { "aria-live": "polite", children: /* @__PURE__ */ p("strong", { children: k(h) }) }),
2969
- /* @__PURE__ */ p("ul", { children: d.series.map(({ shape: f }) => /* @__PURE__ */ g("li", { children: [
2970
- /* @__PURE__ */ p(
3068
+ d == null || p == null ? null : /* @__PURE__ */ y("cap-readout", { children: [
3069
+ /* @__PURE__ */ h("p", { "aria-live": "polite", children: /* @__PURE__ */ h("strong", { children: b(p) }) }),
3070
+ /* @__PURE__ */ h("ul", { children: d.series.map(({ shape: f }) => /* @__PURE__ */ y("li", { children: [
3071
+ /* @__PURE__ */ h(
2971
3072
  "cap-swatch",
2972
3073
  {
2973
3074
  style: { "--colored-base": f.color },
2974
3075
  "aria-hidden": "true"
2975
3076
  }
2976
3077
  ),
2977
- /* @__PURE__ */ p("span", { children: f.label }),
2978
- /* @__PURE__ */ p("strong", { children: b(ni(f, h)) })
3078
+ /* @__PURE__ */ h("span", { children: f.label }),
3079
+ /* @__PURE__ */ h("strong", { children: w(oi(f, p)) })
2979
3080
  ] }, f.key)) })
2980
3081
  ] })
2981
3082
  ]
@@ -3002,7 +3103,7 @@ class je extends Ne {
3002
3103
  }), this.resizeObserver.observe(this.chartHost));
3003
3104
  }
3004
3105
  source(r, i) {
3005
- if (di(r)) return r;
3106
+ if (hi(r)) return r;
3006
3107
  const n = new D(r, { owner: this, purpose: i });
3007
3108
  return this.ownedSources.push(n), n;
3008
3109
  }
@@ -3012,12 +3113,12 @@ class je extends Ne {
3012
3113
  const s = n.getBoundingClientRect();
3013
3114
  if (s.width <= 0) return;
3014
3115
  const o = (r.clientX - s.left) / s.width * i.width, a = Math.max(0, Math.min(1, (o - i.plotLeft) / i.plotWidth)), l = Math.round(i.minDay + a * (i.maxDay - i.minDay));
3015
- this.cursorDate$.set(U(l), "line graph pointer moved");
3116
+ this.cursorDate$.set(H(l), "line graph pointer moved");
3016
3117
  }
3017
3118
  cursorKeyDown(r) {
3018
3119
  const i = this.currentModel;
3019
3120
  if (i == null) return;
3020
- let n = $(this.cursorDate$.get() ?? i.maxDate);
3121
+ let n = x(this.cursorDate$.get() ?? i.maxDate);
3021
3122
  if (r.key === "ArrowLeft") n -= r.shiftKey ? 7 : 1;
3022
3123
  else if (r.key === "ArrowRight") n += r.shiftKey ? 7 : 1;
3023
3124
  else if (r.key === "Home") n = i.minDay;
@@ -3027,35 +3128,35 @@ class je extends Ne {
3027
3128
  return;
3028
3129
  } else return;
3029
3130
  r.preventDefault();
3030
- const s = U(Math.max(i.minDay, Math.min(i.maxDay, n)));
3131
+ const s = H(Math.max(i.minDay, Math.min(i.maxDay, n)));
3031
3132
  this.cursorDate$.set(s, "line graph cursor moved by keyboard");
3032
3133
  }
3033
3134
  drawChart() {
3034
3135
  const r = this.chartHost, i = this.currentModel;
3035
3136
  if (r == null || i == null) return;
3036
- const n = this.smooth$.get(), s = A("svg");
3137
+ const n = this.smooth$.get(), s = R("svg");
3037
3138
  s.setAttribute("viewBox", `0 0 ${i.width} ${i.height}`), s.setAttribute("role", "img"), s.setAttribute("aria-label", this.props.label ?? "History chart");
3038
3139
  for (const a of i.valueTicks) {
3039
- const l = A("line");
3040
- l.classList.add("gridline"), G(l, {
3140
+ const l = R("line");
3141
+ l.classList.add("gridline"), Z(l, {
3041
3142
  x1: i.plotLeft,
3042
3143
  x2: i.plotLeft + i.plotWidth,
3043
3144
  y1: a.y,
3044
3145
  y2: a.y
3045
3146
  }), s.append(l);
3046
- const u = A("text");
3047
- u.classList.add("axismark"), G(u, { x: i.plotLeft - 8, y: a.y + 4, "text-anchor": "end" }), u.textContent = String(a.value), s.append(u);
3147
+ const u = R("text");
3148
+ u.classList.add("axismark"), Z(u, { x: i.plotLeft - 8, y: a.y + 4, "text-anchor": "end" }), u.textContent = String(a.value), s.append(u);
3048
3149
  }
3049
3150
  for (const a of i.dateMarks) {
3050
- const l = A("line");
3051
- l.classList.add("gridline"), G(l, {
3151
+ const l = R("line");
3152
+ l.classList.add("gridline"), Z(l, {
3052
3153
  x1: a.x,
3053
3154
  x2: a.x,
3054
3155
  y1: i.plotTop,
3055
3156
  y2: i.plotTop + i.plotHeight
3056
3157
  }), s.append(l);
3057
- const u = A("text");
3058
- u.classList.add("axismark"), G(u, {
3158
+ const u = R("text");
3159
+ u.classList.add("axismark"), Z(u, {
3059
3160
  x: a.x,
3060
3161
  y: i.plotTop + i.plotHeight + 22,
3061
3162
  "text-anchor": "middle"
@@ -3063,16 +3164,16 @@ class je extends Ne {
3063
3164
  }
3064
3165
  for (const a of i.series) {
3065
3166
  if (i.stacked) {
3066
- const u = A("path");
3067
- u.classList.add("seriesarea"), u.setAttribute("fill", a.color), u.setAttribute("d", si(a.points, n)), s.append(u);
3167
+ const u = R("path");
3168
+ u.classList.add("seriesarea"), u.setAttribute("fill", a.color), u.setAttribute("d", ai(a.points, n)), s.append(u);
3068
3169
  }
3069
- const l = A("path");
3070
- l.classList.add("seriesline"), l.setAttribute("stroke", a.color), l.setAttribute("d", Nt(a.points, n)), s.append(l);
3170
+ const l = R("path");
3171
+ l.classList.add("seriesline"), l.setAttribute("stroke", a.color), l.setAttribute("d", Kt(a.points, n)), s.append(l);
3071
3172
  }
3072
3173
  const o = this.cursorDate$.get();
3073
3174
  if (o != null) {
3074
- const a = $(o), l = i.plotLeft + (a - i.minDay) / Math.max(1, i.maxDay - i.minDay) * i.plotWidth, u = A("line");
3075
- u.classList.add("cursor"), G(u, {
3175
+ const a = x(o), l = i.plotLeft + (a - i.minDay) / Math.max(1, i.maxDay - i.minDay) * i.plotWidth, u = R("line");
3176
+ u.classList.add("cursor"), Z(u, {
3076
3177
  x1: l,
3077
3178
  x2: l,
3078
3179
  y1: i.plotTop,
@@ -3082,7 +3183,7 @@ class je extends Ne {
3082
3183
  r.replaceChildren(s);
3083
3184
  }
3084
3185
  }
3085
- c(je, "liveProps", []), c(je, "hostName", "line-graph"), c(je, "css", re`
3186
+ c(je, "liveProps", []), c(je, "hostName", "line-graph"), c(je, "css", ne`
3086
3187
  & {
3087
3188
  display: flex;
3088
3189
  min-width: 0;
@@ -3183,19 +3284,19 @@ c(je, "liveProps", []), c(je, "hostName", "line-graph"), c(je, "css", re`
3183
3284
  }
3184
3285
  }
3185
3286
  `);
3186
- function di(t) {
3187
- return t != null && (typeof t == "object" || typeof t == "function") && typeof Reflect.get(t, "get") == "function" && typeof Reflect.get(t, "subscribe") == "function";
3287
+ function hi(e) {
3288
+ return e != null && (typeof e == "object" || typeof e == "function") && typeof Reflect.get(e, "get") == "function" && typeof Reflect.get(e, "subscribe") == "function";
3188
3289
  }
3189
- const pi = "http://www.w3.org/2000/svg";
3190
- function A(t) {
3191
- return document.createElementNS(pi, t);
3290
+ const fi = "http://www.w3.org/2000/svg";
3291
+ function R(e) {
3292
+ return document.createElementNS(fi, e);
3192
3293
  }
3193
- function G(t, e) {
3194
- for (const [r, i] of Object.entries(e))
3195
- t.setAttribute(r, String(i));
3294
+ function Z(e, t) {
3295
+ for (const [r, i] of Object.entries(t))
3296
+ e.setAttribute(r, String(i));
3196
3297
  }
3197
- class hi {
3198
- constructor(e, r = {}) {
3298
+ class mi {
3299
+ constructor(t, r = {}) {
3199
3300
  c(this, "criteria");
3200
3301
  c(this, "presets");
3201
3302
  c(this, "order$");
@@ -3207,25 +3308,25 @@ class hi {
3207
3308
  c(this, "activeSplitsEmitter");
3208
3309
  c(this, "activeEmitters", /* @__PURE__ */ new Map());
3209
3310
  c(this, "disposed", !1);
3210
- if (!Array.isArray(e) || e.some((o) => !(o instanceof H)))
3311
+ if (!Array.isArray(t) || t.some((o) => !(o instanceof V)))
3211
3312
  throw new TypeError("Split criteria must contain GroupingCriterion instances");
3212
3313
  const i = new Map(
3213
- e.map((o) => [o.key, o])
3314
+ t.map((o) => [o.key, o])
3214
3315
  );
3215
- if (i.size !== e.length) throw new Error("Split criteria keys must be unique");
3216
- this.criteria = Object.freeze([...e]), this.byKey = i, this.presets = mi(r.presets ?? [], i);
3316
+ if (i.size !== t.length) throw new Error("Split criteria keys must be unique");
3317
+ this.criteria = Object.freeze([...t]), this.byKey = i, this.presets = gi(r.presets ?? [], i);
3217
3318
  const n = this.criteria.map(({ key: o }) => o), s = r.active ?? n;
3218
- Q(s, i, "Active split keys"), this.state$ = new D(ue(n, new Set(s)), {
3319
+ te(s, i, "Active split keys"), this.state$ = new D(de(n, new Set(s)), {
3219
3320
  owner: this,
3220
3321
  purpose: "split selection state",
3221
- equals: yi
3222
- }), this.orderEmitter = new j(
3322
+ equals: bi
3323
+ }), this.orderEmitter = new L(
3223
3324
  [this.state$],
3224
3325
  ([o]) => Object.freeze(
3225
3326
  o.order.map((a) => at(i, a))
3226
3327
  ),
3227
3328
  { owner: this, purpose: "ordered visualization criteria" }
3228
- ), this.order$ = this.orderEmitter, this.activeSplitsEmitter = new j(
3329
+ ), this.order$ = this.orderEmitter, this.activeSplitsEmitter = new L(
3229
3330
  [this.state$],
3230
3331
  ([o]) => Object.freeze(o.order.filter((a) => o.active.has(a)).map((a) => at(i, a))),
3231
3332
  { owner: this, purpose: "active ordered visualization splits" }
@@ -3234,83 +3335,83 @@ class hi {
3234
3335
  purpose: "active visualization split preset"
3235
3336
  });
3236
3337
  }
3237
- activeState(e) {
3338
+ activeState(t) {
3238
3339
  this.assertActive();
3239
- const r = this.requireKey(e);
3340
+ const r = this.requireKey(t);
3240
3341
  let i = this.activeEmitters.get(r);
3241
- return i == null && (i = new fi(this, r), this.activeEmitters.set(r, i)), i;
3342
+ return i == null && (i = new yi(this, r), this.activeEmitters.set(r, i)), i;
3242
3343
  }
3243
- isActive(e) {
3244
- return this.state$.get().active.has(this.requireKey(e));
3344
+ isActive(t) {
3345
+ return this.state$.get().active.has(this.requireKey(t));
3245
3346
  }
3246
- toggle(e, r) {
3347
+ toggle(t, r) {
3247
3348
  this.assertActive();
3248
- const i = this.requireKey(e), n = this.state$.get(), s = new Set(n.active);
3349
+ const i = this.requireKey(t), n = this.state$.get(), s = new Set(n.active);
3249
3350
  return s.has(i) ? s.delete(i) : s.add(i), this.activePreset$.set(null, "split selection customized"), this.state$.set(
3250
- ue(n.order, s),
3351
+ de(n.order, s),
3251
3352
  r ?? `${i} split toggled`
3252
3353
  );
3253
3354
  }
3254
- move(e, r, i) {
3355
+ move(t, r, i) {
3255
3356
  this.assertActive();
3256
- const n = this.requireKey(e);
3357
+ const n = this.requireKey(t);
3257
3358
  if (!Number.isInteger(r)) throw new TypeError("Split target index must be an integer");
3258
3359
  const s = this.state$.get(), o = s.order.indexOf(n), a = Math.max(0, Math.min(r, s.order.length - 1));
3259
3360
  if (o === a) return !1;
3260
3361
  const l = [...s.order];
3261
3362
  return l.splice(o, 1), l.splice(a, 0, n), this.activePreset$.set(null, "split order customized"), this.state$.set(
3262
- ue(l, s.active),
3363
+ de(l, s.active),
3263
3364
  i ?? `${n} split moved`
3264
3365
  );
3265
3366
  }
3266
- moveBy(e, r, i) {
3367
+ moveBy(t, r, i) {
3267
3368
  if (!Number.isInteger(r)) throw new TypeError("Split move offset must be an integer");
3268
- const n = this.requireKey(e);
3369
+ const n = this.requireKey(t);
3269
3370
  return this.move(
3270
3371
  n,
3271
3372
  this.state$.get().order.indexOf(n) + r,
3272
3373
  i
3273
3374
  );
3274
3375
  }
3275
- setSplits(e, r, i) {
3276
- this.assertActive(), Q(e, this.byKey, "Active split keys");
3277
- const n = new Set(e), s = r ?? this.state$.get().order.filter((a) => !n.has(a));
3278
- Q(s, this.byKey, "Inactive split keys");
3279
- const o = [...e, ...s];
3376
+ setSplits(t, r, i) {
3377
+ this.assertActive(), te(t, this.byKey, "Active split keys");
3378
+ const n = new Set(t), s = r ?? this.state$.get().order.filter((a) => !n.has(a));
3379
+ te(s, this.byKey, "Inactive split keys");
3380
+ const o = [...t, ...s];
3280
3381
  if (new Set(o).size !== this.criteria.length || o.length !== this.criteria.length)
3281
3382
  throw new Error("Active and inactive split keys must cover every criterion exactly once");
3282
3383
  return this.activePreset$.set(null, "split selection replaced"), this.state$.set(
3283
- ue(o, n),
3384
+ de(o, n),
3284
3385
  i ?? "split selection replaced"
3285
3386
  );
3286
3387
  }
3287
- applyPreset(e) {
3388
+ applyPreset(t) {
3288
3389
  this.assertActive();
3289
- const r = this.presets.find(({ key: n }) => n === e);
3290
- if (r == null) throw new Error(`Unknown split preset "${e}"`);
3390
+ const r = this.presets.find(({ key: n }) => n === t);
3391
+ if (r == null) throw new Error(`Unknown split preset "${t}"`);
3291
3392
  const i = this.setSplits(r.active, r.inactive, `${r.key} preset applied`);
3292
3393
  return this.activePreset$.set(r.key, `${r.key} preset applied`), i;
3293
3394
  }
3294
3395
  dispose() {
3295
3396
  if (!this.disposed) {
3296
3397
  this.disposed = !0;
3297
- for (const e of this.activeEmitters.values()) e.dispose();
3398
+ for (const t of this.activeEmitters.values()) t.dispose();
3298
3399
  this.activeEmitters.clear(), this.activePreset$.dispose(), this.activeSplitsEmitter.dispose(), this.orderEmitter.dispose(), this.state$.dispose();
3299
3400
  }
3300
3401
  }
3301
- requireKey(e) {
3302
- if (typeof e != "string" || !this.byKey.has(e))
3303
- throw new Error(`Unknown criterion key "${String(e)}"`);
3304
- return e;
3402
+ requireKey(t) {
3403
+ if (typeof t != "string" || !this.byKey.has(t))
3404
+ throw new Error(`Unknown criterion key "${String(t)}"`);
3405
+ return t;
3305
3406
  }
3306
3407
  assertActive() {
3307
3408
  if (this.disposed) throw new Error("Split selection model is disposed");
3308
3409
  }
3309
3410
  }
3310
- function Ti(t, e = {}) {
3311
- return new hi(t, e);
3411
+ function Oi(e, t = {}) {
3412
+ return new mi(e, t);
3312
3413
  }
3313
- class fi extends Pe {
3414
+ class yi extends ct {
3314
3415
  constructor(r, i) {
3315
3416
  super(r.isActive(i) ? "visible" : "hidden", {
3316
3417
  owner: r,
@@ -3342,45 +3443,45 @@ class fi extends Pe {
3342
3443
  });
3343
3444
  }
3344
3445
  }
3345
- function mi(t, e) {
3346
- if (!Array.isArray(t)) throw new TypeError("Split presets must be an array");
3446
+ function gi(e, t) {
3447
+ if (!Array.isArray(e)) throw new TypeError("Split presets must be an array");
3347
3448
  const r = /* @__PURE__ */ new Set();
3348
- return Object.freeze(t.map((i) => {
3449
+ return Object.freeze(e.map((i) => {
3349
3450
  if (i == null || typeof i != "object" || Array.isArray(i))
3350
3451
  throw new TypeError("Split preset must be an object");
3351
3452
  if (typeof i.key != "string" || i.key.trim() === "" || r.has(i.key))
3352
3453
  throw new Error("Split preset keys must be non-empty and unique");
3353
3454
  if (typeof i.label != "string" || i.label.trim() === "")
3354
3455
  throw new TypeError("Split preset label must be a non-empty string");
3355
- r.add(i.key), Q(i.active, e, `${i.key} active keys`);
3356
- const n = Object.freeze([...i.active]), s = i.inactive == null ? Object.freeze([...e.keys()].filter((o) => !n.includes(o))) : Object.freeze([...i.inactive]);
3357
- if (Q(s, e, `${i.key} inactive keys`), (/* @__PURE__ */ new Set([...n, ...s])).size !== e.size || n.length + s.length !== e.size)
3456
+ r.add(i.key), te(i.active, t, `${i.key} active keys`);
3457
+ const n = Object.freeze([...i.active]), s = i.inactive == null ? Object.freeze([...t.keys()].filter((o) => !n.includes(o))) : Object.freeze([...i.inactive]);
3458
+ if (te(s, t, `${i.key} inactive keys`), (/* @__PURE__ */ new Set([...n, ...s])).size !== t.size || n.length + s.length !== t.size)
3358
3459
  throw new Error(`Split preset "${i.key}" must cover every criterion exactly once`);
3359
3460
  return Object.freeze({ ...i, active: n, inactive: s });
3360
3461
  }));
3361
3462
  }
3362
- function Q(t, e, r) {
3363
- if (!Array.isArray(t)) throw new TypeError(`${r} must be an array`);
3364
- if (new Set(t).size !== t.length) throw new Error(`${r} must be unique`);
3365
- for (const n of t)
3366
- if (!e.has(n)) throw new Error(`${r} contains unknown criterion "${n}"`);
3463
+ function te(e, t, r) {
3464
+ if (!Array.isArray(e)) throw new TypeError(`${r} must be an array`);
3465
+ if (new Set(e).size !== e.length) throw new Error(`${r} must be unique`);
3466
+ for (const n of e)
3467
+ if (!t.has(n)) throw new Error(`${r} contains unknown criterion "${n}"`);
3367
3468
  }
3368
- function at(t, e) {
3369
- const r = t.get(e);
3370
- if (r == null) throw new Error(`Missing criterion "${e}"`);
3469
+ function at(e, t) {
3470
+ const r = e.get(t);
3471
+ if (r == null) throw new Error(`Missing criterion "${t}"`);
3371
3472
  return r;
3372
3473
  }
3373
- function ue(t, e) {
3374
- return Object.freeze({ order: Object.freeze([...t]), active: new Set(e) });
3474
+ function de(e, t) {
3475
+ return Object.freeze({ order: Object.freeze([...e]), active: new Set(t) });
3375
3476
  }
3376
- function yi(t, e) {
3377
- return t.order.length === e.order.length && t.order.every((r, i) => r === e.order[i]) && t.active.size === e.active.size && [...t.active].every((r) => e.active.has(r));
3477
+ function bi(e, t) {
3478
+ return e.order.length === t.order.length && e.order.every((r, i) => r === t.order[i]) && e.active.size === t.active.size && [...e.active].every((r) => t.active.has(r));
3378
3479
  }
3379
- const gi = [
3480
+ const wi = [
3380
3481
  ["☐", "hidden"],
3381
3482
  ["✓", "visible"]
3382
3483
  ];
3383
- class de extends Ne {
3484
+ class pe extends Ne {
3384
3485
  constructor() {
3385
3486
  super(...arguments);
3386
3487
  c(this, "draggingKey", null);
@@ -3401,9 +3502,9 @@ class de extends Ne {
3401
3502
  } = this.props, o = this.read(r.order$);
3402
3503
  this.read(r.activeSplits$);
3403
3504
  const a = this.read(r.activePreset$), l = this.Host;
3404
- return /* @__PURE__ */ g(l, { children: [
3405
- r.presets.length === 0 ? null : /* @__PURE__ */ p(Ce, { header: s, children: /* @__PURE__ */ p("cap-presets", { children: r.presets.map((u) => /* @__PURE__ */ p(
3406
- he,
3505
+ return /* @__PURE__ */ y(l, { children: [
3506
+ r.presets.length === 0 ? null : /* @__PURE__ */ h(ze, { header: s, children: /* @__PURE__ */ h("cap-presets", { children: r.presets.map((u) => /* @__PURE__ */ h(
3507
+ fe,
3407
3508
  {
3408
3509
  label: u.label,
3409
3510
  pressed: a === u.key,
@@ -3413,9 +3514,9 @@ class de extends Ne {
3413
3514
  },
3414
3515
  u.key
3415
3516
  )) }) }),
3416
- /* @__PURE__ */ g(Ce, { header: i, children: [
3417
- /* @__PURE__ */ p("p", { children: n }),
3418
- /* @__PURE__ */ p("ol", { children: o.map((u) => /* @__PURE__ */ g(
3517
+ /* @__PURE__ */ y(ze, { header: i, children: [
3518
+ /* @__PURE__ */ h("p", { children: n }),
3519
+ /* @__PURE__ */ h("ol", { children: o.map((u) => /* @__PURE__ */ y(
3419
3520
  "li",
3420
3521
  {
3421
3522
  className: this.draggingKey === u.key ? "dragging" : void 0,
@@ -3423,15 +3524,15 @@ class de extends Ne {
3423
3524
  onPointerDown: (d) => this.startDragging(u.key, d),
3424
3525
  onClick: (d) => this.suppressDraggedClick(d),
3425
3526
  children: [
3426
- /* @__PURE__ */ p(
3427
- fe,
3527
+ /* @__PURE__ */ h(
3528
+ me,
3428
3529
  {
3429
- symbols: gi,
3530
+ symbols: wi,
3430
3531
  label: u.label,
3431
3532
  valueEmitter: r.activeState(u.key)
3432
3533
  }
3433
3534
  ),
3434
- /* @__PURE__ */ p(
3535
+ /* @__PURE__ */ h(
3435
3536
  "cap-draghandle",
3436
3537
  {
3437
3538
  role: "button",
@@ -3442,10 +3543,10 @@ class de extends Ne {
3442
3543
  if (!d.altKey || d.key !== "ArrowUp" && d.key !== "ArrowDown")
3443
3544
  return;
3444
3545
  d.preventDefault();
3445
- const h = d.key === "ArrowUp" ? -1 : 1;
3446
- if (r.moveBy(u.key, h, "split reordered by keyboard")) {
3447
- const k = r.order$.get().findIndex(({ key: b }) => b === u.key) + 1;
3448
- this.announce(`${u.label} moved to position ${k}`), queueMicrotask(() => this.focusHandle(u.key));
3546
+ const p = d.key === "ArrowUp" ? -1 : 1;
3547
+ if (r.moveBy(u.key, p, "split reordered by keyboard")) {
3548
+ const b = r.order$.get().findIndex(({ key: w }) => w === u.key) + 1;
3549
+ this.announce(`${u.label} moved to position ${b}`), queueMicrotask(() => this.focusHandle(u.key));
3449
3550
  }
3450
3551
  }
3451
3552
  }
@@ -3454,7 +3555,7 @@ class de extends Ne {
3454
3555
  },
3455
3556
  u.key
3456
3557
  )) }),
3457
- /* @__PURE__ */ p("p", { role: "status", "aria-live": "polite", "aria-atomic": "true", children: this.announcement })
3558
+ /* @__PURE__ */ h("p", { role: "status", "aria-live": "polite", "aria-atomic": "true", children: this.announcement })
3458
3559
  ] })
3459
3560
  ] });
3460
3561
  }
@@ -3505,7 +3606,7 @@ class de extends Ne {
3505
3606
  }
3506
3607
  }
3507
3608
  }
3508
- c(de, "liveProps", []), c(de, "hostName", "split-selection-panel"), c(de, "dependencies", [he, fe, Ce]), c(de, "css", re`
3609
+ c(pe, "liveProps", []), c(pe, "hostName", "split-selection-panel"), c(pe, "dependencies", [fe, me, ze]), c(pe, "css", ne`
3509
3610
  & {
3510
3611
  display: flex;
3511
3612
  flex-flow: column nowrap;
@@ -3618,32 +3719,32 @@ c(de, "liveProps", []), c(de, "hostName", "split-selection-panel"), c(de, "depen
3618
3719
  border: 0;
3619
3720
  }
3620
3721
  `);
3621
- class zi {
3622
- constructor(e) {
3722
+ class Ri {
3723
+ constructor(t) {
3623
3724
  c(this, "categories");
3624
3725
  c(this, "byKey");
3625
3726
  c(this, "deltas", /* @__PURE__ */ new Map());
3626
- if (!Array.isArray(e)) throw new TypeError("Series categories must be an array");
3627
- const r = e.map((n) => bi(n)), i = new Map(r.map((n) => [n.key, n]));
3727
+ if (!Array.isArray(t)) throw new TypeError("Series categories must be an array");
3728
+ const r = t.map((n) => vi(n)), i = new Map(r.map((n) => [n.key, n]));
3628
3729
  if (i.size !== r.length) throw new Error("Series category keys must be unique");
3629
3730
  this.categories = Object.freeze(r), this.byKey = i;
3630
3731
  }
3631
- addOne(e, r) {
3632
- return this.add(e, r, 1);
3732
+ addOne(t, r) {
3733
+ return this.add(t, r, 1);
3633
3734
  }
3634
- removeOne(e, r) {
3635
- return this.add(e, r, -1);
3735
+ removeOne(t, r) {
3736
+ return this.add(t, r, -1);
3636
3737
  }
3637
- add(e, r, i) {
3638
- if ($(e), !Number.isFinite(i)) throw new TypeError("Series delta must be finite");
3738
+ add(t, r, i) {
3739
+ if (x(t), !Number.isFinite(i)) throw new TypeError("Series delta must be finite");
3639
3740
  if (!this.byKey.has(r))
3640
3741
  throw new Error(`Unknown series category "${r}"`);
3641
3742
  const n = this.deltas.get(r) ?? /* @__PURE__ */ new Map();
3642
- return n.set(e, (n.get(e) ?? 0) + i), this.deltas.set(r, n), this;
3743
+ return n.set(t, (n.get(t) ?? 0) + i), this.deltas.set(r, n), this;
3643
3744
  }
3644
3745
  build() {
3645
- const e = this.allDates();
3646
- return this.categories.map((r) => lt(r, Object.fromEntries(e.map((i) => {
3746
+ const t = this.allDates();
3747
+ return this.categories.map((r) => lt(r, Object.fromEntries(t.map((i) => {
3647
3748
  var n;
3648
3749
  return [
3649
3750
  i,
@@ -3652,74 +3753,74 @@ class zi {
3652
3753
  })), !1)).filter((r) => Object.values(r.values).some((i) => i !== 0));
3653
3754
  }
3654
3755
  buildCumulative() {
3655
- const e = this.allDates();
3656
- if (e.length === 0) return Object.freeze([]);
3657
- const r = [ei(e[0], -1), ...e];
3756
+ const t = this.allDates();
3757
+ if (t.length === 0) return Object.freeze([]);
3758
+ const r = [ri(t[0], -1), ...t];
3658
3759
  return this.categories.map((i) => {
3659
3760
  var o;
3660
3761
  let n = 0;
3661
3762
  const s = { [r[0]]: 0 };
3662
- for (const a of e)
3763
+ for (const a of t)
3663
3764
  n += ((o = this.deltas.get(i.key)) == null ? void 0 : o.get(a)) ?? 0, s[a] = n;
3664
3765
  return lt(i, s, !0);
3665
3766
  }).filter((i) => Object.values(i.values).some((n) => n !== 0));
3666
3767
  }
3667
3768
  allDates() {
3668
- return [...new Set([...this.deltas.values()].flatMap((e) => [...e.keys()]))].sort(ri);
3769
+ return [...new Set([...this.deltas.values()].flatMap((t) => [...t.keys()]))].sort(ni);
3669
3770
  }
3670
3771
  }
3671
- function bi(t) {
3672
- if (t == null || typeof t != "object")
3772
+ function vi(e) {
3773
+ if (e == null || typeof e != "object")
3673
3774
  throw new TypeError("Series category must be an object");
3674
- if (typeof t.key != "string" || t.key.trim() === "")
3775
+ if (typeof e.key != "string" || e.key.trim() === "")
3675
3776
  throw new TypeError("Series category key must be a non-empty string");
3676
- if (typeof t.label != "string" || t.label.trim() === "")
3777
+ if (typeof e.label != "string" || e.label.trim() === "")
3677
3778
  throw new TypeError("Series category label must be a non-empty string");
3678
- const e = "color" in t ? t.color : t.colors[1];
3679
- if (typeof e != "string" || e.trim() === "")
3779
+ const t = "color" in e ? e.color : e.colors[1];
3780
+ if (typeof t != "string" || t.trim() === "")
3680
3781
  throw new TypeError("Series category color must be a non-empty CSS value");
3681
- const r = t.colorKey === void 0 ? { key: t.key, label: t.label, color: e } : { key: t.key, label: t.label, color: e, colorKey: t.colorKey };
3782
+ const r = e.colorKey === void 0 ? { key: e.key, label: e.label, color: t } : { key: e.key, label: e.label, color: t, colorKey: e.colorKey };
3682
3783
  return Object.freeze(r);
3683
3784
  }
3684
- function lt(t, e, r) {
3785
+ function lt(e, t, r) {
3685
3786
  return Object.freeze({
3686
- ...t,
3687
- values: Object.freeze(e),
3787
+ ...e,
3788
+ values: Object.freeze(t),
3688
3789
  carryForward: r
3689
3790
  });
3690
3791
  }
3691
3792
  export {
3692
- Y as BlockGraph,
3693
- rr as BlockSelectionModel,
3694
- ce as CategoryHidePanel,
3695
- we as CollapsibleOptionGroup,
3696
- H as GroupingCriterion,
3793
+ X as BlockGraph,
3794
+ nr as BlockSelectionModel,
3795
+ ue as CategoryHidePanel,
3796
+ ve as CollapsibleOptionGroup,
3797
+ V as GroupingCriterion,
3697
3798
  je as LineGraph,
3698
- zi as SeriesBuilder,
3699
- hi as SplitSelectionModel,
3700
- de as SplitSelectionPanel,
3701
- ei as addCivilDays,
3702
- si as areaPath,
3799
+ Ri as SeriesBuilder,
3800
+ mi as SplitSelectionModel,
3801
+ pe as SplitSelectionPanel,
3802
+ ri as addCivilDays,
3803
+ ai as areaPath,
3703
3804
  Re as buildBlockLayout,
3704
- oi as buildIntegerTicks,
3705
- ii as buildLineChartModel,
3706
- ct as categoryColorVariables,
3707
- xi as categoryCounts,
3708
- $ as civilDateToDay,
3709
- ri as compareCivilDates,
3710
- Ci as createBlockSelection,
3711
- Ti as createSplitSelection,
3712
- tr as criterionSnapshot,
3713
- U as dayToCivilDate,
3714
- Zt as deriveCategories,
3715
- Ei as derivedCriterion,
3716
- $i as filterByHidden,
3717
- I as findBlock,
3718
- Dt as flattenBlocks,
3719
- Nt as linePath,
3720
- Jt as setsEqual,
3721
- Si as staticCriterion,
3722
- ti as todayCivilDate,
3723
- ni as valueAtDate
3805
+ li as buildIntegerTicks,
3806
+ si as buildLineChartModel,
3807
+ ut as categoryColorVariables,
3808
+ zi as categoryCounts,
3809
+ x as civilDateToDay,
3810
+ ni as compareCivilDates,
3811
+ Ti as createBlockSelection,
3812
+ Oi as createSplitSelection,
3813
+ ir as criterionSnapshot,
3814
+ H as dayToCivilDate,
3815
+ Qt as deriveCategories,
3816
+ xi as derivedCriterion,
3817
+ Ci as filterByHidden,
3818
+ _ as findBlock,
3819
+ Pt as flattenBlocks,
3820
+ Kt as linePath,
3821
+ er as setsEqual,
3822
+ $i as staticCriterion,
3823
+ ii as todayCivilDate,
3824
+ oi as valueAtDate
3724
3825
  };
3725
3826
  //# sourceMappingURL=index.js.map