@capillaryjs/capillary-viz 1.0.0-alpha.1 → 1.0.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,9 +1,9 @@
1
1
  var Tt = Object.defineProperty;
2
- var zt = (t, e, r) => e in t ? Tt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
- var c = (t, e, r) => zt(t, typeof e != "symbol" ? e + "" : e, r);
4
- import { Emitter as A, DerivedEmitter as z, BaseEmitter as xe, FetchState as k, combineFetchStates as Rt } from "@capillaryjs/capillary";
5
- import { Component as Te, Button as oe, css as G, OptionGroup as At, readDeclarativeRegions as Ot, OptionGroupHeaderEnd as jt, OptionsBox as Lt, Checkbox as ae, GroupBox as ge } from "@capillaryjs/capillary-ui";
6
- function Xe([t, e, r]) {
2
+ var Rt = (t, e, r) => e in t ? Tt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
+ var c = (t, e, r) => Rt(t, typeof e != "symbol" ? e + "" : e, r);
4
+ import { Emitter as O, DerivedEmitter as R, BaseEmitter as ze, FetchState as k, combineFetchStates as At } from "@capillaryjs/capillary";
5
+ import { Component as Te, Placeholder as ge, Button as ae, css as X, OptionGroup as Ot, readDeclarativeRegions as jt, OptionGroupHeaderEnd as Lt, OptionsBox as Dt, Checkbox as le, GroupBox as be } from "@capillaryjs/capillary-ui";
6
+ function Ze([t, e, r]) {
7
7
  return {
8
8
  "--c1": t,
9
9
  "--c2": e,
@@ -13,7 +13,7 @@ function Xe([t, e, r]) {
13
13
  "--colored-light": r
14
14
  };
15
15
  }
16
- class I {
16
+ class B {
17
17
  constructor(e) {
18
18
  c(this, "key");
19
19
  c(this, "label");
@@ -27,10 +27,10 @@ class I {
27
27
  c(this, "visibilityEmitters", /* @__PURE__ */ new Map());
28
28
  c(this, "releaseCategoryDefaults");
29
29
  c(this, "disposed", !1);
30
- W(e, "Criterion options"), this.key = P(e.key, "Criterion key"), this.label = ze(e.label, "Criterion label"), pe(e.categories$, "Criterion categories$"), this.categories$ = e.categories$, this.allowResorting = e.allowResorting ?? !1, this.ownedCategories = e.ownedCategories, this.hidden$ = new A(
30
+ Z(e, "Criterion options"), this.key = K(e.key, "Criterion key"), this.label = Re(e.label, "Criterion label"), pe(e.categories$, "Criterion categories$"), this.categories$ = e.categories$, this.allowResorting = e.allowResorting ?? !1, this.ownedCategories = e.ownedCategories, this.hidden$ = new O(
31
31
  new Set(e.initialHiddenKeys ?? []),
32
- { owner: this, purpose: `${this.key} hidden categories`, equals: Mt }
33
- ), this.visibleCategoriesEmitter = new z(
32
+ { owner: this, purpose: `${this.key} hidden categories`, equals: Pt }
33
+ ), this.visibleCategoriesEmitter = new R(
34
34
  [this.categories$, this.hidden$],
35
35
  ([r, i]) => Object.freeze(
36
36
  r.filter(({ key: n }) => !i.has(n))
@@ -42,9 +42,9 @@ class I {
42
42
  }
43
43
  visibility(e) {
44
44
  this.assertActive();
45
- const r = P(e, "Category key");
45
+ const r = K(e, "Category key");
46
46
  let i = this.visibilityEmitters.get(r);
47
- return i == null && (i = new Pt(this.hidden$, r, this), this.visibilityEmitters.set(r, i)), i;
47
+ return i == null && (i = new Kt(this.hidden$, r, this), this.visibilityEmitters.set(r, i)), i;
48
48
  }
49
49
  setAllVisible(e, r) {
50
50
  this.assertActive();
@@ -67,7 +67,7 @@ class I {
67
67
  }
68
68
  }
69
69
  applyFirstSeenDefaults(e) {
70
- Je(e, `${this.label} categories`);
70
+ Qe(e, `${this.label} categories`);
71
71
  const r = new Set(this.hidden$.get());
72
72
  let i = !1;
73
73
  for (const n of e)
@@ -78,36 +78,36 @@ class I {
78
78
  if (this.disposed) throw new Error(`Criterion "${this.key}" is disposed`);
79
79
  }
80
80
  }
81
- function si(t) {
82
- W(t, "Static criterion options");
83
- const e = Ze(t.categories, `${t.label} categories`), r = new A(e, {
81
+ function oi(t) {
82
+ Z(t, "Static criterion options");
83
+ const e = Je(t.categories, `${t.label} categories`), r = new O(e, {
84
84
  purpose: `${t.key} static categories`
85
85
  });
86
- return new I({ ...t, categories$: r, ownedCategories: r });
86
+ return new B({ ...t, categories$: r, ownedCategories: r });
87
87
  }
88
- function oi(t) {
89
- if (W(t, "Derived criterion options"), pe(t.source$, "Derived criterion source$"), typeof t.extractKeys != "function")
88
+ function ai(t) {
89
+ if (Z(t, "Derived criterion options"), pe(t.source$, "Derived criterion source$"), typeof t.extractKeys != "function")
90
90
  throw new TypeError("Derived criterion extractKeys must be a function");
91
91
  if (typeof t.describe != "function")
92
92
  throw new TypeError("Derived criterion describe must be a function");
93
- const e = new z(
93
+ const e = new R(
94
94
  [t.source$],
95
- ([r]) => Dt(r, t),
95
+ ([r]) => Mt(r, t),
96
96
  { purpose: `${t.key} derived categories` }
97
97
  );
98
- return new I({
98
+ return new B({
99
99
  ...t,
100
100
  allowResorting: t.allowResorting ?? !0,
101
101
  categories$: e,
102
102
  ownedCategories: e
103
103
  });
104
104
  }
105
- function Dt(t, e) {
105
+ function Mt(t, e) {
106
106
  if (!Array.isArray(t)) throw new TypeError("Derived category items must be an array");
107
107
  const r = /* @__PURE__ */ new Map();
108
108
  let i = 0;
109
109
  for (const o of t) {
110
- const a = be(e.extractKeys(o));
110
+ const a = we(e.extractKeys(o));
111
111
  if (a.length === 0) {
112
112
  i += 1;
113
113
  continue;
@@ -118,29 +118,29 @@ function Dt(t, e) {
118
118
  n.sort(e.compare ?? ((o, a) => a.count - o.count || o.label.localeCompare(a.label) || o.key.localeCompare(a.key)));
119
119
  const s = n.map(({ key: o, count: a }) => {
120
120
  const l = e.describe(o, a);
121
- return Ee({
121
+ return $e({
122
122
  key: o,
123
123
  ...l,
124
124
  generated: !0,
125
- predicate: (u) => be(e.extractKeys(u)).includes(o)
125
+ predicate: (u) => we(e.extractKeys(u)).includes(o)
126
126
  }, "Derived category");
127
127
  });
128
128
  if (i > 0 && e.unmatched != null) {
129
129
  const { key: o, ...a } = e.unmatched;
130
- s.push(Ee({
130
+ s.push($e({
131
131
  key: o,
132
132
  ...a,
133
133
  generated: !0,
134
- predicate: (l) => be(e.extractKeys(l)).length === 0
134
+ predicate: (l) => we(e.extractKeys(l)).length === 0
135
135
  }, "Derived unmatched category"));
136
136
  }
137
- return Ze(s, "Derived categories");
137
+ return Je(s, "Derived categories");
138
138
  }
139
- function ai(t, e) {
139
+ function li(t, e) {
140
140
  pe(t, "filterByHidden items$"), Nt(e);
141
141
  const r = [t];
142
142
  for (const i of e) r.push(i.categories$, i.hidden$);
143
- return new z(
143
+ return new R(
144
144
  r,
145
145
  (i) => i[0].filter((s) => !e.some((o, a) => {
146
146
  const l = i[a * 2 + 1], u = i[a * 2 + 2];
@@ -149,10 +149,10 @@ function ai(t, e) {
149
149
  { purpose: "items filtered by hidden visualization categories" }
150
150
  );
151
151
  }
152
- function li(t, e) {
153
- if (pe(t, "categoryCounts items$"), !(e instanceof I))
152
+ function ci(t, e) {
153
+ if (pe(t, "categoryCounts items$"), !(e instanceof B))
154
154
  throw new TypeError("categoryCounts criterion must be a GroupingCriterion");
155
- return new z(
155
+ return new R(
156
156
  [t, e.categories$],
157
157
  (r) => {
158
158
  const i = r[0], n = r[1];
@@ -164,10 +164,10 @@ function li(t, e) {
164
164
  { purpose: `${e.key} unfiltered category counts` }
165
165
  );
166
166
  }
167
- function Mt(t, e) {
167
+ function Pt(t, e) {
168
168
  return t === e || t.size === e.size && [...t].every((r) => e.has(r));
169
169
  }
170
- class Pt extends xe {
170
+ class Kt extends ze {
171
171
  constructor(r, i, n) {
172
172
  super(r.get().has(i) ? "hidden" : "visible", {
173
173
  owner: n,
@@ -199,33 +199,33 @@ class Pt extends xe {
199
199
  });
200
200
  }
201
201
  }
202
- function be(t) {
203
- const r = (t == null ? [] : typeof t == "string" ? [t] : [...t]).map((i) => P(i, "Extracted category key"));
202
+ function we(t) {
203
+ const r = (t == null ? [] : typeof t == "string" ? [t] : [...t]).map((i) => K(i, "Extracted category key"));
204
204
  return [...new Set(r)];
205
205
  }
206
- function Ze(t, e) {
207
- return Je(t, e), Object.freeze(t.map((r) => Ee(r, e)));
206
+ function Je(t, e) {
207
+ return Qe(t, e), Object.freeze(t.map((r) => $e(r, e)));
208
208
  }
209
- function Ee(t, e) {
210
- W(t, e);
209
+ function $e(t, e) {
210
+ Z(t, e);
211
211
  const r = {
212
212
  ...t,
213
- key: P(t.key, `${e} key`),
214
- label: ze(t.label, `${e} label`),
215
- colors: Qe(t.colors, `${e} colors`)
213
+ key: K(t.key, `${e} key`),
214
+ label: Re(t.label, `${e} label`),
215
+ colors: et(t.colors, `${e} colors`)
216
216
  };
217
217
  if (typeof t.predicate != "function")
218
218
  throw new TypeError(`${e} predicate must be a function`);
219
- return t.colorKey !== void 0 && P(t.colorKey, `${e} colorKey`), Object.freeze(r);
219
+ return t.colorKey !== void 0 && K(t.colorKey, `${e} colorKey`), Object.freeze(r);
220
220
  }
221
- function Je(t, e) {
221
+ function Qe(t, e) {
222
222
  if (!Array.isArray(t)) throw new TypeError(`${e} must be an array`);
223
223
  const r = /* @__PURE__ */ new Set();
224
224
  for (const i of t) {
225
- W(i, e);
226
- const n = P(i.key, `${e} key`);
225
+ Z(i, e);
226
+ const n = K(i.key, `${e} key`);
227
227
  if (r.has(n)) throw new Error(`${e} contains duplicate key "${n}"`);
228
- if (r.add(n), ze(i.label, `${e} label`), Qe(i.colors, `${e} colors`), typeof i.predicate != "function")
228
+ if (r.add(n), Re(i.label, `${e} label`), et(i.colors, `${e} colors`), typeof i.predicate != "function")
229
229
  throw new TypeError(`${e} predicate must be a function`);
230
230
  }
231
231
  }
@@ -233,13 +233,13 @@ function Nt(t) {
233
233
  if (!Array.isArray(t)) throw new TypeError("Criteria must be an array");
234
234
  const e = /* @__PURE__ */ new Set();
235
235
  for (const r of t) {
236
- if (!(r instanceof I))
236
+ if (!(r instanceof B))
237
237
  throw new TypeError("Criteria must contain GroupingCriterion instances");
238
238
  if (e.has(r.key)) throw new Error(`Duplicate criterion key "${r.key}"`);
239
239
  e.add(r.key);
240
240
  }
241
241
  }
242
- function Qe(t, e) {
242
+ function et(t, e) {
243
243
  if (!Array.isArray(t) || t.length !== 3 || t.some((r) => typeof r != "string" || r.trim() === ""))
244
244
  throw new TypeError(`${e} must contain three non-empty CSS color values`);
245
245
  return Object.freeze([...t]);
@@ -248,27 +248,27 @@ function pe(t, e) {
248
248
  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")
249
249
  throw new TypeError(`${e} must be a readable emitter`);
250
250
  }
251
- function W(t, e) {
251
+ function Z(t, e) {
252
252
  if (t == null || typeof t != "object" || Array.isArray(t))
253
253
  throw new TypeError(`${e} must be an object`);
254
254
  }
255
- function P(t, e) {
255
+ function K(t, e) {
256
256
  if (typeof t != "string" || t.trim() === "")
257
257
  throw new TypeError(`${e} must be a non-empty string`);
258
258
  return t;
259
259
  }
260
- function ze(t, e) {
260
+ function Re(t, e) {
261
261
  if (typeof t != "string" || t.trim() === "")
262
262
  throw new TypeError(`${e} must be a non-empty string`);
263
263
  return t;
264
264
  }
265
- function we(t, e, r = {}) {
265
+ function ve(t, e, r = {}) {
266
266
  if (!Array.isArray(t)) throw new TypeError("Block layout items must be an array");
267
267
  if (!Array.isArray(e)) throw new TypeError("Block layout splits must be an array");
268
268
  const i = r.readabilityThreshold ?? 0.02;
269
269
  if (!Number.isFinite(i) || i < 0 || i > 1)
270
270
  throw new RangeError("Block readability threshold must be between zero and one");
271
- const n = [], s = Object.freeze([...t]), o = et({
271
+ const n = [], s = Object.freeze([...t]), o = tt({
272
272
  items: s,
273
273
  splits: e,
274
274
  splitIndex: 0,
@@ -283,8 +283,8 @@ function we(t, e, r = {}) {
283
283
  });
284
284
  return Object.freeze({ valid: n.length === 0, root: o, issues: Object.freeze(n) });
285
285
  }
286
- function Kt(t) {
287
- if (!(t instanceof I))
286
+ function It(t) {
287
+ if (!(t instanceof B))
288
288
  throw new TypeError("criterionSnapshot requires a GroupingCriterion");
289
289
  return Object.freeze({
290
290
  key: t.key,
@@ -293,7 +293,7 @@ function Kt(t) {
293
293
  allowResorting: t.allowResorting
294
294
  });
295
295
  }
296
- function D(t, e) {
296
+ function M(t, e) {
297
297
  if (e == null) return null;
298
298
  let r = t;
299
299
  for (const i of e) {
@@ -303,7 +303,7 @@ function D(t, e) {
303
303
  }
304
304
  return r;
305
305
  }
306
- class It {
306
+ class Bt {
307
307
  constructor(e, r, i = {}) {
308
308
  c(this, "layout$");
309
309
  c(this, "selectedPath$");
@@ -314,15 +314,15 @@ class It {
314
314
  c(this, "selectedItemsEmitter");
315
315
  c(this, "releases", []);
316
316
  c(this, "disposed", !1);
317
- this.options = i, this.layoutEmitter = new Bt(e, r, i), this.layout$ = this.layoutEmitter, this.selectedPath$ = new A(null, {
317
+ this.options = i, this.layoutEmitter = new Ft(e, r, i), this.layout$ = this.layoutEmitter, this.selectedPath$ = new O(null, {
318
318
  owner: this,
319
319
  purpose: "selected block path",
320
- equals: qt
321
- }), this.selectedBlockEmitter = new z(
320
+ equals: _t
321
+ }), this.selectedBlockEmitter = new R(
322
322
  [this.layout$, this.selectedPath$],
323
- ([n, s]) => D(n.root, s),
323
+ ([n, s]) => M(n.root, s),
324
324
  { owner: this, purpose: "selected block" }
325
- ), this.selectedBlock$ = this.selectedBlockEmitter, this.selectedItemsEmitter = new z(
325
+ ), this.selectedBlock$ = this.selectedBlockEmitter, this.selectedItemsEmitter = new R(
326
326
  [this.selectedBlock$],
327
327
  ([n]) => (n == null ? void 0 : n.items) ?? Object.freeze([]),
328
328
  { owner: this, purpose: "selected block items" }
@@ -333,8 +333,8 @@ class It {
333
333
  }
334
334
  select(e, r) {
335
335
  this.assertActive();
336
- const i = tt(e);
337
- if (D(this.layout$.get().root, i) == null)
336
+ const i = rt(e);
337
+ if (M(this.layout$.get().root, i) == null)
338
338
  throw new Error("Cannot select a path absent from the current block layout");
339
339
  return this.selectedPath$.set(i, r ?? "block selected");
340
340
  }
@@ -350,24 +350,24 @@ class It {
350
350
  }
351
351
  reconcileSelection() {
352
352
  const e = this.selectedPath$.get();
353
- e == null || D(this.layout$.get().root, e) != null || this.selectedPath$.set(null, "block selection no longer exists");
353
+ e == null || M(this.layout$.get().root, e) != null || this.selectedPath$.set(null, "block selection no longer exists");
354
354
  }
355
355
  assertActive() {
356
356
  if (this.disposed) throw new Error("Block selection model is disposed");
357
357
  }
358
358
  }
359
- function ci(t, e, r = {}) {
360
- return new It(t, e, r);
359
+ function ui(t, e, r = {}) {
360
+ return new Bt(t, e, r);
361
361
  }
362
- class Bt extends xe {
362
+ class Ft extends ze {
363
363
  constructor(r, i, n) {
364
- super(we([], [], n), {
364
+ super(ve([], [], n), {
365
365
  purpose: "reactive block layout",
366
366
  fetchState: k.Initial
367
367
  });
368
368
  c(this, "releases", []);
369
369
  c(this, "categoryReleases", []);
370
- this.items$ = r, this.splits$ = i, this.options = n, Ie(r, "Block selection items$"), Ie(i, "Block selection splits$"), this.releases.push(
370
+ this.items$ = r, this.splits$ = i, this.options = n, Be(r, "Block selection items$"), Be(i, "Block selection splits$"), this.releases.push(
371
371
  r.subscribe(({ event: s }) => this.recompute(s), { emitCurrent: !1 }),
372
372
  i.subscribe(({ event: s }) => {
373
373
  this.subscribeCategories(), this.recompute(s);
@@ -391,19 +391,19 @@ class Bt extends xe {
391
391
  const i = this.splits$.get(), n = [
392
392
  this.items$,
393
393
  this.splits$,
394
- ...i.map(({ categories$: p }) => p)
395
- ], s = n.map((p) => p.getFetchState()), o = n.map((p) => p.getError()).filter(Ut);
394
+ ...i.map(({ categories$: f }) => f)
395
+ ], s = n.map((f) => f.getFetchState()), o = n.map((f) => f.getError()).filter(Ht);
396
396
  let a, l = null;
397
397
  try {
398
- a = we(
398
+ a = ve(
399
399
  this.items$.get(),
400
- i.map(Kt),
400
+ i.map(It),
401
401
  this.options
402
402
  );
403
- } catch (p) {
404
- l = p, a = we([], [], this.options);
403
+ } catch (f) {
404
+ l = f, a = ve([], [], this.options);
405
405
  }
406
- const u = l == null ? o : [...o, l], h = u.length > 0 ? k.Error : Rt(s);
406
+ const u = l == null ? o : [...o, l], h = u.length > 0 ? k.Error : At(s);
407
407
  this.setSnapshot({
408
408
  value: a,
409
409
  fetchState: h,
@@ -413,7 +413,7 @@ class Bt extends xe {
413
413
  });
414
414
  }
415
415
  }
416
- function et(t) {
416
+ function tt(t) {
417
417
  const {
418
418
  items: e,
419
419
  splits: r,
@@ -425,45 +425,45 @@ function et(t) {
425
425
  totalShare: l,
426
426
  readabilityThreshold: u,
427
427
  issues: h,
428
- rootLabel: p
429
- } = t, b = r[i], y = b != null && n.length > 0 && l < u, g = b == null || y ? [] : Ft({
428
+ rootLabel: f
429
+ } = t, v = r[i], g = v != null && n.length > 0 && l < u, m = v == null || g ? [] : qt({
430
430
  items: e,
431
431
  splits: r,
432
432
  splitIndex: i,
433
433
  path: n,
434
- criterion: b,
434
+ criterion: v,
435
435
  totalShare: l,
436
436
  readabilityThreshold: u,
437
437
  issues: h,
438
- rootLabel: p
439
- }), f = a === 0 ? 0 : e.length / a;
438
+ rootLabel: f
439
+ }), p = a === 0 ? 0 : e.length / a;
440
440
  return Object.freeze({
441
- key: _t(n),
441
+ key: Ut(n),
442
442
  path: n,
443
443
  criterionKey: (s == null ? void 0 : s.key) ?? null,
444
444
  criterionLabel: (s == null ? void 0 : s.label) ?? null,
445
445
  categoryKey: (o == null ? void 0 : o.key) ?? null,
446
- label: (o == null ? void 0 : o.label) ?? p,
446
+ label: (o == null ? void 0 : o.label) ?? f,
447
447
  colors: (o == null ? void 0 : o.colors) ?? null,
448
448
  colorKey: (o == null ? void 0 : o.colorKey) ?? null,
449
449
  count: e.length,
450
- share: f,
450
+ share: p,
451
451
  totalShare: l,
452
452
  depth: n.length - 1,
453
453
  items: e,
454
- children: Object.freeze(g),
454
+ children: Object.freeze(m),
455
455
  childOrientation: n.length % 2 === 0 ? "horizontal" : "vertical",
456
- childrenSuppressed: y
456
+ childrenSuppressed: g
457
457
  });
458
458
  }
459
- function Ft(t) {
459
+ function qt(t) {
460
460
  const { items: e, criterion: r, path: i, issues: n } = t, s = new Map(r.categories.map((l) => [l.key, {
461
461
  category: l,
462
462
  items: []
463
463
  }]));
464
464
  let o = !0;
465
465
  if (e.forEach((l, u) => {
466
- const h = r.categories.filter((p) => p.predicate(l));
466
+ const h = r.categories.filter((f) => f.predicate(l));
467
467
  if (h.length !== 1) {
468
468
  o = !1, n.push(Object.freeze({
469
469
  kind: h.length === 0 ? "unmatched" : "multiple-matches",
@@ -472,7 +472,7 @@ function Ft(t) {
472
472
  parentPath: i,
473
473
  item: l,
474
474
  itemIndex: u,
475
- matchedCategoryKeys: Object.freeze(h.map(({ key: p }) => p))
475
+ matchedCategoryKeys: Object.freeze(h.map(({ key: f }) => f))
476
476
  }));
477
477
  return;
478
478
  }
@@ -480,11 +480,11 @@ function Ft(t) {
480
480
  }), !o) return [];
481
481
  let a = [...s.values()].filter((l) => l.items.length > 0);
482
482
  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 }) => {
483
- const h = tt([...i, {
483
+ const h = rt([...i, {
484
484
  criterionKey: r.key,
485
485
  categoryKey: l.key
486
- }]), p = e.length === 0 ? 0 : u.length / e.length;
487
- return et({
486
+ }]), f = e.length === 0 ? 0 : u.length / e.length;
487
+ return tt({
488
488
  ...t,
489
489
  items: Object.freeze(u),
490
490
  splitIndex: t.splitIndex + 1,
@@ -492,11 +492,11 @@ function Ft(t) {
492
492
  criterion: r,
493
493
  category: l,
494
494
  parentCount: e.length,
495
- totalShare: t.totalShare * p
495
+ totalShare: t.totalShare * f
496
496
  });
497
497
  });
498
498
  }
499
- function tt(t) {
499
+ function rt(t) {
500
500
  if (!Array.isArray(t)) throw new TypeError("Block path must be an array");
501
501
  return Object.freeze(t.map((e) => {
502
502
  if (e == null || typeof e != "object")
@@ -506,26 +506,26 @@ function tt(t) {
506
506
  return Object.freeze({ ...e });
507
507
  }));
508
508
  }
509
- function qt(t, e) {
509
+ function _t(t, e) {
510
510
  return t === e || t != null && e != null && t.length === e.length && t.every((r, i) => {
511
511
  const n = e[i];
512
512
  return r.criterionKey === (n == null ? void 0 : n.criterionKey) && r.categoryKey === n.categoryKey;
513
513
  });
514
514
  }
515
- function _t(t) {
515
+ function Ut(t) {
516
516
  return t.length === 0 ? "root" : t.map(({ criterionKey: e, categoryKey: r }) => `${encodeURIComponent(e)}=${encodeURIComponent(r)}`).join("/");
517
517
  }
518
- function Ut(t) {
518
+ function Ht(t) {
519
519
  return t != null;
520
520
  }
521
- function Ie(t, e) {
521
+ function Be(t, e) {
522
522
  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")
523
523
  throw new TypeError(`${e} must be a readable emitter`);
524
524
  }
525
- const Be = "data-cap-structural-styles";
526
- let Ht = 1;
527
- class rt {
528
- constructor(e = `runtime-${Ht++}`) {
525
+ const Fe = "data-cap-structural-styles";
526
+ let Vt = 1;
527
+ class it {
528
+ constructor(e = `runtime-${Vt++}`) {
529
529
  c(this, "id");
530
530
  c(this, "cssFragments", /* @__PURE__ */ new Map());
531
531
  if (typeof e != "string") throw new TypeError("StyleRegistry id must be a string");
@@ -552,16 +552,16 @@ class rt {
552
552
  }) : s.kind === "host" && s.hosts.add(r.trim()), this;
553
553
  }
554
554
  generateCSS() {
555
- return [...this.cssFragments.values()].map((e) => e.kind === "raw" ? e.css : it(e.css, [...e.hosts])).join(`
555
+ return [...this.cssFragments.values()].map((e) => e.kind === "raw" ? e.css : nt(e.css, [...e.hosts])).join(`
556
556
 
557
557
  `);
558
558
  }
559
559
  injectAll(e = globalThis.document) {
560
560
  if ((e == null ? void 0 : e.head) == null)
561
561
  throw new TypeError("StyleRegistry.injectAll requires a document with a head");
562
- const r = `style[${Be}="${Gt(this.id)}"]`;
562
+ const r = `style[${Fe}="${Gt(this.id)}"]`;
563
563
  let i = e.head.querySelector(r);
564
- i == null && (i = e.createElement("style"), i.setAttribute(Be, this.id), e.head.prepend(i));
564
+ i == null && (i = e.createElement("style"), i.setAttribute(Fe, this.id), e.head.prepend(i));
565
565
  const n = this.generateCSS();
566
566
  return i.textContent !== n && (i.textContent = n), i;
567
567
  }
@@ -569,34 +569,34 @@ class rt {
569
569
  this.cssFragments.clear();
570
570
  }
571
571
  }
572
- function Vt() {
573
- return new rt();
572
+ function Yt() {
573
+ return new it();
574
574
  }
575
- const Yt = new rt("");
575
+ const Wt = new it("");
576
576
  function Gt(t) {
577
577
  return t.replaceAll("\\", "\\\\").replaceAll('"', '\\"');
578
578
  }
579
- function it(t, e) {
579
+ function nt(t, e) {
580
580
  let r = "", i = 0;
581
581
  for (; i < t.length; ) {
582
- const n = Zt(t, i);
582
+ const n = Jt(t, i);
583
583
  if (n < 0) return r + t.slice(i);
584
- const s = Jt(t, n);
584
+ const s = Qt(t, n);
585
585
  if (s < 0) return r + t.slice(i);
586
586
  const o = t.slice(i, n), a = t.slice(n + 1, s), l = o.trim();
587
- r += l.startsWith("@") ? `${o}{${it(a, e)}}` : `${Wt(o, e)}{${a}}`, i = s + 1;
587
+ r += l.startsWith("@") ? `${o}{${nt(a, e)}}` : `${Xt(o, e)}{${a}}`, i = s + 1;
588
588
  }
589
589
  return r;
590
590
  }
591
- function Wt(t, e) {
591
+ function Xt(t, e) {
592
592
  var o, a, l;
593
593
  if (e.length === 1 || !t.includes("&"))
594
594
  return e.length === 1 ? t.replaceAll("&", e[0]) : t;
595
- const r = ((o = t.match(/^\s*/)) == null ? void 0 : o[0]) ?? "", i = ((a = t.match(/\s*$/)) == null ? void 0 : a[0]) ?? "", n = Xt(t.trim()), s = ((l = r.match(/(?:^|\n)([ \t]*)$/)) == null ? void 0 : l[1]) ?? "";
595
+ const r = ((o = t.match(/^\s*/)) == null ? void 0 : o[0]) ?? "", i = ((a = t.match(/\s*$/)) == null ? void 0 : a[0]) ?? "", n = Zt(t.trim()), s = ((l = r.match(/(?:^|\n)([ \t]*)$/)) == null ? void 0 : l[1]) ?? "";
596
596
  return r + n.flatMap((u) => u.includes("&") ? e.map((h) => u.replaceAll("&", h)) : [u]).join(`,
597
597
  ${s}`) + i;
598
598
  }
599
- function Xt(t) {
599
+ function Zt(t) {
600
600
  const e = [];
601
601
  let r = 0, i = 0, n = 0, s = null;
602
602
  for (let o = 0; o < t.length; o += 1) {
@@ -609,26 +609,26 @@ function Xt(t) {
609
609
  }
610
610
  return e.push(t.slice(r).trim()), e.filter(Boolean);
611
611
  }
612
- function Zt(t, e) {
612
+ function Jt(t, e) {
613
613
  for (let r = e; r < t.length; r += 1) {
614
614
  const i = t[r];
615
615
  if (i === '"' || i === "'")
616
- r = nt(t, r);
617
- else if (i === "/" && t[r + 1] === "*")
618
616
  r = st(t, r);
617
+ else if (i === "/" && t[r + 1] === "*")
618
+ r = ot(t, r);
619
619
  else if (i === "{")
620
620
  return r;
621
621
  }
622
622
  return -1;
623
623
  }
624
- function Jt(t, e) {
624
+ function Qt(t, e) {
625
625
  let r = 1;
626
626
  for (let i = e + 1; i < t.length; i += 1) {
627
627
  const n = t[i];
628
628
  if (n === '"' || n === "'")
629
- i = nt(t, i);
630
- else if (n === "/" && t[i + 1] === "*")
631
629
  i = st(t, i);
630
+ else if (n === "/" && t[i + 1] === "*")
631
+ i = ot(t, i);
632
632
  else if (n === "{")
633
633
  r += 1;
634
634
  else if (n === "}" && --r === 0)
@@ -636,19 +636,19 @@ function Jt(t, e) {
636
636
  }
637
637
  return -1;
638
638
  }
639
- function nt(t, e) {
639
+ function st(t, e) {
640
640
  const r = t[e];
641
641
  for (let i = e + 1; i < t.length; i += 1)
642
642
  if (t[i] === "\\") i += 1;
643
643
  else if (t[i] === r) return i;
644
644
  return t.length;
645
645
  }
646
- function st(t, e) {
646
+ function ot(t, e) {
647
647
  const r = t.indexOf("*/", e + 2);
648
648
  return r < 0 ? t.length : r + 1;
649
649
  }
650
- const Qt = /* @__PURE__ */ new WeakSet(), er = /* @__PURE__ */ new WeakSet();
651
- class ot {
650
+ const er = /* @__PURE__ */ new WeakSet(), tr = /* @__PURE__ */ new WeakSet();
651
+ class at {
652
652
  constructor(e = []) {
653
653
  c(this, "providers", /* @__PURE__ */ new Map());
654
654
  c(this, "instances", /* @__PURE__ */ new Map());
@@ -658,7 +658,7 @@ class ot {
658
658
  if (!Array.isArray(e))
659
659
  throw new TypeError("ServiceScope providers must be an array");
660
660
  for (const r of e) {
661
- if (ir(r), this.providers.has(r.key))
661
+ if (nr(r), this.providers.has(r.key))
662
662
  throw new Error(`Service "${r.key.name}" is registered more than once`);
663
663
  this.providers.set(r.key, r);
664
664
  }
@@ -667,10 +667,10 @@ class ot {
667
667
  return this.disposed;
668
668
  }
669
669
  has(e) {
670
- return this.assertActive(), Fe(e), this.providers.has(e);
670
+ return this.assertActive(), qe(e), this.providers.has(e);
671
671
  }
672
672
  require(e) {
673
- if (this.assertActive(), Fe(e), this.instances.has(e)) return this.instances.get(e);
673
+ if (this.assertActive(), qe(e), this.instances.has(e)) return this.instances.get(e);
674
674
  const r = this.providers.get(e);
675
675
  if (r == null) throw new Error(`Service "${e.name}" is not registered`);
676
676
  const i = this.resolving.indexOf(e);
@@ -693,7 +693,7 @@ class ot {
693
693
  for (const r of [...this.creationOrder].reverse()) {
694
694
  const i = this.instances.get(r);
695
695
  try {
696
- const n = nr(i);
696
+ const n = sr(i);
697
697
  n != null && n.call(i);
698
698
  } catch (n) {
699
699
  e.push(n);
@@ -707,29 +707,26 @@ class ot {
707
707
  if (this.disposed) throw new Error("ServiceScope has been disposed");
708
708
  }
709
709
  }
710
- function tr(t = []) {
711
- return new ot(t);
710
+ function rr(t = []) {
711
+ return new at(t);
712
712
  }
713
- function rr(t) {
714
- return t != null && (typeof t == "object" || typeof t == "function") && Qt.has(t);
713
+ function ir(t) {
714
+ return t != null && (typeof t == "object" || typeof t == "function") && er.has(t);
715
715
  }
716
- function Fe(t) {
717
- if (!rr(t)) throw new TypeError("Expected a service key created by defineService()");
716
+ function qe(t) {
717
+ if (!ir(t)) throw new TypeError("Expected a service key created by defineService()");
718
718
  }
719
- function ir(t) {
720
- if (t == null || typeof t != "object" && typeof t != "function" || !er.has(t))
719
+ function nr(t) {
720
+ if (t == null || typeof t != "object" && typeof t != "function" || !tr.has(t))
721
721
  throw new TypeError("Expected a service provider created by provideService()");
722
722
  }
723
- function nr(t) {
723
+ function sr(t) {
724
724
  if (t == null || typeof t != "object" && typeof t != "function") return null;
725
725
  const e = Reflect.get(t, "dispose");
726
726
  return typeof e == "function" ? e : null;
727
727
  }
728
- const ne = Object.freeze({
728
+ const se = Object.freeze({
729
729
  breadcrumbLabel: "Breadcrumb",
730
- calendarGridLabel: "Choose a date",
731
- calendarNextMonthLabel: "Next month",
732
- calendarPreviousMonthLabel: "Previous month",
733
730
  checkboxOptionLabel: "Option",
734
731
  checkboxStateLabel: (t, e) => `${t}: ${e}`,
735
732
  colorOptionGrayLabel: "Gray",
@@ -744,10 +741,6 @@ const ne = Object.freeze({
744
741
  dataTableLoadError: "Unable to load rows",
745
742
  dataTableLoading: "Loading rows…",
746
743
  dataTableRetry: "Retry",
747
- datePickerDialogLabel: "Choose a date",
748
- datePickerOpenCalendarLabel: "Open calendar",
749
- dateTimePickerDateLabel: "Date",
750
- dateTimePickerTimeLabel: "Time",
751
744
  dialogCloseLabel: "Close",
752
745
  dropdownLoadError: "Unable to load options",
753
746
  dropdownPlaceholder: "Select…",
@@ -772,13 +765,12 @@ const ne = Object.freeze({
772
765
  themeOptionJavaLabel: "Java",
773
766
  themeOptionMinimalLabel: "Minimal",
774
767
  themeOptionShinyLabel: "Shiny",
775
- timePickerPlaceholder: "Select time…",
776
768
  toolbarLabel: "Actions",
777
769
  treeViewEmpty: "No tree items",
778
770
  treeViewLoadError: "Unable to load tree items",
779
771
  treeViewLoading: "Loading tree items…"
780
772
  });
781
- class at {
773
+ class lt {
782
774
  constructor(e, r) {
783
775
  c(this, "locale");
784
776
  c(this, "messages");
@@ -788,30 +780,30 @@ class at {
788
780
  return this.messages[e];
789
781
  }
790
782
  }
791
- const sr = new at(
783
+ const or = new lt(
792
784
  void 0,
793
- ne
785
+ se
794
786
  );
795
- function or(t) {
796
- if (t == null) return sr;
787
+ function ar(t) {
788
+ if (t == null) return or;
797
789
  if (typeof t != "object" || Array.isArray(t))
798
790
  throw new TypeError("Capillary UI localization must be an object");
799
- const e = ar(t.locale), r = t.messages;
791
+ const e = lr(t.locale), r = t.messages;
800
792
  if (r != null && (typeof r != "object" || Array.isArray(r)))
801
793
  throw new TypeError("Capillary UI localization messages must be an object");
802
- const i = { ...ne };
794
+ const i = { ...se };
803
795
  if (r != null)
804
- for (const n of Object.keys(ne)) {
796
+ for (const n of Object.keys(se)) {
805
797
  const s = r[n];
806
798
  if (s === void 0) continue;
807
- const o = ne[n];
799
+ const o = se[n];
808
800
  if (typeof s != typeof o)
809
801
  throw new TypeError(`Capillary UI localization message "${n}" has the wrong type`);
810
802
  Object.assign(i, { [n]: s });
811
803
  }
812
- return new at(e, Object.freeze(i));
804
+ return new lt(e, Object.freeze(i));
813
805
  }
814
- function ar(t) {
806
+ function lr(t) {
815
807
  if (typeof t != "string" || t.trim() === "")
816
808
  throw new TypeError("Capillary UI localization locale must be a non-empty BCP 47 language tag");
817
809
  try {
@@ -820,7 +812,7 @@ function ar(t) {
820
812
  throw new RangeError(`Invalid Capillary UI localization locale: ${t}`, { cause: e });
821
813
  }
822
814
  }
823
- const lr = /* @__PURE__ */ new Set([
815
+ const cr = /* @__PURE__ */ new Set([
824
816
  "annotation-xml",
825
817
  "color-profile",
826
818
  "font-face",
@@ -830,8 +822,8 @@ const lr = /* @__PURE__ */ new Set([
830
822
  "font-face-name",
831
823
  "missing-glyph"
832
824
  ]);
833
- class lt {
834
- constructor(e = {}, r = Vt()) {
825
+ class ct {
826
+ constructor(e = {}, r = Yt()) {
835
827
  c(this, "styleRegistry");
836
828
  c(this, "services");
837
829
  c(this, "router");
@@ -841,16 +833,16 @@ class lt {
841
833
  throw new TypeError("CapillaryUiRuntime options must be an object");
842
834
  if (Object.hasOwn(e, "elementNames"))
843
835
  throw new TypeError("CapillaryUiRuntime no longer supports configurable element names");
844
- if (this.styleRegistry = r, this.localization = or(e.localization), this.services = e.services ?? tr(), !(this.services instanceof ot))
836
+ if (this.styleRegistry = r, this.localization = ar(e.localization), this.services = e.services ?? rr(), !(this.services instanceof at))
845
837
  throw new TypeError("Capillary UI services must be a ServiceScope");
846
838
  if (this.router = e.router ?? null, this.router != null && (typeof this.router != "object" || typeof this.router.openScope != "function" || typeof this.router.completeScope != "function"))
847
839
  throw new TypeError("Capillary UI router must be a BrowserRouter");
848
840
  }
849
841
  /** Resolve a fixed one-hyphen public host name for a built-in component. */
850
842
  resolveElementName(e) {
851
- ct(e, "Capillary UI component host name");
843
+ ut(e, "Capillary UI component host name");
852
844
  const r = `cap-${e.replaceAll("-", "")}`;
853
- return cr(r), r;
845
+ return ur(r), r;
854
846
  }
855
847
  resolveHostSelector(e, r) {
856
848
  if (typeof e != "string") throw new TypeError("Host selector must be a string");
@@ -884,16 +876,16 @@ class lt {
884
876
  return this.styleRegistry.injectAll(e);
885
877
  }
886
878
  }
887
- const qe = new lt({}, Yt);
888
- function ct(t, e) {
879
+ const _e = new ct({}, Wt);
880
+ function ut(t, e) {
889
881
  if (typeof t != "string" || !/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(t))
890
882
  throw new TypeError(`${e} must be a lowercase kebab-case name`);
891
883
  }
892
- function cr(t) {
893
- if (ct(t, "Capillary UI element name"), !t.includes("-") || lr.has(t))
884
+ function ur(t) {
885
+ if (ut(t, "Capillary UI element name"), !t.includes("-") || cr.has(t))
894
886
  throw new TypeError(`Capillary UI element name must be a non-reserved name containing a hyphen: ${t}`);
895
887
  }
896
- const le = Symbol.for("@capillaryjs/capillary-ui.Fragment"), ur = /* @__PURE__ */ new WeakSet(), hr = /* @__PURE__ */ new Set([
888
+ const W = Symbol.for("@capillaryjs/capillary-ui.Fragment"), hr = /* @__PURE__ */ new WeakSet(), dr = /* @__PURE__ */ new Set([
897
889
  "allowFullScreen",
898
890
  "async",
899
891
  "autoFocus",
@@ -917,7 +909,7 @@ const le = Symbol.for("@capillaryjs/capillary-ui.Fragment"), ur = /* @__PURE__ *
917
909
  "required",
918
910
  "reversed",
919
911
  "selected"
920
- ]), dr = /* @__PURE__ */ new Set([
912
+ ]), pr = /* @__PURE__ */ new Set([
921
913
  "checked",
922
914
  "defaultChecked",
923
915
  "defaultValue",
@@ -931,7 +923,7 @@ const le = Symbol.for("@capillaryjs/capillary-ui.Fragment"), ur = /* @__PURE__ *
931
923
  "selectedIndex",
932
924
  "tabIndex",
933
925
  "value"
934
- ]), _e = "data-cap";
926
+ ]), Ue = "data-cap";
935
927
  function ce(t, e = null, ...r) {
936
928
  const i = e ?? {};
937
929
  if (typeof i != "object" || Array.isArray(i))
@@ -946,14 +938,14 @@ function ce(t, e = null, ...r) {
946
938
  key: s,
947
939
  props: {
948
940
  ...o,
949
- children: ut([n, r])
941
+ children: ht([n, r])
950
942
  }
951
943
  };
952
944
  }
953
- function pr(t, ...e) {
945
+ function fr(t, ...e) {
954
946
  return t.reduce((r, i, n) => r + i + String(e[n] ?? ""), "");
955
947
  }
956
- const $ = class $ {
948
+ const E = class E {
957
949
  constructor(e = {}) {
958
950
  c(this, "props");
959
951
  c(this, "dom", null);
@@ -973,7 +965,7 @@ const $ = class $ {
973
965
  c(this, "renderReadSubscriptions", /* @__PURE__ */ new Map());
974
966
  c(this, "collectingRenderReads", null);
975
967
  /** @internal */
976
- c(this, "_runtime", qe);
968
+ c(this, "_runtime", _e);
977
969
  /** @internal Route lineage inherited by nested routed components. */
978
970
  c(this, "_routeContext", null);
979
971
  /** JSX component for this instance's runtime-configured custom host. */
@@ -987,14 +979,14 @@ const $ = class $ {
987
979
  }
988
980
  static new(...e) {
989
981
  const r = new this(...e);
990
- if (!(r instanceof $))
982
+ if (!(r instanceof E))
991
983
  throw new TypeError("Component.new() requires a Component constructor");
992
984
  return r.mount();
993
985
  }
994
- static registerStyles(e = qe, r = /* @__PURE__ */ new Set()) {
986
+ static registerStyles(e = _e, r = /* @__PURE__ */ new Set()) {
995
987
  if (r.has(this)) return;
996
988
  r.add(this);
997
- const i = this.hostName ?? null, n = Ar(this);
989
+ const i = this.hostName ?? null, n = Or(this);
998
990
  for (const s of n)
999
991
  Object.hasOwn(s, "css") && s.css && (i == null ? e.styleRegistry.registerCSS(s.css) : e.styleRegistry.registerHostCSS(
1000
992
  s.css,
@@ -1013,24 +1005,25 @@ const $ = class $ {
1013
1005
  }
1014
1006
  /** Render this component's configured custom host element. */
1015
1007
  host(e = null, ...r) {
1016
- const n = this.constructor.hostName;
1008
+ const i = this.constructor, n = i.hostName;
1017
1009
  if (n == null)
1018
1010
  throw new Error(`${this.constructor.name} does not declare a custom host name`);
1019
1011
  const {
1020
1012
  class: s,
1021
1013
  className: o,
1022
1014
  ...a
1023
- } = e ?? {}, l = o ?? s, u = this.props.island === !0 ? Or(l, "island") : l;
1015
+ } = e ?? {}, l = o ?? s, u = this.props.island === !0 ? jr(l, "island") : l;
1024
1016
  return ce(this._runtime.resolveElementName(n), {
1025
1017
  ...a,
1026
1018
  ...u == null ? {} : { className: u },
1027
- "data-cap-component": n
1019
+ "data-cap-component": n,
1020
+ ...i.dataSurface == null ? {} : { "data-cap-surface": i.dataSurface }
1028
1021
  }, ...r);
1029
1022
  }
1030
1023
  /** @internal Assign an immutable application runtime before initialization or mounting. */
1031
1024
  _setRuntime(e) {
1032
1025
  var r;
1033
- if (!(e instanceof lt))
1026
+ if (!(e instanceof ct))
1034
1027
  throw new TypeError("Component runtime must be a CapillaryUiRuntime");
1035
1028
  if (e === this._runtime) return this;
1036
1029
  if (this.initialized || this.mounted || this._rendered != null)
@@ -1057,7 +1050,7 @@ const $ = class $ {
1057
1050
  if (this.destroyed) throw new Error("Cannot mount a destroyed component");
1058
1051
  this.validateIslandAncestry(this.props);
1059
1052
  let i = !1;
1060
- return this.initialized || (this.validateRequiredServices(), this.initialized = !0, this.initialize()), this.mounted || (this.mounted = !0, this.update(), i = !0), e != null && (Rr(e), je(e, this._rendered, r)), i && this.afterMount(this.dom), this;
1053
+ return this.initialized || (this.validateRequiredServices(), this.initialized = !0, this.initialize()), this.mounted || (this.mounted = !0, this.update(), i = !0), e != null && (Ar(e), Le(e, this._rendered, r)), i && this.afterMount(this.dom), this;
1061
1054
  }
1062
1055
  attachTo(e) {
1063
1056
  return this.mount(e), this;
@@ -1075,11 +1068,11 @@ const $ = class $ {
1075
1068
  this.collectingRenderReads = r;
1076
1069
  let i;
1077
1070
  try {
1078
- i = H(this.render());
1071
+ i = V(this.render());
1079
1072
  } finally {
1080
1073
  this.collectingRenderReads = null;
1081
1074
  }
1082
- this._rendered = Re(this._rendered, i, this), this.dom = mt(this._rendered), this.reconcileRenderReads(r), this.afterUpdate(this.dom);
1075
+ this._rendered = Ae(this._rendered, i, this), this.dom = yt(this._rendered), this.reconcileRenderReads(r), this.afterUpdate(this.dom);
1083
1076
  } while (this.updateRequested && !this.destroyed);
1084
1077
  } finally {
1085
1078
  this.updating = !1;
@@ -1161,7 +1154,7 @@ const $ = class $ {
1161
1154
  return e.addEventListener(r, s, n), this.onCleanup(() => e.removeEventListener(r, s, n)), this;
1162
1155
  }
1163
1156
  registerChild(e) {
1164
- if (!(e instanceof $))
1157
+ if (!(e instanceof E))
1165
1158
  throw new TypeError("registerChild requires a Component");
1166
1159
  return this._childComponents.add(e), e;
1167
1160
  }
@@ -1171,7 +1164,7 @@ const $ = class $ {
1171
1164
  for (const e of [...this.cleanupFunctions]) e();
1172
1165
  this.cleanupFunctions.clear(), this.watched.clear();
1173
1166
  for (const e of this.renderReadSubscriptions.values()) e();
1174
- this.renderReadSubscriptions.clear(), this.collectingRenderReads = null, this._rendered && R(this._rendered, !0), this._rendered = null, this.dom = null, this._childComponents.clear(), this.onDestroy();
1167
+ this.renderReadSubscriptions.clear(), this.collectingRenderReads = null, this._rendered && A(this._rendered, !0), this._rendered = null, this.dom = null, this._childComponents.clear(), this.onDestroy();
1175
1168
  }
1176
1169
  }
1177
1170
  validateRequiredServices() {
@@ -1181,25 +1174,25 @@ const $ = class $ {
1181
1174
  throw new Error(`${e.name} requires unregistered service "${r.name}"`);
1182
1175
  }
1183
1176
  validateIslandAncestry(e) {
1184
- if (!ke(e)) return;
1177
+ if (!Se(e)) return;
1185
1178
  if (this.hasIslandDescendant())
1186
1179
  throw new Error("An island component cannot contain another island");
1187
1180
  let r = this._parentComponent;
1188
1181
  for (; r != null; ) {
1189
- if (ke(r.props))
1182
+ if (Se(r.props))
1190
1183
  throw new Error("An island component cannot be nested inside another island");
1191
1184
  r = r._parentComponent;
1192
1185
  }
1193
1186
  }
1194
1187
  hasIslandDescendant() {
1195
1188
  for (const e of this._childComponents)
1196
- if (ke(e.props) || e.hasIslandDescendant()) return !0;
1189
+ if (Se(e.props) || e.hasIslandDescendant()) return !0;
1197
1190
  return !1;
1198
1191
  }
1199
1192
  onDestroy() {
1200
1193
  }
1201
1194
  trackRenderRead(e) {
1202
- if (wt(e, "Component.read"), this.collectingRenderReads == null)
1195
+ if (vt(e, "Component.read"), this.collectingRenderReads == null)
1203
1196
  throw new Error("Component.read() and snapshot() may only be called during render()");
1204
1197
  this.collectingRenderReads.add(e);
1205
1198
  }
@@ -1215,8 +1208,8 @@ const $ = class $ {
1215
1208
  }
1216
1209
  }
1217
1210
  };
1218
- c($, "dependencies", []), c($, "requiredServices", []), /** Component `live()` bindings are opt-in; subclasses declare their allowlist. */
1219
- c($, "liveProps", []), c($, "css", pr`
1211
+ c(E, "dependencies", []), c(E, "requiredServices", []), /** Component `live()` bindings are opt-in; subclasses declare their allowlist. */
1212
+ c(E, "liveProps", []), c(E, "css", fr`
1220
1213
  .cap-fill-horizontal,
1221
1214
  .cap-fill-vertical {
1222
1215
  box-sizing: border-box;
@@ -1316,12 +1309,13 @@ c($, "liveProps", []), c($, "css", pr`
1316
1309
  label[data-cap] {
1317
1310
  user-select: none;
1318
1311
  }
1319
- `), c($, "hostName", null);
1320
- let C = $;
1321
- function H(t) {
1322
- return Array.isArray(t) ? ce(le, null, t) : t == null || typeof t == "boolean" ? ce(le) : t;
1312
+ `), c(E, "hostName", null), /** Optional host-level data surface marker for parent composition. */
1313
+ c(E, "dataSurface", null);
1314
+ let $ = E;
1315
+ function V(t) {
1316
+ return Array.isArray(t) ? ce(W, null, t) : t == null || typeof t == "boolean" ? ce(W) : t;
1323
1317
  }
1324
- function ut(t) {
1318
+ function ht(t) {
1325
1319
  const e = [], r = (i) => {
1326
1320
  if (Array.isArray(i))
1327
1321
  for (const n of i) r(n);
@@ -1329,7 +1323,7 @@ function ut(t) {
1329
1323
  };
1330
1324
  return r(t), e;
1331
1325
  }
1332
- function Y(t, e) {
1326
+ function G(t, e) {
1333
1327
  if (typeof t == "string" || typeof t == "number")
1334
1328
  return {
1335
1329
  kind: "text",
@@ -1344,8 +1338,8 @@ function Y(t, e) {
1344
1338
  throw new TypeError("A Capillary UI emitter child cannot render itself");
1345
1339
  const l = document.createDocumentFragment();
1346
1340
  l.append(s, o);
1347
- const u = Y(H(a), e);
1348
- je(l, u, o);
1341
+ const u = G(V(a), e);
1342
+ Le(l, u, o);
1349
1343
  const h = {
1350
1344
  kind: "emitter",
1351
1345
  key: null,
@@ -1357,16 +1351,16 @@ function Y(t, e) {
1357
1351
  },
1358
1352
  owner: e
1359
1353
  };
1360
- return h.unsubscribe = t.subscribe(({ value: p }) => {
1361
- if (Object.is(p, t))
1354
+ return h.unsubscribe = t.subscribe(({ value: f }) => {
1355
+ if (Object.is(f, t))
1362
1356
  throw new TypeError("A Capillary UI emitter child cannot render itself");
1363
- h.child = Re(h.child, H(p), e);
1357
+ h.child = Ae(h.child, V(f), e);
1364
1358
  }, { emitCurrent: !1 }), h;
1365
1359
  }
1366
- if (t instanceof C)
1360
+ if (t instanceof $)
1367
1361
  return t._setRuntime(e._runtime), t._setRouteContext(e._routeContextForChildren()), t._setParentComponent(e), t.mount(), e.registerChild(t), {
1368
1362
  kind: "component",
1369
- key: yt(t.props),
1363
+ key: gt(t.props),
1370
1364
  type: t.constructor,
1371
1365
  instance: t,
1372
1366
  prebuilt: !0,
@@ -1375,9 +1369,9 @@ function Y(t, e) {
1375
1369
  owner: e
1376
1370
  };
1377
1371
  if (!T(t))
1378
- throw new TypeError(`Invalid Capillary UI child: ${Ve(t)}`);
1372
+ throw new TypeError(`Invalid Capillary UI child: ${Ye(t)}`);
1379
1373
  const { type: r, key: i = null, props: n } = t;
1380
- if (r === le) {
1374
+ if (r === W) {
1381
1375
  const s = document.createComment("cap-fragment-start"), o = document.createComment("cap-fragment-end"), a = {
1382
1376
  kind: "fragment",
1383
1377
  key: i,
@@ -1410,12 +1404,12 @@ function Y(t, e) {
1410
1404
  children: [],
1411
1405
  owner: e
1412
1406
  };
1413
- return ft(o, n), o.children = ue(s, [], n.children, e), o;
1407
+ return mt(o, n), o.children = ue(s, [], n.children, e), o;
1414
1408
  }
1415
- if (bt(r)) {
1409
+ if (wt(r)) {
1416
1410
  const s = n;
1417
- pt(r, s);
1418
- const o = Ue(s), a = new r(o);
1411
+ ft(r, s);
1412
+ const o = He(s), a = new r(o);
1419
1413
  a._setRuntime(e._runtime), a._setRouteContext(e._routeContextForChildren()), a._setParentComponent(e);
1420
1414
  const l = {
1421
1415
  kind: "component",
@@ -1427,59 +1421,59 @@ function Y(t, e) {
1427
1421
  liveProps: /* @__PURE__ */ new Map(),
1428
1422
  owner: e
1429
1423
  };
1430
- return dt(l, s), a.mount(), e.registerChild(a), l;
1424
+ return pt(l, s), a.mount(), e.registerChild(a), l;
1431
1425
  }
1432
1426
  if (typeof r == "function") {
1433
- const s = r, o = n, a = Ue(o), l = H(s(a)), u = {
1427
+ const s = r, o = n, a = He(o), l = V(s(a)), u = {
1434
1428
  kind: "function",
1435
1429
  key: i,
1436
1430
  type: s,
1437
1431
  props: a,
1438
1432
  sourceProps: o,
1439
1433
  liveProps: /* @__PURE__ */ new Map(),
1440
- child: Y(l, e),
1434
+ child: G(l, e),
1441
1435
  owner: e
1442
1436
  };
1443
- return mr(u), u;
1437
+ return yr(u), u;
1444
1438
  }
1445
- throw new TypeError(`Unsupported vnode type: ${Ve(r)}`);
1439
+ throw new TypeError(`Unsupported vnode type: ${Ye(r)}`);
1446
1440
  }
1447
- function Re(t, e, r) {
1448
- if (t == null) return Y(e, r);
1449
- if (gt(t, e)) return ht(t, e, r);
1450
- const i = Y(e, r), n = mt(t), s = (n == null ? void 0 : n.parentNode) ?? null;
1451
- return s && je(s, i, n), R(t, !0), i;
1441
+ function Ae(t, e, r) {
1442
+ if (t == null) return G(e, r);
1443
+ if (bt(t, e)) return dt(t, e, r);
1444
+ const i = G(e, r), n = yt(t), s = (n == null ? void 0 : n.parentNode) ?? null;
1445
+ return s && Le(s, i, n), A(t, !0), i;
1452
1446
  }
1453
- function ht(t, e, r) {
1454
- return t.kind === "text" ? (typeof e != "string" && typeof e != "number" || Object.is(t.value, e) || (t.value = e, t.node.data = String(e)), t) : t.kind === "emitter" ? (!fe(e) || t.source !== e, t) : t.kind === "component" ? (e instanceof C || T(e) && fr(t, e.props), t) : T(e) ? t.kind === "function" ? (yr(t, e.props), t) : t.kind === "fragment" ? (t.children = ue(
1447
+ function dt(t, e, r) {
1448
+ return t.kind === "text" ? (typeof e != "string" && typeof e != "number" || Object.is(t.value, e) || (t.value = e, t.node.data = String(e)), t) : t.kind === "emitter" ? (!fe(e) || t.source !== e, t) : t.kind === "component" ? (e instanceof $ || T(e) && mr(t, e.props), t) : T(e) ? t.kind === "function" ? (gr(t, e.props), t) : t.kind === "fragment" ? (t.children = ue(
1455
1449
  t.start.parentNode,
1456
1450
  t.children,
1457
1451
  e.props.children,
1458
1452
  r,
1459
1453
  t.end,
1460
1454
  t.start
1461
- ), t) : (ft(t, e.props), t.children = ue(
1455
+ ), t) : (mt(t, e.props), t.children = ue(
1462
1456
  t.node,
1463
1457
  t.children,
1464
1458
  e.props.children,
1465
1459
  r
1466
1460
  ), t) : t;
1467
1461
  }
1468
- function Ue(t) {
1462
+ function He(t) {
1469
1463
  return Object.fromEntries(Object.entries(t).map(([e, r]) => [
1470
1464
  e,
1471
1465
  N(r) ? r.emitter.get() : r
1472
1466
  ]));
1473
1467
  }
1474
- function dt(t, e) {
1475
- Ae(t.liveProps, e, (r, i) => {
1468
+ function pt(t, e) {
1469
+ Oe(t.liveProps, e, (r, i) => {
1476
1470
  t.props = { ...t.props, [r]: i }, t.instance.setProps(t.props);
1477
- }), t.props = Oe(t.liveProps, e), t.instance.setProps(t.props);
1471
+ }), t.props = je(t.liveProps, e), t.instance.setProps(t.props);
1478
1472
  }
1479
- function fr(t, e) {
1480
- pt(t.type, e), dt(t, e);
1473
+ function mr(t, e) {
1474
+ ft(t.type, e), pt(t, e);
1481
1475
  }
1482
- function pt(t, e) {
1476
+ function ft(t, e) {
1483
1477
  const r = Reflect.get(t, "liveProps");
1484
1478
  if (r == null) return;
1485
1479
  if (!Array.isArray(r) || r.some((n) => typeof n != "string"))
@@ -1491,21 +1485,21 @@ function pt(t, e) {
1491
1485
  `${t.name || "Component"} prop "${n}" does not support live()`
1492
1486
  );
1493
1487
  }
1494
- function mr(t) {
1495
- Ae(t.liveProps, t.sourceProps, (e, r) => {
1496
- t.props = { ...t.props, [e]: r }, $e(t);
1497
- }), t.props = Oe(t.liveProps, t.sourceProps);
1488
+ function yr(t) {
1489
+ Oe(t.liveProps, t.sourceProps, (e, r) => {
1490
+ t.props = { ...t.props, [e]: r }, Ce(t);
1491
+ }), t.props = je(t.liveProps, t.sourceProps);
1498
1492
  }
1499
- function yr(t, e) {
1500
- t.sourceProps = e, Ae(t.liveProps, e, (r, i) => {
1501
- t.props = { ...t.props, [r]: i }, $e(t);
1502
- }), t.props = Oe(t.liveProps, e), $e(t);
1493
+ function gr(t, e) {
1494
+ t.sourceProps = e, Oe(t.liveProps, e, (r, i) => {
1495
+ t.props = { ...t.props, [r]: i }, Ce(t);
1496
+ }), t.props = je(t.liveProps, e), Ce(t);
1503
1497
  }
1504
- function $e(t) {
1505
- const e = H(t.type(t.props));
1506
- t.child = Re(t.child, e, t.owner);
1498
+ function Ce(t) {
1499
+ const e = V(t.type(t.props));
1500
+ t.child = Ae(t.child, e, t.owner);
1507
1501
  }
1508
- function Ae(t, e, r) {
1502
+ function Oe(t, e, r) {
1509
1503
  for (const [i, n] of t) {
1510
1504
  const s = e[i];
1511
1505
  N(s) && s.emitter === n.source || (n.unsubscribe(), t.delete(i));
@@ -1523,7 +1517,7 @@ function Ae(t, e, r) {
1523
1517
  }, { emitCurrent: !1 }), t.set(i, s);
1524
1518
  }
1525
1519
  }
1526
- function Oe(t, e) {
1520
+ function je(t, e) {
1527
1521
  return Object.fromEntries(Object.entries(e).map(([r, i]) => {
1528
1522
  var n;
1529
1523
  return [
@@ -1534,60 +1528,60 @@ function Oe(t, e) {
1534
1528
  }
1535
1529
  function ue(t, e, r, i, n = null, s = null) {
1536
1530
  if (t == null) throw new Error("Cannot patch a detached fragment range");
1537
- const o = ut(r), a = /* @__PURE__ */ new Map(), l = [];
1538
- for (const g of e)
1539
- g.key == null ? l.push(g) : a.has(g.key) || a.set(g.key, g);
1540
- const u = /* @__PURE__ */ new Set(), h = /* @__PURE__ */ new Set(), p = [];
1541
- let b = 0;
1542
- for (const g of o) {
1543
- const f = U(g);
1544
- if (f != null) {
1545
- if (u.has(f)) throw new Error(`Duplicate sibling key: ${String(f)}`);
1546
- u.add(f);
1531
+ const o = ht(r), a = /* @__PURE__ */ new Map(), l = [];
1532
+ for (const m of e)
1533
+ m.key == null ? l.push(m) : a.has(m.key) || a.set(m.key, m);
1534
+ const u = /* @__PURE__ */ new Set(), h = /* @__PURE__ */ new Set(), f = [];
1535
+ let v = 0;
1536
+ for (const m of o) {
1537
+ const p = H(m);
1538
+ if (p != null) {
1539
+ if (u.has(p)) throw new Error(`Duplicate sibling key: ${String(p)}`);
1540
+ u.add(p);
1547
1541
  }
1548
- const E = f == null ? l[b++] : a.get(f);
1549
- E && gt(E, g) ? (h.add(E), p.push(ht(E, g, i))) : p.push(Y(g, i));
1550
- }
1551
- for (const g of e)
1552
- h.has(g) || R(g, !0);
1553
- let y = s ? s.nextSibling : t.firstChild;
1554
- for (const g of p)
1555
- for (const f of O(g))
1556
- f === y ? y = y.nextSibling : (t.insertBefore(f, y ?? n), y = f.nextSibling);
1557
- return p;
1558
- }
1559
- function ft(t, e) {
1542
+ const C = p == null ? l[v++] : a.get(p);
1543
+ C && bt(C, m) ? (h.add(C), f.push(dt(C, m, i))) : f.push(G(m, i));
1544
+ }
1545
+ for (const m of e)
1546
+ h.has(m) || A(m, !0);
1547
+ let g = s ? s.nextSibling : t.firstChild;
1548
+ for (const m of f)
1549
+ for (const p of j(m))
1550
+ p === g ? g = g.nextSibling : (t.insertBefore(p, g ?? n), g = p.nextSibling);
1551
+ return f;
1552
+ }
1553
+ function mt(t, e) {
1560
1554
  const r = Object.fromEntries(Object.entries(e).filter(
1561
- ([s]) => s !== "children" && se(s) !== _e
1555
+ ([s]) => s !== "children" && oe(s) !== Ue
1562
1556
  )), i = t.props, n = /* @__PURE__ */ new Set([...Object.keys(i), ...Object.keys(r)]);
1563
1557
  for (const s of ["value", "checked"])
1564
1558
  if (Object.hasOwn(r, s) && Object.hasOwn(r, `bind:${s}`))
1565
1559
  throw new Error(`${s} and bind:${s} cannot be used together`);
1566
1560
  for (const s of n) {
1567
1561
  const o = i[s], a = r[s];
1568
- if (Cr(s))
1569
- br(t, s, a);
1570
- else if (s === "ref")
1571
- o !== a && vr(t, a);
1572
- else if ($r(s))
1562
+ if (xr(s))
1573
1563
  wr(t, s, a);
1564
+ else if (s === "ref")
1565
+ o !== a && kr(t, a);
1566
+ else if (Cr(s))
1567
+ vr(t, s, a);
1574
1568
  else if (N(a))
1575
- gr(t, s, a);
1569
+ br(t, s, a);
1576
1570
  else {
1577
1571
  const l = t.liveProps.get(s);
1578
1572
  l && (l.unsubscribe(), t.liveProps.delete(s));
1579
1573
  const u = (l == null ? void 0 : l.value) ?? o;
1580
- Object.is(u, a) || M(t.node, s, u, a);
1574
+ Object.is(u, a) || P(t.node, s, u, a);
1581
1575
  }
1582
1576
  }
1583
- t.node.setAttribute(_e, ""), t.props = { ...r };
1577
+ t.node.setAttribute(Ue, ""), t.props = { ...r };
1584
1578
  }
1585
- function gr(t, e, r) {
1579
+ function br(t, e, r) {
1586
1580
  const i = t.liveProps.get(e);
1587
1581
  if ((i == null ? void 0 : i.source) === r.emitter) return;
1588
1582
  i == null || i.unsubscribe();
1589
1583
  const n = r.emitter.get();
1590
- M(t.node, e, (i == null ? void 0 : i.value) ?? t.props[e], n);
1584
+ P(t.node, e, (i == null ? void 0 : i.value) ?? t.props[e], n);
1591
1585
  const s = {
1592
1586
  source: r.emitter,
1593
1587
  value: n,
@@ -1596,19 +1590,19 @@ function gr(t, e, r) {
1596
1590
  };
1597
1591
  s.unsubscribe = r.emitter.subscribe(({ value: o }) => {
1598
1592
  const a = s.value;
1599
- s.value = o, Object.is(a, o) || M(t.node, e, a, o);
1593
+ s.value = o, Object.is(a, o) || P(t.node, e, a, o);
1600
1594
  }, { emitCurrent: !1 }), t.liveProps.set(e, s);
1601
1595
  }
1602
- function br(t, e, r) {
1596
+ function wr(t, e, r) {
1603
1597
  const i = e.slice(5), n = t.nativeBindings.get(e);
1604
1598
  if (r == null) {
1605
- n && (n.unsubscribe(), t.node.removeEventListener(n.eventName, n.listener), t.nativeBindings.delete(e), M(t.node, i, n.value, void 0));
1599
+ n && (n.unsubscribe(), t.node.removeEventListener(n.eventName, n.listener), t.nativeBindings.delete(e), P(t.node, i, n.value, void 0));
1606
1600
  return;
1607
1601
  }
1608
- if (xr(r, e), (n == null ? void 0 : n.source) === r) return;
1602
+ if (zr(r, e), (n == null ? void 0 : n.source) === r) return;
1609
1603
  n && (n.unsubscribe(), t.node.removeEventListener(n.eventName, n.listener)), Tr(t.node, i);
1610
- const s = zr(t.node, i), o = r.get();
1611
- M(t.node, i, n == null ? void 0 : n.value, o);
1604
+ const s = Rr(t.node, i), o = r.get();
1605
+ P(t.node, i, n == null ? void 0 : n.value, o);
1612
1606
  const a = () => {
1613
1607
  r.set(Reflect.get(t.node, i), `${e} changed`);
1614
1608
  }, l = {
@@ -1621,10 +1615,10 @@ function br(t, e, r) {
1621
1615
  };
1622
1616
  l.unsubscribe = r.subscribe(({ value: u }) => {
1623
1617
  const h = l.value;
1624
- l.value = u, Object.is(h, u) || M(t.node, i, h, u);
1618
+ l.value = u, Object.is(h, u) || P(t.node, i, h, u);
1625
1619
  }, { emitCurrent: !1 }), t.node.addEventListener(s, a), t.nativeBindings.set(e, l);
1626
1620
  }
1627
- function wr(t, e, r) {
1621
+ function vr(t, e, r) {
1628
1622
  const i = e.slice(2).toLowerCase(), n = t.listeners.get(e);
1629
1623
  if (n && n !== r && (t.node.removeEventListener(i, n), t.listeners.delete(e)), r != null && typeof r != "function")
1630
1624
  throw new TypeError(`${e} must be a function or null`);
@@ -1633,51 +1627,51 @@ function wr(t, e, r) {
1633
1627
  t.node.addEventListener(i, s), t.listeners.set(e, s);
1634
1628
  }
1635
1629
  }
1636
- function vr(t, e) {
1637
- if (Ce(t.ref, null), e != null && typeof e != "function" && typeof e != "object")
1630
+ function kr(t, e) {
1631
+ if (xe(t.ref, null), e != null && typeof e != "function" && typeof e != "object")
1638
1632
  throw new TypeError("ref must be a function, object, or null");
1639
- t.ref = e, Ce(t.ref, t.node);
1633
+ t.ref = e, xe(t.ref, t.node);
1640
1634
  }
1641
- function M(t, e, r, i) {
1635
+ function P(t, e, r, i) {
1642
1636
  if (e === "class" || e === "className") {
1643
- ve(t, "class", i);
1637
+ ke(t, "class", i);
1644
1638
  return;
1645
1639
  }
1646
1640
  if (e === "for" || e === "htmlFor") {
1647
- ve(t, "for", i);
1641
+ ke(t, "for", i);
1648
1642
  return;
1649
1643
  }
1650
1644
  if (e === "dataset") {
1651
- kr(t, r, i);
1645
+ Sr(t, r, i);
1652
1646
  return;
1653
1647
  }
1654
1648
  if (e === "style") {
1655
- Sr(t, r, i);
1649
+ Er(t, r, i);
1656
1650
  return;
1657
1651
  }
1658
1652
  if (e === "dangerouslySetInnerHTML")
1659
1653
  throw new Error("dangerouslySetInnerHTML is not supported");
1660
- const n = Er(e);
1661
- if (hr.has(n)) {
1654
+ const n = $r(e);
1655
+ if (dr.has(n)) {
1662
1656
  const s = !!i;
1663
- n in t && Reflect.set(t, n, s), t.toggleAttribute(se(e), s);
1657
+ n in t && Reflect.set(t, n, s), t.toggleAttribute(oe(e), s);
1664
1658
  return;
1665
1659
  }
1666
- if (dr.has(n) && n in t) {
1660
+ if (pr.has(n) && n in t) {
1667
1661
  const s = i ?? (n === "value" ? "" : !1);
1668
- Object.is(Reflect.get(t, n), s) || Reflect.set(t, n, s), i == null && t.removeAttribute(se(e));
1662
+ Object.is(Reflect.get(t, n), s) || Reflect.set(t, n, s), i == null && t.removeAttribute(oe(e));
1669
1663
  return;
1670
1664
  }
1671
- ve(t, se(e), i);
1665
+ ke(t, oe(e), i);
1672
1666
  }
1673
- function kr(t, e, r) {
1667
+ function Sr(t, e, r) {
1674
1668
  const i = he(e, "dataset"), n = he(r, "dataset");
1675
1669
  for (const s of /* @__PURE__ */ new Set([...Object.keys(i), ...Object.keys(n)])) {
1676
1670
  const o = n[s];
1677
1671
  o == null ? delete t.dataset[s] : t.dataset[s] = String(o);
1678
1672
  }
1679
1673
  }
1680
- function Sr(t, e, r) {
1674
+ function Er(t, e, r) {
1681
1675
  if (typeof r == "string") {
1682
1676
  t.style.cssText = r;
1683
1677
  return;
@@ -1695,25 +1689,25 @@ function he(t, e) {
1695
1689
  throw new TypeError(`${e} must be an object or null`);
1696
1690
  return t;
1697
1691
  }
1698
- function ve(t, e, r) {
1692
+ function ke(t, e, r) {
1699
1693
  r == null || r === !1 ? t.removeAttribute(e) : r === !0 ? t.setAttribute(e, "") : t.setAttribute(e, String(r));
1700
1694
  }
1701
- function Er(t) {
1695
+ function $r(t) {
1702
1696
  return t === "readonly" ? "readOnly" : t === "autofocus" ? "autoFocus" : t;
1703
1697
  }
1704
- function se(t) {
1705
- 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) ? He(t) : t.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
1698
+ function oe(t) {
1699
+ 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) ? Ve(t) : t.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
1706
1700
  }
1707
- function He(t) {
1701
+ function Ve(t) {
1708
1702
  return t.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
1709
1703
  }
1710
- function Ce(t, e) {
1704
+ function xe(t, e) {
1711
1705
  t != null && (typeof t == "function" ? t(e) : t.current = e);
1712
1706
  }
1713
- function R(t, e) {
1707
+ function A(t, e) {
1714
1708
  if (t.kind === "emitter") {
1715
- if (t.unsubscribe(), R(t.child, !1), e)
1716
- for (const r of O(t)) r.remove();
1709
+ if (t.unsubscribe(), A(t.child, !1), e)
1710
+ for (const r of j(t)) r.remove();
1717
1711
  return;
1718
1712
  }
1719
1713
  if (t.kind === "component") {
@@ -1723,11 +1717,11 @@ function R(t, e) {
1723
1717
  }
1724
1718
  if (t.kind === "function") {
1725
1719
  for (const r of t.liveProps.values()) r.unsubscribe();
1726
- t.liveProps.clear(), R(t.child, e);
1720
+ t.liveProps.clear(), A(t.child, e);
1727
1721
  return;
1728
1722
  }
1729
1723
  if (t.kind === "element") {
1730
- Ce(t.ref, null);
1724
+ xe(t.ref, null);
1731
1725
  for (const [r, i] of t.listeners)
1732
1726
  t.node.removeEventListener(r.slice(2).toLowerCase(), i);
1733
1727
  t.listeners.clear();
@@ -1736,100 +1730,100 @@ function R(t, e) {
1736
1730
  for (const r of t.nativeBindings.values())
1737
1731
  r.unsubscribe(), t.node.removeEventListener(r.eventName, r.listener);
1738
1732
  t.nativeBindings.clear();
1739
- for (const r of t.children) R(r, !1);
1733
+ for (const r of t.children) A(r, !1);
1740
1734
  e && t.node.remove();
1741
1735
  return;
1742
1736
  }
1743
1737
  if (t.kind === "fragment") {
1744
- for (const r of t.children) R(r, !1);
1738
+ for (const r of t.children) A(r, !1);
1745
1739
  if (e)
1746
- for (const r of O(t)) r.remove();
1740
+ for (const r of j(t)) r.remove();
1747
1741
  return;
1748
1742
  }
1749
1743
  e && t.node.remove();
1750
1744
  }
1751
- function je(t, e, r = null) {
1745
+ function Le(t, e, r = null) {
1752
1746
  if (e != null)
1753
- for (const i of O(e)) t.insertBefore(i, r);
1747
+ for (const i of j(e)) t.insertBefore(i, r);
1754
1748
  }
1755
- function O(t) {
1749
+ function j(t) {
1756
1750
  if (t == null) return [];
1757
1751
  if (t.kind === "text" || t.kind === "element") return [t.node];
1758
- if (t.kind === "component") return O(t.instance._rendered);
1759
- if (t.kind === "function") return O(t.child);
1752
+ if (t.kind === "component") return j(t.instance._rendered);
1753
+ if (t.kind === "function") return j(t.child);
1760
1754
  const e = [];
1761
1755
  let r = t.start;
1762
1756
  for (; r && (e.push(r), r !== t.end); )
1763
1757
  r = r.nextSibling;
1764
1758
  return e;
1765
1759
  }
1766
- function mt(t) {
1767
- return O(t)[0] ?? null;
1760
+ function yt(t) {
1761
+ return j(t)[0] ?? null;
1768
1762
  }
1769
- function U(t) {
1770
- return t instanceof C ? yt(t.props) : T(t) ? t.key : null;
1763
+ function H(t) {
1764
+ return t instanceof $ ? gt(t.props) : T(t) ? t.key : null;
1771
1765
  }
1772
- function yt(t) {
1766
+ function gt(t) {
1773
1767
  const e = t.key;
1774
1768
  return typeof e == "string" || typeof e == "number" ? e : null;
1775
1769
  }
1776
- function gt(t, e) {
1777
- return t.kind === "text" ? typeof e == "string" || typeof e == "number" : t.kind === "emitter" ? fe(e) && t.source === e : t.kind === "component" ? e instanceof C ? t.instance === e : T(e) && bt(e.type) && t.type === e.type && t.key === U(e) : t.kind === "function" ? T(e) && t.type === e.type && t.key === U(e) : t.kind === "fragment" ? T(e) && e.type === le && t.key === U(e) : T(e) && typeof e.type == "string" && t.type === e.type && t.key === U(e);
1770
+ function bt(t, e) {
1771
+ return t.kind === "text" ? typeof e == "string" || typeof e == "number" : t.kind === "emitter" ? fe(e) && t.source === e : t.kind === "component" ? e instanceof $ ? t.instance === e : T(e) && wt(e.type) && t.type === e.type && t.key === H(e) : t.kind === "function" ? T(e) && t.type === e.type && t.key === H(e) : t.kind === "fragment" ? T(e) && e.type === W && t.key === H(e) : T(e) && typeof e.type == "string" && t.type === e.type && t.key === H(e);
1778
1772
  }
1779
1773
  function T(t) {
1780
1774
  return t != null && typeof t == "object" && Object.hasOwn(t, "type");
1781
1775
  }
1782
- function bt(t) {
1783
- return typeof t == "function" && (t === C || t.prototype instanceof C);
1776
+ function wt(t) {
1777
+ return typeof t == "function" && (t === $ || t.prototype instanceof $);
1784
1778
  }
1785
- function $r(t) {
1779
+ function Cr(t) {
1786
1780
  return /^on[A-Z]/.test(t);
1787
1781
  }
1788
- function Cr(t) {
1782
+ function xr(t) {
1789
1783
  return t === "bind:value" || t === "bind:checked";
1790
1784
  }
1791
1785
  function N(t) {
1792
- return t != null && typeof t == "object" && ur.has(t);
1786
+ return t != null && typeof t == "object" && hr.has(t);
1793
1787
  }
1794
1788
  function fe(t) {
1795
1789
  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";
1796
1790
  }
1797
- function wt(t, e) {
1791
+ function vt(t, e) {
1798
1792
  if (!fe(t)) throw new TypeError(`${e} requires a readable emitter`);
1799
1793
  }
1800
- function xr(t, e) {
1801
- if (wt(t, e), typeof Reflect.get(t, "set") != "function")
1794
+ function zr(t, e) {
1795
+ if (vt(t, e), typeof Reflect.get(t, "set") != "function")
1802
1796
  throw new TypeError(`${e} requires a writable emitter`);
1803
1797
  }
1804
1798
  function Tr(t, e) {
1805
1799
  const r = t.localName;
1806
1800
  if (!(e === "checked" ? r === "input" : r === "input" || r === "textarea" || r === "select")) throw new TypeError(`bind:${e} is not supported on ${r}`);
1807
1801
  }
1808
- function zr(t, e) {
1802
+ function Rr(t, e) {
1809
1803
  return e === "value" && t.localName !== "select" ? "input" : "change";
1810
1804
  }
1811
- function Rr(t) {
1805
+ function Ar(t) {
1812
1806
  if (t == null || typeof t != "object" && typeof t != "function" || typeof Reflect.get(t, "insertBefore") != "function")
1813
1807
  throw new TypeError("Component parent must be a DOM ParentNode");
1814
1808
  }
1815
- function Ve(t) {
1809
+ function Ye(t) {
1816
1810
  try {
1817
1811
  return String(t);
1818
1812
  } catch {
1819
1813
  return Object.prototype.toString.call(t);
1820
1814
  }
1821
1815
  }
1822
- function Ar(t) {
1816
+ function Or(t) {
1823
1817
  const e = [];
1824
1818
  let r = t;
1825
- for (; r != null && typeof r == "function" && (e.unshift(r), r !== C); )
1819
+ for (; r != null && typeof r == "function" && (e.unshift(r), r !== $); )
1826
1820
  r = Object.getPrototypeOf(r);
1827
1821
  return e;
1828
1822
  }
1829
- function Or(...t) {
1823
+ function jr(...t) {
1830
1824
  return [...new Set(t.flatMap((e) => typeof e == "string" ? e.split(/\s+/) : []).filter(Boolean))].join(" ");
1831
1825
  }
1832
- function ke(t) {
1826
+ function Se(t) {
1833
1827
  if (t.island === !0) return !0;
1834
1828
  const e = t.className ?? t.class;
1835
1829
  return typeof e == "string" && e.split(/\s+/).includes("island");
@@ -1838,56 +1832,58 @@ function d(t, e, r) {
1838
1832
  const i = e == null ? {} : { ...e };
1839
1833
  return r !== void 0 && (i.key = r), ce(t, i);
1840
1834
  }
1841
- const m = d, jr = [
1835
+ const y = d, Lr = [
1842
1836
  "var(--colored-dark)",
1843
1837
  "var(--colored-base)",
1844
1838
  "var(--colored-light)"
1845
1839
  ];
1846
- class ee extends Te {
1840
+ class _ extends Te {
1847
1841
  render() {
1848
- var b;
1842
+ var g;
1849
1843
  const {
1850
1844
  model: e,
1851
1845
  label: r = "Block graph",
1852
1846
  description: i = "Area is proportional to item count.",
1853
1847
  emptyMessage: n = "No items are available."
1854
- } = this.props, s = this.snapshot(e.layout$), o = this.read(e.selectedPath$), a = s.value, l = D(a.root, o), u = a.root.children.length === 0 ? [a.root] : a.root.children, h = (b = u[0]) == null ? void 0 : b.key, p = this.Host;
1855
- return /* @__PURE__ */ m(
1856
- p,
1848
+ } = this.props, s = this.snapshot(e.layout$), o = s.fetchState === k.Initial || s.fetchState === k.Loading, a = this.read(e.selectedPath$), l = s.value, u = M(l.root, a), h = l.root.children.length === 0 ? [l.root] : l.root.children, f = (g = h[0]) == null ? void 0 : g.key, v = this.Host;
1849
+ return /* @__PURE__ */ y(
1850
+ v,
1857
1851
  {
1858
1852
  className: (this.props.className ?? this.props.class ?? "") || null,
1859
1853
  "aria-label": r,
1860
- "aria-busy": s.fetchState !== k.Ready ? "true" : null,
1854
+ "aria-busy": o ? "true" : null,
1861
1855
  children: [
1862
- /* @__PURE__ */ m("header", { children: [
1863
- /* @__PURE__ */ m("cap-summary", { children: [
1856
+ /* @__PURE__ */ y("header", { children: [
1857
+ /* @__PURE__ */ y("cap-summary", { children: [
1864
1858
  /* @__PURE__ */ d("h2", { children: r }),
1865
- /* @__PURE__ */ m("p", { children: [
1859
+ /* @__PURE__ */ y("p", { children: [
1866
1860
  i,
1867
1861
  " ",
1868
- a.root.count,
1869
- " items."
1862
+ o ? null : `${l.root.count} items.`
1870
1863
  ] }),
1871
- /* @__PURE__ */ m("output", { children: [
1864
+ o ? /* @__PURE__ */ d(ge, { width: 45 }) : /* @__PURE__ */ y("output", { children: [
1872
1865
  /* @__PURE__ */ d("strong", { children: "Selection:" }),
1873
1866
  " ",
1874
- l == null ? "None" : l.path.length === 0 ? l.label : l.path.map((y, g) => {
1875
- var E;
1876
- const f = l.path.slice(0, g + 1);
1877
- return ((E = D(a.root, f)) == null ? void 0 : E.label) ?? y.categoryKey;
1867
+ u == null ? "None" : u.path.length === 0 ? u.label : u.path.map((m, p) => {
1868
+ var x;
1869
+ const C = u.path.slice(0, p + 1);
1870
+ return ((x = M(l.root, C)) == null ? void 0 : x.label) ?? m.categoryKey;
1878
1871
  }).join(" → ")
1879
1872
  ] })
1880
1873
  ] }),
1881
1874
  /* @__PURE__ */ d(
1882
- oe,
1875
+ ae,
1883
1876
  {
1884
1877
  label: "Clear selection",
1885
- disabled: o == null,
1878
+ disabled: o || a == null,
1886
1879
  onClick: () => e.clear()
1887
1880
  }
1888
1881
  )
1889
1882
  ] }),
1890
- s.fetchState === k.Error ? /* @__PURE__ */ d("p", { role: "alert", children: "The block graph could not be calculated." }) : s.fetchState !== k.Ready ? /* @__PURE__ */ d("p", { role: "status", "aria-live": "polite", children: "Loading block graph…" }) : a.valid ? a.root.count === 0 ? /* @__PURE__ */ d("p", { role: "status", children: n }) : /* @__PURE__ */ d(
1883
+ s.fetchState === k.Error ? /* @__PURE__ */ d("p", { role: "alert", children: "The block graph could not be calculated." }) : o ? /* @__PURE__ */ y(W, { children: [
1884
+ /* @__PURE__ */ d("p", { role: "status", "aria-live": "polite", children: "Loading block graph…" }),
1885
+ /* @__PURE__ */ d("cap-blockskeleton", { "aria-hidden": "true", children: [0, 1, 2].map((m) => /* @__PURE__ */ d("cap-blockskeletoncolumn", { children: [0, 1].map((p) => /* @__PURE__ */ d(ge, { width: 100 }, p)) }, m)) })
1886
+ ] }) : l.valid ? l.root.count === 0 ? /* @__PURE__ */ d("p", { role: "status", children: n }) : /* @__PURE__ */ d(
1891
1887
  "cap-scroller",
1892
1888
  {
1893
1889
  tabIndex: 0,
@@ -1897,26 +1893,26 @@ class ee extends Te {
1897
1893
  {
1898
1894
  role: "tree",
1899
1895
  "aria-label": r,
1900
- className: a.root.childOrientation,
1901
- onClick: (y) => {
1902
- y.target === y.currentTarget && e.clear();
1896
+ className: l.root.childOrientation,
1897
+ onClick: (m) => {
1898
+ m.target === m.currentTarget && e.clear();
1903
1899
  },
1904
- children: u.map((y) => this.renderBlock(
1905
- y,
1906
- o,
1907
- (l == null ? void 0 : l.key) ?? h ?? null
1900
+ children: h.map((m) => this.renderBlock(
1901
+ m,
1902
+ a,
1903
+ (u == null ? void 0 : u.key) ?? f ?? null
1908
1904
  ))
1909
1905
  }
1910
1906
  )
1911
1907
  }
1912
- ) : this.renderPartitionError(a.issues)
1908
+ ) : this.renderPartitionError(l.issues)
1913
1909
  ]
1914
1910
  }
1915
1911
  );
1916
1912
  }
1917
1913
  renderBlock(e, r, i) {
1918
- const n = Lr(e.path, r), s = e.colors, o = Xe(s ?? jr);
1919
- return /* @__PURE__ */ m(
1914
+ const n = Dr(e.path, r), s = e.colors, o = Ze(s ?? Lr);
1915
+ return /* @__PURE__ */ y(
1920
1916
  "article",
1921
1917
  {
1922
1918
  role: "treeitem",
@@ -1938,9 +1934,9 @@ class ee extends Te {
1938
1934
  }
1939
1935
  },
1940
1936
  children: [
1941
- /* @__PURE__ */ m("cap-blocklabel", { children: [
1942
- /* @__PURE__ */ m("cap-blockname", { children: [
1943
- /* @__PURE__ */ m("small", { children: [
1937
+ /* @__PURE__ */ y("cap-blocklabel", { children: [
1938
+ /* @__PURE__ */ y("cap-blockname", { children: [
1939
+ /* @__PURE__ */ y("small", { children: [
1944
1940
  e.criterionLabel ?? "Items",
1945
1941
  ":"
1946
1942
  ] }),
@@ -1967,9 +1963,9 @@ class ee extends Te {
1967
1963
  }
1968
1964
  renderPartitionError(e) {
1969
1965
  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.`;
1970
- return /* @__PURE__ */ m("div", { role: "alert", children: [
1966
+ return /* @__PURE__ */ y("div", { role: "alert", children: [
1971
1967
  /* @__PURE__ */ d("strong", { children: "Invalid block partition" }),
1972
- /* @__PURE__ */ m("p", { children: [
1968
+ /* @__PURE__ */ y("p", { children: [
1973
1969
  i,
1974
1970
  " ",
1975
1971
  e.length,
@@ -1988,7 +1984,7 @@ class ee extends Te {
1988
1984
  e.preventDefault(), this.props.model.clear("block selection cleared by keyboard");
1989
1985
  return;
1990
1986
  }
1991
- const i = this.props.model.layout$.get().root, n = vt(i.children.length === 0 ? [i] : i.children), s = n.findIndex(({ key: a }) => a === r.key);
1987
+ const i = this.props.model.layout$.get().root, n = kt(i.children.length === 0 ? [i] : i.children), s = n.findIndex(({ key: a }) => a === r.key);
1992
1988
  let o;
1993
1989
  if (e.key === "ArrowDown") o = n[s + 1];
1994
1990
  else if (e.key === "ArrowUp") o = n[s - 1];
@@ -1996,7 +1992,7 @@ class ee extends Te {
1996
1992
  else if (e.key === "End") o = n.at(-1);
1997
1993
  else if (e.key === "ArrowRight") o = r.children[0] ?? n[s + 1];
1998
1994
  else if (e.key === "ArrowLeft")
1999
- o = r.path.length <= 1 ? n[s - 1] : D(i, r.path.slice(0, -1)) ?? void 0;
1995
+ o = r.path.length <= 1 ? n[s - 1] : M(i, r.path.slice(0, -1)) ?? void 0;
2000
1996
  else return;
2001
1997
  o != null && (e.preventDefault(), this.focusBlock(o.key));
2002
1998
  }
@@ -2010,7 +2006,7 @@ class ee extends Te {
2010
2006
  }
2011
2007
  }
2012
2008
  }
2013
- c(ee, "liveProps", []), c(ee, "hostName", "block-graph"), c(ee, "dependencies", [oe]), c(ee, "css", G`
2009
+ c(_, "liveProps", []), c(_, "hostName", "block-graph"), c(_, "dataSurface", "data"), c(_, "dependencies", [ae, ge]), c(_, "css", X`
2014
2010
  & {
2015
2011
  display: flex;
2016
2012
  min-width: 0;
@@ -2047,6 +2043,33 @@ c(ee, "liveProps", []), c(ee, "hostName", "block-graph"), c(ee, "dependencies",
2047
2043
  overflow: auto;
2048
2044
  }
2049
2045
 
2046
+ & > cap-blockskeleton {
2047
+ display: flex;
2048
+ flex: 1;
2049
+ gap: var(--viz-space, 0.7rem);
2050
+ min-block-size: 24rem;
2051
+ }
2052
+
2053
+ & cap-blockskeletoncolumn {
2054
+ display: flex;
2055
+ flex: 1;
2056
+ flex-direction: column;
2057
+ gap: var(--viz-space, 0.7rem);
2058
+ }
2059
+
2060
+ & cap-blockskeletoncolumn:nth-child(2) {
2061
+ flex: 2;
2062
+ }
2063
+
2064
+ & cap-blockskeletoncolumn > cap-placeholder {
2065
+ flex: 1;
2066
+ block-size: auto;
2067
+ }
2068
+
2069
+ & cap-blockskeletoncolumn:nth-child(odd) > cap-placeholder:first-child {
2070
+ flex: 2;
2071
+ }
2072
+
2050
2073
  & cap-blocks,
2051
2074
  & cap-blockgroup {
2052
2075
  display: flex;
@@ -2173,16 +2196,16 @@ c(ee, "liveProps", []), c(ee, "hostName", "block-graph"), c(ee, "dependencies",
2173
2196
  }
2174
2197
  }
2175
2198
  `);
2176
- function vt(t) {
2177
- return t.flatMap((e) => [e, ...vt(e.children)]);
2199
+ function kt(t) {
2200
+ return t.flatMap((e) => [e, ...kt(e.children)]);
2178
2201
  }
2179
- function Lr(t, e) {
2202
+ function Dr(t, e) {
2180
2203
  return e != null && t.length === e.length && t.every((r, i) => {
2181
2204
  var n, s;
2182
2205
  return r.criterionKey === ((n = e[i]) == null ? void 0 : n.criterionKey) && r.categoryKey === ((s = e[i]) == null ? void 0 : s.categoryKey);
2183
2206
  });
2184
2207
  }
2185
- class de extends At {
2208
+ class de extends Ot {
2186
2209
  constructor(r) {
2187
2210
  super(r);
2188
2211
  c(this, "contentId");
@@ -2194,10 +2217,10 @@ class de extends At {
2194
2217
  throw new Error(
2195
2218
  "CollapsibleOptionGroup trailing header content must use a direct OptionGroupHeaderEnd child"
2196
2219
  );
2197
- const { content: r, regions: i } = Ot(
2220
+ const { content: r, regions: i } = jt(
2198
2221
  "CollapsibleOptionGroup",
2199
2222
  this.props.children,
2200
- { headerEnd: jt }
2223
+ { headerEnd: Lt }
2201
2224
  );
2202
2225
  return this.renderOptionGroup(r, i.headerEnd ?? null);
2203
2226
  }
@@ -2213,8 +2236,8 @@ class de extends At {
2213
2236
  busy: u = !1,
2214
2237
  error: h = null
2215
2238
  } = this.props;
2216
- return /* @__PURE__ */ m(n, { className: this.props.className ?? this.props.class ?? null, children: [
2217
- /* @__PURE__ */ m(
2239
+ return /* @__PURE__ */ y(n, { className: this.props.className ?? this.props.class ?? null, children: [
2240
+ /* @__PURE__ */ y(
2218
2241
  "fieldset",
2219
2242
  {
2220
2243
  id: this.groupId,
@@ -2225,7 +2248,7 @@ class de extends At {
2225
2248
  "aria-invalid": h == null ? null : "true",
2226
2249
  "aria-describedby": h == null ? null : this.errorId,
2227
2250
  children: [
2228
- /* @__PURE__ */ m("legend", { children: [
2251
+ /* @__PURE__ */ y("legend", { children: [
2229
2252
  /* @__PURE__ */ d(
2230
2253
  "button",
2231
2254
  {
@@ -2248,7 +2271,7 @@ class de extends At {
2248
2271
  ] });
2249
2272
  }
2250
2273
  }
2251
- c(de, "hostName", "collapsible-option-group"), c(de, "css", G`
2274
+ c(de, "hostName", "collapsible-option-group"), c(de, "css", X`
2252
2275
  & > fieldset > legend > button.cap-collapse-toggle {
2253
2276
  display: inline-flex;
2254
2277
  align-items: center;
@@ -2283,11 +2306,11 @@ c(de, "hostName", "collapsible-option-group"), c(de, "css", G`
2283
2306
  display: none;
2284
2307
  }
2285
2308
  `);
2286
- const Dr = [
2309
+ const Mr = [
2287
2310
  ["☐", "hidden"],
2288
2311
  ["✓", "visible"]
2289
2312
  ];
2290
- class te extends Lt {
2313
+ class re extends Dt {
2291
2314
  render() {
2292
2315
  const {
2293
2316
  criteria: e,
@@ -2296,37 +2319,37 @@ class te extends Lt {
2296
2319
  } = this.props, n = this.snapshot(this.props.items$), s = Array.isArray(n.value) ? n.value : [];
2297
2320
  return this.renderGroupBox(
2298
2321
  r,
2299
- /* @__PURE__ */ m("cap-categoryhidecontent", { children: [
2322
+ /* @__PURE__ */ y("cap-categoryhidecontent", { children: [
2300
2323
  /* @__PURE__ */ d("p", { children: i }),
2301
2324
  n.fetchState === k.Error ? /* @__PURE__ */ d("p", { role: "alert", children: "Category counts are unavailable." }) : null,
2302
2325
  /* @__PURE__ */ d("cap-criteriongroups", { children: e.map((o) => {
2303
2326
  const a = this.snapshot(o.categories$), l = Array.isArray(a.value) ? a.value : [];
2304
- return /* @__PURE__ */ m(
2327
+ return /* @__PURE__ */ y(
2305
2328
  de,
2306
2329
  {
2307
2330
  label: o.label,
2308
2331
  children: [
2309
- a.fetchState === k.Error ? /* @__PURE__ */ m("p", { role: "alert", children: [
2332
+ a.fetchState === k.Error ? /* @__PURE__ */ y("p", { role: "alert", children: [
2310
2333
  o.label,
2311
2334
  " categories are unavailable."
2312
2335
  ] }) : null,
2313
- a.fetchState !== k.Ready ? /* @__PURE__ */ m("p", { role: "status", "aria-live": "polite", children: [
2336
+ a.fetchState !== k.Ready ? /* @__PURE__ */ y("p", { role: "status", "aria-live": "polite", children: [
2314
2337
  "Loading ",
2315
2338
  o.label,
2316
2339
  "…"
2317
2340
  ] }) : null,
2318
2341
  /* @__PURE__ */ d("cap-categories", { children: l.map((u) => {
2319
- const h = Mr(s, u.predicate);
2320
- return /* @__PURE__ */ m(
2342
+ const h = Pr(s, u.predicate);
2343
+ return /* @__PURE__ */ y(
2321
2344
  "cap-categoryoption",
2322
2345
  {
2323
- style: { ...Xe(u.colors) },
2346
+ style: { ...Ze(u.colors) },
2324
2347
  children: [
2325
2348
  /* @__PURE__ */ d("cap-categoryswatch", { "aria-hidden": "true" }),
2326
2349
  /* @__PURE__ */ d(
2327
- ae,
2350
+ le,
2328
2351
  {
2329
- symbols: Dr,
2352
+ symbols: Mr,
2330
2353
  label: `${u.label} (${h})`,
2331
2354
  valueEmitter: o.visibility(u.key)
2332
2355
  }
@@ -2345,7 +2368,7 @@ class te extends Lt {
2345
2368
  );
2346
2369
  }
2347
2370
  }
2348
- c(te, "liveProps", []), c(te, "hostName", "category-hide-panel"), c(te, "dependencies", [ae, de]), c(te, "css", G`
2371
+ c(re, "liveProps", []), c(re, "hostName", "category-hide-panel"), c(re, "dependencies", [le, de]), c(re, "css", X`
2349
2372
  & {
2350
2373
  flex: 0 0 auto;
2351
2374
  min-width: 0;
@@ -2391,7 +2414,7 @@ c(te, "liveProps", []), c(te, "hostName", "category-hide-panel"), c(te, "depende
2391
2414
  align-items: center;
2392
2415
  gap: 0.45rem;
2393
2416
  min-width: 0;
2394
- max-height: 1em;
2417
+
2395
2418
  }
2396
2419
 
2397
2420
  & cap-categoryswatch {
@@ -2420,141 +2443,141 @@ c(te, "liveProps", []), c(te, "hostName", "category-hide-panel"), c(te, "depende
2420
2443
  white-space: nowrap;
2421
2444
  }
2422
2445
  `);
2423
- function Mr(t, e) {
2446
+ function Pr(t, e) {
2424
2447
  let r = 0;
2425
2448
  for (const i of t)
2426
2449
  e(i) && (r += 1);
2427
2450
  return r;
2428
2451
  }
2429
- const kt = 864e5, Pr = /^(\d{4})-(\d{2})-(\d{2})$/;
2452
+ const St = 864e5, Kr = /^(\d{4})-(\d{2})-(\d{2})$/;
2430
2453
  function S(t) {
2431
- const e = Pr.exec(t);
2454
+ const e = Kr.exec(t);
2432
2455
  if (e == null) throw new TypeError(`Invalid civil date "${t}"; expected YYYY-MM-DD`);
2433
2456
  const r = Number(e[1]), i = Number(e[2]), n = Number(e[3]), s = Date.UTC(r, i - 1, n), o = new Date(s);
2434
2457
  if (o.getUTCFullYear() !== r || o.getUTCMonth() !== i - 1 || o.getUTCDate() !== n)
2435
2458
  throw new TypeError(`Invalid civil date "${t}"`);
2436
- return Math.floor(s / kt);
2459
+ return Math.floor(s / St);
2437
2460
  }
2438
- function K(t) {
2461
+ function I(t) {
2439
2462
  if (!Number.isInteger(t)) throw new TypeError("Civil day must be an integer");
2440
- return new Date(t * kt).toISOString().slice(0, 10);
2463
+ return new Date(t * St).toISOString().slice(0, 10);
2441
2464
  }
2442
2465
  function Nr(t, e) {
2443
2466
  if (!Number.isInteger(e)) throw new TypeError("Civil date offset must be an integer");
2444
- return K(S(t) + e);
2467
+ return I(S(t) + e);
2445
2468
  }
2446
- function Kr(t = /* @__PURE__ */ new Date()) {
2469
+ function Ir(t = /* @__PURE__ */ new Date()) {
2447
2470
  if (!(t instanceof Date) || Number.isNaN(t.getTime()))
2448
2471
  throw new TypeError("todayCivilDate requires a valid Date");
2449
2472
  return `${String(t.getUTCFullYear()).padStart(4, "0")}-${String(
2450
2473
  t.getUTCMonth() + 1
2451
2474
  ).padStart(2, "0")}-${String(t.getUTCDate()).padStart(2, "0")}`;
2452
2475
  }
2453
- function Ir(t, e) {
2476
+ function Br(t, e) {
2454
2477
  return S(t) - S(e);
2455
2478
  }
2456
- function Br(t, e = {}) {
2457
- var Me, Pe, Ne, Ke;
2458
- Vr(t);
2459
- const r = Ye(e.width ?? 960, "Chart width"), i = Ye(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 ?? Kr(), h = ((Me = e.range) == null ? void 0 : Me.minX) ?? Yr(l) ?? u, p = ((Pe = e.range) == null ? void 0 : Pe.maxX) ?? u, b = S(h), y = S(p);
2460
- if (b > y) throw new RangeError("Line graph minX must not be after maxX");
2461
- const g = Ur(t, b, y), f = e.stacked ?? !1, E = t.map((w) => ({
2462
- shape: w,
2463
- values: g.map((F) => Et(w, F))
2479
+ function Fr(t, e = {}) {
2480
+ var Pe, Ke, Ne, Ie;
2481
+ Yr(t);
2482
+ const r = We(e.width ?? 960, "Chart width"), i = We(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((b) => Object.keys(b.values)), u = e.today ?? Ir(), h = ((Pe = e.range) == null ? void 0 : Pe.minX) ?? Wr(l) ?? u, f = ((Ke = e.range) == null ? void 0 : Ke.maxX) ?? u, v = S(h), g = S(f);
2483
+ if (v > g) throw new RangeError("Line graph minX must not be after maxX");
2484
+ const m = Hr(t, v, g), p = e.stacked ?? !1, C = t.map((b) => ({
2485
+ shape: b,
2486
+ values: m.map((F) => $t(b, F))
2464
2487
  }));
2465
- let B = ((Ne = e.range) == null ? void 0 : Ne.minY) ?? 0, X = B;
2466
- const Le = Array.from({ length: g.length }, () => 0), $t = E.map(({ shape: w, values: F }) => {
2467
- const q = F.map((Z, L) => {
2468
- const J = f ? Le[L] : 0, Q = J + Z;
2469
- return f && (Le[L] = Q), B = Math.min(B, J, Q), X = Math.max(X, J, Q), { value: Z, baseValue: J, displayValue: Q };
2488
+ let x = ((Ne = e.range) == null ? void 0 : Ne.minY) ?? 0, J = x;
2489
+ const De = Array.from({ length: m.length }, () => 0), Ct = C.map(({ shape: b, values: F }) => {
2490
+ const q = F.map((Q, D) => {
2491
+ const ee = p ? De[D] : 0, te = ee + Q;
2492
+ return p && (De[D] = te), x = Math.min(x, ee, te), J = Math.max(J, ee, te), { value: Q, baseValue: ee, displayValue: te };
2470
2493
  });
2471
- return { shape: w, entries: q };
2472
- }), Ct = Math.max(1, X - B), j = X + Ct * 0.05, me = ((Ke = e.range) == null ? void 0 : Ke.minY) ?? B, ye = Math.max(1, j - me), De = Math.max(1, y - b), xt = $t.map(({ shape: w, entries: F }) => ({
2473
- key: w.key,
2474
- label: w.label,
2475
- color: w.color,
2476
- ...w.colorKey === void 0 ? {} : { colorKey: w.colorKey },
2477
- shape: w,
2478
- points: Object.freeze(F.map((q, Z) => {
2479
- const L = g[Z];
2494
+ return { shape: b, entries: q };
2495
+ }), xt = Math.max(1, J - x), L = J + xt * 0.05, me = ((Ie = e.range) == null ? void 0 : Ie.minY) ?? x, ye = Math.max(1, L - me), Me = Math.max(1, g - v), zt = Ct.map(({ shape: b, entries: F }) => ({
2496
+ key: b.key,
2497
+ label: b.label,
2498
+ color: b.color,
2499
+ ...b.colorKey === void 0 ? {} : { colorKey: b.colorKey },
2500
+ shape: b,
2501
+ points: Object.freeze(F.map((q, Q) => {
2502
+ const D = m[Q];
2480
2503
  return Object.freeze({
2481
- date: K(L),
2482
- day: L,
2504
+ date: I(D),
2505
+ day: D,
2483
2506
  ...q,
2484
- x: n + (L - b) / De * o,
2485
- y: s + (j - q.displayValue) / ye * a,
2486
- baseY: s + (j - q.baseValue) / ye * a
2507
+ x: n + (D - v) / Me * o,
2508
+ y: s + (L - q.displayValue) / ye * a,
2509
+ baseY: s + (L - q.baseValue) / ye * a
2487
2510
  });
2488
2511
  }))
2489
2512
  }));
2490
2513
  return Object.freeze({
2491
2514
  minDate: h,
2492
- maxDate: p,
2493
- minDay: b,
2494
- maxDay: y,
2515
+ maxDate: f,
2516
+ minDay: v,
2517
+ maxDay: g,
2495
2518
  minY: me,
2496
- maxY: j,
2519
+ maxY: L,
2497
2520
  width: r,
2498
2521
  height: i,
2499
2522
  plotLeft: n,
2500
2523
  plotTop: s,
2501
2524
  plotWidth: o,
2502
2525
  plotHeight: a,
2503
- stacked: f,
2504
- series: Object.freeze(xt),
2505
- dateMarks: Object.freeze(Hr(b, y, e.maxDateMarks ?? 8).map((w) => ({
2506
- date: K(w),
2507
- day: w,
2508
- x: n + (w - b) / De * o
2526
+ stacked: p,
2527
+ series: Object.freeze(zt),
2528
+ dateMarks: Object.freeze(Vr(v, g, e.maxDateMarks ?? 8).map((b) => ({
2529
+ date: I(b),
2530
+ day: b,
2531
+ x: n + (b - v) / Me * o
2509
2532
  }))),
2510
- valueTicks: Object.freeze(_r(me, j).map((w) => ({
2511
- value: w,
2512
- y: s + (j - w) / ye * a
2533
+ valueTicks: Object.freeze(Ur(me, L).map((b) => ({
2534
+ value: b,
2535
+ y: s + (L - b) / ye * a
2513
2536
  })))
2514
2537
  });
2515
2538
  }
2516
- function Fr(t, e) {
2517
- return Et(t, S(e));
2539
+ function qr(t, e) {
2540
+ return $t(t, S(e));
2518
2541
  }
2519
- function St(t, e) {
2542
+ function Et(t, e) {
2520
2543
  const r = t[0];
2521
2544
  if (r == null) return "";
2522
- let i = `M ${v(r.x)} ${v(r.y)}`;
2545
+ let i = `M ${w(r.x)} ${w(r.y)}`;
2523
2546
  for (let n = 1; n < t.length; n += 1) {
2524
2547
  const s = t[n - 1], o = t[n];
2525
2548
  if (e) {
2526
2549
  const a = (s.x + o.x) / 2;
2527
- i += ` C ${v(a)} ${v(s.y)}, ${v(a)} ${v(o.y)}, ${v(o.x)} ${v(o.y)}`;
2550
+ i += ` C ${w(a)} ${w(s.y)}, ${w(a)} ${w(o.y)}, ${w(o.x)} ${w(o.y)}`;
2528
2551
  } else
2529
- i += ` H ${v(o.x)} V ${v(o.y)}`;
2552
+ i += ` H ${w(o.x)} V ${w(o.y)}`;
2530
2553
  }
2531
2554
  return i;
2532
2555
  }
2533
- function qr(t, e) {
2556
+ function _r(t, e) {
2534
2557
  if (t.length === 0) return "";
2535
- const r = St(t, e), i = [...t].reverse();
2558
+ const r = Et(t, e), i = [...t].reverse();
2536
2559
  let n = "";
2537
2560
  for (let s = 0; s < i.length; s += 1) {
2538
2561
  const o = i[s];
2539
- if (s === 0) n += ` L ${v(o.x)} ${v(o.baseY)}`;
2562
+ if (s === 0) n += ` L ${w(o.x)} ${w(o.baseY)}`;
2540
2563
  else if (e) {
2541
2564
  const a = i[s - 1], l = (a.x + o.x) / 2;
2542
- n += ` C ${v(l)} ${v(a.baseY)}, ${v(l)} ${v(o.baseY)}, ${v(o.x)} ${v(o.baseY)}`;
2565
+ n += ` C ${w(l)} ${w(a.baseY)}, ${w(l)} ${w(o.baseY)}, ${w(o.x)} ${w(o.baseY)}`;
2543
2566
  } else
2544
- n += ` H ${v(o.x)} V ${v(o.baseY)}`;
2567
+ n += ` H ${w(o.x)} V ${w(o.baseY)}`;
2545
2568
  }
2546
2569
  return `${r}${n} Z`;
2547
2570
  }
2548
- function _r(t, e, r = 6) {
2571
+ function Ur(t, e, r = 6) {
2549
2572
  if (!Number.isFinite(t) || !Number.isFinite(e) || t > e)
2550
2573
  throw new RangeError("Tick range must contain finite ascending values");
2551
2574
  if (!Number.isInteger(r) || r < 2) throw new RangeError("Tick target must be at least two");
2552
2575
  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, h = [];
2553
- for (let p = u; p <= e + l / 1e3; p += l)
2554
- h.push(Number(p.toFixed(10)));
2576
+ for (let f = u; f <= e + l / 1e3; f += l)
2577
+ h.push(Number(f.toFixed(10)));
2555
2578
  return h.length === 0 && h.push(Math.ceil(t)), h;
2556
2579
  }
2557
- function Ur(t, e, r) {
2580
+ function Hr(t, e, r) {
2558
2581
  const i = /* @__PURE__ */ new Set([e, r]);
2559
2582
  for (const n of t)
2560
2583
  for (const s of Object.keys(n.values)) {
@@ -2563,8 +2586,8 @@ function Ur(t, e, r) {
2563
2586
  }
2564
2587
  return [...i].sort((n, s) => n - s);
2565
2588
  }
2566
- function Et(t, e) {
2567
- const r = t.values[K(e)];
2589
+ function $t(t, e) {
2590
+ const r = t.values[I(e)];
2568
2591
  if (r !== void 0) return r;
2569
2592
  if (t.carryForward !== !0) return 0;
2570
2593
  let i = Number.NEGATIVE_INFINITY, n = 0;
@@ -2574,14 +2597,14 @@ function Et(t, e) {
2574
2597
  }
2575
2598
  return n;
2576
2599
  }
2577
- function Hr(t, e, r) {
2600
+ function Vr(t, e, r) {
2578
2601
  if (!Number.isInteger(r) || r < 2)
2579
2602
  throw new RangeError("Maximum date marks must be at least two");
2580
2603
  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];
2581
2604
  for (let a = t + s; a < e; a += s) o.push(a);
2582
2605
  return e !== t && o.push(e), o;
2583
2606
  }
2584
- function Vr(t) {
2607
+ function Yr(t) {
2585
2608
  if (!Array.isArray(t)) throw new TypeError("History shapes must be an array");
2586
2609
  const e = /* @__PURE__ */ new Set();
2587
2610
  for (const r of t) {
@@ -2596,20 +2619,20 @@ function Vr(t) {
2596
2619
  if (S(i), !Number.isFinite(n)) throw new TypeError("History shape values must be finite");
2597
2620
  }
2598
2621
  }
2599
- function Yr(t) {
2622
+ function Wr(t) {
2600
2623
  return t.length === 0 ? void 0 : t.reduce((e, r) => S(e) <= S(r) ? e : r);
2601
2624
  }
2602
- function Ye(t, e) {
2625
+ function We(t, e) {
2603
2626
  if (!Number.isFinite(t) || t <= 0) throw new RangeError(`${e} must be positive`);
2604
2627
  return t;
2605
2628
  }
2606
- function v(t) {
2629
+ function w(t) {
2607
2630
  return Number(t.toFixed(3)).toString();
2608
2631
  }
2609
- class Se extends Te {
2632
+ class Ee extends Te {
2610
2633
  constructor(r) {
2611
2634
  super(r);
2612
- c(this, "cursorDate$", new A(null, {
2635
+ c(this, "cursorDate$", new O(null, {
2613
2636
  owner: this,
2614
2637
  purpose: "line graph cursor date"
2615
2638
  }));
@@ -2625,30 +2648,30 @@ class Se extends Te {
2625
2648
  this.shapes$ = this.source(r.shapes$, "line graph shapes"), this.stacked$ = this.source(r.stacked$, "line graph stacked state"), this.smooth$ = this.source(r.smooth$, "line graph smooth state"), this.range$ = this.source(r.range$, "line graph range");
2626
2649
  }
2627
2650
  render() {
2628
- const r = this.snapshot(this.shapes$), i = this.snapshot(this.stacked$), n = this.snapshot(this.smooth$), s = this.snapshot(this.range$), o = this.read(this.cursorDate$), a = this.props.label ?? "History chart", l = [r, i, n, s].some(({ fetchState: f }) => f === k.Error) ? k.Error : [r, i, n, s].some(({ fetchState: f }) => f !== k.Ready) ? k.Loading : k.Ready;
2651
+ const r = this.snapshot(this.shapes$), i = this.snapshot(this.stacked$), n = this.snapshot(this.smooth$), s = this.snapshot(this.range$), o = this.read(this.cursorDate$), a = this.props.label ?? "History chart", l = [r, i, n, s].some(({ fetchState: p }) => p === k.Error) ? k.Error : [r, i, n, s].some(({ fetchState: p }) => p !== k.Ready) ? k.Loading : k.Ready;
2629
2652
  let u = null;
2630
2653
  if (this.currentModel = null, l === k.Ready)
2631
2654
  try {
2632
- this.currentModel = Br(r.value, {
2655
+ this.currentModel = Fr(r.value, {
2633
2656
  stacked: i.value,
2634
2657
  range: s.value,
2635
2658
  width: Math.max(480, this.observedWidth),
2636
2659
  maxDateMarks: this.observedWidth < 640 ? 5 : 9
2637
2660
  });
2638
- } catch (f) {
2639
- u = f;
2661
+ } catch (p) {
2662
+ u = p;
2640
2663
  }
2641
- const h = this.currentModel, p = h == null ? null : o ?? h.maxDate, b = this.props.formatDate ?? ((f) => f), y = this.props.formatValue ?? ((f) => String(f)), g = this.Host;
2642
- return /* @__PURE__ */ m(
2643
- g,
2664
+ const h = this.currentModel, f = h == null ? null : o ?? h.maxDate, v = this.props.formatDate ?? ((p) => p), g = this.props.formatValue ?? ((p) => String(p)), m = this.Host;
2665
+ return /* @__PURE__ */ y(
2666
+ m,
2644
2667
  {
2645
2668
  className: (this.props.className ?? this.props.class ?? "") || null,
2646
2669
  "aria-label": a,
2647
2670
  "aria-busy": l !== k.Ready ? "true" : null,
2648
2671
  children: [
2649
- /* @__PURE__ */ m("header", { children: [
2672
+ /* @__PURE__ */ y("header", { children: [
2650
2673
  /* @__PURE__ */ d("h2", { children: a }),
2651
- /* @__PURE__ */ m("p", { children: [
2674
+ /* @__PURE__ */ y("p", { children: [
2652
2675
  i.value ? "Stacked area" : "Individual line",
2653
2676
  " chart;",
2654
2677
  " ",
@@ -2662,24 +2685,24 @@ class Se extends Te {
2662
2685
  tabIndex: 0,
2663
2686
  role: "group",
2664
2687
  "aria-label": `${a}. Use Left and Right Arrow to move by day; hold Shift to move by week.`,
2665
- onPointerMove: (f) => this.pointerMove(f),
2666
- onKeyDown: (f) => this.cursorKeyDown(f),
2667
- ref: (f) => this.chartHost = f
2688
+ onPointerMove: (p) => this.pointerMove(p),
2689
+ onKeyDown: (p) => this.cursorKeyDown(p),
2690
+ ref: (p) => this.chartHost = p
2668
2691
  }
2669
2692
  ),
2670
- h == null || p == null ? null : /* @__PURE__ */ m("cap-readout", { children: [
2671
- /* @__PURE__ */ d("p", { "aria-live": "polite", children: /* @__PURE__ */ d("strong", { children: b(p) }) }),
2672
- /* @__PURE__ */ d("ul", { children: h.series.map(({ shape: f }) => /* @__PURE__ */ m("li", { children: [
2693
+ h == null || f == null ? null : /* @__PURE__ */ y("cap-readout", { children: [
2694
+ /* @__PURE__ */ d("p", { "aria-live": "polite", children: /* @__PURE__ */ d("strong", { children: v(f) }) }),
2695
+ /* @__PURE__ */ d("ul", { children: h.series.map(({ shape: p }) => /* @__PURE__ */ y("li", { children: [
2673
2696
  /* @__PURE__ */ d(
2674
2697
  "cap-swatch",
2675
2698
  {
2676
- style: { "--colored-base": f.color },
2699
+ style: { "--colored-base": p.color },
2677
2700
  "aria-hidden": "true"
2678
2701
  }
2679
2702
  ),
2680
- /* @__PURE__ */ d("span", { children: f.label }),
2681
- /* @__PURE__ */ d("strong", { children: y(Fr(f, p)) })
2682
- ] }, f.key)) })
2703
+ /* @__PURE__ */ d("span", { children: p.label }),
2704
+ /* @__PURE__ */ d("strong", { children: g(qr(p, f)) })
2705
+ ] }, p.key)) })
2683
2706
  ] })
2684
2707
  ]
2685
2708
  }
@@ -2706,7 +2729,7 @@ class Se extends Te {
2706
2729
  }
2707
2730
  source(r, i) {
2708
2731
  if (Gr(r)) return r;
2709
- const n = new A(r, { owner: this, purpose: i });
2732
+ const n = new O(r, { owner: this, purpose: i });
2710
2733
  return this.ownedSources.push(n), n;
2711
2734
  }
2712
2735
  pointerMove(r) {
@@ -2715,7 +2738,7 @@ class Se extends Te {
2715
2738
  const s = n.getBoundingClientRect();
2716
2739
  if (s.width <= 0) return;
2717
2740
  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));
2718
- this.cursorDate$.set(K(l), "line graph pointer moved");
2741
+ this.cursorDate$.set(I(l), "line graph pointer moved");
2719
2742
  }
2720
2743
  cursorKeyDown(r) {
2721
2744
  const i = this.currentModel;
@@ -2730,35 +2753,35 @@ class Se extends Te {
2730
2753
  return;
2731
2754
  } else return;
2732
2755
  r.preventDefault();
2733
- const s = K(Math.max(i.minDay, Math.min(i.maxDay, n)));
2756
+ const s = I(Math.max(i.minDay, Math.min(i.maxDay, n)));
2734
2757
  this.cursorDate$.set(s, "line graph cursor moved by keyboard");
2735
2758
  }
2736
2759
  drawChart() {
2737
2760
  const r = this.chartHost, i = this.currentModel;
2738
2761
  if (r == null || i == null) return;
2739
- const n = this.smooth$.get(), s = x("svg");
2762
+ const n = this.smooth$.get(), s = z("svg");
2740
2763
  s.setAttribute("viewBox", `0 0 ${i.width} ${i.height}`), s.setAttribute("role", "img"), s.setAttribute("aria-label", this.props.label ?? "History chart");
2741
2764
  for (const a of i.valueTicks) {
2742
- const l = x("line");
2743
- l.classList.add("gridline"), _(l, {
2765
+ const l = z("line");
2766
+ l.classList.add("gridline"), U(l, {
2744
2767
  x1: i.plotLeft,
2745
2768
  x2: i.plotLeft + i.plotWidth,
2746
2769
  y1: a.y,
2747
2770
  y2: a.y
2748
2771
  }), s.append(l);
2749
- const u = x("text");
2750
- u.classList.add("axismark"), _(u, { x: i.plotLeft - 8, y: a.y + 4, "text-anchor": "end" }), u.textContent = String(a.value), s.append(u);
2772
+ const u = z("text");
2773
+ u.classList.add("axismark"), U(u, { x: i.plotLeft - 8, y: a.y + 4, "text-anchor": "end" }), u.textContent = String(a.value), s.append(u);
2751
2774
  }
2752
2775
  for (const a of i.dateMarks) {
2753
- const l = x("line");
2754
- l.classList.add("gridline"), _(l, {
2776
+ const l = z("line");
2777
+ l.classList.add("gridline"), U(l, {
2755
2778
  x1: a.x,
2756
2779
  x2: a.x,
2757
2780
  y1: i.plotTop,
2758
2781
  y2: i.plotTop + i.plotHeight
2759
2782
  }), s.append(l);
2760
- const u = x("text");
2761
- u.classList.add("axismark"), _(u, {
2783
+ const u = z("text");
2784
+ u.classList.add("axismark"), U(u, {
2762
2785
  x: a.x,
2763
2786
  y: i.plotTop + i.plotHeight + 22,
2764
2787
  "text-anchor": "middle"
@@ -2766,16 +2789,16 @@ class Se extends Te {
2766
2789
  }
2767
2790
  for (const a of i.series) {
2768
2791
  if (i.stacked) {
2769
- const u = x("path");
2770
- u.classList.add("seriesarea"), u.setAttribute("fill", a.color), u.setAttribute("d", qr(a.points, n)), s.append(u);
2792
+ const u = z("path");
2793
+ u.classList.add("seriesarea"), u.setAttribute("fill", a.color), u.setAttribute("d", _r(a.points, n)), s.append(u);
2771
2794
  }
2772
- const l = x("path");
2773
- l.classList.add("seriesline"), l.setAttribute("stroke", a.color), l.setAttribute("d", St(a.points, n)), s.append(l);
2795
+ const l = z("path");
2796
+ l.classList.add("seriesline"), l.setAttribute("stroke", a.color), l.setAttribute("d", Et(a.points, n)), s.append(l);
2774
2797
  }
2775
2798
  const o = this.cursorDate$.get();
2776
2799
  if (o != null) {
2777
- const a = S(o), l = i.plotLeft + (a - i.minDay) / Math.max(1, i.maxDay - i.minDay) * i.plotWidth, u = x("line");
2778
- u.classList.add("cursor"), _(u, {
2800
+ const a = S(o), l = i.plotLeft + (a - i.minDay) / Math.max(1, i.maxDay - i.minDay) * i.plotWidth, u = z("line");
2801
+ u.classList.add("cursor"), U(u, {
2779
2802
  x1: l,
2780
2803
  x2: l,
2781
2804
  y1: i.plotTop,
@@ -2785,7 +2808,7 @@ class Se extends Te {
2785
2808
  r.replaceChildren(s);
2786
2809
  }
2787
2810
  }
2788
- c(Se, "liveProps", []), c(Se, "hostName", "line-graph"), c(Se, "css", G`
2811
+ c(Ee, "liveProps", []), c(Ee, "hostName", "line-graph"), c(Ee, "css", X`
2789
2812
  & {
2790
2813
  display: flex;
2791
2814
  min-width: 0;
@@ -2889,15 +2912,15 @@ c(Se, "liveProps", []), c(Se, "hostName", "line-graph"), c(Se, "css", G`
2889
2912
  function Gr(t) {
2890
2913
  return t != null && (typeof t == "object" || typeof t == "function") && typeof Reflect.get(t, "get") == "function" && typeof Reflect.get(t, "subscribe") == "function";
2891
2914
  }
2892
- const Wr = "http://www.w3.org/2000/svg";
2893
- function x(t) {
2894
- return document.createElementNS(Wr, t);
2915
+ const Xr = "http://www.w3.org/2000/svg";
2916
+ function z(t) {
2917
+ return document.createElementNS(Xr, t);
2895
2918
  }
2896
- function _(t, e) {
2919
+ function U(t, e) {
2897
2920
  for (const [r, i] of Object.entries(e))
2898
2921
  t.setAttribute(r, String(i));
2899
2922
  }
2900
- class Xr {
2923
+ class Zr {
2901
2924
  constructor(e, r = {}) {
2902
2925
  c(this, "criteria");
2903
2926
  c(this, "presets");
@@ -2910,29 +2933,29 @@ class Xr {
2910
2933
  c(this, "activeSplitsEmitter");
2911
2934
  c(this, "activeEmitters", /* @__PURE__ */ new Map());
2912
2935
  c(this, "disposed", !1);
2913
- if (!Array.isArray(e) || e.some((o) => !(o instanceof I)))
2936
+ if (!Array.isArray(e) || e.some((o) => !(o instanceof B)))
2914
2937
  throw new TypeError("Split criteria must contain GroupingCriterion instances");
2915
2938
  const i = new Map(
2916
2939
  e.map((o) => [o.key, o])
2917
2940
  );
2918
2941
  if (i.size !== e.length) throw new Error("Split criteria keys must be unique");
2919
- this.criteria = Object.freeze([...e]), this.byKey = i, this.presets = Jr(r.presets ?? [], i);
2942
+ this.criteria = Object.freeze([...e]), this.byKey = i, this.presets = Qr(r.presets ?? [], i);
2920
2943
  const n = this.criteria.map(({ key: o }) => o), s = r.active ?? n;
2921
- V(s, i, "Active split keys"), this.state$ = new A(re(n, new Set(s)), {
2944
+ Y(s, i, "Active split keys"), this.state$ = new O(ie(n, new Set(s)), {
2922
2945
  owner: this,
2923
2946
  purpose: "split selection state",
2924
- equals: Qr
2925
- }), this.orderEmitter = new z(
2947
+ equals: ei
2948
+ }), this.orderEmitter = new R(
2926
2949
  [this.state$],
2927
2950
  ([o]) => Object.freeze(
2928
2951
  o.order.map((a) => Ge(i, a))
2929
2952
  ),
2930
2953
  { owner: this, purpose: "ordered visualization criteria" }
2931
- ), this.order$ = this.orderEmitter, this.activeSplitsEmitter = new z(
2954
+ ), this.order$ = this.orderEmitter, this.activeSplitsEmitter = new R(
2932
2955
  [this.state$],
2933
2956
  ([o]) => Object.freeze(o.order.filter((a) => o.active.has(a)).map((a) => Ge(i, a))),
2934
2957
  { owner: this, purpose: "active ordered visualization splits" }
2935
- ), this.activeSplits$ = this.activeSplitsEmitter, this.activePreset$ = new A(null, {
2958
+ ), this.activeSplits$ = this.activeSplitsEmitter, this.activePreset$ = new O(null, {
2936
2959
  owner: this,
2937
2960
  purpose: "active visualization split preset"
2938
2961
  });
@@ -2941,7 +2964,7 @@ class Xr {
2941
2964
  this.assertActive();
2942
2965
  const r = this.requireKey(e);
2943
2966
  let i = this.activeEmitters.get(r);
2944
- return i == null && (i = new Zr(this, r), this.activeEmitters.set(r, i)), i;
2967
+ return i == null && (i = new Jr(this, r), this.activeEmitters.set(r, i)), i;
2945
2968
  }
2946
2969
  isActive(e) {
2947
2970
  return this.state$.get().active.has(this.requireKey(e));
@@ -2950,7 +2973,7 @@ class Xr {
2950
2973
  this.assertActive();
2951
2974
  const i = this.requireKey(e), n = this.state$.get(), s = new Set(n.active);
2952
2975
  return s.has(i) ? s.delete(i) : s.add(i), this.activePreset$.set(null, "split selection customized"), this.state$.set(
2953
- re(n.order, s),
2976
+ ie(n.order, s),
2954
2977
  r ?? `${i} split toggled`
2955
2978
  );
2956
2979
  }
@@ -2962,7 +2985,7 @@ class Xr {
2962
2985
  if (o === a) return !1;
2963
2986
  const l = [...s.order];
2964
2987
  return l.splice(o, 1), l.splice(a, 0, n), this.activePreset$.set(null, "split order customized"), this.state$.set(
2965
- re(l, s.active),
2988
+ ie(l, s.active),
2966
2989
  i ?? `${n} split moved`
2967
2990
  );
2968
2991
  }
@@ -2976,14 +2999,14 @@ class Xr {
2976
2999
  );
2977
3000
  }
2978
3001
  setSplits(e, r, i) {
2979
- this.assertActive(), V(e, this.byKey, "Active split keys");
3002
+ this.assertActive(), Y(e, this.byKey, "Active split keys");
2980
3003
  const n = new Set(e), s = r ?? this.state$.get().order.filter((a) => !n.has(a));
2981
- V(s, this.byKey, "Inactive split keys");
3004
+ Y(s, this.byKey, "Inactive split keys");
2982
3005
  const o = [...e, ...s];
2983
3006
  if (new Set(o).size !== this.criteria.length || o.length !== this.criteria.length)
2984
3007
  throw new Error("Active and inactive split keys must cover every criterion exactly once");
2985
3008
  return this.activePreset$.set(null, "split selection replaced"), this.state$.set(
2986
- re(o, n),
3009
+ ie(o, n),
2987
3010
  i ?? "split selection replaced"
2988
3011
  );
2989
3012
  }
@@ -3010,10 +3033,10 @@ class Xr {
3010
3033
  if (this.disposed) throw new Error("Split selection model is disposed");
3011
3034
  }
3012
3035
  }
3013
- function ui(t, e = {}) {
3014
- return new Xr(t, e);
3036
+ function hi(t, e = {}) {
3037
+ return new Zr(t, e);
3015
3038
  }
3016
- class Zr extends xe {
3039
+ class Jr extends ze {
3017
3040
  constructor(r, i) {
3018
3041
  super(r.isActive(i) ? "visible" : "hidden", {
3019
3042
  owner: r,
@@ -3045,7 +3068,7 @@ class Zr extends xe {
3045
3068
  });
3046
3069
  }
3047
3070
  }
3048
- function Jr(t, e) {
3071
+ function Qr(t, e) {
3049
3072
  if (!Array.isArray(t)) throw new TypeError("Split presets must be an array");
3050
3073
  const r = /* @__PURE__ */ new Set();
3051
3074
  return Object.freeze(t.map((i) => {
@@ -3055,14 +3078,14 @@ function Jr(t, e) {
3055
3078
  throw new Error("Split preset keys must be non-empty and unique");
3056
3079
  if (typeof i.label != "string" || i.label.trim() === "")
3057
3080
  throw new TypeError("Split preset label must be a non-empty string");
3058
- r.add(i.key), V(i.active, e, `${i.key} active keys`);
3081
+ r.add(i.key), Y(i.active, e, `${i.key} active keys`);
3059
3082
  const n = Object.freeze([...i.active]), s = i.inactive == null ? Object.freeze([...e.keys()].filter((o) => !n.includes(o))) : Object.freeze([...i.inactive]);
3060
- if (V(s, e, `${i.key} inactive keys`), (/* @__PURE__ */ new Set([...n, ...s])).size !== e.size || n.length + s.length !== e.size)
3083
+ if (Y(s, e, `${i.key} inactive keys`), (/* @__PURE__ */ new Set([...n, ...s])).size !== e.size || n.length + s.length !== e.size)
3061
3084
  throw new Error(`Split preset "${i.key}" must cover every criterion exactly once`);
3062
3085
  return Object.freeze({ ...i, active: n, inactive: s });
3063
3086
  }));
3064
3087
  }
3065
- function V(t, e, r) {
3088
+ function Y(t, e, r) {
3066
3089
  if (!Array.isArray(t)) throw new TypeError(`${r} must be an array`);
3067
3090
  if (new Set(t).size !== t.length) throw new Error(`${r} must be unique`);
3068
3091
  for (const n of t)
@@ -3073,17 +3096,17 @@ function Ge(t, e) {
3073
3096
  if (r == null) throw new Error(`Missing criterion "${e}"`);
3074
3097
  return r;
3075
3098
  }
3076
- function re(t, e) {
3099
+ function ie(t, e) {
3077
3100
  return Object.freeze({ order: Object.freeze([...t]), active: new Set(e) });
3078
3101
  }
3079
- function Qr(t, e) {
3102
+ function ei(t, e) {
3080
3103
  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));
3081
3104
  }
3082
- const ei = [
3105
+ const ti = [
3083
3106
  ["☐", "hidden"],
3084
3107
  ["✓", "visible"]
3085
3108
  ];
3086
- class ie extends Te {
3109
+ class ne extends Te {
3087
3110
  constructor() {
3088
3111
  super(...arguments);
3089
3112
  c(this, "draggingKey", null);
@@ -3104,9 +3127,9 @@ class ie extends Te {
3104
3127
  } = this.props, o = this.read(r.order$);
3105
3128
  this.read(r.activeSplits$);
3106
3129
  const a = this.read(r.activePreset$), l = this.Host;
3107
- return /* @__PURE__ */ m(l, { children: [
3108
- r.presets.length === 0 ? null : /* @__PURE__ */ d(ge, { header: s, children: /* @__PURE__ */ d("cap-presets", { children: r.presets.map((u) => /* @__PURE__ */ d(
3109
- oe,
3130
+ return /* @__PURE__ */ y(l, { children: [
3131
+ r.presets.length === 0 ? null : /* @__PURE__ */ d(be, { header: s, children: /* @__PURE__ */ d("cap-presets", { children: r.presets.map((u) => /* @__PURE__ */ d(
3132
+ ae,
3110
3133
  {
3111
3134
  label: u.label,
3112
3135
  pressed: a === u.key,
@@ -3116,9 +3139,9 @@ class ie extends Te {
3116
3139
  },
3117
3140
  u.key
3118
3141
  )) }) }),
3119
- /* @__PURE__ */ m(ge, { header: i, children: [
3142
+ /* @__PURE__ */ y(be, { header: i, children: [
3120
3143
  /* @__PURE__ */ d("p", { children: n }),
3121
- /* @__PURE__ */ d("ol", { children: o.map((u) => /* @__PURE__ */ m(
3144
+ /* @__PURE__ */ d("ol", { children: o.map((u) => /* @__PURE__ */ y(
3122
3145
  "li",
3123
3146
  {
3124
3147
  className: this.draggingKey === u.key ? "dragging" : void 0,
@@ -3127,9 +3150,9 @@ class ie extends Te {
3127
3150
  onClick: (h) => this.suppressDraggedClick(h),
3128
3151
  children: [
3129
3152
  /* @__PURE__ */ d(
3130
- ae,
3153
+ le,
3131
3154
  {
3132
- symbols: ei,
3155
+ symbols: ti,
3133
3156
  label: u.label,
3134
3157
  valueEmitter: r.activeState(u.key)
3135
3158
  }
@@ -3145,10 +3168,10 @@ class ie extends Te {
3145
3168
  if (!h.altKey || h.key !== "ArrowUp" && h.key !== "ArrowDown")
3146
3169
  return;
3147
3170
  h.preventDefault();
3148
- const p = h.key === "ArrowUp" ? -1 : 1;
3149
- if (r.moveBy(u.key, p, "split reordered by keyboard")) {
3150
- const b = r.order$.get().findIndex(({ key: y }) => y === u.key) + 1;
3151
- this.announce(`${u.label} moved to position ${b}`), queueMicrotask(() => this.focusHandle(u.key));
3171
+ const f = h.key === "ArrowUp" ? -1 : 1;
3172
+ if (r.moveBy(u.key, f, "split reordered by keyboard")) {
3173
+ const v = r.order$.get().findIndex(({ key: g }) => g === u.key) + 1;
3174
+ this.announce(`${u.label} moved to position ${v}`), queueMicrotask(() => this.focusHandle(u.key));
3152
3175
  }
3153
3176
  }
3154
3177
  }
@@ -3208,7 +3231,7 @@ class ie extends Te {
3208
3231
  }
3209
3232
  }
3210
3233
  }
3211
- c(ie, "liveProps", []), c(ie, "hostName", "split-selection-panel"), c(ie, "dependencies", [oe, ae, ge]), c(ie, "css", G`
3234
+ c(ne, "liveProps", []), c(ne, "hostName", "split-selection-panel"), c(ne, "dependencies", [ae, le, be]), c(ne, "css", X`
3212
3235
  & {
3213
3236
  display: grid;
3214
3237
  gap: var(--viz-space, 0.6rem);
@@ -3252,7 +3275,7 @@ c(ie, "liveProps", []), c(ie, "hostName", "split-selection-panel"), c(ie, "depen
3252
3275
 
3253
3276
  & ol {
3254
3277
  display: grid;
3255
- gap: 0.25rem;
3278
+ gap: .33rem;
3256
3279
  padding: 0;
3257
3280
  list-style: none;
3258
3281
  }
@@ -3264,7 +3287,7 @@ c(ie, "liveProps", []), c(ie, "hostName", "split-selection-panel"), c(ie, "depen
3264
3287
  justify-content: space-between;
3265
3288
  gap: 0.35rem;
3266
3289
  min-width: 0;
3267
- padding: 0 .35rem;
3290
+ padding: .15rem .35rem;
3268
3291
  border-radius: var(--ui-border-radius);
3269
3292
  box-shadow: var(--box-shadow);
3270
3293
  }
@@ -3319,13 +3342,13 @@ c(ie, "liveProps", []), c(ie, "hostName", "split-selection-panel"), c(ie, "depen
3319
3342
  border: 0;
3320
3343
  }
3321
3344
  `);
3322
- class hi {
3345
+ class di {
3323
3346
  constructor(e) {
3324
3347
  c(this, "categories");
3325
3348
  c(this, "byKey");
3326
3349
  c(this, "deltas", /* @__PURE__ */ new Map());
3327
3350
  if (!Array.isArray(e)) throw new TypeError("Series categories must be an array");
3328
- const r = e.map((n) => ti(n)), i = new Map(r.map((n) => [n.key, n]));
3351
+ const r = e.map((n) => ri(n)), i = new Map(r.map((n) => [n.key, n]));
3329
3352
  if (i.size !== r.length) throw new Error("Series category keys must be unique");
3330
3353
  this.categories = Object.freeze(r), this.byKey = i;
3331
3354
  }
@@ -3344,7 +3367,7 @@ class hi {
3344
3367
  }
3345
3368
  build() {
3346
3369
  const e = this.allDates();
3347
- return this.categories.map((r) => We(r, Object.fromEntries(e.map((i) => {
3370
+ return this.categories.map((r) => Xe(r, Object.fromEntries(e.map((i) => {
3348
3371
  var n;
3349
3372
  return [
3350
3373
  i,
@@ -3362,14 +3385,14 @@ class hi {
3362
3385
  const s = { [r[0]]: 0 };
3363
3386
  for (const a of e)
3364
3387
  n += ((o = this.deltas.get(i.key)) == null ? void 0 : o.get(a)) ?? 0, s[a] = n;
3365
- return We(i, s, !0);
3388
+ return Xe(i, s, !0);
3366
3389
  }).filter((i) => Object.values(i.values).some((n) => n !== 0));
3367
3390
  }
3368
3391
  allDates() {
3369
- return [...new Set([...this.deltas.values()].flatMap((e) => [...e.keys()]))].sort(Ir);
3392
+ return [...new Set([...this.deltas.values()].flatMap((e) => [...e.keys()]))].sort(Br);
3370
3393
  }
3371
3394
  }
3372
- function ti(t) {
3395
+ function ri(t) {
3373
3396
  if (t == null || typeof t != "object")
3374
3397
  throw new TypeError("Series category must be an object");
3375
3398
  if (typeof t.key != "string" || t.key.trim() === "")
@@ -3382,7 +3405,7 @@ function ti(t) {
3382
3405
  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 };
3383
3406
  return Object.freeze(r);
3384
3407
  }
3385
- function We(t, e, r) {
3408
+ function Xe(t, e, r) {
3386
3409
  return Object.freeze({
3387
3410
  ...t,
3388
3411
  values: Object.freeze(e),
@@ -3390,37 +3413,37 @@ function We(t, e, r) {
3390
3413
  });
3391
3414
  }
3392
3415
  export {
3393
- ee as BlockGraph,
3394
- It as BlockSelectionModel,
3395
- te as CategoryHidePanel,
3416
+ _ as BlockGraph,
3417
+ Bt as BlockSelectionModel,
3418
+ re as CategoryHidePanel,
3396
3419
  de as CollapsibleOptionGroup,
3397
- I as GroupingCriterion,
3398
- Se as LineGraph,
3399
- hi as SeriesBuilder,
3400
- Xr as SplitSelectionModel,
3401
- ie as SplitSelectionPanel,
3420
+ B as GroupingCriterion,
3421
+ Ee as LineGraph,
3422
+ di as SeriesBuilder,
3423
+ Zr as SplitSelectionModel,
3424
+ ne as SplitSelectionPanel,
3402
3425
  Nr as addCivilDays,
3403
- qr as areaPath,
3404
- we as buildBlockLayout,
3405
- _r as buildIntegerTicks,
3406
- Br as buildLineChartModel,
3407
- Xe as categoryColorVariables,
3408
- li as categoryCounts,
3426
+ _r as areaPath,
3427
+ ve as buildBlockLayout,
3428
+ Ur as buildIntegerTicks,
3429
+ Fr as buildLineChartModel,
3430
+ Ze as categoryColorVariables,
3431
+ ci as categoryCounts,
3409
3432
  S as civilDateToDay,
3410
- Ir as compareCivilDates,
3411
- ci as createBlockSelection,
3412
- ui as createSplitSelection,
3413
- Kt as criterionSnapshot,
3414
- K as dayToCivilDate,
3415
- Dt as deriveCategories,
3416
- oi as derivedCriterion,
3417
- ai as filterByHidden,
3418
- D as findBlock,
3419
- vt as flattenBlocks,
3420
- St as linePath,
3421
- Mt as setsEqual,
3422
- si as staticCriterion,
3423
- Kr as todayCivilDate,
3424
- Fr as valueAtDate
3433
+ Br as compareCivilDates,
3434
+ ui as createBlockSelection,
3435
+ hi as createSplitSelection,
3436
+ It as criterionSnapshot,
3437
+ I as dayToCivilDate,
3438
+ Mt as deriveCategories,
3439
+ ai as derivedCriterion,
3440
+ li as filterByHidden,
3441
+ M as findBlock,
3442
+ kt as flattenBlocks,
3443
+ Et as linePath,
3444
+ Pt as setsEqual,
3445
+ oi as staticCriterion,
3446
+ Ir as todayCivilDate,
3447
+ qr as valueAtDate
3425
3448
  };
3426
3449
  //# sourceMappingURL=index.js.map