@cfasim-ui/charts 0.4.14 → 0.4.16

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
@@ -7,7 +7,7 @@ import { select as le } from "d3-selection";
7
7
  import "d3-transition";
8
8
  import { feature as P, merge as ue, mesh as de } from "topojson-client";
9
9
  //#region src/ChartMenu/ChartMenu.vue?vue&type=script&setup=true&lang.ts
10
- var F = { class: "chart-menu-trigger-area" }, fe = ["aria-label"], pe = /* @__PURE__ */ l({
10
+ var F = { class: "chart-menu-trigger-area" }, I = ["aria-label"], fe = /* @__PURE__ */ l({
11
11
  __name: "ChartMenu",
12
12
  props: {
13
13
  items: {},
@@ -85,44 +85,44 @@ var F = { class: "chart-menu-trigger-area" }, fe = ["aria-label"], pe = /* @__PU
85
85
  "stroke-linecap": "round",
86
86
  "stroke-linejoin": "round",
87
87
  "aria-hidden": "true"
88
- }, [o("path", { d: "M7 1v8M3 6l4 4 4-4M2 13h10" })], -1)]], 8, fe))]));
88
+ }, [o("path", { d: "M7 1v8M3 6l4 4 4-4M2 13h10" })], -1)]], 8, I))]));
89
89
  }
90
- }), I = (e, t) => {
90
+ }), L = (e, t) => {
91
91
  let n = e.__vccOpts || e;
92
92
  for (let [e, r] of t) n[e] = r;
93
93
  return n;
94
- }, me = /* @__PURE__ */ I(pe, [["__scopeId", "data-v-c74e2889"]]);
94
+ }, pe = /* @__PURE__ */ L(fe, [["__scopeId", "data-v-c74e2889"]]);
95
95
  //#endregion
96
96
  //#region src/_shared/axes.ts
97
- function L(e) {
97
+ function R(e) {
98
98
  return Math.round(e) + .5;
99
99
  }
100
- function he(e, t) {
100
+ function me(e, t) {
101
101
  let n = e / t, r = 10 ** Math.floor(Math.log10(n)), i = n / r, a;
102
102
  return a = i <= 1.5 ? 1 : i <= 3 ? 2 : i <= 7 ? 5 : 10, a * r;
103
103
  }
104
- function ge(e, t, n) {
104
+ function he(e, t, n) {
105
105
  if (!(n > 0) || !isFinite(n)) return [];
106
106
  let r = [], i = Math.ceil(e / n) * n;
107
107
  for (let e = 0, a = i; a <= t + 1e-9 && e < 1e3; e++, a = i + e * n) r.push(a);
108
108
  return r;
109
109
  }
110
- var _e = new Intl.NumberFormat();
111
- function ve(e) {
112
- return Math.abs(e) >= 1e3 ? _e.format(e) : Number.isInteger(e) ? e.toString() : e.toFixed(1);
110
+ var ge = new Intl.NumberFormat();
111
+ function _e(e) {
112
+ return Math.abs(e) >= 1e3 ? ge.format(e) : Number.isInteger(e) ? e.toString() : e.toFixed(1);
113
113
  }
114
114
  //#endregion
115
115
  //#region src/_shared/computeTicks.ts
116
- function ye(e) {
116
+ function ve(e) {
117
117
  let { min: t, max: n, ticks: r } = e;
118
118
  if (t === n) return [];
119
119
  let i = e.displayOffset ?? 0;
120
120
  if (Array.isArray(r)) return r.map((e) => e - i).filter((e) => e >= t && e <= n);
121
- if (typeof r == "number") return ge(t + i, n + i, r).map((e) => e - i);
122
- let a = Math.max(3, Math.floor(e.targetTickCount ?? 3)), o = he(n - t, a);
123
- return ge(t + i, n + i, o).map((e) => e - i);
121
+ if (typeof r == "number") return he(t + i, n + i, r).map((e) => e - i);
122
+ let a = Math.max(3, Math.floor(e.targetTickCount ?? 3)), o = me(n - t, a);
123
+ return he(t + i, n + i, o).map((e) => e - i);
124
124
  }
125
- function be(e, t, n, r) {
125
+ function ye(e, t, n, r) {
126
126
  if (r === "log") {
127
127
  let r = Math.log10(t), i = Math.log10(n) - r || 1;
128
128
  return (Math.log10(e > 0 ? e : t) - r) / i;
@@ -130,7 +130,7 @@ function be(e, t, n, r) {
130
130
  let i = n - t || 1;
131
131
  return (e - t) / i;
132
132
  }
133
- function xe(e, t, n, r) {
133
+ function be(e, t, n, r) {
134
134
  if (n !== "log") return {
135
135
  min: e,
136
136
  max: t
@@ -141,7 +141,7 @@ function xe(e, t, n, r) {
141
141
  max: t > 0 ? Math.max(t, i) : i
142
142
  };
143
143
  }
144
- function R(e) {
144
+ function z(e) {
145
145
  let { min: t, max: n, ticks: r } = e;
146
146
  if (!(t > 0) || !(n > 0) || t === n) return [];
147
147
  if (Array.isArray(r)) return r.filter((e) => e > 0 && e >= t && e <= n);
@@ -154,7 +154,7 @@ function R(e) {
154
154
  }
155
155
  //#endregion
156
156
  //#region src/_shared/useChartSize.ts
157
- function Se(e = {}) {
157
+ function xe(e = {}) {
158
158
  let t = v(null), n = v(0), r = v(0), i = null, a = null;
159
159
  return h(() => {
160
160
  t.value && (n.value = t.value.clientWidth, r.value = t.value.clientHeight, i = new ResizeObserver((t) => {
@@ -173,8 +173,8 @@ function Se(e = {}) {
173
173
  measuredHeight: r
174
174
  };
175
175
  }
176
- var Ce = .6, we = 8;
177
- function z(e, t) {
176
+ var Se = .6, B = 8;
177
+ function V(e, t) {
178
178
  return {
179
179
  fontSize: e?.fontSize ?? t.fontSize,
180
180
  fill: e?.color ?? "currentColor",
@@ -182,8 +182,8 @@ function z(e, t) {
182
182
  fillOpacity: e?.color == null ? t.fillOpacity : void 0
183
183
  };
184
184
  }
185
- var B = 7, Te = 18, Ee = 16;
186
- function V(e) {
185
+ var Ce = 7, we = 18, Te = 16;
186
+ function Ee(e) {
187
187
  return e == null ? {
188
188
  top: 0,
189
189
  right: 0,
@@ -201,12 +201,12 @@ function V(e) {
201
201
  left: e.left ?? 0
202
202
  };
203
203
  }
204
- function H(e) {
205
- return Te + e.length * B;
206
- }
207
204
  function De(e) {
205
+ return we + e.length * Ce;
206
+ }
207
+ function Oe(e) {
208
208
  let t = n(() => {
209
- let t = V(e.extraPadding?.());
209
+ let t = Ee(e.extraPadding?.());
210
210
  return {
211
211
  left: (e.yLabel() ? 56 : 50) + t.left,
212
212
  right: 10 + t.right
@@ -219,11 +219,11 @@ function De(e) {
219
219
  };
220
220
  let n = Math.max(0, r.value), i = [], a = 0, o = 0;
221
221
  for (let e of t) {
222
- let t = H(e);
222
+ let t = De(e);
223
223
  o > 0 && o + t > n && (a++, o = 0), i.push({
224
224
  x: o,
225
225
  row: a
226
- }), o += t + Ee;
226
+ }), o += t + Te;
227
227
  }
228
228
  return {
229
229
  positions: i,
@@ -233,9 +233,9 @@ function De(e) {
233
233
  let t = e.title();
234
234
  if (!t) return 10;
235
235
  let n = e.titleStyle?.()?.lineHeight ?? 18;
236
- return t.split("\n").length * n + we;
236
+ return t.split("\n").length * n + B;
237
237
  }), o = n(() => {
238
- let n = V(e.extraPadding?.()), r = i.value.rowCount;
238
+ let n = Ee(e.extraPadding?.()), r = i.value.rowCount;
239
239
  return {
240
240
  top: a.value + r * 20 + n.top,
241
241
  bottom: (e.xLabel() ? 38 : 30) + n.bottom,
@@ -264,10 +264,10 @@ function De(e) {
264
264
  }
265
265
  //#endregion
266
266
  //#region src/tooltip-position.ts
267
- var Oe = 16, ke = 8;
267
+ var H = 16, ke = 8;
268
268
  function Ae(e, t, n, r, i, a) {
269
269
  if (i === "none") return {
270
- left: e + Oe,
270
+ left: e + H,
271
271
  top: t
272
272
  };
273
273
  let o = i === "chart" && a ? {
@@ -280,7 +280,7 @@ function Ae(e, t, n, r, i, a) {
280
280
  right: window.innerWidth,
281
281
  top: 0,
282
282
  bottom: window.innerHeight
283
- }, s = e + Oe + n > o.right - ke ? e - Oe - n : e + Oe, c = r / 2;
283
+ }, s = e + H + n > o.right - ke ? e - H - n : e + H, c = r / 2;
284
284
  return {
285
285
  left: s,
286
286
  top: Math.min(Math.max(t, o.top + ke + c), o.bottom - ke - c)
@@ -288,7 +288,7 @@ function Ae(e, t, n, r, i, a) {
288
288
  }
289
289
  //#endregion
290
290
  //#region src/_shared/useChartTooltip.ts
291
- function je(e) {
291
+ function U(e) {
292
292
  let t = e.touchYOffset ?? 50, n = v(null), r = v(!1), i = v(null), a = v(null), o = v(null);
293
293
  function s(e) {
294
294
  return "touches" in e ? e.touches[0] ?? null : e;
@@ -355,64 +355,64 @@ function je(e) {
355
355
  }
356
356
  //#endregion
357
357
  //#region src/ChartMenu/download.ts
358
- function Me(e, t) {
358
+ function W(e, t) {
359
359
  let n = URL.createObjectURL(e), r = document.createElement("a");
360
360
  r.href = n, r.download = t, r.click(), URL.revokeObjectURL(n);
361
361
  }
362
- var U = [
362
+ var G = [
363
363
  "color",
364
364
  "font-family",
365
365
  "font-size",
366
366
  "font-weight"
367
- ], Ne = ["fill", "stroke"];
368
- function Pe(e) {
367
+ ], je = ["fill", "stroke"];
368
+ function Me(e) {
369
369
  let t = e.match(/^\s*var\(\s*(--[\w-]+)\s*(?:,\s*([^)]*?)\s*)?\)\s*$/);
370
370
  if (!t) return e;
371
371
  let [, n, r] = t;
372
372
  return window.getComputedStyle(document.documentElement).getPropertyValue(n).trim() || (r ? r.trim() : e);
373
373
  }
374
- function W(e) {
374
+ function K(e) {
375
375
  let t = e.cloneNode(!0);
376
376
  t.setAttribute("xmlns", "http://www.w3.org/2000/svg");
377
377
  let n = window.getComputedStyle(e), r = [];
378
- for (let e of U) {
378
+ for (let e of G) {
379
379
  let t = n.getPropertyValue(e);
380
380
  t && r.push(`${e}: ${t}`);
381
381
  }
382
382
  let i = t.getAttribute("style") ?? "";
383
383
  t.setAttribute("style", [i, ...r].filter(Boolean).join("; "));
384
- for (let e of t.querySelectorAll("*")) for (let t of Ne) {
384
+ for (let e of t.querySelectorAll("*")) for (let t of je) {
385
385
  let n = e.getAttribute(t);
386
- !n || !n.includes("var(") || e.setAttribute(t, Pe(n));
386
+ !n || !n.includes("var(") || e.setAttribute(t, Me(n));
387
387
  }
388
388
  return t;
389
389
  }
390
- function G(e, t) {
391
- let n = W(e), r = new XMLSerializer().serializeToString(n);
392
- Me(new Blob([r], { type: "image/svg+xml" }), `${t}.svg`);
390
+ function q(e, t) {
391
+ let n = K(e), r = new XMLSerializer().serializeToString(n);
392
+ W(new Blob([r], { type: "image/svg+xml" }), `${t}.svg`);
393
393
  }
394
- function K(e, t) {
395
- let n = W(e), 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;
394
+ function Ne(e, t) {
395
+ let n = K(e), 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;
396
396
  o.onload = () => {
397
397
  let e = document.createElement("canvas");
398
398
  e.width = s * 2, e.height = c * 2;
399
399
  let n = e.getContext("2d");
400
400
  n.scale(2, 2), n.drawImage(o, 0, 0, s, c), e.toBlob((e) => {
401
- e && Me(e, `${t}.png`);
401
+ e && W(e, `${t}.png`);
402
402
  }), URL.revokeObjectURL(a);
403
403
  }, o.src = a;
404
404
  }
405
- function q(e, t) {
406
- Me(new Blob([e], { type: "text/csv" }), `${t}.csv`);
405
+ function J(e, t) {
406
+ W(new Blob([e], { type: "text/csv" }), `${t}.csv`);
407
407
  }
408
408
  //#endregion
409
409
  //#region src/_shared/useChartFullscreen.ts
410
- var J = 0, Fe = "";
410
+ var Pe = 0, Fe = "";
411
411
  function Ie() {
412
- typeof document > "u" || (J === 0 && (Fe = document.body.style.overflow, document.body.style.overflow = "hidden"), J++);
412
+ typeof document > "u" || (Pe === 0 && (Fe = document.body.style.overflow, document.body.style.overflow = "hidden"), Pe++);
413
413
  }
414
414
  function Le() {
415
- typeof document > "u" || J !== 0 && (J--, J === 0 && (document.body.style.overflow = Fe));
415
+ typeof document > "u" || Pe !== 0 && (Pe--, Pe === 0 && (document.body.style.overflow = Fe));
416
416
  }
417
417
  function Re() {
418
418
  let e = v(!1), t = !1;
@@ -459,38 +459,49 @@ function ze(e) {
459
459
  let n = e.legacyMenuLabel();
460
460
  return typeof n == "string" ? n : "chart";
461
461
  }
462
- let i = e.fullscreen ? Re() : null;
462
+ let i = e.fullscreen ? Re() : null, a = n(() => {
463
+ let n = r(), a = [];
464
+ i && a.push(i.menuItem.value), a.push({
465
+ label: "Save as SVG",
466
+ action: () => {
467
+ t.value && q(t.value, n);
468
+ }
469
+ }, {
470
+ label: "Save as PNG",
471
+ action: () => {
472
+ t.value && Ne(t.value, n);
473
+ }
474
+ });
475
+ let o = e.downloadButton?.();
476
+ return !e.downloadLink() && !o && a.push({
477
+ label: "Download CSV",
478
+ action: () => J(e.getCsv(), n)
479
+ }), a;
480
+ }), o = n(() => {
481
+ if (e.downloadButton?.()) return null;
482
+ let t = e.downloadLink();
483
+ return t ? typeof t == "string" ? t : "Download data (CSV)" : null;
484
+ }), s = n(() => e.downloadButton?.() || !e.downloadLink() ? null : `data:text/csv;charset=utf-8,${encodeURIComponent(e.getCsv())}`), c = n(() => {
485
+ let t = e.downloadButton?.();
486
+ return t ? typeof t == "string" ? t : "Download data (CSV)" : null;
487
+ });
488
+ function l() {
489
+ J(e.getCsv(), r());
490
+ }
463
491
  return {
464
492
  svgRef: t,
465
- items: n(() => {
466
- let n = r(), a = [];
467
- return i && a.push(i.menuItem.value), a.push({
468
- label: "Save as SVG",
469
- action: () => {
470
- t.value && G(t.value, n);
471
- }
472
- }, {
473
- label: "Save as PNG",
474
- action: () => {
475
- t.value && K(t.value, n);
476
- }
477
- }), e.downloadLink() || a.push({
478
- label: "Download CSV",
479
- action: () => q(e.getCsv(), n)
480
- }), a;
481
- }),
482
- downloadLinkText: n(() => {
483
- let t = e.downloadLink();
484
- return t ? typeof t == "string" ? t : "Download data (CSV)" : null;
485
- }),
486
- csvHref: n(() => e.downloadLink() ? `data:text/csv;charset=utf-8,${encodeURIComponent(e.getCsv())}` : null),
493
+ items: a,
494
+ downloadLinkText: o,
495
+ csvHref: s,
496
+ downloadButtonText: c,
497
+ triggerCsvDownload: l,
487
498
  resolvedFilename: r,
488
499
  isFullscreen: i?.isFullscreen ?? v(!1)
489
500
  };
490
501
  }
491
502
  //#endregion
492
503
  //#region src/_shared/seriesCsv.ts
493
- function Be(e) {
504
+ function Y(e) {
494
505
  if (e.length === 0) return "";
495
506
  let t = 0;
496
507
  for (let n of e) n.data.length > t && (t = n.data.length);
@@ -502,43 +513,43 @@ function Be(e) {
502
513
  }
503
514
  return i.join("\n");
504
515
  }
505
- function Ve(e, t, n = "category") {
516
+ function Be(e, t, n = "category") {
506
517
  if (t.length === 0 || e.length === 0) return "";
507
518
  let r = [(t.length === 1 ? [n, t[0].label || "value"] : [n, ...t.map((e, t) => e.label || `series_${t}`)]).join(",")];
508
519
  for (let n = 0; n < e.length; n++) {
509
- let i = [He(e[n])];
520
+ let i = [Ve(e[n])];
510
521
  for (let e of t) i.push(n < e.data.length ? String(e.data[n]) : "");
511
522
  r.push(i.join(","));
512
523
  }
513
524
  return r.join("\n");
514
525
  }
515
- function He(e) {
526
+ function Ve(e) {
516
527
  return e.includes(",") || e.includes("\"") || e.includes("\n") ? `"${e.replace(/"/g, "\"\"")}"` : e;
517
528
  }
518
529
  //#endregion
519
530
  //#region src/_shared/ChartAnnotations.vue?vue&type=script&setup=true&lang.ts
520
- var Ue = {
531
+ var X = {
521
532
  class: "chart-annotations",
522
533
  "pointer-events": "none"
523
- }, We = ["stroke", "stroke-width"], Ge = [
534
+ }, He = ["stroke", "stroke-width"], Ue = [
524
535
  "d",
525
536
  "stroke",
526
537
  "stroke-width"
527
- ], Y = [
538
+ ], Z = [
528
539
  "fill",
529
540
  "stroke",
530
541
  "stroke-width",
531
542
  "transform"
532
- ], Ke = [
543
+ ], We = [
533
544
  "stroke",
534
545
  "stroke-width",
535
546
  "stroke-dasharray"
536
- ], qe = [
547
+ ], Ge = [
537
548
  "d",
538
549
  "stroke",
539
550
  "stroke-width",
540
551
  "stroke-dasharray"
541
- ], Je = ["fill", "transform"], Ye = [
552
+ ], Ke = ["fill", "transform"], qe = [
542
553
  "x",
543
554
  "y",
544
555
  "text-anchor",
@@ -547,7 +558,7 @@ var Ue = {
547
558
  "fill",
548
559
  "stroke",
549
560
  "stroke-width"
550
- ], Xe = ["x", "dy"], Ze = ["font-weight", "font-style"], Qe = 13, $e = "normal", et = 700, tt = "var(--color-bg-0, #fff)", nt = 3, rt = 1, it = 4, at = 6, ot = 1.2, st = .35, ct = /* @__PURE__ */ l({
561
+ ], Je = ["x", "dy"], Ye = ["font-weight", "font-style"], Xe = 13, Ze = "normal", Qe = 700, $e = "var(--color-bg-0, #fff)", et = 3, tt = 1, nt = 4, rt = 6, it = 1.2, at = .35, ot = /* @__PURE__ */ l({
551
562
  __name: "ChartAnnotations",
552
563
  props: {
553
564
  annotations: { default: () => [] },
@@ -584,7 +595,7 @@ var Ue = {
584
595
  if (!n || !isFinite(n.x) || !isFinite(n.y)) continue;
585
596
  let i = t.pointer ?? "curved", a = i.startsWith("rule");
586
597
  if (a && !r.bounds) continue;
587
- let { x: o, y: l } = t.offset, d = n.x + o, p = n.y + l, m = t.color ?? "currentColor", h = t.fontSize ?? Qe, g = t.fontWeight ?? $e, _ = t.outlineColor ?? tt, v = t.outlineWidth ?? nt, y = t.lineColor ?? m, ee = t.lineWidth ?? rt, b = s(t.lineDash), te = {
598
+ let { x: o, y: l } = t.offset, d = n.x + o, p = n.y + l, m = t.color ?? "currentColor", h = t.fontSize ?? Xe, g = t.fontWeight ?? Ze, _ = t.outlineColor ?? $e, v = t.outlineWidth ?? et, y = t.lineColor ?? m, ee = t.lineWidth ?? tt, b = s(t.lineDash), te = {
588
599
  left: "start",
589
600
  center: "middle",
590
601
  right: "end"
@@ -599,7 +610,7 @@ var Ue = {
599
610
  textX: d,
600
611
  textY: p,
601
612
  textAnchor: te,
602
- dy: h * ot,
613
+ dy: h * it,
603
614
  fontSize: h,
604
615
  fontWeight: g,
605
616
  color: m,
@@ -665,11 +676,11 @@ var Ue = {
665
676
  }
666
677
  function f(e, t, n, r, i, a) {
667
678
  if (a === "none") return { path: "" };
668
- let o = n - e, s = r - t, c = r - i * st;
679
+ let o = n - e, s = r - t, c = r - i * at;
669
680
  if (o === 0 || s === 0 || a === "straight") {
670
681
  let i = s === 0 ? r : c, a = n - e, o = i - t, l = Math.hypot(a, o);
671
- if (l <= it + at) return { path: "" };
672
- let u = a / l, d = o / l, f = e + u * it, p = t + d * it, m = n - u * at, h = i - d * at, g = Math.atan2(-d, -u) * 180 / Math.PI;
682
+ if (l <= nt + rt) return { path: "" };
683
+ let u = a / l, d = o / l, f = e + u * nt, p = t + d * nt, m = n - u * rt, h = i - d * rt, g = Math.atan2(-d, -u) * 180 / Math.PI;
673
684
  return {
674
685
  path: `M${f},${p} L${m},${h}`,
675
686
  arrow: {
@@ -680,8 +691,8 @@ var Ue = {
680
691
  };
681
692
  }
682
693
  let l = c - t;
683
- if (Math.abs(l) <= it || Math.abs(o) <= at) return { path: "" };
684
- let u = Math.sign(o), d = Math.sign(l), f = e, p = t + d * it, m = n - u * at, h = c, g = d > 0 ? -90 : 90;
694
+ if (Math.abs(l) <= nt || Math.abs(o) <= rt) return { path: "" };
695
+ let u = Math.sign(o), d = Math.sign(l), f = e, p = t + d * nt, m = n - u * rt, h = c, g = d > 0 ? -90 : 90;
685
696
  return {
686
697
  path: `M${f},${p} Q${f},${c} ${m},${h}`,
687
698
  arrow: {
@@ -691,7 +702,7 @@ var Ue = {
691
702
  }
692
703
  };
693
704
  }
694
- return (t, n) => (_(), a("g", Ue, [(_(!0), a(e, null, y(l.value, (t, n) => (_(), a(e, { key: n }, [
705
+ return (t, n) => (_(), a("g", X, [(_(!0), a(e, null, y(l.value, (t, n) => (_(), a(e, { key: n }, [
695
706
  t.rule && t.outlineWidth > 0 ? (_(), a("line", d({
696
707
  key: 0,
697
708
  ref_for: !0
@@ -700,7 +711,7 @@ var Ue = {
700
711
  stroke: t.outlineColor,
701
712
  "stroke-width": t.lineWidth + t.outlineWidth,
702
713
  "stroke-linecap": "round"
703
- }), null, 16, We)) : i("", !0),
714
+ }), null, 16, He)) : i("", !0),
704
715
  t.pointerPath && t.outlineWidth > 0 ? (_(), a("path", {
705
716
  key: 1,
706
717
  d: t.pointerPath,
@@ -709,7 +720,7 @@ var Ue = {
709
720
  stroke: t.outlineColor,
710
721
  "stroke-width": t.lineWidth + t.outlineWidth,
711
722
  "stroke-linecap": "round"
712
- }, null, 8, Ge)) : i("", !0),
723
+ }, null, 8, Ue)) : i("", !0),
713
724
  t.arrowTip && t.outlineWidth > 0 ? (_(), a("polygon", {
714
725
  key: 2,
715
726
  points: "0,0 -6,-3 -6,3",
@@ -719,7 +730,7 @@ var Ue = {
719
730
  "stroke-width": t.outlineWidth,
720
731
  "stroke-linejoin": "round",
721
732
  transform: t.arrowTransform
722
- }, null, 8, Y)) : i("", !0),
733
+ }, null, 8, Z)) : i("", !0),
723
734
  t.rule ? (_(), a("line", d({
724
735
  key: 3,
725
736
  ref_for: !0
@@ -728,7 +739,7 @@ var Ue = {
728
739
  "stroke-width": t.lineWidth,
729
740
  "stroke-dasharray": t.lineDash,
730
741
  "stroke-linecap": "round"
731
- }), null, 16, Ke)) : i("", !0),
742
+ }), null, 16, We)) : i("", !0),
732
743
  t.pointerPath ? (_(), a("path", {
733
744
  key: 4,
734
745
  d: t.pointerPath,
@@ -737,13 +748,13 @@ var Ue = {
737
748
  "stroke-width": t.lineWidth,
738
749
  "stroke-dasharray": t.lineDash,
739
750
  "stroke-linecap": "round"
740
- }, null, 8, qe)) : i("", !0),
751
+ }, null, 8, Ge)) : i("", !0),
741
752
  t.arrowTip ? (_(), a("polygon", {
742
753
  key: 5,
743
754
  points: "0,0 -6,-3 -6,3",
744
755
  fill: t.lineColor,
745
756
  transform: t.arrowTransform
746
- }, null, 8, Je)) : i("", !0),
757
+ }, null, 8, Ke)) : i("", !0),
747
758
  o("text", {
748
759
  x: t.textX,
749
760
  y: t.textY,
@@ -761,35 +772,36 @@ var Ue = {
761
772
  dy: r === 0 ? 0 : t.dy
762
773
  }, [(_(!0), a(e, null, y(n, (e, t) => (_(), a("tspan", {
763
774
  key: t,
764
- "font-weight": e.bold ? et : void 0,
775
+ "font-weight": e.bold ? Qe : void 0,
765
776
  "font-style": e.italic ? "italic" : void 0
766
- }, b(e.text), 9, Ze))), 128))], 8, Xe))), 128))], 8, Ye)
777
+ }, b(e.text), 9, Ye))), 128))], 8, Je))), 128))], 8, qe)
767
778
  ], 64))), 128))]));
768
779
  }
769
- }), lt = 400, ut = 200;
770
- function dt(e) {
771
- let { containerRef: t, measuredWidth: r, measuredHeight: i } = Se({ debounce: e.debounce }), { svgRef: a, items: o, downloadLinkText: s, csvHref: c, resolvedFilename: l, isFullscreen: u } = ze({
780
+ }), st = 400, ct = 200;
781
+ function lt(e) {
782
+ let { containerRef: t, measuredWidth: r, measuredHeight: i } = xe({ debounce: e.debounce }), { svgRef: a, items: o, downloadLinkText: s, csvHref: c, downloadButtonText: l, triggerCsvDownload: u, resolvedFilename: d, isFullscreen: f } = ze({
772
783
  filename: e.filename,
773
784
  legacyMenuLabel: e.menu,
774
785
  getCsv: e.getCsv,
775
786
  downloadLink: e.downloadLink,
787
+ downloadButton: e.downloadButton,
776
788
  fullscreen: !0
777
- }), d = n(() => u.value && r.value > 0 ? r.value : e.width() ?? (r.value || lt)), f = n(() => {
778
- if (u.value && i.value > 0) {
789
+ }), p = n(() => f.value && r.value > 0 ? r.value : e.width() ?? (r.value || st)), m = n(() => {
790
+ if (f.value && i.value > 0) {
779
791
  let t = e.extraBelowHeight?.() ?? 0;
780
792
  return i.value - t;
781
793
  }
782
- return e.height() ?? ut;
783
- }), { padding: p, legendY: m, inlineLegendLayout: h, innerW: g, innerH: _, bounds: v } = De({
794
+ return e.height() ?? ct;
795
+ }), { padding: h, legendY: g, inlineLegendLayout: _, innerW: v, innerH: y, bounds: ee } = Oe({
784
796
  title: e.title,
785
797
  titleStyle: e.titleStyle,
786
798
  xLabel: e.xLabel,
787
799
  yLabel: e.yLabel,
788
800
  inlineLegendLabels: e.inlineLegendLabels,
789
- width: () => d.value,
790
- height: () => f.value,
801
+ width: () => p.value,
802
+ height: () => m.value,
791
803
  extraPadding: e.chartPadding
792
- }), { hoverIndex: y, tooltipRef: ee, tooltipPos: b, handlers: te } = je({
804
+ }), { hoverIndex: b, tooltipRef: te, tooltipPos: x, handlers: S } = U({
793
805
  enabled: e.hasTooltipSlot,
794
806
  trigger: e.tooltipTrigger,
795
807
  clamp: () => e.tooltipClamp() ?? "chart",
@@ -800,96 +812,98 @@ function dt(e) {
800
812
  return {
801
813
  containerRef: t,
802
814
  svgRef: a,
803
- width: d,
804
- height: f,
805
- padding: p,
806
- legendY: m,
807
- inlineLegendLayout: h,
808
- innerW: g,
809
- innerH: _,
810
- bounds: v,
811
- hoverIndex: y,
812
- tooltipRef: ee,
813
- tooltipPos: b,
814
- tooltipHandlers: te,
815
+ width: p,
816
+ height: m,
817
+ padding: h,
818
+ legendY: g,
819
+ inlineLegendLayout: _,
820
+ innerW: v,
821
+ innerH: y,
822
+ bounds: ee,
823
+ hoverIndex: b,
824
+ tooltipRef: te,
825
+ tooltipPos: x,
826
+ tooltipHandlers: S,
815
827
  menuItems: o,
816
828
  downloadLinkText: s,
817
829
  csvHref: c,
818
- menuFilename: l,
819
- isFullscreen: u,
830
+ downloadButtonText: l,
831
+ triggerCsvDownload: u,
832
+ menuFilename: d,
833
+ isFullscreen: f,
820
834
  measuredHeight: i
821
835
  };
822
836
  }
823
- function ft(e, t) {
837
+ function ut(e, t) {
824
838
  return (n) => {
825
839
  let r = e();
826
840
  if (r !== void 0) return ne(n, r);
827
841
  let i = t();
828
- return i === void 0 ? ve(n) : ne(n, i);
842
+ return i === void 0 ? _e(n) : ne(n, i);
829
843
  };
830
844
  }
831
845
  //#endregion
832
846
  //#region src/_shared/dateAxis.ts
833
- var pt = /^(\d{4})-(\d{2})-(\d{2})$/, mt = /^(\d{4})-(\d{2})-(\d{2})[Tt ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(Z|[+-]\d{2}:?\d{2})?$/, X = 1e3, Z = 60 * X, Q = 60 * Z, ht = 24 * Q, gt = 7 * ht, _t = 30 * ht, vt = 365 * ht, yt = [
847
+ var dt = /^(\d{4})-(\d{2})-(\d{2})$/, ft = /^(\d{4})-(\d{2})-(\d{2})[Tt ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(Z|[+-]\d{2}:?\d{2})?$/, Q = 1e3, pt = 60 * Q, mt = 60 * pt, ht = 24 * mt, gt = 7 * ht, _t = 30 * ht, vt = 365 * ht, yt = [
834
848
  {
835
849
  unit: "second",
836
850
  step: 1,
837
- ms: 1 * X
851
+ ms: 1 * Q
838
852
  },
839
853
  {
840
854
  unit: "second",
841
855
  step: 5,
842
- ms: 5 * X
856
+ ms: 5 * Q
843
857
  },
844
858
  {
845
859
  unit: "second",
846
860
  step: 15,
847
- ms: 15 * X
861
+ ms: 15 * Q
848
862
  },
849
863
  {
850
864
  unit: "second",
851
865
  step: 30,
852
- ms: 30 * X
866
+ ms: 30 * Q
853
867
  },
854
868
  {
855
869
  unit: "minute",
856
870
  step: 1,
857
- ms: 1 * Z
871
+ ms: 1 * pt
858
872
  },
859
873
  {
860
874
  unit: "minute",
861
875
  step: 5,
862
- ms: 5 * Z
876
+ ms: 5 * pt
863
877
  },
864
878
  {
865
879
  unit: "minute",
866
880
  step: 15,
867
- ms: 15 * Z
881
+ ms: 15 * pt
868
882
  },
869
883
  {
870
884
  unit: "minute",
871
885
  step: 30,
872
- ms: 30 * Z
886
+ ms: 30 * pt
873
887
  },
874
888
  {
875
889
  unit: "hour",
876
890
  step: 1,
877
- ms: 1 * Q
891
+ ms: 1 * mt
878
892
  },
879
893
  {
880
894
  unit: "hour",
881
895
  step: 3,
882
- ms: 3 * Q
896
+ ms: 3 * mt
883
897
  },
884
898
  {
885
899
  unit: "hour",
886
900
  step: 6,
887
- ms: 6 * Q
901
+ ms: 6 * mt
888
902
  },
889
903
  {
890
904
  unit: "hour",
891
905
  step: 12,
892
- ms: 12 * Q
906
+ ms: 12 * mt
893
907
  },
894
908
  {
895
909
  unit: "day",
@@ -963,17 +977,17 @@ function xt(e, t) {
963
977
  return Number.isFinite(t) ? t : null;
964
978
  }
965
979
  if (typeof e != "string") return null;
966
- let n = pt.exec(e);
980
+ let n = dt.exec(e);
967
981
  if (n) {
968
982
  let e = +n[1], r = n[2] - 1, i = +n[3];
969
983
  return t === "utc" ? Date.UTC(e, r, i) : new Date(e, r, i).getTime();
970
984
  }
971
- let r = mt.exec(e);
985
+ let r = ft.exec(e);
972
986
  if (r) {
973
987
  let e = +r[1], n = r[2] - 1, i = +r[3], a = +r[4], o = +r[5], s = r[6] ? +r[6] : 0, c = r[7] ? Number("0." + r[7]) * 1e3 : 0, l = r[8];
974
988
  if (l) {
975
989
  if (l === "Z" || l === "z") return Date.UTC(e, n, i, a, o, s, c);
976
- let t = l[0] === "+" ? 1 : -1, r = +l.slice(1, 3), u = +l.slice(-2), d = t * (r * 60 + u) * Z;
990
+ let t = l[0] === "+" ? 1 : -1, r = +l.slice(1, 3), u = +l.slice(-2), d = t * (r * 60 + u) * pt;
977
991
  return Date.UTC(e, n, i, a, o, s, c) - d;
978
992
  }
979
993
  return t === "utc" ? Date.UTC(e, n, i, a, o, s, c) : new Date(e, n, i, a, o, s, c).getTime();
@@ -981,7 +995,7 @@ function xt(e, t) {
981
995
  return null;
982
996
  }
983
997
  function St(e) {
984
- return e instanceof Date ? Number.isFinite(e.getTime()) : typeof e == "string" ? pt.test(e) || mt.test(e) : !1;
998
+ return e instanceof Date ? Number.isFinite(e.getTime()) : typeof e == "string" ? dt.test(e) || ft.test(e) : !1;
985
999
  }
986
1000
  function Ct(e, t) {
987
1001
  if (e.length === 0) return !1;
@@ -999,9 +1013,9 @@ function wt(e, t) {
999
1013
  function Tt(e, t, n) {
1000
1014
  let r = new Date(e);
1001
1015
  if (n === "utc") switch (t) {
1002
- case "second": return Math.floor(e / X) * X;
1003
- case "minute": return Math.floor(e / Z) * Z;
1004
- case "hour": return Math.floor(e / Q) * Q;
1016
+ case "second": return Math.floor(e / Q) * Q;
1017
+ case "minute": return Math.floor(e / pt) * pt;
1018
+ case "hour": return Math.floor(e / mt) * mt;
1005
1019
  case "day": return Date.UTC(r.getUTCFullYear(), r.getUTCMonth(), r.getUTCDate());
1006
1020
  case "week": {
1007
1021
  let e = (r.getUTCDay() + 6) % 7;
@@ -1011,8 +1025,8 @@ function Tt(e, t, n) {
1011
1025
  case "year": return Date.UTC(r.getUTCFullYear(), 0, 1);
1012
1026
  }
1013
1027
  switch (t) {
1014
- case "second": return Math.floor(e / X) * X;
1015
- case "minute": return Math.floor(e / Z) * Z;
1028
+ case "second": return Math.floor(e / Q) * Q;
1029
+ case "minute": return Math.floor(e / pt) * pt;
1016
1030
  case "hour": return new Date(r.getFullYear(), r.getMonth(), r.getDate(), r.getHours()).getTime();
1017
1031
  case "day": return new Date(r.getFullYear(), r.getMonth(), r.getDate()).getTime();
1018
1032
  case "week": {
@@ -1024,9 +1038,9 @@ function Tt(e, t, n) {
1024
1038
  }
1025
1039
  }
1026
1040
  function Et(e, t, n, r) {
1027
- if (t === "second") return e + n * X;
1028
- if (t === "minute") return e + n * Z;
1029
- if (t === "hour" && r === "utc") return e + n * Q;
1041
+ if (t === "second") return e + n * Q;
1042
+ if (t === "minute") return e + n * pt;
1043
+ if (t === "hour" && r === "utc") return e + n * mt;
1030
1044
  if (t === "week" && r === "utc") return e + n * gt;
1031
1045
  let i = new Date(e);
1032
1046
  if (r === "utc") switch (t) {
@@ -1299,7 +1313,7 @@ var Pt = {
1299
1313
  ], pn = { class: "line-chart-tooltip" }, mn = {
1300
1314
  key: 0,
1301
1315
  class: "line-chart-tooltip-label"
1302
- }, hn = ["href", "download"], gn = 36, _n = 12, vn = 7, yn = 16, bn = /* @__PURE__ */ I(/* @__PURE__ */ l({
1316
+ }, hn = ["href", "download"], gn = 36, _n = 12, vn = 7, yn = 16, bn = /* @__PURE__ */ L(/* @__PURE__ */ l({
1303
1317
  __name: "LineChart",
1304
1318
  props: {
1305
1319
  y: {},
@@ -1341,6 +1355,7 @@ var Pt = {
1341
1355
  csv: {},
1342
1356
  filename: {},
1343
1357
  downloadLink: { type: [Boolean, String] },
1358
+ downloadButton: { type: [Boolean, String] },
1344
1359
  annotations: {},
1345
1360
  chartPadding: {}
1346
1361
  },
@@ -1358,7 +1373,7 @@ var Pt = {
1358
1373
  for (let t = 0; t < e.length; t++) r[t] = xt(e[t], n) ?? NaN;
1359
1374
  return r;
1360
1375
  }
1361
- let C = ft(() => l.tooltipValueFormat, () => l.yTickFormat), w = n(() => l.timezone ?? "utc"), T = n(() => {
1376
+ let C = ut(() => l.tooltipValueFormat, () => l.yTickFormat), w = n(() => l.timezone ?? "utc"), T = n(() => {
1362
1377
  let e = w.value, t = !1, n = !1;
1363
1378
  for (let r of v(l)) {
1364
1379
  if (n = !0, !Ct(r, e)) {
@@ -1422,7 +1437,7 @@ var Pt = {
1422
1437
  });
1423
1438
  function M(e) {
1424
1439
  let { min: t, max: n } = ae.value, r = n - t || 1;
1425
- return U.value.left + (e - t) / r * W.value;
1440
+ return G.value.left + (e - t) / r * K.value;
1426
1441
  }
1427
1442
  let oe = n(() => {
1428
1443
  let e = Infinity, t = -Infinity, n = Infinity, r = (r) => {
@@ -1439,7 +1454,7 @@ var Pt = {
1439
1454
  range: 1
1440
1455
  };
1441
1456
  l.yMin != null && l.yMin < e && (e = l.yMin);
1442
- let i = xe(e, t, l.yScaleType, n);
1457
+ let i = be(e, t, l.yScaleType, n);
1443
1458
  return {
1444
1459
  min: i.min,
1445
1460
  max: i.max,
@@ -1448,7 +1463,7 @@ var Pt = {
1448
1463
  });
1449
1464
  function N(e) {
1450
1465
  let { min: t, max: n } = oe.value;
1451
- return U.value.top + G.value - be(e, t, n, l.yScaleType) * G.value;
1466
+ return G.value.top + q.value - ye(e, t, n, l.yScaleType) * q.value;
1452
1467
  }
1453
1468
  function se(e) {
1454
1469
  let t = e.data;
@@ -1496,10 +1511,10 @@ var Pt = {
1496
1511
  return M(r ? A(r, n) : n);
1497
1512
  }
1498
1513
  function ue(e, t = !0) {
1499
- let n = U.value.top + G.value;
1514
+ let n = G.value.top + q.value;
1500
1515
  if (e.seriesIndex == null) {
1501
1516
  let t = P(e, "start"), r = P(e, "end");
1502
- return t > r ? "" : `M${t},${U.value.top}L${r},${U.value.top}L${r},${n}L${t},${n}Z`;
1517
+ return t > r ? "" : `M${t},${G.value.top}L${r},${G.value.top}L${r},${n}L${t},${n}Z`;
1503
1518
  }
1504
1519
  let r = D.value[e.seriesIndex];
1505
1520
  if (!r) return "";
@@ -1515,14 +1530,14 @@ var Pt = {
1515
1530
  labels: [],
1516
1531
  extraHeight: 0
1517
1532
  };
1518
- let t = [], n = U.value.left + W.value;
1533
+ let t = [], n = G.value.left + K.value;
1519
1534
  for (let r of e) {
1520
1535
  if (!r.label && !r.description || r.legend === "inline" || r.legend === !1) continue;
1521
- let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) * vn, o = P(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"), u = z({
1536
+ let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) * vn, o = P(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"), u = V({
1522
1537
  color: l,
1523
1538
  fontWeight: 600,
1524
1539
  ...r.inlineLabelStyle
1525
- }, { fontSize: 11 }), d = z(r.inlineDescriptionStyle, {
1540
+ }, { fontSize: 11 }), d = V(r.inlineDescriptionStyle, {
1526
1541
  fontSize: 11,
1527
1542
  fillOpacity: .6
1528
1543
  });
@@ -1574,38 +1589,38 @@ var Pt = {
1574
1589
  });
1575
1590
  }
1576
1591
  return e;
1577
- }), fe = n(() => F.value.map((e) => e.label)), pe = n(() => Me.value + de.value.extraHeight), I = n(() => U.value.top + G.value + U.value.bottom + _n), he = n(() => {
1578
- let { min: e, max: t } = oe.value, n = (e) => l.yTickFormat === void 0 ? ve(e) : ne(e, l.yTickFormat);
1592
+ }), I = n(() => F.value.map((e) => e.label)), fe = n(() => W.value + de.value.extraHeight), L = n(() => G.value.top + q.value + G.value.bottom + _n), me = n(() => {
1593
+ let { min: e, max: t } = oe.value, n = (e) => l.yTickFormat === void 0 ? _e(e) : ne(e, l.yTickFormat);
1579
1594
  return e === t ? [{
1580
1595
  value: n(e),
1581
- y: L(U.value.top + G.value / 2)
1582
- }] : (l.yScaleType === "log" ? R({
1596
+ y: R(G.value.top + q.value / 2)
1597
+ }] : (l.yScaleType === "log" ? z({
1583
1598
  min: e,
1584
1599
  max: t,
1585
1600
  ticks: l.yTicks
1586
- }) : ye({
1601
+ }) : ve({
1587
1602
  min: e,
1588
1603
  max: t,
1589
1604
  ticks: l.yTicks,
1590
- targetTickCount: G.value / 50
1605
+ targetTickCount: q.value / 50
1591
1606
  })).map((e) => ({
1592
1607
  value: n(e),
1593
- y: L(N(e))
1608
+ y: R(N(e))
1594
1609
  }));
1595
1610
  });
1596
- function ge(e, t, n) {
1611
+ function he(e, t, n) {
1597
1612
  let r = l.xTickFormat;
1598
1613
  if (E.value) return typeof r == "function" ? r(e, t) : Nt(e, r, w.value, n);
1599
1614
  let i = e + j.value;
1600
- return r === void 0 ? !k.value && l.xLabels && Number.isInteger(e) && e >= 0 && e < l.xLabels.length ? l.xLabels[e] : ve(i) : typeof r == "function" ? r(i, t) : ne(i, r);
1615
+ return r === void 0 ? !k.value && l.xLabels && Number.isInteger(e) && e >= 0 && e < l.xLabels.length ? l.xLabels[e] : _e(i) : typeof r == "function" ? r(i, t) : ne(i, r);
1601
1616
  }
1602
- let _e = n(() => {
1617
+ let ge = n(() => {
1603
1618
  let { min: e, max: t } = ae.value;
1604
1619
  if (e === t) return [];
1605
- let n = E.value, r = n ? 0 : j.value, i = re.value, a = W.value / 80, o, s;
1620
+ let n = E.value, r = n ? 0 : j.value, i = re.value, a = K.value / 80, o, s;
1606
1621
  if (n) {
1607
1622
  let n = Dt(e, t, a, w.value);
1608
- s = n.unit, o = ye({
1623
+ s = n.unit, o = ve({
1609
1624
  min: e,
1610
1625
  max: t,
1611
1626
  ticks: n.values
@@ -1614,31 +1629,31 @@ var Pt = {
1614
1629
  let e = Math.max(3, Math.floor(a)), t = Math.max(1, Math.round((i - 1) / e));
1615
1630
  o = [];
1616
1631
  for (let e = 0; e < i; e += t) o.push(e);
1617
- } else o = ye({
1632
+ } else o = ve({
1618
1633
  min: e,
1619
1634
  max: t,
1620
1635
  ticks: l.xTicks,
1621
1636
  targetTickCount: a,
1622
1637
  displayOffset: r
1623
1638
  });
1624
- let c = U.value.left, u = U.value.left + W.value;
1639
+ let c = G.value.left, u = G.value.left + K.value;
1625
1640
  return o.map((e, t) => {
1626
- let n = L(M(e)), r = "middle";
1641
+ let n = R(M(e)), r = "middle";
1627
1642
  return n - c <= 1 ? r = "start" : u - n <= 1 && (r = "end"), {
1628
- value: ge(e, t, s),
1643
+ value: he(e, t, s),
1629
1644
  x: n,
1630
1645
  anchor: r
1631
1646
  };
1632
1647
  });
1633
1648
  });
1634
- function Se() {
1635
- return typeof l.csv == "function" ? l.csv() : typeof l.csv == "string" ? l.csv : Be(D.value);
1649
+ function xe() {
1650
+ return typeof l.csv == "function" ? l.csv() : typeof l.csv == "string" ? l.csv : Y(D.value);
1636
1651
  }
1637
- let we = n(() => !!l.tooltipData || !!l.tooltipTrigger), B = n(() => {
1638
- let e = q.value, t = D.value[0];
1652
+ let B = n(() => !!l.tooltipData || !!l.tooltipTrigger), Ce = n(() => {
1653
+ let e = J.value, t = D.value[0];
1639
1654
  return e === null || !t ? null : A(t, e);
1640
- }), Te = n(() => B.value === null ? 0 : M(B.value));
1641
- function Ee(e, t) {
1655
+ }), we = n(() => Ce.value === null ? 0 : M(Ce.value));
1656
+ function Te(e, t) {
1642
1657
  let n = e.data.length;
1643
1658
  if (n === 0) return null;
1644
1659
  let r = 0, i = Infinity;
@@ -1650,13 +1665,13 @@ var Pt = {
1650
1665
  }
1651
1666
  return i === Infinity ? null : r;
1652
1667
  }
1653
- let V = n(() => {
1654
- let e = B.value;
1668
+ let Ee = n(() => {
1669
+ let e = Ce.value;
1655
1670
  if (e === null) return [];
1656
1671
  let t = [];
1657
1672
  for (let n of D.value) {
1658
1673
  if (n.showInTooltip === !1) continue;
1659
- let r = Ee(n, e);
1674
+ let r = Te(n, e);
1660
1675
  if (r === null) continue;
1661
1676
  let i = n.data[r];
1662
1677
  isFinite(i) && t.push({
@@ -1666,14 +1681,14 @@ var Pt = {
1666
1681
  });
1667
1682
  }
1668
1683
  return t;
1669
- }), H = n(() => {
1670
- let e = q.value, t = B.value;
1684
+ }), De = n(() => {
1685
+ let e = J.value, t = Ce.value;
1671
1686
  if (e === null || t === null) return null;
1672
- let n = ge(t, e), r = D.value, i = [];
1687
+ let n = he(t, e), r = D.value, i = [];
1673
1688
  for (let e = 0; e < r.length; e++) {
1674
1689
  let n = r[e];
1675
1690
  if (n.showInTooltip === !1) continue;
1676
- let a = Ee(n, t);
1691
+ let a = Te(n, t);
1677
1692
  i.push({
1678
1693
  value: a === null ? NaN : Number(n.data[a]),
1679
1694
  color: n.color ?? "currentColor",
@@ -1687,21 +1702,21 @@ var Pt = {
1687
1702
  data: l.tooltipData?.[e] ?? null
1688
1703
  };
1689
1704
  });
1690
- function De(e, t) {
1705
+ function Oe(e, t) {
1691
1706
  return !isFinite(e) || !isFinite(t) ? null : {
1692
1707
  x: M(e - j.value),
1693
1708
  y: N(t)
1694
1709
  };
1695
1710
  }
1696
- function Oe(e) {
1711
+ function H(e) {
1697
1712
  let t = ke.value?.getBoundingClientRect();
1698
1713
  if (!t) return null;
1699
1714
  let n = D.value[0];
1700
1715
  if (!n || n.data.length === 0) return null;
1701
1716
  let { min: r, max: i } = ae.value, a = i - r || 1;
1702
- return Ee(n, r + (e - t.left - U.value.left) / W.value * a);
1717
+ return Te(n, r + (e - t.left - G.value.left) / K.value * a);
1703
1718
  }
1704
- let { containerRef: ke, svgRef: Ae, width: je, height: Me, padding: U, legendY: Ne, inlineLegendLayout: Pe, innerW: W, innerH: G, bounds: K, hoverIndex: q, tooltipRef: J, tooltipPos: Fe, tooltipHandlers: Ie, menuItems: Le, downloadLinkText: Re, csvHref: ze, menuFilename: Ve, isFullscreen: He } = dt({
1719
+ let { containerRef: ke, svgRef: Ae, width: U, height: W, padding: G, legendY: je, inlineLegendLayout: Me, innerW: K, innerH: q, bounds: Ne, hoverIndex: J, tooltipRef: Pe, tooltipPos: Fe, tooltipHandlers: Ie, menuItems: Le, downloadLinkText: Re, csvHref: ze, downloadButtonText: Be, triggerCsvDownload: Ve, menuFilename: X, isFullscreen: He } = lt({
1705
1720
  width: () => l.width,
1706
1721
  height: () => l.height,
1707
1722
  title: () => l.title,
@@ -1714,18 +1729,19 @@ var Pt = {
1714
1729
  tooltipClamp: () => l.tooltipClamp,
1715
1730
  filename: () => l.filename,
1716
1731
  downloadLink: () => l.downloadLink,
1732
+ downloadButton: () => l.downloadButton,
1717
1733
  chartPadding: () => l.chartPadding,
1718
- inlineLegendLabels: () => fe.value,
1719
- hasTooltipSlot: () => we.value,
1720
- getCsv: Se,
1721
- pointerToIndex: Oe,
1734
+ inlineLegendLabels: () => I.value,
1735
+ hasTooltipSlot: () => B.value,
1736
+ getCsv: xe,
1737
+ pointerToIndex: H,
1722
1738
  onHover: (e) => h("hover", e),
1723
1739
  extraBelowHeight: () => de.value.extraHeight
1724
- }), Ue = n(() => z(l.axisLabelStyle, { fontSize: 13 })), We = n(() => z(l.tickLabelStyle, {
1740
+ }), Ue = n(() => V(l.axisLabelStyle, { fontSize: 13 })), Z = n(() => V(l.tickLabelStyle, {
1725
1741
  fontSize: 10,
1726
- fillOpacity: Ce
1727
- })), Ge = n(() => z(l.legendStyle, { fontSize: 11 })), Y = n(() => {
1728
- let e = l.titleStyle, t = e?.align ?? "left", n = K.value, r = t === "left" ? n.left : t === "right" ? n.right : n.left + n.width / 2, i = t === "left" ? "start" : t === "right" ? "end" : "middle";
1742
+ fillOpacity: Se
1743
+ })), We = n(() => V(l.legendStyle, { fontSize: 11 })), Ge = n(() => {
1744
+ let e = l.titleStyle, t = e?.align ?? "left", n = Ne.value, r = t === "left" ? n.left : t === "right" ? n.right : n.left + n.width / 2, i = t === "left" ? "start" : t === "right" ? "end" : "middle";
1729
1745
  return {
1730
1746
  lines: (l.title ?? "").split("\n"),
1731
1747
  fontSize: e?.fontSize ?? 14,
@@ -1736,7 +1752,7 @@ var Pt = {
1736
1752
  anchor: i
1737
1753
  };
1738
1754
  }), Ke = n(() => {
1739
- let e = Pe.value.positions, t = U.value.left, n = Ne.value;
1755
+ let e = Me.value.positions, t = G.value.left, n = je.value;
1740
1756
  return F.value.map((r, i) => {
1741
1757
  let a = e[i];
1742
1758
  return {
@@ -1751,7 +1767,7 @@ var Pt = {
1751
1767
  ref: ke,
1752
1768
  class: f(["line-chart-wrapper", { "is-fullscreen": S(He) }])
1753
1769
  }, [
1754
- t.menu ? (_(), r(me, {
1770
+ t.menu ? (_(), r(pe, {
1755
1771
  key: 0,
1756
1772
  items: S(Le)
1757
1773
  }, null, 8, ["items"])) : i("", !0),
@@ -1759,21 +1775,21 @@ var Pt = {
1759
1775
  (_(), a("svg", {
1760
1776
  ref_key: "svgRef",
1761
1777
  ref: Ae,
1762
- width: S(je),
1763
- height: pe.value
1778
+ width: S(U),
1779
+ height: fe.value
1764
1780
  }, [
1765
1781
  t.title ? (_(), a("text", {
1766
1782
  key: 0,
1767
- x: Y.value.x,
1768
- y: Y.value.lineHeight,
1769
- "text-anchor": Y.value.anchor,
1770
- "font-size": Y.value.fontSize,
1771
- "font-weight": Y.value.fontWeight,
1772
- fill: Y.value.color
1773
- }, [(_(!0), a(e, null, y(Y.value.lines, (e, t) => (_(), a("tspan", {
1783
+ x: Ge.value.x,
1784
+ y: Ge.value.lineHeight,
1785
+ "text-anchor": Ge.value.anchor,
1786
+ "font-size": Ge.value.fontSize,
1787
+ "font-weight": Ge.value.fontWeight,
1788
+ fill: Ge.value.color
1789
+ }, [(_(!0), a(e, null, y(Ge.value.lines, (e, t) => (_(), a("tspan", {
1774
1790
  key: t,
1775
- x: Y.value.x,
1776
- dy: t === 0 ? 0 : Y.value.lineHeight
1791
+ x: Ge.value.x,
1792
+ dy: t === 0 ? 0 : Ge.value.lineHeight
1777
1793
  }, b(e), 9, Lt))), 128))], 8, It)) : i("", !0),
1778
1794
  Ke.value.length > 0 ? (_(), a("g", Rt, [(_(!0), a(e, null, y(Ke.value, (t, n) => (_(), a(e, { key: "ileg" + n }, [t.type === "series" ? (_(), a("line", {
1779
1795
  key: 0,
@@ -1796,81 +1812,81 @@ var Pt = {
1796
1812
  }, null, 8, Bt)), o("text", {
1797
1813
  x: t.x + 18,
1798
1814
  y: t.y + 4,
1799
- "font-size": Ge.value.fontSize,
1800
- fill: Ge.value.fill,
1801
- "font-weight": Ge.value.fontWeight
1815
+ "font-size": We.value.fontSize,
1816
+ fill: We.value.fill,
1817
+ "font-weight": We.value.fontWeight
1802
1818
  }, b(t.label), 9, Vt)], 64))), 128))])) : i("", !0),
1803
1819
  o("line", {
1804
- x1: S(L)(S(U).left),
1805
- y1: S(L)(S(U).top),
1806
- x2: S(L)(S(U).left),
1807
- y2: S(L)(S(U).top + S(G)),
1820
+ x1: S(R)(S(G).left),
1821
+ y1: S(R)(S(G).top),
1822
+ x2: S(R)(S(G).left),
1823
+ y2: S(R)(S(G).top + S(q)),
1808
1824
  stroke: "currentColor",
1809
1825
  "stroke-opacity": "0.3"
1810
1826
  }, null, 8, Ht),
1811
1827
  o("line", {
1812
- x1: S(L)(S(U).left),
1813
- y1: S(L)(S(U).top + S(G)),
1814
- x2: S(L)(S(U).left + S(W)),
1815
- y2: S(L)(S(U).top + S(G)),
1828
+ x1: S(R)(S(G).left),
1829
+ y1: S(R)(S(G).top + S(q)),
1830
+ x2: S(R)(S(G).left + S(K)),
1831
+ y2: S(R)(S(G).top + S(q)),
1816
1832
  stroke: "currentColor",
1817
1833
  "stroke-opacity": "0.3"
1818
1834
  }, null, 8, Ut),
1819
- t.yGrid ? (_(!0), a(e, { key: 2 }, y(he.value, (e, t) => (_(), a("line", {
1835
+ t.yGrid ? (_(!0), a(e, { key: 2 }, y(me.value, (e, t) => (_(), a("line", {
1820
1836
  key: "yg" + t,
1821
- x1: S(U).left,
1837
+ x1: S(G).left,
1822
1838
  y1: e.y,
1823
- x2: S(U).left + S(W),
1839
+ x2: S(G).left + S(K),
1824
1840
  y2: e.y,
1825
1841
  stroke: "currentColor",
1826
1842
  "stroke-opacity": "0.1"
1827
1843
  }, null, 8, Wt))), 128)) : i("", !0),
1828
- t.xGrid ? (_(!0), a(e, { key: 3 }, y(_e.value, (e, t) => (_(), a("line", {
1844
+ t.xGrid ? (_(!0), a(e, { key: 3 }, y(ge.value, (e, t) => (_(), a("line", {
1829
1845
  key: "xg" + t,
1830
1846
  x1: e.x,
1831
- y1: S(U).top,
1847
+ y1: S(G).top,
1832
1848
  x2: e.x,
1833
- y2: S(U).top + S(G),
1849
+ y2: S(G).top + S(q),
1834
1850
  stroke: "currentColor",
1835
1851
  "stroke-opacity": "0.1"
1836
1852
  }, null, 8, Gt))), 128)) : i("", !0),
1837
- (_(!0), a(e, null, y(he.value, (e, t) => (_(), a("text", {
1853
+ (_(!0), a(e, null, y(me.value, (e, t) => (_(), a("text", {
1838
1854
  key: "y" + t,
1839
1855
  "data-testid": "y-tick",
1840
- x: S(U).left - 6,
1856
+ x: S(G).left - 6,
1841
1857
  y: e.y,
1842
1858
  "text-anchor": "end",
1843
1859
  "dominant-baseline": "middle",
1844
- "font-size": We.value.fontSize,
1845
- fill: We.value.fill,
1846
- "font-weight": We.value.fontWeight,
1847
- "fill-opacity": We.value.fillOpacity
1860
+ "font-size": Z.value.fontSize,
1861
+ fill: Z.value.fill,
1862
+ "font-weight": Z.value.fontWeight,
1863
+ "fill-opacity": Z.value.fillOpacity
1848
1864
  }, b(e.value), 9, Kt))), 128)),
1849
1865
  t.yLabel ? (_(), a("text", {
1850
1866
  key: 4,
1851
1867
  x: 0,
1852
1868
  y: 0,
1853
- transform: `translate(14, ${S(U).top + S(G) / 2}) rotate(-90)`,
1869
+ transform: `translate(14, ${S(G).top + S(q) / 2}) rotate(-90)`,
1854
1870
  "text-anchor": "middle",
1855
1871
  "font-size": Ue.value.fontSize,
1856
1872
  fill: Ue.value.fill,
1857
1873
  "font-weight": Ue.value.fontWeight
1858
1874
  }, b(t.yLabel), 9, qt)) : i("", !0),
1859
- (_(!0), a(e, null, y(_e.value, (e, t) => (_(), a("text", {
1875
+ (_(!0), a(e, null, y(ge.value, (e, t) => (_(), a("text", {
1860
1876
  key: "x" + t,
1861
1877
  "data-testid": "x-tick",
1862
1878
  x: e.x,
1863
- y: S(U).top + S(G) + 16,
1879
+ y: S(G).top + S(q) + 16,
1864
1880
  "text-anchor": e.anchor,
1865
- "font-size": We.value.fontSize,
1866
- fill: We.value.fill,
1867
- "font-weight": We.value.fontWeight,
1868
- "fill-opacity": We.value.fillOpacity
1881
+ "font-size": Z.value.fontSize,
1882
+ fill: Z.value.fill,
1883
+ "font-weight": Z.value.fontWeight,
1884
+ "fill-opacity": Z.value.fillOpacity
1869
1885
  }, b(e.value), 9, Jt))), 128)),
1870
1886
  t.xLabel ? (_(), a("text", {
1871
1887
  key: 5,
1872
- x: S(U).left + S(W) / 2,
1873
- y: S(Me) - 4,
1888
+ x: S(G).left + S(K) / 2,
1889
+ y: S(W) - 4,
1874
1890
  "text-anchor": "middle",
1875
1891
  "font-size": Ue.value.fontSize,
1876
1892
  fill: Ue.value.fill,
@@ -1901,8 +1917,9 @@ var Pt = {
1901
1917
  stroke: n.color ?? "currentColor",
1902
1918
  "stroke-width": n.strokeWidth ?? 1.5,
1903
1919
  "stroke-opacity": n.lineOpacity ?? n.opacity ?? t.lineOpacity,
1904
- "stroke-dasharray": n.dashed ? "6 3" : void 0
1905
- }, null, 8, Qt)),
1920
+ "stroke-dasharray": n.dashed ? "6 3" : void 0,
1921
+ style: m(n.blendMode ? { mixBlendMode: n.blendMode } : void 0)
1922
+ }, null, 12, Qt)),
1906
1923
  n.dots ? (_(!0), a(e, { key: 2 }, y(ce(n), (e, r) => (_(), a("circle", {
1907
1924
  key: r,
1908
1925
  cx: e.x,
@@ -1910,8 +1927,9 @@ var Pt = {
1910
1927
  r: n.dotRadius ?? (n.strokeWidth ?? 1.5) + 1,
1911
1928
  fill: n.dotFill ?? n.color ?? "currentColor",
1912
1929
  "fill-opacity": n.dotOpacity ?? n.opacity ?? t.lineOpacity,
1913
- stroke: n.dotStroke ?? "none"
1914
- }, null, 8, $t))), 128)) : i("", !0)
1930
+ stroke: n.dotStroke ?? "none",
1931
+ style: m(n.blendMode ? { mixBlendMode: n.blendMode } : void 0)
1932
+ }, null, 12, $t))), 128)) : i("", !0)
1915
1933
  ], 64))), 128)),
1916
1934
  (_(!0), a(e, null, y(t.areaSections ?? [], (t, n) => (_(), a(e, { key: "areasec" + n }, [
1917
1935
  o("path", {
@@ -1929,51 +1947,51 @@ var Pt = {
1929
1947
  "stroke-dasharray": t.dashed ? "6 3" : void 0
1930
1948
  }, null, 8, tn)),
1931
1949
  t.seriesIndex == null ? (_(), a(e, { key: 1 }, [o("line", {
1932
- x1: S(L)(P(t, "start")),
1933
- y1: S(U).top,
1934
- x2: S(L)(P(t, "start")),
1935
- y2: S(U).top + S(G),
1950
+ x1: S(R)(P(t, "start")),
1951
+ y1: S(G).top,
1952
+ x2: S(R)(P(t, "start")),
1953
+ y2: S(G).top + S(q),
1936
1954
  stroke: t.color ?? "#999",
1937
1955
  "stroke-width": t.strokeWidth ?? 2,
1938
1956
  "stroke-dasharray": t.dashed ? "6 3" : void 0
1939
1957
  }, null, 8, nn), o("line", {
1940
- x1: S(L)(P(t, "end")),
1941
- y1: S(U).top,
1942
- x2: S(L)(P(t, "end")),
1943
- y2: S(U).top + S(G),
1958
+ x1: S(R)(P(t, "end")),
1959
+ y1: S(G).top,
1960
+ x2: S(R)(P(t, "end")),
1961
+ y2: S(G).top + S(q),
1944
1962
  stroke: t.color ?? "#999",
1945
1963
  "stroke-width": t.strokeWidth ?? 2,
1946
1964
  "stroke-dasharray": t.dashed ? "6 3" : void 0
1947
1965
  }, null, 8, rn)], 64)) : i("", !0),
1948
1966
  o("line", {
1949
- x1: S(L)(P(t, "start")),
1950
- y1: S(U).top + S(G) - 4,
1951
- x2: S(L)(P(t, "start")),
1952
- y2: S(U).top + S(G) + 4,
1967
+ x1: S(R)(P(t, "start")),
1968
+ y1: S(G).top + S(q) - 4,
1969
+ x2: S(R)(P(t, "start")),
1970
+ y2: S(G).top + S(q) + 4,
1953
1971
  stroke: "currentColor",
1954
1972
  "stroke-opacity": "0.4"
1955
1973
  }, null, 8, an),
1956
1974
  o("line", {
1957
- x1: S(L)(P(t, "end")),
1958
- y1: S(U).top + S(G) - 4,
1959
- x2: S(L)(P(t, "end")),
1960
- y2: S(U).top + S(G) + 4,
1975
+ x1: S(R)(P(t, "end")),
1976
+ y1: S(G).top + S(q) - 4,
1977
+ x2: S(R)(P(t, "end")),
1978
+ y2: S(G).top + S(q) + 4,
1961
1979
  stroke: "currentColor",
1962
1980
  "stroke-opacity": "0.4"
1963
1981
  }, null, 8, on)
1964
1982
  ], 64))), 128)),
1965
- we.value && S(q) !== null ? (_(), a("line", {
1983
+ B.value && S(J) !== null ? (_(), a("line", {
1966
1984
  key: 6,
1967
- x1: S(L)(Te.value),
1968
- y1: S(U).top,
1969
- x2: S(L)(Te.value),
1970
- y2: S(U).top + S(G),
1985
+ x1: S(R)(we.value),
1986
+ y1: S(G).top,
1987
+ x2: S(R)(we.value),
1988
+ y2: S(G).top + S(q),
1971
1989
  stroke: "currentColor",
1972
1990
  "stroke-opacity": "0.3",
1973
1991
  "stroke-dasharray": "4 2",
1974
1992
  "pointer-events": "none"
1975
1993
  }, null, 8, sn)) : i("", !0),
1976
- (_(!0), a(e, null, y(V.value, (e, t) => (_(), a("circle", {
1994
+ (_(!0), a(e, null, y(Ee.value, (e, t) => (_(), a("circle", {
1977
1995
  key: "hd" + t,
1978
1996
  cx: e.x,
1979
1997
  cy: e.y,
@@ -1983,28 +2001,28 @@ var Pt = {
1983
2001
  "stroke-width": "2",
1984
2002
  "pointer-events": "none"
1985
2003
  }, null, 8, cn))), 128)),
1986
- we.value ? (_(), a("rect", d({
2004
+ B.value ? (_(), a("rect", d({
1987
2005
  key: 7,
1988
- x: S(U).left,
1989
- y: S(U).top,
1990
- width: S(W),
1991
- height: S(G),
2006
+ x: S(G).left,
2007
+ y: S(G).top,
2008
+ width: S(K),
2009
+ height: S(q),
1992
2010
  fill: "transparent",
1993
2011
  style: {
1994
2012
  cursor: "crosshair",
1995
2013
  "touch-action": "none"
1996
2014
  }
1997
2015
  }, te(S(Ie), !0)), null, 16, ln)) : i("", !0),
1998
- t.annotations && t.annotations.length > 0 ? (_(), r(S(ct), {
2016
+ t.annotations && t.annotations.length > 0 ? (_(), r(S(ot), {
1999
2017
  key: 8,
2000
2018
  annotations: t.annotations,
2001
- project: De,
2002
- bounds: S(K)
2019
+ project: Oe,
2020
+ bounds: S(Ne)
2003
2021
  }, null, 8, ["annotations", "bounds"])) : i("", !0),
2004
2022
  (_(!0), a(e, null, y(de.value.labels, (e, t) => (_(), a("g", { key: "seclab" + t }, [
2005
2023
  o("circle", {
2006
2024
  cx: e.cx - e.textWidth / 2 - 2,
2007
- cy: I.value + e.row * gn + 4,
2025
+ cy: L.value + e.row * gn + 4,
2008
2026
  r: "4",
2009
2027
  fill: e.color,
2010
2028
  "fill-opacity": e.fillOpacity,
@@ -2014,7 +2032,7 @@ var Pt = {
2014
2032
  e.labelText ? (_(), a("text", {
2015
2033
  key: 0,
2016
2034
  x: e.cx - e.textWidth / 2 + 8,
2017
- y: I.value + e.row * gn + 8,
2035
+ y: L.value + e.row * gn + 8,
2018
2036
  "font-size": e.labelStyle.fontSize,
2019
2037
  "font-weight": e.labelStyle.fontWeight,
2020
2038
  fill: e.labelStyle.fill
@@ -2022,7 +2040,7 @@ var Pt = {
2022
2040
  e.descText ? (_(), a("text", {
2023
2041
  key: 1,
2024
2042
  x: e.cx - e.textWidth / 2 + 8,
2025
- y: I.value + e.row * gn + 22,
2043
+ y: L.value + e.row * gn + 22,
2026
2044
  "font-size": e.descStyle.fontSize,
2027
2045
  "font-weight": e.descStyle.fontWeight,
2028
2046
  fill: e.descStyle.fill,
@@ -2030,10 +2048,10 @@ var Pt = {
2030
2048
  }, b(e.descText), 9, fn)) : i("", !0)
2031
2049
  ]))), 128))
2032
2050
  ], 8, Ft)),
2033
- we.value && S(q) !== null && H.value ? (_(), a("div", {
2051
+ B.value && S(J) !== null && De.value ? (_(), a("div", {
2034
2052
  key: 1,
2035
2053
  ref_key: "tooltipRef",
2036
- ref: J,
2054
+ ref: Pe,
2037
2055
  class: "chart-tooltip-content",
2038
2056
  style: m({
2039
2057
  position: "absolute",
@@ -2043,7 +2061,7 @@ var Pt = {
2043
2061
  transform: S(Fe) ? `translate3d(${S(Fe).left}px, ${S(Fe).top}px, 0) translateY(-50%)` : "translateY(-50%)",
2044
2062
  visibility: S(Fe) ? "visible" : "hidden"
2045
2063
  })
2046
- }, [ee(n.$slots, "tooltip", p(u(H.value)), () => [o("div", pn, [H.value.xLabel ? (_(), a("div", mn, b(H.value.xLabel), 1)) : i("", !0), (_(!0), a(e, null, y(H.value.values, (e) => (_(), a("div", {
2064
+ }, [ee(n.$slots, "tooltip", p(u(De.value)), () => [o("div", pn, [De.value.xLabel ? (_(), a("div", mn, b(De.value.xLabel), 1)) : i("", !0), (_(!0), a(e, null, y(De.value.values, (e) => (_(), a("div", {
2047
2065
  key: e.seriesIndex,
2048
2066
  class: "line-chart-tooltip-row"
2049
2067
  }, [o("span", {
@@ -2054,11 +2072,17 @@ var Pt = {
2054
2072
  key: 2,
2055
2073
  class: "line-chart-download-link",
2056
2074
  href: S(ze),
2057
- download: `${S(Ve)()}.csv`
2058
- }, b(S(Re)), 9, hn)) : i("", !0)
2075
+ download: `${S(X)()}.csv`
2076
+ }, b(S(Re)), 9, hn)) : i("", !0),
2077
+ S(Be) ? (_(), a("button", {
2078
+ key: 3,
2079
+ type: "button",
2080
+ class: "line-chart-download-button",
2081
+ onClick: c[0] ||= (...e) => S(Ve) && S(Ve)(...e)
2082
+ }, b(S(Be)), 1)) : i("", !0)
2059
2083
  ], 2));
2060
2084
  }
2061
- }), [["__scopeId", "data-v-d5524bd2"]]), xn = {
2085
+ }), [["__scopeId", "data-v-0d24242d"]]), xn = {
2062
2086
  class: "chart-sr-only",
2063
2087
  "aria-live": "polite"
2064
2088
  }, Sn = ["width", "height"], Cn = [
@@ -2073,51 +2097,58 @@ var Pt = {
2073
2097
  "y",
2074
2098
  "fill"
2075
2099
  ], Dn = [
2100
+ "x1",
2101
+ "y1",
2102
+ "x2",
2103
+ "y2",
2104
+ "stroke",
2105
+ "stroke-dasharray"
2106
+ ], On = [
2076
2107
  "x",
2077
2108
  "y",
2078
2109
  "font-size",
2079
2110
  "fill",
2080
2111
  "font-weight"
2081
- ], On = [
2112
+ ], kn = [
2082
2113
  "x1",
2083
2114
  "y1",
2084
2115
  "x2",
2085
2116
  "y2"
2086
- ], kn = [
2117
+ ], An = [
2087
2118
  "x1",
2088
2119
  "y1",
2089
2120
  "x2",
2090
2121
  "y2"
2091
- ], An = [
2122
+ ], jn = [
2092
2123
  "x1",
2093
2124
  "y1",
2094
2125
  "x2",
2095
2126
  "y2"
2096
- ], jn = [
2127
+ ], Mn = [
2097
2128
  "x",
2098
2129
  "y",
2099
2130
  "width",
2100
2131
  "height"
2101
- ], Mn = [
2132
+ ], Nn = [
2102
2133
  "x",
2103
2134
  "y",
2104
2135
  "font-size",
2105
2136
  "fill",
2106
2137
  "font-weight",
2107
2138
  "fill-opacity"
2108
- ], Nn = [
2139
+ ], Pn = [
2109
2140
  "x",
2110
2141
  "y",
2111
2142
  "font-size",
2112
2143
  "fill",
2113
2144
  "font-weight",
2114
2145
  "fill-opacity"
2115
- ], Pn = [
2146
+ ], Fn = [
2116
2147
  "transform",
2117
2148
  "font-size",
2118
2149
  "fill",
2119
2150
  "font-weight"
2120
- ], Fn = [
2151
+ ], In = [
2121
2152
  "x",
2122
2153
  "y",
2123
2154
  "text-anchor",
@@ -2125,20 +2156,20 @@ var Pt = {
2125
2156
  "fill",
2126
2157
  "font-weight",
2127
2158
  "fill-opacity"
2128
- ], In = [
2159
+ ], Ln = [
2129
2160
  "x",
2130
2161
  "y",
2131
2162
  "font-size",
2132
2163
  "fill",
2133
2164
  "font-weight",
2134
2165
  "fill-opacity"
2135
- ], Ln = [
2166
+ ], Rn = [
2136
2167
  "x",
2137
2168
  "y",
2138
2169
  "font-size",
2139
2170
  "fill",
2140
2171
  "font-weight"
2141
- ], Rn = [
2172
+ ], zn = [
2142
2173
  "data-category",
2143
2174
  "data-series",
2144
2175
  "x",
@@ -2147,20 +2178,33 @@ var Pt = {
2147
2178
  "height",
2148
2179
  "fill",
2149
2180
  "fill-opacity"
2150
- ], zn = [
2181
+ ], Bn = [
2182
+ "d",
2183
+ "stroke",
2184
+ "stroke-width",
2185
+ "stroke-opacity",
2186
+ "stroke-dasharray"
2187
+ ], Vn = [
2188
+ "cx",
2189
+ "cy",
2190
+ "r",
2191
+ "fill",
2192
+ "fill-opacity"
2193
+ ], Hn = [
2151
2194
  "x",
2152
2195
  "y",
2153
2196
  "width",
2154
2197
  "height"
2155
- ], Bn = { class: "bar-chart-tooltip" }, Vn = {
2198
+ ], Un = { class: "bar-chart-tooltip" }, Wn = {
2156
2199
  key: 0,
2157
2200
  class: "bar-chart-tooltip-label"
2158
- }, Hn = ["href", "download"], Un = /* @__PURE__ */ I(/* @__PURE__ */ l({
2201
+ }, Gn = ["href", "download"], Kn = /* @__PURE__ */ L(/* @__PURE__ */ l({
2159
2202
  __name: "BarChart",
2160
2203
  props: {
2161
2204
  data: {},
2162
2205
  y: {},
2163
2206
  series: {},
2207
+ summaryLines: {},
2164
2208
  categories: {},
2165
2209
  orientation: { default: "vertical" },
2166
2210
  layout: { default: "grouped" },
@@ -2197,6 +2241,7 @@ var Pt = {
2197
2241
  csv: {},
2198
2242
  filename: {},
2199
2243
  downloadLink: { type: [Boolean, String] },
2244
+ downloadButton: { type: [Boolean, String] },
2200
2245
  annotations: {},
2201
2246
  chartPadding: {}
2202
2247
  },
@@ -2208,6 +2253,7 @@ var Pt = {
2208
2253
  data: e.y ?? e.data ?? g,
2209
2254
  color: e.color,
2210
2255
  opacity: e.opacity,
2256
+ blendMode: e.blendMode,
2211
2257
  legend: e.legend,
2212
2258
  showInLegend: e.showInLegend,
2213
2259
  showInTooltip: e.showInTooltip
@@ -2256,13 +2302,13 @@ var Pt = {
2256
2302
  isFinite(e) || (e = 0), isFinite(t) || (t = 0);
2257
2303
  let i = l.valueMin ?? 0;
2258
2304
  l.valueScaleType === "log" ? i > 0 && i < e && (e = i) : i < e && (e = i);
2259
- let a = xe(e, t, l.valueScaleType, n);
2305
+ let a = be(e, t, l.valueScaleType, n);
2260
2306
  return {
2261
2307
  min: a.min,
2262
2308
  max: a.max,
2263
2309
  range: a.max - a.min || 1
2264
2310
  };
2265
- }), O = n(() => E.value ? V.value : H.value), re = n(() => E.value ? H.value : V.value), k = n(() => {
2311
+ }), O = n(() => E.value ? U.value : W.value), re = n(() => E.value ? W.value : U.value), k = n(() => {
2266
2312
  let e = C.value;
2267
2313
  return e > 0 ? O.value / e : 0;
2268
2314
  }), A = n(() => k.value * (1 - l.barPadding)), ie = n(() => {
@@ -2273,38 +2319,40 @@ var Pt = {
2273
2319
  return Math.max(1, (A.value - t) / e);
2274
2320
  });
2275
2321
  function j(e) {
2276
- return (E.value ? B.value.left : B.value.top) + e * k.value;
2322
+ return (E.value ? H.value.left : H.value.top) + e * k.value;
2277
2323
  }
2278
2324
  let ae = n(() => {
2279
2325
  let { min: e, max: t } = D.value, n = l.valueMin ?? 0;
2280
2326
  return M(Math.max(e, Math.min(t, n)));
2281
2327
  });
2282
2328
  function M(e) {
2283
- let { min: t, max: n } = D.value, r = be(e, t, n, l.valueScaleType);
2284
- return E.value ? B.value.top + H.value - r * H.value : B.value.left + r * V.value;
2329
+ let { min: t, max: n } = D.value, r = ye(e, t, n, l.valueScaleType);
2330
+ return E.value ? H.value.top + W.value - r * W.value : H.value.left + r * U.value;
2285
2331
  }
2286
- function oe(e, t, n, r, i, a, o, s, c) {
2287
- let l = Math.min(e, t), u = Math.abs(e - t);
2332
+ function oe(e, t, n, r, i, a, o, s, c, l) {
2333
+ let u = Math.min(e, t), d = Math.abs(e - t);
2288
2334
  return E.value ? {
2289
2335
  x: n,
2290
- y: l,
2336
+ y: u,
2291
2337
  w: r,
2292
- h: u,
2338
+ h: d,
2293
2339
  color: i,
2294
2340
  opacity: a,
2295
- value: o,
2296
- categoryIndex: s,
2297
- seriesIndex: c
2341
+ blendMode: o,
2342
+ value: s,
2343
+ categoryIndex: c,
2344
+ seriesIndex: l
2298
2345
  } : {
2299
- x: l,
2346
+ x: u,
2300
2347
  y: n,
2301
- w: u,
2348
+ w: d,
2302
2349
  h: r,
2303
2350
  color: i,
2304
2351
  opacity: a,
2305
- value: o,
2306
- categoryIndex: s,
2307
- seriesIndex: c
2352
+ blendMode: o,
2353
+ value: s,
2354
+ categoryIndex: c,
2355
+ seriesIndex: l
2308
2356
  };
2309
2357
  }
2310
2358
  let N = n(() => {
@@ -2319,17 +2367,84 @@ var Pt = {
2319
2367
  let n = t[c], l = Number(n.data[i] ?? NaN);
2320
2368
  if (!isFinite(l)) continue;
2321
2369
  let u = l >= 0 ? o : s, d = u + l;
2322
- e.push(oe(M(u), M(d), r, a, n.color ?? ce(c), n.opacity ?? 1, l, i, c)), l >= 0 ? o = d : s = d;
2370
+ e.push(oe(M(u), M(d), r, a, n.color ?? I(c), n.opacity ?? 1, n.blendMode, l, i, c)), l >= 0 ? o = d : s = d;
2323
2371
  }
2324
- } else for (let a = 0; a < n; a++) {
2372
+ } else if (l.layout === "overlay") for (let o = 0; o < n; o++) {
2373
+ let n = t[o], s = Number(n.data[i] ?? NaN);
2374
+ isFinite(s) && e.push(oe(c, M(s), r, a, n.color ?? I(o), n.opacity ?? 1, n.blendMode, s, i, o));
2375
+ }
2376
+ else for (let a = 0; a < n; a++) {
2325
2377
  let s = t[a], u = Number(s.data[i] ?? NaN);
2326
2378
  if (!isFinite(u)) continue;
2327
2379
  let d = r + (n === 1 ? 0 : a * (o + l.groupGap));
2328
- e.push(oe(c, M(u), d, o, s.color ?? ce(a), s.opacity ?? 1, u, i, a));
2380
+ e.push(oe(c, M(u), d, o, s.color ?? I(a), s.opacity ?? 1, s.blendMode, u, i, a));
2329
2381
  }
2330
2382
  }
2331
2383
  return e;
2332
- }), se = [
2384
+ });
2385
+ function se(e) {
2386
+ let t = Infinity, n = -Infinity;
2387
+ for (let r of e.data) {
2388
+ let e = Number(r);
2389
+ isFinite(e) && (e < t && (t = e), e > n && (n = e));
2390
+ }
2391
+ return isFinite(t) || (t = 0, n = 1), e.valueMin === void 0 ? t > 0 && (t = 0) : t = e.valueMin, e.valueMax !== void 0 && (n = e.valueMax), t === n && (n = t + 1), {
2392
+ min: t,
2393
+ max: n
2394
+ };
2395
+ }
2396
+ function ce(e, t, n) {
2397
+ let r = (E.value ? H.value.left : H.value.top) + (e + .5) * k.value, i = n.max - n.min || 1, a = (t - n.min) / i;
2398
+ return E.value ? {
2399
+ x: r,
2400
+ y: H.value.top + W.value - a * W.value
2401
+ } : {
2402
+ x: H.value.left + a * U.value,
2403
+ y: r
2404
+ };
2405
+ }
2406
+ let le = n(() => {
2407
+ let e = l.summaryLines;
2408
+ return !e || e.length === 0 ? [] : e.map((e, t) => ({
2409
+ data: e.data ?? g,
2410
+ x: e.x,
2411
+ color: e.color ?? de(t),
2412
+ strokeWidth: e.strokeWidth ?? 2,
2413
+ dashed: e.dashed ?? !1,
2414
+ opacity: e.opacity ?? 1,
2415
+ blendMode: e.blendMode,
2416
+ dots: e.dots ?? !1,
2417
+ dotRadius: e.dotRadius ?? (e.strokeWidth ?? 2) + 1,
2418
+ extent: se(e),
2419
+ legend: e.legend,
2420
+ showInLegend: e.showInLegend !== !1
2421
+ }));
2422
+ }), P = n(() => k.value === 0 ? [] : le.value.map((e) => {
2423
+ let t = [], n = "", r = !1;
2424
+ for (let i = 0; i < e.data.length; i++) {
2425
+ let a = Number(e.data[i]), o = e.x ? Number(e.x[i]) : i;
2426
+ if (!isFinite(a) || !isFinite(o)) {
2427
+ r = !1;
2428
+ continue;
2429
+ }
2430
+ let s = ce(o, a, e.extent);
2431
+ t.push(s), n += r ? `L${s.x},${s.y}` : `M${s.x},${s.y}`, r = !0;
2432
+ }
2433
+ return {
2434
+ ...e,
2435
+ pathD: n,
2436
+ points: t
2437
+ };
2438
+ })), ue = [
2439
+ "var(--color-fg-1, #111)",
2440
+ "var(--color-danger, #ef4444)",
2441
+ "var(--color-success, #10b981)",
2442
+ "var(--color-info, #6366f1)"
2443
+ ];
2444
+ function de(e) {
2445
+ return ue[e % ue.length];
2446
+ }
2447
+ let F = [
2333
2448
  "var(--color-primary, #3b82f6)",
2334
2449
  "var(--color-accent, #f59e0b)",
2335
2450
  "var(--color-success, #10b981)",
@@ -2337,36 +2452,36 @@ var Pt = {
2337
2452
  "var(--color-info, #6366f1)",
2338
2453
  "var(--color-warning, #d97706)"
2339
2454
  ];
2340
- function ce(e) {
2341
- return se[e % se.length];
2455
+ function I(e) {
2456
+ return F[e % F.length];
2342
2457
  }
2343
- let le = ft(() => l.tooltipValueFormat, () => l.valueTickFormat), P = n(() => {
2344
- let { min: e, max: t } = D.value, n = (e) => l.valueTickFormat === void 0 ? ve(e) : ne(e, l.valueTickFormat);
2458
+ let fe = ut(() => l.tooltipValueFormat, () => l.valueTickFormat), L = n(() => {
2459
+ let { min: e, max: t } = D.value, n = (e) => l.valueTickFormat === void 0 ? _e(e) : ne(e, l.valueTickFormat);
2345
2460
  if (e === t) return [{
2346
2461
  value: n(e),
2347
- pos: L(M(e))
2462
+ pos: R(M(e))
2348
2463
  }];
2349
2464
  let r = E.value ? 50 : 80;
2350
- return (l.valueScaleType === "log" ? R({
2465
+ return (l.valueScaleType === "log" ? z({
2351
2466
  min: e,
2352
2467
  max: t,
2353
2468
  ticks: l.valueTicks
2354
- }) : ye({
2469
+ }) : ve({
2355
2470
  min: e,
2356
2471
  max: t,
2357
2472
  ticks: l.valueTicks,
2358
2473
  targetTickCount: re.value / r
2359
2474
  })).map((e) => ({
2360
2475
  value: n(e),
2361
- pos: L(M(e))
2476
+ pos: R(M(e))
2362
2477
  }));
2363
- }), ue = n(() => {
2478
+ }), me = n(() => {
2364
2479
  let e = C.value, t = T.value;
2365
2480
  if (t && t.length > 0) {
2366
2481
  let e = Infinity, n = -Infinity;
2367
2482
  for (let r of t) Number.isFinite(r) && (r < e && (e = r), r > n && (n = r));
2368
2483
  if (!Number.isFinite(e) || e === n) return [];
2369
- let r = E.value ? V.value : H.value, i = Math.max(2, Math.floor(r / 80)), a = Dt(e, n, i, "utc"), o = a.unit, s = [], c = /* @__PURE__ */ new Set();
2484
+ let r = E.value ? U.value : W.value, i = Math.max(2, Math.floor(r / 80)), a = Dt(e, n, i, "utc"), o = a.unit, s = [], c = /* @__PURE__ */ new Set();
2370
2485
  for (let e of a.values) {
2371
2486
  let n = -1, r = Infinity;
2372
2487
  for (let i = 0; i < t.length; i++) {
@@ -2396,28 +2511,36 @@ var Pt = {
2396
2511
  });
2397
2512
  }
2398
2513
  return n;
2399
- }), de = n(() => {
2514
+ }), he = n(() => {
2400
2515
  let e = [];
2401
2516
  return x.value.forEach((t, n) => {
2402
2517
  !t.legend || t.showInLegend === !1 || e.push({
2403
2518
  label: t.legend,
2404
- color: t.color ?? ce(n)
2519
+ color: t.color ?? I(n),
2520
+ kind: "bar"
2521
+ });
2522
+ }), le.value.forEach((t) => {
2523
+ !t.legend || !t.showInLegend || e.push({
2524
+ label: t.legend,
2525
+ color: t.color,
2526
+ kind: "line",
2527
+ dashed: t.dashed
2405
2528
  });
2406
2529
  }), e;
2407
- }), F = n(() => de.value.map((e) => e.label));
2408
- function fe() {
2530
+ }), ge = n(() => he.value.map((e) => e.label));
2531
+ function xe() {
2409
2532
  if (typeof l.csv == "function") return l.csv();
2410
2533
  if (typeof l.csv == "string") return l.csv;
2411
2534
  let e = x.value.map((e) => ({
2412
2535
  label: e.legend,
2413
2536
  data: e.data
2414
2537
  }));
2415
- return Ve(w.value, e);
2538
+ return Be(w.value, e);
2416
2539
  }
2417
- let pe = n(() => !!l.tooltipData || !!l.tooltipTrigger);
2418
- function I(e, t) {
2540
+ let B = n(() => !!l.tooltipData || !!l.tooltipTrigger);
2541
+ function Ce(e, t) {
2419
2542
  if (!isFinite(e) || !isFinite(t) || k.value === 0) return null;
2420
- let n = (E.value ? B.value.left : B.value.top) + (e + .5) * k.value, r = M(t);
2543
+ let n = (E.value ? H.value.left : H.value.top) + (e + .5) * k.value, r = M(t);
2421
2544
  return E.value ? {
2422
2545
  x: n,
2423
2546
  y: r
@@ -2426,15 +2549,15 @@ var Pt = {
2426
2549
  y: n
2427
2550
  };
2428
2551
  }
2429
- function he(e, t) {
2430
- let n = ge.value?.getBoundingClientRect();
2552
+ function we(e, t) {
2553
+ let n = Te.value?.getBoundingClientRect();
2431
2554
  if (!n) return null;
2432
2555
  let r = C.value;
2433
2556
  if (r === 0 || k.value === 0) return null;
2434
- let i = E.value ? e - n.left - B.value.left : t - n.top - B.value.top;
2557
+ let i = E.value ? e - n.left - H.value.left : t - n.top - H.value.top;
2435
2558
  return Math.max(0, Math.min(r - 1, Math.floor(i / k.value)));
2436
2559
  }
2437
- let { containerRef: ge, svgRef: _e, width: Se, height: we, padding: B, legendY: Te, inlineLegendLayout: Ee, innerW: V, innerH: H, bounds: De, hoverIndex: Oe, tooltipRef: ke, tooltipPos: Ae, tooltipHandlers: je, menuItems: Me, downloadLinkText: U, csvHref: Ne, menuFilename: Pe, isFullscreen: W } = dt({
2560
+ let { containerRef: Te, svgRef: Ee, width: De, height: Oe, padding: H, legendY: ke, inlineLegendLayout: Ae, innerW: U, innerH: W, bounds: G, hoverIndex: je, tooltipRef: Me, tooltipPos: K, tooltipHandlers: q, menuItems: Ne, downloadLinkText: J, csvHref: Pe, downloadButtonText: Fe, triggerCsvDownload: Ie, menuFilename: Le, isFullscreen: Re } = lt({
2438
2561
  width: () => l.width,
2439
2562
  height: () => l.height,
2440
2563
  title: () => l.title,
@@ -2447,17 +2570,18 @@ var Pt = {
2447
2570
  tooltipClamp: () => l.tooltipClamp,
2448
2571
  filename: () => l.filename,
2449
2572
  downloadLink: () => l.downloadLink,
2573
+ downloadButton: () => l.downloadButton,
2450
2574
  chartPadding: () => l.chartPadding,
2451
- inlineLegendLabels: () => F.value,
2452
- hasTooltipSlot: () => pe.value,
2453
- getCsv: fe,
2454
- pointerToIndex: he,
2575
+ inlineLegendLabels: () => ge.value,
2576
+ hasTooltipSlot: () => B.value,
2577
+ getCsv: xe,
2578
+ pointerToIndex: we,
2455
2579
  onHover: (e) => h("hover", e)
2456
- }), G = n(() => z(l.axisLabelStyle, { fontSize: 13 })), K = n(() => z(l.tickLabelStyle, {
2580
+ }), ze = n(() => V(l.axisLabelStyle, { fontSize: 13 })), Y = n(() => V(l.tickLabelStyle, {
2457
2581
  fontSize: 10,
2458
- fillOpacity: Ce
2459
- })), q = n(() => z(l.legendStyle, { fontSize: 11 })), J = n(() => {
2460
- let e = l.titleStyle, t = e?.align ?? "left", n = De.value, r = t === "left" ? n.left : t === "right" ? n.right : n.left + n.width / 2, i = t === "left" ? "start" : t === "right" ? "end" : "middle";
2582
+ fillOpacity: Se
2583
+ })), Ve = n(() => V(l.legendStyle, { fontSize: 11 })), X = n(() => {
2584
+ let e = l.titleStyle, t = e?.align ?? "left", n = G.value, r = t === "left" ? n.left : t === "right" ? n.right : n.left + n.width / 2, i = t === "left" ? "start" : t === "right" ? "end" : "middle";
2461
2585
  return {
2462
2586
  lines: (l.title ?? "").split("\n"),
2463
2587
  fontSize: e?.fontSize ?? 14,
@@ -2467,20 +2591,20 @@ var Pt = {
2467
2591
  x: r,
2468
2592
  anchor: i
2469
2593
  };
2470
- }), Fe = n(() => {
2471
- let e = Oe.value;
2594
+ }), He = n(() => {
2595
+ let e = je.value;
2472
2596
  if (e === null) return;
2473
2597
  let t = T.value;
2474
2598
  return t && Number.isFinite(t[e]) ? Nt(t[e], l.dateFormat, "utc") : w.value[e];
2475
- }), Ie = n(() => {
2476
- let e = Oe.value;
2599
+ }), Ue = n(() => {
2600
+ let e = je.value;
2477
2601
  if (e === null) return null;
2478
2602
  let t = x.value, n = [];
2479
2603
  for (let r = 0; r < t.length; r++) {
2480
2604
  let i = t[r];
2481
2605
  i.showInTooltip !== !1 && n.push({
2482
2606
  value: Number(i.data[e] ?? NaN),
2483
- color: i.color ?? ce(r),
2607
+ color: i.color ?? I(r),
2484
2608
  seriesIndex: r
2485
2609
  });
2486
2610
  }
@@ -2490,24 +2614,24 @@ var Pt = {
2490
2614
  values: n,
2491
2615
  data: l.tooltipData?.[e] ?? null
2492
2616
  };
2493
- }), Le = n(() => {
2494
- let e = Oe.value;
2617
+ }), Z = n(() => {
2618
+ let e = je.value;
2495
2619
  if (e === null) return null;
2496
2620
  let t = j(e);
2497
2621
  return E.value ? {
2498
2622
  x: t,
2499
- y: B.value.top,
2623
+ y: H.value.top,
2500
2624
  w: k.value,
2501
- h: H.value
2625
+ h: W.value
2502
2626
  } : {
2503
- x: B.value.left,
2627
+ x: H.value.left,
2504
2628
  y: t,
2505
- w: V.value,
2629
+ w: U.value,
2506
2630
  h: k.value
2507
2631
  };
2508
- }), Re = n(() => {
2509
- let e = Ee.value.positions, t = B.value.left, n = Te.value;
2510
- return de.value.map((r, i) => {
2632
+ }), We = n(() => {
2633
+ let e = Ae.value.positions, t = H.value.left, n = ke.value;
2634
+ return he.value.map((r, i) => {
2511
2635
  let a = e[i];
2512
2636
  return {
2513
2637
  ...r,
@@ -2518,144 +2642,154 @@ var Pt = {
2518
2642
  });
2519
2643
  return (n, c) => (_(), a("div", {
2520
2644
  ref_key: "containerRef",
2521
- ref: ge,
2522
- class: f(["bar-chart-wrapper", { "is-fullscreen": S(W) }])
2645
+ ref: Te,
2646
+ class: f(["bar-chart-wrapper", { "is-fullscreen": S(Re) }])
2523
2647
  }, [
2524
- t.menu ? (_(), r(me, {
2648
+ t.menu ? (_(), r(pe, {
2525
2649
  key: 0,
2526
- items: S(Me)
2650
+ items: S(Ne)
2527
2651
  }, null, 8, ["items"])) : i("", !0),
2528
- o("div", xn, b(S(W) ? "Chart expanded to fill window" : ""), 1),
2652
+ o("div", xn, b(S(Re) ? "Chart expanded to fill window" : ""), 1),
2529
2653
  (_(), a("svg", {
2530
2654
  ref_key: "svgRef",
2531
- ref: _e,
2532
- width: S(Se),
2533
- height: S(we)
2655
+ ref: Ee,
2656
+ width: S(De),
2657
+ height: S(Oe)
2534
2658
  }, [
2535
2659
  t.title ? (_(), a("text", {
2536
2660
  key: 0,
2537
- x: J.value.x,
2538
- y: J.value.lineHeight,
2539
- "text-anchor": J.value.anchor,
2540
- "font-size": J.value.fontSize,
2541
- "font-weight": J.value.fontWeight,
2542
- fill: J.value.color
2543
- }, [(_(!0), a(e, null, y(J.value.lines, (e, t) => (_(), a("tspan", {
2661
+ x: X.value.x,
2662
+ y: X.value.lineHeight,
2663
+ "text-anchor": X.value.anchor,
2664
+ "font-size": X.value.fontSize,
2665
+ "font-weight": X.value.fontWeight,
2666
+ fill: X.value.color
2667
+ }, [(_(!0), a(e, null, y(X.value.lines, (e, t) => (_(), a("tspan", {
2544
2668
  key: t,
2545
- x: J.value.x,
2546
- dy: t === 0 ? 0 : J.value.lineHeight
2669
+ x: X.value.x,
2670
+ dy: t === 0 ? 0 : X.value.lineHeight
2547
2671
  }, b(e), 9, wn))), 128))], 8, Cn)) : i("", !0),
2548
- Re.value.length > 0 ? (_(), a("g", Tn, [(_(!0), a(e, null, y(Re.value, (t, n) => (_(), a(e, { key: "ileg" + n }, [o("rect", {
2672
+ We.value.length > 0 ? (_(), a("g", Tn, [(_(!0), a(e, null, y(We.value, (t, n) => (_(), a(e, { key: "ileg" + n }, [t.kind === "bar" ? (_(), a("rect", {
2673
+ key: 0,
2549
2674
  x: t.x,
2550
2675
  y: t.y - 5,
2551
2676
  width: "12",
2552
2677
  height: "10",
2553
2678
  fill: t.color
2554
- }, null, 8, En), o("text", {
2679
+ }, null, 8, En)) : (_(), a("line", {
2680
+ key: 1,
2681
+ x1: t.x,
2682
+ y1: t.y,
2683
+ x2: t.x + 12,
2684
+ y2: t.y,
2685
+ stroke: t.color,
2686
+ "stroke-width": "2",
2687
+ "stroke-dasharray": t.dashed ? "4 2" : void 0
2688
+ }, null, 8, Dn)), o("text", {
2555
2689
  x: t.x + 18,
2556
2690
  y: t.y + 4,
2557
- "font-size": q.value.fontSize,
2558
- fill: q.value.fill,
2559
- "font-weight": q.value.fontWeight
2560
- }, b(t.label), 9, Dn)], 64))), 128))])) : i("", !0),
2691
+ "font-size": Ve.value.fontSize,
2692
+ fill: Ve.value.fill,
2693
+ "font-weight": Ve.value.fontWeight
2694
+ }, b(t.label), 9, On)], 64))), 128))])) : i("", !0),
2561
2695
  o("line", {
2562
- x1: S(L)(S(B).left),
2563
- y1: S(L)(S(B).top),
2564
- x2: S(L)(S(B).left),
2565
- y2: S(L)(S(B).top + S(H)),
2696
+ x1: S(R)(S(H).left),
2697
+ y1: S(R)(S(H).top),
2698
+ x2: S(R)(S(H).left),
2699
+ y2: S(R)(S(H).top + S(W)),
2566
2700
  stroke: "currentColor",
2567
2701
  "stroke-opacity": "0.3"
2568
- }, null, 8, On),
2702
+ }, null, 8, kn),
2569
2703
  o("line", {
2570
- x1: S(L)(S(B).left),
2571
- y1: S(L)(S(B).top + S(H)),
2572
- x2: S(L)(S(B).left + S(V)),
2573
- y2: S(L)(S(B).top + S(H)),
2704
+ x1: S(R)(S(H).left),
2705
+ y1: S(R)(S(H).top + S(W)),
2706
+ x2: S(R)(S(H).left + S(U)),
2707
+ y2: S(R)(S(H).top + S(W)),
2574
2708
  stroke: "currentColor",
2575
2709
  "stroke-opacity": "0.3"
2576
- }, null, 8, kn),
2577
- t.valueGrid ? (_(!0), a(e, { key: 2 }, y(P.value, (e, t) => (_(), a("line", {
2710
+ }, null, 8, An),
2711
+ t.valueGrid ? (_(!0), a(e, { key: 2 }, y(L.value, (e, t) => (_(), a("line", {
2578
2712
  key: "vg" + t,
2579
- x1: E.value ? S(B).left : e.pos,
2580
- y1: E.value ? e.pos : S(B).top,
2581
- x2: E.value ? S(B).left + S(V) : e.pos,
2582
- y2: E.value ? e.pos : S(B).top + S(H),
2713
+ x1: E.value ? S(H).left : e.pos,
2714
+ y1: E.value ? e.pos : S(H).top,
2715
+ x2: E.value ? S(H).left + S(U) : e.pos,
2716
+ y2: E.value ? e.pos : S(H).top + S(W),
2583
2717
  stroke: "currentColor",
2584
2718
  "stroke-opacity": "0.1"
2585
- }, null, 8, An))), 128)) : i("", !0),
2586
- Le.value && pe.value ? (_(), a("rect", {
2719
+ }, null, 8, jn))), 128)) : i("", !0),
2720
+ Z.value && B.value ? (_(), a("rect", {
2587
2721
  key: 3,
2588
- x: Le.value.x,
2589
- y: Le.value.y,
2590
- width: Le.value.w,
2591
- height: Le.value.h,
2722
+ x: Z.value.x,
2723
+ y: Z.value.y,
2724
+ width: Z.value.w,
2725
+ height: Z.value.h,
2592
2726
  fill: "currentColor",
2593
2727
  "fill-opacity": "0.06",
2594
2728
  "pointer-events": "none"
2595
- }, null, 8, jn)) : i("", !0),
2596
- E.value ? (_(!0), a(e, { key: 4 }, y(P.value, (e, t) => (_(), a("text", {
2729
+ }, null, 8, Mn)) : i("", !0),
2730
+ E.value ? (_(!0), a(e, { key: 4 }, y(L.value, (e, t) => (_(), a("text", {
2597
2731
  key: "vt" + t,
2598
2732
  "data-testid": "value-tick",
2599
- x: S(B).left - 6,
2733
+ x: S(H).left - 6,
2600
2734
  y: e.pos,
2601
2735
  "text-anchor": "end",
2602
2736
  "dominant-baseline": "middle",
2603
- "font-size": K.value.fontSize,
2604
- fill: K.value.fill,
2605
- "font-weight": K.value.fontWeight,
2606
- "fill-opacity": K.value.fillOpacity
2607
- }, b(e.value), 9, Mn))), 128)) : (_(!0), a(e, { key: 5 }, y(P.value, (e, t) => (_(), a("text", {
2737
+ "font-size": Y.value.fontSize,
2738
+ fill: Y.value.fill,
2739
+ "font-weight": Y.value.fontWeight,
2740
+ "fill-opacity": Y.value.fillOpacity
2741
+ }, b(e.value), 9, Nn))), 128)) : (_(!0), a(e, { key: 5 }, y(L.value, (e, t) => (_(), a("text", {
2608
2742
  key: "vt" + t,
2609
2743
  "data-testid": "value-tick",
2610
2744
  x: e.pos,
2611
- y: S(B).top + S(H) + 16,
2745
+ y: S(H).top + S(W) + 16,
2612
2746
  "text-anchor": "middle",
2613
- "font-size": K.value.fontSize,
2614
- fill: K.value.fill,
2615
- "font-weight": K.value.fontWeight,
2616
- "fill-opacity": K.value.fillOpacity
2617
- }, b(e.value), 9, Nn))), 128)),
2747
+ "font-size": Y.value.fontSize,
2748
+ fill: Y.value.fill,
2749
+ "font-weight": Y.value.fontWeight,
2750
+ "fill-opacity": Y.value.fillOpacity
2751
+ }, b(e.value), 9, Pn))), 128)),
2618
2752
  t.yLabel ? (_(), a("text", {
2619
2753
  key: 6,
2620
2754
  x: 0,
2621
2755
  y: 0,
2622
- transform: `translate(14, ${S(B).top + S(H) / 2}) rotate(-90)`,
2756
+ transform: `translate(14, ${S(H).top + S(W) / 2}) rotate(-90)`,
2623
2757
  "text-anchor": "middle",
2624
- "font-size": G.value.fontSize,
2625
- fill: G.value.fill,
2626
- "font-weight": G.value.fontWeight
2627
- }, b(t.yLabel), 9, Pn)) : i("", !0),
2628
- E.value ? (_(!0), a(e, { key: 7 }, y(ue.value, (e, t) => (_(), a("text", {
2758
+ "font-size": ze.value.fontSize,
2759
+ fill: ze.value.fill,
2760
+ "font-weight": ze.value.fontWeight
2761
+ }, b(t.yLabel), 9, Fn)) : i("", !0),
2762
+ E.value ? (_(!0), a(e, { key: 7 }, y(me.value, (e, t) => (_(), a("text", {
2629
2763
  key: "ct" + t,
2630
2764
  "data-testid": "category-tick",
2631
2765
  x: e.pos,
2632
- y: S(B).top + S(H) + 16,
2766
+ y: S(H).top + S(W) + 16,
2633
2767
  "text-anchor": e.anchor,
2634
- "font-size": K.value.fontSize,
2635
- fill: K.value.fill,
2636
- "font-weight": K.value.fontWeight,
2637
- "fill-opacity": K.value.fillOpacity
2638
- }, b(e.label), 9, Fn))), 128)) : (_(!0), a(e, { key: 8 }, y(ue.value, (e, t) => (_(), a("text", {
2768
+ "font-size": Y.value.fontSize,
2769
+ fill: Y.value.fill,
2770
+ "font-weight": Y.value.fontWeight,
2771
+ "fill-opacity": Y.value.fillOpacity
2772
+ }, b(e.label), 9, In))), 128)) : (_(!0), a(e, { key: 8 }, y(me.value, (e, t) => (_(), a("text", {
2639
2773
  key: "ct" + t,
2640
2774
  "data-testid": "category-tick",
2641
- x: S(B).left - 6,
2775
+ x: S(H).left - 6,
2642
2776
  y: e.pos,
2643
2777
  "text-anchor": "end",
2644
2778
  "dominant-baseline": "middle",
2645
- "font-size": K.value.fontSize,
2646
- fill: K.value.fill,
2647
- "font-weight": K.value.fontWeight,
2648
- "fill-opacity": K.value.fillOpacity
2649
- }, b(e.label), 9, In))), 128)),
2779
+ "font-size": Y.value.fontSize,
2780
+ fill: Y.value.fill,
2781
+ "font-weight": Y.value.fontWeight,
2782
+ "fill-opacity": Y.value.fillOpacity
2783
+ }, b(e.label), 9, Ln))), 128)),
2650
2784
  t.xLabel ? (_(), a("text", {
2651
2785
  key: 9,
2652
- x: S(B).left + S(V) / 2,
2653
- y: S(we) - 4,
2786
+ x: S(H).left + S(U) / 2,
2787
+ y: S(Oe) - 4,
2654
2788
  "text-anchor": "middle",
2655
- "font-size": G.value.fontSize,
2656
- fill: G.value.fill,
2657
- "font-weight": G.value.fontWeight
2658
- }, b(t.xLabel), 9, Ln)) : i("", !0),
2789
+ "font-size": ze.value.fontSize,
2790
+ fill: ze.value.fill,
2791
+ "font-weight": ze.value.fontWeight
2792
+ }, b(t.xLabel), 9, Rn)) : i("", !0),
2659
2793
  (_(!0), a(e, null, y(N.value, (e, t) => (_(), a("rect", {
2660
2794
  key: "bar" + t,
2661
2795
  "data-testid": "bar",
@@ -2666,56 +2800,84 @@ var Pt = {
2666
2800
  width: e.w,
2667
2801
  height: e.h,
2668
2802
  fill: e.color,
2669
- "fill-opacity": e.opacity
2670
- }, null, 8, Rn))), 128)),
2671
- pe.value ? (_(), a("rect", d({
2803
+ "fill-opacity": e.opacity,
2804
+ style: m(e.blendMode ? { mixBlendMode: e.blendMode } : void 0)
2805
+ }, null, 12, zn))), 128)),
2806
+ (_(!0), a(e, null, y(P.value, (t, n) => (_(), a(e, { key: "sl" + n }, [t.pathD ? (_(), a("path", {
2807
+ key: 0,
2808
+ "data-testid": "summary-line",
2809
+ d: t.pathD,
2810
+ fill: "none",
2811
+ stroke: t.color,
2812
+ "stroke-width": t.strokeWidth,
2813
+ "stroke-opacity": t.opacity,
2814
+ "stroke-dasharray": t.dashed ? "6 3" : void 0,
2815
+ "stroke-linecap": "round",
2816
+ "stroke-linejoin": "round",
2817
+ style: m(t.blendMode ? { mixBlendMode: t.blendMode } : void 0)
2818
+ }, null, 12, Bn)) : i("", !0), t.dots ? (_(!0), a(e, { key: 1 }, y(t.points, (e, r) => (_(), a("circle", {
2819
+ key: "sld" + n + "-" + r,
2820
+ cx: e.x,
2821
+ cy: e.y,
2822
+ r: t.dotRadius,
2823
+ fill: t.color,
2824
+ "fill-opacity": t.opacity,
2825
+ style: m(t.blendMode ? { mixBlendMode: t.blendMode } : void 0)
2826
+ }, null, 12, Vn))), 128)) : i("", !0)], 64))), 128)),
2827
+ B.value ? (_(), a("rect", d({
2672
2828
  key: 10,
2673
- x: S(B).left,
2674
- y: S(B).top,
2675
- width: S(V),
2676
- height: S(H),
2829
+ x: S(H).left,
2830
+ y: S(H).top,
2831
+ width: S(U),
2832
+ height: S(W),
2677
2833
  fill: "transparent",
2678
2834
  style: {
2679
2835
  cursor: "crosshair",
2680
2836
  "touch-action": "none"
2681
2837
  }
2682
- }, te(S(je), !0)), null, 16, zn)) : i("", !0),
2683
- t.annotations && t.annotations.length > 0 ? (_(), r(S(ct), {
2838
+ }, te(S(q), !0)), null, 16, Hn)) : i("", !0),
2839
+ t.annotations && t.annotations.length > 0 ? (_(), r(S(ot), {
2684
2840
  key: 11,
2685
2841
  annotations: t.annotations,
2686
- project: I,
2687
- bounds: S(De)
2842
+ project: Ce,
2843
+ bounds: S(G)
2688
2844
  }, null, 8, ["annotations", "bounds"])) : i("", !0)
2689
2845
  ], 8, Sn)),
2690
- pe.value && S(Oe) !== null && Ie.value ? (_(), a("div", {
2846
+ B.value && S(je) !== null && Ue.value ? (_(), a("div", {
2691
2847
  key: 1,
2692
2848
  ref_key: "tooltipRef",
2693
- ref: ke,
2849
+ ref: Me,
2694
2850
  class: "chart-tooltip-content",
2695
2851
  style: m({
2696
2852
  position: "absolute",
2697
2853
  top: "0",
2698
2854
  left: "0",
2699
2855
  willChange: "transform",
2700
- transform: S(Ae) ? `translate3d(${S(Ae).left}px, ${S(Ae).top}px, 0) translateY(-50%)` : "translateY(-50%)",
2701
- visibility: S(Ae) ? "visible" : "hidden"
2856
+ transform: S(K) ? `translate3d(${S(K).left}px, ${S(K).top}px, 0) translateY(-50%)` : "translateY(-50%)",
2857
+ visibility: S(K) ? "visible" : "hidden"
2702
2858
  })
2703
- }, [ee(n.$slots, "tooltip", p(u(Ie.value)), () => [o("div", Bn, [Fe.value ? (_(), a("div", Vn, b(Fe.value), 1)) : i("", !0), (_(!0), a(e, null, y(Ie.value.values, (e) => (_(), a("div", {
2859
+ }, [ee(n.$slots, "tooltip", p(u(Ue.value)), () => [o("div", Un, [He.value ? (_(), a("div", Wn, b(He.value), 1)) : i("", !0), (_(!0), a(e, null, y(Ue.value.values, (e) => (_(), a("div", {
2704
2860
  key: e.seriesIndex,
2705
2861
  class: "bar-chart-tooltip-row"
2706
2862
  }, [o("span", {
2707
2863
  class: "bar-chart-tooltip-swatch",
2708
2864
  style: m({ background: e.color })
2709
- }, null, 4), s(" " + b(isFinite(e.value) ? S(le)(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
2710
- S(U) ? (_(), a("a", {
2865
+ }, null, 4), s(" " + b(isFinite(e.value) ? S(fe)(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
2866
+ S(J) ? (_(), a("a", {
2711
2867
  key: 2,
2712
2868
  class: "bar-chart-download-link",
2713
- href: S(Ne),
2714
- download: `${S(Pe)()}.csv`
2715
- }, b(S(U)), 9, Hn)) : i("", !0)
2869
+ href: S(Pe),
2870
+ download: `${S(Le)()}.csv`
2871
+ }, b(S(J)), 9, Gn)) : i("", !0),
2872
+ S(Fe) ? (_(), a("button", {
2873
+ key: 3,
2874
+ type: "button",
2875
+ class: "bar-chart-download-button",
2876
+ onClick: c[0] ||= (...e) => S(Ie) && S(Ie)(...e)
2877
+ }, b(S(Fe)), 1)) : i("", !0)
2716
2878
  ], 2));
2717
2879
  }
2718
- }), [["__scopeId", "data-v-ad030dd3"]]), Wn = {
2880
+ }), [["__scopeId", "data-v-bce03a52"]]), qn = {
2719
2881
  ref: "root",
2720
2882
  class: "chart-tooltip-content",
2721
2883
  style: {
@@ -2727,7 +2889,7 @@ var Pt = {
2727
2889
  "pointer-events": "none",
2728
2890
  transform: "translateY(-50%)"
2729
2891
  }
2730
- }, Gn = /* @__PURE__ */ l({
2892
+ }, Jn = /* @__PURE__ */ l({
2731
2893
  __name: "ChoroplethTooltip",
2732
2894
  setup(e, { expose: n }) {
2733
2895
  let a = v(null), s = w("root");
@@ -2738,21 +2900,21 @@ var Pt = {
2738
2900
  getEl() {
2739
2901
  return s.value;
2740
2902
  }
2741
- }), (e, n) => (_(), r(t, { to: "body" }, [o("div", Wn, [a.value ? ee(e.$slots, "default", p(d({ key: 0 }, a.value))) : i("", !0)], 512)]));
2903
+ }), (e, n) => (_(), r(t, { to: "body" }, [o("div", qn, [a.value ? ee(e.$slots, "default", p(d({ key: 0 }, a.value))) : i("", !0)], 512)]));
2742
2904
  }
2743
- }), Kn = {
2905
+ }), Yn = {
2744
2906
  class: "chart-sr-only",
2745
2907
  "aria-live": "polite"
2746
- }, qn = {
2908
+ }, Xn = {
2747
2909
  key: 1,
2748
2910
  class: "choropleth-header"
2749
- }, Jn = {
2911
+ }, Zn = {
2750
2912
  key: 0,
2751
2913
  class: "choropleth-legend-title"
2752
- }, Yn = {
2914
+ }, Qn = {
2753
2915
  key: 2,
2754
2916
  class: "choropleth-legend-continuous"
2755
- }, Xn = { class: "choropleth-legend-ticks" }, Zn = ["viewBox"], Qn = ["innerHTML"], $n = "http://www.w3.org/2000/svg", er = 450, tr = 1e3, nr = /* @__PURE__ */ I(/* @__PURE__ */ l({
2917
+ }, $n = { class: "choropleth-legend-ticks" }, er = ["viewBox"], tr = ["innerHTML"], nr = "http://www.w3.org/2000/svg", rr = 450, ir = 1e3, ar = /* @__PURE__ */ L(/* @__PURE__ */ l({
2756
2918
  __name: "ChoroplethMap",
2757
2919
  props: {
2758
2920
  topology: {},
@@ -2810,56 +2972,56 @@ var Pt = {
2810
2972
  width: "100%"
2811
2973
  };
2812
2974
  return e?.color && (t.color = e.color), t;
2813
- }), F = /* @__PURE__ */ new Map(), fe = /* @__PURE__ */ new Map(), pe = null, I = null, L = /* @__PURE__ */ new Map(), he = /* @__PURE__ */ new Map(), ge = !1, _e = typeof window < "u" && "ontouchstart" in window, ve = null, ye = {
2975
+ }), F = /* @__PURE__ */ new Map(), I = /* @__PURE__ */ new Map(), fe = null, L = null, R = /* @__PURE__ */ new Map(), me = /* @__PURE__ */ new Map(), he = !1, ge = typeof window < "u" && "ontouchstart" in window, _e = null, ve = {
2814
2976
  width: 0,
2815
2977
  height: 0
2816
- }, be = null, xe = !1, R = null, Se = v(!1), Ce = 0, we = 0, z = 0;
2817
- function B() {
2818
- if (_e) return;
2978
+ }, ye = null, be = !1, z = null, xe = v(!1), Se = 0, B = 0, V = 0;
2979
+ function Ce() {
2980
+ if (ge) return;
2819
2981
  let e = O.value;
2820
2982
  e && (e.addEventListener("click", gt), e.addEventListener("mouseover", gt), e.addEventListener("mousemove", _t), e.addEventListener("mouseout", vt));
2821
2983
  }
2822
- function Te() {
2984
+ function we() {
2823
2985
  let e = O.value;
2824
2986
  e && (e.removeEventListener("click", gt), e.removeEventListener("mouseover", gt), e.removeEventListener("mousemove", _t), e.removeEventListener("mouseout", vt));
2825
2987
  }
2826
- function Ee() {
2827
- Q();
2988
+ function Te() {
2989
+ mt();
2828
2990
  }
2829
2991
  h(() => {
2830
- V(), B(), bt(), je(), ct(), window.addEventListener("scroll", Ee, {
2992
+ Ee(), Ce(), bt(), U(), ot(), window.addEventListener("scroll", Te, {
2831
2993
  passive: !0,
2832
2994
  capture: !0
2833
- }), window.addEventListener("resize", Ee, { passive: !0 });
2995
+ }), window.addEventListener("resize", Te, { passive: !0 });
2834
2996
  }), g(() => {
2835
- ve?.disconnect(), z && cancelAnimationFrame(z), H(), Te(), window.removeEventListener("scroll", Ee, { capture: !0 }), window.removeEventListener("resize", Ee);
2997
+ _e?.disconnect(), V && cancelAnimationFrame(V), De(), we(), window.removeEventListener("scroll", Te, { capture: !0 }), window.removeEventListener("resize", Te);
2836
2998
  });
2837
- function V() {
2999
+ function Ee() {
2838
3000
  if (!D.value || !O.value) return;
2839
3001
  let e = le(D.value), t = Math.max(12, l.focusZoomLevel);
2840
- R = se().scaleExtent([1, t]).on("start", () => {
2841
- ge = !0, Q();
3002
+ z = se().scaleExtent([1, t]).on("start", () => {
3003
+ he = !0, mt();
2842
3004
  }).on("zoom", (e) => {
2843
3005
  O.value && O.value.setAttribute("transform", e.transform);
2844
3006
  let t = e.transform;
2845
- Se.value = t.k !== 1 || t.x !== 0 || t.y !== 0;
3007
+ xe.value = t.k !== 1 || t.x !== 0 || t.y !== 0;
2846
3008
  }).on("end", () => {
2847
- ge = !1;
2848
- }), R.filter((e) => {
2849
- let t = Y.value.length > 0, n = !!l.zoom || t, r = !!l.pan || t;
3009
+ he = !1;
3010
+ }), z.filter((e) => {
3011
+ let t = Z.value.length > 0, n = !!l.zoom || t, r = !!l.pan || t;
2850
3012
  if (e.type === "wheel" || e.type === "dblclick") {
2851
3013
  if (!n) return !1;
2852
3014
  } else if (e.type === "mousedown" || e.type === "touchstart") {
2853
3015
  if (!r) return !1;
2854
3016
  } else if (!n && !r) return !1;
2855
3017
  return (!e.ctrlKey || e.type === "wheel") && !e.button;
2856
- }), e.call(R);
3018
+ }), e.call(z);
2857
3019
  }
2858
- function H() {
2859
- D.value && R && (le(D.value).on(".zoom", null), R = null);
3020
+ function De() {
3021
+ D.value && z && (le(D.value).on(".zoom", null), z = null);
2860
3022
  }
2861
- function De(e) {
2862
- let t = Ke.value, n = Ue.value, r = [];
3023
+ function Oe(e) {
3024
+ let t = We.value, n = X.value, r = [];
2863
3025
  for (let i of e) {
2864
3026
  let e = i.geoType ?? l.geoType, a = t.get(e);
2865
3027
  if (!a) continue;
@@ -2877,66 +3039,66 @@ var Pt = {
2877
3039
  }
2878
3040
  return r;
2879
3041
  }
2880
- function Oe(e) {
3042
+ function H(e) {
2881
3043
  let t = /* @__PURE__ */ new Set();
2882
- for (let n of De(e)) n.geoType === l.geoType && t.add(String(n.feature.id));
3044
+ for (let n of Oe(e)) n.geoType === l.geoType && t.add(String(n.feature.id));
2883
3045
  return t;
2884
3046
  }
2885
3047
  let ke = !1;
2886
- function je() {
2887
- if (!D.value || !R) return;
2888
- let e = De(Y.value), t = e.filter((e) => e.geoType === l.geoType), n = e.filter((e) => e.geoType !== l.geoType), r = /* @__PURE__ */ new Map();
3048
+ function U() {
3049
+ if (!D.value || !z) return;
3050
+ let e = Oe(Z.value), t = e.filter((e) => e.geoType === l.geoType), n = e.filter((e) => e.geoType !== l.geoType), r = /* @__PURE__ */ new Map();
2889
3051
  for (let e of t) {
2890
3052
  let t = F.get(String(e.feature.id));
2891
3053
  t && r.set(t, e.item.style ?? "solid");
2892
3054
  }
2893
- for (let [e] of L) r.has(e) || e === I || X(e);
2894
- for (let [e, t] of r) L.get(e) === t && e !== I || e !== I && mt(e, t);
2895
- L.clear();
2896
- for (let [e, t] of r) L.set(e, t);
2897
- if (Me(n), e.length === 0) {
2898
- ke = !0, Q();
3055
+ for (let [e] of R) r.has(e) || e === L || Q(e);
3056
+ for (let [e, t] of r) R.get(e) === t && e !== L || e !== L && ft(e, t);
3057
+ R.clear();
3058
+ for (let [e, t] of r) R.set(e, t);
3059
+ if (W(n), e.length === 0) {
3060
+ ke = !0, mt();
2899
3061
  return;
2900
3062
  }
2901
3063
  let i = le(D.value);
2902
3064
  i.interrupt();
2903
3065
  let a = ke;
2904
3066
  ke = !0;
2905
- let [[o, s], [c, u]] = Ve.value.bounds({
3067
+ let [[o, s], [c, u]] = Be.value.bounds({
2906
3068
  type: "FeatureCollection",
2907
3069
  features: e.map((e) => e.feature)
2908
- }), d = (o + c) / 2, f = (s + u) / 2, p = l.focusZoomLevel, m = ce.translate(Pe.value / 2 - p * d, W.value / 2 - p * f).scale(p), h = t[0]?.feature ?? null, g = () => {
3070
+ }), d = (o + c) / 2, f = (s + u) / 2, p = l.focusZoomLevel, m = ce.translate(Me.value / 2 - p * d, K.value / 2 - p * f).scale(p), h = t[0]?.feature ?? null, g = () => {
2909
3071
  if (!j.value || !h) return;
2910
3072
  let e = String(h.id), t = F.get(e);
2911
3073
  if (!t) return;
2912
3074
  let n = t.getBoundingClientRect();
2913
- ut(e, n.left + n.width / 2, n.top + n.height / 2);
3075
+ ct(e, n.left + n.width / 2, n.top + n.height / 2);
2914
3076
  };
2915
- a ? (ft(), i.transition().duration(er).call(R.transform, m).on("end", g)) : (R.transform(i, m), g());
3077
+ a ? (ut(), i.transition().duration(rr).call(z.transform, m).on("end", g)) : (z.transform(i, m), g());
2916
3078
  }
2917
- function Me(e) {
3079
+ function W(e) {
2918
3080
  let t = k.value;
2919
3081
  if (!t) return;
2920
3082
  let n = new Set(e.map((e) => e.key));
2921
- for (let [e, t] of he) n.has(e) || (t.remove(), he.delete(e));
2922
- let r = Ve.value, i = He.value + 1.5;
3083
+ for (let [e, t] of me) n.has(e) || (t.remove(), me.delete(e));
3084
+ let r = Be.value, i = Ve.value + 1.5;
2923
3085
  for (let { item: n, feature: a, key: o } of e) {
2924
- let e = he.get(o);
2925
- e || (e = document.createElementNS($n, "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), he.set(o, e)), e.setAttribute("stroke", n.stroke ?? "#fff"), e.setAttribute("stroke-width", String(i)), pt(e, n.style);
3086
+ let e = me.get(o);
3087
+ e || (e = document.createElementNS(nr, "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), me.set(o, e)), e.setAttribute("stroke", n.stroke ?? "#fff"), e.setAttribute("stroke-width", String(i)), dt(e, n.style);
2926
3088
  }
2927
3089
  }
2928
- function U() {
2929
- if (!D.value || !R) return;
2930
- Y.value.length > 0 && d("update:focus", null);
3090
+ function G() {
3091
+ if (!D.value || !z) return;
3092
+ Z.value.length > 0 && d("update:focus", null);
2931
3093
  let e = le(D.value);
2932
- e.interrupt(), ft(), e.transition().duration(er).call(R.transform, ce);
3094
+ e.interrupt(), ut(), e.transition().duration(rr).call(z.transform, ce);
2933
3095
  }
2934
3096
  T(() => l.focusZoomLevel, () => {
2935
- R && R.scaleExtent([1, Math.max(12, l.focusZoomLevel)]), je();
3097
+ z && z.scaleExtent([1, Math.max(12, l.focusZoomLevel)]), U();
2936
3098
  });
2937
- let Ne = n(() => l.width && l.height ? l.height / l.width : .625), Pe = n(() => tr), W = n(() => tr * Ne.value), q = v(null), J = null;
3099
+ let je = n(() => l.width && l.height ? l.height / l.width : .625), Me = n(() => ir), K = n(() => ir * je.value), J = v(null), Pe = null;
2938
3100
  function Fe() {
2939
- return J ||= import("./hsaMapping-Devrp7Rk.js").then((e) => e.n).then((e) => (q.value = e, e)), J;
3101
+ return Pe ||= import("./hsaMapping-Devrp7Rk.js").then((e) => e.n).then((e) => (J.value = e, e)), Pe;
2940
3102
  }
2941
3103
  T(() => {
2942
3104
  if (l.geoType === "hsas" || l.dataGeoType === "hsas") return !0;
@@ -2946,7 +3108,7 @@ var Pt = {
2946
3108
  e && Fe();
2947
3109
  }, { immediate: !0 });
2948
3110
  let Ie = n(() => {
2949
- let e = q.value;
3111
+ let e = J.value;
2950
3112
  if (!e) return {
2951
3113
  type: "FeatureCollection",
2952
3114
  features: []
@@ -2979,31 +3141,31 @@ var Pt = {
2979
3141
  if (l.geoType !== "counties" && l.geoType !== "hsas") return null;
2980
3142
  let e = x(l.topology);
2981
3143
  return de(e, e.objects.states, (e, t) => e !== t);
2982
- }), Be = n(() => oe().fitExtent([[0, 0], [Pe.value, W.value]], Le.value)), Ve = n(() => N(Be.value)), He = n(() => l.geoType === "counties" || l.geoType === "hsas" ? l.strokeWidth * .5 : l.strokeWidth), Ue = n(() => {
3144
+ }), Y = n(() => oe().fitExtent([[0, 0], [Me.value, K.value]], Le.value)), Be = n(() => N(Y.value)), Ve = n(() => l.geoType === "counties" || l.geoType === "hsas" ? l.strokeWidth * .5 : l.strokeWidth), X = n(() => {
2983
3145
  let e = /* @__PURE__ */ new Map();
2984
- for (let [t, n] of Ke.value) {
3146
+ for (let [t, n] of We.value) {
2985
3147
  let r = /* @__PURE__ */ new Map();
2986
3148
  for (let [e, t] of n) t.properties?.name != null && r.set(t.properties.name, e);
2987
3149
  e.set(t, r);
2988
3150
  }
2989
3151
  return e;
2990
3152
  });
2991
- function We(e) {
3153
+ function He(e) {
2992
3154
  let t = l.dataGeoType;
2993
3155
  if (!t || t === l.geoType) return e;
2994
- if (l.geoType === "counties" && t === "hsas") return q.value?.fipsToHsa[e];
3156
+ if (l.geoType === "counties" && t === "hsas") return J.value?.fipsToHsa[e];
2995
3157
  if (l.geoType === "counties" && t === "states" || l.geoType === "hsas" && t === "states") return e.slice(0, 2);
2996
3158
  }
2997
- let Ge = n(() => {
3159
+ let Ue = n(() => {
2998
3160
  let e = /* @__PURE__ */ new Map();
2999
3161
  for (let t of Le.value.features) t.id != null && e.set(String(t.id), t);
3000
3162
  return e;
3001
- }), Y = n(() => {
3163
+ }), Z = n(() => {
3002
3164
  let e = l.focus;
3003
3165
  return e == null ? [] : (Array.isArray(e) ? e : [e]).map((e) => typeof e == "string" ? { id: e } : e);
3004
- }), Ke = n(() => {
3166
+ }), We = n(() => {
3005
3167
  let e = /* @__PURE__ */ new Map();
3006
- e.set(l.geoType, Ge.value);
3168
+ e.set(l.geoType, Ue.value);
3007
3169
  let t = x(l.topology), n = t?.objects;
3008
3170
  if (!n) return e;
3009
3171
  let r = (e) => {
@@ -3020,17 +3182,17 @@ var Pt = {
3020
3182
  e.set("counties", r(i.features));
3021
3183
  }
3022
3184
  return !e.has("hsas") && n.counties && e.set("hsas", r(Ie.value.features)), e;
3023
- }), qe = n(() => {
3185
+ }), Ge = n(() => {
3024
3186
  let e = /* @__PURE__ */ new Map();
3025
3187
  if (!l.data) return e;
3026
- let t = l.dataGeoType ?? l.geoType, n = Ue.value.get(t);
3188
+ let t = l.dataGeoType ?? l.geoType, n = X.value.get(t);
3027
3189
  for (let t of l.data) {
3028
3190
  e.set(t.id, t.value);
3029
3191
  let r = n?.get(t.id);
3030
3192
  r && e.set(r, t.value);
3031
3193
  }
3032
3194
  return e;
3033
- }), Je = n(() => {
3195
+ }), Ke = n(() => {
3034
3196
  if (!l.data || l.data.length === 0) return {
3035
3197
  min: 0,
3036
3198
  max: 1
@@ -3047,8 +3209,8 @@ var Pt = {
3047
3209
  min: 0,
3048
3210
  max: 1
3049
3211
  };
3050
- }), Ye = n(() => Array.isArray(l.colorScale) && l.colorScale.length > 0 && "value" in l.colorScale[0]), Xe = n(() => Array.isArray(l.colorScale) && !Ye.value), Ze = n(() => Xe.value ? "" : l.colorScale?.min ?? "#e5f0fa"), Qe = n(() => Xe.value ? "" : l.colorScale?.max ?? "#08519c");
3051
- function $e(e) {
3212
+ }), qe = n(() => Array.isArray(l.colorScale) && l.colorScale.length > 0 && "value" in l.colorScale[0]), Je = n(() => Array.isArray(l.colorScale) && !qe.value), Ye = n(() => Je.value ? "" : l.colorScale?.min ?? "#e5f0fa"), Xe = n(() => Je.value ? "" : l.colorScale?.max ?? "#08519c");
3213
+ function Ze(e) {
3052
3214
  let t = e.replace("#", "");
3053
3215
  return [
3054
3216
  parseInt(t.slice(0, 2), 16),
@@ -3056,100 +3218,100 @@ var Pt = {
3056
3218
  parseInt(t.slice(4, 6), 16)
3057
3219
  ];
3058
3220
  }
3059
- function et(e) {
3060
- let [t, n, r] = $e(Ze.value), [i, a, o] = $e(Qe.value);
3221
+ function Qe(e) {
3222
+ let [t, n, r] = Ze(Ye.value), [i, a, o] = Ze(Xe.value);
3061
3223
  return `rgb(${Math.round(t + (i - t) * e)},${Math.round(n + (a - n) * e)},${Math.round(r + (o - r) * e)})`;
3062
3224
  }
3063
- let tt = n(() => Xe.value ? l.colorScale.slice().sort((e, t) => t.min - e.min) : null), nt = n(() => {
3064
- if (!Ye.value) return null;
3225
+ let $e = n(() => Je.value ? l.colorScale.slice().sort((e, t) => t.min - e.min) : null), et = n(() => {
3226
+ if (!qe.value) return null;
3065
3227
  let e = /* @__PURE__ */ new Map();
3066
3228
  for (let t of l.colorScale) e.set(t.value, t.color);
3067
3229
  return e;
3068
3230
  });
3069
- function rt(e) {
3070
- let t = We(e);
3071
- return t == null ? void 0 : qe.value.get(t);
3231
+ function tt(e) {
3232
+ let t = He(e);
3233
+ return t == null ? void 0 : Ge.value.get(t);
3072
3234
  }
3073
- function it(e) {
3074
- let t = rt(e), n = l.noDataColor;
3235
+ function nt(e) {
3236
+ let t = tt(e), n = l.noDataColor;
3075
3237
  if (t == null) return n;
3076
- let r = nt.value;
3238
+ let r = et.value;
3077
3239
  if (r) return r.get(String(t)) ?? n;
3078
- let i = tt.value;
3240
+ let i = $e.value;
3079
3241
  if (i) {
3080
3242
  let e = t;
3081
3243
  for (let t of i) if (e >= t.min) return t.color;
3082
3244
  return n;
3083
3245
  }
3084
- let { min: a, max: o } = Je.value;
3085
- return et((t - a) / (o - a));
3246
+ let { min: a, max: o } = Ke.value;
3247
+ return Qe((t - a) / (o - a));
3086
3248
  }
3087
- let at = (e) => e.properties?.name ?? String(e.id);
3088
- function ot(e) {
3249
+ let rt = (e) => e.properties?.name ?? String(e.id);
3250
+ function it(e) {
3089
3251
  return e == null ? "" : typeof e == "number" && l.tooltipValueFormat !== void 0 ? ne(e, l.tooltipValueFormat) : String(e);
3090
3252
  }
3091
- function st(e, t) {
3092
- return t == null ? e : `${e}: ${ot(t)}`;
3253
+ function at(e, t) {
3254
+ return t == null ? e : `${e}: ${it(t)}`;
3093
3255
  }
3094
- function ct() {
3256
+ function ot() {
3095
3257
  let e = A.value?.getEl();
3096
3258
  if (!e) return;
3097
- ve?.disconnect();
3259
+ _e?.disconnect();
3098
3260
  let t = !1;
3099
- ve = new ResizeObserver((e) => {
3261
+ _e = new ResizeObserver((e) => {
3100
3262
  let n = e[0]?.contentRect;
3101
- n && (ye.width = n.width, ye.height = n.height, !t && xe && be ? (t = !0, lt(be.x, be.y)) : t = !0);
3102
- }), ve.observe(e);
3263
+ n && (ve.width = n.width, ve.height = n.height, !t && be && ye ? (t = !0, st(ye.x, ye.y)) : t = !0);
3264
+ }), _e.observe(e);
3103
3265
  }
3104
- function lt(e, t) {
3266
+ function st(e, t) {
3105
3267
  let n = A.value?.getEl();
3106
3268
  if (!n) return;
3107
- let r = w.value?.getBoundingClientRect(), { left: i, top: a } = Ae(e, t, ye.width, ye.height, l.tooltipClamp, r);
3269
+ let r = w.value?.getBoundingClientRect(), { left: i, top: a } = Ae(e, t, ve.width, ve.height, l.tooltipClamp, r);
3108
3270
  n.style.transform = `translate3d(${i}px, ${a}px, 0) translateY(-50%)`;
3109
3271
  }
3110
- function ut(e, t, n) {
3111
- let r = fe.get(e);
3272
+ function ct(e, t, n) {
3273
+ let r = I.get(e);
3112
3274
  if (!r) return;
3113
3275
  let i = A.value, a = i?.getEl();
3114
- !i || !a || (i.setData(r), be = {
3276
+ !i || !a || (i.setData(r), ye = {
3115
3277
  x: t,
3116
3278
  y: n
3117
- }, xe = !0, lt(t, n), a.style.visibility = "visible");
3279
+ }, be = !0, st(t, n), a.style.visibility = "visible");
3118
3280
  }
3119
- function dt(e, t) {
3120
- xe && (Ce = e, we = t, !z && (z = requestAnimationFrame(() => {
3121
- z = 0;
3281
+ function lt(e, t) {
3282
+ be && (Se = e, B = t, !V && (V = requestAnimationFrame(() => {
3283
+ V = 0;
3122
3284
  let e = A.value?.getEl();
3123
- !e || !xe || (be = {
3124
- x: Ce,
3125
- y: we
3126
- }, e.style.transform = `translate3d(${Ce + 16}px, ${we}px, 0) translateY(-50%)`);
3285
+ !e || !be || (ye = {
3286
+ x: Se,
3287
+ y: B
3288
+ }, e.style.transform = `translate3d(${Se + 16}px, ${B}px, 0) translateY(-50%)`);
3127
3289
  })));
3128
3290
  }
3129
- function ft() {
3130
- if (!xe) return;
3131
- xe = !1, be = null;
3291
+ function ut() {
3292
+ if (!be) return;
3293
+ be = !1, ye = null;
3132
3294
  let e = A.value?.getEl();
3133
3295
  e && (e.style.visibility = "hidden");
3134
3296
  }
3135
- function pt(e, t) {
3297
+ function dt(e, t) {
3136
3298
  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"));
3137
3299
  }
3138
- function mt(e, t = "solid") {
3139
- e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(He.value + 1)), e.setAttribute("stroke", "#555"), pt(e, t);
3300
+ function ft(e, t = "solid") {
3301
+ e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(Ve.value + 1)), e.setAttribute("stroke", "#555"), dt(e, t);
3140
3302
  }
3141
- function X(e) {
3142
- e.setAttribute("stroke-width", String(He.value)), e.setAttribute("stroke", l.strokeColor), e.removeAttribute("stroke-dasharray"), e.removeAttribute("stroke-linecap");
3303
+ function Q(e) {
3304
+ e.setAttribute("stroke-width", String(Ve.value)), e.setAttribute("stroke", l.strokeColor), e.removeAttribute("stroke-dasharray"), e.removeAttribute("stroke-linecap");
3143
3305
  }
3144
- function Z(e) {
3145
- I !== e && (I && !L.has(I) && X(I), I = e, mt(e, L.get(e) ?? "solid"));
3306
+ function pt(e) {
3307
+ L !== e && (L && !R.has(L) && Q(L), L = e, ft(e, R.get(e) ?? "solid"));
3146
3308
  }
3147
- function Q() {
3148
- if (I) {
3149
- let e = L.get(I);
3150
- e == null ? X(I) : mt(I, e), I = null, d("stateHover", null);
3309
+ function mt() {
3310
+ if (L) {
3311
+ let e = R.get(L);
3312
+ e == null ? Q(L) : ft(L, e), L = null, d("stateHover", null);
3151
3313
  }
3152
- ft();
3314
+ ut();
3153
3315
  }
3154
3316
  function ht(e) {
3155
3317
  let t = e;
@@ -3157,27 +3319,27 @@ var Pt = {
3157
3319
  return t ? t.dataset.featId ?? null : null;
3158
3320
  }
3159
3321
  function gt(e) {
3160
- if (ge) return;
3322
+ if (he) return;
3161
3323
  let t = e, n = ht(t.target);
3162
3324
  if (!n) return;
3163
- let r = fe.get(n);
3325
+ let r = I.get(n);
3164
3326
  if (!r) return;
3165
3327
  let i = {
3166
3328
  id: r.id,
3167
3329
  name: r.name,
3168
3330
  value: r.value
3169
3331
  };
3170
- e.type === "click" ? (d("stateClick", i), d("update:focus", Oe(Y.value).has(r.id) ? null : r.id)) : e.type === "mouseover" && (Z(F.get(n)), j.value && ut(n, t.clientX, t.clientY), d("stateHover", i));
3332
+ e.type === "click" ? (d("stateClick", i), d("update:focus", H(Z.value).has(r.id) ? null : r.id)) : e.type === "mouseover" && (pt(F.get(n)), j.value && ct(n, t.clientX, t.clientY), d("stateHover", i));
3171
3333
  }
3172
3334
  function _t(e) {
3173
- ge || dt(e.clientX, e.clientY);
3335
+ he || lt(e.clientX, e.clientY);
3174
3336
  }
3175
3337
  function vt(e) {
3176
3338
  let t = e.relatedTarget;
3177
- t && O.value?.contains(t) || Q();
3339
+ t && O.value?.contains(t) || mt();
3178
3340
  }
3179
3341
  function yt(e) {
3180
- let t = document.createElementNS($n, "path");
3342
+ let t = document.createElementNS(nr, "path");
3181
3343
  return e && t.setAttribute("d", e), t;
3182
3344
  }
3183
3345
  function bt() {
@@ -3185,15 +3347,15 @@ var Pt = {
3185
3347
  if (!e || !t) return;
3186
3348
  for (; e.firstChild;) e.removeChild(e.firstChild);
3187
3349
  for (; t.firstChild;) t.removeChild(t.firstChild);
3188
- F.clear(), fe.clear(), pe = null, I = null, L.clear(), he.clear();
3189
- let n = Ve.value, r = Le.value.features, i = l.strokeColor, a = String(He.value), o = !j.value, s = document.createDocumentFragment();
3350
+ F.clear(), I.clear(), fe = null, L = null, R.clear(), me.clear();
3351
+ let n = Be.value, r = Le.value.features, i = l.strokeColor, a = String(Ve.value), o = !j.value, s = document.createDocumentFragment();
3190
3352
  for (let e of r) {
3191
- let t = String(e.id), r = at(e), c = rt(t), l = yt(n(e));
3192
- if (l.setAttribute("class", "state-path"), l.setAttribute("data-feat-id", t), l.setAttribute("fill", it(t)), l.setAttribute("stroke", i), l.setAttribute("stroke-width", a), l.setAttribute("vector-effect", "non-scaling-stroke"), o) {
3193
- let e = document.createElementNS($n, "title");
3194
- e.textContent = st(r, c), l.appendChild(e);
3353
+ let t = String(e.id), r = rt(e), c = tt(t), l = yt(n(e));
3354
+ if (l.setAttribute("class", "state-path"), l.setAttribute("data-feat-id", t), l.setAttribute("fill", nt(t)), l.setAttribute("stroke", i), l.setAttribute("stroke-width", a), l.setAttribute("vector-effect", "non-scaling-stroke"), o) {
3355
+ let e = document.createElementNS(nr, "title");
3356
+ e.textContent = at(r, c), l.appendChild(e);
3195
3357
  }
3196
- s.appendChild(l), F.set(t, l), fe.set(t, {
3358
+ s.appendChild(l), F.set(t, l), I.set(t, {
3197
3359
  id: t,
3198
3360
  name: r,
3199
3361
  value: c,
@@ -3203,34 +3365,34 @@ var Pt = {
3203
3365
  let c = ze.value;
3204
3366
  if (c) {
3205
3367
  let e = yt(n(c));
3206
- 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), pe = e;
3368
+ 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), fe = e;
3207
3369
  }
3208
3370
  e.appendChild(s);
3209
3371
  }
3210
3372
  function xt() {
3211
3373
  let e = !j.value;
3212
3374
  for (let [t, n] of F) {
3213
- let r = rt(t), i = fe.get(t);
3214
- if (n.setAttribute("fill", it(t)), i && (i.value = r), e && i) {
3375
+ let r = tt(t), i = I.get(t);
3376
+ if (n.setAttribute("fill", nt(t)), i && (i.value = r), e && i) {
3215
3377
  let e = n.firstElementChild;
3216
- e && (e.textContent = st(i.name, r));
3378
+ e && (e.textContent = at(i.name, r));
3217
3379
  }
3218
3380
  }
3219
3381
  }
3220
3382
  function St() {
3221
- for (let e of F.values()) e === I || L.has(e) || X(e);
3222
- pe && pe.setAttribute("stroke", l.strokeColor);
3383
+ for (let e of F.values()) e === L || R.has(e) || Q(e);
3384
+ fe && fe.setAttribute("stroke", l.strokeColor);
3223
3385
  }
3224
3386
  function Ct() {
3225
3387
  return typeof l.menu == "string" ? l.menu : "choropleth";
3226
3388
  }
3227
- let wt = n(() => l.legend && (Ye.value || Xe.value || l.data)), Tt = n(() => l.colorScale.slice().sort((e, t) => e.min - t.min)), Et = n(() => {
3389
+ let wt = n(() => l.legend && (qe.value || Je.value || l.data)), Tt = n(() => l.colorScale.slice().sort((e, t) => e.min - t.min)), Et = n(() => {
3228
3390
  let e = [];
3229
3391
  for (let t = 0; t <= 10; t++) {
3230
3392
  let n = t / 10;
3231
3393
  e.push({
3232
3394
  offset: `${(n * 100).toFixed(0)}%`,
3233
- color: et(n)
3395
+ color: Qe(n)
3234
3396
  });
3235
3397
  }
3236
3398
  return e;
@@ -3238,7 +3400,7 @@ var Pt = {
3238
3400
  notation: "compact",
3239
3401
  maximumFractionDigits: 1
3240
3402
  }), Ot = n(() => {
3241
- let { min: e, max: t } = Je.value, n = t - e, r = [];
3403
+ let { min: e, max: t } = Ke.value, n = t - e, r = [];
3242
3404
  for (let t = 1; t <= 3; t++) {
3243
3405
  let i = t / 4, a = e + n * i, o = Math.abs(a) >= 1e3 ? Dt.format(a) : Number.isInteger(a) ? String(a) : a.toFixed(1).replace(/\.0$/, "");
3244
3406
  r.push({
@@ -3249,12 +3411,12 @@ var Pt = {
3249
3411
  return r;
3250
3412
  }), kt = n(() => {
3251
3413
  let e = [];
3252
- if (Ye.value) for (let t of l.colorScale) e.push({
3414
+ if (qe.value) for (let t of l.colorScale) e.push({
3253
3415
  key: t.value,
3254
3416
  color: t.color,
3255
3417
  label: t.value
3256
3418
  });
3257
- else if (Xe.value) for (let t of Tt.value) e.push({
3419
+ else if (Je.value) for (let t of Tt.value) e.push({
3258
3420
  key: String(t.min),
3259
3421
  color: t.color,
3260
3422
  label: t.label ?? String(t.min)
@@ -3267,27 +3429,27 @@ var Pt = {
3267
3429
  {
3268
3430
  label: "Save as SVG",
3269
3431
  action: () => {
3270
- D.value && G(D.value, e);
3432
+ D.value && q(D.value, e);
3271
3433
  }
3272
3434
  },
3273
3435
  {
3274
3436
  label: "Save as PNG",
3275
3437
  action: () => {
3276
- D.value && K(D.value, e);
3438
+ D.value && Ne(D.value, e);
3277
3439
  }
3278
3440
  }
3279
3441
  ];
3280
3442
  });
3281
- return T(() => [Ve.value, j.value], () => bt()), T(() => [
3282
- qe.value,
3443
+ return T(() => [Be.value, j.value], () => bt()), T(() => [
3444
+ Ge.value,
3283
3445
  l.colorScale,
3284
3446
  l.noDataColor,
3285
3447
  l.dataGeoType
3286
- ], () => xt()), T(() => [l.strokeColor, He.value], () => St()), T(() => [
3287
- Y.value,
3288
- Ve.value,
3289
- q.value
3290
- ], () => je(), { flush: "post" }), (n, c) => (_(), a("div", {
3448
+ ], () => xt()), T(() => [l.strokeColor, Ve.value], () => St()), T(() => [
3449
+ Z.value,
3450
+ Be.value,
3451
+ J.value
3452
+ ], () => U(), { flush: "post" }), (n, c) => (_(), a("div", {
3291
3453
  ref_key: "containerRef",
3292
3454
  ref: w,
3293
3455
  class: f(["choropleth-wrapper", {
@@ -3295,12 +3457,12 @@ var Pt = {
3295
3457
  "is-fullscreen": S(At).isFullscreen.value
3296
3458
  }])
3297
3459
  }, [
3298
- t.menu ? (_(), r(me, {
3460
+ t.menu ? (_(), r(pe, {
3299
3461
  key: 0,
3300
3462
  items: jt.value
3301
3463
  }, null, 8, ["items"])) : i("", !0),
3302
- o("div", Kn, b(S(At).isFullscreen.value ? "Map expanded to fill window" : ""), 1),
3303
- t.title || wt.value ? (_(), a("div", qn, [t.title ? (_(), a("div", {
3464
+ o("div", Yn, b(S(At).isFullscreen.value ? "Map expanded to fill window" : ""), 1),
3465
+ t.title || wt.value ? (_(), a("div", Xn, [t.title ? (_(), a("div", {
3304
3466
  key: 0,
3305
3467
  class: "choropleth-title",
3306
3468
  style: m(M.value)
@@ -3308,23 +3470,23 @@ var Pt = {
3308
3470
  key: 1,
3309
3471
  class: "choropleth-legend",
3310
3472
  style: m(ae.value)
3311
- }, [t.legendTitle ? (_(), a("span", Jn, b(t.legendTitle), 1)) : i("", !0), Ye.value || Xe.value ? (_(!0), a(e, { key: 1 }, y(kt.value, (e) => (_(), a("span", {
3473
+ }, [t.legendTitle ? (_(), a("span", Zn, b(t.legendTitle), 1)) : i("", !0), qe.value || Je.value ? (_(!0), a(e, { key: 1 }, y(kt.value, (e) => (_(), a("span", {
3312
3474
  key: e.key,
3313
3475
  class: "choropleth-legend-item"
3314
3476
  }, [o("span", {
3315
3477
  class: "choropleth-legend-swatch",
3316
3478
  style: m({ background: e.color })
3317
- }, null, 4), s(" " + b(e.label), 1)]))), 128)) : (_(), a("div", Yn, [o("div", {
3479
+ }, null, 4), s(" " + b(e.label), 1)]))), 128)) : (_(), a("div", Qn, [o("div", {
3318
3480
  class: "choropleth-legend-gradient",
3319
3481
  style: m({ background: $.value })
3320
- }, null, 4), o("div", Xn, [(_(!0), a(e, null, y(Ot.value, (e) => (_(), a("span", {
3482
+ }, null, 4), o("div", $n, [(_(!0), a(e, null, y(Ot.value, (e) => (_(), a("span", {
3321
3483
  key: e.value,
3322
3484
  style: m({ left: e.pct + "%" })
3323
3485
  }, b(e.value), 5))), 128))])]))], 4)) : i("", !0)])) : i("", !0),
3324
3486
  (_(), a("svg", {
3325
3487
  ref_key: "svgRef",
3326
3488
  ref: D,
3327
- viewBox: `0 0 ${Pe.value} ${W.value}`,
3489
+ viewBox: `0 0 ${Me.value} ${K.value}`,
3328
3490
  preserveAspectRatio: "xMidYMid meet"
3329
3491
  }, [o("g", {
3330
3492
  ref_key: "mapGroupRef",
@@ -3335,15 +3497,15 @@ var Pt = {
3335
3497
  }, null, 512), o("g", {
3336
3498
  ref_key: "overlayGroupRef",
3337
3499
  ref: k
3338
- }, null, 512)], 512)], 8, Zn)),
3339
- Se.value ? (_(), a("button", {
3500
+ }, null, 512)], 512)], 8, er)),
3501
+ xe.value ? (_(), a("button", {
3340
3502
  key: 2,
3341
3503
  type: "button",
3342
3504
  class: "choropleth-reset",
3343
3505
  "aria-label": "Reset zoom",
3344
- onClick: U
3506
+ onClick: G
3345
3507
  }, " Reset ")) : i("", !0),
3346
- j.value ? (_(), r(Gn, {
3508
+ j.value ? (_(), r(Jn, {
3347
3509
  key: 3,
3348
3510
  ref_key: "tooltipChildRef",
3349
3511
  ref: A
@@ -3351,12 +3513,12 @@ var Pt = {
3351
3513
  default: E((r) => [ee(n.$slots, "tooltip", p(u(te(r))), () => [t.tooltipFormat ? (_(), a("span", {
3352
3514
  key: 0,
3353
3515
  innerHTML: t.tooltipFormat(r)
3354
- }, null, 8, Qn)) : r.value == null ? (_(), a(e, { key: 1 }, [s(b(r.name), 1)], 64)) : (_(), a(e, { key: 2 }, [s(b(r.name) + ": " + b(ot(r.value)), 1)], 64))], !0)]),
3516
+ }, null, 8, tr)) : r.value == null ? (_(), a(e, { key: 1 }, [s(b(r.name), 1)], 64)) : (_(), a(e, { key: 2 }, [s(b(r.name) + ": " + b(it(r.value)), 1)], 64))], !0)]),
3355
3517
  _: 3
3356
3518
  }, 512)) : i("", !0)
3357
3519
  ], 2));
3358
3520
  }
3359
- }), [["__scopeId", "data-v-b11a80ed"]]), rr = /* @__PURE__ */ I(/* @__PURE__ */ l({
3521
+ }), [["__scopeId", "data-v-b11a80ed"]]), or = /* @__PURE__ */ L(/* @__PURE__ */ l({
3360
3522
  __name: "ChartTooltip",
3361
3523
  props: {
3362
3524
  x: {},
@@ -3407,7 +3569,7 @@ var Pt = {
3407
3569
  _: 3
3408
3570
  }, 8, ["open"])) : i("", !0);
3409
3571
  }
3410
- }), [["__scopeId", "data-v-44377f70"]]), ir = { class: "TableWrapper" }, ar = /* @__PURE__ */ I(/* @__PURE__ */ l({
3572
+ }), [["__scopeId", "data-v-44377f70"]]), sr = { class: "TableWrapper" }, cr = ["href", "download"], lr = /* @__PURE__ */ L(/* @__PURE__ */ l({
3411
3573
  __name: "DataTable",
3412
3574
  props: {
3413
3575
  data: {},
@@ -3420,6 +3582,11 @@ var Pt = {
3420
3582
  csv: {},
3421
3583
  filename: {},
3422
3584
  downloadMenuLink: { default: "Download" },
3585
+ downloadButton: {
3586
+ type: Boolean,
3587
+ default: !1
3588
+ },
3589
+ downloadLink: { type: [Boolean, String] },
3423
3590
  fullWidth: {
3424
3591
  type: Boolean,
3425
3592
  default: !1
@@ -3496,33 +3663,54 @@ var Pt = {
3496
3663
  }
3497
3664
  return n.join("\n");
3498
3665
  }
3499
- let S = n(() => [{
3666
+ function S() {
3667
+ J(x(), ee());
3668
+ }
3669
+ let C = n(() => c.downloadButton || c.downloadLink ? [] : [{
3500
3670
  label: c.downloadMenuLink,
3501
- action: () => q(x(), ee())
3502
- }]), C = n(() => !!c.menu);
3671
+ action: S
3672
+ }]), w = n(() => {
3673
+ if (c.downloadButton) return null;
3674
+ let e = c.downloadLink;
3675
+ return e ? typeof e == "string" ? e : "Download data (CSV)" : null;
3676
+ }), T = n(() => w.value ? `data:text/csv;charset=utf-8,${encodeURIComponent(x())}` : null), E = n(() => !!c.menu && C.value.length > 0);
3503
3677
  return (n, s) => (_(), a("div", { class: f(["TableOuter", {
3504
3678
  "full-width": t.fullWidth,
3505
- "has-menu": C.value
3506
- }]) }, [C.value ? (_(), r(me, {
3507
- key: 0,
3508
- items: S.value,
3509
- "force-dropdown": ""
3510
- }, null, 8, ["items"])) : i("", !0), o("div", ir, [o("table", { class: f(["Table", { "full-width": t.fullWidth }]) }, [
3511
- o("colgroup", null, [(_(!0), a(e, null, y(h.value, (e) => (_(), a("col", {
3512
- key: e.name,
3513
- style: m(u(e.name))
3514
- }, null, 4))), 128))]),
3515
- o("thead", null, [o("tr", null, [(_(!0), a(e, null, y(h.value, (e) => (_(), a("th", {
3516
- key: e.name,
3517
- style: m(d(e.name))
3518
- }, b(l(e.name)), 5))), 128))])]),
3519
- o("tbody", null, [(_(!0), a(e, null, y(g.value, (n) => (_(), a("tr", { key: n }, [(_(!0), a(e, null, y(h.value, (e) => (_(), a("td", {
3520
- key: e.name,
3521
- class: f(t.columnConfig?.[e.name]?.cellClass),
3522
- style: m(d(e.name))
3523
- }, b(v(e, n - 1)), 7))), 128))]))), 128))])
3524
- ], 2)])], 2));
3679
+ "has-menu": E.value
3680
+ }]) }, [
3681
+ E.value ? (_(), r(pe, {
3682
+ key: 0,
3683
+ items: C.value,
3684
+ "force-dropdown": ""
3685
+ }, null, 8, ["items"])) : i("", !0),
3686
+ o("div", sr, [o("table", { class: f(["Table", { "full-width": t.fullWidth }]) }, [
3687
+ o("colgroup", null, [(_(!0), a(e, null, y(h.value, (e) => (_(), a("col", {
3688
+ key: e.name,
3689
+ style: m(u(e.name))
3690
+ }, null, 4))), 128))]),
3691
+ o("thead", null, [o("tr", null, [(_(!0), a(e, null, y(h.value, (e) => (_(), a("th", {
3692
+ key: e.name,
3693
+ style: m(d(e.name))
3694
+ }, b(l(e.name)), 5))), 128))])]),
3695
+ o("tbody", null, [(_(!0), a(e, null, y(g.value, (n) => (_(), a("tr", { key: n }, [(_(!0), a(e, null, y(h.value, (e) => (_(), a("td", {
3696
+ key: e.name,
3697
+ class: f(t.columnConfig?.[e.name]?.cellClass),
3698
+ style: m(d(e.name))
3699
+ }, b(v(e, n - 1)), 7))), 128))]))), 128))])
3700
+ ], 2)]),
3701
+ t.downloadButton ? (_(), a("button", {
3702
+ key: 1,
3703
+ type: "button",
3704
+ class: "data-table-download-button",
3705
+ onClick: S
3706
+ }, b(t.downloadMenuLink), 1)) : w.value ? (_(), a("a", {
3707
+ key: 2,
3708
+ class: "data-table-download-link",
3709
+ href: T.value,
3710
+ download: `${ee()}.csv`
3711
+ }, b(w.value), 9, cr)) : i("", !0)
3712
+ ], 2));
3525
3713
  }
3526
- }), [["__scopeId", "data-v-d6b3bce8"]]);
3714
+ }), [["__scopeId", "data-v-20a55780"]]);
3527
3715
  //#endregion
3528
- export { Un as BarChart, rr as ChartTooltip, nr as ChoroplethMap, ar as DataTable, bn as LineChart };
3716
+ export { Kn as BarChart, or as ChartTooltip, ar as ChoroplethMap, lr as DataTable, bn as LineChart };