@martinomagnifico/tablechart 1.0.6 → 1.0.7

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.
@@ -10,6 +10,7 @@ var e = "tablechart", t = "tablechart-plot", n = "tablechart-value", r = "tablec
10
10
  shape: "straight",
11
11
  legend: !1,
12
12
  tooltip: "auto",
13
+ tooltipparent: null,
13
14
  table: "never",
14
15
  totallabel: "Total",
15
16
  controls: !0,
@@ -1202,9 +1203,13 @@ var Te = (e) => e.map((e) => ({
1202
1203
  ]), i;
1203
1204
  };
1204
1205
  return r.append(i("previous"), i("next")), r;
1205
- }, We = (e, t, n, r = 10, i = 8, a = 12) => {
1206
- let { offsetWidth: o, offsetHeight: s } = e, { clientWidth: c, clientHeight: l } = document.documentElement, u = n.top - i, d = l - n.bottom - i, f = s + r <= u ? !0 : s + r <= d ? !1 : u >= d, p = f ? n.top - r - s : n.bottom + r, m = n.left + n.width / 2, h = Math.max(i, Math.min(m - o / 2, c - o - i));
1207
- e.style.left = `${h}px`, e.style.top = `${Math.max(i, Math.min(p, l - s - i))}px`, e.dataset.side = f ? "top" : "bottom", t.style.left = `${Math.max(a, Math.min(m - h, o - a))}px`;
1206
+ }, We = (e, t, n, r = {
1207
+ x: 0,
1208
+ y: 0,
1209
+ scale: 1
1210
+ }, i = 2, a = 8, o = 12) => {
1211
+ let s = e.getBoundingClientRect(), c = s.width, l = s.height, u = Number.parseFloat(getComputedStyle(e).borderLeftWidth) || 0, d = t.getBoundingClientRect().height / 2 + (i - u) * r.scale, f = o * r.scale, { clientWidth: p, clientHeight: m } = document.documentElement, h = n.top - a, g = m - n.bottom - a, _ = l + d <= h ? !0 : l + d <= g ? !1 : h >= g, v = _ ? n.top - d - l : n.bottom + d, y = n.left + n.width / 2, b = Math.max(a, Math.min(y - c / 2, p - c - a));
1212
+ e.style.left = `${(b - r.x) / r.scale}px`, e.style.top = `${(Math.max(a, Math.min(v, m - l - a)) - r.y) / r.scale}px`, e.dataset.side = _ ? "top" : "bottom", t.style.left = `${Math.max(f, Math.min(y - b, c - f)) / r.scale - u}px`;
1208
1213
  }, Ge = "tablechart-tooltip", Ke = [
1209
1214
  "--tablechart-surface",
1210
1215
  "--tablechart-tooltip-surface",
@@ -1216,42 +1221,48 @@ var Te = (e) => e.map((e) => ({
1216
1221
  ], Z = null, qe, Je, Q = null, Ye = null, Xe = 0, $ = () => {
1217
1222
  clearTimeout(Xe), Z && Q && (Z.hidden = !0, Q = null, Ye = null);
1218
1223
  }, Ze = !1, Qe = !0, $e = NaN, et = NaN, tt = !1, nt = () => {
1219
- tt || (tt = !0, document.addEventListener("pointermove", (e) => {
1224
+ if (tt) return;
1225
+ tt = !0, document.addEventListener("pointermove", (e) => {
1220
1226
  e.pointerType === "mouse" && (Qe = e.screenX !== $e || e.screenY !== et, $e = e.screenX, et = e.screenY, Qe && (Ze = !1));
1221
1227
  }, {
1222
1228
  capture: !0,
1223
1229
  passive: !0
1224
- }), document.addEventListener("keydown", () => {
1230
+ });
1231
+ let e = () => {
1225
1232
  Ze = !0, $();
1226
- }, !0));
1227
- }, rt = () => {
1233
+ };
1234
+ document.addEventListener("keydown", e, !0), window.addEventListener("scroll", e, {
1235
+ capture: !0,
1236
+ passive: !0
1237
+ });
1238
+ }, rt = (e, t) => t / Number.parseFloat(getComputedStyle(e).width) || 1, it = (e) => {
1239
+ let t = e.tooltipparent;
1240
+ return (typeof t == "string" ? document.querySelector(t) : t) ?? document.body;
1241
+ }, at = () => {
1228
1242
  clearTimeout(Xe), Xe = window.setTimeout($, 120);
1229
- }, it = () => {
1243
+ }, ot = () => {
1230
1244
  let e = document.createElement("div");
1231
- return e.className = Ge, e.setAttribute("aria-hidden", "true"), e.hidden = !0, qe = document.createElement("div"), Je = document.createElement("div"), Je.className = `${Ge}-arrow`, e.append(qe, Je), document.body.append(e), e.addEventListener("pointerenter", () => clearTimeout(Xe)), e.addEventListener("pointerleave", (e) => e.pointerType === "mouse" && rt()), document.addEventListener("pointerdown", (t) => {
1245
+ return e.className = Ge, e.setAttribute("aria-hidden", "true"), e.hidden = !0, qe = document.createElement("div"), Je = document.createElement("div"), Je.className = `${Ge}-arrow`, e.append(qe, Je), document.body.append(e), e.addEventListener("pointerenter", () => clearTimeout(Xe)), e.addEventListener("pointerleave", (e) => e.pointerType === "mouse" && at()), document.addEventListener("pointerdown", (t) => {
1232
1246
  let n = t.target;
1233
1247
  Q && !Q.plot.contains(n) && !e.contains(n) && $();
1234
- }), window.addEventListener("scroll", $, {
1235
- capture: !0,
1236
- passive: !0
1237
1248
  }), window.addEventListener("resize", $), e;
1238
- }, at = (e, t) => {
1249
+ }, st = (e, t) => {
1239
1250
  let n = t ? t.style.getPropertyValue("--step") : "x";
1240
1251
  return n === "" || Number(n) < e.step;
1241
- }, ot = (e, t) => {
1252
+ }, ct = (e, t) => {
1242
1253
  let n = e.svg.querySelector(`[data-series="${t + 1}"]:not(.tablechart-hole)`);
1243
1254
  if (!n) return;
1244
1255
  let r = getComputedStyle(n);
1245
1256
  return r.fill && r.fill !== "none" ? r.fill : r.stroke;
1246
- }, st = (e, t, n) => {
1257
+ }, lt = (e, t, n) => {
1247
1258
  let r = e.series.length > 1, i = [];
1248
1259
  for (let [n, a] of e.seriesValues.entries()) {
1249
- if (!at(e, a[t])) continue;
1260
+ if (!st(e, a[t])) continue;
1250
1261
  let o = r ? e.figure.querySelector(`.tablechart-name[data-series="${n + 1}"]`) : null;
1251
1262
  i.push({
1252
1263
  name: r ? o?.textContent ?? e.series[n].name : "",
1253
1264
  value: a[t].textContent ?? "",
1254
- colour: r ? ot(e, n) : void 0,
1265
+ colour: r ? ct(e, n) : void 0,
1255
1266
  sample: o ? {
1256
1267
  marker: o.dataset.marker ?? null,
1257
1268
  open: o.hasAttribute("data-open"),
@@ -1261,11 +1272,11 @@ var Te = (e) => e.map((e) => ({
1261
1272
  });
1262
1273
  }
1263
1274
  let a = e.totals[t];
1264
- return i.length > 1 && at(e, a) && i.push({
1275
+ return i.length > 1 && st(e, a) && i.push({
1265
1276
  name: n.totallabel,
1266
1277
  value: a.textContent ?? ""
1267
1278
  }), i;
1268
- }, ct = (e, t) => {
1279
+ }, ut = (e, t) => {
1269
1280
  if (e.type.centre && e.values[t]) return e.values[t].getBoundingClientRect();
1270
1281
  let n = e.svg.querySelectorAll(`[data-row="${t + 1}"]:not(.tablechart-connector, .tablechart-leader)`), r = null;
1271
1282
  for (let e of n) {
@@ -1280,11 +1291,11 @@ var Te = (e) => e.map((e) => ({
1280
1291
  100
1281
1292
  ];
1282
1293
  return new DOMRect(i.left + i.width * a / 100, i.top + i.height * o / 100, i.width * s / 100, i.height * c / 100);
1283
- }, lt = (e, t, n) => {
1294
+ }, dt = (e, t, n) => {
1284
1295
  if (clearTimeout(Xe), Q === e && Ye === t) return;
1285
- let r = (e.type.tooltip ?? st)(e, t, n);
1296
+ let r = (e.type.tooltip ?? lt)(e, t, n);
1286
1297
  if (!r.length) return $();
1287
- Q && Q !== e && $(), Z ?? (Z = it());
1298
+ Q && Q !== e && $(), Z ?? (Z = ot());
1288
1299
  let i = (e, t, n, r = !1, i) => {
1289
1300
  let a = document.createElement("div");
1290
1301
  if (a.className = `${Ge}-line`, n) {
@@ -1305,13 +1316,21 @@ var Te = (e) => e.map((e) => ({
1305
1316
  let t = s.getPropertyValue(e).trim();
1306
1317
  t ? Z.style.setProperty(e, t) : Z.style.removeProperty(e);
1307
1318
  }
1308
- Z.style.setProperty("--_color", s.color), Z.style.colorScheme = s.colorScheme, Z.style.fontFamily = s.fontFamily, Z.style.fontSize = s.fontSize, Q = e, Ye = t, Z.hidden = !1, Z.style.left = "0px", We(Z, Je, ct(e, t));
1309
- }, ut = (e, t, n = !1) => {
1319
+ Z.style.setProperty("--_color", s.color), Z.style.colorScheme = s.colorScheme, Z.style.fontFamily = s.fontFamily;
1320
+ let c = it(n);
1321
+ Z.parentElement !== c && c.append(Z), Q = e, Ye = t, Z.hidden = !1, Z.style.left = "0px", Z.style.top = "0px";
1322
+ let l = Z.getBoundingClientRect(), u = {
1323
+ x: l.left,
1324
+ y: l.top,
1325
+ scale: rt(Z, l.width)
1326
+ }, d = rt(e.plot, e.plot.getBoundingClientRect().width);
1327
+ Z.style.fontSize = `${Number.parseFloat(s.fontSize) * d / u.scale}px`, We(Z, Je, ut(e, t), u);
1328
+ }, ft = (e, t, n = !1) => {
1310
1329
  let { plot: r } = e;
1311
1330
  r.setAttribute("data-hover", ""), nt();
1312
1331
  let i = (t) => {
1313
1332
  if (e.rowAt) {
1314
- let n = r.getBoundingClientRect(), i = n.width / r.offsetWidth || 1;
1333
+ let n = r.getBoundingClientRect(), i = rt(r, n.width);
1315
1334
  return e.rowAt((t.clientX - n.left) / i, (t.clientY - n.top) / i);
1316
1335
  }
1317
1336
  let n = t.target.closest?.("[data-row]")?.getAttribute("data-row");
@@ -1326,8 +1345,8 @@ var Te = (e) => e.map((e) => ({
1326
1345
  if (!r.classList.contains("is-placed") || !e.figure.classList.contains("is-shown")) return;
1327
1346
  if (n && !e.figure.hasAttribute("data-left-out")) return Q === e ? $() : void 0;
1328
1347
  let c = i(a);
1329
- if (s = c, c === null || o(c)) return Q === e ? rt() : void 0;
1330
- lt(e, c, t);
1348
+ if (s = c, c === null || o(c)) return Q === e ? at() : void 0;
1349
+ dt(e, c, t);
1331
1350
  }, l = (t) => {
1332
1351
  let n = t.target;
1333
1352
  return e.svg.contains(n) && n.hasAttribute("data-row") ? n : null;
@@ -1341,42 +1360,42 @@ var Te = (e) => e.map((e) => ({
1341
1360
  if (!r) return;
1342
1361
  a.delete(r);
1343
1362
  let i = Number(r.getAttribute("data-row")) - 1;
1344
- s === i && !o(i) && !Ze && lt(e, i, t);
1363
+ s === i && !o(i) && !Ze && dt(e, i, t);
1345
1364
  };
1346
1365
  e.svg.addEventListener("transitionend", u), e.svg.addEventListener("transitioncancel", u), r.addEventListener("pointermove", c), r.addEventListener("pointerdown", c), r.addEventListener("pointerleave", (t) => {
1347
- t.pointerType === "mouse" && (s = null, Q === e && rt());
1366
+ t.pointerType === "mouse" && (s = null, Q === e && at());
1348
1367
  });
1349
- }, dt = (e) => {
1368
+ }, pt = (e) => {
1350
1369
  Q === e && $();
1351
- }, ft = {
1370
+ }, mt = {
1352
1371
  area: Oe,
1353
1372
  bar: pe,
1354
1373
  column: me,
1355
1374
  donut: _e,
1356
1375
  line: De,
1357
1376
  waterfall: je
1358
- }, pt = {
1377
+ }, ht = {
1359
1378
  "axis-break": M,
1360
1379
  trend: te,
1361
1380
  bracket: H
1362
- }, mt = Object.keys(pt), ht = (e) => {
1381
+ }, gt = Object.keys(ht), _t = (e) => {
1363
1382
  let t = "";
1364
1383
  for (let n = e.previousSibling; n && (t = (n.textContent ?? "") + t, !t.trim()); n = n.previousSibling);
1365
1384
  return t.trim();
1366
- }, gt = [
1385
+ }, vt = [
1367
1386
  "straight",
1368
1387
  "step",
1369
1388
  "smooth"
1370
- ], _t = (e, t) => {
1389
+ ], yt = (e, t) => {
1371
1390
  let n = e.dataset.chartShape;
1372
- return n && gt.includes(n) ? n : gt.includes(t.shape) ? t.shape : "straight";
1373
- }, vt = (e) => {
1391
+ return n && vt.includes(n) ? n : vt.includes(t.shape) ? t.shape : "straight";
1392
+ }, bt = (e) => {
1374
1393
  for (let t of e.querySelectorAll("br")) {
1375
- if (t.previousElementSibling?.classList.contains("tablechart-sr") || /[.!?:;,…]$/.test(ht(t))) continue;
1394
+ if (t.previousElementSibling?.classList.contains("tablechart-sr") || /[.!?:;,…]$/.test(_t(t))) continue;
1376
1395
  let e = document.createElement("span");
1377
1396
  e.className = p, e.textContent = ". ", t.before(e);
1378
1397
  }
1379
- }, yt = (e, t, n) => {
1398
+ }, xt = (e, t, n) => {
1380
1399
  let r = e.querySelector("table");
1381
1400
  if (!r) return null;
1382
1401
  let i = r.querySelector("tfoot [data-chart-total]");
@@ -1387,22 +1406,22 @@ var Te = (e) => e.map((e) => ({
1387
1406
  s && n.langattribute && o.setAttribute(n.langattribute, `${s}-total`);
1388
1407
  let c = a.insertCell();
1389
1408
  return c.setAttribute("data-chart-total", ""), c.dataset.value = t.dataset.value ?? "0", a.prepend(o), c;
1390
- }, bt = 0, xt = (e) => {
1409
+ }, St = 0, Ct = (e) => {
1391
1410
  let t = e.querySelector(":scope > figcaption");
1392
1411
  if (!t) return;
1393
- vt(t);
1412
+ bt(t);
1394
1413
  let n = (e) => e.hasAttribute("aria-label") || e.hasAttribute("aria-labelledby"), r = (e) => {
1395
- t.id || (t.id = `tablechart-caption-${++bt}`), e.setAttribute("aria-labelledby", t.id);
1414
+ t.id || (t.id = `tablechart-caption-${++St}`), e.setAttribute("aria-labelledby", t.id);
1396
1415
  };
1397
1416
  e.tagName === "FIGURE" && !n(e) && r(e);
1398
1417
  let i = e.querySelector("table");
1399
1418
  i && !n(i) && !i.querySelector(":scope > caption") && r(i);
1400
- }, St = (r, i, a = null) => {
1401
- let o = a ?? (r.getAttribute("data-chart") || "column"), s = ft[o];
1402
- if (!s) return console.warn(`[${e}] Unknown chart type "${o}". Known types: ${Object.keys(ft).join(", ")}.`), r.setAttribute("data-chart-empty", ""), null;
1419
+ }, wt = (r, i, a = null) => {
1420
+ let o = a ?? (r.getAttribute("data-chart") || "column"), s = mt[o];
1421
+ if (!s) return console.warn(`[${e}] Unknown chart type "${o}". Known types: ${Object.keys(mt).join(", ")}.`), r.setAttribute("data-chart-empty", ""), null;
1403
1422
  let l = Ne(r, i.langattribute);
1404
1423
  if (!l.length) return console.warn(r.querySelector("table") ? `[${e}] A chart has no rows in its table, so there is nothing to draw.` : `[${e}] A chart has no table, so there is nothing to draw.`, r), r.setAttribute("data-chart-empty", ""), null;
1405
- xt(r);
1424
+ Ct(r);
1406
1425
  let d = Ie(r, l, i.langattribute);
1407
1426
  d.length > 1 && !s.series && (console.warn(`[${e}] A ${o} chart uses only the first of its ${d.length} value columns.`), d = d.slice(0, 1));
1408
1427
  let f = d.length > 1;
@@ -1430,7 +1449,7 @@ var Te = (e) => e.map((e) => ({
1430
1449
  let n = E("tablechart-name", D ?? h);
1431
1450
  D && (n.dataset.place = "legend");
1432
1451
  let a = s.legend ?? s.swatch;
1433
- if (a && (n.dataset.swatch = a), n.textContent = e.name, !a && _t(r, i) !== "step") {
1452
+ if (a && (n.dataset.swatch = a), n.textContent = e.name, !a && yt(r, i) !== "step") {
1434
1453
  let e = ye(d, t);
1435
1454
  n.dataset.marker = e.shape, n.toggleAttribute("data-open", e.open);
1436
1455
  }
@@ -1440,7 +1459,7 @@ var Te = (e) => e.map((e) => ({
1440
1459
  let e = l.find((e) => e.isTotal), t = e ? e.value : l.reduce((e, t) => e + Math.abs(t.value), 0);
1441
1460
  k.dataset.value = String(t), e && (k.dataset.decimals = String(P(e.number)));
1442
1461
  }
1443
- let A = k && !l.some((e) => e.isTotal) ? yt(r, k, i) : null, j = s.categories === "beside", M = document.createElement("div");
1462
+ let A = k && !l.some((e) => e.isTotal) ? xt(r, k, i) : null, j = s.categories === "beside", M = document.createElement("div");
1444
1463
  M.className = "tablechart-categories", M.setAttribute("aria-hidden", "true"), M.inert = !0, j ? M.dataset.place = "beside" : s.centre && (M.dataset.place = "key"), M.style.setProperty("--_columns", String(l.length));
1445
1464
  let F = 0;
1446
1465
  for (let [e, t] of l.entries()) {
@@ -1460,7 +1479,7 @@ var Te = (e) => e.map((e) => ({
1460
1479
  hint: L && `${L}-step`
1461
1480
  }, i.langattribute) : null;
1462
1481
  R && r.appendChild(R);
1463
- let z = r.getAttribute("data-chart-table"), B = z && wt.includes(z) ? z : i.table;
1482
+ let z = r.getAttribute("data-chart-table"), B = z && Et.includes(z) ? z : i.table;
1464
1483
  if (B === "never") r.removeAttribute("data-table");
1465
1484
  else {
1466
1485
  r.setAttribute("data-table", B);
@@ -1468,8 +1487,8 @@ var Te = (e) => e.map((e) => ({
1468
1487
  e && r.append(e);
1469
1488
  }
1470
1489
  let V = Array.from(r.querySelectorAll("[data-annotation]")).map((t) => {
1471
- let n = t.getAttribute("data-annotation"), r = pt[n];
1472
- if (!r) return console.warn(`[${e}] Unknown annotation "${n}". Known annotations: ${Object.keys(pt).join(", ")}.`), null;
1490
+ let n = t.getAttribute("data-annotation"), r = ht[n];
1491
+ if (!r) return console.warn(`[${e}] Unknown annotation "${n}". Known annotations: ${Object.keys(ht).join(", ")}.`), null;
1473
1492
  let i = Number.parseInt(t.getAttribute("data-series") ?? "1", 10), a = i >= 1 && i <= d.length ? i - 1 : 0;
1474
1493
  return i !== a + 1 && console.warn(`[${e}] An annotation reads line ${i}, which is not there; it reads line 1.`), {
1475
1494
  spec: t,
@@ -1479,7 +1498,7 @@ var Te = (e) => e.map((e) => ({
1479
1498
  after: l.length
1480
1499
  };
1481
1500
  }).filter((e) => e !== null);
1482
- i.animate && r.setAttribute("data-animate", Et(r, o, i, !!I));
1501
+ i.animate && r.setAttribute("data-animate", Ot(r, o, i, !!I));
1483
1502
  let H = {
1484
1503
  figure: r,
1485
1504
  plot: h,
@@ -1509,31 +1528,31 @@ var Te = (e) => e.map((e) => ({
1509
1528
  t && He(H, H.step + (t === "next" ? 1 : -1));
1510
1529
  }), He(H, 0, !0);
1511
1530
  let U = r.getAttribute("data-chart-tooltip") ?? r.getAttribute("data-chart-hover"), ee = U === "false" ? !1 : U === "auto" ? "auto" : U !== null || i.hover !== !1 && i.tooltip;
1512
- return ee && ut(H, i, ee === "auto"), jt(H, i), H;
1513
- }, Ct = {
1531
+ return ee && ft(H, i, ee === "auto"), Nt(H, i), H;
1532
+ }, Tt = {
1514
1533
  grow: "grow",
1515
1534
  sweep: "sweep"
1516
- }, wt = [
1535
+ }, Et = [
1517
1536
  "never",
1518
1537
  "auto",
1519
1538
  "print",
1520
1539
  "always"
1521
- ], Tt = {
1522
- ...Ct,
1540
+ ], Dt = {
1541
+ ...Tt,
1523
1542
  up: "grow",
1524
1543
  across: "sweep"
1525
- }, Et = (e, t, n, r) => {
1526
- let i = t === "line" || t === "area", a = i ? Tt : Ct, o = a[e.getAttribute("data-chart-animate") ?? ""] ?? a[String(n.animate)];
1544
+ }, Ot = (e, t, n, r) => {
1545
+ let i = t === "line" || t === "area", a = i ? Dt : Tt, o = a[e.getAttribute("data-chart-animate") ?? ""] ?? a[String(n.animate)];
1527
1546
  return i ? r ? "sweep" : o ?? "sweep" : t === "donut" || t === "waterfall" ? o ?? "grow" : "grow";
1528
- }, Dt = (e) => {
1547
+ }, kt = (e) => {
1529
1548
  let t = getComputedStyle(e), n = (t.getPropertyValue("--tablechart-value-align") || t.getPropertyValue("--tablechart-inside-align")).trim();
1530
1549
  return n === "start" || n === "center" || n === "end" ? n : null;
1531
- }, Ot = (e, t, n, r) => {
1550
+ }, At = (e, t, n, r) => {
1532
1551
  let i = getComputedStyle(e), a = (i.getPropertyValue(n).trim() || r).match(/^(\d+(?:\.\d+)?)(px|%|em|rem)$/);
1533
1552
  if (!a) return null;
1534
1553
  let o = Number(a[1]);
1535
1554
  return a[2] === "%" ? o / 100 * _ : o * (a[2] === "em" ? Number.parseFloat(i.fontSize) : a[2] === "rem" ? Number.parseFloat(getComputedStyle(document.documentElement).fontSize) : 1) * t;
1536
- }, kt = (e, t) => Ot(e, t, "--tablechart-bar-max", "60px") ?? Infinity, At = (t, n) => {
1555
+ }, jt = (e, t) => At(e, t, "--tablechart-bar-max", "60px") ?? Infinity, Mt = (t, n) => {
1537
1556
  let { plot: r, svg: i, rows: a, type: o, values: s, series: c, seriesValues: u, names: d, annotations: p } = t, m = r.clientWidth;
1538
1557
  if (!m) return !1;
1539
1558
  let h = _ / m, g = Number.parseFloat(t.figure.dataset.chartAspect ?? ""), v = _ * (g > 0 ? g : o.aspect ?? n.aspect);
@@ -1546,7 +1565,7 @@ var Te = (e) => e.map((e) => ({
1546
1565
  ...t.categories,
1547
1566
  ...p.map((e) => e.badge)
1548
1567
  ]);
1549
- let y = (s[0] ? W(s[0]).height : 0) * h, b = p[0]?.badge ? W(p[0].badge).height * h : 0, x = Math.max(v, Ot(t.figure, h, "--tablechart-min-height", "200px") ?? 0, o.minHeight?.({
1568
+ let y = (s[0] ? W(s[0]).height : 0) * h, b = p[0]?.badge ? W(p[0].badge).height * h : 0, x = Math.max(v, At(t.figure, h, "--tablechart-min-height", "200px") ?? 0, o.minHeight?.({
1550
1569
  labelHeight: y,
1551
1570
  nameHeight: Math.max(0, N(t.categories.map((e) => W(e).height))) * h,
1552
1571
  unit: h,
@@ -1598,7 +1617,7 @@ var Te = (e) => e.map((e) => ({
1598
1617
  share: s
1599
1618
  } : console.warn(`[${e}] This kind of chart cannot break its scale.`);
1600
1619
  }
1601
- let H = V ? V.gap : null, U = (V && Ot(t.figure, h, "--tablechart-break-gap", "")) ?? 13, G = x - M, te = F - I || 1, ne = (e) => G - (e - I) / te * P;
1620
+ let H = V ? V.gap : null, U = (V && At(t.figure, h, "--tablechart-break-gap", "")) ?? 13, G = x - M, te = F - I || 1, ne = (e) => G - (e - I) / te * P;
1602
1621
  if (V) {
1603
1622
  let { lo: e, hi: t, gap: n, share: r } = V, i = P * r, a = (P - i - U) / (e + (F - t)), o = i / (t - e);
1604
1623
  ne = (r) => r <= e ? G - r * a : r <= n ? G - e * a - (r - e) * o : r <= t ? G - e * a - (r - e) * o - U : G - e * a - i - U - (r - t) * a;
@@ -1624,8 +1643,8 @@ var Te = (e) => e.map((e) => ({
1624
1643
  segments: T,
1625
1644
  cx: oe,
1626
1645
  y: ne,
1627
- barWidth: Math.min(K * n.barfill, kt(t.figure, h)),
1628
- barMax: kt(t.figure, h),
1646
+ barWidth: Math.min(K * n.barfill, jt(t.figure, h)),
1647
+ barMax: jt(t.figure, h),
1629
1648
  height: x,
1630
1649
  unit: h,
1631
1650
  labelHeight: y,
@@ -1633,12 +1652,12 @@ var Te = (e) => e.map((e) => ({
1633
1652
  after: a.length,
1634
1653
  note: 0,
1635
1654
  labels: t.figure.dataset.chartLabels === "inside" || t.figure.dataset.chartLabels !== "outside" && n.labels === "inside" ? "inside" : "outside",
1636
- insideAlign: Dt(t.figure),
1655
+ insideAlign: kt(t.figure),
1637
1656
  breakAt: H,
1638
1657
  squeeze: V,
1639
1658
  breakGap: U,
1640
1659
  stacked: t.stacked,
1641
- shape: _t(t.figure, n),
1660
+ shape: yt(t.figure, n),
1642
1661
  totals: t.totals,
1643
1662
  svg: i,
1644
1663
  plot: r,
@@ -1705,7 +1724,7 @@ var Te = (e) => e.map((e) => ({
1705
1724
  return t.some((e) => pe(e) && Number(e.dataset.row) <= n && n <= Number(e.dataset.rowEnd ?? e.dataset.row));
1706
1725
  };
1707
1726
  return t.figure.toggleAttribute("data-left-out", [...u, t.totals].some((e) => e.some((t) => !fe(t) && !pe(t) && !me(t, e)))), !0;
1708
- }, jt = (e, t) => {
1727
+ }, Nt = (e, t) => {
1709
1728
  let n = [
1710
1729
  ...e.seriesValues.flat(),
1711
1730
  ...e.totals,
@@ -1723,29 +1742,29 @@ var Te = (e) => e.map((e) => ({
1723
1742
  e.className = "tablechart-minus", e.textContent = o, r.prepend(e);
1724
1743
  }
1725
1744
  }
1726
- }, Mt = (e) => {
1727
- dt(e), e.plot.remove(), e.categories[0]?.parentElement?.remove(), e.figure.querySelector(`:scope > .${c}`)?.remove(), e.controls?.remove();
1728
- }, Nt = (e, t) => {
1745
+ }, Pt = (e) => {
1746
+ pt(e), e.plot.remove(), e.categories[0]?.parentElement?.remove(), e.figure.querySelector(`:scope > .${c}`)?.remove(), e.controls?.remove();
1747
+ }, Ft = (e, t) => {
1729
1748
  e.figure.classList.toggle(m, t);
1730
- }, Pt = (e) => e === "id" || e === "style" || e.startsWith("data-chart"), Ft = /^\s*(?:Table)?:\s+/, It = (e) => e?.tagName === "P" && Ft.test(e.textContent ?? ""), Lt = (e) => {
1749
+ }, It = (e) => e === "id" || e === "style" || e.startsWith("data-chart"), Lt = /^\s*(?:Table)?:\s+/, Rt = (e) => e?.tagName === "P" && Lt.test(e.textContent ?? ""), zt = (e) => {
1731
1750
  let t = document.createElement("figcaption");
1732
1751
  for (let { name: n, value: r } of Array.from(e.attributes)) t.setAttribute(n, r);
1733
1752
  let n = e.firstChild;
1734
- n?.nodeType === Node.TEXT_NODE && (n.textContent = (n.textContent ?? "").replace(Ft, ""), n.textContent || n.remove());
1753
+ n?.nodeType === Node.TEXT_NODE && (n.textContent = (n.textContent ?? "").replace(Lt, ""), n.textContent || n.remove());
1735
1754
  let r = Array.from(e.childNodes), i = r.findIndex((e) => e.nodeName === "BR");
1736
1755
  if (t.append(...i === -1 ? r : r.slice(0, i + 1)), i !== -1 && i < r.length - 1) {
1737
1756
  let e = document.createElement("span");
1738
1757
  e.append(...r.slice(i + 1)), t.append(e);
1739
1758
  }
1740
1759
  return e.remove(), t;
1741
- }, Rt = /^\s*([a-z][\w-]*)((?:\s+[\w-]+=[^\s:]+)*)\s*(:\s*|$)/, zt = (e) => {
1742
- let t = qt(e);
1760
+ }, Bt = /^\s*([a-z][\w-]*)((?:\s+[\w-]+=[^\s:]+)*)\s*(:\s*|$)/, Vt = (e) => {
1761
+ let t = Yt(e);
1743
1762
  return t?.tagName === "P" ? t : e;
1744
- }, Bt = (e) => {
1745
- let t = zt(e).firstChild;
1763
+ }, Ht = (e) => {
1764
+ let t = Vt(e).firstChild;
1746
1765
  if (t?.nodeType !== Node.TEXT_NODE) return null;
1747
- let n = Rt.exec(t.textContent ?? "");
1748
- if (!n || !mt.includes(n[1]) || !n[3] && t.nextSibling) return null;
1766
+ let n = Bt.exec(t.textContent ?? "");
1767
+ if (!n || !gt.includes(n[1]) || !n[3] && t.nextSibling) return null;
1749
1768
  let r = n[2].trim().split(/\s+/).filter(Boolean).map((e) => e.split("="));
1750
1769
  return {
1751
1770
  name: n[1],
@@ -1753,11 +1772,11 @@ var Te = (e) => e.map((e) => ({
1753
1772
  text: t,
1754
1773
  length: n[0].length
1755
1774
  };
1756
- }, Vt = (e) => {
1775
+ }, Ut = (e) => {
1757
1776
  if (e?.tagName !== "UL" && e?.tagName !== "OL") return null;
1758
- let t = Array.from(e.children), n = t.map((e) => e.hasAttribute("data-annotation") ? null : Bt(e));
1777
+ let t = Array.from(e.children), n = t.map((e) => e.hasAttribute("data-annotation") ? null : Ht(e));
1759
1778
  return !t.length || t.some((e, t) => !n[t] && !e.hasAttribute("data-annotation")) ? null : (t.forEach((e, t) => {
1760
- let r = n[t], i = zt(e);
1779
+ let r = n[t], i = Vt(e);
1761
1780
  if (i !== e && i.replaceWith(...i.childNodes), r) {
1762
1781
  e.setAttribute("data-annotation", r.name);
1763
1782
  for (let [t, n] of r.options) e.setAttribute(`data-${t}`, n);
@@ -1768,18 +1787,18 @@ var Te = (e) => e.map((e) => ({
1768
1787
  t === 0 && e instanceof HTMLElement && e.matches("em, i") ? (n.className = "tablechart-caption", n.append(...e.childNodes), e.replaceWith(n)) : e.nodeType === Node.TEXT_NODE && (n.textContent = (e.textContent ?? "").trim(), e.replaceWith(n));
1769
1788
  });
1770
1789
  }), e.classList.add("chart-annotations"), e);
1771
- }, Ht = (e, t) => {
1772
- for (let { name: n, value: r } of Array.from(e.attributes)) (n === "class" || Pt(n)) && (t.setAttribute(n, r), e.removeAttribute(n));
1773
- }, Ut = (e) => e.map((e) => {
1774
- let t = e.closest("p"), n = It(t) ? t : e;
1790
+ }, Wt = (e, t) => {
1791
+ for (let { name: n, value: r } of Array.from(e.attributes)) (n === "class" || It(n)) && (t.setAttribute(n, r), e.removeAttribute(n));
1792
+ }, Gt = (e) => e.map((e) => {
1793
+ let t = e.closest("p"), n = Rt(t) ? t : e;
1775
1794
  if (n.tagName !== "TABLE" && n.tagName !== "P") return n;
1776
1795
  let r = document.createElement("figure");
1777
- Ht(e, r), e.classList.length || e.removeAttribute("class");
1778
- let i = n.tagName === "TABLE" ? n : null, a = n.previousElementSibling, o = n.nextElementSibling, s = i ? It(a) ? a : It(o) ? o : null : n;
1796
+ Wt(e, r), e.classList.length || e.removeAttribute("class");
1797
+ let i = n.tagName === "TABLE" ? n : null, a = n.previousElementSibling, o = n.nextElementSibling, s = i ? Rt(a) ? a : Rt(o) ? o : null : n;
1779
1798
  i && s === o && (o = o?.nextElementSibling ?? null);
1780
- let c = o?.classList.contains("chart-annotations") ? o : Vt(o);
1781
- return n.replaceWith(r), s && r.append(Lt(s)), i && r.append(i), c && r.append(c), X?.log?.(`A ${i ? "table" : "caption"} with chart attributes was wrapped in a figure of its own`), r;
1782
- }), Wt = (e, t, n, r = document.createElement("table")) => {
1799
+ let c = o?.classList.contains("chart-annotations") ? o : Ut(o);
1800
+ return n.replaceWith(r), s && r.append(zt(s)), i && r.append(i), c && r.append(c), X?.log?.(`A ${i ? "table" : "caption"} with chart attributes was wrapped in a figure of its own`), r;
1801
+ }), Kt = (e, t, n, r = document.createElement("table")) => {
1783
1802
  for (let e of r.querySelectorAll(":scope > tbody, :scope > tfoot, :scope > tr")) e.remove();
1784
1803
  if (!r.tHead && (t.length || n)) {
1785
1804
  let e = r.createTHead().insertRow(), i = document.createElement("th");
@@ -1799,7 +1818,7 @@ var Te = (e) => e.map((e) => ({
1799
1818
  for (let n of t.values ?? [t.value ?? null]) e.insertCell().textContent = n === null ? "" : String(n);
1800
1819
  }
1801
1820
  return r;
1802
- }, Gt = (e) => {
1821
+ }, qt = (e) => {
1803
1822
  if (!e || typeof e != "object") return;
1804
1823
  let t = Object.entries(e), n = (e) => e === null || typeof e == "string" || typeof e == "number";
1805
1824
  if (t.length && t.every(([, e]) => n(e) || Array.isArray(e) && e.every(n))) return t.map(([e, t]) => Array.isArray(t) ? {
@@ -1809,16 +1828,16 @@ var Te = (e) => e.map((e) => ({
1809
1828
  label: e,
1810
1829
  value: t
1811
1830
  });
1812
- }, Kt = async (t) => {
1831
+ }, Jt = async (t) => {
1813
1832
  await Promise.all(t.filter((e) => e.hasAttribute("data-chart-src")).map(async (t) => {
1814
1833
  let n = t.getAttribute("data-chart-src"), r = Array.from(t.querySelectorAll("table")).find((e) => e.tHead) ?? null;
1815
1834
  for (let e of t.querySelectorAll("table")) e !== r && e.remove();
1816
1835
  try {
1817
1836
  let e = await fetch(n);
1818
1837
  if (!e.ok) throw Error(`${e.status} ${e.statusText}`);
1819
- let i = await e.json(), a = Array.isArray(i) ? i : i?.rows ? Array.isArray(i.rows) ? i.rows : Gt(i.rows) : Gt(i);
1838
+ let i = await e.json(), a = Array.isArray(i) ? i : i?.rows ? Array.isArray(i.rows) ? i.rows : qt(i.rows) : qt(i);
1820
1839
  if (!Array.isArray(a)) throw Error("no rows in it: a list of rows, an object with rows, or names with their values");
1821
- let o = Wt(a, Array.isArray(i?.series) ? i.series.map(String) : [], typeof i?.label == "string" ? i.label : "", r ?? void 0);
1840
+ let o = Kt(a, Array.isArray(i?.series) ? i.series.map(String) : [], typeof i?.label == "string" ? i.label : "", r ?? void 0);
1822
1841
  if (!r) {
1823
1842
  let e = t.querySelector(":scope > figcaption");
1824
1843
  e ? e.after(o) : t.prepend(o);
@@ -1829,10 +1848,10 @@ var Te = (e) => e.map((e) => ({
1829
1848
  console.warn(`[${e}] Could not read the chart data in "${n}": ${t.message}.` + (r ? " A page opened as a file cannot fetch files; open it from a server." : ""));
1830
1849
  }
1831
1850
  }));
1832
- }, qt = (e) => {
1851
+ }, Yt = (e) => {
1833
1852
  let t = Array.from(e.childNodes).filter((e) => e.nodeType === Node.ELEMENT_NODE || e.nodeType === Node.TEXT_NODE && e.textContent?.trim());
1834
1853
  return t.length === 1 && t[0] instanceof HTMLElement ? t[0] : null;
1835
- }, Jt = "strong, b, span.total", Yt = (e) => {
1854
+ }, Xt = "strong, b, span.total", Zt = (e) => {
1836
1855
  for (let t of e) {
1837
1856
  for (let e of t.querySelectorAll("tbody tr")) {
1838
1857
  let t = e.cells[0];
@@ -1840,16 +1859,16 @@ var Te = (e) => e.map((e) => ({
1840
1859
  let n = document.createElement("th");
1841
1860
  for (let { name: e, value: r } of Array.from(t.attributes)) n.setAttribute(e, r);
1842
1861
  n.append(...t.childNodes), t.replaceWith(n);
1843
- for (let t = qt(n); t?.matches(Jt); t = qt(n)) e.dataset.kind = "total", t.replaceWith(...t.childNodes);
1862
+ for (let t = Yt(n); t?.matches(Xt); t = Yt(n)) e.dataset.kind = "total", t.replaceWith(...t.childNodes);
1844
1863
  }
1845
1864
  let e = Array.from(t.querySelector("thead tr:last-child")?.children ?? []);
1846
- for (let t of e.slice(1)) for (let e = qt(t); e?.matches(Jt); e = qt(t)) t.setAttribute("data-kind", "focus"), e.replaceWith(...e.childNodes);
1865
+ for (let t of e.slice(1)) for (let e = Yt(t); e?.matches(Xt); e = Yt(t)) t.setAttribute("data-kind", "focus"), e.replaceWith(...e.childNodes);
1847
1866
  }
1848
- }, Xt = "data-chart-made", Zt = () => window.matchMedia("(prefers-reduced-motion: reduce)").matches, Qt = (e) => new Promise((t) => setTimeout(t, e)), $t = (e, t) => {
1867
+ }, Qt = "data-chart-made", $t = () => window.matchMedia("(prefers-reduced-motion: reduce)").matches, en = (e) => new Promise((t) => setTimeout(t, e)), tn = (e, t) => {
1849
1868
  let n = Number.parseFloat(e.dataset.chartEntrance ?? ""), r = Number.isFinite(n) ? n : t.entrance;
1850
1869
  return Math.min(Math.max(r, 0), 1);
1851
- }, en = async (e, t) => {
1852
- if (Zt()) return;
1870
+ }, nn = async (e, t) => {
1871
+ if ($t()) return;
1853
1872
  await new Promise(requestAnimationFrame);
1854
1873
  let n = e.getAnimations().filter((e) => e instanceof CSSAnimation);
1855
1874
  for (let t = e.parentElement; t && t !== document.body; t = t.parentElement) n.push(...t.getAnimations());
@@ -1860,11 +1879,11 @@ var Te = (e) => e.map((e) => ({
1860
1879
  let a = Number(n.delay ?? 0) + i * t;
1861
1880
  r = Math.max(r, a - Number(e.currentTime ?? 0));
1862
1881
  }
1863
- r > 0 && await Qt(r);
1864
- }, tn = (e) => {
1882
+ r > 0 && await en(r);
1883
+ }, rn = (e) => {
1865
1884
  for (let t = e; t && t !== document.body; t = t.parentElement) if (getComputedStyle(t).opacity === "0") return t;
1866
1885
  return null;
1867
- }, nn = (e) => new Promise((t) => {
1886
+ }, an = (e) => new Promise((t) => {
1868
1887
  let n = ["animationstart", "transitionrun"], r = () => {
1869
1888
  for (let e of n) document.removeEventListener(e, i, !0);
1870
1889
  a.disconnect(), t();
@@ -1878,41 +1897,41 @@ var Te = (e) => e.map((e) => ({
1878
1897
  attributes: !0,
1879
1898
  attributeFilter: ["class", "style"]
1880
1899
  });
1881
- }), rn = /* @__PURE__ */ new Set(), an = null, on = (e) => {
1882
- rn.add(e), !an && (an = new MutationObserver(() => {
1883
- for (let e of rn) e.relabel();
1900
+ }), on = /* @__PURE__ */ new Set(), sn = null, cn = (e) => {
1901
+ on.add(e), !sn && (sn = new MutationObserver(() => {
1902
+ for (let e of on) e.relabel();
1884
1903
  requestAnimationFrame(() => requestAnimationFrame(() => {
1885
- for (let e of rn) e.refresh();
1904
+ for (let e of on) e.refresh();
1886
1905
  }));
1887
- }), an.observe(document.documentElement, {
1906
+ }), sn.observe(document.documentElement, {
1888
1907
  attributes: !0,
1889
1908
  attributeFilter: ["lang"]
1890
1909
  }));
1891
- }, sn = (e) => {
1892
- rn.delete(e), !rn.size && an && (an.disconnect(), an = null);
1893
- }, cn = ["column", "bar"], ln = (e) => {
1910
+ }, ln = (e) => {
1911
+ on.delete(e), !on.size && sn && (sn.disconnect(), sn = null);
1912
+ }, un = ["column", "bar"], dn = (e) => {
1894
1913
  let t = e.getAttribute("data-chart") || "column";
1895
- if (!cn.includes(t)) return null;
1914
+ if (!un.includes(t)) return null;
1896
1915
  let n = getComputedStyle(e).getPropertyValue("--tablechart-type").trim();
1897
- return cn.includes(n) ? n : t;
1898
- }, un = (e, t) => {
1899
- let n = e, r = ln(n.figure), i = null, a = !1, o = !1, s = async () => {
1900
- if (!t.animate) return Nt(n, !0);
1916
+ return un.includes(n) ? n : t;
1917
+ }, fn = (e, t) => {
1918
+ let n = e, r = dn(n.figure), i = null, a = !1, o = !1, s = async () => {
1919
+ if (!t.animate) return Ft(n, !0);
1901
1920
  let e = n.figure.classList.contains("is-shown");
1902
1921
  if (a && i !== null && !e && !o) {
1903
1922
  o = !0;
1904
- let e = Zt() ? null : tn(n.figure);
1905
- e && await nn(e), await en(n.figure, $t(n.figure, t)), o = !1, (a || !t.replay) && Nt(n, !0);
1906
- } else !a && t.replay && e && Nt(n, !1);
1923
+ let e = $t() ? null : rn(n.figure);
1924
+ e && await an(e), await nn(n.figure, tn(n.figure, t)), o = !1, (a || !t.replay) && Ft(n, !0);
1925
+ } else !a && t.replay && e && Ft(n, !1);
1907
1926
  }, c = () => {
1908
- let e = ln(n.figure);
1927
+ let e = dn(n.figure);
1909
1928
  if (!e || e === r) return;
1910
- let a = X.timed("Building", n.figure, () => St(n.figure, t, e));
1911
- a && (Mt(n), He(a, n.step, !0), n = a, r = e, i = null);
1929
+ let a = X.timed("Building", n.figure, () => wt(n.figure, t, e));
1930
+ a && (Pt(n), He(a, n.step, !0), n = a, r = e, i = null);
1912
1931
  }, l = () => {
1913
1932
  c();
1914
1933
  let e = n.plot.clientWidth;
1915
- e && e !== i && X.timed("Layout", n.figure, () => At(n, t)) && (i = e, s());
1934
+ e && e !== i && X.timed("Layout", n.figure, () => Mt(n, t)) && (i = e, s());
1916
1935
  }, u = !1, d = new ResizeObserver(() => {
1917
1936
  u || (u = !0, requestAnimationFrame(() => {
1918
1937
  u = !1, l();
@@ -1920,14 +1939,14 @@ var Te = (e) => e.map((e) => ({
1920
1939
  }), f = new IntersectionObserver((e) => {
1921
1940
  for (let t of e) a = t.isIntersecting, s();
1922
1941
  }, { threshold: t.threshold }), p = () => {
1923
- n.figure.classList.add(h), Nt(n, !0), n.figure.offsetWidth;
1942
+ n.figure.classList.add(h), Ft(n, !0), n.figure.offsetWidth;
1924
1943
  }, m = () => n.figure.classList.remove(h), g = () => {
1925
1944
  i = null, l();
1926
1945
  }, _ = {
1927
- relabel: () => jt(n, t),
1946
+ relabel: () => Nt(n, t),
1928
1947
  refresh: g
1929
1948
  };
1930
- c(), l(), d.observe(n.figure), f.observe(n.figure), window.addEventListener("beforeprint", p), window.addEventListener("afterprint", m), on(_);
1949
+ c(), l(), d.observe(n.figure), f.observe(n.figure), window.addEventListener("beforeprint", p), window.addEventListener("afterprint", m), cn(_);
1931
1950
  let v = {
1932
1951
  figure: n.figure,
1933
1952
  refresh: g,
@@ -1941,29 +1960,29 @@ var Te = (e) => e.map((e) => ({
1941
1960
  return n.plan?.count ?? 0;
1942
1961
  },
1943
1962
  destroy() {
1944
- d.disconnect(), f.disconnect(), window.removeEventListener("beforeprint", p), window.removeEventListener("afterprint", m), sn(_), dt(n), n.figure.tablechart === v && delete n.figure.tablechart;
1963
+ d.disconnect(), f.disconnect(), window.removeEventListener("beforeprint", p), window.removeEventListener("afterprint", m), ln(_), pt(n), n.figure.tablechart === v && delete n.figure.tablechart;
1945
1964
  }
1946
1965
  };
1947
1966
  return n.figure.tablechart = v, v;
1948
- }, dn = !1, fn = (t) => {
1967
+ }, pn = !1, mn = (t) => {
1949
1968
  let n = t.find((e) => e.tagName !== "FIGURE");
1950
- !dn && n && (dn = !0, console.warn(`[${e}] A chart is a <${n.tagName.toLowerCase()}>. Use a <figure> with a <figcaption>, so the chart has a title, also for screen readers.`, n));
1951
- }, pn = async (e, t) => {
1952
- let n = Ut(e.filter((e) => !e.hasAttribute(Xt)));
1953
- return fn(n), await Kt(n), Yt(n), Le(n, t.langattribute), n;
1954
- }, mn = (e, t) => {
1955
- let n = X.timed("Building", e, () => St(e, t));
1956
- return n ? (e.setAttribute(Xt, ""), un(n, t)) : null;
1957
- }, hn = async (e, t = {}) => {
1969
+ !pn && n && (pn = !0, console.warn(`[${e}] A chart is a <${n.tagName.toLowerCase()}>. Use a <figure> with a <figcaption>, so the chart has a title, also for screen readers.`, n));
1970
+ }, hn = async (e, t) => {
1971
+ let n = Gt(e.filter((e) => !e.hasAttribute(Qt)));
1972
+ return mn(n), await Jt(n), Zt(n), Le(n, t.langattribute), n;
1973
+ }, gn = (e, t) => {
1974
+ let n = X.timed("Building", e, () => wt(e, t));
1975
+ return n ? (e.setAttribute(Qt, ""), fn(n, t)) : null;
1976
+ }, _n = async (e, t = {}) => {
1958
1977
  if (e.tablechart) return e.tablechart;
1959
1978
  let n = {
1960
1979
  ...v,
1961
1980
  ...t
1962
1981
  };
1963
1982
  n.debug && (X.enabled = !0);
1964
- let [r] = await pn([e], n);
1965
- return r ? mn(r, n) : null;
1966
- }, gn = [
1983
+ let [r] = await hn([e], n);
1984
+ return r ? gn(r, n) : null;
1985
+ }, vn = [
1967
1986
  ["--tablechart-duration", "--tablechart-animation-element-duration"],
1968
1987
  ["--tablechart-stagger", "--tablechart-animation-stagger, a share of the element time"],
1969
1988
  ["--tablechart-easing", "--tablechart-animation-ease"],
@@ -1986,32 +2005,32 @@ var Te = (e) => e.map((e) => ({
1986
2005
  ["--tablechart-key-size", "--tablechart-legend-key-size"],
1987
2006
  ["--tablechart-controls-justify", "--tablechart-control-justify"],
1988
2007
  ["--tablechart-controls-gap", "--tablechart-control-gap"]
1989
- ], _n = {
2008
+ ], yn = {
1990
2009
  up: "grow",
1991
2010
  across: "sweep"
1992
- }, vn = !1, yn = (t, n) => {
1993
- if (vn) return;
2011
+ }, bn = !1, xn = (t, n) => {
2012
+ if (bn) return;
1994
2013
  let r = (e) => {
1995
- let t = _n[String(e)];
2014
+ let t = yn[String(e)];
1996
2015
  return t ? [`"${e}" is now "${t}"`] : [];
1997
2016
  }, i = new Set(r(n.animate));
1998
2017
  n.hover !== void 0 && i.add("the \"hover\" option is now \"tooltip\"");
1999
2018
  for (let e of t) {
2000
2019
  e.hasAttribute("data-chart-hover") && i.add("data-chart-hover is now data-chart-tooltip");
2001
2020
  let t = getComputedStyle(e);
2002
- for (let [e, n] of gn) t.getPropertyValue(e).trim() && i.add(`${e} is now ${n}`);
2021
+ for (let [e, n] of vn) t.getPropertyValue(e).trim() && i.add(`${e} is now ${n}`);
2003
2022
  for (let t of r(e.getAttribute("data-chart-animate"))) i.add(t);
2004
2023
  }
2005
- i.size && (vn = !0, console.warn(`[${e}] ${[...i].join("; ")}. The old names work until the next minor version.`));
2006
- }, bn = async (e = {}, t = document) => {
2024
+ i.size && (bn = !0, console.warn(`[${e}] ${[...i].join("; ")}. The old names work until the next minor version.`));
2025
+ }, Sn = async (e = {}, t = document) => {
2007
2026
  let n = {
2008
2027
  ...v,
2009
2028
  ...e
2010
2029
  };
2011
2030
  n.debug && (X.enabled = !0);
2012
- let r = await pn(Array.from(t.querySelectorAll(n.selector)), n);
2013
- yn(r, n);
2014
- let i = r.map((e) => mn(e, n)).filter((e) => e !== null);
2031
+ let r = await hn(Array.from(t.querySelectorAll(n.selector)), n);
2032
+ xn(r, n);
2033
+ let i = r.map((e) => gn(e, n)).filter((e) => e !== null);
2015
2034
  return X.log(`Made ${i.length} chart(s).`), {
2016
2035
  charts: i,
2017
2036
  refresh: () => {
@@ -2023,4 +2042,4 @@ var Te = (e) => e.map((e) => ({
2023
2042
  };
2024
2043
  };
2025
2044
  //#endregion
2026
- export { h as _, Ut as a, v as b, St as c, Nt as d, Mt as f, t as g, f as h, pn as i, At as l, Le as m, $t as n, Kt as o, He as p, bn as r, Yt as s, hn as t, jt as u, g as v, m as y };
2045
+ export { h as _, Gt as a, v as b, wt as c, Ft as d, Pt as f, t as g, f as h, hn as i, Mt as l, Le as m, tn as n, Jt as o, He as p, Sn as r, Zt as s, _n as t, Nt as u, g as v, m as y };