@adyen/lume-vue3 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,2925 @@
1
+ import { defineComponent as W, ref as R, openBlock as h, createElementBlock as w, mergeProps as j, createElementVNode as B, toDisplayString as Q, createCommentVNode as V, isRef as dt, computed as p, watch as X, toRefs as K, inject as Ve, reactive as we, onMounted as ie, unref as d, Fragment as Y, renderList as Z, createBlock as z, normalizeClass as q, normalizeStyle as vt, onBeforeUnmount as pt, watchEffect as ft, renderSlot as G, createTextVNode as he, useSlots as ne, withDirectives as Ft, withCtx as C, createSlots as se, vShow as zt, pushScopeId as Zt, popScopeId as Wt, provide as Ne, createVNode as ae, normalizeProps as le, guardReactiveProps as re, defineAsyncComponent as De, resolveDynamicComponent as Xt } from "vue";
2
+ import { format as Ut, ticks as Yt, scaleBand as ke, scaleLinear as be, line as Kt, area as Jt } from "d3";
3
+ import { createPopper as Qt } from "@popperjs/core";
4
+ import { sankeyLinkHorizontal as qt, sankey as en, sankeyJustify as tn } from "d3-sankey";
5
+ const nn = {
6
+ class: "axis__tick-label lume-typography--axis",
7
+ "pointer-events": "all",
8
+ "data-j-axis__tick-label": ""
9
+ }, on = /* @__PURE__ */ W({
10
+ __name: "lume-tick",
11
+ props: {
12
+ value: {
13
+ type: [String, Number],
14
+ required: !0
15
+ },
16
+ group: {
17
+ type: Object,
18
+ required: !0
19
+ },
20
+ ghost: {
21
+ type: Object,
22
+ required: !0
23
+ },
24
+ label: {
25
+ type: Object,
26
+ required: !0
27
+ },
28
+ gridline: {
29
+ type: Object,
30
+ required: !0
31
+ },
32
+ isHovered: {
33
+ type: Boolean,
34
+ default: !1
35
+ },
36
+ isHidden: {
37
+ type: Boolean,
38
+ default: !1
39
+ },
40
+ withGridlines: {
41
+ type: Boolean,
42
+ default: !0
43
+ }
44
+ },
45
+ emits: ["click", "mouseenter"],
46
+ setup(e, { expose: t, emit: n }) {
47
+ const o = R(null);
48
+ return t({ ref: o }), (a, l) => (h(), w("g", j(e.group, {
49
+ class: ["axis__tick", {
50
+ "axis__tick--hovered": e.isHovered,
51
+ "axis__tick--hidden": e.isHidden
52
+ }],
53
+ "data-j-axis__tick": "",
54
+ onMouseenter: l[0] || (l[0] = (r) => n("mouseenter", r)),
55
+ onClick: l[1] || (l[1] = (r) => n("click", r))
56
+ }), [
57
+ B("g", nn, [
58
+ B("rect", j(e.ghost, {
59
+ class: "axis__ghost",
60
+ fill: "url(#lume-tick-gradient)"
61
+ }), null, 16),
62
+ B("text", j(e.label, {
63
+ ref_key: "labelRef",
64
+ ref: o,
65
+ class: "axis__label"
66
+ }), Q(e.value), 17)
67
+ ]),
68
+ e.withGridlines ? (h(), w("line", j({ key: 0 }, e.gridline, { class: "axis__grid-line" }), null, 16)) : V("", !0)
69
+ ], 16));
70
+ }
71
+ });
72
+ const J = (e, t) => {
73
+ const n = e.__vccOpts || e;
74
+ for (const [o, a] of t)
75
+ n[o] = a;
76
+ return n;
77
+ }, Qe = /* @__PURE__ */ J(on, [["__scopeId", "data-v-59ddc0a6"]]);
78
+ function ht() {
79
+ return process.env.NODE_ENV === "production";
80
+ }
81
+ function mt(e) {
82
+ return (e == null ? void 0 : e.map(
83
+ (t) => t.values.map((n) => n == null ? void 0 : n.value).flat()
84
+ ).flat()) || [];
85
+ }
86
+ function Ce(e) {
87
+ return e.length === 1;
88
+ }
89
+ function an(e) {
90
+ return !!e && e.every(
91
+ (t) => "color" in t
92
+ );
93
+ }
94
+ function He(e) {
95
+ return !!e && typeof e == "object" && !Array.isArray(e);
96
+ }
97
+ function gt(e, t) {
98
+ const n = { ...e };
99
+ return Object.entries(t).forEach(([o, a]) => {
100
+ n[o] = He(e[o]) && He(a) ? gt(e[o], a) : a;
101
+ }), n;
102
+ }
103
+ function ln(e) {
104
+ return e != null && He(e) && "value" in e;
105
+ }
106
+ function pe(e) {
107
+ return (e == null ? void 0 : e.bandwidth) !== void 0;
108
+ }
109
+ function rn(e) {
110
+ return pe(e) ? e.step() : Math.max(...e.range()) / Math.max(...e.domain());
111
+ }
112
+ const un = (e, t) => {
113
+ if (!e)
114
+ throw new Error("Data is not a valid array");
115
+ if (e.length === 0)
116
+ throw new Error("Cannot get highest value from empty array");
117
+ e.forEach(({ values: n }) => {
118
+ if (n.length - 1 < t)
119
+ throw new Error("Index exceeds length of at least one of the datasets");
120
+ });
121
+ };
122
+ function sn(e, t) {
123
+ var n;
124
+ return un(e, t), ((n = e.reduce(
125
+ (o, a) => {
126
+ var l, r;
127
+ return (((l = o.values[t]) == null ? void 0 : l.value) ?? 0) > (((r = a.values[t]) == null ? void 0 : r.value) ?? 0) ? o : a;
128
+ }
129
+ ).values[t]) == null ? void 0 : n.value) || 0;
130
+ }
131
+ function Me(e) {
132
+ const t = dt(e) ? e.value : e;
133
+ if (!t)
134
+ throw new Error("No empty array can be created from specified data value");
135
+ const n = Math.max(
136
+ ...t.map((o) => o.values.length),
137
+ 0
138
+ );
139
+ return Array(n).fill(null);
140
+ }
141
+ function cn(e) {
142
+ return pe(e) ? e.domain().length : Math.max(...e.domain());
143
+ }
144
+ function dn(e, t) {
145
+ return (n) => Math.round(e * (1 - n) + t * n);
146
+ }
147
+ function vn(e, t, n) {
148
+ const o = n ? e.length - t : t, a = e.slice(0, o);
149
+ return e.slice(o).concat(a);
150
+ }
151
+ function fe(e) {
152
+ if (e.groups) {
153
+ const t = Object.keys(e);
154
+ return Object.assign(
155
+ {},
156
+ ...t.map((n) => n !== "groups" ? { [n]: e[n] } : {})
157
+ );
158
+ }
159
+ return e;
160
+ }
161
+ const pn = (e = 21) => crypto.getRandomValues(new Uint8Array(e)).reduce(
162
+ (t, n) => t += (n &= 63) < 36 ? n.toString(36) : n < 62 ? (n - 26).toString(36).toUpperCase() : n > 62 ? "-" : "_",
163
+ ""
164
+ );
165
+ var ue = /* @__PURE__ */ ((e) => (e.DatasetLength = `Our guidelines highly recommend not having more than 5 datasets in one chart.
166
+ Learn more: https://lume.design/guidelines/datasets`, e.ColorLoop = "Colors will loop around after the 5th dataset. You can prevent this by setting specific colors for your datasets.", e.Empty = "The dataset(s) provided are empty.", e.InvalidFormat = "The string provided to format is invalid. Please refer to https://github.com/d3/d3-format for valid arguments.", e.NotContainedInSvg = "This component is an `SVGElement`, thus it is required to be inside an `<svg>` container.", e.InvalidHoveredIndex = "The provided hovered index is not valid for the data of this chart.", e.InvalidHoveredElement = "The provided hovered element is not valid for the data of this diagram.", e))(ue || {});
167
+ const fn = "[lume] ";
168
+ function de(e, t = !0) {
169
+ t && ht() || console.warn(fn + "Warning: " + e);
170
+ }
171
+ const Le = (e) => {
172
+ let t = null;
173
+ switch (typeof e) {
174
+ case "string":
175
+ try {
176
+ t = Ut(e);
177
+ } catch {
178
+ de(ue.InvalidFormat), t = null;
179
+ }
180
+ break;
181
+ case "function":
182
+ t = e;
183
+ break;
184
+ default:
185
+ t = null;
186
+ }
187
+ function n(...o) {
188
+ return t ? t(...o) : o[0];
189
+ }
190
+ return n;
191
+ }, Te = () => ({
192
+ options: {
193
+ type: Object,
194
+ default: () => ({})
195
+ }
196
+ });
197
+ function oe(e, t) {
198
+ return { allOptions: p(() => {
199
+ const o = dt(t) ? t == null ? void 0 : t.value : t;
200
+ return o ? gt(o, e.value) : e.value;
201
+ }) };
202
+ }
203
+ const hn = 0.15;
204
+ function mn(e, t, n) {
205
+ const o = R(), a = p(() => Math.max(...e.value.range())), l = p(() => t.value.length);
206
+ function r() {
207
+ if (!t.value)
208
+ return;
209
+ const u = t.value.reduce(
210
+ (c, f) => c + f.ref.getBoundingClientRect().width,
211
+ 0
212
+ ), i = Math.ceil(u / l.value);
213
+ o.value = i + i * hn;
214
+ }
215
+ function s(u) {
216
+ if (!t.value)
217
+ return !0;
218
+ const i = t.value.length;
219
+ if (u === 0)
220
+ return !0;
221
+ const c = a.value / i, f = typeof n == "number" && n > 0 && n + 1 || Math.ceil(o.value / c);
222
+ return u % f === 0;
223
+ }
224
+ return X(t, r), { showTick: s };
225
+ }
226
+ var te = /* @__PURE__ */ ((e) => (e.Skyblue = "skyblue", e.Royalblue = "royalblue", e.Violet = "violet", e.Darkteal = "darkteal", e.Gold = "gold", e))(te || {}), _t = /* @__PURE__ */ ((e) => (e.Skyblue10 = "skyblue-10", e.Skyblue20 = "skyblue-20", e.Skyblue30 = "skyblue-30", e.Skyblue40 = "skyblue-40", e.Skyblue50 = "skyblue-50", e.Skyblue60 = "skyblue-60", e.Skyblue70 = "skyblue-70", e.Skyblue80 = "skyblue-80", e.Skyblue90 = "skyblue-90", e.Skyblue100 = "skyblue-100", e.Royalblue10 = "royalblue-10", e.Royalblue20 = "royalblue-20", e.Royalblue30 = "royalblue-30", e.Royalblue40 = "royalblue-40", e.Royalblue50 = "royalblue-50", e.Royalblue60 = "royalblue-60", e.Royalblue70 = "royalblue-70", e.Royalblue80 = "royalblue-80", e.Royalblue90 = "royalblue-90", e.Royalblue100 = "royalblue-100", e.Violet10 = "violet-10", e.Violet20 = "violet-20", e.Violet30 = "violet-30", e.Violet40 = "violet-40", e.Violet50 = "violet-50", e.Violet60 = "violet-60", e.Violet70 = "violet-70", e.Violet80 = "violet-80", e.Violet90 = "violet-90", e.Violet100 = "violet-100", e.Darkteal10 = "darkteal-10", e.Darkteal20 = "darkteal-20", e.Darkteal30 = "darkteal-30", e.Darkteal40 = "darkteal-40", e.Darkteal50 = "darkteal-50", e.Darkteal60 = "darkteal-60", e.Darkteal70 = "darkteal-70", e.Darkteal80 = "darkteal-80", e.Darkteal90 = "darkteal-90", e.Darkteal100 = "darkteal-100", e.Gold10 = "gold-10", e.Gold20 = "gold-20", e.Gold30 = "gold-30", e.Gold40 = "gold-40", e.Gold50 = "gold-50", e.Gold60 = "gold-60", e.Gold70 = "gold-70", e.Gold80 = "gold-80", e.Gold90 = "gold-90", e.Gold100 = "gold-100", e))(_t || {}), Se = /* @__PURE__ */ ((e) => (e.SkyTeal = "skyblue-darkteal", e.VioletRoyal = "violet-royalblue", e.VioletTeal = "violet-darkteal", e.GoldTeal = "gold-darkteal", e.GoldRoyal = "gold-royalblue", e))(Se || {}), yt = /* @__PURE__ */ ((e) => (e.Grey = "grey", e.Green = "green", e.Orange = "orange", e.Red = "red", e))(yt || {}), Pe = /* @__PURE__ */ ((e) => (e["01"] = "01", e["02"] = "02", e["03"] = "03", e["04"] = "04", e["05"] = "05", e["06"] = "06", e["07"] = "07", e["08"] = "08", e["09"] = "09", e))(Pe || {});
227
+ const N = {
228
+ HORIZONTAL: "horizontal",
229
+ VERTICAL: "vertical"
230
+ }, gn = {
231
+ SINGLE: "single",
232
+ GROUPED: "grouped",
233
+ STACKED: "stacked"
234
+ }, ve = {
235
+ VERTICAL: {
236
+ top: 16,
237
+ right: 0,
238
+ bottom: 28,
239
+ left: 24
240
+ },
241
+ HORIZONTAL: {
242
+ top: 16,
243
+ right: 0,
244
+ bottom: 28,
245
+ left: 24
246
+ }
247
+ }, kt = "No data", _n = 20, bt = 0.33, At = 0.5, Tt = 12, Ot = 8, yn = 1, kn = [
248
+ "auto",
249
+ "auto-start",
250
+ "auto-end",
251
+ "top",
252
+ "top-start",
253
+ "top-end",
254
+ "right",
255
+ "right-start",
256
+ "right-end",
257
+ "bottom",
258
+ "bottom-start",
259
+ "bottom-end",
260
+ "left",
261
+ "left-start",
262
+ "left-end"
263
+ ];
264
+ function $e(e) {
265
+ e != null && e.closest("svg") || de(ue.NotContainedInSvg);
266
+ }
267
+ const Lt = {
268
+ /** Displays a line for each tick. */
269
+ gridLines: !1,
270
+ /** Displays the axis title. */
271
+ withTitle: !0,
272
+ //
273
+ //// Tick settings
274
+ //
275
+ /** Controls if the tick labels should be displayed. */
276
+ showTicks: !0,
277
+ /** Amount of ticks to display in the axis. */
278
+ tickCount: 10,
279
+ /** Formatting string/function for the tick label. */
280
+ tickFormat: null,
281
+ /** Space between the tick label and the axis line. */
282
+ tickPadding: 8
283
+ }, bn = {
284
+ ...Lt,
285
+ withTitle: !1,
286
+ skip: !0
287
+ }, An = {
288
+ ...Lt,
289
+ gridLines: !0
290
+ }, Tn = function(e, t, n) {
291
+ const o = p(() => e.value.step() * e.value.paddingInner() / 2);
292
+ function a(u, i) {
293
+ return {
294
+ transform: `translate(${(e.value(i) ?? e.value(u)) - o.value}, 0)`
295
+ };
296
+ }
297
+ function l(u) {
298
+ var c;
299
+ const i = Math.max(
300
+ e.value.step(),
301
+ (u ? (c = u.getComputedTextLength) == null ? void 0 : c.call(u) : e.value.step()) + 20
302
+ );
303
+ return {
304
+ x: -(i - e.value.step()) / 2,
305
+ width: i,
306
+ height: n.value.tickPadding + Tt + Ot
307
+ };
308
+ }
309
+ function r() {
310
+ const u = e.value.step() / 2;
311
+ return {
312
+ x1: u,
313
+ x2: u,
314
+ y1: -t.value.height
315
+ // Negative height means it goes from bottom to top
316
+ };
317
+ }
318
+ function s() {
319
+ return {
320
+ x: e.value.step() / 2,
321
+ y: n.value.tickPadding,
322
+ dy: "0.8em",
323
+ "text-anchor": "middle"
324
+ };
325
+ }
326
+ return {
327
+ getGridLinesAttributes: r,
328
+ getTickGhostAttributes: l,
329
+ getTickGroupAttributes: a,
330
+ getTickLabelAttributes: s
331
+ };
332
+ }, On = function(e, t, n) {
333
+ const o = p(() => e.value.step() * e.value.paddingInner() / 2);
334
+ function a(u, i) {
335
+ return {
336
+ transform: `translate(0, ${(e.value(i) ?? e.value(u)) - o.value})`
337
+ };
338
+ }
339
+ function l(u) {
340
+ var c;
341
+ const i = (u ? (c = u.getComputedTextLength) == null ? void 0 : c.call(u) : 42) + n.value.tickPadding * 2;
342
+ return {
343
+ x: -i,
344
+ width: i,
345
+ height: e.value.step()
346
+ };
347
+ }
348
+ function r() {
349
+ const u = e.value.step() / 2;
350
+ return {
351
+ y1: u,
352
+ y2: u,
353
+ x1: t.value.width
354
+ };
355
+ }
356
+ function s() {
357
+ return {
358
+ x: -n.value.tickPadding,
359
+ y: e.value.step() / 2,
360
+ "text-anchor": "end",
361
+ "alignment-baseline": "middle"
362
+ };
363
+ }
364
+ return {
365
+ getGridLinesAttributes: r,
366
+ getTickGhostAttributes: l,
367
+ getTickGroupAttributes: a,
368
+ getTickLabelAttributes: s
369
+ };
370
+ }, Ln = function(e, t, n) {
371
+ const o = p(() => {
372
+ const u = e.value.ticks();
373
+ return u.length > 1 ? e.value(u[1]) - e.value(u[0]) : 0;
374
+ });
375
+ function a(u) {
376
+ return {
377
+ transform: `translate(${e.value(u)}, 0)`
378
+ };
379
+ }
380
+ function l() {
381
+ return {
382
+ height: n.value.tickPadding + Tt + Ot,
383
+ width: o.value,
384
+ x: -(o.value / 2)
385
+ };
386
+ }
387
+ function r() {
388
+ return {
389
+ y1: -t.value.height
390
+ };
391
+ }
392
+ function s() {
393
+ return {
394
+ y: n.value.tickPadding,
395
+ dy: "0.8em",
396
+ "text-anchor": "middle"
397
+ };
398
+ }
399
+ return {
400
+ getGridLinesAttributes: r,
401
+ getTickGhostAttributes: l,
402
+ getTickGroupAttributes: a,
403
+ getTickLabelAttributes: s
404
+ };
405
+ }, wn = function(e, t, n) {
406
+ const o = p(() => {
407
+ const u = e.value.ticks();
408
+ return u.length > 1 ? e.value(u[1]) - e.value(u[0]) : 0;
409
+ });
410
+ function a(u) {
411
+ return {
412
+ transform: `translate(0, ${e.value(u)})`
413
+ };
414
+ }
415
+ function l(u) {
416
+ var c;
417
+ const i = (((c = u == null ? void 0 : u.getComputedTextLength) == null ? void 0 : c.call(u)) || 0) + n.value.tickPadding * 2;
418
+ return {
419
+ width: i,
420
+ height: o.value,
421
+ x: -i,
422
+ y: -(o.value / 2)
423
+ };
424
+ }
425
+ function r() {
426
+ return {
427
+ x1: t.value.width
428
+ };
429
+ }
430
+ function s() {
431
+ return {
432
+ x: -n.value.tickPadding,
433
+ dy: "0.4em",
434
+ "text-anchor": "end"
435
+ };
436
+ }
437
+ return {
438
+ getGridLinesAttributes: r,
439
+ getTickGhostAttributes: l,
440
+ getTickGroupAttributes: a,
441
+ getTickLabelAttributes: s
442
+ };
443
+ }, $n = {
444
+ "x-band-scale-axis": Tn,
445
+ "y-band-scale-axis": On,
446
+ "x-linear-scale-axis": Ln,
447
+ "y-linear-scale-axis": wn
448
+ }, xn = ["transform"], In = { key: 0 }, En = /* @__PURE__ */ B("linearGradient", { id: "lume-tick-gradient" }, [
449
+ /* @__PURE__ */ B("stop", {
450
+ offset: "0%",
451
+ "stop-color": "rgba(255,255,255,0)"
452
+ }),
453
+ /* @__PURE__ */ B("stop", {
454
+ offset: "10%",
455
+ "stop-color": "var(--lume-chart-background-color)"
456
+ }),
457
+ /* @__PURE__ */ B("stop", {
458
+ offset: "90%",
459
+ "stop-color": "var(--lume-chart-background-color)"
460
+ }),
461
+ /* @__PURE__ */ B("stop", {
462
+ offset: "100%",
463
+ "stop-color": "rgba(255,255,255,0)"
464
+ })
465
+ ], -1), Nn = [
466
+ En
467
+ ];
468
+ var wt = /* @__PURE__ */ ((e) => (e.bandScale = "band-scale-axis", e.linearScale = "linear-scale-axis", e))(wt || {}), $t = /* @__PURE__ */ ((e) => (e.left = "left", e.bottom = "bottom", e))($t || {}), Be = /* @__PURE__ */ ((e) => (e.x = "bottom", e.y = "left", e))(Be || {});
469
+ const qe = /* @__PURE__ */ W({
470
+ __name: "lume-axis",
471
+ props: {
472
+ scale: {
473
+ type: Function,
474
+ required: !0
475
+ },
476
+ type: {
477
+ type: String,
478
+ default: void 0,
479
+ validator: (e) => e in Be
480
+ },
481
+ position: {
482
+ type: String,
483
+ default: void 0,
484
+ validator: (e) => e in $t
485
+ },
486
+ containerSize: {
487
+ type: Object,
488
+ default: () => ({ width: 0, height: 0 })
489
+ },
490
+ hoveredIndex: {
491
+ type: Number,
492
+ default: -1
493
+ },
494
+ orientation: {
495
+ type: String,
496
+ default: N.VERTICAL
497
+ },
498
+ ...Te()
499
+ },
500
+ emits: ["mouseenter", "click", "mouseleave"],
501
+ setup(e, { emit: t }) {
502
+ const n = e, { scale: o, containerSize: a, hoveredIndex: l, options: r, orientation: s } = K(n), u = Ve("isEmpty", R(!1)), i = we({}), c = R(null), f = R(null), m = R(null), A = p(
503
+ () => n.type ? Be[n.type] : n.position
504
+ ), v = p(
505
+ () => n.type || (A.value === "left" ? "y" : "x")
506
+ ), g = p(
507
+ () => v.value === "x" && s.value === N.VERTICAL || v.value === "y" && s.value === N.HORIZONTAL
508
+ ), { allOptions: T } = oe(
509
+ r,
510
+ v.value === "x" ? bn : An
511
+ ), { showTick: y } = mn(o, c, T.value.skip), E = p(() => {
512
+ var S, P, F, ee;
513
+ return v.value === "y" && u.value ? `translate(0, ${((S = a.value) == null ? void 0 : S.height) / 2})` : v.value === "x" && u.value ? `translate(-${((P = a.value) == null ? void 0 : P.width) / 2}, ${(F = a.value) == null ? void 0 : F.height})` : `translate(0, ${v.value === "x" ? (ee = a.value) == null ? void 0 : ee.height : 0})`;
514
+ }), D = p(() => {
515
+ if (pe(o.value))
516
+ return o.value.labels || o.value.domain();
517
+ const { tickCount: S } = T.value, [P, F] = o.value.domain();
518
+ return Yt(P, F, S);
519
+ }), $ = p(() => {
520
+ const { tickFormat: S } = T.value;
521
+ return Le(S);
522
+ }), L = p(
523
+ () => T.value.withHover && g.value && l.value > -1
524
+ );
525
+ function I(S) {
526
+ const { showTicks: P } = T.value;
527
+ return P === !1 ? "" : $.value(S);
528
+ }
529
+ function _(S, P, F) {
530
+ t("mouseenter", { index: g.value ? S : null, value: P, event: F });
531
+ }
532
+ function H(S, P, F) {
533
+ t("click", { index: S, value: P, event: F });
534
+ }
535
+ function O(S) {
536
+ if (!(!c.value || !c.value.length))
537
+ return c.value[S].ref;
538
+ }
539
+ function M() {
540
+ m.value = D.value.map(
541
+ (S, P) => ({
542
+ value: I(S),
543
+ group: i.getTickGroupAttributes(S, P),
544
+ ghost: i.getTickGhostAttributes(O(P)),
545
+ label: i.getTickLabelAttributes(),
546
+ gridline: i.getGridLinesAttributes()
547
+ })
548
+ );
549
+ }
550
+ function U() {
551
+ const S = o.value.step ? "bandScale" : "linearScale", P = $n[`${v.value}-${wt[S]}`];
552
+ Object.entries(P(o, a, T) || []).forEach(
553
+ ([F, ee]) => {
554
+ i[F] = ee;
555
+ }
556
+ );
557
+ }
558
+ return X(o, U, { flush: "sync", immediate: !0 }), X(o, M, { immediate: !0 }), X(c, M), ie(() => $e(f.value)), (S, P) => d(o) ? (h(), w("g", {
559
+ key: 0,
560
+ ref_key: "root",
561
+ ref: f,
562
+ class: "axis",
563
+ transform: E.value,
564
+ "data-j-axis": "",
565
+ onMouseleave: P[1] || (P[1] = (F) => t("mouseleave", F))
566
+ }, [
567
+ v.value === "x" ? (h(), w("defs", In, Nn)) : V("", !0),
568
+ (h(!0), w(Y, null, Z(m.value, (F, ee) => (h(), z(d(Qe), j({
569
+ key: `${F.value}_${ee}`,
570
+ ref_for: !0,
571
+ ref_key: "tickRefs",
572
+ ref: c
573
+ }, F, {
574
+ "is-hidden": d(T).skip && !d(y)(ee),
575
+ "with-gridlines": d(T).gridLines,
576
+ onMouseenter: (ye) => _(ee, F.value, ye),
577
+ onClick: (ye) => H(ee, F.value, ye)
578
+ }), null, 16, ["is-hidden", "with-gridlines", "onMouseenter", "onClick"]))), 128)),
579
+ L.value ? (h(), z(d(Qe), j({ key: 1 }, m.value[d(l)], {
580
+ "with-gridlines": !1,
581
+ "is-hovered": "",
582
+ onClick: P[0] || (P[0] = (F) => H(
583
+ d(l),
584
+ m.value[d(l)].value,
585
+ F
586
+ ))
587
+ }), null, 16)) : V("", !0)
588
+ ], 40, xn)) : V("", !0);
589
+ }
590
+ });
591
+ function Dn(e, t, n, o) {
592
+ const a = p(() => n.value > 0 && n.value < 1), l = p(
593
+ () => o.value > 0 && o.value < 1
594
+ ), r = p(
595
+ () => a.value ? e.value - 0.5 : e.value
596
+ // draws the 1px bar closer to the axis
597
+ ), s = p(
598
+ () => l.value ? t.value - 0.5 : t.value
599
+ // draws the 1px bar closer to the axis
600
+ );
601
+ return { computedX: r, computedY: s, shouldHaveMinWidth: a, shouldHaveMinHeight: l };
602
+ }
603
+ function Hn(e, t, n, o) {
604
+ const a = R(0), l = R(0), r = p(() => `${e.value + n.value / 2}px ${t.value + o.value / 2}px`);
605
+ return ie(() => {
606
+ a.value = n.value, l.value = o.value;
607
+ }), X(n, (s) => a.value = s), X(o, (s) => l.value = s), { computedWidth: a, computedHeight: l, transformOrigin: r };
608
+ }
609
+ const Mn = ["x", "y", "width", "height"], Bn = /* @__PURE__ */ W({
610
+ __name: "lume-bar",
611
+ props: {
612
+ x: {
613
+ type: Number,
614
+ default: 0
615
+ },
616
+ y: {
617
+ type: Number,
618
+ default: 0
619
+ },
620
+ width: {
621
+ type: Number,
622
+ required: !0
623
+ },
624
+ height: {
625
+ type: Number,
626
+ required: !0
627
+ },
628
+ classList: {
629
+ type: [String, Array],
630
+ default: ""
631
+ },
632
+ isFaded: {
633
+ type: Boolean,
634
+ default: !1
635
+ },
636
+ isNegative: {
637
+ type: Boolean,
638
+ default: !1
639
+ },
640
+ transition: {
641
+ type: [String, Boolean],
642
+ default: !1
643
+ }
644
+ },
645
+ emits: ["click", "mouseover", "mouseleave"],
646
+ setup(e, { emit: t }) {
647
+ const n = e, { x: o, y: a, width: l, height: r, transition: s, classList: u } = K(n), i = R(null), c = p(
648
+ () => typeof u.value == "string" ? [u.value] : u.value
649
+ ), f = p(() => s.value === "width"), m = p(() => s.value === "height"), A = Hn(o, a, l, r), { computedX: v, computedY: g, shouldHaveMinWidth: T, shouldHaveMinHeight: y } = Dn(o, a, l, r), E = p(() => T.value ? 1 : (f.value ? A.computedWidth : l).value), D = p(() => y.value ? 1 : (m.value ? A.computedHeight : r).value), $ = f.value || m.value ? A.transformOrigin : null;
650
+ return ie(() => $e(i.value)), (L, I) => (h(), w("rect", {
651
+ ref_key: "root",
652
+ ref: i,
653
+ class: q(["lume-bar", [
654
+ {
655
+ "lume-fill--faded": e.isFaded,
656
+ "lume-bar--negative": e.isNegative,
657
+ "lume-bar--transition-width": f.value,
658
+ "lume-bar--transition-height": m.value
659
+ },
660
+ ...c.value
661
+ ]]),
662
+ style: vt({ transformOrigin: d($) }),
663
+ x: d(v),
664
+ y: d(g),
665
+ width: E.value,
666
+ height: D.value,
667
+ "data-j-bar": "",
668
+ onClick: I[0] || (I[0] = (_) => t("click", _)),
669
+ onMouseover: I[1] || (I[1] = (_) => t("mouseover", _)),
670
+ onMouseleave: I[2] || (I[2] = (_) => t("mouseleave", _))
671
+ }, null, 46, Mn));
672
+ }
673
+ });
674
+ const Fe = /* @__PURE__ */ J(Bn, [["__scopeId", "data-v-8e8f732a"]]);
675
+ function Rn() {
676
+ const e = R(), t = we({
677
+ dimensions: {}
678
+ }), n = new ResizeObserver((o) => {
679
+ o.forEach((a) => {
680
+ t.dimensions = a.contentRect;
681
+ });
682
+ });
683
+ return ie(() => {
684
+ n.observe(e.value);
685
+ }), pt(() => {
686
+ n.unobserve(e.value);
687
+ }), { resizeState: t, resizeRef: e };
688
+ }
689
+ const jn = ["height"], Gn = ["transform"], Vn = /* @__PURE__ */ W({
690
+ __name: "lume-chart-container",
691
+ props: {
692
+ margins: {
693
+ type: Object,
694
+ default: () => ({})
695
+ },
696
+ containerSize: {
697
+ type: Object,
698
+ default: () => ({ width: 0, height: 0 })
699
+ },
700
+ transparentBackground: {
701
+ type: Boolean,
702
+ default: !1
703
+ },
704
+ noMinSize: {
705
+ type: Boolean,
706
+ default: !1
707
+ }
708
+ },
709
+ emits: ["click", "mouseenter", "mouseleave", "resize"],
710
+ setup(e, { emit: t }) {
711
+ const n = e, o = {
712
+ left: 0,
713
+ right: 0,
714
+ top: 0,
715
+ bottom: 0
716
+ }, { margins: a, containerSize: l } = K(n), r = R(null), { resizeRef: s, resizeState: u } = Rn(), i = p(() => ({
717
+ ...o,
718
+ // Default values
719
+ ...a.value
720
+ // Prop overrides
721
+ })), c = p(
722
+ () => l.value.height + i.value.top + i.value.bottom
723
+ );
724
+ return ft(() => {
725
+ if (!r.value)
726
+ return;
727
+ const { width: f } = u.dimensions, { height: m } = r.value.getBoundingClientRect();
728
+ if (!f || !m)
729
+ return;
730
+ const A = f - i.value.left - i.value.right, v = m - i.value.top - i.value.bottom, g = {
731
+ width: A > 0 ? A : 0,
732
+ height: v > 0 ? v : 0,
733
+ outerWidth: f,
734
+ outerHeight: m
735
+ };
736
+ t("resize", g);
737
+ }), (f, m) => (h(), w("div", {
738
+ ref_key: "resizeRef",
739
+ ref: s,
740
+ class: q(["lume-chart-container", {
741
+ "lume-chart-container--minimum": !e.noMinSize
742
+ }]),
743
+ "data-j-chart-container": ""
744
+ }, [
745
+ G(f.$slots, "header", {}, void 0, !0),
746
+ (h(), w("svg", {
747
+ ref_key: "root",
748
+ ref: r,
749
+ class: q(["lume-chart-container__svg", {
750
+ "lume-chart-container__svg--transparent": e.transparentBackground
751
+ }]),
752
+ height: c.value,
753
+ "data-j-chart-container__root": "",
754
+ onClick: m[0] || (m[0] = (A) => t("click", A)),
755
+ onMouseenter: m[1] || (m[1] = (A) => t("mouseenter", A)),
756
+ onMouseleave: m[2] || (m[2] = (A) => t("mouseleave", A))
757
+ }, [
758
+ B("g", {
759
+ transform: `translate(${i.value.left}, ${i.value.top})`,
760
+ class: "lume-chart-container__group",
761
+ "data-j-chart-container__group": ""
762
+ }, [
763
+ G(f.$slots, "default", {}, void 0, !0)
764
+ ], 8, Gn)
765
+ ], 42, jn)),
766
+ G(f.$slots, "footer", {}, void 0, !0),
767
+ G(f.$slots, "extra", {}, void 0, !0)
768
+ ], 2));
769
+ }
770
+ });
771
+ const Cn = /* @__PURE__ */ J(Vn, [["__scopeId", "data-v-d53fd184"]]), Sn = ["onClick", "onMouseenter"], Pn = /* @__PURE__ */ W({
772
+ __name: "lume-chart-legend",
773
+ props: {
774
+ data: {
775
+ type: Array,
776
+ validator: an,
777
+ required: !0
778
+ }
779
+ },
780
+ emits: ["click", "mouseenter", "mouseleave"],
781
+ setup(e, { emit: t }) {
782
+ const n = Ve("isEmpty");
783
+ return (o, a) => d(n) ? V("", !0) : (h(), w("div", {
784
+ key: 0,
785
+ class: "lume-chart-legend",
786
+ "data-j-chart-legend": "",
787
+ onMouseleave: a[0] || (a[0] = (l) => t("mouseleave"))
788
+ }, [
789
+ (h(!0), w(Y, null, Z(e.data, (l, r) => (h(), w("div", {
790
+ key: `legend-item-${r}`,
791
+ class: "lume-chart-legend__item lume-typography--body",
792
+ tabindex: "0",
793
+ "data-j-chart-legend__symbol-wrapper": "",
794
+ onClick: (s) => t("click", { index: r, dataset: l, event: s }),
795
+ onMouseenter: (s) => t("mouseenter", { index: r, dataset: l, event: s })
796
+ }, [
797
+ B("span", {
798
+ class: q(["lume-chart-legend__symbol", `lume-background-color--${l.color}`]),
799
+ "data-j-chart-legend__symbol": ""
800
+ }, null, 2),
801
+ he(" " + Q(l.label || r), 1)
802
+ ], 40, Sn))), 128))
803
+ ], 32));
804
+ }
805
+ });
806
+ const et = /* @__PURE__ */ J(Pn, [["__scopeId", "data-v-4710298b"]]);
807
+ const Fn = {}, zn = {
808
+ class: "lume-tooltip__title",
809
+ "data-j-tooltip__title": ""
810
+ };
811
+ function Zn(e, t) {
812
+ return h(), w("div", zn, [
813
+ G(e.$slots, "default", {}, void 0, !0)
814
+ ]);
815
+ }
816
+ const Wn = /* @__PURE__ */ J(Fn, [["render", Zn], ["__scopeId", "data-v-8af3fac6"]]);
817
+ const Xn = {}, Un = {
818
+ class: "lume-tooltip__item",
819
+ "data-j-tooltip__summary-item": ""
820
+ }, Yn = { class: "lume-tooltip__value" };
821
+ function Kn(e, t) {
822
+ return h(), w("li", Un, [
823
+ B("span", null, [
824
+ G(e.$slots, "default", {}, void 0, !0)
825
+ ]),
826
+ B("strong", Yn, [
827
+ G(e.$slots, "value", {}, void 0, !0)
828
+ ])
829
+ ]);
830
+ }
831
+ const Jn = /* @__PURE__ */ J(Xn, [["render", Kn], ["__scopeId", "data-v-4ed7ec1b"]]), Qn = {
832
+ class: "lume-tooltip__item",
833
+ "data-j-tooltip__item": ""
834
+ }, qn = { "data-j-tooltip__item__label": "" }, eo = {
835
+ class: "lume-tooltip__value",
836
+ "data-j-tooltip__item__value": ""
837
+ }, to = /* @__PURE__ */ W({
838
+ __name: "lume-tooltip-item",
839
+ props: {
840
+ color: {
841
+ type: String,
842
+ default: null
843
+ }
844
+ },
845
+ setup(e) {
846
+ return (t, n) => (h(), w("li", Qn, [
847
+ e.color ? (h(), w("span", {
848
+ key: 0,
849
+ class: q([[`lume-background-color--${e.color}`], "lume-tooltip__symbol"]),
850
+ "data-j-tooltip__item__symbol": ""
851
+ }, null, 2)) : V("", !0),
852
+ B("span", qn, [
853
+ G(t.$slots, "label", {}, void 0, !0)
854
+ ]),
855
+ B("strong", eo, [
856
+ G(t.$slots, "value", {}, void 0, !0)
857
+ ])
858
+ ]));
859
+ }
860
+ });
861
+ const no = /* @__PURE__ */ J(to, [["__scopeId", "data-v-4f995c3c"]]), oo = (e) => (Zt("data-v-57f370fa"), e = e(), Wt(), e), ao = { class: "lume-tooltip__items" }, lo = {
862
+ key: 0,
863
+ class: "lume-tooltip__break"
864
+ }, ro = /* @__PURE__ */ oo(() => /* @__PURE__ */ B("hr", null, null, -1)), uo = [
865
+ ro
866
+ ], io = /* @__PURE__ */ W({
867
+ __name: "lume-tooltip",
868
+ props: {
869
+ targetElement: {
870
+ type: Element,
871
+ default: null
872
+ },
873
+ items: {
874
+ type: Array,
875
+ required: !0
876
+ },
877
+ position: {
878
+ type: String,
879
+ default: "auto",
880
+ validator: (e) => kn.includes(e)
881
+ },
882
+ fixedPositioning: {
883
+ type: Boolean,
884
+ default: !1
885
+ },
886
+ modifiers: {
887
+ type: Array,
888
+ default: null
889
+ },
890
+ title: {
891
+ type: [String, Number],
892
+ default: null
893
+ },
894
+ summary: {
895
+ type: String,
896
+ default: null
897
+ },
898
+ ...Te()
899
+ },
900
+ emits: ["opened", "moved", "closed"],
901
+ setup(e, { emit: t }) {
902
+ const n = e, o = R(null), { items: a, options: l } = K(n), r = ne(), s = R(null), { allOptions: u } = oe(l), i = p(
903
+ () => u.value.fixedPositioning ?? n.fixedPositioning
904
+ ), c = p(
905
+ () => i.value ? "fixed" : "absolute"
906
+ ), f = p(() => [
907
+ {
908
+ name: "computeStyles",
909
+ options: {
910
+ adaptive: !1
911
+ // so that we can have smooth transitions
912
+ }
913
+ },
914
+ {
915
+ name: "offset",
916
+ options: { offset: [0, u.value.offset || 8] }
917
+ },
918
+ ...n.modifiers || []
919
+ ]), m = p(
920
+ () => u.value.showTitle !== !1 && n.title != null
921
+ ), A = p(() => Le(u.value.valueFormat)), v = p(() => Le(u.value.titleFormat)), g = p(
922
+ () => {
923
+ var $;
924
+ return (($ = a.value) == null ? void 0 : $.find((L) => L.isSummary)) || {
925
+ label: u.value.summary ?? n.summary
926
+ };
927
+ }
928
+ ), T = p(() => r.summary || g.value.label);
929
+ function y() {
930
+ n.targetElement && o.value && (s.value = Qt(n.targetElement, o.value, {
931
+ placement: n.position,
932
+ strategy: c.value,
933
+ modifiers: f.value
934
+ }), t("opened", n.targetElement));
935
+ }
936
+ function E() {
937
+ s.value && (s.value.destroy(), t("closed"));
938
+ }
939
+ function D() {
940
+ s.value && (o.value.classList.add("lume-tooltip--animated"), n.targetElement ? function() {
941
+ s.value.state.elements.reference = n.targetElement, s.value.update(), t("moved", n.targetElement);
942
+ }() : E());
943
+ }
944
+ return X(
945
+ () => n.targetElement,
946
+ ($, L) => {
947
+ !L && $ ? y() : D();
948
+ }
949
+ ), ie(y), pt(E), ($, L) => Ft((h(), w("div", {
950
+ ref_key: "root",
951
+ ref: o,
952
+ class: "lume-tooltip lume-typography--caption",
953
+ "data-j-tooltip": ""
954
+ }, [
955
+ G($.$slots, "default", {}, () => [
956
+ G($.$slots, "title", {}, () => [
957
+ m.value ? (h(), z(d(Wn), { key: 0 }, {
958
+ default: C(() => [
959
+ he(Q(v.value(e.title)), 1)
960
+ ]),
961
+ _: 1
962
+ })) : V("", !0)
963
+ ], !0),
964
+ B("ul", ao, [
965
+ G($.$slots, "summary", {}, () => [
966
+ T.value ? (h(), z(d(Jn), { key: 0 }, se({
967
+ default: C(() => [
968
+ he(Q(g.value.label) + " ", 1)
969
+ ]),
970
+ _: 2
971
+ }, [
972
+ g.value.value ? {
973
+ name: "value",
974
+ fn: C(() => [
975
+ he(Q(A.value(g.value.value)), 1)
976
+ ]),
977
+ key: "0"
978
+ } : void 0
979
+ ]), 1024)) : V("", !0)
980
+ ], !0),
981
+ T.value ? (h(), w("li", lo, uo)) : V("", !0),
982
+ G($.$slots, "items", {}, () => [
983
+ (h(!0), w(Y, null, Z(d(a), (I) => (h(), z(d(no), {
984
+ key: I.label,
985
+ color: I.color
986
+ }, {
987
+ label: C(() => [
988
+ he(Q(I.label), 1)
989
+ ]),
990
+ value: C(() => [
991
+ he(Q(A.value(I.value)), 1)
992
+ ]),
993
+ _: 2
994
+ }, 1032, ["color"]))), 128))
995
+ ], !0)
996
+ ])
997
+ ], !0)
998
+ ], 512)), [
999
+ [zt, e.targetElement]
1000
+ ]);
1001
+ }
1002
+ });
1003
+ const so = /* @__PURE__ */ J(io, [["__scopeId", "data-v-57f370fa"]]);
1004
+ var ce = /* @__PURE__ */ ((e) => (e.Categorical = "categorical", e.Sequential = "sequential", e.Divergent = "divergent", e))(ce || {});
1005
+ const co = ce.Categorical, xe = te.Skyblue, vo = Se.SkyTeal;
1006
+ function po(e) {
1007
+ return e === ce.Divergent ? vo : xe;
1008
+ }
1009
+ function fo(e) {
1010
+ return Object.values(Pe).includes(e);
1011
+ }
1012
+ function tt(e, t) {
1013
+ return t === ce.Divergent ? Object.values(Se).includes(e) : Object.values({
1014
+ ...te,
1015
+ ..._t,
1016
+ ...yt,
1017
+ ...Pe
1018
+ }).includes(e);
1019
+ }
1020
+ function ho(e, t) {
1021
+ const n = Object.values(te).indexOf(e);
1022
+ return vn(Object.values(te), n > -1 ? n : 0)[t];
1023
+ }
1024
+ function mo(e, t) {
1025
+ const n = 50 + t * 10;
1026
+ return `${e}-${n}`;
1027
+ }
1028
+ function go(e, t) {
1029
+ const n = (t + 1) * 10;
1030
+ return `${e}-${n}`;
1031
+ }
1032
+ function nt(e, t, n) {
1033
+ switch (t) {
1034
+ default:
1035
+ case ce.Categorical:
1036
+ return fo(e) ? e : ho(e, n);
1037
+ case ce.Sequential:
1038
+ return mo(e, n);
1039
+ case ce.Divergent:
1040
+ return go(e, n);
1041
+ }
1042
+ }
1043
+ function _o(e, t, n = co, o) {
1044
+ return tt(e, n) ? e : (o > 4 && (de(ue.ColorLoop), o = o % 5), tt(t, n) ? nt(t, n, o) : nt(po(n), n, o));
1045
+ }
1046
+ function yo(e) {
1047
+ return e.map((t) => ln(t) ? t : { value: t });
1048
+ }
1049
+ function ko(e) {
1050
+ return e.__internal === !0;
1051
+ }
1052
+ const ze = (e = null) => ({
1053
+ data: {
1054
+ type: Array,
1055
+ required: !0,
1056
+ validator: e || void 0
1057
+ },
1058
+ labels: {
1059
+ type: Array,
1060
+ default: void 0
1061
+ },
1062
+ color: {
1063
+ type: String,
1064
+ default: te.Skyblue
1065
+ },
1066
+ title: {
1067
+ type: String,
1068
+ default: null
1069
+ }
1070
+ });
1071
+ function Ze(e, t, n, o, a) {
1072
+ const l = we({
1073
+ width: 0,
1074
+ height: 0
1075
+ }), r = pn(12), s = p(() => {
1076
+ var c;
1077
+ return e.value.length > 5 && de(ue.DatasetLength), (c = e.value) == null ? void 0 : c.map(
1078
+ (f, m) => {
1079
+ if (ko(f))
1080
+ return f;
1081
+ const A = yo(f.values), v = _o(
1082
+ f.color,
1083
+ n == null ? void 0 : n.value,
1084
+ o == null ? void 0 : o.value.colorPalette,
1085
+ m
1086
+ );
1087
+ return {
1088
+ ...f,
1089
+ values: A,
1090
+ color: v,
1091
+ __internal: !0
1092
+ };
1093
+ }
1094
+ );
1095
+ }), u = p(() => Array.isArray(t.value) ? t.value : Me(e.value).map((c, f) => f));
1096
+ function i(c) {
1097
+ const f = (a == null ? void 0 : a.value) === N.HORIZONTAL && Me(e).length * (_n * 2) || c.height;
1098
+ l.width = c.width, l.height = f;
1099
+ }
1100
+ return {
1101
+ chartID: r,
1102
+ computedLabels: u,
1103
+ containerSize: l,
1104
+ internalData: s,
1105
+ updateSize: i
1106
+ };
1107
+ }
1108
+ const bo = () => ({
1109
+ xScale: {
1110
+ type: Function,
1111
+ default: null
1112
+ },
1113
+ yScale: {
1114
+ type: Function,
1115
+ default: null
1116
+ }
1117
+ });
1118
+ function Ao(e, t, n, o, a) {
1119
+ const l = R(null), r = R(null);
1120
+ function s() {
1121
+ const { width: u, height: i } = n;
1122
+ !u && !i || !t.value || !e.value || (o.value === N.HORIZONTAL ? (l.value = at(
1123
+ e.value,
1124
+ u,
1125
+ o.value,
1126
+ a.value.startOnZero
1127
+ ), r.value = ot(
1128
+ t.value,
1129
+ i,
1130
+ o.value,
1131
+ a.value
1132
+ )) : (l.value = ot(
1133
+ t.value,
1134
+ u,
1135
+ o.value,
1136
+ a.value
1137
+ ), r.value = at(
1138
+ e.value,
1139
+ i,
1140
+ o.value,
1141
+ a.value.startOnZero
1142
+ )));
1143
+ }
1144
+ return ft(s), { xScale: l, yScale: r };
1145
+ }
1146
+ function ot(e, t, n, o) {
1147
+ const a = [0, t], { padding: l, paddingInner: r, paddingOuter: s } = o, u = l ?? (n === N.HORIZONTAL ? At : bt);
1148
+ return Object.assign(
1149
+ ke().range(a).paddingInner(r ?? u).paddingOuter(s ?? u).domain(e.map((i, c) => c)),
1150
+ { labels: e }
1151
+ );
1152
+ }
1153
+ function at(e, t, n, o) {
1154
+ const a = mt(e).filter((c) => c != null), l = [0, t];
1155
+ if (a.length === 0)
1156
+ return be().range(l).domain([0, 0]).nice();
1157
+ const r = Math.min(...a), s = o && r > 0 ? 0 : r, u = Math.max(...a), i = n === N.HORIZONTAL ? [s, u] : [u, s];
1158
+ return be().range(l).domain(i).nice();
1159
+ }
1160
+ function lt(e) {
1161
+ return (e == null ? void 0 : e.range) !== void 0 || (e == null ? void 0 : e.copy) !== void 0;
1162
+ }
1163
+ function Re(e, t) {
1164
+ return pe(e) ? e.bandwidth() / 2 + e(e.domain()[t]) : e(t);
1165
+ }
1166
+ function rt(e, t, {
1167
+ padding: n,
1168
+ paddingInner: o,
1169
+ paddingOuter: a
1170
+ } = {}) {
1171
+ const l = n ?? (t === N.HORIZONTAL ? At : bt);
1172
+ return e.copy().paddingInner(o ?? l).paddingOuter(a ?? l / 2);
1173
+ }
1174
+ function xt(e) {
1175
+ return Object.values(N).includes(e);
1176
+ }
1177
+ const ge = (e, t = !0) => ({
1178
+ ...ze(e),
1179
+ ...bo(),
1180
+ ...Te(),
1181
+ classList: {
1182
+ type: [String, Array],
1183
+ default: () => []
1184
+ },
1185
+ hoveredIndex: {
1186
+ type: Number,
1187
+ default: null
1188
+ },
1189
+ ...t ? {
1190
+ orientation: {
1191
+ type: String,
1192
+ default: N.VERTICAL,
1193
+ validator: xt
1194
+ }
1195
+ } : {}
1196
+ }), To = (e) => ({
1197
+ ...ze(e),
1198
+ ...Te(),
1199
+ hoveredElement: {
1200
+ type: [Number, String],
1201
+ default: null
1202
+ }
1203
+ }), Ie = () => ({
1204
+ data: {
1205
+ type: Array,
1206
+ required: !0
1207
+ },
1208
+ labels: {
1209
+ type: Array,
1210
+ default: () => []
1211
+ },
1212
+ options: {
1213
+ type: Object,
1214
+ default: () => ({})
1215
+ },
1216
+ orientation: {
1217
+ type: String,
1218
+ default: N.VERTICAL,
1219
+ validator: xt
1220
+ },
1221
+ xScale: {
1222
+ type: Function,
1223
+ default: () => null
1224
+ },
1225
+ yScale: {
1226
+ type: Function,
1227
+ default: () => null
1228
+ },
1229
+ hoveredIndex: {
1230
+ type: Number,
1231
+ default: -1
1232
+ },
1233
+ containerSize: {
1234
+ type: Object,
1235
+ default: () => ({ width: 0, height: 0 })
1236
+ },
1237
+ transition: {
1238
+ type: Boolean,
1239
+ default: !0
1240
+ },
1241
+ classList: {
1242
+ type: [String, Array],
1243
+ default: () => []
1244
+ }
1245
+ }), Oo = { class: "lume-overlay-group" }, Lo = /* @__PURE__ */ W({
1246
+ __name: "lume-overlay-group",
1247
+ props: {
1248
+ ...Ie(),
1249
+ orientation: {
1250
+ type: String,
1251
+ default: N.VERTICAL
1252
+ }
1253
+ },
1254
+ emits: ["click", "lume__internal--hover", "mouseover"],
1255
+ setup(e, { emit: t }) {
1256
+ const n = e, { data: o, orientation: a, xScale: l, yScale: r } = K(n), s = p(() => Me(o));
1257
+ function u(i) {
1258
+ var T;
1259
+ const c = a.value === N.HORIZONTAL ? r.value : l.value, f = c.domain(), m = rn(c), A = ((T = c.paddingInner) == null ? void 0 : T.call(c)) ?? 0, v = m * A, g = pe(c) ? c(f[i]) - v / 2 : c(i) - m / 2;
1260
+ return a.value === N.HORIZONTAL ? {
1261
+ width: Math.max(...l.value.range()),
1262
+ height: m,
1263
+ transform: `translate(0, ${g})`
1264
+ } : {
1265
+ width: m,
1266
+ height: Math.max(...r.value.range()),
1267
+ transform: `translate(${g}, 0)`
1268
+ };
1269
+ }
1270
+ return (i, c) => (h(), w("g", Oo, [
1271
+ (h(!0), w(Y, null, Z(s.value, (f, m) => (h(), z(d(Fe), j(u(m), {
1272
+ key: `overlay-${m}`,
1273
+ "data-j-lume-overlay-group": m,
1274
+ transition: !1,
1275
+ "class-list": "lume-fill--transparent",
1276
+ onMouseover: (A) => t("lume__internal--hover", m),
1277
+ onClick: (A) => t("click", { index: m, event: A })
1278
+ }), null, 16, ["data-j-lume-overlay-group", "onMouseover", "onClick"]))), 128))
1279
+ ]));
1280
+ }
1281
+ });
1282
+ function wo(e) {
1283
+ return { hasNegativeValues: p(
1284
+ () => mt(e.value).some((n) => n < 0)
1285
+ ) };
1286
+ }
1287
+ function $o(e, t, n, o) {
1288
+ const a = p(
1289
+ () => o.value === N.HORIZONTAL
1290
+ ), l = p(
1291
+ () => {
1292
+ var i;
1293
+ return e.height - (a != null && a.value ? 0 : ((i = n.value) == null ? void 0 : i.call(n, 0)) || 0);
1294
+ }
1295
+ ), r = p(
1296
+ () => {
1297
+ var i;
1298
+ return a != null && a.value ? ((i = t.value) == null ? void 0 : i.call(t, 0)) || 0 : e.width;
1299
+ }
1300
+ ), s = p(
1301
+ () => {
1302
+ var i;
1303
+ return a != null && a.value ? "translate(0, 0)" : `translate(0, ${((i = n.value) == null ? void 0 : i.call(n, 0)) || 0})`;
1304
+ }
1305
+ );
1306
+ return { negativeBarAttributes: p(() => ({
1307
+ width: r.value,
1308
+ height: l.value,
1309
+ transform: s.value
1310
+ })) };
1311
+ }
1312
+ function xo(e) {
1313
+ return e.reduce((t, n) => n.values.map((o, a) => t[a] ? o.value > t[a] ? o.value : t[a] : o.value ?? 0), []);
1314
+ }
1315
+ function Io(e) {
1316
+ return e.reduce((t, n) => n.values.map((o, a) => {
1317
+ const l = o.value == null || o.value < 0 ? 0 : o.value;
1318
+ return t[a] ? t[a] + l : l;
1319
+ }), []);
1320
+ }
1321
+ const ut = {
1322
+ "stacked-bar": Io
1323
+ };
1324
+ function It(e, t, n, o, a, l, r) {
1325
+ const s = p(
1326
+ () => {
1327
+ var i;
1328
+ return t.value.withTooltip !== !1 && !((i = t.value.tooltipOptions) != null && i.targetElement);
1329
+ }
1330
+ );
1331
+ function u(i) {
1332
+ const c = r != null && r.value && ut[r.value] ? ut[r.value](i) : xo(i);
1333
+ e.value = c.map((f, m) => ({
1334
+ cx: (a == null ? void 0 : a.value) === N.HORIZONTAL ? n.value(f) : Re(n.value, m),
1335
+ cy: (a == null ? void 0 : a.value) === N.HORIZONTAL ? Re(o.value, m) : o.value(f)
1336
+ }));
1337
+ }
1338
+ return X(
1339
+ [n, o],
1340
+ () => {
1341
+ n.value && o.value && (l != null && l.value) && s.value && u(l.value);
1342
+ },
1343
+ { immediate: !0 }
1344
+ ), { shouldGenerateTooltipAnchors: s, updateTooltipAnchorAttributes: u };
1345
+ }
1346
+ function Eo() {
1347
+ const e = we({
1348
+ opened: !1,
1349
+ targetElement: null
1350
+ });
1351
+ return { tooltipConfig: e, showTooltip: (o) => {
1352
+ e.opened = !0, e.targetElement = o;
1353
+ }, hideTooltip: () => {
1354
+ e.opened = !1, e.targetElement = null;
1355
+ } };
1356
+ }
1357
+ function No(e) {
1358
+ return { getTooltipItems: p(
1359
+ () => (n) => e.value.map(({ color: o, label: a, values: l }) => {
1360
+ var r, s, u;
1361
+ return {
1362
+ color: ((r = l[n]) == null ? void 0 : r.color) || o,
1363
+ label: a,
1364
+ value: ((s = l[n]) == null ? void 0 : s.label) ?? ((u = l[n]) == null ? void 0 : u.value) ?? kt
1365
+ };
1366
+ })
1367
+ ) };
1368
+ }
1369
+ const Do = { class: "lume-chart__header" }, Ho = { class: "lume-chart__header-section" }, Mo = {
1370
+ key: 0,
1371
+ class: "lume-chart__title lume-chart-title lume-typography--display"
1372
+ }, Bo = { class: "lume-chart__controls" }, Ro = { class: "lume-chart__header-section" }, jo = {
1373
+ key: 0,
1374
+ class: "lume-chart__axis-title lume-axis-title lume-typography--body"
1375
+ }, Go = { key: 3 }, Vo = ["r"], Co = {
1376
+ key: 0,
1377
+ class: "lume-chart__axis-title lume-chart__axis-title--centered lume-axis-title"
1378
+ }, So = /* @__PURE__ */ W({
1379
+ __name: "lume-chart",
1380
+ props: {
1381
+ ...ge(),
1382
+ chartType: {
1383
+ type: String,
1384
+ default: null
1385
+ }
1386
+ },
1387
+ setup(e, { emit: t }) {
1388
+ const n = e, o = ne(), { data: a, labels: l, color: r, options: s, orientation: u, chartType: i } = K(n), c = R(-1), f = R(null), m = R(null), A = R([]), { allOptions: v } = oe(s), { internalData: g, computedLabels: T, containerSize: y, updateSize: E, chartID: D } = Ze(a, l, r, v, u), { xScale: $, yScale: L } = Ao(
1389
+ g,
1390
+ T,
1391
+ y,
1392
+ u,
1393
+ v
1394
+ ), I = p(() => {
1395
+ var b;
1396
+ return n.xScale ? lt(n.xScale) ? n.xScale : (b = n.xScale) == null ? void 0 : b.call(n, g.value, l.value, y) : $.value;
1397
+ }), _ = p(() => {
1398
+ var b;
1399
+ return n.yScale ? lt(n.yScale) ? n.yScale : (b = n.yScale) == null ? void 0 : b.call(n, g.value, l.value, y) : L.value;
1400
+ }), H = p(() => ({
1401
+ ...v.value.xAxisOptions,
1402
+ withHover: u.value === N.VERTICAL
1403
+ })), O = p(() => ({
1404
+ ...v.value.yAxisOptions,
1405
+ withHover: u.value === N.HORIZONTAL
1406
+ })), M = p(() => {
1407
+ var b;
1408
+ return (b = v.value.xAxisOptions) == null ? void 0 : b.title;
1409
+ }), U = p(() => {
1410
+ var b;
1411
+ return (b = v.value.yAxisOptions) == null ? void 0 : b.title;
1412
+ }), S = p(() => {
1413
+ var b;
1414
+ return ((b = v.value.xAxisOptions) == null ? void 0 : b.withTitle) !== !1 && M.value;
1415
+ }), P = p(() => {
1416
+ var b;
1417
+ return ((b = v.value.yAxisOptions) == null ? void 0 : b.withTitle) !== !1 && U.value;
1418
+ }), F = p(
1419
+ () => a.value.every((b) => !b.values.length)
1420
+ ), ee = p(() => {
1421
+ const b = [], { noBaseScales: k } = v.value;
1422
+ return k || b.push(() => !!(I.value && _.value)), b.every((x) => x() === !0);
1423
+ }), { hasNegativeValues: ye } = wo(g), { negativeBarAttributes: Rt } = $o(
1424
+ y,
1425
+ I,
1426
+ _,
1427
+ u
1428
+ ), { shouldGenerateTooltipAnchors: jt } = It(
1429
+ A,
1430
+ v,
1431
+ I,
1432
+ _,
1433
+ u,
1434
+ g,
1435
+ i
1436
+ ), { tooltipConfig: Ee, showTooltip: Gt, hideTooltip: Vt } = Eo(), { getTooltipItems: Xe } = No(g), Ct = p(
1437
+ () => v.value.withTooltip !== !1 && Ee.opened
1438
+ ), Ue = p(
1439
+ () => {
1440
+ var b;
1441
+ return ((b = v.value.tooltipOptions) == null ? void 0 : b.position) || "top";
1442
+ }
1443
+ );
1444
+ function Oe(b) {
1445
+ var k;
1446
+ if (b !== c.value && (v.value.withHover !== !1 && (c.value = b), v.value.withTooltip !== !1)) {
1447
+ const x = (k = v.value.tooltipOptions) != null && k.targetElement ? v.value.tooltipOptions.targetElement === "self" ? m.value.$el : v.value.tooltipOptions.targetElement : f.value[b];
1448
+ Gt(x);
1449
+ }
1450
+ }
1451
+ function Ye(b) {
1452
+ if (b > a.value[0].values.length - 1) {
1453
+ de(ue.InvalidHoveredIndex);
1454
+ return;
1455
+ }
1456
+ Oe(b);
1457
+ }
1458
+ function St() {
1459
+ Vt(), c.value = -1, t("chart-mouseleave");
1460
+ }
1461
+ function Ke({ index: b, value: k, event: x }) {
1462
+ b !== null && Oe(b), t("axis-mouseenter", { index: b, value: k, event: x });
1463
+ }
1464
+ function Je({ index: b, value: k, event: x }) {
1465
+ t("axis-click", { index: b, value: k, event: x });
1466
+ }
1467
+ return X(
1468
+ a,
1469
+ (b, k) => t("data-changed", { newValue: b, oldValue: k })
1470
+ ), X(
1471
+ l,
1472
+ (b, k) => t("labels-changed", { newValue: b, oldValue: k })
1473
+ ), X(F, (b) => b && de(ue.Empty), { immediate: !0 }), X(() => n.hoveredIndex, Ye), X(
1474
+ A,
1475
+ (b) => {
1476
+ b && n.hoveredIndex != null && c.value === -1 && Ye(n.hoveredIndex);
1477
+ },
1478
+ { flush: "post" }
1479
+ ), ie(() => {
1480
+ t("rendered"), o.groups || console.error('"groups" `<slot>` must have content.');
1481
+ }), Ne("chartID", D), Ne("isEmpty", F), Ne("tooltipAnchorAttributes", A), (b, k) => (h(), z(d(Cn), {
1482
+ id: `lume-chart_${d(D)}`,
1483
+ ref_key: "chartContainer",
1484
+ ref: m,
1485
+ margins: d(v).margins,
1486
+ "container-size": d(y),
1487
+ "no-min-size": d(v).noMinSize,
1488
+ "transparent-background": d(v).transparentBackground,
1489
+ "data-j-lume-chart": "",
1490
+ onResize: d(E),
1491
+ onClick: k[20] || (k[20] = (x) => t("chart-click", x)),
1492
+ onMouseenter: k[21] || (k[21] = (x) => t("chart-mouseenter", x)),
1493
+ onMouseleave: St
1494
+ }, {
1495
+ header: C(() => [
1496
+ B("div", Do, [
1497
+ B("div", Ho, [
1498
+ b.title ? (h(), w("h1", Mo, Q(b.title), 1)) : V("", !0),
1499
+ B("div", Bo, [
1500
+ G(b.$slots, "controls", {}, void 0, !0)
1501
+ ])
1502
+ ]),
1503
+ B("div", Ro, [
1504
+ P.value ? (h(), w("h3", jo, Q(U.value), 1)) : V("", !0),
1505
+ G(b.$slots, "legend", { data: d(g) }, () => [
1506
+ d(v).withLegend !== !1 && d(v).legendPosition !== "bottom" ? (h(), z(d(et), {
1507
+ key: 0,
1508
+ data: d(g),
1509
+ class: "lume-chart__legend",
1510
+ "data-j-lume-chart__legend": "",
1511
+ onClick: k[0] || (k[0] = (x) => t("legend-click", x)),
1512
+ onMouseenter: k[1] || (k[1] = (x) => t("legend-mouseenter", x)),
1513
+ onMouseleave: k[2] || (k[2] = (x) => t("legend-mouseleave"))
1514
+ }, null, 8, ["data"])) : V("", !0)
1515
+ ], !0)
1516
+ ])
1517
+ ])
1518
+ ]),
1519
+ footer: C(() => [
1520
+ S.value ? (h(), w("h3", Co, Q(M.value), 1)) : V("", !0),
1521
+ d(v).withLegend !== !1 && d(v).legendPosition == "bottom" ? (h(), z(d(et), {
1522
+ key: 1,
1523
+ data: d(g),
1524
+ class: "lume-chart__legend lume-chart__legend--bottom",
1525
+ "data-j-lume-chart__legend": "",
1526
+ onClick: k[14] || (k[14] = (x) => t("legend-click", x)),
1527
+ onMouseenter: k[15] || (k[15] = (x) => t("legend-mouseenter", x)),
1528
+ onMouseleave: k[16] || (k[16] = (x) => t("legend-mouseleave"))
1529
+ }, null, 8, ["data"])) : V("", !0)
1530
+ ]),
1531
+ extra: C(() => [
1532
+ G(b.$slots, "tooltip", j(d(Ee), {
1533
+ data: d(g),
1534
+ labels: d(T),
1535
+ title: d(T)[c.value],
1536
+ items: d(Xe)(c.value),
1537
+ position: Ue.value,
1538
+ withTooltip: d(v).withTooltip !== !1,
1539
+ hoveredIndex: c.value,
1540
+ options: d(v).tooltipOptions
1541
+ }), () => [
1542
+ Ct.value ? (h(), z(d(so), j({ key: 0 }, d(Ee), {
1543
+ position: Ue.value,
1544
+ title: d(T)[c.value],
1545
+ items: d(Xe)(c.value),
1546
+ options: d(v).tooltipOptions,
1547
+ "data-j-lume-chart__tooltip": "",
1548
+ onOpened: k[17] || (k[17] = (x) => t("tooltip-opened", {
1549
+ index: c.value,
1550
+ targetElement: x
1551
+ })),
1552
+ onMoved: k[18] || (k[18] = (x) => t("tooltip-moved", {
1553
+ index: c.value,
1554
+ targetElement: x
1555
+ })),
1556
+ onClosed: k[19] || (k[19] = (x) => t("tooltip-closed"))
1557
+ }), {
1558
+ default: C(() => [
1559
+ G(b.$slots, "tooltip-content", {
1560
+ data: d(g),
1561
+ labels: d(T),
1562
+ hoveredIndex: c.value
1563
+ }, void 0, !0)
1564
+ ]),
1565
+ _: 3
1566
+ }, 16, ["position", "title", "items", "options"])) : V("", !0)
1567
+ ], !0)
1568
+ ]),
1569
+ default: C(() => [
1570
+ ee.value ? (h(), w(Y, { key: 0 }, [
1571
+ d(ye) ? (h(), z(d(Fe), j({ key: 0 }, d(Rt), {
1572
+ "class-list": "lume-fill--negative",
1573
+ transition: !1,
1574
+ "data-j-lume-chart__negative-values": ""
1575
+ }), null, 16)) : V("", !0),
1576
+ d(v).withAxes !== !1 ? G(b.$slots, "axes", {
1577
+ key: 1,
1578
+ xScale: I.value,
1579
+ yScale: _.value,
1580
+ containerSize: d(y),
1581
+ options: d(v),
1582
+ hoveredIndex: c.value
1583
+ }, () => [
1584
+ ae(d(qe), {
1585
+ type: "x",
1586
+ scale: I.value,
1587
+ "container-size": d(y),
1588
+ options: H.value,
1589
+ "hovered-index": c.value,
1590
+ orientation: d(u),
1591
+ "data-j-lume-chart__x-axis": "",
1592
+ onClick: Je,
1593
+ onMouseenter: Ke,
1594
+ onMouseleave: k[3] || (k[3] = (x) => t("axis-mouseleave"))
1595
+ }, null, 8, ["scale", "container-size", "options", "hovered-index", "orientation"]),
1596
+ ae(d(qe), {
1597
+ type: "y",
1598
+ scale: _.value,
1599
+ "container-size": d(y),
1600
+ options: O.value,
1601
+ "hovered-index": c.value,
1602
+ orientation: d(u),
1603
+ "data-j-lume-chart__y-axis": "",
1604
+ onClick: Je,
1605
+ onMouseenter: Ke,
1606
+ onMouseleave: k[4] || (k[4] = (x) => t("axis-mouseleave"))
1607
+ }, null, 8, ["scale", "container-size", "options", "hovered-index", "orientation"])
1608
+ ], !0) : V("", !0),
1609
+ d(v).withHover !== !1 ? (h(), z(d(Lo), {
1610
+ key: 2,
1611
+ data: d(g),
1612
+ orientation: d(u),
1613
+ "x-scale": I.value,
1614
+ "y-scale": _.value,
1615
+ "data-j-lume-chart__overlay-group": "",
1616
+ "onLume__internal-Hover": Oe
1617
+ }, null, 8, ["data", "orientation", "x-scale", "y-scale"])) : V("", !0),
1618
+ d(jt) ? (h(), w("g", Go, [
1619
+ (h(!0), w(Y, null, Z(A.value, (x, Pt) => (h(), w("circle", j(x, {
1620
+ ref_for: !0,
1621
+ ref_key: "tooltipAnchor",
1622
+ ref: f,
1623
+ key: `anchor_${Pt}`,
1624
+ r: d(yn),
1625
+ class: "lume-fill--transparent"
1626
+ }), null, 16, Vo))), 128))
1627
+ ])) : V("", !0),
1628
+ G(b.$slots, "groups", {
1629
+ data: d(g),
1630
+ labels: d(T),
1631
+ options: d(v),
1632
+ orientation: d(u),
1633
+ xScale: I.value,
1634
+ yScale: _.value,
1635
+ hoveredIndex: c.value,
1636
+ containerSize: d(y),
1637
+ transition: d(v).withTransition !== !1,
1638
+ classList: b.classList,
1639
+ onNodeClick: k[5] || (k[5] = (x) => t("node-click", x)),
1640
+ onNodeMouseenter: k[6] || (k[6] = (x) => t("node-mouseenter", x)),
1641
+ onNodeMouseleave: k[7] || (k[7] = (x) => t("node-mouseleave", x)),
1642
+ onLinkClick: k[8] || (k[8] = (x) => t("link-click", x)),
1643
+ onLinkMouseenter: k[9] || (k[9] = (x) => t("link-mouseenter", x)),
1644
+ onLinkMouseleave: k[10] || (k[10] = (x) => t("link-mouseleave", x)),
1645
+ onBarClick: k[11] || (k[11] = (x) => t("bar-click", x)),
1646
+ onLineClick: k[12] || (k[12] = (x) => t("line-click", x)),
1647
+ onPointClick: k[13] || (k[13] = (x) => t("point-click", x)),
1648
+ "onLume__internal-Hover": Oe
1649
+ }, void 0, !0)
1650
+ ], 64)) : V("", !0)
1651
+ ]),
1652
+ _: 3
1653
+ }, 8, ["id", "margins", "container-size", "no-min-size", "transparent-background", "onResize"]));
1654
+ }
1655
+ });
1656
+ const _e = /* @__PURE__ */ J(So, [["__scopeId", "data-v-19d7190c"]]);
1657
+ function it(e, t) {
1658
+ return {
1659
+ x0: 0 + (t ? t.left : 0),
1660
+ y0: 0 + (t ? t.top : 0),
1661
+ x1: e.width - (t ? t.right : 0),
1662
+ y1: e.height - (t ? t.bottom : 0)
1663
+ };
1664
+ }
1665
+ function Po(e) {
1666
+ const t = R(it(e));
1667
+ function n(o) {
1668
+ t.value = it(e, o);
1669
+ }
1670
+ return { extents: t, updateExtents: n };
1671
+ }
1672
+ var Et = /* @__PURE__ */ ((e) => (e.GraphProblem = "There was an issue generating your alluvial graph.", e))(Et || {});
1673
+ const Fo = "[lume] ";
1674
+ function zo(e, t, n = !0) {
1675
+ n && ht() || console.error(Fo + "Error: " + e, t);
1676
+ }
1677
+ const st = 8, Zo = 8, Wo = 20, Xo = 200;
1678
+ function me(e) {
1679
+ return typeof e == "string" || typeof e == "number" ? e : e.id ?? e.label;
1680
+ }
1681
+ function Ae(e) {
1682
+ return e.source.id + ":" + e.target.id;
1683
+ }
1684
+ function Uo(e, t) {
1685
+ return t.nodes.find((n) => n.id === e);
1686
+ }
1687
+ function Yo(e, t) {
1688
+ return t.links.find((n) => Ae(n) === e);
1689
+ }
1690
+ function Nt(e) {
1691
+ return !!(e.sourceLinks && e.targetLinks);
1692
+ }
1693
+ function Ko(e, t) {
1694
+ if (!t)
1695
+ return;
1696
+ const n = e.nodes.filter((r) => r.targetLinks.length === 0).map((r) => `${r.id}`), o = e.nodes.filter((r) => r.sourceLinks.length === 0).map((r) => `${r.id}`), a = t.filter((r) => n.includes(r.dataset.id)).reduce(
1697
+ (r, s) => Math.max(r, s.getBBox().width),
1698
+ -1 / 0
1699
+ ), l = t.filter((r) => o.includes(r.dataset.id)).reduce(
1700
+ (r, s) => Math.max(r, s.getBBox().width),
1701
+ -1 / 0
1702
+ );
1703
+ return {
1704
+ left: a,
1705
+ top: 0,
1706
+ right: l,
1707
+ bottom: 0
1708
+ };
1709
+ }
1710
+ function Jo(e) {
1711
+ return e.map((t) => ({
1712
+ x: t.x0,
1713
+ y: t.y0,
1714
+ width: t.x1 - t.x0,
1715
+ height: t.y1 - t.y0,
1716
+ textTransform: {
1717
+ x: t.depth > 0 ? t.x1 + st : t.x0 - st,
1718
+ y: (t.y1 + t.y0) / 2
1719
+ },
1720
+ node: t
1721
+ }));
1722
+ }
1723
+ function Qo(e) {
1724
+ const t = qt();
1725
+ return e.map((n) => {
1726
+ var o;
1727
+ return {
1728
+ id: Ae(n),
1729
+ color: n.color || ((o = n.source) == null ? void 0 : o.color) || xe,
1730
+ d: t(n),
1731
+ strokeWidth: Math.max(1, n.width),
1732
+ link: n
1733
+ };
1734
+ });
1735
+ }
1736
+ function ct(e, t, n, o, a) {
1737
+ if (o === !1) {
1738
+ e.node = {
1739
+ ...e.node,
1740
+ transitionValue: a ? void 0 : n
1741
+ };
1742
+ return;
1743
+ }
1744
+ const l = Date.now(), r = dn(t, n), s = () => {
1745
+ let i = (Date.now() - l) / Xo;
1746
+ i > 1 && (i = 1), e.node = {
1747
+ ...e.node,
1748
+ transitionValue: a && i === 1 ? void 0 : r(i)
1749
+ }, i < 1 && requestAnimationFrame(s);
1750
+ };
1751
+ requestAnimationFrame(s);
1752
+ }
1753
+ const qo = {
1754
+ nodes: [],
1755
+ links: []
1756
+ };
1757
+ function ea(e, t, n) {
1758
+ const o = R(null), a = p(() => {
1759
+ var s;
1760
+ return (s = e.value) == null ? void 0 : s[0].values.map(({ label: u, color: i, value: c }) => ({
1761
+ label: u || c.toString(),
1762
+ color: i,
1763
+ id: c
1764
+ }));
1765
+ }), l = p(() => {
1766
+ var s;
1767
+ return (s = e.value) == null ? void 0 : s[0].values.map(
1768
+ (u) => {
1769
+ var i;
1770
+ return (i = u.targets) == null ? void 0 : i.map(({ node: c, value: f, color: m }) => ({
1771
+ color: m,
1772
+ source: u.value ?? u.label,
1773
+ target: c,
1774
+ value: f
1775
+ }));
1776
+ }
1777
+ ).filter(Boolean).flat();
1778
+ }), r = p(() => en().nodeId(me).nodeAlign(t.value.nodeAlign).nodePadding(t.value.nodePadding).nodeSort(t.value.nodeSort).nodeWidth(t.value.nodeWidth).linkSort(t.value.linkSort));
1779
+ return X([r, n], () => {
1780
+ try {
1781
+ const { x0: s, y0: u, x1: i, y1: c } = n.value;
1782
+ o.value = r.value.extent([
1783
+ [s, u],
1784
+ [i, c]
1785
+ ])({ nodes: a.value, links: l.value });
1786
+ } catch (s) {
1787
+ zo(Et.GraphProblem, s), o.value = qo;
1788
+ }
1789
+ }), { graph: o };
1790
+ }
1791
+ function je(e, t) {
1792
+ return t || (t = {}), e.targetLinks && e.targetLinks.forEach(({ source: n, value: o }) => {
1793
+ t[n.id] = o, je(n, t);
1794
+ }), t;
1795
+ }
1796
+ function Ge(e, t) {
1797
+ return t || (t = {}), e.sourceLinks && e.sourceLinks.forEach(({ target: n, value: o }) => {
1798
+ t[n.id] = o, Ge(n, t);
1799
+ }), t;
1800
+ }
1801
+ function ta(e, t) {
1802
+ return t.links.reduce((n, o) => (o.source.id in e && o.target.id in e && n.push(Ae(o)), n), []);
1803
+ }
1804
+ const na = (e, t) => {
1805
+ let n;
1806
+ Nt(e) ? n = {
1807
+ [e.id]: e.value,
1808
+ ...je(e),
1809
+ ...Ge(e)
1810
+ } : n = {
1811
+ [e.source.id]: e.source.value,
1812
+ [e.target.id]: e.target.value,
1813
+ ...je(e.source),
1814
+ ...Ge(e.target)
1815
+ };
1816
+ const o = ta(n, t);
1817
+ return { nodes: n, links: o };
1818
+ }, oa = (e) => {
1819
+ if (Nt(e)) {
1820
+ const t = [...e.sourceLinks, ...e.targetLinks];
1821
+ return {
1822
+ nodes: t.reduce(
1823
+ (n, { source: o, target: a, value: l }) => o === e ? { ...n, [me(a)]: l } : { ...n, [me(o)]: l },
1824
+ { [me(e)]: e.value }
1825
+ ),
1826
+ links: t.map((n) => Ae(n))
1827
+ };
1828
+ }
1829
+ return {
1830
+ nodes: {
1831
+ [me(e.target)]: e.value,
1832
+ [me(e.source)]: e.source.value
1833
+ },
1834
+ links: [Ae(e)]
1835
+ };
1836
+ };
1837
+ function aa(e, t, n) {
1838
+ const o = R(null), a = p(() => o.value ? typeof t.value.highlightedElements == "function" ? t.value.highlightedElements(
1839
+ o.value,
1840
+ n.value
1841
+ ) : t.value.highlightedElements === "closest" ? oa(o.value, n.value) : na(o.value, n.value) : { nodes: {}, links: [] });
1842
+ return X(a, (l, r) => {
1843
+ if (l.links.length === 0 && Object.keys(l.nodes).length === 0) {
1844
+ e.value.forEach((s) => {
1845
+ s.node.id in r.nodes && ct(
1846
+ s,
1847
+ r.nodes[s.node.id],
1848
+ s.node.value,
1849
+ t.value.withTransition,
1850
+ !0
1851
+ );
1852
+ });
1853
+ return;
1854
+ }
1855
+ e.value.forEach((s) => {
1856
+ s.node.id in l.nodes && ct(
1857
+ s,
1858
+ s.node.value,
1859
+ l.nodes[s.node.id],
1860
+ t.value.withTransition
1861
+ );
1862
+ });
1863
+ }), { highlightedElements: a, hoveredElement: o };
1864
+ }
1865
+ const la = {
1866
+ class: "lume-alluvial-group",
1867
+ "data-j-alluvial-group": ""
1868
+ }, ra = { key: 0 }, ua = ["x", "y"], ia = ["d", "stroke-width", "onClick", "onMouseover"], sa = ["d", "stroke-dasharray", "stroke-dashoffset", "stroke-width", "data-id", "onClick", "onMouseover"], ca = ["onClick", "onMouseenter", "onMouseleave", "onMouseover"], da = ["x", "y", "height", "width"], va = ["transform", "data-id"], pa = ["textContent"], fa = ["textContent"], ha = /* @__PURE__ */ W({
1869
+ __name: "lume-alluvial-group",
1870
+ props: {
1871
+ ...Ie(),
1872
+ hoveredElementId: {
1873
+ type: [Number, String],
1874
+ default: null
1875
+ }
1876
+ },
1877
+ emits: ["node-click", "node-mouseenter", "node-mouseleave", "link-click", "link-mouseenter", "link-mouseleave"],
1878
+ setup(e, { emit: t }) {
1879
+ const n = e, { data: o, options: a } = K(n), l = R([]), r = R([]), s = R(null), { extents: u, updateExtents: i } = Po(n.containerSize), { graph: c } = ea(o, a, u), { hoveredElement: f, highlightedElements: m } = aa(
1880
+ l,
1881
+ a,
1882
+ c
1883
+ ), A = p(() => Le(a.value.valueFormat)), v = p(
1884
+ () => Object.keys(m.value.nodes)
1885
+ ), g = p(
1886
+ () => l.value.reduce((_, H) => {
1887
+ const O = H.x + a.value.nodeWidth / 2;
1888
+ return _.includes(O) ? _ : [..._, O];
1889
+ }, []).sort((_, H) => _ - H)
1890
+ // Make sure positions are sorted in ascending order
1891
+ ), T = p(() => {
1892
+ if (!(!a.value.nodeHeaders || !a.value.nodeHeaders.length))
1893
+ return a.value.nodeHeaders.slice(0, g.value.length).map((_, H) => ({
1894
+ label: _,
1895
+ x: g.value[H]
1896
+ }));
1897
+ }), y = p(
1898
+ () => a.value.nodeHeaderPadding ?? Wo
1899
+ );
1900
+ function E(_) {
1901
+ return v.value.length > 0 && !v.value.includes(_.toString());
1902
+ }
1903
+ function D(_) {
1904
+ return m.value.links.length > 0 && !m.value.links.includes(_);
1905
+ }
1906
+ function $(_, H) {
1907
+ _ !== f.value && (f.value = _, t("link-mouseenter", { link: _, event: H }));
1908
+ }
1909
+ function L(_) {
1910
+ const H = f.value;
1911
+ f.value = null, t("link-mouseleave", { link: H, event: _ });
1912
+ }
1913
+ function I(_) {
1914
+ if (_ == null) {
1915
+ f.value = null;
1916
+ return;
1917
+ }
1918
+ const H = Uo(_, c.value) || Yo(_, c.value);
1919
+ if (!H) {
1920
+ de(ue.InvalidHoveredElement);
1921
+ return;
1922
+ }
1923
+ f.value = H;
1924
+ }
1925
+ return X(c, (_) => {
1926
+ l.value = Jo(_.nodes), r.value = Qo(_.links).reverse(), f.value == null && n.hoveredElementId != null && I(n.hoveredElementId);
1927
+ }), X([n.containerSize, s], () => {
1928
+ if (n.containerSize.width && n.containerSize.height) {
1929
+ const _ = Ko(c.value, s.value);
1930
+ i(_);
1931
+ }
1932
+ }), X(() => n.hoveredElementId, I), (_, H) => (h(), w("g", la, [
1933
+ T.value ? (h(), w("g", ra, [
1934
+ (h(!0), w(Y, null, Z(T.value, (O) => (h(), w("text", {
1935
+ key: `header_${O.x}`,
1936
+ x: O.x,
1937
+ y: -y.value,
1938
+ class: "lume-alluvial-group__node-header lume-typography--caption"
1939
+ }, Q(O.label), 9, ua))), 128))
1940
+ ])) : V("", !0),
1941
+ B("g", {
1942
+ class: "lume-alluvial-link-group",
1943
+ onMouseleave: L
1944
+ }, [
1945
+ (h(!0), w(Y, null, Z(r.value, (O) => (h(), w("path", {
1946
+ key: `link-ghost_${O.id}`,
1947
+ class: q(["lume-alluvial-group__link", [
1948
+ "lume-stroke--transparent",
1949
+ "lume-alluvial-group__link--ghost"
1950
+ ]]),
1951
+ d: O.d,
1952
+ "stroke-width": O.strokeWidth + d(Zo),
1953
+ "data-j-alluvial-ghost": "",
1954
+ onClick: (M) => t("link-click", { link: O.link, event: M }),
1955
+ onMouseover: (M) => $(O.link, M)
1956
+ }, null, 40, ia))), 128)),
1957
+ (h(!0), w(Y, null, Z(r.value, (O) => (h(), w("path", {
1958
+ key: `link_${O.id}`,
1959
+ class: q(["lume-alluvial-group__link", {
1960
+ [`lume-stroke--${O.color}`]: O.color,
1961
+ "lume-alluvial-group__link--faded": D(O.id)
1962
+ }]),
1963
+ d: O.d,
1964
+ "stroke-dasharray": _.containerSize.width,
1965
+ "stroke-dashoffset": _.containerSize.width,
1966
+ "stroke-width": O.strokeWidth,
1967
+ "data-j-alluvial-path": "",
1968
+ "data-id": O.id,
1969
+ onClick: (M) => t("link-click", { link: O.link, event: M }),
1970
+ onMouseover: (M) => $(O.link, M)
1971
+ }, null, 42, sa))), 128))
1972
+ ], 32),
1973
+ (h(!0), w(Y, null, Z(l.value, (O, M) => (h(), w("g", {
1974
+ key: `node-block_${M}`,
1975
+ class: q(["lume-alluvial-group__node", {
1976
+ "lume-alluvial-group__node--faded": E(O.node.id)
1977
+ }]),
1978
+ "data-j-alluvial-group__node-block": ""
1979
+ }, [
1980
+ B("g", {
1981
+ onClick: (U) => t("node-click", { node: O.node, event: U }),
1982
+ onMouseenter: (U) => t("node-mouseenter", { node: O.node, event: U }),
1983
+ onMouseleave: (U) => t("node-mouseleave", { node: O.node, event: U }),
1984
+ onMouseover: (U) => f.value = O.node,
1985
+ onMouseout: H[0] || (H[0] = (U) => f.value = null)
1986
+ }, [
1987
+ B("rect", {
1988
+ class: q(`lume-alluvial-group__node-block--${O.node.color || d(xe)}`),
1989
+ x: O.x,
1990
+ y: O.y,
1991
+ height: O.height,
1992
+ width: O.width
1993
+ }, null, 10, da),
1994
+ B("text", {
1995
+ ref_for: !0,
1996
+ ref_key: "nodeTextRefs",
1997
+ ref: s,
1998
+ class: q(["lume-alluvial-group__node-text lume-typography--caption", {
1999
+ "lume-alluvial-group__node-text--right": O.node.depth === 0
2000
+ }]),
2001
+ transform: `translate(${O.textTransform.x},${O.textTransform.y})`,
2002
+ "data-id": O.node.id
2003
+ }, [
2004
+ B("tspan", {
2005
+ class: "lume-alluvial-group__node-title",
2006
+ textContent: Q(O.node.label)
2007
+ }, null, 8, pa),
2008
+ B("tspan", {
2009
+ class: "lume-alluvial-group__node-value",
2010
+ x: "0",
2011
+ dy: "1.2em",
2012
+ textContent: Q(
2013
+ A.value(
2014
+ O.node.transitionValue || O.node.value,
2015
+ O.node.value
2016
+ )
2017
+ )
2018
+ }, null, 8, fa)
2019
+ ], 10, va)
2020
+ ], 40, ca)
2021
+ ], 2))), 128))
2022
+ ]));
2023
+ }
2024
+ });
2025
+ const ma = /* @__PURE__ */ J(ha, [["__scopeId", "data-v-8ba64716"]]), ga = {
2026
+ margins: {
2027
+ top: 0,
2028
+ right: 0,
2029
+ bottom: 0,
2030
+ left: 0
2031
+ },
2032
+ withAxes: !1,
2033
+ withTooltip: !1,
2034
+ withHover: !1,
2035
+ withLegend: !1,
2036
+ // Alluvial options
2037
+ highlightedElements: "full",
2038
+ nodePadding: 16,
2039
+ nodeWidth: 16,
2040
+ nodeAlign: tn,
2041
+ valueFormat: (e) => String(e)
2042
+ }, al = /* @__PURE__ */ W({
2043
+ __name: "lume-alluvial-diagram",
2044
+ props: {
2045
+ ...To(Ce)
2046
+ },
2047
+ setup(e) {
2048
+ const t = e, n = fe(ne()), { options: o } = K(t), { allOptions: a } = oe(o, ga);
2049
+ function l(r) {
2050
+ return {
2051
+ ...r,
2052
+ noBaseScales: !0
2053
+ // Alluvial chart never uses base scales
2054
+ };
2055
+ }
2056
+ return (r, s) => (h(), z(d(_e), j(t, {
2057
+ options: l(d(a)),
2058
+ "data-j-alluvial-diagram": ""
2059
+ }), se({
2060
+ groups: C((u) => [
2061
+ ae(d(ma), j(u, { "hovered-element-id": r.hoveredElement }), null, 16, ["hovered-element-id"])
2062
+ ]),
2063
+ _: 2
2064
+ }, [
2065
+ Z(d(n), (u, i) => ({
2066
+ name: i,
2067
+ fn: C((c) => [
2068
+ G(r.$slots, i, le(re(c || {})))
2069
+ ])
2070
+ }))
2071
+ ]), 1040, ["options"]));
2072
+ }
2073
+ });
2074
+ var Dt = /* @__PURE__ */ ((e) => (e.grouped = "grouped", e.stacked = "stacked", e))(Dt || {});
2075
+ const ll = /* @__PURE__ */ W({
2076
+ __name: "lume-bar-chart",
2077
+ props: {
2078
+ ...ge(),
2079
+ type: {
2080
+ type: String,
2081
+ default: null,
2082
+ validator: (e) => e in Dt || e == null
2083
+ }
2084
+ },
2085
+ setup(e) {
2086
+ const t = e, n = De(
2087
+ () => import("./common/42f5d2fc.js")
2088
+ ), o = De(
2089
+ () => import("./common/abc9d23d.js")
2090
+ ), a = De(
2091
+ () => import("./common/0664fd4d.js")
2092
+ ), l = /* @__PURE__ */ new Map([
2093
+ ["single", n],
2094
+ ["grouped", o],
2095
+ ["stacked", a]
2096
+ ]), r = fe(ne());
2097
+ function s(i) {
2098
+ return {
2099
+ ...i,
2100
+ startOnZero: !0,
2101
+ // Bar chart always starts on zero,
2102
+ tooltipOptions: {
2103
+ ...(i == null ? void 0 : i.tooltipOptions) || {},
2104
+ position: t.orientation === N.HORIZONTAL && "right"
2105
+ }
2106
+ };
2107
+ }
2108
+ const u = p(() => {
2109
+ if (t.data) {
2110
+ if (Ce(t.data))
2111
+ return l.get("single");
2112
+ if (!t.type)
2113
+ throw new Error("Bar chart needs a type when there's multiple datasets.");
2114
+ return l.get(t.type);
2115
+ }
2116
+ });
2117
+ return (i, c) => (h(), z(Xt(u.value), j({ ...t, ...i.$attrs }, {
2118
+ options: s(i.options)
2119
+ }), se({ _: 2 }, [
2120
+ Z(d(r), (f, m) => ({
2121
+ name: m,
2122
+ fn: C((A) => [
2123
+ G(i.$slots, m, le(re(A || {})))
2124
+ ])
2125
+ }))
2126
+ ]), 1040, ["options"]));
2127
+ }
2128
+ });
2129
+ function _a(e) {
2130
+ return Object.values(gn).includes(e) || e == null;
2131
+ }
2132
+ function ya(e) {
2133
+ return Object.values(N).includes(e);
2134
+ }
2135
+ const ka = (e = !1) => ({
2136
+ type: {
2137
+ type: String,
2138
+ default: null,
2139
+ validator: _a
2140
+ },
2141
+ ...e ? {
2142
+ orientation: {
2143
+ type: String,
2144
+ default: N.VERTICAL,
2145
+ validator: ya
2146
+ }
2147
+ } : {}
2148
+ });
2149
+ function Ht(e) {
2150
+ const t = p(() => e.value.map((o) => ({
2151
+ ...o,
2152
+ values: o.values.map((a) => ({
2153
+ ...a,
2154
+ value: (a == null ? void 0 : a.value) || 0
2155
+ }))
2156
+ }))), n = p(() => {
2157
+ var o;
2158
+ return (o = t.value) == null ? void 0 : o.reduce((a, l) => (l.values.forEach((r, s) => {
2159
+ a[s] ? a[s].push(r) : a[s] = [r];
2160
+ }), a), []);
2161
+ });
2162
+ return { multiBarData: t, groupedData: n };
2163
+ }
2164
+ function ba(e, t) {
2165
+ return e.value.length === 1 ? "single" : t.value;
2166
+ }
2167
+ function Aa(e, t, n) {
2168
+ const o = p(
2169
+ () => n.value === N.HORIZONTAL
2170
+ );
2171
+ function a(s) {
2172
+ Math.min(...s.domain()) > 0 && console.error("Bar linear scale domain cannot start above 0!");
2173
+ }
2174
+ const l = p(() => o.value ? (() => (a(e.value), e.value))() : e.value), r = p(() => o.value ? t.value : (() => (a(t.value), t.value))());
2175
+ return { barXScale: l, barYScale: r };
2176
+ }
2177
+ function Ta(e, t, n, o, a, l) {
2178
+ const r = p(
2179
+ () => o.value === N.HORIZONTAL
2180
+ );
2181
+ function s(f, m) {
2182
+ let A, v;
2183
+ return r.value ? (A = f >= 0 ? t.value(0) : t.value(f), v = n.value(n.value.domain()[m])) : (A = t.value(t.value.domain()[m]), v = f < 0 ? n.value(0) : n.value(f)), { x: A, y: v };
2184
+ }
2185
+ function u(f) {
2186
+ return r.value ? f < 0 ? t.value(0) - t.value(f) : t.value(f) - t.value(0) : t.value.bandwidth();
2187
+ }
2188
+ function i(f) {
2189
+ return r.value ? n.value.bandwidth() : f < 0 ? n.value(f) - n.value(0) : n.value(0) - n.value(f);
2190
+ }
2191
+ function c(f, m, A) {
2192
+ const { value: v, color: g } = f, T = g ?? e.value[m].color ?? xe, { x: y, y: E } = s(v, A), D = u(v), $ = i(v);
2193
+ return {
2194
+ classList: [`lume-fill--${T}`, ...l],
2195
+ x: y,
2196
+ y: E,
2197
+ width: D,
2198
+ height: $,
2199
+ isFaded: a.value !== -1 && a.value !== A,
2200
+ isNegative: v < 0
2201
+ };
2202
+ }
2203
+ return { barAttributeGenerator: c };
2204
+ }
2205
+ function Oa(e, t, n, o, a, l) {
2206
+ const r = p(
2207
+ () => o.value === N.HORIZONTAL
2208
+ ), s = p(() => ke().domain(e.value.map((v, g) => g)).range([0, t.value.bandwidth()]).padding(0)), u = p(() => ke().domain(e.value.map((v, g) => g)).range([0, n.value.bandwidth()]).padding(0));
2209
+ function i(v, g, T) {
2210
+ if (r.value)
2211
+ return v >= 0 ? t.value(0) : t.value(v);
2212
+ const y = t.value.domain();
2213
+ return t.value(y[g]) + s.value(T);
2214
+ }
2215
+ function c(v, g, T) {
2216
+ if (r.value) {
2217
+ const y = n.value.domain();
2218
+ return n.value(y[g]) + u.value(T);
2219
+ }
2220
+ return v < 0 ? n.value(0) : n.value(v);
2221
+ }
2222
+ function f(v) {
2223
+ return r.value ? v < 0 ? t.value(0) - t.value(v) : t.value(v) - t.value(0) : s.value.bandwidth();
2224
+ }
2225
+ function m(v) {
2226
+ return r.value ? u.value.bandwidth() : v < 0 ? n.value(v) - n.value(0) : n.value(0) - n.value(v);
2227
+ }
2228
+ function A(v, g, T) {
2229
+ const { value: y, color: E } = v, D = E ?? e.value[g].color ?? Object.values(te)[g], $ = i(y, T, g), L = c(y, T, g), I = f(y), _ = m(y);
2230
+ return {
2231
+ classList: [`lume-fill--${D}`, ...l],
2232
+ x: $,
2233
+ y: L,
2234
+ width: I,
2235
+ height: _,
2236
+ isFaded: a.value !== -1 && a.value !== T,
2237
+ isNegative: y < 0
2238
+ };
2239
+ }
2240
+ return { barAttributeGenerator: A };
2241
+ }
2242
+ function La(e, t) {
2243
+ const n = p(
2244
+ () => t.value === N.HORIZONTAL
2245
+ ), o = p(() => {
2246
+ const s = e.value.map(
2247
+ (u) => u.filter((i) => i.value < 0).reduce((i, c) => i + c.value, 0)
2248
+ );
2249
+ return Math.min(...s);
2250
+ }), a = p(() => {
2251
+ const s = e.value.map(
2252
+ (u) => u.reduce(
2253
+ (i, c) => c.value >= 0 ? i + c.value : i,
2254
+ 0
2255
+ )
2256
+ );
2257
+ return Math.max(...s);
2258
+ });
2259
+ function l(s, u, i) {
2260
+ return n.value ? be().domain([o.value, a.value]).range([0, i.width]) : Object.assign(
2261
+ rt(
2262
+ ke().domain(u.map((c, f) => f)).range([0, i.width])
2263
+ ),
2264
+ { labels: u }
2265
+ );
2266
+ }
2267
+ function r(s, u, i) {
2268
+ return n.value ? Object.assign(
2269
+ rt(
2270
+ ke().domain(u.map((c, f) => f)).range([0, i.height])
2271
+ ),
2272
+ { labels: u }
2273
+ ) : be().domain([a.value, o.value]).range([0, i.height]);
2274
+ }
2275
+ return { stackedXScaleGenerator: l, stackedYScaleGenerator: r };
2276
+ }
2277
+ function wa(e, t, n, o, a, l) {
2278
+ const r = p(
2279
+ () => o.value === N.HORIZONTAL
2280
+ ), s = p(
2281
+ () => r.value ? n.value.domain() : t.value.domain()
2282
+ ), u = p(
2283
+ () => e.value.map((y) => y.values.map((E) => E == null ? void 0 : E.value))
2284
+ );
2285
+ function i(y, E, D) {
2286
+ let $, L;
2287
+ return r.value ? ($ = t.value(y >= 0 ? 0 + D : y + D), L = n.value(s.value[E])) : ($ = t.value(s.value[E]), L = n.value(y >= 0 ? y + D : 0 + D)), { x: $, y: L };
2288
+ }
2289
+ function c(y) {
2290
+ return r.value ? t.value(y) - t.value(0) : t.value.bandwidth();
2291
+ }
2292
+ function f(y) {
2293
+ return r.value ? t.value(0) - t.value(y) : t.value.bandwidth();
2294
+ }
2295
+ function m(y) {
2296
+ return r.value ? n.value.bandwidth() : n.value(0) - n.value(y);
2297
+ }
2298
+ function A(y) {
2299
+ return r.value ? n.value.bandwidth() : n.value(y) - n.value(0);
2300
+ }
2301
+ function v(y, E) {
2302
+ return y ? u.value.reduce((D, $, L) => (L < y && $[E] >= 0 && (D += $[E]), D), 0) : 0;
2303
+ }
2304
+ function g(y, E) {
2305
+ return y ? u.value.reduce((D, $, L) => (L < y && $[E] < 0 && (D += $[E]), D), 0) : 0;
2306
+ }
2307
+ function T(y, E, D) {
2308
+ const { value: $, color: L } = y, I = $ >= 0 ? c($) : f($), _ = $ >= 0 ? m($) : A($), H = $ >= 0 ? v(E, D) : g(E, D), { x: O, y: M } = i($, D, H);
2309
+ return {
2310
+ classList: [`lume-fill--${L ?? e.value[E].color ?? Object.values(te)[E]}`, ...l],
2311
+ width: I,
2312
+ height: _,
2313
+ x: O,
2314
+ y: M,
2315
+ isFaded: a.value !== -1 && a.value !== D,
2316
+ isNegative: $ < 0
2317
+ };
2318
+ }
2319
+ return { barAttributeGenerator: T };
2320
+ }
2321
+ const $a = {
2322
+ class: "lume-bar-group",
2323
+ "data-j-bars-group": ""
2324
+ }, xa = ["onMouseenter"], Ia = {
2325
+ single: Ta,
2326
+ grouped: Oa,
2327
+ stacked: wa
2328
+ }, We = /* @__PURE__ */ W({
2329
+ __name: "lume-bar-group",
2330
+ props: {
2331
+ ...Ie(),
2332
+ classList: {
2333
+ type: [String, Array],
2334
+ default: () => []
2335
+ },
2336
+ ...ka(!0),
2337
+ transition: {
2338
+ type: Boolean,
2339
+ default: !0
2340
+ }
2341
+ },
2342
+ emits: ["bar-click", "lume__internal--hover"],
2343
+ setup(e, { emit: t }) {
2344
+ const n = e, {
2345
+ data: o,
2346
+ hoveredIndex: a,
2347
+ orientation: l,
2348
+ transition: r,
2349
+ type: s,
2350
+ xScale: u,
2351
+ yScale: i,
2352
+ classList: c
2353
+ } = K(n), { groupedData: f } = Ht(o), { barXScale: m, barYScale: A } = Aa(u, i, l), v = p(() => typeof c.value == "string" ? [c.value] : c.value), g = p(() => {
2354
+ const y = ba(o, s), { barAttributeGenerator: E } = Ia[y](
2355
+ o,
2356
+ m,
2357
+ A,
2358
+ l,
2359
+ a,
2360
+ v.value
2361
+ );
2362
+ return E;
2363
+ }), T = p(() => {
2364
+ if (r.value)
2365
+ return l.value === N.HORIZONTAL ? "width" : "height";
2366
+ });
2367
+ return (y, E) => (h(), w("g", $a, [
2368
+ (h(!0), w(Y, null, Z(d(f), (D, $) => (h(), w("g", {
2369
+ key: $,
2370
+ onMouseenter: (L) => t("lume__internal--hover", $)
2371
+ }, [
2372
+ (h(!0), w(Y, null, Z(D, (L, I) => (h(), z(d(Fe), j(g.value(L, I, $, D), {
2373
+ key: `bar-${I}`,
2374
+ transition: T.value,
2375
+ "data-j-lume-bar": "",
2376
+ onClick: (_) => t("bar-click", {
2377
+ index: $,
2378
+ datasetIndex: I,
2379
+ event: _
2380
+ })
2381
+ }), null, 16, ["transition", "onClick"]))), 128))
2382
+ ], 40, xa))), 128))
2383
+ ]));
2384
+ }
2385
+ }), Ea = {
2386
+ [N.VERTICAL]: {
2387
+ withTooltip: !0,
2388
+ xAxisOptions: {},
2389
+ yAxisOptions: { gridLines: !0 },
2390
+ margins: ve.VERTICAL
2391
+ },
2392
+ [N.HORIZONTAL]: {
2393
+ withTooltip: !0,
2394
+ xAxisOptions: { gridLines: !0 },
2395
+ yAxisOptions: { gridLines: !1 },
2396
+ margins: ve.HORIZONTAL
2397
+ }
2398
+ }, rl = /* @__PURE__ */ W({
2399
+ __name: "lume-single-bar-chart",
2400
+ props: {
2401
+ ...ge(Ce)
2402
+ },
2403
+ setup(e) {
2404
+ const t = e, n = fe(ne()), { orientation: o, options: a } = K(t), l = p(
2405
+ () => Ea[o.value || N.VERTICAL]
2406
+ // needs to be computed so that default options are reactive
2407
+ ), { allOptions: r } = oe(a, l);
2408
+ return (s, u) => (h(), z(d(_e), j(t, {
2409
+ "chart-type": "single-bar",
2410
+ options: d(r),
2411
+ "data-j-single-bar-chart": ""
2412
+ }), se({
2413
+ groups: C((i) => [
2414
+ ae(d(We), j(i, { orientation: d(o) }), null, 16, ["orientation"])
2415
+ ]),
2416
+ _: 2
2417
+ }, [
2418
+ Z(d(n), (i, c) => ({
2419
+ name: c,
2420
+ fn: C((f) => [
2421
+ G(s.$slots, c, le(re(f || {})))
2422
+ ])
2423
+ }))
2424
+ ]), 1040, ["options"]));
2425
+ }
2426
+ }), Na = {
2427
+ [N.VERTICAL]: {
2428
+ withTooltip: !0,
2429
+ xAxisOptions: {},
2430
+ yAxisOptions: { gridLines: !0 },
2431
+ margins: ve.VERTICAL
2432
+ },
2433
+ [N.HORIZONTAL]: {
2434
+ withTooltip: !0,
2435
+ xAxisOptions: { gridLines: !0 },
2436
+ yAxisOptions: { gridLines: !1 },
2437
+ margins: ve.HORIZONTAL,
2438
+ tooltipOptions: { position: "right" }
2439
+ }
2440
+ }, ul = /* @__PURE__ */ W({
2441
+ __name: "lume-grouped-bar-chart",
2442
+ props: {
2443
+ ...ge()
2444
+ },
2445
+ setup(e) {
2446
+ const t = e, n = fe(ne()), { orientation: o, options: a } = K(t), l = p(
2447
+ () => Na[o.value || N.VERTICAL]
2448
+ // needs to be computed so that default options are reactive
2449
+ ), { allOptions: r } = oe(
2450
+ a,
2451
+ l
2452
+ );
2453
+ return (s, u) => (h(), z(d(_e), j(t, {
2454
+ "chart-type": "grouped-bar",
2455
+ options: d(r),
2456
+ "data-j-grouped-bar-chart": ""
2457
+ }), se({
2458
+ groups: C((i) => [
2459
+ ae(d(We), j(i, { type: "grouped" }), null, 16)
2460
+ ]),
2461
+ _: 2
2462
+ }, [
2463
+ Z(d(n), (i, c) => ({
2464
+ name: c,
2465
+ fn: C((f) => [
2466
+ G(s.$slots, c, le(re(f || {})))
2467
+ ])
2468
+ }))
2469
+ ]), 1040, ["options"]));
2470
+ }
2471
+ }), Da = {
2472
+ [N.VERTICAL]: {
2473
+ withTooltip: !0,
2474
+ xAxisOptions: {},
2475
+ yAxisOptions: { gridLines: !0 },
2476
+ margins: ve.VERTICAL
2477
+ },
2478
+ [N.HORIZONTAL]: {
2479
+ withTooltip: !0,
2480
+ xAxisOptions: { gridLines: !0 },
2481
+ yAxisOptions: { gridLines: !1 },
2482
+ margins: ve.HORIZONTAL,
2483
+ tooltipOptions: { position: "right" }
2484
+ }
2485
+ }, il = /* @__PURE__ */ W({
2486
+ __name: "lume-stacked-bar-chart",
2487
+ props: {
2488
+ ...ge()
2489
+ },
2490
+ setup(e) {
2491
+ const t = e, n = fe(ne()), { data: o, orientation: a, options: l } = K(t), r = p(
2492
+ () => Da[a.value || N.VERTICAL]
2493
+ // needs to be computed so that default options are reactive
2494
+ ), { allOptions: s } = oe(
2495
+ l,
2496
+ r
2497
+ ), { internalData: u } = Ze(o), { groupedData: i } = Ht(u), { stackedXScaleGenerator: c, stackedYScaleGenerator: f } = La(
2498
+ i,
2499
+ a
2500
+ );
2501
+ return (m, A) => (h(), z(d(_e), j(t, {
2502
+ "chart-type": "stacked-bar",
2503
+ options: d(s),
2504
+ "x-scale": d(c),
2505
+ "y-scale": d(f),
2506
+ "data-j-stacked-bar-chart": ""
2507
+ }), se({
2508
+ groups: C((v) => [
2509
+ ae(d(We), j(v, { type: "stacked" }), null, 16)
2510
+ ]),
2511
+ _: 2
2512
+ }, [
2513
+ Z(d(n), (v, g) => ({
2514
+ name: g,
2515
+ fn: C((T) => [
2516
+ G(m.$slots, g, le(re(T || {})))
2517
+ ])
2518
+ }))
2519
+ ]), 1040, ["options", "x-scale", "y-scale"]));
2520
+ }
2521
+ }), Ha = ["d", "stroke-width"], Ma = 2, Ba = /* @__PURE__ */ W({
2522
+ __name: "lume-line",
2523
+ props: {
2524
+ pathDefinition: {
2525
+ type: String,
2526
+ required: !0
2527
+ },
2528
+ width: {
2529
+ type: Number,
2530
+ default: Ma
2531
+ },
2532
+ color: {
2533
+ type: String,
2534
+ default: te.Skyblue
2535
+ },
2536
+ dashed: {
2537
+ type: Boolean,
2538
+ default: !1
2539
+ },
2540
+ transition: {
2541
+ type: Boolean,
2542
+ default: !0
2543
+ },
2544
+ animationDelay: {
2545
+ type: Number,
2546
+ default: 0
2547
+ },
2548
+ animationDuration: {
2549
+ type: Number,
2550
+ default: 0.2
2551
+ }
2552
+ },
2553
+ emits: ["click"],
2554
+ setup(e, { emit: t }) {
2555
+ const n = R(null);
2556
+ return ie(() => $e(n.value)), (o, a) => (h(), w("path", {
2557
+ ref_key: "root",
2558
+ ref: n,
2559
+ class: q(["lume-line", {
2560
+ [`lume-stroke--${e.color}`]: !0,
2561
+ "lume-line--dashed": e.dashed,
2562
+ "lume-line--transition": e.transition
2563
+ }]),
2564
+ d: e.pathDefinition,
2565
+ "stroke-width": e.width,
2566
+ style: vt({
2567
+ animationDelay: e.transition && e.animationDelay + "s",
2568
+ animationDuration: e.transition && e.animationDuration + "s"
2569
+ }),
2570
+ "data-j-line": "",
2571
+ onClick: a[0] || (a[0] = (l) => t("click", l))
2572
+ }, null, 14, Ha));
2573
+ }
2574
+ });
2575
+ const Ra = /* @__PURE__ */ J(Ba, [["__scopeId", "data-v-08896455"]]), ja = ["cx", "cy", "r", "stroke-width"], Ga = 4, Va = /* @__PURE__ */ W({
2576
+ __name: "lume-point",
2577
+ props: {
2578
+ x: { type: Number, required: !0 },
2579
+ y: { type: Number, required: !0 },
2580
+ color: {
2581
+ type: String,
2582
+ default: te.Skyblue
2583
+ },
2584
+ radius: {
2585
+ type: Number,
2586
+ default: Ga
2587
+ },
2588
+ active: {
2589
+ type: Boolean,
2590
+ default: !1
2591
+ }
2592
+ },
2593
+ emits: ["click"],
2594
+ setup(e, { emit: t }) {
2595
+ const n = e, o = R(null), a = p(() => n.radius / 2);
2596
+ return ie(() => $e(o.value)), (l, r) => (h(), w("circle", {
2597
+ ref_key: "root",
2598
+ ref: o,
2599
+ class: q(["lume-point", `lume-stroke--${e.color}`]),
2600
+ cx: e.x,
2601
+ cy: e.y,
2602
+ r: e.active ? e.radius : 0,
2603
+ "stroke-width": a.value,
2604
+ "data-j-point": "",
2605
+ onClick: r[0] || (r[0] = (s) => t("click", s))
2606
+ }, null, 10, ja));
2607
+ }
2608
+ });
2609
+ const Ca = /* @__PURE__ */ J(Va, [["__scopeId", "data-v-9bacbd7d"]]);
2610
+ function Mt(e) {
2611
+ function t(l) {
2612
+ let r = null;
2613
+ return l == null ? void 0 : l.reduce((s, u, i) => (u == null || u.value == null ? (r ? r.push(i) : r = [i], i === (l == null ? void 0 : l.length) - 1 && s.push(r)) : r && (s.push(r), r = null), s), []);
2614
+ }
2615
+ function n(l, r, s, u) {
2616
+ const f = Math.abs(l - r) / (s + 1) * (u + 1);
2617
+ return l > r ? l - f : l + f;
2618
+ }
2619
+ function o(l) {
2620
+ return function(s) {
2621
+ return !!l.find(
2622
+ (u) => u.includes(s) || u.includes(s - 1)
2623
+ );
2624
+ };
2625
+ }
2626
+ return { computedLineData: p(() => e.value.map((l) => {
2627
+ const r = t(l.values);
2628
+ return {
2629
+ ...l,
2630
+ isDashed: o(r),
2631
+ values: l.values.map((s, u) => {
2632
+ var c, f;
2633
+ const i = r.find(
2634
+ (m) => m.includes(u)
2635
+ );
2636
+ if (i) {
2637
+ const m = i[0] - 1, A = i[i.length - 1] + 1;
2638
+ let v = (c = l.values[m]) == null ? void 0 : c.value, g = (f = l.values[A]) == null ? void 0 : f.value;
2639
+ return v == null && (v = g), g == null && (g = v), {
2640
+ value: n(
2641
+ v,
2642
+ g,
2643
+ i.length,
2644
+ i.indexOf(u)
2645
+ ),
2646
+ label: kt
2647
+ };
2648
+ }
2649
+ return s;
2650
+ })
2651
+ };
2652
+ })) };
2653
+ }
2654
+ function Sa(e, t) {
2655
+ const n = e.bandwidth() / 2;
2656
+ return (o, a) => e(e.domain()[t + (a - 1)]) + n;
2657
+ }
2658
+ function Pa(e, t) {
2659
+ return (n, o) => e(t + (o - 1));
2660
+ }
2661
+ function Fa(e, t, n, o) {
2662
+ return Kt().x(
2663
+ pe(n) ? Sa(n, e) : Pa(n, e)
2664
+ ).y((l) => o(l))(t);
2665
+ }
2666
+ const za = {
2667
+ class: "lume-line-group",
2668
+ "data-j-lume-line-group": ""
2669
+ }, Za = { class: "lume-line-group__lines" }, Wa = {
2670
+ key: 0,
2671
+ class: "lume-line-group__points",
2672
+ "data-j-lume-line-group__points": ""
2673
+ }, Xa = 1, Ua = /* @__PURE__ */ W({
2674
+ __name: "lume-line-group",
2675
+ props: {
2676
+ ...Ie(),
2677
+ withPoints: {
2678
+ type: Boolean,
2679
+ default: !0
2680
+ },
2681
+ transition: {
2682
+ type: Boolean,
2683
+ default: !0
2684
+ }
2685
+ },
2686
+ emits: ["line-click", "point-click", "lume__internal--hover"],
2687
+ setup(e, { emit: t }) {
2688
+ const n = e, { data: o, options: a, xScale: l, yScale: r } = K(n), s = Ve(
2689
+ "tooltipAnchorAttributes",
2690
+ null
2691
+ ), { updateTooltipAnchorAttributes: u } = It(
2692
+ s,
2693
+ a,
2694
+ l,
2695
+ r
2696
+ ), i = p(() => {
2697
+ if (o.value.every((I) => I.isDashed))
2698
+ return o.value;
2699
+ const { computedLineData: L } = Mt(o);
2700
+ return a.value.withTooltip !== !1 && (s != null && s.value) && u(L.value), L.value;
2701
+ }), c = p(() => {
2702
+ if (n.hoveredIndex === -1)
2703
+ return;
2704
+ const L = sn(
2705
+ i.value,
2706
+ n.hoveredIndex
2707
+ );
2708
+ return {
2709
+ d: `M ${Re(l.value, n.hoveredIndex)},${r.value.range()[1]}
2710
+ V ${r.value(L)}`
2711
+ // Move to X index, Vertical line to the highest point
2712
+ };
2713
+ }), f = p(
2714
+ () => l.value && Xa / (cn(l.value) - 1)
2715
+ // Subtracting the first line (read below)
2716
+ ), m = p(
2717
+ () => {
2718
+ var L;
2719
+ return ((L = a.value) == null ? void 0 : L.lineWidth) * 2 || void 0;
2720
+ }
2721
+ // If no `lineWidth`, returns NaN which needs to be undefined
2722
+ ), A = p(
2723
+ () => l.value.bandwidth() / 2
2724
+ ), v = p(() => l.value.domain()), g = p(
2725
+ () => a.value.withPoints ?? n.withPoints
2726
+ );
2727
+ function T(L) {
2728
+ return i.value[L].values;
2729
+ }
2730
+ function y(L, I) {
2731
+ var H, O;
2732
+ const _ = L === 0 ? [] : [
2733
+ (H = T(I)[L - 1]) == null ? void 0 : H.value,
2734
+ (O = T(I)[L]) == null ? void 0 : O.value
2735
+ ];
2736
+ return Fa(
2737
+ L,
2738
+ _,
2739
+ l.value,
2740
+ r.value
2741
+ ) || "";
2742
+ }
2743
+ function E(L) {
2744
+ return {
2745
+ animationDelay: L < 2 ? 0 : (L - 1) * f.value,
2746
+ animationDuration: f.value
2747
+ };
2748
+ }
2749
+ function D(L, I) {
2750
+ var H;
2751
+ const _ = (H = T(I)[L]) == null ? void 0 : H.value;
2752
+ return {
2753
+ x: pe(l.value) ? n.xScale(v.value[L]) + A.value : n.xScale(L),
2754
+ y: r.value(_)
2755
+ };
2756
+ }
2757
+ function $(L) {
2758
+ return n.hoveredIndex === L;
2759
+ }
2760
+ return (L, I) => (h(), w("g", za, [
2761
+ B("path", j(c.value, {
2762
+ class: "lume-line-group__overlay-line",
2763
+ "data-j-lume-line-group__overlay-line": ""
2764
+ }), null, 16),
2765
+ (h(!0), w(Y, null, Z(i.value, (_, H) => (h(), w("g", {
2766
+ key: _.label,
2767
+ class: "lume-line-group__group"
2768
+ }, [
2769
+ B("g", Za, [
2770
+ (h(!0), w(Y, null, Z(_.values, (O, M) => (h(), z(d(Ra), j(E(M), {
2771
+ key: `line-${M}`,
2772
+ color: _.color,
2773
+ dashed: _.isDashed(M),
2774
+ "path-definition": y(M, H),
2775
+ transition: e.transition,
2776
+ width: d(a).lineWidth,
2777
+ onClick: (U) => t("line-click", { index: M, datasetIndex: H, event: U })
2778
+ }), null, 16, ["color", "dashed", "path-definition", "transition", "width", "onClick"]))), 128))
2779
+ ]),
2780
+ g.value ? (h(), w("g", Wa, [
2781
+ (h(!0), w(Y, null, Z(_.values, (O, M) => (h(), z(d(Ca), j(D(M, H), {
2782
+ key: `point-${M}`,
2783
+ active: $(M),
2784
+ color: _.color,
2785
+ index: M,
2786
+ radius: m.value,
2787
+ onClick: (U) => t("point-click", { index: M, datasetIndex: H, event: U })
2788
+ }), null, 16, ["active", "color", "index", "radius", "onClick"]))), 128))
2789
+ ])) : V("", !0)
2790
+ ]))), 128))
2791
+ ]));
2792
+ }
2793
+ });
2794
+ const Bt = /* @__PURE__ */ J(Ua, [["__scopeId", "data-v-c4d7f0ca"]]), Ya = {
2795
+ margins: ve.VERTICAL,
2796
+ startOnZero: !0,
2797
+ withTooltip: !0,
2798
+ xAxisOptions: {},
2799
+ yAxisOptions: { gridLines: !0 }
2800
+ }, sl = /* @__PURE__ */ W({
2801
+ __name: "lume-line-chart",
2802
+ props: {
2803
+ ...ge(null, !1)
2804
+ },
2805
+ setup(e) {
2806
+ const t = e, n = fe(ne()), { options: o } = K(t), { allOptions: a } = oe(o, Ya);
2807
+ return (l, r) => (h(), z(d(_e), j(t, {
2808
+ "chart-type": "line",
2809
+ options: d(a),
2810
+ "data-j-lume-line-chart": ""
2811
+ }), se({
2812
+ groups: C((s) => [
2813
+ ae(d(Bt), le(re(s)), null, 16)
2814
+ ]),
2815
+ _: 2
2816
+ }, [
2817
+ Z(d(n), (s, u) => ({
2818
+ name: u,
2819
+ fn: C((i) => [
2820
+ G(l.$slots, u, le(re(i || {})))
2821
+ ])
2822
+ }))
2823
+ ]), 1040, ["options"]));
2824
+ }
2825
+ });
2826
+ function Ka(e) {
2827
+ return { areaPathDefinition: p(
2828
+ () => function(n, o) {
2829
+ if (!n || !o)
2830
+ return;
2831
+ const a = e.value[0].values;
2832
+ return Jt().x((l, r) => n(r)).y0(o(Math.min(...o.domain()))).y1((l) => o(l.value))(a);
2833
+ }
2834
+ ) };
2835
+ }
2836
+ const Ja = {
2837
+ margins: {
2838
+ top: 0,
2839
+ right: 0,
2840
+ bottom: 0,
2841
+ left: 0
2842
+ },
2843
+ withAxes: !1,
2844
+ showArea: !0,
2845
+ startOnZero: !0,
2846
+ withLegend: !1,
2847
+ tooltipOptions: {
2848
+ showTitle: !1
2849
+ }
2850
+ }, Qa = ["d"], qa = /* @__PURE__ */ W({
2851
+ __name: "lume-sparkline-chart",
2852
+ props: {
2853
+ ...ze(null),
2854
+ ...Te()
2855
+ },
2856
+ setup(e, { expose: t }) {
2857
+ const n = e, o = fe(ne()), { data: a, options: l } = K(n), { internalData: r } = Ze(a), { allOptions: s } = oe(l, Ja), { computedLineData: u } = Mt(r), { areaPathDefinition: i } = Ka(u), c = p(() => r.value[0].color), f = p(
2858
+ () => a.value[0].areaColor || c.value
2859
+ );
2860
+ function m(v) {
2861
+ return {
2862
+ ...v,
2863
+ noMinSize: !0
2864
+ };
2865
+ }
2866
+ function A(v, g, T) {
2867
+ return be().range([0, T.width]).domain([0, v[0].values.length - 1]);
2868
+ }
2869
+ return t({
2870
+ areaPathDefinition: i
2871
+ }), (v, g) => (h(), z(d(_e), j(n, {
2872
+ "chart-type": "line",
2873
+ options: m(d(s)),
2874
+ "x-scale": A
2875
+ }), se({
2876
+ groups: C((T) => [
2877
+ d(s).showArea ? (h(), w("path", {
2878
+ key: 0,
2879
+ class: q([
2880
+ "sparkline-chart__area",
2881
+ `lume-fill--${f.value || c.value}`,
2882
+ "lume-fill--faded"
2883
+ ]),
2884
+ d: d(i)(T.xScale, T.yScale),
2885
+ "data-j-sparkline__area": ""
2886
+ }, null, 10, Qa)) : V("", !0),
2887
+ ae(d(Bt), j(T, { "with-points": !1 }), null, 16)
2888
+ ]),
2889
+ _: 2
2890
+ }, [
2891
+ Z(d(o), (T, y) => ({
2892
+ name: y,
2893
+ fn: C((E) => [
2894
+ G(v.$slots, y, le(re(E || {})), void 0, !0)
2895
+ ])
2896
+ }))
2897
+ ]), 1040, ["options"]));
2898
+ }
2899
+ });
2900
+ const cl = /* @__PURE__ */ J(qa, [["__scopeId", "data-v-60a59b77"]]);
2901
+ export {
2902
+ al as LumeAlluvialDiagram,
2903
+ ma as LumeAlluvialGroup,
2904
+ qe as LumeAxis,
2905
+ Fe as LumeBar,
2906
+ ll as LumeBarChart,
2907
+ We as LumeBarGroup,
2908
+ _e as LumeChart,
2909
+ Cn as LumeChartContainer,
2910
+ et as LumeChartLegend,
2911
+ ul as LumeGroupedBarChart,
2912
+ Ra as LumeLine,
2913
+ sl as LumeLineChart,
2914
+ Bt as LumeLineGroup,
2915
+ Lo as LumeOverlayGroup,
2916
+ Ca as LumePoint,
2917
+ rl as LumeSingleBarChart,
2918
+ cl as LumeSparklineChart,
2919
+ il as LumeStackedBarChart,
2920
+ so as LumeTooltip,
2921
+ no as LumeTooltipItem,
2922
+ Jn as LumeTooltipSummary,
2923
+ Wn as LumeTooltipTitle
2924
+ };
2925
+ //# sourceMappingURL=index.js.map