@bicharts/chart-host 0.6.110 → 0.6.112

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.
@@ -1175,10 +1175,10 @@ function Fn(n, s2) {
1175
1175
  return { iso: o2, unmatched: I3, matchedRows: N2, totalRows: n.length };
1176
1176
  }
1177
1177
 
1178
- // ../shape-core/dist/chunk-O6A7HGFH.mjs
1178
+ // ../shape-core/dist/chunk-QAGRGHJI.mjs
1179
1179
  var import_papaparse = __toESM(require_papaparse_min(), 1);
1180
1180
  /*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
1181
- function Ct(t, e, n) {
1181
+ function wt(t, e, n) {
1182
1182
  if (e === "us-state-code" || e === "us-state-name") {
1183
1183
  let s2 = En2(t, e);
1184
1184
  return s2 ? "US-" + s2 : null;
@@ -1188,21 +1188,21 @@ function Ct(t, e, n) {
1188
1188
  let i = n == null ? null : String(n), r2 = new Set(vn(t, i).map(Zn).filter((s2) => !!s2));
1189
1189
  return r2.size === 1 ? [...r2][0] : null;
1190
1190
  }
1191
- function Si(t, e = {}) {
1192
- let n = e.deriveProvinces !== false, i = new Array(t.length), r2 = new Array(t.length), s2 = /* @__PURE__ */ new Set(), o2 = [], l2 = /* @__PURE__ */ new Set(), a3 = [], c = 0, d2 = 0, g5 = 0, m2 = (A2) => {
1191
+ function Mi(t, e = {}) {
1192
+ let n = e.deriveProvinces !== false, i = new Array(t.length), r2 = new Array(t.length), s2 = /* @__PURE__ */ new Set(), a3 = [], l2 = /* @__PURE__ */ new Set(), o2 = [], c = 0, u3 = 0, g5 = 0, d2 = (A2) => {
1193
1193
  let S = A2.toLowerCase();
1194
- s2.has(S) || (s2.add(S), o2.push(A2));
1195
- }, b2 = (A2) => A2 == null || A2 === "" ? null : Number(A2), M2 = /* @__PURE__ */ new Map();
1194
+ s2.has(S) || (s2.add(S), a3.push(A2));
1195
+ }, y3 = (A2) => A2 == null || A2 === "" ? null : Number(A2), w4 = /* @__PURE__ */ new Map();
1196
1196
  return t.forEach((A2, S) => {
1197
1197
  i[S] = null, r2[S] = null;
1198
1198
  let p3 = A2.country === null || A2.country === void 0 || String(A2.country).trim() === "" ? null : String(A2.country).trim(), h3 = A2.province === null || A2.province === void 0 ? "" : String(A2.province).trim();
1199
1199
  if (h3) {
1200
- let _3 = Ct(h3, e.provinceKind, p3);
1201
- _3 ? (i[S] = _3, r2[S] = "province", c++) : m2(h3);
1200
+ let _3 = wt(h3, e.provinceKind, p3);
1201
+ _3 ? (i[S] = _3, r2[S] = "province", c++) : d2(h3);
1202
1202
  return;
1203
1203
  }
1204
1204
  if (!n) return;
1205
- let x3 = b2(A2.lat), f2 = b2(A2.lon), C3 = false;
1205
+ let x3 = y3(A2.lat), f2 = y3(A2.lon), C3 = false;
1206
1206
  if (e.locate && x3 !== null && f2 !== null && isFinite(x3) && isFinite(f2)) {
1207
1207
  C3 = true;
1208
1208
  let _3 = e.locate(x3, f2);
@@ -1211,116 +1211,129 @@ function Si(t, e = {}) {
1211
1211
  return;
1212
1212
  }
1213
1213
  }
1214
- let y3 = A2.city === null || A2.city === void 0 ? "" : String(A2.city).trim();
1215
- if (y3 && W2()) {
1216
- let _3 = y3.toLowerCase() + "" + (p3 ?? ""), w4 = M2.get(_3);
1217
- if (w4 || (w4 = Mn(y3, { country: p3 }), M2.set(_3, w4)), w4.status === "resolved" && w4.provinceId) {
1218
- i[S] = w4.provinceId, r2[S] = "city", c++;
1214
+ let b2 = A2.city === null || A2.city === void 0 ? "" : String(A2.city).trim();
1215
+ if (b2 && W2()) {
1216
+ let _3 = b2.toLowerCase() + "" + (p3 ?? ""), M2 = w4.get(_3);
1217
+ if (M2 || (M2 = Mn(b2, { country: p3 }), w4.set(_3, M2)), M2.status === "resolved" && M2.provinceId) {
1218
+ i[S] = M2.provinceId, r2[S] = "city", c++;
1219
1219
  return;
1220
1220
  }
1221
- if (w4.status === "ambiguous") {
1222
- d2++, l2.has(_3) || (l2.add(_3), a3.length < 8 && a3.push(y3));
1221
+ if (M2.status === "ambiguous") {
1222
+ u3++, l2.has(_3) || (l2.add(_3), o2.length < 8 && o2.push(b2));
1223
1223
  return;
1224
1224
  }
1225
- m2(y3);
1225
+ d2(b2);
1226
1226
  return;
1227
1227
  }
1228
1228
  C3 && g5++;
1229
- }), { iso: i, source: r2, unmatched: o2, matchedRows: c, totalRows: t.length, ambiguousRows: d2, ambiguousExamples: a3, unplacedPoints: g5 };
1229
+ }), { iso: i, source: r2, unmatched: a3, matchedRows: c, totalRows: t.length, ambiguousRows: u3, ambiguousExamples: o2, unplacedPoints: g5 };
1230
+ }
1231
+ var Tn3 = { es: ["latitud"], pt: ["latitude"], fr: ["latitude"], it: ["latitudine"], nl: ["breedtegraad"], de: ["breitengrad"] };
1232
+ var vn2 = { es: ["longitud"], pt: ["longitude"], fr: ["longitude"], it: ["longitudine"], nl: ["lengtegraad"], de: ["l\xE4ngengrad"] };
1233
+ var We = (t) => f(t.normalize("NFC")).toLowerCase();
1234
+ var In2 = new Set(Object.values(Tn3).flatMap((t) => (t ?? []).map(We)));
1235
+ var Rn3 = new Set(Object.values(vn2).flatMap((t) => (t ?? []).map(We)));
1236
+ function Rt2(t) {
1237
+ let e = false, n = false;
1238
+ for (let i of t) {
1239
+ let r2 = We(i);
1240
+ In2.has(r2) ? e = true : Rn3.has(r2) && (n = true);
1241
+ }
1242
+ return e === n ? null : e ? "lat" : "lon";
1230
1243
  }
1231
- var wn = ["rate", "ratio", "pct", "percent", "percentage", "rating", "share", "score", "index", "nps", "csat", "margin", "yield", "coverage", "utilization", "utilisation", "z[_-]?score", "average", "avg", "mean", "median", "stddev", "variance", "gpa", "percentile", "quantile", "efficiency", "accuracy", "probability", "multiplier", "coefficient", "correlation", "occupancy", "age", "bmi", "temperature", "density", "pressure", "humidity", "ph", "velocity", "speed", "elevation", "altitude", "latency", "throughput", "bandwidth", "iops", "ppm", "ppb", "dpmo", "bps", "capita", "temperatuur", "temperatur", "temperatura", "teplota", "lampotila", "homerseklet", "sicaklik", "pression", "presion", "pressao", "pressione", "druck", "tryck", "tlak", "paine", "nyomas", "presiune", "humidite", "humedad", "umidade", "umidita", "feuchtigkeit", "vochtigheid", "kosteus", "vlhkost", "vitesse", "velocidad", "velocidade", "velocita", "geschwindigkeit", "snelheid", "hastighet", "hastighed", "rychlost", "nopeus", "sebesseg", "brzina", "predkosc", "densite", "densidad", "densidade", "densita", "dichte", "dichtheid", "hustota", "tiheys", "gustoca", "moyenne", "mediane", "promedio", "mediana", "gemiddelde", "durchschnitt", "mittelwert", "genomsnitt", "gennemsnit", "gjennomsnitt", "keskiarvo", "atlag", "ortalama", "prosjek", "srednia", "prumer", "priemer", "medie", "taux", "tasa", "taxa", "tasso", "verhaltnis", "verhouding", "aandeel", "anteil", "andel", "osuus", "podil", "udzial", "udio", "pourcentage", "porcentaje", "percentual", "prozent", "procent", "prosentti", "szazalek", "yuzde", "participacion", "participacao", "pondere", "omjer", "arany", "oran", "rata", "leeftijd", "edad", "idade", "wiek", "eletkor", "varsta", "puntuacion", "pontuacao", "punteggio", "betyg", "ocena", "indice", "indeks", "wskaznik", "puan", "ocupacion", "ocupacao", "occupazione", "auslastung", "bezetting", "belaggning", "belaegning", "belegg", "kayttoaste", "oblozenie", "obsazenost", "obsadenost", "kihasznaltsag", "doluluk", "ocupare", "popunjenost", "efficacite", "eficiencia", "efficienza", "effizienz", "effectiviteit", "verimlilik"];
1232
- var Mn2 = ["pct", "percent", "percentage", "rate", "ratio", "rating", "share", "score", "index", "nps", "csat", "margin", "yield", "coverage", "utilization", "utilisation", "gpa", "percentile", "quantile", "bmi", "density", "pressure", "humidity", "velocity", "efficiency", "occupancy", "latency", "throughput", "bandwidth", "iops", "ppm", "ppb", "dpmo", "bps"];
1233
- var Tn3 = ["latitude", "longitude"];
1234
- var vn2 = ["latitude", "longitude"];
1244
+ var En3 = ["rate", "ratio", "pct", "percent", "percentage", "rating", "share", "score", "index", "nps", "csat", "margin", "yield", "coverage", "utilization", "utilisation", "z[_-]?score", "average", "avg", "mean", "median", "stddev", "variance", "gpa", "percentile", "quantile", "efficiency", "accuracy", "probability", "multiplier", "coefficient", "correlation", "occupancy", "age", "bmi", "temperature", "density", "pressure", "humidity", "ph", "velocity", "speed", "elevation", "altitude", "latency", "throughput", "bandwidth", "iops", "ppm", "ppb", "dpmo", "bps", "capita", "temperatuur", "temperatur", "temperatura", "teplota", "lampotila", "homerseklet", "sicaklik", "pression", "presion", "pressao", "pressione", "druck", "tryck", "tlak", "paine", "nyomas", "presiune", "humidite", "humedad", "umidade", "umidita", "feuchtigkeit", "vochtigheid", "kosteus", "vlhkost", "vitesse", "velocidad", "velocidade", "velocita", "geschwindigkeit", "snelheid", "hastighet", "hastighed", "rychlost", "nopeus", "sebesseg", "brzina", "predkosc", "densite", "densidad", "densidade", "densita", "dichte", "dichtheid", "hustota", "tiheys", "gustoca", "moyenne", "mediane", "promedio", "mediana", "gemiddelde", "durchschnitt", "mittelwert", "genomsnitt", "gennemsnit", "gjennomsnitt", "keskiarvo", "atlag", "ortalama", "prosjek", "srednia", "prumer", "priemer", "medie", "taux", "tasa", "taxa", "tasso", "verhaltnis", "verhouding", "aandeel", "anteil", "andel", "osuus", "podil", "udzial", "udio", "pourcentage", "porcentaje", "percentual", "prozent", "procent", "prosentti", "szazalek", "yuzde", "participacion", "participacao", "pondere", "omjer", "arany", "oran", "rata", "leeftijd", "edad", "idade", "wiek", "eletkor", "varsta", "puntuacion", "pontuacao", "punteggio", "betyg", "ocena", "indice", "indeks", "wskaznik", "puan", "ocupacion", "ocupacao", "occupazione", "auslastung", "bezetting", "belaggning", "belaegning", "belegg", "kayttoaste", "oblozenie", "obsazenost", "obsadenost", "kihasznaltsag", "doluluk", "ocupare", "popunjenost", "efficacite", "eficiencia", "efficienza", "effizienz", "effectiviteit", "verimlilik"];
1245
+ var Nn2 = ["pct", "percent", "percentage", "rate", "ratio", "rating", "share", "score", "index", "nps", "csat", "margin", "yield", "coverage", "utilization", "utilisation", "gpa", "percentile", "quantile", "bmi", "density", "pressure", "humidity", "velocity", "efficiency", "occupancy", "latency", "throughput", "bandwidth", "iops", "ppm", "ppb", "dpmo", "bps"];
1246
+ var kn2 = ["latitude", "longitude"];
1247
+ var Dn = ["latitude", "longitude"];
1235
1248
  function q2(t) {
1236
1249
  return f(t);
1237
1250
  }
1238
- var Et = ["somme de", "suma de", "soma de", "summe von", "som van", "somma di", "summa av", "sum av", "sum af", "soucet z", "suma z", "totaal van", "total de", "toplam", "osszeg", "nombre de", "recuento de", "contagem de", "anzahl von", "aantal van", "conteggio di", "antal av", "lukumaara", "pocet z", "sum pa", "\u0441\u0443\u043C\u043C\u0430", "\u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E", "\u0441\u0443\u043C\u0430", "\u043A\u0456\u043B\u044C\u043A\u0456\u0441\u0442\u044C", "\u03B1\u03B8\u03C1\u03BF\u03B9\u03C3\u03BC\u03B1", "\u03C0\u03BB\u03B7\u03B8\u03BF\u03C2"];
1239
- var Rn3 = ["osszege", "sucet", "\u7684\u603B\u548C", "\u7684\u8BA1\u6570", "\u306E\u5408\u8A08", "\uC758 \uD569\uACC4"];
1240
- var En3 = ["atlaga", "priemer", "\u7684\u5E73\u5747\u503C", "\u306E\u5E73\u5747", "\uC758 \uD3C9\uADE0"];
1251
+ var kt2 = ["somme de", "suma de", "soma de", "summe von", "som van", "somma di", "summa av", "sum av", "sum af", "soucet z", "suma z", "totaal van", "total de", "toplam", "osszeg", "nombre de", "recuento de", "contagem de", "anzahl von", "aantal van", "conteggio di", "antal av", "lukumaara", "pocet z", "sum pa", "\u0441\u0443\u043C\u043C\u0430", "\u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E", "\u0441\u0443\u043C\u0430", "\u043A\u0456\u043B\u044C\u043A\u0456\u0441\u0442\u044C", "\u03B1\u03B8\u03C1\u03BF\u03B9\u03C3\u03BC\u03B1", "\u03C0\u03BB\u03B7\u03B8\u03BF\u03C2"];
1252
+ var Pn2 = ["osszege", "sucet", "\u7684\u603B\u548C", "\u7684\u8BA1\u6570", "\u306E\u5408\u8A08", "\uC758 \uD569\uACC4"];
1253
+ var Ln2 = ["atlaga", "priemer", "\u7684\u5E73\u5747\u503C", "\u306E\u5E73\u5747", "\uC758 \uD3C9\uADE0"];
1241
1254
  var xe = Object.freeze({ "nombre de": "count", "recuento de": "count", "contagem de": "count", "anzahl von": "count", "aantal van": "count", "conteggio di": "count", "antal av": "count", lukumaara: "count", "pocet z": "count", \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E: "count", \u043A\u0456\u043B\u044C\u043A\u0456\u0441\u0442\u044C: "count", \u03C0\u03BB\u03B7\u03B8\u03BF\u03C2: "count", \u7684\u8BA1\u6570: "count", "minimum de": "min", "minimo de": "min", "minimo di": "min", "minimum von": "min", "maximum de": "max", "maximo de": "max", "massimo di": "max", "maximum von": "max" });
1242
- function We(t) {
1255
+ function $e(t) {
1243
1256
  return [...t].sort((e, n) => n.length - e.length).map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\s+/g, "\\s+")).join("|");
1244
1257
  }
1245
- var Nt = new RegExp("^\\s*(?:(?:sum|count|count\\s+distinct|distinct\\s+count)\\s+of\\s+|(?:" + We(Et) + ")\\s+)", "i");
1246
- function It(t) {
1258
+ var Dt = new RegExp("^\\s*(?:(?:sum|count|count\\s+distinct|distinct\\s+count)\\s+of\\s+|(?:" + $e(kt2) + ")\\s+)", "i");
1259
+ function Et(t) {
1247
1260
  for (let e of t) {
1248
1261
  let n = e.codePointAt(0) ?? 0;
1249
1262
  if (n >= 11904 && n <= 40959 || n >= 44032 && n <= 55215) return true;
1250
1263
  }
1251
1264
  return false;
1252
1265
  }
1253
- var Nn2 = "[\u2013\u2014-]";
1254
- function kt2(t) {
1255
- let e = t.filter((r2) => !It(r2)), n = t.filter(It), i = [];
1256
- return e.length && i.push("(?:\\s+|\\s*" + Nn2 + "\\s*)(" + We(e) + ")"), n.length && i.push("\\s*(" + We(n) + ")"), new RegExp("(?:" + i.join("|") + ")\\s*$", "i");
1266
+ var Fn2 = "[\u2013\u2014-]";
1267
+ function Ot2(t) {
1268
+ let e = t.filter((r2) => !Et(r2)), n = t.filter(Et), i = [];
1269
+ return e.length && i.push("(?:\\s+|\\s*" + Fn2 + "\\s*)(" + $e(e) + ")"), n.length && i.push("\\s*(" + $e(n) + ")"), new RegExp("(?:" + i.join("|") + ")\\s*$", "i");
1257
1270
  }
1258
- var $e = kt2(Rn3);
1259
- var kn2 = kt2(En3);
1271
+ var Be = Ot2(Pn2);
1272
+ var zn2 = Ot2(Ln2);
1260
1273
  function Ce(t, e) {
1261
1274
  let n = e.exec(t);
1262
1275
  if (!n) return null;
1263
1276
  let i = t.slice(0, n.index);
1264
1277
  return i.trim() === "" ? null : { base: i, label: (n[1] ?? n[2] ?? "").toLowerCase() };
1265
1278
  }
1266
- var Dn = /(?<=[a-z0-9])(?=[A-Z])|(?<=[A-Za-z])(?=[0-9])|(?<=[0-9])(?=[A-Za-z])/g;
1267
- var Pn2 = new RegExp("\\b(" + wn.join("|") + ")\\b|(" + Mn2.join("|") + ")$", "i");
1268
- var On3 = new RegExp("\\b(" + Tn3.join("|") + ")\\b|(" + vn2.join("|") + ")$", "i");
1279
+ var Wn2 = /(?<=[a-z0-9])(?=[A-Z])|(?<=[A-Za-z])(?=[0-9])|(?<=[0-9])(?=[A-Za-z])/g;
1280
+ var $n2 = new RegExp("\\b(" + En3.join("|") + ")\\b|(" + Nn2.join("|") + ")$", "i");
1281
+ var Bn2 = new RegExp("\\b(" + kn2.join("|") + ")\\b|(" + Dn.join("|") + ")$", "i");
1269
1282
  function Me(t) {
1270
1283
  if (!t) return "";
1271
- let e = String(t), n = q2(e), i = Nt.exec(n);
1284
+ let e = String(t), n = q2(e), i = Dt.exec(n);
1272
1285
  if (i) return e.slice(i[0].length).trim();
1273
- let r2 = Ce(n, $e);
1286
+ let r2 = Ce(n, Be);
1274
1287
  return (r2 ? e.slice(0, r2.base.length) : e).trim();
1275
1288
  }
1276
- function Ln2(t) {
1289
+ function Gn2(t) {
1277
1290
  if (!t) return false;
1278
1291
  let e = q2(String(t));
1279
- return Nt.test(e) || Ce(e, $e) !== null;
1292
+ return Dt.test(e) || Ce(e, Be) !== null;
1280
1293
  }
1281
- var Fn2 = ["count (distinct)", "count distinct", "distinct count", "standard deviation", "average", "variance", "median", "product", "stddev", "std dev", "count", "sum", "avg", "min", "minimum", "max", "maximum", "var"];
1282
- var Rt2 = new RegExp("^\\s*(" + [...Fn2].sort((t, e) => e.length - t.length).map((t) => t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\s+/g, "\\s+")).join("|") + ")\\s+of\\s+", "i");
1294
+ var Vn2 = ["count (distinct)", "count distinct", "distinct count", "standard deviation", "average", "variance", "median", "product", "stddev", "std dev", "count", "sum", "avg", "min", "minimum", "max", "maximum", "var"];
1295
+ var Nt = new RegExp("^\\s*(" + [...Vn2].sort((t, e) => e.length - t.length).map((t) => t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\s+/g, "\\s+")).join("|") + ")\\s+of\\s+", "i");
1283
1296
  var we = { Sum: ["Sum of "], Avg: ["Average of "], Average: ["Average of "], Count: ["Count of "], CountNonNull: ["Count of "], Min: ["Min of ", "First ", "Earliest "], Max: ["Max of ", "Last ", "Latest "], Median: ["Median of "], StandardDeviation: ["Standard deviation of "], Variance: ["Variance of "] };
1284
- var Ot2 = new RegExp("^(" + Object.keys(we).join("|") + ")\\((.+)\\)$");
1285
- function zn2(t) {
1297
+ var Ft = new RegExp("^(" + Object.keys(we).join("|") + ")\\((.+)\\)$");
1298
+ function Kn2(t) {
1286
1299
  let e = Me(t);
1287
- return e.length === 0 ? "" : e.replace(Dn, " ");
1300
+ return e.length === 0 ? "" : e.replace(Wn2, " ");
1288
1301
  }
1289
- function zt(t, e) {
1302
+ function $t(t, e) {
1290
1303
  if (!e) return false;
1291
1304
  let n = Me(e);
1292
- return t.test(q2(zn2(e))) || t.test(q2(n)) || t.test(q2(g2(n).join(" ")));
1305
+ return t.test(q2(Kn2(e))) || t.test(q2(n)) || t.test(q2(g2(n).join(" ")));
1293
1306
  }
1294
- function Wt(t) {
1295
- return zt(On3, t);
1307
+ function Bt(t) {
1308
+ return $t(Bn2, t);
1296
1309
  }
1297
- function Wn2(t) {
1298
- return zt(Pn2, t) || Wt(t);
1310
+ function Un3(t) {
1311
+ return $t($n2, t) || Bt(t);
1299
1312
  }
1300
- var $t = /int|double|decimal|single|float|number|currency|money/i;
1301
- function $n2(t) {
1313
+ var Gt2 = /int|double|decimal|single|float|number|currency|money/i;
1314
+ function Hn2(t) {
1302
1315
  let e = String(t?.valueNature ?? "").trim().toLowerCase();
1303
- return e === "categorical" ? "Categorical" : e === "ordinal" ? "Ordinal" : e === "continuous" || t?.isMeasure === true || $t.test(String(t?.dataType ?? "")) ? "Continuous" : "Categorical";
1316
+ return e === "categorical" ? "Categorical" : e === "ordinal" ? "Ordinal" : e === "continuous" || t?.isMeasure === true || Gt2.test(String(t?.dataType ?? "")) ? "Continuous" : "Categorical";
1304
1317
  }
1305
- function Bn2(t) {
1306
- return t?.isMeasure === true || $t.test(String(t?.dataType ?? ""));
1318
+ function Yn3(t) {
1319
+ return t?.isMeasure === true || Gt2.test(String(t?.dataType ?? ""));
1307
1320
  }
1308
- function Bt(t) {
1309
- let e = t ?? {}, n = $n2(e);
1321
+ function Vt(t) {
1322
+ let e = t ?? {}, n = Hn2(e);
1310
1323
  if (n !== "Continuous") return { nature: n, additivity: "unknown", basis: "role", suppressed: false };
1311
- if (Wt(e.name)) return { nature: n, additivity: "positional", basis: "name", suppressed: true };
1324
+ if (Bt(e.name)) return { nature: n, additivity: "positional", basis: "name", suppressed: true };
1312
1325
  let i = String(e.additivity ?? "").trim().toLowerCase();
1313
- if (!(i === "additive" && Ln2(e.name))) {
1326
+ if (!(i === "additive" && Gn2(e.name))) {
1314
1327
  if (i === "additive") return { nature: n, additivity: "additive", basis: "measured", suppressed: false };
1315
1328
  if (i === "part_of_whole") return { nature: n, additivity: "part_of_whole", basis: "measured", suppressed: false };
1316
1329
  if (i === "intensive_rate") return { nature: n, additivity: "intensive_rate", basis: "measured", suppressed: false };
1317
1330
  }
1318
- return e.discourageAggregationAcrossGroups === true ? { nature: n, additivity: "intensive_rate", basis: "host-flag", suppressed: false } : Wn2(e.name) ? { nature: n, additivity: "intensive_rate", basis: "name", suppressed: false } : { nature: n, additivity: "additive", basis: "default", suppressed: false };
1331
+ return e.discourageAggregationAcrossGroups === true ? { nature: n, additivity: "intensive_rate", basis: "host-flag", suppressed: false } : Un3(e.name) ? { nature: n, additivity: "intensive_rate", basis: "name", suppressed: false } : { nature: n, additivity: "additive", basis: "default", suppressed: false };
1319
1332
  }
1320
- function Gt2(t) {
1321
- let e = Bt(t), n = t ?? {};
1333
+ function Kt(t) {
1334
+ let e = Vt(t), n = t ?? {};
1322
1335
  if (e.nature === "Categorical") return ["first", "distinctcount", "count"];
1323
- if (e.nature === "Ordinal") return Bn2(n) ? ["median", "average", "min", "max", "first", "distinctcount", "count"] : ["first", "distinctcount", "count"];
1336
+ if (e.nature === "Ordinal") return Yn3(n) ? ["median", "average", "min", "max", "first", "distinctcount", "count"] : ["first", "distinctcount", "count"];
1324
1337
  switch (e.additivity) {
1325
1338
  case "positional":
1326
1339
  return ["min", "max", "count", "distinctcount", "first"];
@@ -1330,16 +1343,16 @@ function Gt2(t) {
1330
1343
  return ["sum", "average", "median", "min", "max", "count", "distinctcount", "first"];
1331
1344
  }
1332
1345
  }
1333
- function Ti(t) {
1334
- return Gt2(t)[0];
1346
+ function Oi(t) {
1347
+ return Kt(t)[0];
1335
1348
  }
1336
- function Ii(t, e) {
1349
+ function Li(t, e) {
1337
1350
  if (e !== "sum" && e !== "count") return false;
1338
1351
  if (e === "count") return true;
1339
- let n = Bt(t);
1352
+ let n = Vt(t);
1340
1353
  return n.additivity === "additive" || n.additivity === "part_of_whole" || n.additivity === "unknown";
1341
1354
  }
1342
- var tr = new RegExp([String.raw`\bisMeasure\b`, String.raw`\bdataType\b`, String.raw`\bcolumns\s*\[\s*-?\d`, String.raw`\.iloc\s*\[[^\]]*,`, String.raw`\.iat\s*\[`, String.raw`\bselect_dtypes\b`, String.raw`\b_get_numeric_data\b`, String.raw`\bis_numeric_dtype\b`, String.raw`\bfor\s+\w+\s+in\s+(?:list\s*\(\s*)?df\.columns\b`, String.raw`\bdf\.columns\s*\.\s*(?:tolist|to_list|difference|drop)\b`, String.raw`\bdf\.dtypes\b`, String.raw`\bObject\s*\.\s*(?:keys|values|entries)\s*\(\s*(?:rows|data|df)?\s*\[\s*0\s*\]`, String.raw`\b(?:row|rw|r)\s*\[\s*\d+\s*\]`].join("|"));
1355
+ var ar = new RegExp([String.raw`\bisMeasure\b`, String.raw`\bdataType\b`, String.raw`\bcolumns\s*\[\s*-?\d`, String.raw`\.iloc\s*\[[^\]]*,`, String.raw`\.iat\s*\[`, String.raw`\bselect_dtypes\b`, String.raw`\b_get_numeric_data\b`, String.raw`\bis_numeric_dtype\b`, String.raw`\bfor\s+\w+\s+in\s+(?:list\s*\(\s*)?df\.columns\b`, String.raw`\bdf\.columns\s*\.\s*(?:tolist|to_list|difference|drop)\b`, String.raw`\bdf\.dtypes\b`, String.raw`\bObject\s*\.\s*(?:keys|values|entries)\s*\(\s*(?:rows|data|df)?\s*\[\s*0\s*\]`, String.raw`\b(?:row|rw|r)\s*\[\s*\d+\s*\]`].join("|"));
1343
1356
 
1344
1357
  // ../shape-core/dist/index.mjs
1345
1358
  /*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
@@ -1375,17 +1388,17 @@ function re(e) {
1375
1388
  for (let o2 of t) ne(o2) && n++;
1376
1389
  return Math.round(n / t.length * 1e3) / 10;
1377
1390
  }
1378
- function oe(e) {
1391
+ function oe2(e) {
1379
1392
  return An(e) ? true : W2() ? z(e).status !== "unmatched" || z(e.trim().replace(/\s+/g, "-")).status !== "unmatched" : false;
1380
1393
  }
1381
1394
  function q4(e) {
1382
1395
  let t = F3(e);
1383
1396
  if (t.length === 0) return 0;
1384
1397
  let n = 0;
1385
- for (let o2 of t) oe(o2) && n++;
1398
+ for (let o2 of t) oe2(o2) && n++;
1386
1399
  return Math.round(n / t.length * 1e3) / 10;
1387
1400
  }
1388
- function se2(e) {
1401
+ function se(e) {
1389
1402
  let t = /* @__PURE__ */ new Set();
1390
1403
  for (let n of e) {
1391
1404
  if (n == null) continue;
@@ -1395,16 +1408,16 @@ function se2(e) {
1395
1408
  return Array.from(t);
1396
1409
  }
1397
1410
  function ie(e) {
1398
- let t = se2(e);
1411
+ let t = se(e);
1399
1412
  if (t.length === 0) return 0;
1400
1413
  let n = 0;
1401
1414
  for (let o2 of t) Gn(o2).length > 0 && n++;
1402
1415
  return Math.round(n / t.length * 1e3) / 10;
1403
1416
  }
1404
1417
  function pe(e, t) {
1405
- return y2(t, fn) ? true : se2(e).some((n) => /^\d{5}(-\d{4})?$/.test(n.replace(/\.0+$/, "")));
1418
+ return y2(t, fn) ? true : se(e).some((n) => /^\d{5}(-\d{4})?$/.test(n.replace(/\.0+$/, "")));
1406
1419
  }
1407
- function Tr2(e, t) {
1420
+ function xr(e, t) {
1408
1421
  let n = F3(e);
1409
1422
  if (n.length === 0) return 0;
1410
1423
  let o2 = 0;
@@ -1416,12 +1429,12 @@ function te(e, t) {
1416
1429
  for (let o2 of F3(e)) t(o2) && n++;
1417
1430
  return n;
1418
1431
  }
1419
- function Sr2(e, t) {
1432
+ function wr(e, t) {
1420
1433
  let n = 0;
1421
- for (let o2 of se2(e)) t(o2) && n++;
1434
+ for (let o2 of se(e)) t(o2) && n++;
1422
1435
  return n;
1423
1436
  }
1424
- function Rr(e, t, n, o2, a3) {
1437
+ function _r(e, t, n, o2, a3) {
1425
1438
  let u3 = [], l2 = [], i = {}, y3 = {}, h3 = new Set(e), b2 = (s2) => t.map((d2) => d2[s2]);
1426
1439
  for (let s2 of ["city", "country"]) {
1427
1440
  let d2 = n?.[s2];
@@ -1450,15 +1463,15 @@ function Rr(e, t, n, o2, a3) {
1450
1463
  if (N(S)) continue;
1451
1464
  let O2 = q4(S);
1452
1465
  if (O2 < 95) continue;
1453
- let H3 = te(S, oe), Ge = te(S, (ue) => oe(ue) && !fe(ue, o2));
1454
- H3 < ee && Ge < 1 || (!s2 || O2 > s2.pct) && (s2 = { name: d2, pct: O2 });
1466
+ let H3 = te(S, oe2), Ge2 = te(S, (ue) => oe2(ue) && !fe(ue, o2));
1467
+ H3 < ee && Ge2 < 1 || (!s2 || O2 > s2.pct) && (s2 = { name: d2, pct: O2 });
1455
1468
  }
1456
1469
  s2 && (i.state = s2.name, p3.add(s2.name), u3.push(`state=${s2.name} (${s2.pct}% states/provinces)`));
1457
1470
  }
1458
1471
  if (!i.zip) for (let s2 of C3) {
1459
1472
  if (p3.has(s2)) continue;
1460
1473
  let d2 = b2(s2), S = ie(d2);
1461
- if (!(S < 95) && pe(d2, s2) && !(Sr2(d2, (O2) => Gn(O2).length > 0) < ee)) {
1474
+ if (!(S < 95) && pe(d2, s2) && !(wr(d2, (O2) => Gn(O2).length > 0) < ee)) {
1462
1475
  i.zip = s2, p3.add(s2), u3.push(`zip=${s2} (${S}% ZIP codes)`);
1463
1476
  break;
1464
1477
  }
@@ -1477,12 +1490,12 @@ function Rr(e, t, n, o2, a3) {
1477
1490
  let s2 = null;
1478
1491
  for (let d2 of C3) {
1479
1492
  if (p3.has(d2)) continue;
1480
- let S = b2(d2), O2 = Tr2(S, o2);
1493
+ let S = b2(d2), O2 = xr(S, o2);
1481
1494
  O2 < pt || te(S, (H3) => kt(H3, o2)) < ee || (!s2 || O2 > s2.pct) && (s2 = { name: d2, pct: O2 });
1482
1495
  }
1483
1496
  s2 && (i.city = s2.name, u3.push(`city=${s2.name} (${s2.pct}% known cities)`));
1484
1497
  }
1485
- let A2 = i.country ? b2(i.country) : [], R3 = !!i.country && N(A2), v2 = R3 ? new Set(A2.map((s2) => I(s2 == null ? null : String(s2))).filter(Boolean)).size : 0, x3 = R3 && v2 >= 2, w4 = !!(i.lat && i.lon) && t.some((s2) => {
1498
+ let P2 = i.country ? b2(i.country) : [], R3 = !!i.country && N(P2), L3 = R3 ? new Set(P2.map((s2) => I(s2 == null ? null : String(s2))).filter(Boolean)).size : 0, x3 = R3 && L3 >= 2, w4 = !!(i.lat && i.lon) && t.some((s2) => {
1486
1499
  let d2 = +String(s2[i.lat] ?? "").trim(), S = +String(s2[i.lon] ?? "").trim();
1487
1500
  return isFinite(d2) && isFinite(S) && d2 >= -90 && d2 <= 90 && S >= -180 && S <= 180 && String(s2[i.lat] ?? "").trim() !== "" && String(s2[i.lon] ?? "").trim() !== "";
1488
1501
  });
@@ -1490,11 +1503,11 @@ function Rr(e, t, n, o2, a3) {
1490
1503
  }
1491
1504
  var r = (e, ...t) => ({ part: e, langs: Object.freeze(t) });
1492
1505
  var ae = Object.freeze({ jaar: r("year", "nl"), kwartaal: r("quarter", "nl"), maand: r("month", "nl"), dag: r("day", "nl", "sv", "da", "nb"), jahr: r("year", "de"), quartal: r("quarter", "de"), monat: r("month", "de"), tag: r("day", "de"), ann\u00E9e: r("year", "fr"), mois: r("month", "fr"), jour: r("day", "fr"), trimestre: r("quarter", "fr", "es", "pt", "it"), a\u00F1o: r("year", "es"), mes: r("month", "es"), d\u00EDa: r("day", "es"), ano: r("year", "pt"), m\u00EAs: r("month", "pt"), dia: r("day", "pt"), anno: r("year", "it"), mese: r("month", "it"), giorno: r("day", "it"), \u0433\u043E\u0434: r("year", "ru"), \u043C\u0435\u0441\u044F\u0446: r("month", "ru"), \u0440\u0456\u043A: r("year", "uk"), \u043C\u0456\u0441\u044F\u0446\u044C: r("month", "uk"), \u043A\u0432\u0430\u0440\u0442\u0430\u043B: r("quarter", "ru", "uk"), \u0434\u0435\u043D\u044C: r("day", "ru", "uk"), rok: r("year", "pl", "cs", "sk"), kwarta\u0142: r("quarter", "pl"), miesi\u0105c: r("month", "pl"), dzie\u0144: r("day", "pl"), \u010Dtvrtlet\u00ED: r("quarter", "cs"), m\u011Bs\u00EDc: r("month", "cs"), den: r("day", "cs"), \u0161tvr\u0165rok: r("quarter", "sk"), mesiac: r("month", "sk"), de\u0148: r("day", "sk"), \u00E5r: r("year", "sv", "da", "nb"), kvartal: r("quarter", "sv", "da", "nb"), m\u00E5nad: r("month", "sv"), m\u00E5ned: r("month", "da", "nb"), vuosi: r("year", "fi"), vuosinelj\u00E4nnes: r("quarter", "fi"), kuukausi: r("month", "fi"), p\u00E4iv\u00E4: r("day", "fi"), \u00E9v: r("year", "hu"), negyed\u00E9v: r("quarter", "hu"), h\u00F3nap: r("month", "hu"), nap: r("day", "hu"), y\u0131l: r("year", "tr"), \u00E7eyrek: r("quarter", "tr"), ay: r("month", "tr"), g\u00FCn: r("day", "tr"), \u03AD\u03C4\u03BF\u03C2: r("year", "el"), \u03C4\u03C1\u03AF\u03BC\u03B7\u03BD\u03BF: r("quarter", "el"), \u03BC\u03AE\u03BD\u03B1\u03C2: r("month", "el"), \u03B7\u03BC\u03AD\u03C1\u03B1: r("day", "el"), an: r("year", "ro"), trimestru: r("quarter", "ro"), lun\u0103: r("month", "ro"), zi: r("day", "ro"), godina: r("year", "hr"), tromjese\u010Dje: r("quarter", "hr"), mjesec: r("month", "hr"), dan: r("day", "hr"), \u5E74: r("year", "ja", "zh"), \u56DB\u534A\u671F: r("quarter", "ja"), \u5B63\u5EA6: r("quarter", "zh"), \u6708: r("month", "ja", "zh"), \u65E5: r("day", "ja", "zh"), \uC5F0\uB3C4: r("year", "ko"), \uBD84\uAE30: r("quarter", "ko"), \uC6D4: r("month", "ko"), \uC77C: r("day", "ko"), tahun: r("year", "id"), kuartal: r("quarter", "id"), triwulan: r("quarter", "id"), bulan: r("month", "id"), hari: r("day", "id"), n\u0103m: r("year", "vi"), qu\u00FD: r("quarter", "vi"), th\u00E1ng: r("month", "vi"), ng\u00E0y: r("day", "vi"), \u0E1B\u0E35: r("year", "th"), \u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A: r("quarter", "th"), \u0E40\u0E14\u0E37\u0E2D\u0E19: r("month", "th"), \u0E27\u0E31\u0E19: r("day", "th"), \u0627\u0644\u0633\u0646\u0629: r("year", "ar"), \u0633\u0646\u0629: r("year", "ar"), \u0627\u0644\u0639\u0627\u0645: r("year", "ar"), \u0639\u0627\u0645: r("year", "ar"), \u0627\u0644\u0631\u0628\u0639: r("quarter", "ar"), \u0631\u0628\u0639: r("quarter", "ar"), "\u0631\u0628\u0639 \u0627\u0644\u0633\u0646\u0629": r("quarter", "ar"), \u0627\u0644\u0634\u0647\u0631: r("month", "ar"), \u0634\u0647\u0631: r("month", "ar"), \u0627\u0644\u064A\u0648\u0645: r("day", "ar"), \u064A\u0648\u0645: r("day", "ar"), \u05E9\u05E0\u05D4: r("year", "he"), \u05E8\u05D1\u05E2\u05D5\u05DF: r("quarter", "he"), \u05D7\u05D5\u05D3\u05E9: r("month", "he"), \u05D9\u05D5\u05DD: r("day", "he"), \u0935\u0930\u094D\u0937: r("year", "hi"), \u0938\u093E\u0932: r("year", "hi"), \u0924\u093F\u092E\u093E\u0939\u0940: r("quarter", "hi"), \u092E\u0939\u0940\u0928\u093E: r("month", "hi"), \u092E\u093E\u0939: r("month", "hi"), \u0926\u093F\u0928: r("day", "hi"), \u0633\u0627\u0644: r("year", "fa"), \u0645\u0627\u0647: r("month", "fa"), \u0631\u0648\u0632: r("day", "fa") });
1493
- var xr = Object.freeze(Array.from(new Set(Object.values(ae).flatMap((e) => e.langs))));
1506
+ var Or = Object.freeze(Array.from(new Set(Object.values(ae).flatMap((e) => e.langs))));
1494
1507
  var ye = Object.freeze(["fa", "ar", "he", "th"]);
1495
- var ro = Object.freeze({ integer: "number", decimal: "number", double: "number", datetime: "date", date: "date", boolean: "boolean", string: "text" });
1496
- var mo = Object.freeze({ RENDER_START: "render-start", RENDER_OK: "render-ok", RENDER_ERROR: "render-error", VIEW: "view", VIEW_VERDICT: "view-verdict", REDRAW: "redraw", INTERACT: "interact" });
1497
- var fo = Object.freeze(["open", "generate", "version", "rebind", "data", "sample", "fix", "resize", "other"]);
1508
+ var so = Object.freeze({ integer: "number", decimal: "number", double: "number", datetime: "date", date: "date", boolean: "boolean", string: "text" });
1509
+ var go = Object.freeze({ RENDER_START: "render-start", RENDER_OK: "render-ok", RENDER_ERROR: "render-error", VIEW: "view", VIEW_VERDICT: "view-verdict", REDRAW: "redraw", INTERACT: "interact" });
1510
+ var yo = Object.freeze(["open", "generate", "version", "rebind", "data", "sample", "fix", "resize", "other"]);
1498
1511
  var Ne = 2 ** 31 - 1;
1499
1512
 
1500
1513
  export {
@@ -1511,10 +1524,11 @@ export {
1511
1524
  xt,
1512
1525
  Yn2 as Yn,
1513
1526
  Fn,
1514
- Si,
1515
- Bt,
1516
- Gt2 as Gt,
1517
- Ti,
1518
- Ii,
1519
- Rr
1527
+ Mi,
1528
+ Rt2 as Rt,
1529
+ Vt,
1530
+ Kt,
1531
+ Oi,
1532
+ Li,
1533
+ _r
1520
1534
  };
@@ -0,0 +1,162 @@
1
+ /*! @bicharts/chart-host — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; Natural Earth and US Census/TIGER (public domain). Full text: NOTICE in this package. */
2
+ import {
3
+ LASSO_KNOB_KEY
4
+ } from "./chunk-IL5M7K6Z.mjs";
5
+
6
+ // src/controls.ts
7
+ var isKnob = (key) => key !== LASSO_KNOB_KEY;
8
+ var same = (a, b) => a.length === b.length && a.every((x, i) => x.key === b[i].key && x.label === b[i].label && x.text === b[i].text && JSON.stringify(x.value) === JSON.stringify(b[i].value));
9
+ function createControls(initial) {
10
+ const ui = initial ? { knobs: { ...initial } } : {};
11
+ let info = [];
12
+ let version = 0;
13
+ const subs = /* @__PURE__ */ new Set();
14
+ const appliers = /* @__PURE__ */ new Set();
15
+ const notify = () => {
16
+ version++;
17
+ for (const cb of Array.from(subs)) cb(c);
18
+ };
19
+ const c = {
20
+ get values() {
21
+ const out = {};
22
+ for (const i of info) out[i.key] = i.value;
23
+ if (!info.length && ui.knobs && typeof ui.knobs === "object") {
24
+ for (const [k, v] of Object.entries(ui.knobs)) if (isKnob(k)) out[k] = v;
25
+ }
26
+ return out;
27
+ },
28
+ get info() {
29
+ return info;
30
+ },
31
+ get summary() {
32
+ return info.map((i) => [i.label, i.text].filter(Boolean).join(" ")).filter(Boolean).join(" \xB7 ");
33
+ },
34
+ get ready() {
35
+ return info.length > 0;
36
+ },
37
+ get version() {
38
+ return version;
39
+ },
40
+ set(values) {
41
+ const knobs = { ...ui.knobs ?? {}, ...values };
42
+ ui.knobs = knobs;
43
+ for (const a of Array.from(appliers)) a();
44
+ },
45
+ reset() {
46
+ const kept = ui.knobs?.[LASSO_KNOB_KEY];
47
+ delete ui.knobs;
48
+ if (kept !== void 0) ui.knobs = { [LASSO_KNOB_KEY]: kept };
49
+ for (const a of Array.from(appliers)) a();
50
+ },
51
+ onChange(cb) {
52
+ subs.add(cb);
53
+ return () => {
54
+ subs.delete(cb);
55
+ };
56
+ },
57
+ _ui: ui,
58
+ _attach(onApply) {
59
+ appliers.add(onApply);
60
+ return () => {
61
+ appliers.delete(onApply);
62
+ };
63
+ },
64
+ _report(next) {
65
+ if (same(info, next)) return;
66
+ info = next;
67
+ notify();
68
+ }
69
+ };
70
+ return c;
71
+ }
72
+ function readControls(container) {
73
+ const bag = container.__lchKnobs;
74
+ if (!bag || typeof bag !== "object") return [];
75
+ const keys = Object.keys(bag).filter(isKnob);
76
+ if (!keys.length) return [];
77
+ const groups = Array.from(container.querySelectorAll("g.llm-slider"));
78
+ return keys.map((key, i) => {
79
+ const g = groups.find((x) => x.getAttribute("data-knob") === key) ?? groups[i] ?? null;
80
+ const txt = (sel) => (g?.querySelector(sel)?.textContent ?? "").trim();
81
+ return { key, value: bag[key], label: txt(".llm-slider-label"), text: txt(".llm-slider-readout") };
82
+ });
83
+ }
84
+ function attachControls(getHost, container, controls) {
85
+ const c = controls;
86
+ const read = () => c._report(readControls(container));
87
+ const setUiState = (s) => {
88
+ if (!s || typeof s !== "object") return;
89
+ for (const k of Object.keys(c._ui)) delete c._ui[k];
90
+ Object.assign(c._ui, s);
91
+ Promise.resolve().then(read);
92
+ };
93
+ const off = c._attach(() => {
94
+ const host = getHost();
95
+ if (!host) return;
96
+ host.setOptions({ uiState: c._ui });
97
+ host.rendered.then(read, () => {
98
+ });
99
+ });
100
+ return {
101
+ options: { uiState: c._ui, setUiState },
102
+ read,
103
+ detach: off
104
+ };
105
+ }
106
+
107
+ // src/markNotes.ts
108
+ var keyText = (k) => JSON.stringify(k.map((v) => v == null ? "" : String(v).trim()));
109
+ function defaultKey(n, width) {
110
+ return width > 1 ? [n.markKey, n.markKeyTo] : [n.markKey];
111
+ }
112
+ function noteBadges(notes, opts) {
113
+ const cols = typeof opts.columns === "string" ? [opts.columns] : opts.columns.slice();
114
+ const keyOf = opts.keyOf ?? ((n) => defaultKey(n, cols.length));
115
+ const textOf = opts.textOf ?? ((n) => String(n.body ?? ""));
116
+ const byKey = /* @__PURE__ */ new Map();
117
+ for (const n of notes ?? []) {
118
+ if (opts.chart !== void 0 && n.chart !== opts.chart) continue;
119
+ const key = keyOf(n).slice(0, cols.length);
120
+ if (key.length < cols.length || key.some((v) => v == null || v === "")) continue;
121
+ const id = keyText(key);
122
+ const hit = byKey.get(id);
123
+ if (hit) hit.list.push(n);
124
+ else byKey.set(id, { key, list: [n] });
125
+ }
126
+ return [...byKey.entries()].map(([id, { key, list }]) => {
127
+ const title = list.length > 1 ? `${textOf(list[0])} (+${list.length - 1} more)` : textOf(list[0]);
128
+ const base = { id, label: String(list.length), title };
129
+ if (cols.length === 1) return { ...base, column: cols[0], value: key[0] };
130
+ const where = {};
131
+ cols.forEach((c, i) => {
132
+ where[c] = key[i];
133
+ });
134
+ return { ...base, where };
135
+ });
136
+ }
137
+ function badgeKey(a) {
138
+ try {
139
+ const v = JSON.parse(String(a.id ?? ""));
140
+ if (Array.isArray(v)) return v;
141
+ } catch {
142
+ }
143
+ if (a.where) return Object.values(a.where);
144
+ return a.value !== void 0 ? [a.value] : [];
145
+ }
146
+ function notesFor(notes, key, opts) {
147
+ const cols = typeof opts.columns === "string" ? [opts.columns] : opts.columns.slice();
148
+ const want = !key ? null : Array.isArray(key) ? key : key.keys[0] ?? null;
149
+ if (!want) return [];
150
+ const keyOf = opts.keyOf ?? ((n) => defaultKey(n, cols.length));
151
+ const target = keyText(want.slice(0, cols.length));
152
+ return (notes ?? []).filter((n) => (opts.chart === void 0 || n.chart === opts.chart) && keyText(keyOf(n).slice(0, cols.length)) === target);
153
+ }
154
+
155
+ export {
156
+ createControls,
157
+ readControls,
158
+ attachControls,
159
+ noteBadges,
160
+ badgeKey,
161
+ notesFor
162
+ };
@@ -1,12 +1,12 @@
1
1
  /*! @bicharts/chart-host — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; Natural Earth and US Census/TIGER (public domain). Full text: NOTICE in this package. */
2
2
  import {
3
- Bt,
4
- Gt,
5
- Ii,
6
- Ti,
3
+ Kt,
4
+ Li,
5
+ Oi,
6
+ Vt,
7
7
  j,
8
8
  u
9
- } from "./chunk-NJWR3DFK.mjs";
9
+ } from "./chunk-FIG5DIW7.mjs";
10
10
 
11
11
  // src/sourceDateFormat.ts
12
12
  function formatSourceDate(raw, opts = {}) {
@@ -435,15 +435,15 @@ function displayText(col, raw, opts) {
435
435
  return String(raw);
436
436
  }
437
437
  function isSuppressed(col) {
438
- return Bt(col).suppressed;
438
+ return Vt(col).suppressed;
439
439
  }
440
440
  function resolveAgg(col, requested, auto) {
441
441
  const fallback = () => {
442
- const d = Ti(col);
442
+ const d = Oi(col);
443
443
  return d === "first" ? "count" : d;
444
444
  };
445
445
  if (auto) return fallback();
446
- return Gt(col).indexOf(requested) >= 0 ? requested : fallback();
446
+ return Kt(col).indexOf(requested) >= 0 ? requested : fallback();
447
447
  }
448
448
  function toNumber(v) {
449
449
  if (v == null || v === "") return null;
@@ -546,7 +546,7 @@ function computeSelectionCard(payload, selectedRowIdxs, opts = {}) {
546
546
  }
547
547
  const value = reduce(selVals, colAgg, selRaw);
548
548
  let sharePct = null;
549
- if (Ii(col, colAgg) && value != null) {
549
+ if (Li(col, colAgg) && value != null) {
550
550
  const allVals = [];
551
551
  const allRaw = [];
552
552
  for (let r = 0; r < rows.length; r++) {