@cfasim-ui/charts 0.4.3 → 0.4.5

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,12 +1,12 @@
1
1
  import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, guardReactiveProps as u, mergeProps as d, normalizeClass as f, normalizeProps as p, normalizeStyle as m, onMounted as h, onUnmounted as ee, openBlock as g, ref as _, renderList as v, renderSlot as te, toDisplayString as y, toHandlers as ne, toRaw as b, unref as x, useSlots as re, useTemplateRef as S, watch as C, withCtx as w } from "vue";
2
- import { DropdownMenuContent as T, DropdownMenuItem as E, DropdownMenuPortal as D, DropdownMenuRoot as O, DropdownMenuTrigger as k, PopoverAnchor as A, PopoverContent as j, PopoverPortal as M, PopoverRoot as N } from "reka-ui";
3
- import { geoAlbersUsa as P, geoPath as ie } from "d3-geo";
4
- import { zoom as F, zoomIdentity as I } from "d3-zoom";
5
- import { select as ae } from "d3-selection";
2
+ import { DropdownMenuContent as T, DropdownMenuItem as ie, DropdownMenuPortal as E, DropdownMenuRoot as D, DropdownMenuTrigger as O, PopoverAnchor as k, PopoverContent as A, PopoverPortal as j, PopoverRoot as M } from "reka-ui";
3
+ import { geoAlbersUsa as N, geoPath as ae } from "d3-geo";
4
+ import { zoom as P, zoomIdentity as F } from "d3-zoom";
5
+ import { select as oe } from "d3-selection";
6
6
  import "d3-transition";
7
- import { feature as L, merge as oe, mesh as R } from "topojson-client";
7
+ import { feature as I, merge as se, mesh as L } from "topojson-client";
8
8
  //#region src/ChartMenu/ChartMenu.vue?vue&type=script&setup=true&lang.ts
9
- var z = { class: "chart-menu-trigger-area" }, B = ["aria-label"], V = /* @__PURE__ */ l({
9
+ var R = { class: "chart-menu-trigger-area" }, z = ["aria-label"], B = /* @__PURE__ */ l({
10
10
  __name: "ChartMenu",
11
11
  props: {
12
12
  items: {},
@@ -17,11 +17,11 @@ var z = { class: "chart-menu-trigger-area" }, B = ["aria-label"], V = /* @__PURE
17
17
  },
18
18
  setup(t) {
19
19
  let n = t, i = () => n.forceDropdown || n.items.length > 1;
20
- return (n, l) => (g(), a("div", z, [i() ? (g(), r(x(O), {
20
+ return (n, l) => (g(), a("div", R, [i() ? (g(), r(x(D), {
21
21
  key: 1,
22
22
  modal: !1
23
23
  }, {
24
- default: w(() => [c(x(k), {
24
+ default: w(() => [c(x(O), {
25
25
  class: "chart-menu-button",
26
26
  "aria-label": "Chart options"
27
27
  }, {
@@ -49,13 +49,13 @@ var z = { class: "chart-menu-trigger-area" }, B = ["aria-label"], V = /* @__PURE
49
49
  })
50
50
  ], -1)]]),
51
51
  _: 1
52
- }), c(x(D), null, {
52
+ }), c(x(E), null, {
53
53
  default: w(() => [c(x(T), {
54
54
  class: "chart-menu-content",
55
55
  "side-offset": 4,
56
56
  align: "end"
57
57
  }, {
58
- default: w(() => [(g(!0), a(e, null, v(t.items, (e) => (g(), r(x(E), {
58
+ default: w(() => [(g(!0), a(e, null, v(t.items, (e) => (g(), r(x(ie), {
59
59
  key: e.label,
60
60
  class: "chart-menu-item",
61
61
  onSelect: e.action
@@ -83,46 +83,46 @@ var z = { class: "chart-menu-trigger-area" }, B = ["aria-label"], V = /* @__PURE
83
83
  "stroke-linecap": "round",
84
84
  "stroke-linejoin": "round",
85
85
  "aria-hidden": "true"
86
- }, [o("path", { d: "M7 1v8M3 6l4 4 4-4M2 13h10" })], -1)]], 8, B))]));
86
+ }, [o("path", { d: "M7 1v8M3 6l4 4 4-4M2 13h10" })], -1)]], 8, z))]));
87
87
  }
88
- }), H = (e, t) => {
88
+ }), V = (e, t) => {
89
89
  let n = e.__vccOpts || e;
90
90
  for (let [e, r] of t) n[e] = r;
91
91
  return n;
92
- }, se = /* @__PURE__ */ H(V, [["__scopeId", "data-v-b3c563e8"]]);
92
+ }, ce = /* @__PURE__ */ V(B, [["__scopeId", "data-v-b3c563e8"]]);
93
93
  //#endregion
94
94
  //#region src/_shared/axes.ts
95
- function U(e) {
95
+ function H(e) {
96
96
  return Math.round(e) + .5;
97
97
  }
98
- function W(e, t) {
98
+ function U(e, t) {
99
99
  let n = e / t, r = 10 ** Math.floor(Math.log10(n)), i = n / r, a;
100
100
  return a = i <= 1.5 ? 1 : i <= 3 ? 2 : i <= 7 ? 5 : 10, a * r;
101
101
  }
102
- function G(e, t, n) {
102
+ function W(e, t, n) {
103
103
  if (!(n > 0) || !isFinite(n)) return [];
104
104
  let r = [], i = Math.ceil(e / n) * n;
105
105
  for (let e = 0, a = i; a <= t + 1e-9 && e < 1e3; e++, a = i + e * n) r.push(a);
106
106
  return r;
107
107
  }
108
- var ce = new Intl.NumberFormat();
108
+ var G = new Intl.NumberFormat();
109
109
  function K(e) {
110
- return Math.abs(e) >= 1e3 ? ce.format(e) : Number.isInteger(e) ? e.toString() : e.toFixed(1);
110
+ return Math.abs(e) >= 1e3 ? G.format(e) : Number.isInteger(e) ? e.toString() : e.toFixed(1);
111
111
  }
112
112
  //#endregion
113
113
  //#region src/_shared/computeTicks.ts
114
- function le(e) {
114
+ function q(e) {
115
115
  let { min: t, max: n, ticks: r } = e;
116
116
  if (t === n) return [];
117
117
  let i = e.displayOffset ?? 0;
118
118
  if (Array.isArray(r)) return r.map((e) => e - i).filter((e) => e >= t && e <= n);
119
- if (typeof r == "number") return G(t + i, n + i, r).map((e) => e - i);
120
- let a = Math.max(3, Math.floor(e.targetTickCount ?? 3)), o = W(n - t, a);
121
- return G(t + i, n + i, o).map((e) => e - i);
119
+ if (typeof r == "number") return W(t + i, n + i, r).map((e) => e - i);
120
+ let a = Math.max(3, Math.floor(e.targetTickCount ?? 3)), o = U(n - t, a);
121
+ return W(t + i, n + i, o).map((e) => e - i);
122
122
  }
123
123
  //#endregion
124
124
  //#region src/_shared/useChartSize.ts
125
- function ue(e = {}) {
125
+ function le(e = {}) {
126
126
  let t = _(null), n = _(0), r = null, i = null;
127
127
  return h(() => {
128
128
  t.value && (n.value = t.value.clientWidth, r = new ResizeObserver((t) => {
@@ -140,7 +140,7 @@ function ue(e = {}) {
140
140
  measuredWidth: n
141
141
  };
142
142
  }
143
- function de(e) {
143
+ function ue(e) {
144
144
  let t = n(() => ({
145
145
  top: (e.title() ? 30 : 10) + (e.hasInlineLegend() ? 20 : 0),
146
146
  right: 10,
@@ -155,10 +155,10 @@ function de(e) {
155
155
  }
156
156
  //#endregion
157
157
  //#region src/tooltip-position.ts
158
- var q = 16, J = 8;
159
- function Y(e, t, n, r, i, a) {
158
+ var J = 16, Y = 8;
159
+ function X(e, t, n, r, i, a) {
160
160
  if (i === "none") return {
161
- left: e + q,
161
+ left: e + J,
162
162
  top: t
163
163
  };
164
164
  let o = i === "chart" && a ? {
@@ -171,15 +171,15 @@ function Y(e, t, n, r, i, a) {
171
171
  right: window.innerWidth,
172
172
  top: 0,
173
173
  bottom: window.innerHeight
174
- }, s = e + q + n > o.right - J ? e - q - n : e + q, c = r / 2;
174
+ }, s = e + J + n > o.right - Y ? e - J - n : e + J, c = r / 2;
175
175
  return {
176
176
  left: s,
177
- top: Math.min(Math.max(t, o.top + J + c), o.bottom - J - c)
177
+ top: Math.min(Math.max(t, o.top + Y + c), o.bottom - Y - c)
178
178
  };
179
179
  }
180
180
  //#endregion
181
181
  //#region src/_shared/useChartTooltip.ts
182
- function fe(e) {
182
+ function de(e) {
183
183
  let t = e.touchYOffset ?? 50, n = _(null), r = _(!1), i = _(null), a = _(null), o = _(null);
184
184
  function s(e) {
185
185
  return "touches" in e ? e.touches[0] ?? null : e;
@@ -200,7 +200,7 @@ function fe(e) {
200
200
  }
201
201
  let s = i.value, c = e.containerRef.value;
202
202
  if (!s || !c) return;
203
- let l = c.getBoundingClientRect(), u = r.value ? t : 0, d = e.clamp?.() ?? "chart", { left: f, top: p } = Y(a.value.clientX, a.value.clientY - u, s.offsetWidth, s.offsetHeight, d, l);
203
+ let l = c.getBoundingClientRect(), u = r.value ? t : 0, d = e.clamp?.() ?? "chart", { left: f, top: p } = X(a.value.clientX, a.value.clientY - u, s.offsetWidth, s.offsetHeight, d, l);
204
204
  o.value = {
205
205
  left: f - l.left,
206
206
  top: p - l.top
@@ -246,17 +246,17 @@ function fe(e) {
246
246
  }
247
247
  //#endregion
248
248
  //#region src/ChartMenu/download.ts
249
- function pe(e, t) {
249
+ function fe(e, t) {
250
250
  let n = URL.createObjectURL(e), r = document.createElement("a");
251
251
  r.href = n, r.download = t, r.click(), URL.revokeObjectURL(n);
252
252
  }
253
- function X(e, t) {
253
+ function Z(e, t) {
254
254
  let n = e.cloneNode(!0);
255
255
  n.setAttribute("xmlns", "http://www.w3.org/2000/svg");
256
256
  let r = new XMLSerializer().serializeToString(n);
257
- pe(new Blob([r], { type: "image/svg+xml" }), `${t}.svg`);
257
+ fe(new Blob([r], { type: "image/svg+xml" }), `${t}.svg`);
258
258
  }
259
- function me(e, t) {
259
+ function pe(e, t) {
260
260
  let n = e.cloneNode(!0);
261
261
  n.setAttribute("xmlns", "http://www.w3.org/2000/svg");
262
262
  let r = new XMLSerializer().serializeToString(n), i = new Blob([r], { type: "image/svg+xml;charset=utf-8" }), a = URL.createObjectURL(i), o = new Image(), s = e.width.baseVal.value || e.clientWidth, c = e.height.baseVal.value || e.clientHeight;
@@ -265,16 +265,16 @@ function me(e, t) {
265
265
  e.width = s * 2, e.height = c * 2;
266
266
  let n = e.getContext("2d");
267
267
  n.scale(2, 2), n.drawImage(o, 0, 0, s, c), e.toBlob((e) => {
268
- e && pe(e, `${t}.png`);
268
+ e && fe(e, `${t}.png`);
269
269
  }), URL.revokeObjectURL(a);
270
270
  }, o.src = a;
271
271
  }
272
- function Z(e, t) {
273
- pe(new Blob([e], { type: "text/csv" }), `${t}.csv`);
272
+ function Q(e, t) {
273
+ fe(new Blob([e], { type: "text/csv" }), `${t}.csv`);
274
274
  }
275
275
  //#endregion
276
276
  //#region src/_shared/useChartMenu.ts
277
- function he(e) {
277
+ function me(e) {
278
278
  let t = _(null);
279
279
  function r() {
280
280
  let t = e.filename();
@@ -288,17 +288,17 @@ function he(e) {
288
288
  let n = r(), i = [{
289
289
  label: "Save as SVG",
290
290
  action: () => {
291
- t.value && X(t.value, n);
291
+ t.value && Z(t.value, n);
292
292
  }
293
293
  }, {
294
294
  label: "Save as PNG",
295
295
  action: () => {
296
- t.value && me(t.value, n);
296
+ t.value && pe(t.value, n);
297
297
  }
298
298
  }];
299
299
  return e.downloadLink() || i.push({
300
300
  label: "Download CSV",
301
- action: () => Z(e.getCsv(), n)
301
+ action: () => Q(e.getCsv(), n)
302
302
  }), i;
303
303
  }),
304
304
  downloadLinkText: n(() => {
@@ -311,7 +311,7 @@ function he(e) {
311
311
  }
312
312
  //#endregion
313
313
  //#region src/_shared/seriesCsv.ts
314
- function ge(e) {
314
+ function he(e) {
315
315
  if (e.length === 0) return "";
316
316
  let t = 0;
317
317
  for (let n of e) n.data.length > t && (t = n.data.length);
@@ -323,17 +323,17 @@ function ge(e) {
323
323
  }
324
324
  return i.join("\n");
325
325
  }
326
- function _e(e, t, n = "category") {
326
+ function ge(e, t, n = "category") {
327
327
  if (t.length === 0 || e.length === 0) return "";
328
328
  let r = [(t.length === 1 ? [n, t[0].label || "value"] : [n, ...t.map((e, t) => e.label || `series_${t}`)]).join(",")];
329
329
  for (let n = 0; n < e.length; n++) {
330
- let i = [Q(e[n])];
330
+ let i = [_e(e[n])];
331
331
  for (let e of t) i.push(n < e.data.length ? String(e.data[n]) : "");
332
332
  r.push(i.join(","));
333
333
  }
334
334
  return r.join("\n");
335
335
  }
336
- function Q(e) {
336
+ function _e(e) {
337
337
  return e.includes(",") || e.includes("\"") || e.includes("\n") ? `"${e.replace(/"/g, "\"\"")}"` : e;
338
338
  }
339
339
  //#endregion
@@ -345,63 +345,63 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
345
345
  "y2",
346
346
  "stroke",
347
347
  "stroke-dasharray"
348
- ], $ = [
348
+ ], Se = [
349
349
  "cx",
350
350
  "cy",
351
351
  "fill",
352
352
  "fill-opacity",
353
353
  "stroke"
354
- ], Se = ["x", "y"], Ce = [
354
+ ], Ce = ["x", "y"], we = [
355
355
  "x1",
356
356
  "y1",
357
357
  "x2",
358
358
  "y2"
359
- ], we = [
359
+ ], Te = [
360
360
  "x1",
361
361
  "y1",
362
362
  "x2",
363
363
  "y2"
364
- ], Te = [
364
+ ], Ee = [
365
365
  "x1",
366
366
  "y1",
367
367
  "x2",
368
368
  "y2"
369
- ], Ee = [
369
+ ], De = [
370
370
  "x1",
371
371
  "y1",
372
372
  "x2",
373
373
  "y2"
374
- ], De = ["x", "y"], Oe = ["transform"], ke = [
374
+ ], Oe = ["x", "y"], ke = ["transform"], Ae = [
375
375
  "x",
376
376
  "y",
377
377
  "text-anchor"
378
- ], Ae = ["x", "y"], je = [
378
+ ], je = ["x", "y"], Me = [
379
379
  "d",
380
380
  "fill",
381
381
  "fill-opacity"
382
- ], Me = [
382
+ ], Ne = [
383
383
  "d",
384
384
  "stroke",
385
385
  "stroke-width",
386
386
  "stroke-opacity",
387
387
  "stroke-dasharray"
388
- ], Ne = [
388
+ ], Pe = [
389
389
  "cx",
390
390
  "cy",
391
391
  "r",
392
392
  "fill",
393
393
  "fill-opacity",
394
394
  "stroke"
395
- ], Pe = [
395
+ ], Fe = [
396
396
  "d",
397
397
  "fill",
398
398
  "fill-opacity"
399
- ], Fe = [
399
+ ], Ie = [
400
400
  "d",
401
401
  "stroke",
402
402
  "stroke-width",
403
403
  "stroke-dasharray"
404
- ], Ie = [
404
+ ], Le = [
405
405
  "x1",
406
406
  "y1",
407
407
  "x2",
@@ -409,7 +409,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
409
409
  "stroke",
410
410
  "stroke-width",
411
411
  "stroke-dasharray"
412
- ], Le = [
412
+ ], Re = [
413
413
  "x1",
414
414
  "y1",
415
415
  "x2",
@@ -417,44 +417,44 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
417
417
  "stroke",
418
418
  "stroke-width",
419
419
  "stroke-dasharray"
420
- ], Re = [
420
+ ], ze = [
421
421
  "x1",
422
422
  "y1",
423
423
  "x2",
424
424
  "y2"
425
- ], ze = [
425
+ ], Be = [
426
426
  "x1",
427
427
  "y1",
428
428
  "x2",
429
429
  "y2"
430
- ], Be = [
430
+ ], Ve = [
431
431
  "x1",
432
432
  "y1",
433
433
  "x2",
434
434
  "y2"
435
- ], Ve = [
435
+ ], He = [
436
436
  "cx",
437
437
  "cy",
438
438
  "fill"
439
- ], He = [
439
+ ], Ue = [
440
440
  "x",
441
441
  "y",
442
442
  "width",
443
443
  "height"
444
- ], Ue = [
444
+ ], We = [
445
445
  "cx",
446
446
  "cy",
447
447
  "fill",
448
448
  "fill-opacity",
449
449
  "stroke"
450
- ], We = [
450
+ ], Ge = [
451
451
  "x",
452
452
  "y",
453
453
  "fill"
454
- ], Ge = ["x", "y"], Ke = { class: "line-chart-tooltip" }, qe = {
454
+ ], Ke = ["x", "y"], qe = { class: "line-chart-tooltip" }, Je = {
455
455
  key: 0,
456
456
  class: "line-chart-tooltip-label"
457
- }, Je = ["href", "download"], Ye = 36, Xe = 12, Ze = 7, Qe = 16, $e = /* @__PURE__ */ H(/* @__PURE__ */ l({
457
+ }, Ye = ["href", "download"], Xe = 36, Ze = 12, Qe = 7, $e = 16, et = /* @__PURE__ */ V(/* @__PURE__ */ l({
458
458
  __name: "LineChart",
459
459
  props: {
460
460
  y: {},
@@ -493,7 +493,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
493
493
  },
494
494
  emits: ["hover"],
495
495
  setup(t, { emit: c }) {
496
- let l = t, f = c, { containerRef: h, measuredWidth: ee } = ue({ debounce: () => l.debounce }), _ = n(() => l.width ?? (ee.value || 400)), b = n(() => l.height ?? 200), re = n(() => O.value.some((e) => e.legend) || l.areaSections?.some((e) => e.legend === "inline" && (e.label || e.description)) || !1), { padding: S, innerW: C, innerH: w } = de({
496
+ let l = t, f = c, { containerRef: h, measuredWidth: ee } = le({ debounce: () => l.debounce }), _ = n(() => l.width ?? (ee.value || 400)), b = n(() => l.height ?? 200), re = n(() => D.value.some((e) => e.legend) || l.areaSections?.some((e) => e.legend === "inline" && (e.label || e.description)) || !1), { padding: S, innerW: C, innerH: w } = ue({
497
497
  title: () => l.title,
498
498
  xLabel: () => l.xLabel,
499
499
  yLabel: () => l.yLabel,
@@ -501,44 +501,44 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
501
501
  width: () => _.value,
502
502
  height: () => b.value
503
503
  }), T = [];
504
- function E(e) {
504
+ function ie(e) {
505
505
  return {
506
506
  ...e,
507
507
  data: e.y ?? e.data ?? T
508
508
  };
509
509
  }
510
- function D(e) {
510
+ function E(e) {
511
511
  return l.tooltipValueFormat ? l.tooltipValueFormat(e) : l.yTickFormat ? l.yTickFormat(e) : K(e);
512
512
  }
513
- let O = n(() => {
514
- if (l.series && l.series.length > 0) return l.series.map(E);
513
+ let D = n(() => {
514
+ if (l.series && l.series.length > 0) return l.series.map(ie);
515
515
  let e = l.y ?? l.data;
516
516
  return e ? [{
517
517
  data: e,
518
518
  x: l.x
519
519
  }] : [];
520
- }), k = n(() => l.areas ?? []), A = n(() => {
520
+ }), O = n(() => l.areas ?? []), k = n(() => {
521
521
  let e = 0;
522
- for (let t of O.value) t.data.length > e && (e = t.data.length);
523
- for (let t of k.value) t.upper.length > e && (e = t.upper.length), t.lower.length > e && (e = t.lower.length);
522
+ for (let t of D.value) t.data.length > e && (e = t.data.length);
523
+ for (let t of O.value) t.upper.length > e && (e = t.upper.length), t.lower.length > e && (e = t.lower.length);
524
524
  return e;
525
- }), j = n(() => O.value.some((e) => e.x != null) || k.value.some((e) => e.x != null));
526
- function M(e, t) {
525
+ }), A = n(() => D.value.some((e) => e.x != null) || O.value.some((e) => e.x != null));
526
+ function j(e, t) {
527
527
  return e.x ? Number(e.x[t]) : t;
528
528
  }
529
- function N(e, t) {
529
+ function M(e, t) {
530
530
  return e.x ? Number(e.x[t]) : t;
531
531
  }
532
- let P = n(() => j.value ? 0 : l.xMin ?? 0), ie = n(() => {
532
+ let N = n(() => A.value ? 0 : l.xMin ?? 0), ae = n(() => {
533
533
  let e = Infinity, t = -Infinity;
534
- for (let n of O.value) for (let r = 0; r < n.data.length; r++) {
535
- let i = M(n, r);
534
+ for (let n of D.value) for (let r = 0; r < n.data.length; r++) {
535
+ let i = j(n, r);
536
536
  isFinite(i) && (i < e && (e = i), i > t && (t = i));
537
537
  }
538
- for (let n of k.value) {
538
+ for (let n of O.value) {
539
539
  let r = Math.max(n.upper.length, n.lower.length);
540
540
  for (let i = 0; i < r; i++) {
541
- let r = N(n, i);
541
+ let r = M(n, i);
542
542
  isFinite(r) && (r < e && (e = r), r > t && (t = r));
543
543
  }
544
544
  }
@@ -550,14 +550,14 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
550
550
  max: 0
551
551
  };
552
552
  });
553
- function F(e) {
554
- let { min: t, max: n } = ie.value, r = n - t || 1;
553
+ function P(e) {
554
+ let { min: t, max: n } = ae.value, r = n - t || 1;
555
555
  return S.value.left + (e - t) / r * C.value;
556
556
  }
557
- let I = n(() => {
557
+ let F = n(() => {
558
558
  let e = Infinity, t = -Infinity;
559
- for (let n of O.value) for (let r of n.data) isFinite(r) && (r < e && (e = r), r > t && (t = r));
560
- for (let n of k.value) {
559
+ for (let n of D.value) for (let r of n.data) isFinite(r) && (r < e && (e = r), r > t && (t = r));
560
+ for (let n of O.value) {
561
561
  for (let r of n.upper) isFinite(r) && (r < e && (e = r), r > t && (t = r));
562
562
  for (let r of n.lower) isFinite(r) && (r < e && (e = r), r > t && (t = r));
563
563
  }
@@ -571,66 +571,66 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
571
571
  range: 1
572
572
  };
573
573
  });
574
- function ae(e) {
574
+ function oe(e) {
575
575
  let t = e.data;
576
576
  if (t.length === 0) return "";
577
- let { min: n, range: r } = I.value, i = w.value / r, a = S.value.top + w.value, o = "", s = !1;
577
+ let { min: n, range: r } = F.value, i = w.value / r, a = S.value.top + w.value, o = "", s = !1;
578
578
  for (let r = 0; r < t.length; r++) {
579
- let c = M(e, r);
579
+ let c = j(e, r);
580
580
  if (!isFinite(t[r]) || !isFinite(c)) {
581
581
  s = !1;
582
582
  continue;
583
583
  }
584
- let l = F(c), u = a - (t[r] - n) * i;
584
+ let l = P(c), u = a - (t[r] - n) * i;
585
585
  o += s ? `L${l},${u}` : `M${l},${u}`, s = !0;
586
586
  }
587
587
  return o;
588
588
  }
589
- function L(e) {
590
- let t = e.data, { min: n, range: r } = I.value, i = w.value / r, a = S.value.top + w.value, o = [];
589
+ function I(e) {
590
+ let t = e.data, { min: n, range: r } = F.value, i = w.value / r, a = S.value.top + w.value, o = [];
591
591
  for (let r = 0; r < t.length; r++) {
592
- let s = M(e, r);
592
+ let s = j(e, r);
593
593
  !isFinite(t[r]) || !isFinite(s) || o.push({
594
- x: F(s),
594
+ x: P(s),
595
595
  y: a - (t[r] - n) * i
596
596
  });
597
597
  }
598
598
  return o;
599
599
  }
600
- function oe(e) {
600
+ function se(e) {
601
601
  let t = Math.min(e.upper.length, e.lower.length);
602
602
  if (t === 0) return "";
603
- let { min: n, range: r } = I.value, i = w.value / r, a = S.value.top + w.value, o = (e) => a - (e - n) * i, s = [], c = [];
604
- for (let n = 0; n < t; n++) isFinite(e.upper[n]) && isFinite(e.lower[n]) && isFinite(N(e, n)) ? c.push(n) : c.length && (s.push(c), c = []);
603
+ let { min: n, range: r } = F.value, i = w.value / r, a = S.value.top + w.value, o = (e) => a - (e - n) * i, s = [], c = [];
604
+ for (let n = 0; n < t; n++) isFinite(e.upper[n]) && isFinite(e.lower[n]) && isFinite(M(e, n)) ? c.push(n) : c.length && (s.push(c), c = []);
605
605
  c.length && s.push(c);
606
606
  let l = "";
607
607
  for (let t of s) {
608
- l += `M${F(N(e, t[0]))},${o(e.upper[t[0]])}`;
609
- for (let n = 1; n < t.length; n++) l += `L${F(N(e, t[n]))},${o(e.upper[t[n]])}`;
610
- for (let n = t.length - 1; n >= 0; n--) l += `L${F(N(e, t[n]))},${o(e.lower[t[n]])}`;
608
+ l += `M${P(M(e, t[0]))},${o(e.upper[t[0]])}`;
609
+ for (let n = 1; n < t.length; n++) l += `L${P(M(e, t[n]))},${o(e.upper[t[n]])}`;
610
+ for (let n = t.length - 1; n >= 0; n--) l += `L${P(M(e, t[n]))},${o(e.lower[t[n]])}`;
611
611
  l += "Z";
612
612
  }
613
613
  return l;
614
614
  }
615
- function R(e, t) {
616
- let n = t === "start" ? e.startIndex : e.endIndex, r = e.seriesIndex != null && O.value[e.seriesIndex] || O.value[0];
617
- return F(r ? M(r, n) : n);
615
+ function L(e, t) {
616
+ let n = t === "start" ? e.startIndex : e.endIndex, r = e.seriesIndex != null && D.value[e.seriesIndex] || D.value[0];
617
+ return P(r ? j(r, n) : n);
618
618
  }
619
- function z(e, t = !0) {
619
+ function R(e, t = !0) {
620
620
  let n = S.value.top + w.value;
621
621
  if (e.seriesIndex == null) {
622
- let t = R(e, "start"), r = R(e, "end");
622
+ let t = L(e, "start"), r = L(e, "end");
623
623
  return t > r ? "" : `M${t},${S.value.top}L${r},${S.value.top}L${r},${n}L${t},${n}Z`;
624
624
  }
625
- let r = O.value[e.seriesIndex];
625
+ let r = D.value[e.seriesIndex];
626
626
  if (!r) return "";
627
- let { min: i, range: a } = I.value, o = w.value / a, s = (e) => n - (e - i) * o, c = Math.max(0, e.startIndex), l = Math.min(r.data.length - 1, e.endIndex);
627
+ let { min: i, range: a } = F.value, o = w.value / a, s = (e) => n - (e - i) * o, c = Math.max(0, e.startIndex), l = Math.min(r.data.length - 1, e.endIndex);
628
628
  if (c > l) return "";
629
- let u = `M${F(M(r, c))},${s(r.data[c])}`;
630
- for (let e = c + 1; e <= l; e++) isFinite(r.data[e]) && (u += `L${F(M(r, e))},${s(r.data[e])}`);
631
- return t && (u += `L${F(M(r, l))},${n}`, u += `L${F(M(r, c))},${n}`, u += "Z"), u;
629
+ let u = `M${P(j(r, c))},${s(r.data[c])}`;
630
+ for (let e = c + 1; e <= l; e++) isFinite(r.data[e]) && (u += `L${P(j(r, e))},${s(r.data[e])}`);
631
+ return t && (u += `L${P(j(r, l))},${n}`, u += `L${P(j(r, c))},${n}`, u += "Z"), u;
632
632
  }
633
- let B = n(() => {
633
+ let z = n(() => {
634
634
  let e = l.areaSections;
635
635
  if (!e?.length) return {
636
636
  labels: [],
@@ -639,7 +639,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
639
639
  let t = [], n = S.value.left + C.value;
640
640
  for (let r of e) {
641
641
  if (!r.label && !r.description || r.legend === "inline" || r.legend === !1) continue;
642
- let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) * Ze, o = R(r, "start") + a / 2 + 2, s = n - a / 2 - 8, c = Math.min(o, s), l = r.color ?? (r.seriesIndex == null ? "#999" : O.value[r.seriesIndex]?.color ?? "currentColor");
642
+ let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) * Qe, o = L(r, "start") + a / 2 + 2, s = n - a / 2 - 8, c = Math.min(o, s), l = r.color ?? (r.seriesIndex == null ? "#999" : D.value[r.seriesIndex]?.color ?? "currentColor");
643
643
  t.push({
644
644
  cx: c,
645
645
  labelText: e,
@@ -654,7 +654,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
654
654
  let r = [];
655
655
  for (let e of t) {
656
656
  let t = e.cx - e.textWidth / 2, n = 0;
657
- for (; n < r.length && !(t >= r[n] + Qe);) n++;
657
+ for (; n < r.length && !(t >= r[n] + $e);) n++;
658
658
  e.row = n;
659
659
  let i = e.cx + e.textWidth / 2;
660
660
  r[n] = Math.max(r[n] ?? -Infinity, i);
@@ -664,11 +664,11 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
664
664
  extraHeight: 0
665
665
  } : {
666
666
  labels: t,
667
- extraHeight: (Math.max(...t.map((e) => e.row)) + 1) * Ye + Xe
667
+ extraHeight: (Math.max(...t.map((e) => e.row)) + 1) * Xe + Ze
668
668
  };
669
- }), V = n(() => {
669
+ }), B = n(() => {
670
670
  let e = [];
671
- for (let t of O.value) t.legend && e.push({
671
+ for (let t of D.value) t.legend && e.push({
672
672
  label: t.legend,
673
673
  color: t.color ?? "currentColor",
674
674
  type: "series",
@@ -677,7 +677,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
677
677
  let t = l.areaSections;
678
678
  if (t) for (let n of t) {
679
679
  if (n.legend !== "inline" || !n.label && !n.description) continue;
680
- let t = [n.label, n.description].filter(Boolean).join(" "), r = n.color ?? (n.seriesIndex == null ? "#999" : O.value[n.seriesIndex]?.color ?? "currentColor");
680
+ let t = [n.label, n.description].filter(Boolean).join(" "), r = n.color ?? (n.seriesIndex == null ? "#999" : D.value[n.seriesIndex]?.color ?? "currentColor");
681
681
  e.push({
682
682
  label: t,
683
683
  color: r,
@@ -686,12 +686,12 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
686
686
  });
687
687
  }
688
688
  return e;
689
- }), H = n(() => b.value + B.value.extraHeight), W = n(() => S.value.top + w.value + S.value.bottom + Xe), G = n(() => {
690
- let { min: e, max: t } = I.value, n = (t) => U(S.value.top + w.value - (t - e) / I.value.range * w.value), r = (e) => l.yTickFormat ? l.yTickFormat(e) : K(e);
689
+ }), V = n(() => b.value + z.value.extraHeight), U = n(() => S.value.top + w.value + S.value.bottom + Ze), W = n(() => {
690
+ let { min: e, max: t } = F.value, n = (t) => H(S.value.top + w.value - (t - e) / F.value.range * w.value), r = (e) => l.yTickFormat ? l.yTickFormat(e) : K(e);
691
691
  return e === t ? [{
692
692
  value: r(e),
693
- y: U(S.value.top + w.value / 2)
694
- }] : le({
693
+ y: H(S.value.top + w.value / 2)
694
+ }] : q({
695
695
  min: e,
696
696
  max: t,
697
697
  ticks: l.yTicks,
@@ -700,18 +700,18 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
700
700
  value: r(e),
701
701
  y: n(e)
702
702
  }));
703
- }), ce = n(() => {
704
- let { min: e, max: t } = ie.value;
703
+ }), G = n(() => {
704
+ let { min: e, max: t } = ae.value;
705
705
  if (e === t) return [];
706
- let n = P.value, r = A.value, i = (e, t) => {
706
+ let n = N.value, r = k.value, i = (e, t) => {
707
707
  let r = e + n;
708
- return l.xTickFormat ? l.xTickFormat(r, t) : !j.value && l.xLabels && Number.isInteger(e) && e >= 0 && e < l.xLabels.length ? l.xLabels[e] : K(r);
708
+ return l.xTickFormat ? l.xTickFormat(r, t) : !A.value && l.xLabels && Number.isInteger(e) && e >= 0 && e < l.xLabels.length ? l.xLabels[e] : K(r);
709
709
  }, a;
710
- if (l.xTicks == null && !j.value && l.xLabels && l.xLabels.length === r) {
710
+ if (l.xTicks == null && !A.value && l.xLabels && l.xLabels.length === r) {
711
711
  let e = Math.max(3, Math.floor(C.value / 80)), t = Math.max(1, Math.round((r - 1) / e));
712
712
  a = [];
713
713
  for (let e = 0; e < r; e += t) a.push(e);
714
- } else a = le({
714
+ } else a = q({
715
715
  min: e,
716
716
  max: t,
717
717
  ticks: l.xTicks,
@@ -720,7 +720,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
720
720
  });
721
721
  let o = S.value.left, s = S.value.left + C.value;
722
722
  return a.map((e, t) => {
723
- let n = U(F(e)), r = "middle";
723
+ let n = H(P(e)), r = "middle";
724
724
  return n - o <= 1 ? r = "start" : s - n <= 1 && (r = "end"), {
725
725
  value: i(e, t),
726
726
  x: n,
@@ -728,49 +728,49 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
728
728
  };
729
729
  });
730
730
  });
731
- function q() {
732
- return typeof l.csv == "function" ? l.csv() : typeof l.csv == "string" ? l.csv : ge(O.value);
731
+ function J() {
732
+ return typeof l.csv == "function" ? l.csv() : typeof l.csv == "string" ? l.csv : he(D.value);
733
733
  }
734
- let J = n(() => !!l.tooltipData || !!l.tooltipTrigger), Y = n(() => {
735
- let e = Q.value, t = O.value[0];
736
- return e === null || !t ? null : M(t, e);
737
- }), pe = n(() => Y.value === null ? 0 : F(Y.value));
738
- function X(e, t) {
734
+ let Y = n(() => !!l.tooltipData || !!l.tooltipTrigger), X = n(() => {
735
+ let e = _e.value, t = D.value[0];
736
+ return e === null || !t ? null : j(t, e);
737
+ }), fe = n(() => X.value === null ? 0 : P(X.value));
738
+ function Z(e, t) {
739
739
  let n = e.data.length;
740
740
  if (n === 0) return null;
741
741
  let r = 0, i = Infinity;
742
742
  for (let a = 0; a < n; a++) {
743
- let n = M(e, a);
743
+ let n = j(e, a);
744
744
  if (!isFinite(n)) continue;
745
745
  let o = Math.abs(n - t);
746
746
  o < i && (i = o, r = a);
747
747
  }
748
748
  return i === Infinity ? null : r;
749
749
  }
750
- let me = n(() => {
751
- let e = Y.value;
750
+ let pe = n(() => {
751
+ let e = X.value;
752
752
  if (e === null) return [];
753
- let { min: t, range: n } = I.value, r = w.value / n, i = S.value.top + w.value, a = [];
754
- for (let n of O.value) {
755
- let o = X(n, e);
753
+ let { min: t, range: n } = F.value, r = w.value / n, i = S.value.top + w.value, a = [];
754
+ for (let n of D.value) {
755
+ let o = Z(n, e);
756
756
  if (o === null) continue;
757
757
  let s = n.data[o];
758
758
  isFinite(s) && a.push({
759
- x: F(M(n, o)),
759
+ x: P(j(n, o)),
760
760
  y: i - (s - t) * r,
761
761
  color: n.color ?? "currentColor"
762
762
  });
763
763
  }
764
764
  return a;
765
- }), Z = n(() => {
766
- let e = Q.value, t = Y.value;
765
+ }), Q = n(() => {
766
+ let e = _e.value, t = X.value;
767
767
  if (e === null || t === null) return null;
768
- let n = t + P.value, r;
769
- return r = l.xTickFormat ? l.xTickFormat(n, e) : j.value ? K(n) : l.xLabels?.[e], {
768
+ let n = t + N.value, r;
769
+ return r = l.xTickFormat ? l.xTickFormat(n, e) : A.value ? K(n) : l.xLabels?.[e], {
770
770
  index: e,
771
771
  xLabel: r,
772
- values: O.value.map((e, n) => {
773
- let r = X(e, t);
772
+ values: D.value.map((e, n) => {
773
+ let r = Z(e, t);
774
774
  return {
775
775
  value: r === null ? NaN : Number(e.data[r]),
776
776
  color: e.color ?? "currentColor",
@@ -780,25 +780,25 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
780
780
  data: l.tooltipData?.[e] ?? null
781
781
  };
782
782
  });
783
- function _e(e) {
783
+ function ge(e) {
784
784
  let t = h.value?.getBoundingClientRect();
785
785
  if (!t) return null;
786
- let n = O.value[0];
786
+ let n = D.value[0];
787
787
  if (!n || n.data.length === 0) return null;
788
- let { min: r, max: i } = ie.value, a = i - r || 1;
789
- return X(n, r + (e - t.left - S.value.left) / C.value * a);
788
+ let { min: r, max: i } = ae.value, a = i - r || 1;
789
+ return Z(n, r + (e - t.left - S.value.left) / C.value * a);
790
790
  }
791
- let { hoverIndex: Q, tooltipRef: $e, tooltipPos: et, handlers: tt } = fe({
792
- enabled: () => J.value,
791
+ let { hoverIndex: _e, tooltipRef: et, tooltipPos: $, handlers: tt } = de({
792
+ enabled: () => Y.value,
793
793
  trigger: () => l.tooltipTrigger,
794
794
  clamp: () => l.tooltipClamp,
795
- pointerToIndex: _e,
795
+ pointerToIndex: ge,
796
796
  containerRef: h,
797
797
  onHover: (e) => f("hover", e)
798
- }), { svgRef: nt, items: rt, downloadLinkText: it, csvHref: at, resolvedFilename: ot } = he({
798
+ }), { svgRef: nt, items: rt, downloadLinkText: it, csvHref: at, resolvedFilename: ot } = me({
799
799
  filename: () => l.filename,
800
800
  legacyMenuLabel: () => l.menu,
801
- getCsv: q,
801
+ getCsv: J,
802
802
  downloadLink: () => l.downloadLink
803
803
  });
804
804
  return (n, c) => (g(), a("div", {
@@ -806,7 +806,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
806
806
  ref: h,
807
807
  class: "line-chart-wrapper"
808
808
  }, [
809
- t.menu ? (g(), r(se, {
809
+ t.menu ? (g(), r(ce, {
810
810
  key: 0,
811
811
  items: x(rt)
812
812
  }, null, 8, ["items"])) : i("", !0),
@@ -814,7 +814,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
814
814
  ref_key: "svgRef",
815
815
  ref: nt,
816
816
  width: _.value,
817
- height: H.value
817
+ height: V.value
818
818
  }, [
819
819
  t.title ? (g(), a("text", {
820
820
  key: 0,
@@ -825,7 +825,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
825
825
  "font-weight": "600",
826
826
  fill: "currentColor"
827
827
  }, y(t.title), 9, ye)) : i("", !0),
828
- V.value.length > 0 ? (g(), a("g", be, [(g(!0), a(e, null, v(V.value, (t, n) => (g(), a(e, { key: "ileg" + n }, [t.type === "series" ? (g(), a("line", {
828
+ B.value.length > 0 ? (g(), a("g", be, [(g(!0), a(e, null, v(B.value, (t, n) => (g(), a(e, { key: "ileg" + n }, [t.type === "series" ? (g(), a("line", {
829
829
  key: 0,
830
830
  x1: x(S).left + n * 120,
831
831
  y1: x(S).top - x(20) / 2,
@@ -843,29 +843,29 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
843
843
  "fill-opacity": t.fillOpacity,
844
844
  stroke: t.color,
845
845
  "stroke-width": "1.5"
846
- }, null, 8, $)), o("text", {
846
+ }, null, 8, Se)), o("text", {
847
847
  x: x(S).left + n * 120 + 18,
848
848
  y: x(S).top - x(20) / 2 + 4,
849
849
  "font-size": "11",
850
850
  fill: "currentColor"
851
- }, y(t.label), 9, Se)], 64))), 128))])) : i("", !0),
851
+ }, y(t.label), 9, Ce)], 64))), 128))])) : i("", !0),
852
852
  o("line", {
853
- x1: x(U)(x(S).left),
854
- y1: x(U)(x(S).top),
855
- x2: x(U)(x(S).left),
856
- y2: x(U)(x(S).top + x(w)),
853
+ x1: x(H)(x(S).left),
854
+ y1: x(H)(x(S).top),
855
+ x2: x(H)(x(S).left),
856
+ y2: x(H)(x(S).top + x(w)),
857
857
  stroke: "currentColor",
858
858
  "stroke-opacity": "0.3"
859
- }, null, 8, Ce),
859
+ }, null, 8, we),
860
860
  o("line", {
861
- x1: x(U)(x(S).left),
862
- y1: x(U)(x(S).top + x(w)),
863
- x2: x(U)(x(S).left + x(C)),
864
- y2: x(U)(x(S).top + x(w)),
861
+ x1: x(H)(x(S).left),
862
+ y1: x(H)(x(S).top + x(w)),
863
+ x2: x(H)(x(S).left + x(C)),
864
+ y2: x(H)(x(S).top + x(w)),
865
865
  stroke: "currentColor",
866
866
  "stroke-opacity": "0.3"
867
- }, null, 8, we),
868
- t.yGrid ? (g(!0), a(e, { key: 2 }, v(G.value, (e, t) => (g(), a("line", {
867
+ }, null, 8, Te),
868
+ t.yGrid ? (g(!0), a(e, { key: 2 }, v(W.value, (e, t) => (g(), a("line", {
869
869
  key: "yg" + t,
870
870
  x1: x(S).left,
871
871
  y1: e.y,
@@ -873,8 +873,8 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
873
873
  y2: e.y,
874
874
  stroke: "currentColor",
875
875
  "stroke-opacity": "0.1"
876
- }, null, 8, Te))), 128)) : i("", !0),
877
- t.xGrid ? (g(!0), a(e, { key: 3 }, v(ce.value, (e, t) => (g(), a("line", {
876
+ }, null, 8, Ee))), 128)) : i("", !0),
877
+ t.xGrid ? (g(!0), a(e, { key: 3 }, v(G.value, (e, t) => (g(), a("line", {
878
878
  key: "xg" + t,
879
879
  x1: e.x,
880
880
  y1: x(S).top,
@@ -882,8 +882,8 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
882
882
  y2: x(S).top + x(w),
883
883
  stroke: "currentColor",
884
884
  "stroke-opacity": "0.1"
885
- }, null, 8, Ee))), 128)) : i("", !0),
886
- (g(!0), a(e, null, v(G.value, (e, t) => (g(), a("text", {
885
+ }, null, 8, De))), 128)) : i("", !0),
886
+ (g(!0), a(e, null, v(W.value, (e, t) => (g(), a("text", {
887
887
  key: "y" + t,
888
888
  "data-testid": "y-tick",
889
889
  x: x(S).left - 6,
@@ -893,7 +893,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
893
893
  "font-size": "10",
894
894
  fill: "currentColor",
895
895
  "fill-opacity": "0.6"
896
- }, y(e.value), 9, De))), 128)),
896
+ }, y(e.value), 9, Oe))), 128)),
897
897
  t.yLabel ? (g(), a("text", {
898
898
  key: 4,
899
899
  x: 0,
@@ -902,8 +902,8 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
902
902
  "text-anchor": "middle",
903
903
  "font-size": "13",
904
904
  fill: "currentColor"
905
- }, y(t.yLabel), 9, Oe)) : i("", !0),
906
- (g(!0), a(e, null, v(ce.value, (e, t) => (g(), a("text", {
905
+ }, y(t.yLabel), 9, ke)) : i("", !0),
906
+ (g(!0), a(e, null, v(G.value, (e, t) => (g(), a("text", {
907
907
  key: "x" + t,
908
908
  "data-testid": "x-tick",
909
909
  x: e.x,
@@ -912,7 +912,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
912
912
  "font-size": "10",
913
913
  fill: "currentColor",
914
914
  "fill-opacity": "0.6"
915
- }, y(e.value), 9, ke))), 128)),
915
+ }, y(e.value), 9, Ae))), 128)),
916
916
  t.xLabel ? (g(), a("text", {
917
917
  key: 5,
918
918
  x: x(S).left + x(C) / 2,
@@ -920,23 +920,23 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
920
920
  "text-anchor": "middle",
921
921
  "font-size": "13",
922
922
  fill: "currentColor"
923
- }, y(t.xLabel), 9, Ae)) : i("", !0),
924
- (g(!0), a(e, null, v(k.value, (e, t) => (g(), a("path", {
923
+ }, y(t.xLabel), 9, je)) : i("", !0),
924
+ (g(!0), a(e, null, v(O.value, (e, t) => (g(), a("path", {
925
925
  key: "area" + t,
926
- d: oe(e),
926
+ d: se(e),
927
927
  fill: e.color ?? "currentColor",
928
928
  "fill-opacity": e.opacity ?? .2,
929
929
  stroke: "none"
930
- }, null, 8, je))), 128)),
931
- (g(!0), a(e, null, v(O.value, (n, r) => (g(), a(e, { key: r }, [n.line === !1 ? i("", !0) : (g(), a("path", {
930
+ }, null, 8, Me))), 128)),
931
+ (g(!0), a(e, null, v(D.value, (n, r) => (g(), a(e, { key: r }, [n.line === !1 ? i("", !0) : (g(), a("path", {
932
932
  key: 0,
933
- d: ae(n),
933
+ d: oe(n),
934
934
  fill: "none",
935
935
  stroke: n.color ?? "currentColor",
936
936
  "stroke-width": n.strokeWidth ?? 1.5,
937
937
  "stroke-opacity": n.lineOpacity ?? n.opacity ?? t.lineOpacity,
938
938
  "stroke-dasharray": n.dashed ? "6 3" : void 0
939
- }, null, 8, Me)), n.dots ? (g(!0), a(e, { key: 1 }, v(L(n), (e, r) => (g(), a("circle", {
939
+ }, null, 8, Ne)), n.dots ? (g(!0), a(e, { key: 1 }, v(I(n), (e, r) => (g(), a("circle", {
940
940
  key: r,
941
941
  cx: e.x,
942
942
  cy: e.y,
@@ -944,68 +944,68 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
944
944
  fill: n.dotFill ?? n.color ?? "currentColor",
945
945
  "fill-opacity": n.dotOpacity ?? n.opacity ?? t.lineOpacity,
946
946
  stroke: n.dotStroke ?? "none"
947
- }, null, 8, Ne))), 128)) : i("", !0)], 64))), 128)),
947
+ }, null, 8, Pe))), 128)) : i("", !0)], 64))), 128)),
948
948
  (g(!0), a(e, null, v(t.areaSections ?? [], (t, n) => (g(), a(e, { key: "areasec" + n }, [
949
949
  o("path", {
950
- d: z(t),
951
- fill: t.color ?? (t.seriesIndex == null ? "#999" : O.value[t.seriesIndex]?.color ?? "currentColor"),
950
+ d: R(t),
951
+ fill: t.color ?? (t.seriesIndex == null ? "#999" : D.value[t.seriesIndex]?.color ?? "currentColor"),
952
952
  "fill-opacity": t.opacity ?? .15,
953
953
  stroke: "none"
954
- }, null, 8, Pe),
954
+ }, null, 8, Fe),
955
955
  t.seriesIndex == null ? i("", !0) : (g(), a("path", {
956
956
  key: 0,
957
- d: z(t, !1),
957
+ d: R(t, !1),
958
958
  fill: "none",
959
- stroke: t.color ?? O.value[t.seriesIndex]?.color ?? "currentColor",
959
+ stroke: t.color ?? D.value[t.seriesIndex]?.color ?? "currentColor",
960
960
  "stroke-width": t.strokeWidth ?? 2,
961
961
  "stroke-dasharray": t.dashed ? "6 3" : void 0
962
- }, null, 8, Fe)),
962
+ }, null, 8, Ie)),
963
963
  t.seriesIndex == null ? (g(), a(e, { key: 1 }, [o("line", {
964
- x1: x(U)(R(t, "start")),
964
+ x1: x(H)(L(t, "start")),
965
965
  y1: x(S).top,
966
- x2: x(U)(R(t, "start")),
966
+ x2: x(H)(L(t, "start")),
967
967
  y2: x(S).top + x(w),
968
968
  stroke: t.color ?? "#999",
969
969
  "stroke-width": t.strokeWidth ?? 2,
970
970
  "stroke-dasharray": t.dashed ? "6 3" : void 0
971
- }, null, 8, Ie), o("line", {
972
- x1: x(U)(R(t, "end")),
971
+ }, null, 8, Le), o("line", {
972
+ x1: x(H)(L(t, "end")),
973
973
  y1: x(S).top,
974
- x2: x(U)(R(t, "end")),
974
+ x2: x(H)(L(t, "end")),
975
975
  y2: x(S).top + x(w),
976
976
  stroke: t.color ?? "#999",
977
977
  "stroke-width": t.strokeWidth ?? 2,
978
978
  "stroke-dasharray": t.dashed ? "6 3" : void 0
979
- }, null, 8, Le)], 64)) : i("", !0),
979
+ }, null, 8, Re)], 64)) : i("", !0),
980
980
  o("line", {
981
- x1: x(U)(R(t, "start")),
981
+ x1: x(H)(L(t, "start")),
982
982
  y1: x(S).top + x(w) - 4,
983
- x2: x(U)(R(t, "start")),
983
+ x2: x(H)(L(t, "start")),
984
984
  y2: x(S).top + x(w) + 4,
985
985
  stroke: "currentColor",
986
986
  "stroke-opacity": "0.4"
987
- }, null, 8, Re),
987
+ }, null, 8, ze),
988
988
  o("line", {
989
- x1: x(U)(R(t, "end")),
989
+ x1: x(H)(L(t, "end")),
990
990
  y1: x(S).top + x(w) - 4,
991
- x2: x(U)(R(t, "end")),
991
+ x2: x(H)(L(t, "end")),
992
992
  y2: x(S).top + x(w) + 4,
993
993
  stroke: "currentColor",
994
994
  "stroke-opacity": "0.4"
995
- }, null, 8, ze)
995
+ }, null, 8, Be)
996
996
  ], 64))), 128)),
997
- J.value && x(Q) !== null ? (g(), a("line", {
997
+ Y.value && x(_e) !== null ? (g(), a("line", {
998
998
  key: 6,
999
- x1: x(U)(pe.value),
999
+ x1: x(H)(fe.value),
1000
1000
  y1: x(S).top,
1001
- x2: x(U)(pe.value),
1001
+ x2: x(H)(fe.value),
1002
1002
  y2: x(S).top + x(w),
1003
1003
  stroke: "currentColor",
1004
1004
  "stroke-opacity": "0.3",
1005
1005
  "stroke-dasharray": "4 2",
1006
1006
  "pointer-events": "none"
1007
- }, null, 8, Be)) : i("", !0),
1008
- (g(!0), a(e, null, v(me.value, (e, t) => (g(), a("circle", {
1007
+ }, null, 8, Ve)) : i("", !0),
1008
+ (g(!0), a(e, null, v(pe.value, (e, t) => (g(), a("circle", {
1009
1009
  key: "hd" + t,
1010
1010
  cx: e.x,
1011
1011
  cy: e.y,
@@ -1014,8 +1014,8 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
1014
1014
  stroke: "var(--color-bg-0, #fff)",
1015
1015
  "stroke-width": "2",
1016
1016
  "pointer-events": "none"
1017
- }, null, 8, Ve))), 128)),
1018
- J.value ? (g(), a("rect", d({
1017
+ }, null, 8, He))), 128)),
1018
+ Y.value ? (g(), a("rect", d({
1019
1019
  key: 7,
1020
1020
  x: x(S).left,
1021
1021
  y: x(S).top,
@@ -1026,64 +1026,64 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
1026
1026
  cursor: "crosshair",
1027
1027
  "touch-action": "none"
1028
1028
  }
1029
- }, ne(x(tt), !0)), null, 16, He)) : i("", !0),
1030
- (g(!0), a(e, null, v(B.value.labels, (e, t) => (g(), a("g", { key: "seclab" + t }, [
1029
+ }, ne(x(tt), !0)), null, 16, Ue)) : i("", !0),
1030
+ (g(!0), a(e, null, v(z.value.labels, (e, t) => (g(), a("g", { key: "seclab" + t }, [
1031
1031
  o("circle", {
1032
1032
  cx: e.cx - e.textWidth / 2 - 2,
1033
- cy: W.value + e.row * Ye + 4,
1033
+ cy: U.value + e.row * Xe + 4,
1034
1034
  r: "4",
1035
1035
  fill: e.color,
1036
1036
  "fill-opacity": e.fillOpacity,
1037
1037
  stroke: e.color,
1038
1038
  "stroke-width": "1.5"
1039
- }, null, 8, Ue),
1039
+ }, null, 8, We),
1040
1040
  e.labelText ? (g(), a("text", {
1041
1041
  key: 0,
1042
1042
  x: e.cx - e.textWidth / 2 + 8,
1043
- y: W.value + e.row * Ye + 8,
1043
+ y: U.value + e.row * Xe + 8,
1044
1044
  "font-size": "11",
1045
1045
  "font-weight": "600",
1046
1046
  fill: e.color
1047
- }, y(e.labelText), 9, We)) : i("", !0),
1047
+ }, y(e.labelText), 9, Ge)) : i("", !0),
1048
1048
  e.descText ? (g(), a("text", {
1049
1049
  key: 1,
1050
1050
  x: e.cx - e.textWidth / 2 + 8,
1051
- y: W.value + e.row * Ye + 22,
1051
+ y: U.value + e.row * Xe + 22,
1052
1052
  "font-size": "11",
1053
1053
  fill: "currentColor",
1054
1054
  "fill-opacity": "0.6"
1055
- }, y(e.descText), 9, Ge)) : i("", !0)
1055
+ }, y(e.descText), 9, Ke)) : i("", !0)
1056
1056
  ]))), 128))
1057
1057
  ], 8, ve)),
1058
- J.value && x(Q) !== null && Z.value ? (g(), a("div", {
1058
+ Y.value && x(_e) !== null && Q.value ? (g(), a("div", {
1059
1059
  key: 1,
1060
1060
  ref_key: "tooltipRef",
1061
- ref: $e,
1061
+ ref: et,
1062
1062
  class: "chart-tooltip-content",
1063
1063
  style: m({
1064
1064
  position: "absolute",
1065
1065
  top: "0",
1066
1066
  left: "0",
1067
1067
  willChange: "transform",
1068
- transform: x(et) ? `translate3d(${x(et).left}px, ${x(et).top}px, 0) translateY(-50%)` : "translateY(-50%)",
1069
- visibility: x(et) ? "visible" : "hidden"
1068
+ transform: x($) ? `translate3d(${x($).left}px, ${x($).top}px, 0) translateY(-50%)` : "translateY(-50%)",
1069
+ visibility: x($) ? "visible" : "hidden"
1070
1070
  })
1071
- }, [te(n.$slots, "tooltip", p(u(Z.value)), () => [o("div", Ke, [Z.value.xLabel ? (g(), a("div", qe, y(Z.value.xLabel), 1)) : i("", !0), (g(!0), a(e, null, v(Z.value.values, (e) => (g(), a("div", {
1071
+ }, [te(n.$slots, "tooltip", p(u(Q.value)), () => [o("div", qe, [Q.value.xLabel ? (g(), a("div", Je, y(Q.value.xLabel), 1)) : i("", !0), (g(!0), a(e, null, v(Q.value.values, (e) => (g(), a("div", {
1072
1072
  key: e.seriesIndex,
1073
1073
  class: "line-chart-tooltip-row"
1074
1074
  }, [o("span", {
1075
1075
  class: "line-chart-tooltip-swatch",
1076
1076
  style: m({ background: e.color })
1077
- }, null, 4), s(" " + y(isFinite(e.value) ? D(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
1077
+ }, null, 4), s(" " + y(isFinite(e.value) ? E(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
1078
1078
  x(it) ? (g(), a("a", {
1079
1079
  key: 2,
1080
1080
  class: "line-chart-download-link",
1081
1081
  href: x(at),
1082
1082
  download: `${x(ot)()}.csv`
1083
- }, y(x(it)), 9, Je)) : i("", !0)
1083
+ }, y(x(it)), 9, Ye)) : i("", !0)
1084
1084
  ], 512));
1085
1085
  }
1086
- }), [["__scopeId", "data-v-083d1c2f"]]), et = ["width", "height"], tt = ["x"], nt = { key: 1 }, rt = [
1086
+ }), [["__scopeId", "data-v-083d1c2f"]]), $ = ["width", "height"], tt = ["x"], nt = { key: 1 }, rt = [
1087
1087
  "x",
1088
1088
  "y",
1089
1089
  "fill"
@@ -1128,7 +1128,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
1128
1128
  ], _t = { class: "bar-chart-tooltip" }, vt = {
1129
1129
  key: 0,
1130
1130
  class: "bar-chart-tooltip-label"
1131
- }, yt = ["href", "download"], bt = /* @__PURE__ */ H(/* @__PURE__ */ l({
1131
+ }, yt = ["href", "download"], bt = /* @__PURE__ */ V(/* @__PURE__ */ l({
1132
1132
  __name: "BarChart",
1133
1133
  props: {
1134
1134
  data: {},
@@ -1167,7 +1167,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
1167
1167
  },
1168
1168
  emits: ["hover"],
1169
1169
  setup(t, { emit: c }) {
1170
- let l = t, f = c, { containerRef: h, measuredWidth: ee } = ue({ debounce: () => l.debounce }), _ = n(() => l.width ?? (ee.value || 400)), b = n(() => l.height ?? 200), re = n(() => D.value.some((e) => e.legend)), { padding: S, innerW: C, innerH: w } = de({
1170
+ let l = t, f = c, { containerRef: h, measuredWidth: ee } = le({ debounce: () => l.debounce }), _ = n(() => l.width ?? (ee.value || 400)), b = n(() => l.height ?? 200), re = n(() => E.value.some((e) => e.legend)), { padding: S, innerW: C, innerH: w } = ue({
1171
1171
  title: () => l.title,
1172
1172
  xLabel: () => l.xLabel,
1173
1173
  yLabel: () => l.yLabel,
@@ -1175,7 +1175,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
1175
1175
  width: () => _.value,
1176
1176
  height: () => b.value
1177
1177
  }), T = [];
1178
- function E(e) {
1178
+ function ie(e) {
1179
1179
  return {
1180
1180
  data: e.y ?? e.data ?? T,
1181
1181
  color: e.color,
@@ -1183,32 +1183,32 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
1183
1183
  legend: e.legend
1184
1184
  };
1185
1185
  }
1186
- let D = n(() => {
1187
- if (l.series && l.series.length > 0) return l.series.map(E);
1186
+ let E = n(() => {
1187
+ if (l.series && l.series.length > 0) return l.series.map(ie);
1188
1188
  let e = l.y ?? l.data;
1189
1189
  return e ? [{ data: e }] : [];
1190
- }), O = n(() => {
1190
+ }), D = n(() => {
1191
1191
  let e = l.categories?.length ?? 0;
1192
- for (let t of D.value) t.data.length > e && (e = t.data.length);
1192
+ for (let t of E.value) t.data.length > e && (e = t.data.length);
1193
1193
  return e;
1194
- }), k = n(() => {
1195
- let e = O.value, t = Array(e);
1194
+ }), O = n(() => {
1195
+ let e = D.value, t = Array(e);
1196
1196
  for (let n = 0; n < e; n++) t[n] = l.categories?.[n] ?? String(n);
1197
1197
  return t;
1198
- }), A = n(() => l.orientation === "vertical"), j = n(() => {
1198
+ }), k = n(() => l.orientation === "vertical"), A = n(() => {
1199
1199
  let e = Infinity, t = -Infinity;
1200
1200
  if (l.layout === "stacked") {
1201
- let n = O.value;
1201
+ let n = D.value;
1202
1202
  for (let r = 0; r < n; r++) {
1203
1203
  let n = 0, i = 0;
1204
- for (let e of D.value) {
1204
+ for (let e of E.value) {
1205
1205
  if (r >= e.data.length) continue;
1206
1206
  let t = Number(e.data[r]);
1207
1207
  isFinite(t) && (t >= 0 ? n += t : i += t);
1208
1208
  }
1209
1209
  n > t && (t = n), i < e && (e = i);
1210
1210
  }
1211
- } else for (let n of D.value) for (let r of n.data) {
1211
+ } else for (let n of E.value) for (let r of n.data) {
1212
1212
  let n = Number(r);
1213
1213
  isFinite(n) && (n < e && (e = n), n > t && (t = n));
1214
1214
  }
@@ -1221,30 +1221,30 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
1221
1221
  max: t,
1222
1222
  range: r
1223
1223
  };
1224
- }), M = n(() => A.value ? C.value : w.value), N = n(() => A.value ? w.value : C.value), P = n(() => {
1225
- let e = O.value;
1226
- return e > 0 ? M.value / e : 0;
1227
- }), ie = n(() => P.value * (1 - l.barPadding)), F = n(() => {
1228
- let e = D.value.length;
1224
+ }), j = n(() => k.value ? C.value : w.value), M = n(() => k.value ? w.value : C.value), N = n(() => {
1225
+ let e = D.value;
1226
+ return e > 0 ? j.value / e : 0;
1227
+ }), ae = n(() => N.value * (1 - l.barPadding)), P = n(() => {
1228
+ let e = E.value.length;
1229
1229
  if (e === 0) return 0;
1230
- if (l.layout === "stacked" || e === 1) return ie.value;
1230
+ if (l.layout === "stacked" || e === 1) return ae.value;
1231
1231
  let t = l.groupGap * (e - 1);
1232
- return Math.max(1, (ie.value - t) / e);
1232
+ return Math.max(1, (ae.value - t) / e);
1233
1233
  });
1234
- function I(e) {
1235
- return (A.value ? S.value.left : S.value.top) + e * P.value;
1234
+ function F(e) {
1235
+ return (k.value ? S.value.left : S.value.top) + e * N.value;
1236
1236
  }
1237
- let ae = n(() => {
1238
- let { min: e, max: t } = j.value, n = l.valueMin ?? 0;
1239
- return L(Math.max(e, Math.min(t, n)));
1237
+ let oe = n(() => {
1238
+ let { min: e, max: t } = A.value, n = l.valueMin ?? 0;
1239
+ return I(Math.max(e, Math.min(t, n)));
1240
1240
  });
1241
- function L(e) {
1242
- let { min: t, range: n } = j.value, r = N.value / n;
1243
- return A.value ? S.value.top + w.value - (e - t) * r : S.value.left + (e - t) * r;
1241
+ function I(e) {
1242
+ let { min: t, range: n } = A.value, r = M.value / n;
1243
+ return k.value ? S.value.top + w.value - (e - t) * r : S.value.left + (e - t) * r;
1244
1244
  }
1245
- function oe(e, t, n, r, i, a, o, s, c) {
1245
+ function se(e, t, n, r, i, a, o, s, c) {
1246
1246
  let l = Math.min(e, t), u = Math.abs(e - t);
1247
- return A.value ? {
1247
+ return k.value ? {
1248
1248
  x: n,
1249
1249
  y: l,
1250
1250
  w: r,
@@ -1266,29 +1266,29 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
1266
1266
  seriesIndex: c
1267
1267
  };
1268
1268
  }
1269
- let R = n(() => {
1270
- let e = [], t = D.value, n = t.length;
1269
+ let L = n(() => {
1270
+ let e = [], t = E.value, n = t.length;
1271
1271
  if (n === 0) return e;
1272
- let r = O.value, i = P.value, a = ie.value, o = F.value, s = (i - a) / 2, c = ae.value;
1272
+ let r = D.value, i = N.value, a = ae.value, o = P.value, s = (i - a) / 2, c = oe.value;
1273
1273
  for (let i = 0; i < r; i++) {
1274
- let r = I(i) + s;
1274
+ let r = F(i) + s;
1275
1275
  if (l.layout === "stacked") {
1276
1276
  let o = 0, s = 0;
1277
1277
  for (let c = 0; c < n; c++) {
1278
1278
  let n = t[c], l = Number(n.data[i] ?? NaN);
1279
1279
  if (!isFinite(l)) continue;
1280
1280
  let u = l >= 0 ? o : s, d = u + l;
1281
- e.push(oe(L(u), L(d), r, a, n.color ?? B(c), n.opacity ?? 1, l, i, c)), l >= 0 ? o = d : s = d;
1281
+ e.push(se(I(u), I(d), r, a, n.color ?? z(c), n.opacity ?? 1, l, i, c)), l >= 0 ? o = d : s = d;
1282
1282
  }
1283
1283
  } else for (let a = 0; a < n; a++) {
1284
1284
  let s = t[a], u = Number(s.data[i] ?? NaN);
1285
1285
  if (!isFinite(u)) continue;
1286
1286
  let d = r + (n === 1 ? 0 : a * (o + l.groupGap));
1287
- e.push(oe(c, L(u), d, o, s.color ?? B(a), s.opacity ?? 1, u, i, a));
1287
+ e.push(se(c, I(u), d, o, s.color ?? z(a), s.opacity ?? 1, u, i, a));
1288
1288
  }
1289
1289
  }
1290
1290
  return e;
1291
- }), z = [
1291
+ }), R = [
1292
1292
  "var(--color-primary, #3b82f6)",
1293
1293
  "var(--color-accent, #f59e0b)",
1294
1294
  "var(--color-success, #10b981)",
@@ -1296,107 +1296,107 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
1296
1296
  "var(--color-info, #6366f1)",
1297
1297
  "var(--color-warning, #d97706)"
1298
1298
  ];
1299
- function B(e) {
1300
- return z[e % z.length];
1299
+ function z(e) {
1300
+ return R[e % R.length];
1301
1301
  }
1302
- function V(e) {
1302
+ function B(e) {
1303
1303
  return l.tooltipValueFormat ? l.tooltipValueFormat(e) : l.valueTickFormat ? l.valueTickFormat(e) : K(e);
1304
1304
  }
1305
- let H = n(() => {
1306
- let { min: e, max: t } = j.value, n = (e) => l.valueTickFormat ? l.valueTickFormat(e) : K(e);
1305
+ let V = n(() => {
1306
+ let { min: e, max: t } = A.value, n = (e) => l.valueTickFormat ? l.valueTickFormat(e) : K(e);
1307
1307
  if (e === t) return [{
1308
1308
  value: n(e),
1309
- pos: U(L(e))
1309
+ pos: H(I(e))
1310
1310
  }];
1311
- let r = A.value ? 50 : 80;
1312
- return le({
1311
+ let r = k.value ? 50 : 80;
1312
+ return q({
1313
1313
  min: e,
1314
1314
  max: t,
1315
1315
  ticks: l.valueTicks,
1316
- targetTickCount: N.value / r
1316
+ targetTickCount: M.value / r
1317
1317
  }).map((e) => ({
1318
1318
  value: n(e),
1319
- pos: U(L(e))
1319
+ pos: H(I(e))
1320
1320
  }));
1321
- }), W = n(() => {
1322
- let e = [], t = O.value, n = (e, t) => l.categoryFormat ? l.categoryFormat(e, t) : e;
1321
+ }), U = n(() => {
1322
+ let e = [], t = D.value, n = (e, t) => l.categoryFormat ? l.categoryFormat(e, t) : e;
1323
1323
  for (let r = 0; r < t; r++) {
1324
- let t = I(r) + P.value / 2;
1324
+ let t = F(r) + N.value / 2;
1325
1325
  e.push({
1326
- label: n(k.value[r], r),
1326
+ label: n(O.value[r], r),
1327
1327
  pos: t,
1328
1328
  anchor: "middle"
1329
1329
  });
1330
1330
  }
1331
1331
  return e;
1332
- }), G = n(() => {
1332
+ }), W = n(() => {
1333
1333
  let e = [];
1334
- return D.value.forEach((t, n) => {
1334
+ return E.value.forEach((t, n) => {
1335
1335
  t.legend && e.push({
1336
1336
  label: t.legend,
1337
- color: t.color ?? B(n)
1337
+ color: t.color ?? z(n)
1338
1338
  });
1339
1339
  }), e;
1340
1340
  });
1341
- function ce() {
1341
+ function G() {
1342
1342
  if (typeof l.csv == "function") return l.csv();
1343
1343
  if (typeof l.csv == "string") return l.csv;
1344
- let e = D.value.map((e) => ({
1344
+ let e = E.value.map((e) => ({
1345
1345
  label: e.legend,
1346
1346
  data: e.data
1347
1347
  }));
1348
- return _e(k.value, e);
1348
+ return ge(O.value, e);
1349
1349
  }
1350
- let q = n(() => !!l.tooltipData || !!l.tooltipTrigger);
1351
- function J(e, t) {
1350
+ let J = n(() => !!l.tooltipData || !!l.tooltipTrigger);
1351
+ function Y(e, t) {
1352
1352
  let n = h.value?.getBoundingClientRect();
1353
1353
  if (!n) return null;
1354
- let r = O.value;
1355
- if (r === 0 || P.value === 0) return null;
1356
- let i = A.value ? e - n.left - S.value.left : t - n.top - S.value.top;
1357
- return Math.max(0, Math.min(r - 1, Math.floor(i / P.value)));
1354
+ let r = D.value;
1355
+ if (r === 0 || N.value === 0) return null;
1356
+ let i = k.value ? e - n.left - S.value.left : t - n.top - S.value.top;
1357
+ return Math.max(0, Math.min(r - 1, Math.floor(i / N.value)));
1358
1358
  }
1359
- let { hoverIndex: Y, tooltipRef: pe, tooltipPos: X, handlers: me } = fe({
1360
- enabled: () => q.value,
1359
+ let { hoverIndex: X, tooltipRef: fe, tooltipPos: Z, handlers: pe } = de({
1360
+ enabled: () => J.value,
1361
1361
  trigger: () => l.tooltipTrigger,
1362
1362
  clamp: () => l.tooltipClamp,
1363
- pointerToIndex: J,
1363
+ pointerToIndex: Y,
1364
1364
  containerRef: h,
1365
1365
  onHover: (e) => f("hover", e)
1366
- }), { svgRef: Z, items: ge, downloadLinkText: Q, csvHref: ve, resolvedFilename: ye } = he({
1366
+ }), { svgRef: Q, items: he, downloadLinkText: _e, csvHref: ve, resolvedFilename: ye } = me({
1367
1367
  filename: () => l.filename,
1368
1368
  legacyMenuLabel: () => l.menu,
1369
- getCsv: ce,
1369
+ getCsv: G,
1370
1370
  downloadLink: () => l.downloadLink
1371
1371
  }), be = n(() => {
1372
- let e = Y.value;
1373
- if (e !== null) return k.value[e];
1372
+ let e = X.value;
1373
+ if (e !== null) return O.value[e];
1374
1374
  }), xe = n(() => {
1375
- let e = Y.value;
1375
+ let e = X.value;
1376
1376
  return e === null ? null : {
1377
1377
  index: e,
1378
- category: k.value[e] ?? String(e),
1379
- values: D.value.map((t, n) => ({
1378
+ category: O.value[e] ?? String(e),
1379
+ values: E.value.map((t, n) => ({
1380
1380
  value: Number(t.data[e] ?? NaN),
1381
- color: t.color ?? B(n),
1381
+ color: t.color ?? z(n),
1382
1382
  seriesIndex: n
1383
1383
  })),
1384
1384
  data: l.tooltipData?.[e] ?? null
1385
1385
  };
1386
- }), $ = n(() => {
1387
- let e = Y.value;
1386
+ }), Se = n(() => {
1387
+ let e = X.value;
1388
1388
  if (e === null) return null;
1389
- let t = I(e);
1390
- return A.value ? {
1389
+ let t = F(e);
1390
+ return k.value ? {
1391
1391
  x: t,
1392
1392
  y: S.value.top,
1393
- w: P.value,
1393
+ w: N.value,
1394
1394
  h: w.value
1395
1395
  } : {
1396
1396
  x: S.value.left,
1397
1397
  y: t,
1398
1398
  w: C.value,
1399
- h: P.value
1399
+ h: N.value
1400
1400
  };
1401
1401
  });
1402
1402
  return (n, c) => (g(), a("div", {
@@ -1404,13 +1404,13 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
1404
1404
  ref: h,
1405
1405
  class: "bar-chart-wrapper"
1406
1406
  }, [
1407
- t.menu ? (g(), r(se, {
1407
+ t.menu ? (g(), r(ce, {
1408
1408
  key: 0,
1409
- items: x(ge)
1409
+ items: x(he)
1410
1410
  }, null, 8, ["items"])) : i("", !0),
1411
1411
  (g(), a("svg", {
1412
1412
  ref_key: "svgRef",
1413
- ref: Z,
1413
+ ref: Q,
1414
1414
  width: _.value,
1415
1415
  height: b.value
1416
1416
  }, [
@@ -1423,7 +1423,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
1423
1423
  "font-weight": "600",
1424
1424
  fill: "currentColor"
1425
1425
  }, y(t.title), 9, tt)) : i("", !0),
1426
- G.value.length > 0 ? (g(), a("g", nt, [(g(!0), a(e, null, v(G.value, (t, n) => (g(), a(e, { key: "ileg" + n }, [o("rect", {
1426
+ W.value.length > 0 ? (g(), a("g", nt, [(g(!0), a(e, null, v(W.value, (t, n) => (g(), a(e, { key: "ileg" + n }, [o("rect", {
1427
1427
  x: x(S).left + n * 120,
1428
1428
  y: x(S).top - x(20) / 2 - 5,
1429
1429
  width: "12",
@@ -1436,41 +1436,41 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
1436
1436
  fill: "currentColor"
1437
1437
  }, y(t.label), 9, it)], 64))), 128))])) : i("", !0),
1438
1438
  o("line", {
1439
- x1: x(U)(x(S).left),
1440
- y1: x(U)(x(S).top),
1441
- x2: x(U)(x(S).left),
1442
- y2: x(U)(x(S).top + x(w)),
1439
+ x1: x(H)(x(S).left),
1440
+ y1: x(H)(x(S).top),
1441
+ x2: x(H)(x(S).left),
1442
+ y2: x(H)(x(S).top + x(w)),
1443
1443
  stroke: "currentColor",
1444
1444
  "stroke-opacity": "0.3"
1445
1445
  }, null, 8, at),
1446
1446
  o("line", {
1447
- x1: x(U)(x(S).left),
1448
- y1: x(U)(x(S).top + x(w)),
1449
- x2: x(U)(x(S).left + x(C)),
1450
- y2: x(U)(x(S).top + x(w)),
1447
+ x1: x(H)(x(S).left),
1448
+ y1: x(H)(x(S).top + x(w)),
1449
+ x2: x(H)(x(S).left + x(C)),
1450
+ y2: x(H)(x(S).top + x(w)),
1451
1451
  stroke: "currentColor",
1452
1452
  "stroke-opacity": "0.3"
1453
1453
  }, null, 8, ot),
1454
- t.valueGrid ? (g(!0), a(e, { key: 2 }, v(H.value, (e, t) => (g(), a("line", {
1454
+ t.valueGrid ? (g(!0), a(e, { key: 2 }, v(V.value, (e, t) => (g(), a("line", {
1455
1455
  key: "vg" + t,
1456
- x1: A.value ? x(S).left : e.pos,
1457
- y1: A.value ? e.pos : x(S).top,
1458
- x2: A.value ? x(S).left + x(C) : e.pos,
1459
- y2: A.value ? e.pos : x(S).top + x(w),
1456
+ x1: k.value ? x(S).left : e.pos,
1457
+ y1: k.value ? e.pos : x(S).top,
1458
+ x2: k.value ? x(S).left + x(C) : e.pos,
1459
+ y2: k.value ? e.pos : x(S).top + x(w),
1460
1460
  stroke: "currentColor",
1461
1461
  "stroke-opacity": "0.1"
1462
1462
  }, null, 8, st))), 128)) : i("", !0),
1463
- $.value && q.value ? (g(), a("rect", {
1463
+ Se.value && J.value ? (g(), a("rect", {
1464
1464
  key: 3,
1465
- x: $.value.x,
1466
- y: $.value.y,
1467
- width: $.value.w,
1468
- height: $.value.h,
1465
+ x: Se.value.x,
1466
+ y: Se.value.y,
1467
+ width: Se.value.w,
1468
+ height: Se.value.h,
1469
1469
  fill: "currentColor",
1470
1470
  "fill-opacity": "0.06",
1471
1471
  "pointer-events": "none"
1472
1472
  }, null, 8, ct)) : i("", !0),
1473
- A.value ? (g(!0), a(e, { key: 4 }, v(H.value, (e, t) => (g(), a("text", {
1473
+ k.value ? (g(!0), a(e, { key: 4 }, v(V.value, (e, t) => (g(), a("text", {
1474
1474
  key: "vt" + t,
1475
1475
  "data-testid": "value-tick",
1476
1476
  x: x(S).left - 6,
@@ -1480,7 +1480,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
1480
1480
  "font-size": "10",
1481
1481
  fill: "currentColor",
1482
1482
  "fill-opacity": "0.6"
1483
- }, y(e.value), 9, lt))), 128)) : (g(!0), a(e, { key: 5 }, v(H.value, (e, t) => (g(), a("text", {
1483
+ }, y(e.value), 9, lt))), 128)) : (g(!0), a(e, { key: 5 }, v(V.value, (e, t) => (g(), a("text", {
1484
1484
  key: "vt" + t,
1485
1485
  "data-testid": "value-tick",
1486
1486
  x: e.pos,
@@ -1499,7 +1499,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
1499
1499
  "font-size": "13",
1500
1500
  fill: "currentColor"
1501
1501
  }, y(t.yLabel), 9, dt)) : i("", !0),
1502
- A.value ? (g(!0), a(e, { key: 7 }, v(W.value, (e, t) => (g(), a("text", {
1502
+ k.value ? (g(!0), a(e, { key: 7 }, v(U.value, (e, t) => (g(), a("text", {
1503
1503
  key: "ct" + t,
1504
1504
  "data-testid": "category-tick",
1505
1505
  x: e.pos,
@@ -1508,7 +1508,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
1508
1508
  "font-size": "10",
1509
1509
  fill: "currentColor",
1510
1510
  "fill-opacity": "0.6"
1511
- }, y(e.label), 9, ft))), 128)) : (g(!0), a(e, { key: 8 }, v(W.value, (e, t) => (g(), a("text", {
1511
+ }, y(e.label), 9, ft))), 128)) : (g(!0), a(e, { key: 8 }, v(U.value, (e, t) => (g(), a("text", {
1512
1512
  key: "ct" + t,
1513
1513
  "data-testid": "category-tick",
1514
1514
  x: x(S).left - 6,
@@ -1527,7 +1527,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
1527
1527
  "font-size": "13",
1528
1528
  fill: "currentColor"
1529
1529
  }, y(t.xLabel), 9, mt)) : i("", !0),
1530
- (g(!0), a(e, null, v(R.value, (e, t) => (g(), a("rect", {
1530
+ (g(!0), a(e, null, v(L.value, (e, t) => (g(), a("rect", {
1531
1531
  key: "bar" + t,
1532
1532
  "data-testid": "bar",
1533
1533
  "data-category": e.categoryIndex,
@@ -1539,7 +1539,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
1539
1539
  fill: e.color,
1540
1540
  "fill-opacity": e.opacity
1541
1541
  }, null, 8, ht))), 128)),
1542
- q.value ? (g(), a("rect", d({
1542
+ J.value ? (g(), a("rect", d({
1543
1543
  key: 10,
1544
1544
  x: x(S).left,
1545
1545
  y: x(S).top,
@@ -1550,20 +1550,20 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
1550
1550
  cursor: "crosshair",
1551
1551
  "touch-action": "none"
1552
1552
  }
1553
- }, ne(x(me), !0)), null, 16, gt)) : i("", !0)
1554
- ], 8, et)),
1555
- q.value && x(Y) !== null && xe.value ? (g(), a("div", {
1553
+ }, ne(x(pe), !0)), null, 16, gt)) : i("", !0)
1554
+ ], 8, $)),
1555
+ J.value && x(X) !== null && xe.value ? (g(), a("div", {
1556
1556
  key: 1,
1557
1557
  ref_key: "tooltipRef",
1558
- ref: pe,
1558
+ ref: fe,
1559
1559
  class: "chart-tooltip-content",
1560
1560
  style: m({
1561
1561
  position: "absolute",
1562
1562
  top: "0",
1563
1563
  left: "0",
1564
1564
  willChange: "transform",
1565
- transform: x(X) ? `translate3d(${x(X).left}px, ${x(X).top}px, 0) translateY(-50%)` : "translateY(-50%)",
1566
- visibility: x(X) ? "visible" : "hidden"
1565
+ transform: x(Z) ? `translate3d(${x(Z).left}px, ${x(Z).top}px, 0) translateY(-50%)` : "translateY(-50%)",
1566
+ visibility: x(Z) ? "visible" : "hidden"
1567
1567
  })
1568
1568
  }, [te(n.$slots, "tooltip", p(u(xe.value)), () => [o("div", _t, [be.value ? (g(), a("div", vt, y(be.value), 1)) : i("", !0), (g(!0), a(e, null, v(xe.value.values, (e) => (g(), a("div", {
1569
1569
  key: e.seriesIndex,
@@ -1571,13 +1571,13 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
1571
1571
  }, [o("span", {
1572
1572
  class: "bar-chart-tooltip-swatch",
1573
1573
  style: m({ background: e.color })
1574
- }, null, 4), s(" " + y(isFinite(e.value) ? V(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
1575
- x(Q) ? (g(), a("a", {
1574
+ }, null, 4), s(" " + y(isFinite(e.value) ? B(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
1575
+ x(_e) ? (g(), a("a", {
1576
1576
  key: 2,
1577
1577
  class: "bar-chart-download-link",
1578
1578
  href: x(ve),
1579
1579
  download: `${x(ye)()}.csv`
1580
- }, y(x(Q)), 9, yt)) : i("", !0)
1580
+ }, y(x(_e)), 9, yt)) : i("", !0)
1581
1581
  ], 512));
1582
1582
  }
1583
1583
  }), [["__scopeId", "data-v-4f604d9f"]]), xt = {
@@ -5731,12 +5731,13 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
5731
5731
  }, kt = {
5732
5732
  key: 2,
5733
5733
  class: "choropleth-legend-continuous"
5734
- }, At = { class: "choropleth-legend-ticks" }, jt = ["viewBox"], Mt = ["innerHTML"], Nt = "http://www.w3.org/2000/svg", Pt = 450, Ft = 1e3, It = /* @__PURE__ */ H(/* @__PURE__ */ l({
5734
+ }, At = { class: "choropleth-legend-ticks" }, jt = ["viewBox"], Mt = ["innerHTML"], Nt = "http://www.w3.org/2000/svg", Pt = 450, Ft = 1e3, It = /* @__PURE__ */ V(/* @__PURE__ */ l({
5735
5735
  __name: "ChoroplethMap",
5736
5736
  props: {
5737
5737
  topology: {},
5738
5738
  data: {},
5739
5739
  geoType: { default: "states" },
5740
+ dataGeoType: {},
5740
5741
  width: {},
5741
5742
  height: {},
5742
5743
  colorScale: {},
@@ -5774,110 +5775,131 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
5774
5775
  "update:focus"
5775
5776
  ],
5776
5777
  setup(t, { emit: c }) {
5777
- let l = t, d = c, ne = (e) => e, x = _(null), S = _(null), T = _(null), E = _(null), D = re(), O = n(() => !!l.tooltipTrigger || !!l.tooltipFormat || !!D.tooltip), k = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new Map(), j = null, M = null, N = /* @__PURE__ */ new Set(), z = !1, B = typeof window < "u" && "ontouchstart" in window, V = null, H = {
5778
+ let l = t, d = c, ne = (e) => e, x = _(null), S = _(null), T = _(null), ie = _(null), E = _(null), D = _(null), O = re(), k = n(() => !!l.tooltipTrigger || !!l.tooltipFormat || !!O.tooltip), A = /* @__PURE__ */ new Map(), j = /* @__PURE__ */ new Map(), M = null, R = null, z = /* @__PURE__ */ new Map(), B = /* @__PURE__ */ new Map(), V = !1, H = typeof window < "u" && "ontouchstart" in window, U = null, W = {
5778
5779
  width: 0,
5779
5780
  height: 0
5780
- }, U = null, W = !1, G = null, ce = _(!1), K = 0, le = 0, ue = 0;
5781
+ }, G = null, K = !1, q = null, le = _(!1), ue = 0, J = 0, Y = 0;
5781
5782
  function de() {
5782
- if (B) return;
5783
+ if (H) return;
5783
5784
  let e = T.value;
5784
- e && (e.addEventListener("click", $e), e.addEventListener("mouseover", $e), e.addEventListener("mousemove", et), e.addEventListener("mouseout", tt));
5785
+ e && (e.addEventListener("click", st), e.addEventListener("mouseover", st), e.addEventListener("mousemove", ct), e.addEventListener("mouseout", lt));
5785
5786
  }
5786
- function q() {
5787
+ function fe() {
5787
5788
  let e = T.value;
5788
- e && (e.removeEventListener("click", $e), e.removeEventListener("mouseover", $e), e.removeEventListener("mousemove", et), e.removeEventListener("mouseout", tt));
5789
+ e && (e.removeEventListener("click", st), e.removeEventListener("mouseover", st), e.removeEventListener("mousemove", ct), e.removeEventListener("mouseout", lt));
5789
5790
  }
5790
- function J() {
5791
- Ze();
5791
+ function Q() {
5792
+ at();
5792
5793
  }
5793
5794
  h(() => {
5794
- fe(), de(), rt(), _e(), Ue(), window.addEventListener("scroll", J, {
5795
+ me(), de(), dt(), ye(), Ze(), window.addEventListener("scroll", Q, {
5795
5796
  passive: !0,
5796
5797
  capture: !0
5797
- }), window.addEventListener("resize", J, { passive: !0 });
5798
+ }), window.addEventListener("resize", Q, { passive: !0 });
5798
5799
  }), ee(() => {
5799
- V?.disconnect(), ue && cancelAnimationFrame(ue), pe(), q(), window.removeEventListener("scroll", J, { capture: !0 }), window.removeEventListener("resize", J);
5800
+ U?.disconnect(), Y && cancelAnimationFrame(Y), he(), fe(), window.removeEventListener("scroll", Q, { capture: !0 }), window.removeEventListener("resize", Q);
5800
5801
  });
5801
- function fe() {
5802
+ function me() {
5802
5803
  if (!S.value || !T.value) return;
5803
- let e = ae(S.value), t = Math.max(12, l.focusZoomLevel);
5804
- G = F().scaleExtent([1, t]).on("start", () => {
5805
- z = !0, Ze();
5804
+ let e = oe(S.value), t = Math.max(12, l.focusZoomLevel);
5805
+ q = P().scaleExtent([1, t]).on("start", () => {
5806
+ V = !0, at();
5806
5807
  }).on("zoom", (e) => {
5807
5808
  T.value && T.value.setAttribute("transform", e.transform);
5808
5809
  let t = e.transform;
5809
- ce.value = t.k !== 1 || t.x !== 0 || t.y !== 0;
5810
+ le.value = t.k !== 1 || t.x !== 0 || t.y !== 0;
5810
5811
  }).on("end", () => {
5811
- z = !1;
5812
- }), G.filter((e) => {
5813
- let t = Oe.value.length > 0, n = !!l.zoom || t, r = !!l.pan || t;
5812
+ V = !1;
5813
+ }), q.filter((e) => {
5814
+ let t = Pe.value.length > 0, n = !!l.zoom || t, r = !!l.pan || t;
5814
5815
  if (e.type === "wheel" || e.type === "dblclick") {
5815
5816
  if (!n) return !1;
5816
5817
  } else if (e.type === "mousedown" || e.type === "touchstart") {
5817
5818
  if (!r) return !1;
5818
5819
  } else if (!n && !r) return !1;
5819
5820
  return (!e.ctrlKey || e.type === "wheel") && !e.button;
5820
- }), e.call(G);
5821
+ }), e.call(q);
5821
5822
  }
5822
- function pe() {
5823
- S.value && G && (ae(S.value).on(".zoom", null), G = null);
5823
+ function he() {
5824
+ S.value && q && (oe(S.value).on(".zoom", null), q = null);
5824
5825
  }
5825
- function Z(e) {
5826
- let t = De.value, n = Ee.value, r = /* @__PURE__ */ new Set();
5826
+ function ge(e) {
5827
+ let t = Fe.value, n = je.value, r = [];
5827
5828
  for (let i of e) {
5828
- let e = t.has(i) ? i : n.get(i);
5829
- e != null && r.add(e);
5829
+ let e = i.geoType ?? l.geoType, a = t.get(e);
5830
+ if (!a) continue;
5831
+ let o = a.get(i.id);
5832
+ if (!o) {
5833
+ let t = n.get(e)?.get(i.id);
5834
+ t && (o = a.get(t));
5835
+ }
5836
+ o && r.push({
5837
+ item: i,
5838
+ geoType: e,
5839
+ feature: o,
5840
+ key: `${e}:${String(o.id)}`
5841
+ });
5830
5842
  }
5831
5843
  return r;
5832
5844
  }
5833
- function he(e) {
5834
- let t = De.value, n = [];
5835
- for (let r of Z(e)) {
5836
- let e = t.get(r);
5837
- e && n.push(e);
5838
- }
5839
- return n;
5845
+ function _e(e) {
5846
+ let t = /* @__PURE__ */ new Set();
5847
+ for (let n of ge(e)) n.geoType === l.geoType && t.add(String(n.feature.id));
5848
+ return t;
5840
5849
  }
5841
- let ge = !1;
5842
- function _e() {
5843
- if (!S.value || !G) return;
5844
- let e = Oe.value, t = e.length > 0 ? he(e) : [], n = /* @__PURE__ */ new Set();
5850
+ let ve = !1;
5851
+ function ye() {
5852
+ if (!S.value || !q) return;
5853
+ let e = ge(Pe.value), t = e.filter((e) => e.geoType === l.geoType), n = e.filter((e) => e.geoType !== l.geoType), r = /* @__PURE__ */ new Map();
5845
5854
  for (let e of t) {
5846
- let t = k.get(String(e.id));
5847
- t && n.add(t);
5855
+ let t = A.get(String(e.feature.id));
5856
+ t && r.set(t, e.item.style ?? "solid");
5848
5857
  }
5849
- for (let e of N) n.has(e) || e === M || Ye(e);
5850
- for (let e of n) !N.has(e) && e !== M && Je(e);
5851
- N.clear();
5852
- for (let e of n) N.add(e);
5853
- let r = ae(S.value);
5854
- r.interrupt();
5855
- let i = ge && t.length > 0;
5856
- if (ge = !0, t.length === 0) {
5857
- G.transform(r, I), Ze();
5858
+ for (let [e] of z) r.has(e) || e === R || rt(e);
5859
+ for (let [e, t] of r) z.get(e) === t && e !== R || e !== R && nt(e, t);
5860
+ z.clear();
5861
+ for (let [e, t] of r) z.set(e, t);
5862
+ if (be(n), e.length === 0) {
5863
+ ve = !0, at();
5858
5864
  return;
5859
5865
  }
5860
- let [[a, o], [s, c]] = we.value.bounds({
5866
+ let i = oe(S.value);
5867
+ i.interrupt();
5868
+ let a = ve;
5869
+ ve = !0;
5870
+ let [[o, s], [c, u]] = ke.value.bounds({
5861
5871
  type: "FeatureCollection",
5862
- features: t
5863
- }), u = (a + s) / 2, d = (o + c) / 2, f = l.focusZoomLevel, p = I.translate(ye.value / 2 - f * u, be.value / 2 - f * d).scale(f), m = () => {
5864
- if (!O.value) return;
5865
- let e = String(t[0].id), n = k.get(e);
5866
- if (!n) return;
5867
- let r = n.getBoundingClientRect();
5868
- Ge(e, r.left + r.width / 2, r.top + r.height / 2);
5872
+ features: e.map((e) => e.feature)
5873
+ }), d = (o + c) / 2, f = (s + u) / 2, p = l.focusZoomLevel, m = F.translate(Ce.value / 2 - p * d, we.value / 2 - p * f).scale(p), h = t[0]?.feature ?? null, ee = () => {
5874
+ if (!k.value || !h) return;
5875
+ let e = String(h.id), t = A.get(e);
5876
+ if (!t) return;
5877
+ let n = t.getBoundingClientRect();
5878
+ $e(e, n.left + n.width / 2, n.top + n.height / 2);
5869
5879
  };
5870
- i ? (qe(), r.transition().duration(Pt).call(G.transform, p).on("end", m)) : (G.transform(r, p), m());
5880
+ a ? ($(), i.transition().duration(Pt).call(q.transform, m).on("end", ee)) : (q.transform(i, m), ee());
5871
5881
  }
5872
- function Q() {
5873
- if (!S.value || !G) return;
5874
- let e = ae(S.value);
5875
- e.interrupt(), G.transform(e, I), Oe.value.length > 0 && d("update:focus", null);
5882
+ function be(e) {
5883
+ let t = E.value;
5884
+ if (!t) return;
5885
+ let n = new Set(e.map((e) => e.key));
5886
+ for (let [e, t] of B) n.has(e) || (t.remove(), B.delete(e));
5887
+ let r = ke.value, i = Ae.value + 1.5;
5888
+ for (let { item: n, feature: a, key: o } of e) {
5889
+ let e = B.get(o);
5890
+ e || (e = document.createElementNS(Nt, "path"), e.setAttribute("d", r(a) ?? ""), e.setAttribute("fill", "none"), e.setAttribute("pointer-events", "none"), e.setAttribute("vector-effect", "non-scaling-stroke"), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("class", "focus-overlay"), t.appendChild(e), B.set(o, e)), e.setAttribute("stroke", n.stroke ?? "#fff"), e.setAttribute("stroke-width", String(i)), tt(e, n.style);
5891
+ }
5892
+ }
5893
+ function xe() {
5894
+ if (!S.value || !q) return;
5895
+ Pe.value.length > 0 && d("update:focus", null);
5896
+ let e = oe(S.value);
5897
+ e.interrupt(), $(), e.transition().duration(Pt).call(q.transform, F);
5876
5898
  }
5877
5899
  C(() => l.focusZoomLevel, () => {
5878
- G && G.scaleExtent([1, Math.max(12, l.focusZoomLevel)]), _e();
5900
+ q && q.scaleExtent([1, Math.max(12, l.focusZoomLevel)]), ye();
5879
5901
  });
5880
- let ve = n(() => l.width && l.height ? l.height / l.width : .625), ye = n(() => Ft), be = n(() => Ft * ve.value), xe = n(() => {
5902
+ let Se = n(() => l.width && l.height ? l.height / l.width : .625), Ce = n(() => Ft), we = n(() => Ft * Se.value), Te = n(() => {
5881
5903
  let e = b(l.topology), t = e.objects.counties.geometries, n = /* @__PURE__ */ new Map();
5882
5904
  for (let e of t) {
5883
5905
  let t = xt[String(e.id).padStart(5, "0")];
@@ -5888,46 +5910,76 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
5888
5910
  type: "Feature",
5889
5911
  id: t,
5890
5912
  properties: { name: St[t] ?? t },
5891
- geometry: oe(e, i)
5913
+ geometry: se(e, i)
5892
5914
  });
5893
5915
  return {
5894
5916
  type: "FeatureCollection",
5895
5917
  features: r
5896
5918
  };
5897
- }), $ = n(() => {
5898
- if (l.geoType === "hsas") return xe.value;
5919
+ }), Ee = n(() => {
5920
+ if (l.geoType === "hsas") return Te.value;
5899
5921
  if (l.geoType === "counties") {
5900
5922
  let e = b(l.topology);
5901
- return L(e, e.objects.counties);
5923
+ return I(e, e.objects.counties);
5902
5924
  }
5903
5925
  let e = b(l.topology);
5904
- return L(e, e.objects.states);
5905
- }), Se = n(() => {
5926
+ return I(e, e.objects.states);
5927
+ }), De = n(() => {
5906
5928
  if (l.geoType !== "counties" && l.geoType !== "hsas") return null;
5907
5929
  let e = b(l.topology);
5908
- return R(e, e.objects.states, (e, t) => e !== t);
5909
- }), Ce = n(() => P().fitExtent([[0, 0], [ye.value, be.value]], $.value)), we = n(() => ie(Ce.value)), Te = n(() => l.geoType === "counties" || l.geoType === "hsas" ? l.strokeWidth * .5 : l.strokeWidth), Ee = n(() => {
5930
+ return L(e, e.objects.states, (e, t) => e !== t);
5931
+ }), Oe = n(() => N().fitExtent([[0, 0], [Ce.value, we.value]], Ee.value)), ke = n(() => ae(Oe.value)), Ae = n(() => l.geoType === "counties" || l.geoType === "hsas" ? l.strokeWidth * .5 : l.strokeWidth), je = n(() => {
5910
5932
  let e = /* @__PURE__ */ new Map();
5911
- for (let t of $.value.features) t.properties?.name != null && t.id != null && e.set(t.properties.name, String(t.id));
5933
+ for (let [t, n] of Fe.value) {
5934
+ let r = /* @__PURE__ */ new Map();
5935
+ for (let [e, t] of n) t.properties?.name != null && r.set(t.properties.name, e);
5936
+ e.set(t, r);
5937
+ }
5912
5938
  return e;
5913
- }), De = n(() => {
5939
+ });
5940
+ function Me(e) {
5941
+ let t = l.dataGeoType;
5942
+ if (!t || t === l.geoType) return e;
5943
+ if (l.geoType === "counties" && t === "hsas") return xt[e];
5944
+ if (l.geoType === "counties" && t === "states" || l.geoType === "hsas" && t === "states") return e.slice(0, 2);
5945
+ }
5946
+ let Ne = n(() => {
5914
5947
  let e = /* @__PURE__ */ new Map();
5915
- for (let t of $.value.features) t.id != null && e.set(String(t.id), t);
5948
+ for (let t of Ee.value.features) t.id != null && e.set(String(t.id), t);
5916
5949
  return e;
5917
- }), Oe = n(() => {
5950
+ }), Pe = n(() => {
5918
5951
  let e = l.focus;
5919
- return e == null ? [] : Array.isArray(e) ? e : [e];
5920
- }), ke = n(() => {
5952
+ return e == null ? [] : (Array.isArray(e) ? e : [e]).map((e) => typeof e == "string" ? { id: e } : e);
5953
+ }), Fe = n(() => {
5954
+ let e = /* @__PURE__ */ new Map();
5955
+ e.set(l.geoType, Ne.value);
5956
+ let t = b(l.topology), n = t?.objects;
5957
+ if (!n) return e;
5958
+ let r = (e) => {
5959
+ let t = /* @__PURE__ */ new Map();
5960
+ for (let n of e) n.id != null && t.set(String(n.id), n);
5961
+ return t;
5962
+ };
5963
+ if (!e.has("states") && n.states) {
5964
+ let i = I(t, n.states);
5965
+ e.set("states", r(i.features));
5966
+ }
5967
+ if (!e.has("counties") && n.counties) {
5968
+ let i = I(t, n.counties);
5969
+ e.set("counties", r(i.features));
5970
+ }
5971
+ return !e.has("hsas") && n.counties && e.set("hsas", r(Te.value.features)), e;
5972
+ }), Ie = n(() => {
5921
5973
  let e = /* @__PURE__ */ new Map();
5922
5974
  if (!l.data) return e;
5923
- let t = Ee.value;
5924
- for (let n of l.data) {
5925
- e.set(n.id, n.value);
5926
- let r = t.get(n.id);
5927
- r && e.set(r, n.value);
5975
+ let t = l.dataGeoType ?? l.geoType, n = je.value.get(t);
5976
+ for (let t of l.data) {
5977
+ e.set(t.id, t.value);
5978
+ let r = n?.get(t.id);
5979
+ r && e.set(r, t.value);
5928
5980
  }
5929
5981
  return e;
5930
- }), Ae = n(() => {
5982
+ }), Le = n(() => {
5931
5983
  if (!l.data || l.data.length === 0) return {
5932
5984
  min: 0,
5933
5985
  max: 1
@@ -5944,8 +5996,8 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
5944
5996
  min: 0,
5945
5997
  max: 1
5946
5998
  };
5947
- }), je = n(() => Array.isArray(l.colorScale) && l.colorScale.length > 0 && "value" in l.colorScale[0]), Me = n(() => Array.isArray(l.colorScale) && !je.value), Ne = n(() => Me.value ? "" : l.colorScale?.min ?? "#e5f0fa"), Pe = n(() => Me.value ? "" : l.colorScale?.max ?? "#08519c");
5948
- function Fe(e) {
5999
+ }), Re = n(() => Array.isArray(l.colorScale) && l.colorScale.length > 0 && "value" in l.colorScale[0]), ze = n(() => Array.isArray(l.colorScale) && !Re.value), Be = n(() => ze.value ? "" : l.colorScale?.min ?? "#e5f0fa"), Ve = n(() => ze.value ? "" : l.colorScale?.max ?? "#08519c");
6000
+ function He(e) {
5949
6001
  let t = e.replace("#", "");
5950
6002
  return [
5951
6003
  parseInt(t.slice(0, 2), 16),
@@ -5953,226 +6005,239 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
5953
6005
  parseInt(t.slice(4, 6), 16)
5954
6006
  ];
5955
6007
  }
5956
- function Ie(e) {
5957
- let [t, n, r] = Fe(Ne.value), [i, a, o] = Fe(Pe.value);
6008
+ function Ue(e) {
6009
+ let [t, n, r] = He(Be.value), [i, a, o] = He(Ve.value);
5958
6010
  return `rgb(${Math.round(t + (i - t) * e)},${Math.round(n + (a - n) * e)},${Math.round(r + (o - r) * e)})`;
5959
6011
  }
5960
- let Le = n(() => Me.value ? l.colorScale.slice().sort((e, t) => t.min - e.min) : null), Re = n(() => {
5961
- if (!je.value) return null;
6012
+ let We = n(() => ze.value ? l.colorScale.slice().sort((e, t) => t.min - e.min) : null), Ge = n(() => {
6013
+ if (!Re.value) return null;
5962
6014
  let e = /* @__PURE__ */ new Map();
5963
6015
  for (let t of l.colorScale) e.set(t.value, t.color);
5964
6016
  return e;
5965
6017
  });
5966
- function ze(e) {
5967
- let t = ke.value.get(e), n = l.noDataColor;
6018
+ function Ke(e) {
6019
+ let t = Me(e);
6020
+ return t == null ? void 0 : Ie.value.get(t);
6021
+ }
6022
+ function qe(e) {
6023
+ let t = Ke(e), n = l.noDataColor;
5968
6024
  if (t == null) return n;
5969
- let r = Re.value;
6025
+ let r = Ge.value;
5970
6026
  if (r) return r.get(String(t)) ?? n;
5971
- let i = Le.value;
6027
+ let i = We.value;
5972
6028
  if (i) {
5973
6029
  let e = t;
5974
6030
  for (let t of i) if (e >= t.min) return t.color;
5975
6031
  return n;
5976
6032
  }
5977
- let { min: a, max: o } = Ae.value;
5978
- return Ie((t - a) / (o - a));
6033
+ let { min: a, max: o } = Le.value;
6034
+ return Ue((t - a) / (o - a));
5979
6035
  }
5980
- let Be = (e) => e.properties?.name ?? String(e.id);
5981
- function Ve(e) {
6036
+ let Je = (e) => e.properties?.name ?? String(e.id);
6037
+ function Ye(e) {
5982
6038
  return e == null ? "" : typeof e == "number" && l.tooltipValueFormat ? l.tooltipValueFormat(e) : String(e);
5983
6039
  }
5984
- function He(e, t) {
5985
- return t == null ? e : `${e}: ${Ve(t)}`;
6040
+ function Xe(e, t) {
6041
+ return t == null ? e : `${e}: ${Ye(t)}`;
5986
6042
  }
5987
- function Ue() {
5988
- let e = E.value?.getEl();
6043
+ function Ze() {
6044
+ let e = D.value?.getEl();
5989
6045
  if (!e) return;
5990
- V?.disconnect();
6046
+ U?.disconnect();
5991
6047
  let t = !1;
5992
- V = new ResizeObserver((e) => {
6048
+ U = new ResizeObserver((e) => {
5993
6049
  let n = e[0]?.contentRect;
5994
- n && (H.width = n.width, H.height = n.height, !t && W && U ? (t = !0, We(U.x, U.y)) : t = !0);
5995
- }), V.observe(e);
6050
+ n && (W.width = n.width, W.height = n.height, !t && K && G ? (t = !0, Qe(G.x, G.y)) : t = !0);
6051
+ }), U.observe(e);
5996
6052
  }
5997
- function We(e, t) {
5998
- let n = E.value?.getEl();
6053
+ function Qe(e, t) {
6054
+ let n = D.value?.getEl();
5999
6055
  if (!n) return;
6000
- let r = x.value?.getBoundingClientRect(), { left: i, top: a } = Y(e, t, H.width, H.height, l.tooltipClamp, r);
6056
+ let r = x.value?.getBoundingClientRect(), { left: i, top: a } = X(e, t, W.width, W.height, l.tooltipClamp, r);
6001
6057
  n.style.transform = `translate3d(${i}px, ${a}px, 0) translateY(-50%)`;
6002
6058
  }
6003
- function Ge(e, t, n) {
6004
- let r = A.get(e);
6059
+ function $e(e, t, n) {
6060
+ let r = j.get(e);
6005
6061
  if (!r) return;
6006
- let i = E.value, a = i?.getEl();
6007
- !i || !a || (i.setData(r), U = {
6062
+ let i = D.value, a = i?.getEl();
6063
+ !i || !a || (i.setData(r), G = {
6008
6064
  x: t,
6009
6065
  y: n
6010
- }, W = !0, We(t, n), a.style.visibility = "visible");
6066
+ }, K = !0, Qe(t, n), a.style.visibility = "visible");
6011
6067
  }
6012
- function Ke(e, t) {
6013
- W && (K = e, le = t, !ue && (ue = requestAnimationFrame(() => {
6014
- ue = 0;
6015
- let e = E.value?.getEl();
6016
- !e || !W || (U = {
6017
- x: K,
6018
- y: le
6019
- }, e.style.transform = `translate3d(${K + 16}px, ${le}px, 0) translateY(-50%)`);
6068
+ function et(e, t) {
6069
+ K && (ue = e, J = t, !Y && (Y = requestAnimationFrame(() => {
6070
+ Y = 0;
6071
+ let e = D.value?.getEl();
6072
+ !e || !K || (G = {
6073
+ x: ue,
6074
+ y: J
6075
+ }, e.style.transform = `translate3d(${ue + 16}px, ${J}px, 0) translateY(-50%)`);
6020
6076
  })));
6021
6077
  }
6022
- function qe() {
6023
- if (!W) return;
6024
- W = !1, U = null;
6025
- let e = E.value?.getEl();
6078
+ function $() {
6079
+ if (!K) return;
6080
+ K = !1, G = null;
6081
+ let e = D.value?.getEl();
6026
6082
  e && (e.style.visibility = "hidden");
6027
6083
  }
6028
- function Je(e) {
6029
- e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(Te.value + 1)), e.setAttribute("stroke", "#555");
6084
+ function tt(e, t) {
6085
+ t === "dashed" ? (e.setAttribute("stroke-dasharray", "8 4"), e.removeAttribute("stroke-linecap")) : t === "dotted" ? (e.setAttribute("stroke-dasharray", "0 5"), e.setAttribute("stroke-linecap", "round")) : (e.removeAttribute("stroke-dasharray"), e.removeAttribute("stroke-linecap"));
6030
6086
  }
6031
- function Ye(e) {
6032
- e.setAttribute("stroke-width", String(Te.value)), e.setAttribute("stroke", l.strokeColor);
6087
+ function nt(e, t = "solid") {
6088
+ e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(Ae.value + 1)), e.setAttribute("stroke", "#555"), tt(e, t);
6033
6089
  }
6034
- function Xe(e) {
6035
- M !== e && (M && !N.has(M) && Ye(M), M = e, Je(e));
6090
+ function rt(e) {
6091
+ e.setAttribute("stroke-width", String(Ae.value)), e.setAttribute("stroke", l.strokeColor), e.removeAttribute("stroke-dasharray"), e.removeAttribute("stroke-linecap");
6036
6092
  }
6037
- function Ze() {
6038
- M && (N.has(M) || Ye(M), M = null, d("stateHover", null)), qe();
6093
+ function it(e) {
6094
+ R !== e && (R && !z.has(R) && rt(R), R = e, nt(e, z.get(e) ?? "solid"));
6095
+ }
6096
+ function at() {
6097
+ if (R) {
6098
+ let e = z.get(R);
6099
+ e == null ? rt(R) : nt(R, e), R = null, d("stateHover", null);
6100
+ }
6101
+ $();
6039
6102
  }
6040
- function Qe(e) {
6103
+ function ot(e) {
6041
6104
  let t = e;
6042
6105
  for (; t && !t.dataset?.featId;) t = t.parentElement;
6043
6106
  return t ? t.dataset.featId ?? null : null;
6044
6107
  }
6045
- function $e(e) {
6046
- if (z) return;
6047
- let t = e, n = Qe(t.target);
6108
+ function st(e) {
6109
+ if (V) return;
6110
+ let t = e, n = ot(t.target);
6048
6111
  if (!n) return;
6049
- let r = A.get(n);
6112
+ let r = j.get(n);
6050
6113
  if (!r) return;
6051
6114
  let i = {
6052
6115
  id: r.id,
6053
6116
  name: r.name,
6054
6117
  value: r.value
6055
6118
  };
6056
- e.type === "click" ? (d("stateClick", i), d("update:focus", Z(Oe.value).has(r.id) ? null : r.id)) : e.type === "mouseover" && (Xe(k.get(n)), O.value && Ge(n, t.clientX, t.clientY), d("stateHover", i));
6119
+ e.type === "click" ? (d("stateClick", i), d("update:focus", _e(Pe.value).has(r.id) ? null : r.id)) : e.type === "mouseover" && (it(A.get(n)), k.value && $e(n, t.clientX, t.clientY), d("stateHover", i));
6057
6120
  }
6058
- function et(e) {
6059
- z || Ke(e.clientX, e.clientY);
6121
+ function ct(e) {
6122
+ V || et(e.clientX, e.clientY);
6060
6123
  }
6061
- function tt(e) {
6124
+ function lt(e) {
6062
6125
  let t = e.relatedTarget;
6063
- t && T.value?.contains(t) || Ze();
6126
+ t && T.value?.contains(t) || at();
6064
6127
  }
6065
- function nt(e) {
6128
+ function ut(e) {
6066
6129
  let t = document.createElementNS(Nt, "path");
6067
6130
  return e && t.setAttribute("d", e), t;
6068
6131
  }
6069
- function rt() {
6070
- let e = T.value;
6071
- if (!e) return;
6132
+ function dt() {
6133
+ let e = ie.value, t = E.value;
6134
+ if (!e || !t) return;
6072
6135
  for (; e.firstChild;) e.removeChild(e.firstChild);
6073
- k.clear(), A.clear(), j = null, M = null, N.clear();
6074
- let t = we.value, n = $.value.features, r = l.strokeColor, i = String(Te.value), a = !O.value, o = document.createDocumentFragment();
6075
- for (let e of n) {
6076
- let n = String(e.id), s = Be(e), c = ke.value.get(n), l = nt(t(e));
6077
- if (l.setAttribute("class", "state-path"), l.setAttribute("data-feat-id", n), l.setAttribute("fill", ze(n)), l.setAttribute("stroke", r), l.setAttribute("stroke-width", i), l.setAttribute("vector-effect", "non-scaling-stroke"), a) {
6136
+ for (; t.firstChild;) t.removeChild(t.firstChild);
6137
+ A.clear(), j.clear(), M = null, R = null, z.clear(), B.clear();
6138
+ let n = ke.value, r = Ee.value.features, i = l.strokeColor, a = String(Ae.value), o = !k.value, s = document.createDocumentFragment();
6139
+ for (let e of r) {
6140
+ let t = String(e.id), r = Je(e), c = Ke(t), l = ut(n(e));
6141
+ if (l.setAttribute("class", "state-path"), l.setAttribute("data-feat-id", t), l.setAttribute("fill", qe(t)), l.setAttribute("stroke", i), l.setAttribute("stroke-width", a), l.setAttribute("vector-effect", "non-scaling-stroke"), o) {
6078
6142
  let e = document.createElementNS(Nt, "title");
6079
- e.textContent = He(s, c), l.appendChild(e);
6143
+ e.textContent = Xe(r, c), l.appendChild(e);
6080
6144
  }
6081
- o.appendChild(l), k.set(n, l), A.set(n, {
6082
- id: n,
6083
- name: s,
6145
+ s.appendChild(l), A.set(t, l), j.set(t, {
6146
+ id: t,
6147
+ name: r,
6084
6148
  value: c,
6085
6149
  feature: e
6086
6150
  });
6087
6151
  }
6088
- let s = Se.value;
6089
- if (s) {
6090
- let e = nt(t(s));
6091
- e.setAttribute("fill", "none"), e.setAttribute("stroke", r), e.setAttribute("stroke-width", "1"), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("pointer-events", "none"), e.setAttribute("vector-effect", "non-scaling-stroke"), o.appendChild(e), j = e;
6152
+ let c = De.value;
6153
+ if (c) {
6154
+ let e = ut(n(c));
6155
+ e.setAttribute("fill", "none"), e.setAttribute("stroke", i), e.setAttribute("stroke-width", "1"), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("pointer-events", "none"), e.setAttribute("vector-effect", "non-scaling-stroke"), s.appendChild(e), M = e;
6092
6156
  }
6093
- e.appendChild(o);
6157
+ e.appendChild(s);
6094
6158
  }
6095
- function it() {
6096
- let e = !O.value;
6097
- for (let [t, n] of k) {
6098
- let r = ke.value.get(t), i = A.get(t);
6099
- if (n.setAttribute("fill", ze(t)), i && (i.value = r), e && i) {
6159
+ function ft() {
6160
+ let e = !k.value;
6161
+ for (let [t, n] of A) {
6162
+ let r = Ke(t), i = j.get(t);
6163
+ if (n.setAttribute("fill", qe(t)), i && (i.value = r), e && i) {
6100
6164
  let e = n.firstElementChild;
6101
- e && (e.textContent = He(i.name, r));
6165
+ e && (e.textContent = Xe(i.name, r));
6102
6166
  }
6103
6167
  }
6104
6168
  }
6105
- function at() {
6106
- for (let e of k.values()) e === M || N.has(e) || Ye(e);
6107
- j && j.setAttribute("stroke", l.strokeColor);
6169
+ function pt() {
6170
+ for (let e of A.values()) e === R || z.has(e) || rt(e);
6171
+ M && M.setAttribute("stroke", l.strokeColor);
6108
6172
  }
6109
- function ot() {
6173
+ function mt() {
6110
6174
  return typeof l.menu == "string" ? l.menu : "choropleth";
6111
6175
  }
6112
- let st = n(() => l.legend && (je.value || Me.value || l.data)), ct = n(() => l.colorScale.slice().sort((e, t) => e.min - t.min)), lt = n(() => {
6176
+ let ht = n(() => l.legend && (Re.value || ze.value || l.data)), gt = n(() => l.colorScale.slice().sort((e, t) => e.min - t.min)), _t = n(() => {
6113
6177
  let e = [];
6114
6178
  for (let t = 0; t <= 10; t++) {
6115
6179
  let n = t / 10;
6116
6180
  e.push({
6117
6181
  offset: `${(n * 100).toFixed(0)}%`,
6118
- color: Ie(n)
6182
+ color: Ue(n)
6119
6183
  });
6120
6184
  }
6121
6185
  return e;
6122
- }), ut = new Intl.NumberFormat("en-US", {
6186
+ }), vt = new Intl.NumberFormat("en-US", {
6123
6187
  notation: "compact",
6124
6188
  maximumFractionDigits: 1
6125
- }), dt = n(() => {
6126
- let { min: e, max: t } = Ae.value, n = t - e, r = [];
6189
+ }), yt = n(() => {
6190
+ let { min: e, max: t } = Le.value, n = t - e, r = [];
6127
6191
  for (let t = 1; t <= 3; t++) {
6128
- let i = t / 4, a = e + n * i, o = Math.abs(a) >= 1e3 ? ut.format(a) : Number.isInteger(a) ? String(a) : a.toFixed(1).replace(/\.0$/, "");
6192
+ let i = t / 4, a = e + n * i, o = Math.abs(a) >= 1e3 ? vt.format(a) : Number.isInteger(a) ? String(a) : a.toFixed(1).replace(/\.0$/, "");
6129
6193
  r.push({
6130
6194
  value: o,
6131
6195
  pct: i * 100
6132
6196
  });
6133
6197
  }
6134
6198
  return r;
6135
- }), ft = n(() => {
6199
+ }), bt = n(() => {
6136
6200
  let e = [];
6137
- if (je.value) for (let t of l.colorScale) e.push({
6201
+ if (Re.value) for (let t of l.colorScale) e.push({
6138
6202
  key: t.value,
6139
6203
  color: t.color,
6140
6204
  label: t.value
6141
6205
  });
6142
- else if (Me.value) for (let t of ct.value) e.push({
6206
+ else if (ze.value) for (let t of gt.value) e.push({
6143
6207
  key: String(t.min),
6144
6208
  color: t.color,
6145
6209
  label: t.label ?? String(t.min)
6146
6210
  });
6147
6211
  return e;
6148
- }), pt = n(() => `linear-gradient(to right, ${lt.value.map((e) => `${e.color} ${e.offset}`).join(", ")})`), mt = n(() => {
6149
- let e = ot();
6212
+ }), Ct = n(() => `linear-gradient(to right, ${_t.value.map((e) => `${e.color} ${e.offset}`).join(", ")})`), It = n(() => {
6213
+ let e = mt();
6150
6214
  return [{
6151
6215
  label: "Save as SVG",
6152
6216
  action: () => {
6153
- S.value && X(S.value, e);
6217
+ S.value && Z(S.value, e);
6154
6218
  }
6155
6219
  }, {
6156
6220
  label: "Save as PNG",
6157
6221
  action: () => {
6158
- S.value && me(S.value, e);
6222
+ S.value && pe(S.value, e);
6159
6223
  }
6160
6224
  }];
6161
6225
  });
6162
- return C(() => [we.value, O.value], () => rt()), C(() => [
6163
- ke.value,
6226
+ return C(() => [ke.value, k.value], () => dt()), C(() => [
6227
+ Ie.value,
6164
6228
  l.colorScale,
6165
- l.noDataColor
6166
- ], () => it()), C(() => [l.strokeColor, Te.value], () => at()), C(() => [Oe.value, we.value], () => _e(), { flush: "post" }), (n, c) => (g(), a("div", {
6229
+ l.noDataColor,
6230
+ l.dataGeoType
6231
+ ], () => ft()), C(() => [l.strokeColor, Ae.value], () => pt()), C(() => [Pe.value, ke.value], () => ye(), { flush: "post" }), (n, c) => (g(), a("div", {
6167
6232
  ref_key: "containerRef",
6168
6233
  ref: x,
6169
6234
  class: f(["choropleth-wrapper", { pannable: t.pan }])
6170
6235
  }, [
6171
- t.menu ? (g(), r(se, {
6236
+ t.menu ? (g(), r(ce, {
6172
6237
  key: 0,
6173
- items: mt.value
6238
+ items: It.value
6174
6239
  }, null, 8, ["items"])) : i("", !0),
6175
- t.title || st.value ? (g(), a("div", Tt, [t.title ? (g(), a("div", Et, y(t.title), 1)) : i("", !0), st.value ? (g(), a("div", Dt, [t.legendTitle ? (g(), a("span", Ot, y(t.legendTitle), 1)) : i("", !0), je.value || Me.value ? (g(!0), a(e, { key: 1 }, v(ft.value, (e) => (g(), a("span", {
6240
+ t.title || ht.value ? (g(), a("div", Tt, [t.title ? (g(), a("div", Et, y(t.title), 1)) : i("", !0), ht.value ? (g(), a("div", Dt, [t.legendTitle ? (g(), a("span", Ot, y(t.legendTitle), 1)) : i("", !0), Re.value || ze.value ? (g(!0), a(e, { key: 1 }, v(bt.value, (e) => (g(), a("span", {
6176
6241
  key: e.key,
6177
6242
  class: "choropleth-legend-item"
6178
6243
  }, [o("span", {
@@ -6180,41 +6245,47 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
6180
6245
  style: m({ background: e.color })
6181
6246
  }, null, 4), s(" " + y(e.label), 1)]))), 128)) : (g(), a("div", kt, [o("div", {
6182
6247
  class: "choropleth-legend-gradient",
6183
- style: m({ background: pt.value })
6184
- }, null, 4), o("div", At, [(g(!0), a(e, null, v(dt.value, (e) => (g(), a("span", {
6248
+ style: m({ background: Ct.value })
6249
+ }, null, 4), o("div", At, [(g(!0), a(e, null, v(yt.value, (e) => (g(), a("span", {
6185
6250
  key: e.value,
6186
6251
  style: m({ left: e.pct + "%" })
6187
6252
  }, y(e.value), 5))), 128))])]))])) : i("", !0)])) : i("", !0),
6188
6253
  (g(), a("svg", {
6189
6254
  ref_key: "svgRef",
6190
6255
  ref: S,
6191
- viewBox: `0 0 ${ye.value} ${be.value}`,
6256
+ viewBox: `0 0 ${Ce.value} ${we.value}`,
6192
6257
  preserveAspectRatio: "xMidYMid meet"
6193
6258
  }, [o("g", {
6194
6259
  ref_key: "mapGroupRef",
6195
6260
  ref: T
6196
- }, null, 512)], 8, jt)),
6197
- ce.value ? (g(), a("button", {
6261
+ }, [o("g", {
6262
+ ref_key: "baseGroupRef",
6263
+ ref: ie
6264
+ }, null, 512), o("g", {
6265
+ ref_key: "overlayGroupRef",
6266
+ ref: E
6267
+ }, null, 512)], 512)], 8, jt)),
6268
+ le.value ? (g(), a("button", {
6198
6269
  key: 2,
6199
6270
  type: "button",
6200
6271
  class: "choropleth-reset",
6201
6272
  "aria-label": "Reset zoom",
6202
- onClick: Q
6273
+ onClick: xe
6203
6274
  }, " Reset ")) : i("", !0),
6204
- O.value ? (g(), r(wt, {
6275
+ k.value ? (g(), r(wt, {
6205
6276
  key: 3,
6206
6277
  ref_key: "tooltipChildRef",
6207
- ref: E
6278
+ ref: D
6208
6279
  }, {
6209
6280
  default: w((r) => [te(n.$slots, "tooltip", p(u(ne(r))), () => [t.tooltipFormat ? (g(), a("span", {
6210
6281
  key: 0,
6211
6282
  innerHTML: t.tooltipFormat(r)
6212
- }, null, 8, Mt)) : r.value == null ? (g(), a(e, { key: 1 }, [s(y(r.name), 1)], 64)) : (g(), a(e, { key: 2 }, [s(y(r.name) + ": " + y(Ve(r.value)), 1)], 64))], !0)]),
6283
+ }, null, 8, Mt)) : r.value == null ? (g(), a(e, { key: 1 }, [s(y(r.name), 1)], 64)) : (g(), a(e, { key: 2 }, [s(y(r.name) + ": " + y(Ye(r.value)), 1)], 64))], !0)]),
6213
6284
  _: 3
6214
6285
  }, 512)) : i("", !0)
6215
6286
  ], 2));
6216
6287
  }
6217
- }), [["__scopeId", "data-v-62648243"]]), Lt = /* @__PURE__ */ H(/* @__PURE__ */ l({
6288
+ }), [["__scopeId", "data-v-f0f75b22"]]), Lt = /* @__PURE__ */ V(/* @__PURE__ */ l({
6218
6289
  __name: "ChartTooltip",
6219
6290
  props: {
6220
6291
  x: {},
@@ -6234,11 +6305,11 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
6234
6305
  top: `${e.y}px`,
6235
6306
  transform: "translateY(-50%)"
6236
6307
  })
6237
- }, [te(t.$slots, "default", {}, void 0, !0)], 4)) : e.mode === "click" ? (g(), r(x(N), {
6308
+ }, [te(t.$slots, "default", {}, void 0, !0)], 4)) : e.mode === "click" ? (g(), r(x(M), {
6238
6309
  key: 1,
6239
6310
  open: e.open
6240
6311
  }, {
6241
- default: w(() => [c(x(A), { "as-child": "" }, {
6312
+ default: w(() => [c(x(k), { "as-child": "" }, {
6242
6313
  default: w(() => [o("div", {
6243
6314
  class: "chart-tooltip-anchor",
6244
6315
  style: m({
@@ -6247,8 +6318,8 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
6247
6318
  })
6248
6319
  }, null, 4)]),
6249
6320
  _: 1
6250
- }), c(x(M), null, {
6251
- default: w(() => [e.open ? (g(), r(x(j), {
6321
+ }), c(x(j), null, {
6322
+ default: w(() => [e.open ? (g(), r(x(A), {
6252
6323
  key: 0,
6253
6324
  class: "chart-tooltip-content",
6254
6325
  side: "right",
@@ -6265,7 +6336,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
6265
6336
  _: 3
6266
6337
  }, 8, ["open"])) : i("", !0);
6267
6338
  }
6268
- }), [["__scopeId", "data-v-44377f70"]]), Rt = { class: "TableWrapper" }, zt = /* @__PURE__ */ H(/* @__PURE__ */ l({
6339
+ }), [["__scopeId", "data-v-44377f70"]]), Rt = { class: "TableWrapper" }, zt = /* @__PURE__ */ V(/* @__PURE__ */ l({
6269
6340
  __name: "DataTable",
6270
6341
  props: {
6271
6342
  data: {},
@@ -6350,12 +6421,12 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
6350
6421
  }
6351
6422
  let x = n(() => [{
6352
6423
  label: c.downloadMenuLink,
6353
- action: () => Z(b(), te())
6424
+ action: () => Q(b(), te())
6354
6425
  }]), re = n(() => !!c.menu);
6355
6426
  return (n, s) => (g(), a("div", { class: f(["TableOuter", {
6356
6427
  "full-width": t.fullWidth,
6357
6428
  "has-menu": re.value
6358
- }]) }, [re.value ? (g(), r(se, {
6429
+ }]) }, [re.value ? (g(), r(ce, {
6359
6430
  key: 0,
6360
6431
  items: x.value,
6361
6432
  "force-dropdown": ""
@@ -6377,4 +6448,4 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
6377
6448
  }
6378
6449
  }), [["__scopeId", "data-v-d5c290dc"]]);
6379
6450
  //#endregion
6380
- export { bt as BarChart, Lt as ChartTooltip, It as ChoroplethMap, zt as DataTable, $e as LineChart };
6451
+ export { bt as BarChart, Lt as ChartTooltip, It as ChoroplethMap, zt as DataTable, et as LineChart, xt as fipsToHsa, St as hsaNames };