@kong-ui-public/analytics-chart 10.21.12 → 10.22.0

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.
@@ -12259,6 +12259,7 @@ const tS = ["in", "not_in", "selector"], eS = ["empty", "not_empty"], nS = [
12259
12259
  "bot_info_action",
12260
12260
  "bot_info_detection_reason",
12261
12261
  "bot_info_ban_type",
12262
+ "cache_status",
12262
12263
  "consumer",
12263
12264
  "consumer_group",
12264
12265
  "country_code",
@@ -12271,6 +12272,7 @@ const tS = ["in", "not_in", "selector"], eS = ["empty", "not_empty"], nS = [
12271
12272
  "principal"
12272
12273
  ], np = Di(ep), sS = [
12273
12274
  ...iS,
12275
+ "cache_hit_rate",
12274
12276
  "response_latency_p99",
12275
12277
  "response_latency_p95",
12276
12278
  "response_latency_p50",
@@ -12331,6 +12333,7 @@ const tS = ["in", "not_in", "selector"], eS = ["empty", "not_empty"], nS = [
12331
12333
  "bot_info_ja4_fingerprint",
12332
12334
  "bot_info_ban_type",
12333
12335
  "bot_info_header_names",
12336
+ "cache_status",
12334
12337
  "client_ip",
12335
12338
  "consumer",
12336
12339
  "consumer_group",
@@ -20926,7 +20929,217 @@ const vA = /* @__PURE__ */ ue({
20926
20929
  ]), 1032, ["title-tag"]);
20927
20930
  };
20928
20931
  }
20929
- }), NP = /* @__PURE__ */ We(tP, [["__scopeId", "data-v-bd2cedcf"]]);
20932
+ }), NP = /* @__PURE__ */ We(tP, [["__scopeId", "data-v-bd2cedcf"]]), eP = { class: "container" }, nP = {
20933
+ key: 0,
20934
+ class: "no-data",
20935
+ "data-testid": "sparkline-empty"
20936
+ }, iP = ["title"], sP = /* @__PURE__ */ ue({
20937
+ __name: "SparklineChart",
20938
+ props: {
20939
+ chartKey: { default: () => {
20940
+ } },
20941
+ datasets: {},
20942
+ disableTooltip: { type: Boolean, default: !1 },
20943
+ enableBrushing: { type: Boolean, default: !1 },
20944
+ groupKey: { default: () => {
20945
+ } },
20946
+ maxCount: { default: () => {
20947
+ } },
20948
+ maxStamp: { default: () => {
20949
+ } },
20950
+ minCount: { default: () => {
20951
+ } },
20952
+ minStamp: { default: () => {
20953
+ } },
20954
+ pointRenderCount: { default: 24 },
20955
+ showLabel: { type: Boolean, default: !1 },
20956
+ tooltipTitle: { default: () => {
20957
+ } },
20958
+ type: { default: "sparkline_bar" }
20959
+ },
20960
+ setup(e) {
20961
+ const t = crypto.randomUUID(), { i18n: n } = bt.useI18n(), {
20962
+ syncedGroupSizeMs: i,
20963
+ syncedMinStamp: s,
20964
+ syncedMaxStamp: r,
20965
+ syncedMinCount: o,
20966
+ syncedMaxCount: a,
20967
+ syncedRenderPoints: l,
20968
+ syncedChartDatasets: c
20969
+ } = bt.useSparklineSync({
20970
+ chartKey: e.chartKey,
20971
+ datasets: e.datasets,
20972
+ groupKey: e.groupKey,
20973
+ minStamp: e.minStamp,
20974
+ maxStamp: e.maxStamp,
20975
+ minCount: e.minCount,
20976
+ maxCount: e.maxCount,
20977
+ renderPoints: e.pointRenderCount,
20978
+ type: e.type
20979
+ }), u = tr({
20980
+ showTooltip: !1,
20981
+ tooltipContext: 0,
20982
+ // Set in lineChartTooltipBehavior
20983
+ metricDisplay: "",
20984
+ tooltipSeries: [],
20985
+ left: "",
20986
+ top: "",
20987
+ units: "count",
20988
+ translateUnit: () => "",
20989
+ offsetX: 0,
20990
+ offsetY: 0,
20991
+ width: 0,
20992
+ height: 0,
20993
+ chartType: e.type === "sparkline_bar" ? "timeseries_bar" : "timeseries_line",
20994
+ chartID: t,
20995
+ interactionMode: "idle"
20996
+ }), d = ({ width: O, height: _ }) => {
20997
+ u.width = O, u.height = _;
20998
+ }, h = L(() => e.disableTooltip ? [] : [new lg({
20999
+ // if either groupKey or chartKey is undefined then brushing doesn't make any
21000
+ // sense as the data in this chart isn't related to any other data.
21001
+ enableBrushing: e.groupKey !== void 0 && e.chartKey !== void 0 && e.enableBrushing,
21002
+ brushStrategy: "group",
21003
+ brushGroup: e.groupKey
21004
+ })]), f = L(() => c.value.reduce((O, { data: _, label: b }) => ({
21005
+ ...O,
21006
+ [b]: _.reduce((w, { y: M }) => w + M, 0)
21007
+ }), {})), p = L(() => c.value.map(({ label: O }) => [
21008
+ f.value[O],
21009
+ `${O}: ${f.value[O]}`
21010
+ ]).sort(([O], [_]) => _ - O).map(([, O]) => O).join(", ")), m = L(() => Object.keys(f.value).map((O) => f.value[O]).reduce((O, _) => O + _, 0)), y = L(() => m.value > 0), x = L(() => ({
21011
+ labels: new Array(l.value).fill(""),
21012
+ datasets: c.value
21013
+ })), T = L(() => e.datasets.length > 1), C = `SparklineTooltipPosition-${t}`, D = L(() => {
21014
+ const O = e.type === "sparkline_bar", _ = O ? s.value - 1 : s.value, b = O ? r.value : r.value - i.value;
21015
+ return {
21016
+ maintainAspectRatio: !1,
21017
+ elements: {
21018
+ categoryPercentage: 1,
21019
+ barPercentage: 1,
21020
+ line: {
21021
+ tension: 0,
21022
+ stepped: e.type === "sparkline_step",
21023
+ borderWidth: 1
21024
+ },
21025
+ point: {
21026
+ radius: 0,
21027
+ pointHitRadius: 11,
21028
+ pointHoverRadius: 0
21029
+ }
21030
+ },
21031
+ interaction: {
21032
+ intersect: !1,
21033
+ mode: "index"
21034
+ },
21035
+ layout: {
21036
+ padding: {
21037
+ left: O ? 0 : 2,
21038
+ right: O ? 0 : 2,
21039
+ top: 2
21040
+ }
21041
+ },
21042
+ plugins: {
21043
+ legend: {
21044
+ display: !1
21045
+ },
21046
+ tooltip: {
21047
+ enabled: !1,
21048
+ position: C,
21049
+ external: (w) => {
21050
+ yp(u, w, "minutely", {
21051
+ contextFormatter: (M) => {
21052
+ const E = M + i.value;
21053
+ let j = "";
21054
+ return i.value > 1440 * 60 * 1e3 ? j = So(new Date(E), "MMM dd, yyy hh:mm a") : j = So(new Date(E), "hh:mm a"), `${nT(M)} - ${j}`;
21055
+ }
21056
+ });
21057
+ }
21058
+ }
21059
+ },
21060
+ scales: {
21061
+ x: {
21062
+ min: _,
21063
+ max: b,
21064
+ type: "timeseries",
21065
+ offset: !1,
21066
+ grid: {
21067
+ display: !1
21068
+ },
21069
+ display: !1,
21070
+ stacked: T.value
21071
+ },
21072
+ y: {
21073
+ min: Math.max(o.value - 1, 0),
21074
+ max: a.value,
21075
+ grid: {
21076
+ display: !1
21077
+ },
21078
+ display: !1,
21079
+ stacked: T.value
21080
+ }
21081
+ }
21082
+ };
21083
+ }), k = Vt("0"), A = Vt("0");
21084
+ return Qn(() => {
21085
+ He.positioners[C] = function(O, _) {
21086
+ if (!O.length || u.interactionMode === "interactive" || _.x === null)
21087
+ return !1;
21088
+ const b = 10, w = this.chart.canvas.getBoundingClientRect(), M = u.width || this.width, E = u.height || this.height, j = w.top - E > 0, H = j ? w.top - E - b : w.top + w.height + b, V = w.left > M / 2 - _.x, B = Math.max(b, window.innerWidth - b - M), $ = Math.min(B, V ? Math.floor(w.left - M / 2) + _.x : 0 + b);
21089
+ return k.value = `${H}px`, A.value = `${$}px`, {
21090
+ x: $,
21091
+ y: H,
21092
+ xAlign: "center",
21093
+ yAlign: j ? "top" : "bottom"
21094
+ };
21095
+ };
21096
+ }), Zn(() => {
21097
+ He.positioners[C] && delete He.positioners[C];
21098
+ }), (O, _) => (X(), at("div", eP, [
21099
+ y.value ? e.type === "sparkline_bar" ? (X(), It(Z(rg), {
21100
+ key: 1,
21101
+ "chart-id": Z(t),
21102
+ data: x.value,
21103
+ "data-testid": "sparkline-bar",
21104
+ options: D.value,
21105
+ plugins: h.value
21106
+ }, null, 8, ["chart-id", "data", "options", "plugins"])) : e.type === "sparkline_line" || e.type === "sparkline_step" ? (X(), It(Z(ag), {
21107
+ key: 2,
21108
+ "chart-id": Z(t),
21109
+ data: x.value,
21110
+ "data-testid": e.type === "sparkline_line" ? "sparkline-line" : "sparkline-step",
21111
+ options: D.value,
21112
+ plugins: h.value
21113
+ }, null, 8, ["chart-id", "data", "data-testid", "options", "plugins"])) : Nt("", !0) : (X(), at("div", nP, [
21114
+ ts(O.$slots, "empty", {}, () => [
21115
+ Ee(ut(Z(n).t("sparkline_no_data")), 1)
21116
+ ], !0)
21117
+ ])),
21118
+ e.disableTooltip ? Nt("", !0) : (X(), It(Vo, {
21119
+ key: 3,
21120
+ "absolute-left": A.value,
21121
+ "absolute-top": k.value,
21122
+ class: "tooltip",
21123
+ "data-testid": "sparkline-tooltip",
21124
+ state: u,
21125
+ "tooltip-title": e.tooltipTitle,
21126
+ onDimensions: d
21127
+ }, null, 8, ["absolute-left", "absolute-top", "state", "tooltip-title"])),
21128
+ y.value && e.showLabel ? (X(), at("div", {
21129
+ key: 4,
21130
+ class: "label",
21131
+ title: O.$slots.label ? "" : p.value
21132
+ }, [
21133
+ ts(O.$slots, "label", {
21134
+ total: m.value,
21135
+ totalByDataset: f.value
21136
+ }, () => [
21137
+ Ee(ut(p.value), 1)
21138
+ ], !0)
21139
+ ], 8, iP)) : Nt("", !0)
21140
+ ]));
21141
+ }
21142
+ }), FP = /* @__PURE__ */ We(sP, [["__scopeId", "data-v-ae8259b6"]]);
20930
21143
  var Ke = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
20931
21144
  function cg(e) {
20932
21145
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
@@ -20934,7 +21147,7 @@ function cg(e) {
20934
21147
  var Ys = { exports: {} };
20935
21148
  Ys.exports;
20936
21149
  var wh;
20937
- function eP() {
21150
+ function rP() {
20938
21151
  return wh || (wh = 1, (function(e, t) {
20939
21152
  var n = 200, i = "Expected a function", s = "__lodash_hash_undefined__", r = 1, o = 2, a = 9007199254740991, l = "[object Arguments]", c = "[object Array]", u = "[object Boolean]", d = "[object Date]", h = "[object Error]", f = "[object Function]", p = "[object GeneratorFunction]", m = "[object Map]", y = "[object Number]", x = "[object Object]", T = "[object Promise]", C = "[object RegExp]", D = "[object Set]", k = "[object String]", A = "[object Symbol]", O = "[object WeakMap]", _ = "[object ArrayBuffer]", b = "[object DataView]", w = "[object Float32Array]", M = "[object Float64Array]", E = "[object Int8Array]", j = "[object Int16Array]", H = "[object Int32Array]", V = "[object Uint8Array]", B = "[object Uint8ClampedArray]", $ = "[object Uint16Array]", R = "[object Uint32Array]", z = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, U = /^\w*$/, P = /^\./, N = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, W = /[\\^$.*+?()[\]{}|]/g, tt = /\\(\\)?/g, Q = /^\[object .+?Constructor\]$/, q = /^(?:0|[1-9]\d*)$/, G = {};
20940
21153
  G[w] = G[M] = G[E] = G[j] = G[H] = G[V] = G[B] = G[$] = G[R] = !0, G[l] = G[c] = G[_] = G[u] = G[b] = G[d] = G[h] = G[f] = G[m] = G[y] = G[x] = G[C] = G[D] = G[k] = G[O] = !1;
@@ -21522,10 +21735,10 @@ function eP() {
21522
21735
  e.exports = ws;
21523
21736
  })(Ys, Ys.exports)), Ys.exports;
21524
21737
  }
21525
- var nP = eP();
21526
- const iP = /* @__PURE__ */ cg(nP);
21738
+ var oP = rP();
21739
+ const aP = /* @__PURE__ */ cg(oP);
21527
21740
  var pl, Sh;
21528
- function sP() {
21741
+ function lP() {
21529
21742
  if (Sh) return pl;
21530
21743
  Sh = 1;
21531
21744
  var e = 9007199254740991, t = "[object Arguments]", n = "[object Function]", i = "[object GeneratorFunction]", s = "[object Symbol]", r = typeof Ke == "object" && Ke && Ke.Object === Object && Ke, o = typeof self == "object" && self && self.Object === Object && self, a = r || o || Function("return this")();
@@ -21624,14 +21837,14 @@ function sP() {
21624
21837
  });
21625
21838
  return pl = $, pl;
21626
21839
  }
21627
- var rP = sP();
21628
- const oP = /* @__PURE__ */ cg(rP);
21629
- var co = { exports: {} }, aP = co.exports, Th;
21630
- function lP() {
21840
+ var cP = lP();
21841
+ const uP = /* @__PURE__ */ cg(cP);
21842
+ var co = { exports: {} }, dP = co.exports, Th;
21843
+ function hP() {
21631
21844
  return Th || (Th = 1, (function(e, t) {
21632
21845
  (function(n, i) {
21633
21846
  i();
21634
- })(aP, function() {
21847
+ })(dP, function() {
21635
21848
  function n(c, u) {
21636
21849
  return typeof u > "u" ? u = { autoBom: !1 } : typeof u != "object" && (console.warn("Deprecated: Expected third argument to be a object"), u = { autoBom: !u }), u.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type) ? new Blob(["\uFEFF", c], { type: c.type }) : c;
21637
21850
  }
@@ -21697,13 +21910,13 @@ function lP() {
21697
21910
  });
21698
21911
  })(co)), co.exports;
21699
21912
  }
21700
- var cP = lP(), uo = { exports: {} };
21701
- var uP = uo.exports, Mh;
21702
- function dP() {
21913
+ var fP = hP(), uo = { exports: {} };
21914
+ var pP = uo.exports, Mh;
21915
+ function gP() {
21703
21916
  return Mh || (Mh = 1, (function(e, t) {
21704
21917
  ((n, i) => {
21705
21918
  e.exports = i();
21706
- })(uP, function n() {
21919
+ })(pP, function n() {
21707
21920
  var i = typeof self < "u" ? self : typeof window < "u" ? window : i !== void 0 ? i : {}, s, r = !i.document && !!i.postMessage, o = i.IS_PAPA_WORKER || !1, a = {}, l = 0, c = {};
21708
21921
  function u(_) {
21709
21922
  this._handle = null, this._finished = !1, this._completed = !1, this._halted = !1, this._input = null, this._baseIndex = 0, this._partialLine = "", this._rowCount = 0, this._start = 0, this._nextChunk = null, this.isFirstChunk = !0, this._completeResults = { data: [], errors: [], meta: {} }, (function(b) {
@@ -22109,8 +22322,8 @@ function dP() {
22109
22322
  });
22110
22323
  })(uo)), uo.exports;
22111
22324
  }
22112
- var hP = dP();
22113
- const fP = ["id"], pP = /* @__PURE__ */ ue({
22325
+ var mP = gP();
22326
+ const yP = ["id"], bP = /* @__PURE__ */ ue({
22114
22327
  __name: "VueJsonCsv",
22115
22328
  props: {
22116
22329
  data: {
@@ -22175,12 +22388,12 @@ const fP = ["id"], pP = /* @__PURE__ */ ue({
22175
22388
  const u = i.labels;
22176
22389
  if (typeof i.fields !== Gi.Object)
22177
22390
  throw new Error("Labels needs to be a object containing key / value pairs.");
22178
- return typeof u === Gi.Object ? (d) => iP(d, (h, f) => u[f] || f) : (d) => d;
22391
+ return typeof u === Gi.Object ? (d) => aP(d, (h, f) => u[f] || f) : (d) => d;
22179
22392
  }, a = () => {
22180
22393
  const u = i.fields;
22181
22394
  if (typeof i.fields !== Gi.Object && !Array.isArray(u))
22182
22395
  throw new Error("Fields needs to be an array of strings.");
22183
- return Array.isArray(u) ? (d) => oP(d, u) : (d) => d;
22396
+ return Array.isArray(u) ? (d) => uP(d, u) : (d) => d;
22184
22397
  }, l = () => {
22185
22398
  if (typeof i.fields === Gi.Undefined && typeof i.labels === Gi.Undefined)
22186
22399
  return i.data;
@@ -22192,7 +22405,7 @@ const fP = ["id"], pP = /* @__PURE__ */ ue({
22192
22405
  return;
22193
22406
  }
22194
22407
  n("export-started", r.value);
22195
- let u = hP.unparse(r.value, Object.assign({
22408
+ let u = mP.unparse(r.value, Object.assign({
22196
22409
  delimiter: i.delimiter,
22197
22410
  encoding: i.encoding
22198
22411
  }));
@@ -22201,7 +22414,7 @@ const fP = ["id"], pP = /* @__PURE__ */ ue({
22201
22414
  const d = new Blob([u], {
22202
22415
  type: "text/csv;charset=" + i.encoding
22203
22416
  });
22204
- cP.saveAs(d, i.filename);
22417
+ fP.saveAs(d, i.filename);
22205
22418
  }
22206
22419
  };
22207
22420
  return (u, d) => (X(), at("div", {
@@ -22212,9 +22425,9 @@ const fP = ["id"], pP = /* @__PURE__ */ ue({
22212
22425
  ts(u.$slots, "default", {}, () => [
22213
22426
  Ee("Download " + ut(e.filename), 1)
22214
22427
  ])
22215
- ], 8, fP));
22428
+ ], 8, yP));
22216
22429
  }
22217
- }), gP = /* @__PURE__ */ ue({
22430
+ }), _P = /* @__PURE__ */ ue({
22218
22431
  __name: "DownloadCsv",
22219
22432
  props: {
22220
22433
  rows: {},
@@ -22224,7 +22437,7 @@ const fP = ["id"], pP = /* @__PURE__ */ ue({
22224
22437
  setup(e) {
22225
22438
  const t = e, n = L(() => Object.keys(t.headers));
22226
22439
  return (i, s) => (X(), at("div", null, [
22227
- Xt(pP, {
22440
+ Xt(bP, {
22228
22441
  data: e.rows,
22229
22442
  fields: n.value,
22230
22443
  filename: e.filename,
@@ -22237,14 +22450,14 @@ const fP = ["id"], pP = /* @__PURE__ */ ue({
22237
22450
  }, 8, ["data", "fields", "filename", "labels"])
22238
22451
  ]));
22239
22452
  }
22240
- }), mP = { class: "kong-ui-public-csv-export-modal" }, yP = {
22453
+ }), vP = { class: "kong-ui-public-csv-export-modal" }, xP = {
22241
22454
  key: 0,
22242
22455
  class: "selected-range"
22243
- }, bP = {
22456
+ }, wP = {
22244
22457
  key: 4,
22245
22458
  class: "text-muted",
22246
22459
  tag: "span"
22247
- }, Dh = 3, FP = /* @__PURE__ */ ue({
22460
+ }, Dh = 3, zP = /* @__PURE__ */ ue({
22248
22461
  __name: "CsvExportModal",
22249
22462
  props: {
22250
22463
  exportState: {},
@@ -22317,7 +22530,7 @@ const fP = ["id"], pP = /* @__PURE__ */ ue({
22317
22530
  o.value++;
22318
22531
  }), (p, m) => {
22319
22532
  const y = Re("KSkeleton"), x = Re("KEmptyState"), T = Re("KTableData"), C = Re("KTooltip"), D = Re("KButton"), k = Re("KModal");
22320
- return X(), at("div", mP, [
22533
+ return X(), at("div", vP, [
22321
22534
  Xt(k, {
22322
22535
  class: "vitals-report",
22323
22536
  "data-testid": "csv-export-modal",
@@ -22329,7 +22542,7 @@ const fP = ["id"], pP = /* @__PURE__ */ ue({
22329
22542
  }, {
22330
22543
  default: Ut(() => [
22331
22544
  lt("div", null, [
22332
- e.exportState.status === "success" && l.value ? (X(), at("div", yP, [
22545
+ e.exportState.status === "success" && l.value ? (X(), at("div", xP, [
22333
22546
  lt("p", null, ut(e.modalDescription ? e.modalDescription : Z(n).t("csvExport.exportDescription")), 1),
22334
22547
  lt("p", null, ut(Z(n).t("csvExport.exportTimeRange")) + ": " + ut(c.value), 1)
22335
22548
  ])) : Nt("", !0),
@@ -22368,7 +22581,7 @@ const fP = ["id"], pP = /* @__PURE__ */ ue({
22368
22581
  ]),
22369
22582
  _: 1
22370
22583
  })) : Nt("", !0),
22371
- e.exportState.status === "success" && l.value ? (X(), at("div", bP, [
22584
+ e.exportState.status === "success" && l.value ? (X(), at("div", wP, [
22372
22585
  Ee(ut(u.value) + " ", 1),
22373
22586
  Xt(C, {
22374
22587
  class: "preview-tooltip",
@@ -22397,7 +22610,7 @@ const fP = ["id"], pP = /* @__PURE__ */ ue({
22397
22610
  ]),
22398
22611
  _: 1
22399
22612
  }),
22400
- Xt(gP, {
22613
+ Xt(_P, {
22401
22614
  class: "vitals-report-export-button",
22402
22615
  filename: r,
22403
22616
  headers: h.value.csvHeaders,
@@ -22423,227 +22636,17 @@ const fP = ["id"], pP = /* @__PURE__ */ ue({
22423
22636
  ]);
22424
22637
  };
22425
22638
  }
22426
- }), _P = { class: "container" }, vP = {
22427
- key: 0,
22428
- class: "no-data",
22429
- "data-testid": "sparkline-empty"
22430
- }, xP = ["title"], wP = /* @__PURE__ */ ue({
22431
- __name: "SparklineChart",
22432
- props: {
22433
- chartKey: { default: () => {
22434
- } },
22435
- datasets: {},
22436
- disableTooltip: { type: Boolean, default: !1 },
22437
- enableBrushing: { type: Boolean, default: !1 },
22438
- groupKey: { default: () => {
22439
- } },
22440
- maxCount: { default: () => {
22441
- } },
22442
- maxStamp: { default: () => {
22443
- } },
22444
- minCount: { default: () => {
22445
- } },
22446
- minStamp: { default: () => {
22447
- } },
22448
- pointRenderCount: { default: 24 },
22449
- showLabel: { type: Boolean, default: !1 },
22450
- tooltipTitle: { default: () => {
22451
- } },
22452
- type: { default: "sparkline_bar" }
22453
- },
22454
- setup(e) {
22455
- const t = crypto.randomUUID(), { i18n: n } = bt.useI18n(), {
22456
- syncedGroupSizeMs: i,
22457
- syncedMinStamp: s,
22458
- syncedMaxStamp: r,
22459
- syncedMinCount: o,
22460
- syncedMaxCount: a,
22461
- syncedRenderPoints: l,
22462
- syncedChartDatasets: c
22463
- } = bt.useSparklineSync({
22464
- chartKey: e.chartKey,
22465
- datasets: e.datasets,
22466
- groupKey: e.groupKey,
22467
- minStamp: e.minStamp,
22468
- maxStamp: e.maxStamp,
22469
- minCount: e.minCount,
22470
- maxCount: e.maxCount,
22471
- renderPoints: e.pointRenderCount,
22472
- type: e.type
22473
- }), u = tr({
22474
- showTooltip: !1,
22475
- tooltipContext: 0,
22476
- // Set in lineChartTooltipBehavior
22477
- metricDisplay: "",
22478
- tooltipSeries: [],
22479
- left: "",
22480
- top: "",
22481
- units: "count",
22482
- translateUnit: () => "",
22483
- offsetX: 0,
22484
- offsetY: 0,
22485
- width: 0,
22486
- height: 0,
22487
- chartType: e.type === "sparkline_bar" ? "timeseries_bar" : "timeseries_line",
22488
- chartID: t,
22489
- interactionMode: "idle"
22490
- }), d = ({ width: O, height: _ }) => {
22491
- u.width = O, u.height = _;
22492
- }, h = L(() => e.disableTooltip ? [] : [new lg({
22493
- // if either groupKey or chartKey is undefined then brushing doesn't make any
22494
- // sense as the data in this chart isn't related to any other data.
22495
- enableBrushing: e.groupKey !== void 0 && e.chartKey !== void 0 && e.enableBrushing,
22496
- brushStrategy: "group",
22497
- brushGroup: e.groupKey
22498
- })]), f = L(() => c.value.reduce((O, { data: _, label: b }) => ({
22499
- ...O,
22500
- [b]: _.reduce((w, { y: M }) => w + M, 0)
22501
- }), {})), p = L(() => c.value.map(({ label: O }) => [
22502
- f.value[O],
22503
- `${O}: ${f.value[O]}`
22504
- ]).sort(([O], [_]) => _ - O).map(([, O]) => O).join(", ")), m = L(() => Object.keys(f.value).map((O) => f.value[O]).reduce((O, _) => O + _, 0)), y = L(() => m.value > 0), x = L(() => ({
22505
- labels: new Array(l.value).fill(""),
22506
- datasets: c.value
22507
- })), T = L(() => e.datasets.length > 1), C = `SparklineTooltipPosition-${t}`, D = L(() => {
22508
- const O = e.type === "sparkline_bar", _ = O ? s.value - 1 : s.value, b = O ? r.value : r.value - i.value;
22509
- return {
22510
- maintainAspectRatio: !1,
22511
- elements: {
22512
- categoryPercentage: 1,
22513
- barPercentage: 1,
22514
- line: {
22515
- tension: 0,
22516
- stepped: e.type === "sparkline_step",
22517
- borderWidth: 1
22518
- },
22519
- point: {
22520
- radius: 0,
22521
- pointHitRadius: 11,
22522
- pointHoverRadius: 0
22523
- }
22524
- },
22525
- interaction: {
22526
- intersect: !1,
22527
- mode: "index"
22528
- },
22529
- layout: {
22530
- padding: {
22531
- left: O ? 0 : 2,
22532
- right: O ? 0 : 2,
22533
- top: 2
22534
- }
22535
- },
22536
- plugins: {
22537
- legend: {
22538
- display: !1
22539
- },
22540
- tooltip: {
22541
- enabled: !1,
22542
- position: C,
22543
- external: (w) => {
22544
- yp(u, w, "minutely", {
22545
- contextFormatter: (M) => {
22546
- const E = M + i.value;
22547
- let j = "";
22548
- return i.value > 1440 * 60 * 1e3 ? j = So(new Date(E), "MMM dd, yyy hh:mm a") : j = So(new Date(E), "hh:mm a"), `${nT(M)} - ${j}`;
22549
- }
22550
- });
22551
- }
22552
- }
22553
- },
22554
- scales: {
22555
- x: {
22556
- min: _,
22557
- max: b,
22558
- type: "timeseries",
22559
- offset: !1,
22560
- grid: {
22561
- display: !1
22562
- },
22563
- display: !1,
22564
- stacked: T.value
22565
- },
22566
- y: {
22567
- min: Math.max(o.value - 1, 0),
22568
- max: a.value,
22569
- grid: {
22570
- display: !1
22571
- },
22572
- display: !1,
22573
- stacked: T.value
22574
- }
22575
- }
22576
- };
22577
- }), k = Vt("0"), A = Vt("0");
22578
- return Qn(() => {
22579
- He.positioners[C] = function(O, _) {
22580
- if (!O.length || u.interactionMode === "interactive" || _.x === null)
22581
- return !1;
22582
- const b = 10, w = this.chart.canvas.getBoundingClientRect(), M = u.width || this.width, E = u.height || this.height, j = w.top - E > 0, H = j ? w.top - E - b : w.top + w.height + b, V = w.left > M / 2 - _.x, B = Math.max(b, window.innerWidth - b - M), $ = Math.min(B, V ? Math.floor(w.left - M / 2) + _.x : 0 + b);
22583
- return k.value = `${H}px`, A.value = `${$}px`, {
22584
- x: $,
22585
- y: H,
22586
- xAlign: "center",
22587
- yAlign: j ? "top" : "bottom"
22588
- };
22589
- };
22590
- }), Zn(() => {
22591
- He.positioners[C] && delete He.positioners[C];
22592
- }), (O, _) => (X(), at("div", _P, [
22593
- y.value ? e.type === "sparkline_bar" ? (X(), It(Z(rg), {
22594
- key: 1,
22595
- "chart-id": Z(t),
22596
- data: x.value,
22597
- "data-testid": "sparkline-bar",
22598
- options: D.value,
22599
- plugins: h.value
22600
- }, null, 8, ["chart-id", "data", "options", "plugins"])) : e.type === "sparkline_line" || e.type === "sparkline_step" ? (X(), It(Z(ag), {
22601
- key: 2,
22602
- "chart-id": Z(t),
22603
- data: x.value,
22604
- "data-testid": e.type === "sparkline_line" ? "sparkline-line" : "sparkline-step",
22605
- options: D.value,
22606
- plugins: h.value
22607
- }, null, 8, ["chart-id", "data", "data-testid", "options", "plugins"])) : Nt("", !0) : (X(), at("div", vP, [
22608
- ts(O.$slots, "empty", {}, () => [
22609
- Ee(ut(Z(n).t("sparkline_no_data")), 1)
22610
- ], !0)
22611
- ])),
22612
- e.disableTooltip ? Nt("", !0) : (X(), It(Vo, {
22613
- key: 3,
22614
- "absolute-left": A.value,
22615
- "absolute-top": k.value,
22616
- class: "tooltip",
22617
- "data-testid": "sparkline-tooltip",
22618
- state: u,
22619
- "tooltip-title": e.tooltipTitle,
22620
- onDimensions: d
22621
- }, null, 8, ["absolute-left", "absolute-top", "state", "tooltip-title"])),
22622
- y.value && e.showLabel ? (X(), at("div", {
22623
- key: 4,
22624
- class: "label",
22625
- title: O.$slots.label ? "" : p.value
22626
- }, [
22627
- ts(O.$slots, "label", {
22628
- total: m.value,
22629
- totalByDataset: f.value
22630
- }, () => [
22631
- Ee(ut(p.value), 1)
22632
- ], !0)
22633
- ], 8, xP)) : Nt("", !0)
22634
- ]));
22635
- }
22636
- }), zP = /* @__PURE__ */ We(wP, [["__scopeId", "data-v-ae8259b6"]]);
22639
+ });
22637
22640
  export {
22638
22641
  IP as AnalyticsChart,
22639
22642
  Be as ChartLegendPosition,
22640
- FP as CsvExportModal,
22643
+ zP as CsvExportModal,
22641
22644
  OP as DECIMAL_DISPLAY,
22642
22645
  ST as FONT_SIZE_REGULAR,
22643
22646
  wT as FONT_SIZE_SMALL,
22644
22647
  Il as MAX_LABEL_LENGTH,
22645
22648
  LP as SimpleChart,
22646
- zP as SparklineChart,
22649
+ FP as SparklineChart,
22647
22650
  NP as TopNTable,
22648
22651
  Gi as ValidType,
22649
22652
  RP as chartTypes,