@kong-ui-public/analytics-metric-provider 5.0.10 → 5.1.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.
- package/dist/style.css +1 -1
- package/dist/types/components/MetricsConsumer.vue.d.ts.map +1 -1
- package/dist/types/components/MetricsProviderInternal.vue.d.ts +5 -0
- package/dist/types/components/MetricsProviderInternal.vue.d.ts.map +1 -1
- package/dist/types/components/metricsProviderUtil.d.ts +1 -0
- package/dist/types/components/metricsProviderUtil.d.ts.map +1 -1
- package/dist/vitals-metric-provider.es.js +374 -351
- package/dist/vitals-metric-provider.umd.js +1 -1
- package/package.json +6 -6
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ref as pe, watchEffect as Fe, computed as g, getCurrentInstance as He, reactive as Be, onMounted as $e, onUnmounted as Pe, watch as Ke, isReadonly as Ze, toRefs as Ue, defineComponent as k, inject as
|
|
1
|
+
import { ref as pe, watchEffect as Fe, computed as g, getCurrentInstance as He, reactive as Be, onMounted as $e, onUnmounted as Pe, watch as Ke, isReadonly as Ze, toRefs as Ue, defineComponent as k, inject as xe, toRef as Ge, provide as je, renderSlot as ke, resolveComponent as qe, openBlock as p, createElementBlock as y, createElementVNode as I, normalizeClass as G, unref as w, createCommentVNode as N, createBlock as T, resolveDynamicComponent as z, withCtx as V, createTextVNode as Ye, toDisplayString as R, createVNode as Y, normalizeStyle as A, Fragment as Se, renderList as Xe, mergeProps as Qe, pushScopeId as L, popScopeId as M, normalizeProps as We, guardReactiveProps as Je } from "vue";
|
|
2
2
|
import { TimePeriods as re, TimeframeKeys as te, queryableExploreDimensions as er, DeltaQueryTime as rr, UnaryQueryTime as tr } from "@kong-ui-public/analytics-utilities";
|
|
3
3
|
import { createI18n as ir, i18nTComponent as nr } from "@kong-ui-public/i18n";
|
|
4
4
|
import { useAnalyticsConfigStore as ar, SEVEN_DAYS_MS as or } from "@kong-ui-public/analytics-config-store";
|
|
5
|
-
const
|
|
5
|
+
const lr = {
|
|
6
6
|
notAvailable: "N/A"
|
|
7
|
-
},
|
|
7
|
+
}, sr = {
|
|
8
8
|
short: {
|
|
9
9
|
traffic: "Requests",
|
|
10
10
|
errorRate: "Error Rate",
|
|
@@ -15,7 +15,7 @@ const sr = {
|
|
|
15
15
|
errorRate: "Average Error Rate",
|
|
16
16
|
latency: "P99 Latency"
|
|
17
17
|
}
|
|
18
|
-
},
|
|
18
|
+
}, ur = {
|
|
19
19
|
custom: "vs previous {numDays, plural, =1 {day} other {# days}}",
|
|
20
20
|
"15m": "vs previous 15 minutes",
|
|
21
21
|
"1h": "vs previous hour",
|
|
@@ -31,9 +31,9 @@ const sr = {
|
|
|
31
31
|
previous_month: "vs previous time period",
|
|
32
32
|
previous_quarter: "vs previous quarter"
|
|
33
33
|
}, dr = {
|
|
34
|
-
general:
|
|
35
|
-
metricCard:
|
|
36
|
-
trendRange:
|
|
34
|
+
general: lr,
|
|
35
|
+
metricCard: sr,
|
|
36
|
+
trendRange: ur
|
|
37
37
|
};
|
|
38
38
|
function cr() {
|
|
39
39
|
const e = ir("en-us", dr);
|
|
@@ -87,31 +87,31 @@ function gr(e = pe({}), r, t, a = vr) {
|
|
|
87
87
|
swrvState: ze
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
|
-
const B = Symbol("default"),
|
|
90
|
+
const B = Symbol("default"), se = "status_code_grouped", _e = (e, r, t, a, n) => {
|
|
91
91
|
e[r][t] || (e[r][t] = {}), e[r][t][a] = n;
|
|
92
92
|
};
|
|
93
|
-
function
|
|
94
|
-
var
|
|
95
|
-
const t = ((
|
|
93
|
+
function yr(e, r) {
|
|
94
|
+
var f;
|
|
95
|
+
const t = ((f = e.meta.metric_names) == null ? void 0 : f[0]) || "", a = e.meta.start_ms, n = Object.keys(e.meta.display || {}), i = !!n.find((c) => c === se), s = n.find((c) => c !== se);
|
|
96
96
|
return n.length > 2 || n.length > 1 && !i ? (console.error("Don't know how to work with provided dimensions:", n), {
|
|
97
97
|
previous: { [B]: { [B]: 0 } },
|
|
98
98
|
current: { [B]: { [B]: 0 } }
|
|
99
|
-
}) : e.data.reduce((
|
|
100
|
-
const
|
|
101
|
-
return new Date(o.timestamp).getTime() === a && r ? _e(
|
|
99
|
+
}) : e.data.reduce((c, o) => {
|
|
100
|
+
const l = o.event[t], u = s ? o.event[s] : B, d = i ? o.event[se] : B;
|
|
101
|
+
return new Date(o.timestamp).getTime() === a && r ? _e(c, "previous", u, d, l) : _e(c, "current", u, d, l), c;
|
|
102
102
|
}, {
|
|
103
103
|
previous: {},
|
|
104
104
|
current: {}
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function mr(e) {
|
|
108
108
|
e.queryReady === void 0 && (e.queryReady = g(() => !0));
|
|
109
109
|
const { i18n: r } = K.useI18n(), t = g(() => {
|
|
110
|
-
var
|
|
110
|
+
var u, d;
|
|
111
111
|
return {
|
|
112
112
|
metrics: e.metrics,
|
|
113
113
|
dimensions: [
|
|
114
|
-
...(
|
|
114
|
+
...(u = e.dimensions) != null && u.length ? [...e.dimensions] : [],
|
|
115
115
|
...e.withTrend.value ? ["time"] : []
|
|
116
116
|
],
|
|
117
117
|
granularity: e.withTrend.value ? "trend" : void 0,
|
|
@@ -119,12 +119,12 @@ function yr(e) {
|
|
|
119
119
|
time_range: e.timeframe.value.v4Query(e.tz.value)
|
|
120
120
|
};
|
|
121
121
|
}), a = g(() => {
|
|
122
|
-
var d, v, b,
|
|
122
|
+
var d, v, b, m;
|
|
123
123
|
if (!((d = e.queryReady) != null && d.value) || e.featureFlags && !e.featureFlags.every((h) => h))
|
|
124
124
|
return null;
|
|
125
|
-
const
|
|
126
|
-
return `metric-fetcher-${e.timeframe.value.cacheKey()}-${(b = e.dimensions) == null ? void 0 : b.join("-")}-${(
|
|
127
|
-
}), { response: n, error: i, isValidating:
|
|
125
|
+
const u = (v = e.filter) != null && v.value ? JSON.stringify(e.filter.value) : "";
|
|
126
|
+
return `metric-fetcher-${e.timeframe.value.cacheKey()}-${(b = e.dimensions) == null ? void 0 : b.join("-")}-${(m = e.metrics) == null ? void 0 : m.join("-")}-${u}`;
|
|
127
|
+
}), { response: n, error: i, isValidating: s } = K.useRequest(
|
|
128
128
|
() => a.value,
|
|
129
129
|
() => e.queryFn(t.value, e.abortController ?? new AbortController()),
|
|
130
130
|
{
|
|
@@ -132,31 +132,31 @@ function yr(e) {
|
|
|
132
132
|
revalidateOnFocus: !1,
|
|
133
133
|
errorRetryCount: fr
|
|
134
134
|
}
|
|
135
|
-
), { state:
|
|
136
|
-
var
|
|
137
|
-
return !((d = (
|
|
138
|
-
}),
|
|
139
|
-
var
|
|
135
|
+
), { state: f, swrvState: c } = gr(n, i, s), o = g(() => {
|
|
136
|
+
var u, d, v, b, m, h, x;
|
|
137
|
+
return !((d = (u = n.value) == null ? void 0 : u.data) != null && d.length) || !((b = (v = n.value) == null ? void 0 : v.meta) != null && b.display) || !((x = (h = (m = n.value) == null ? void 0 : m.meta) == null ? void 0 : h.metric_names) != null && x.length) ? { current: {}, previous: {} } : yr(n.value, e.withTrend.value);
|
|
138
|
+
}), l = g(() => {
|
|
139
|
+
var u, d, v;
|
|
140
140
|
if (e.timeframe.value.key === "custom") {
|
|
141
|
-
if (!((d = (
|
|
141
|
+
if (!((d = (u = n.value) == null ? void 0 : u.meta) != null && d.start_ms))
|
|
142
142
|
return "";
|
|
143
|
-
const { start_ms: b, end_ms:
|
|
144
|
-
let h = (
|
|
143
|
+
const { start_ms: b, end_ms: m } = n.value.meta;
|
|
144
|
+
let h = (m - b) / (1e3 * 60 * 60 * 24);
|
|
145
145
|
return e.withTrend.value && (h /= 2), r.t("trendRange.custom", { numDays: Math.round(h) });
|
|
146
146
|
} else
|
|
147
147
|
return e.withTrend.value ? r.t(`trendRange.${e.timeframe.value.key}`) : r.t(`trendRange.${(v = re.get(te.ONE_DAY)) == null ? void 0 : v.key}`);
|
|
148
148
|
});
|
|
149
149
|
return {
|
|
150
|
-
isLoading: g(() =>
|
|
151
|
-
hasError: g(() =>
|
|
150
|
+
isLoading: g(() => c.PENDING === f.value),
|
|
151
|
+
hasError: g(() => c.ERROR === f.value),
|
|
152
152
|
raw: n,
|
|
153
153
|
mapped: o,
|
|
154
|
-
trendRange:
|
|
154
|
+
trendRange: l
|
|
155
155
|
};
|
|
156
156
|
}
|
|
157
|
-
const j = (e, r, t = B, a) => (a ?? [B]).reduce((i,
|
|
158
|
-
const
|
|
159
|
-
return
|
|
157
|
+
const j = (e, r, t = B, a) => (a ?? [B]).reduce((i, s) => {
|
|
158
|
+
const f = e[r][t];
|
|
159
|
+
return f ? i + (f[s] || 0) : i;
|
|
160
160
|
}, 0);
|
|
161
161
|
function hr(e) {
|
|
162
162
|
const {
|
|
@@ -165,42 +165,42 @@ function hr(e) {
|
|
|
165
165
|
description: a,
|
|
166
166
|
record: n,
|
|
167
167
|
hasError: i,
|
|
168
|
-
increaseIsBad:
|
|
169
|
-
formatValueFn:
|
|
170
|
-
trendRange:
|
|
168
|
+
increaseIsBad: s,
|
|
169
|
+
formatValueFn: f,
|
|
170
|
+
trendRange: c
|
|
171
171
|
} = e;
|
|
172
172
|
return g(() => {
|
|
173
|
-
let o = 0,
|
|
173
|
+
let o = 0, l = 0;
|
|
174
174
|
if (n != null && n.value)
|
|
175
175
|
try {
|
|
176
|
-
o = j(n.value, "current", e.lookupKey, e.sumGroupedValues),
|
|
177
|
-
} catch (
|
|
176
|
+
o = j(n.value, "current", e.lookupKey, e.sumGroupedValues), l = j(n.value, "previous", e.lookupKey, e.sumGroupedValues);
|
|
177
|
+
} catch (u) {
|
|
178
178
|
console.error(
|
|
179
179
|
"Metric card data doesn't have the expected structure:",
|
|
180
|
-
|
|
180
|
+
u
|
|
181
181
|
);
|
|
182
182
|
}
|
|
183
183
|
return {
|
|
184
184
|
cardType: r,
|
|
185
185
|
hasError: i.value,
|
|
186
186
|
currentValue: o,
|
|
187
|
-
previousValue:
|
|
187
|
+
previousValue: l,
|
|
188
188
|
title: t.value,
|
|
189
189
|
description: a,
|
|
190
|
-
increaseIsBad: !!
|
|
190
|
+
increaseIsBad: !!s,
|
|
191
191
|
// Coerce undefined to false
|
|
192
|
-
formatValueFn:
|
|
193
|
-
trendRange:
|
|
192
|
+
formatValueFn: f,
|
|
193
|
+
trendRange: c == null ? void 0 : c.value
|
|
194
194
|
};
|
|
195
195
|
});
|
|
196
196
|
}
|
|
197
|
-
var
|
|
197
|
+
var ue = /* @__PURE__ */ new WeakMap(), Re = 0;
|
|
198
198
|
function Cr(e) {
|
|
199
199
|
if (!e.length)
|
|
200
200
|
return "";
|
|
201
201
|
for (var r = "arg", t = 0; t < e.length; ++t) {
|
|
202
202
|
var a = void 0;
|
|
203
|
-
e[t] === null || typeof e[t] != "object" && typeof e[t] != "function" ? typeof e[t] == "string" ? a = '"' + e[t] + '"' : a = String(e[t]) :
|
|
203
|
+
e[t] === null || typeof e[t] != "object" && typeof e[t] != "function" ? typeof e[t] == "string" ? a = '"' + e[t] + '"' : a = String(e[t]) : ue.has(e[t]) ? a = ue.get(e[t]) : (a = Re, ue.set(e[t], Re++)), r += "@" + a;
|
|
204
204
|
}
|
|
205
205
|
return r;
|
|
206
206
|
}
|
|
@@ -225,17 +225,17 @@ var ve = (
|
|
|
225
225
|
var t = this.serializeKey(r);
|
|
226
226
|
return this.items.get(t);
|
|
227
227
|
}, e.prototype.set = function(r, t, a) {
|
|
228
|
-
var n = this.serializeKey(r), i = a || this.ttl,
|
|
228
|
+
var n = this.serializeKey(r), i = a || this.ttl, s = Date.now(), f = {
|
|
229
229
|
data: t,
|
|
230
|
-
createdAt:
|
|
231
|
-
expiresAt: i ?
|
|
230
|
+
createdAt: s,
|
|
231
|
+
expiresAt: i ? s + i : 1 / 0
|
|
232
232
|
};
|
|
233
|
-
this.dispatchExpire(i,
|
|
233
|
+
this.dispatchExpire(i, f, n), this.items.set(n, f);
|
|
234
234
|
}, e.prototype.dispatchExpire = function(r, t, a) {
|
|
235
235
|
var n = this;
|
|
236
236
|
r && setTimeout(function() {
|
|
237
|
-
var i = Date.now(),
|
|
238
|
-
|
|
237
|
+
var i = Date.now(), s = i >= t.expiresAt;
|
|
238
|
+
s && n.delete(a);
|
|
239
239
|
}, r);
|
|
240
240
|
}, e.prototype.delete = function(r) {
|
|
241
241
|
this.items.delete(r);
|
|
@@ -269,27 +269,27 @@ var O = function() {
|
|
|
269
269
|
}, O.apply(this, arguments);
|
|
270
270
|
}, Z = function(e, r, t, a) {
|
|
271
271
|
function n(i) {
|
|
272
|
-
return i instanceof t ? i : new t(function(
|
|
273
|
-
|
|
272
|
+
return i instanceof t ? i : new t(function(s) {
|
|
273
|
+
s(i);
|
|
274
274
|
});
|
|
275
275
|
}
|
|
276
|
-
return new (t || (t = Promise))(function(i,
|
|
277
|
-
function
|
|
276
|
+
return new (t || (t = Promise))(function(i, s) {
|
|
277
|
+
function f(l) {
|
|
278
278
|
try {
|
|
279
|
-
o(a.next(
|
|
280
|
-
} catch (
|
|
281
|
-
u
|
|
279
|
+
o(a.next(l));
|
|
280
|
+
} catch (u) {
|
|
281
|
+
s(u);
|
|
282
282
|
}
|
|
283
283
|
}
|
|
284
|
-
function
|
|
284
|
+
function c(l) {
|
|
285
285
|
try {
|
|
286
|
-
o(a.throw(
|
|
287
|
-
} catch (
|
|
288
|
-
u
|
|
286
|
+
o(a.throw(l));
|
|
287
|
+
} catch (u) {
|
|
288
|
+
s(u);
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
|
-
function o(
|
|
292
|
-
|
|
291
|
+
function o(l) {
|
|
292
|
+
l.done ? i(l.value) : n(l.value).then(f, c);
|
|
293
293
|
}
|
|
294
294
|
o((a = a.apply(e, r || [])).next());
|
|
295
295
|
});
|
|
@@ -298,16 +298,16 @@ var O = function() {
|
|
|
298
298
|
if (i[0] & 1)
|
|
299
299
|
throw i[1];
|
|
300
300
|
return i[1];
|
|
301
|
-
}, trys: [], ops: [] }, a, n, i,
|
|
302
|
-
return
|
|
301
|
+
}, trys: [], ops: [] }, a, n, i, s;
|
|
302
|
+
return s = { next: f(0), throw: f(1), return: f(2) }, typeof Symbol == "function" && (s[Symbol.iterator] = function() {
|
|
303
303
|
return this;
|
|
304
|
-
}),
|
|
305
|
-
function
|
|
306
|
-
return function(
|
|
307
|
-
return
|
|
304
|
+
}), s;
|
|
305
|
+
function f(o) {
|
|
306
|
+
return function(l) {
|
|
307
|
+
return c([o, l]);
|
|
308
308
|
};
|
|
309
309
|
}
|
|
310
|
-
function
|
|
310
|
+
function c(o) {
|
|
311
311
|
if (a)
|
|
312
312
|
throw new TypeError("Generator is already executing.");
|
|
313
313
|
for (; t; )
|
|
@@ -348,8 +348,8 @@ var O = function() {
|
|
|
348
348
|
continue;
|
|
349
349
|
}
|
|
350
350
|
o = r.call(e, t);
|
|
351
|
-
} catch (
|
|
352
|
-
o = [6,
|
|
351
|
+
} catch (l) {
|
|
352
|
+
o = [6, l], n = 0;
|
|
353
353
|
} finally {
|
|
354
354
|
a = i = 0;
|
|
355
355
|
}
|
|
@@ -361,18 +361,18 @@ var O = function() {
|
|
|
361
361
|
var t = typeof Symbol == "function" && e[Symbol.iterator];
|
|
362
362
|
if (!t)
|
|
363
363
|
return e;
|
|
364
|
-
var a = t.call(e), n, i = [],
|
|
364
|
+
var a = t.call(e), n, i = [], s;
|
|
365
365
|
try {
|
|
366
366
|
for (; (r === void 0 || r-- > 0) && !(n = a.next()).done; )
|
|
367
367
|
i.push(n.value);
|
|
368
|
-
} catch (
|
|
369
|
-
|
|
368
|
+
} catch (f) {
|
|
369
|
+
s = { error: f };
|
|
370
370
|
} finally {
|
|
371
371
|
try {
|
|
372
372
|
n && !n.done && (t = a.return) && t.call(a);
|
|
373
373
|
} finally {
|
|
374
|
-
if (
|
|
375
|
-
throw
|
|
374
|
+
if (s)
|
|
375
|
+
throw s.error;
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
return i;
|
|
@@ -381,8 +381,8 @@ var O = function() {
|
|
|
381
381
|
for (var a = 0, n = r.length, i; a < n; a++)
|
|
382
382
|
(i || !(a in r)) && (i || (i = Array.prototype.slice.call(r, 0, a)), i[a] = r[a]);
|
|
383
383
|
return e.concat(i || Array.prototype.slice.call(r));
|
|
384
|
-
},
|
|
385
|
-
cache:
|
|
384
|
+
}, Ve = new ve(), ie = new ve(), ce = new ve(), Ae = {
|
|
385
|
+
cache: Ve,
|
|
386
386
|
refreshInterval: 0,
|
|
387
387
|
ttl: 0,
|
|
388
388
|
serverTTL: 1e3,
|
|
@@ -396,7 +396,7 @@ var O = function() {
|
|
|
396
396
|
isOnline: de.isOnline,
|
|
397
397
|
isDocumentVisible: de.isDocumentVisible
|
|
398
398
|
};
|
|
399
|
-
function
|
|
399
|
+
function Tr(e, r, t) {
|
|
400
400
|
var a = ie.get(e);
|
|
401
401
|
if (a)
|
|
402
402
|
a.data.push(r);
|
|
@@ -405,7 +405,7 @@ function Er(e, r, t) {
|
|
|
405
405
|
ie.set(e, [r], t > 0 ? t + n : t);
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
|
-
function
|
|
408
|
+
function Er(e, r, t) {
|
|
409
409
|
if (t.isDocumentVisible() && !(t.errorRetryCount !== void 0 && r > t.errorRetryCount)) {
|
|
410
410
|
var a = Math.min(r || 0, t.errorRetryCount), n = a * t.errorRetryInterval;
|
|
411
411
|
setTimeout(function() {
|
|
@@ -414,51 +414,51 @@ function Ir(e, r, t) {
|
|
|
414
414
|
}
|
|
415
415
|
}
|
|
416
416
|
var Ne = function(e, r, t, a) {
|
|
417
|
-
return t === void 0 && (t =
|
|
418
|
-
var n, i,
|
|
419
|
-
return U(this, function(
|
|
420
|
-
switch (
|
|
417
|
+
return t === void 0 && (t = Ve), a === void 0 && (a = Ae.ttl), Z(void 0, void 0, void 0, function() {
|
|
418
|
+
var n, i, s, f, c, o, l;
|
|
419
|
+
return U(this, function(u) {
|
|
420
|
+
switch (u.label) {
|
|
421
421
|
case 0:
|
|
422
|
-
if (!
|
|
422
|
+
if (!xr(r))
|
|
423
423
|
return [3, 5];
|
|
424
|
-
|
|
424
|
+
u.label = 1;
|
|
425
425
|
case 1:
|
|
426
|
-
return
|
|
426
|
+
return u.trys.push([1, 3, , 4]), [4, r];
|
|
427
427
|
case 2:
|
|
428
|
-
return n =
|
|
428
|
+
return n = u.sent(), [3, 4];
|
|
429
429
|
case 3:
|
|
430
|
-
return
|
|
430
|
+
return f = u.sent(), i = f, [3, 4];
|
|
431
431
|
case 4:
|
|
432
432
|
return [3, 6];
|
|
433
433
|
case 5:
|
|
434
|
-
n = r,
|
|
434
|
+
n = r, u.label = 6;
|
|
435
435
|
case 6:
|
|
436
|
-
if (
|
|
436
|
+
if (s = !1, c = { data: n, error: i, isValidating: s }, typeof n < "u")
|
|
437
437
|
try {
|
|
438
|
-
t.set(e,
|
|
438
|
+
t.set(e, c, a);
|
|
439
439
|
} catch (d) {
|
|
440
440
|
console.error("swrv(mutate): failed to set cache", d);
|
|
441
441
|
}
|
|
442
|
-
return o = ie.get(e), o && o.data.length && (
|
|
442
|
+
return o = ie.get(e), o && o.data.length && (l = o.data.filter(function(d) {
|
|
443
443
|
return d.key === e;
|
|
444
|
-
}),
|
|
445
|
-
typeof
|
|
446
|
-
var b = v ===
|
|
447
|
-
b || delete
|
|
448
|
-
}),
|
|
444
|
+
}), l.forEach(function(d, v) {
|
|
445
|
+
typeof c.data < "u" && (d.data = c.data), d.error = c.error, d.isValidating = c.isValidating;
|
|
446
|
+
var b = v === l.length - 1;
|
|
447
|
+
b || delete l[v];
|
|
448
|
+
}), l = l.filter(Boolean)), [2, c];
|
|
449
449
|
}
|
|
450
450
|
});
|
|
451
451
|
});
|
|
452
452
|
};
|
|
453
|
-
function
|
|
453
|
+
function Ir() {
|
|
454
454
|
for (var e = this, r = [], t = 0; t < arguments.length; t++)
|
|
455
455
|
r[t] = arguments[t];
|
|
456
|
-
var a, n, i = O({},
|
|
456
|
+
var a, n, i = O({}, Ae), s = !1, f = !1, c = He(), o = (c == null ? void 0 : c.proxy) || c;
|
|
457
457
|
if (!o)
|
|
458
458
|
return console.error("Could not get current instance, check to make sure that `useSwrv` is declared in the top level of the setup function."), null;
|
|
459
|
-
var
|
|
459
|
+
var l = (o == null ? void 0 : o.$isServer) || !1;
|
|
460
460
|
r.length >= 1 && (a = r[0]), r.length >= 2 && (n = r[1]), r.length > 2 && (i = O(O({}, i), r[2]));
|
|
461
|
-
var
|
|
461
|
+
var u = l ? i.serverTTL : i.ttl, d = typeof a == "function" ? a : pe(a);
|
|
462
462
|
typeof n > "u" && (n = i.fetcher);
|
|
463
463
|
var v = null;
|
|
464
464
|
v || (v = Be({
|
|
@@ -469,31 +469,31 @@ function xr() {
|
|
|
469
469
|
}));
|
|
470
470
|
var b = function(S, C) {
|
|
471
471
|
return Z(e, void 0, void 0, function() {
|
|
472
|
-
var H, E, $, X, ne,
|
|
472
|
+
var H, E, $, X, ne, me, ae, he = this;
|
|
473
473
|
return U(this, function(oe) {
|
|
474
474
|
switch (oe.label) {
|
|
475
475
|
case 0:
|
|
476
476
|
return H = v.data === void 0, E = d.value, E ? ($ = i.cache.get(E), X = $ && $.data, v.isValidating = !0, X && (v.data = X.data, v.error = X.error), ne = S || n, !ne || !i.isDocumentVisible() && !H || (C == null ? void 0 : C.forceRevalidate) !== void 0 && !(C != null && C.forceRevalidate) ? (v.isValidating = !1, [
|
|
477
477
|
2
|
|
478
478
|
/*return*/
|
|
479
|
-
]) : $ && (
|
|
479
|
+
]) : $ && (me = !!(Date.now() - $.createdAt >= i.dedupingInterval || C != null && C.forceRevalidate), !me) ? (v.isValidating = !1, [
|
|
480
480
|
2
|
|
481
481
|
/*return*/
|
|
482
482
|
]) : (ae = function() {
|
|
483
483
|
return Z(he, void 0, void 0, function() {
|
|
484
|
-
var P, Ce,
|
|
484
|
+
var P, Ce, le, be;
|
|
485
485
|
return U(this, function(W) {
|
|
486
486
|
switch (W.label) {
|
|
487
487
|
case 0:
|
|
488
|
-
return P = ce.get(E), P ? [3, 2] : (Ce = Array.isArray(E) ? E : [E],
|
|
488
|
+
return P = ce.get(E), P ? [3, 2] : (Ce = Array.isArray(E) ? E : [E], le = ne.apply(void 0, Nr([], Rr(Ce), !1)), ce.set(E, le, i.dedupingInterval), [4, Ne(E, le, i.cache, u)]);
|
|
489
489
|
case 1:
|
|
490
490
|
return W.sent(), [3, 4];
|
|
491
491
|
case 2:
|
|
492
|
-
return [4, Ne(E, P.data, i.cache,
|
|
492
|
+
return [4, Ne(E, P.data, i.cache, u)];
|
|
493
493
|
case 3:
|
|
494
494
|
W.sent(), W.label = 4;
|
|
495
495
|
case 4:
|
|
496
|
-
return v.isValidating = !1, ce.delete(E), v.error !== void 0 && (be = !
|
|
496
|
+
return v.isValidating = !1, ce.delete(E), v.error !== void 0 && (be = !s && i.shouldRetryOnError && (C ? C.shouldRetryOnError : !0), be && Er(b, C ? C.errorRetryCount : 1, i)), [
|
|
497
497
|
2
|
|
498
498
|
/*return*/
|
|
499
499
|
];
|
|
@@ -505,7 +505,7 @@ function xr() {
|
|
|
505
505
|
return U(this, function(P) {
|
|
506
506
|
switch (P.label) {
|
|
507
507
|
case 0:
|
|
508
|
-
return
|
|
508
|
+
return s ? [3, 2] : [4, ae()];
|
|
509
509
|
case 1:
|
|
510
510
|
P.sent(), P.label = 2;
|
|
511
511
|
case 2:
|
|
@@ -532,7 +532,7 @@ function xr() {
|
|
|
532
532
|
}
|
|
533
533
|
});
|
|
534
534
|
});
|
|
535
|
-
},
|
|
535
|
+
}, m = function() {
|
|
536
536
|
return Z(e, void 0, void 0, function() {
|
|
537
537
|
return U(this, function(S) {
|
|
538
538
|
return [2, b(null, { shouldRetryOnError: !1 })];
|
|
@@ -551,7 +551,7 @@ function xr() {
|
|
|
551
551
|
case 2:
|
|
552
552
|
h && clearTimeout(h), C.label = 3;
|
|
553
553
|
case 3:
|
|
554
|
-
return i.refreshInterval && !
|
|
554
|
+
return i.refreshInterval && !s && (h = setTimeout(S, i.refreshInterval)), [
|
|
555
555
|
2
|
|
556
556
|
/*return*/
|
|
557
557
|
];
|
|
@@ -559,9 +559,9 @@ function xr() {
|
|
|
559
559
|
});
|
|
560
560
|
});
|
|
561
561
|
};
|
|
562
|
-
i.refreshInterval && (h = setTimeout(S, i.refreshInterval)), i.revalidateOnFocus && (document.addEventListener("visibilitychange",
|
|
562
|
+
i.refreshInterval && (h = setTimeout(S, i.refreshInterval)), i.revalidateOnFocus && (document.addEventListener("visibilitychange", m, !1), window.addEventListener("focus", m, !1));
|
|
563
563
|
}), Pe(function() {
|
|
564
|
-
|
|
564
|
+
s = !0, h && clearTimeout(h), i.revalidateOnFocus && (document.removeEventListener("visibilitychange", m, !1), window.removeEventListener("focus", m, !1));
|
|
565
565
|
var S = ie.get(d.value);
|
|
566
566
|
S && (S.data = S.data.filter(function(C) {
|
|
567
567
|
return C !== v;
|
|
@@ -569,18 +569,18 @@ function xr() {
|
|
|
569
569
|
});
|
|
570
570
|
try {
|
|
571
571
|
Ke(d, function(S) {
|
|
572
|
-
Ze(d) || (d.value = S), v.key = S, v.isValidating = !!S,
|
|
572
|
+
Ze(d) || (d.value = S), v.key = S, v.isValidating = !!S, Tr(d.value, v, u), !l && !f && d.value && b(), f = !1;
|
|
573
573
|
}, {
|
|
574
574
|
immediate: !0
|
|
575
575
|
});
|
|
576
576
|
} catch {
|
|
577
577
|
}
|
|
578
|
-
var
|
|
578
|
+
var x = O(O({}, Ue(v)), { mutate: function(S, C) {
|
|
579
579
|
return b(S, O(O({}, C), { forceRevalidate: !0 }));
|
|
580
580
|
} });
|
|
581
|
-
return
|
|
581
|
+
return x;
|
|
582
582
|
}
|
|
583
|
-
function
|
|
583
|
+
function xr(e) {
|
|
584
584
|
return e !== null && typeof e == "object" && typeof e.then == "function";
|
|
585
585
|
}
|
|
586
586
|
function kr(e, r, t) {
|
|
@@ -588,8 +588,8 @@ function kr(e, r, t) {
|
|
|
588
588
|
data: a,
|
|
589
589
|
error: n,
|
|
590
590
|
isValidating: i,
|
|
591
|
-
mutate:
|
|
592
|
-
} =
|
|
591
|
+
mutate: s
|
|
592
|
+
} = Ir(e, r, {
|
|
593
593
|
revalidateDebounce: 500,
|
|
594
594
|
revalidateOnFocus: !1,
|
|
595
595
|
dedupingInterval: 100,
|
|
@@ -600,13 +600,13 @@ function kr(e, r, t) {
|
|
|
600
600
|
response: a,
|
|
601
601
|
error: n,
|
|
602
602
|
isValidating: i,
|
|
603
|
-
revalidate:
|
|
603
|
+
revalidate: s
|
|
604
604
|
};
|
|
605
605
|
}
|
|
606
606
|
const K = {
|
|
607
607
|
useI18n: cr,
|
|
608
608
|
useMetricCardBuilder: hr,
|
|
609
|
-
useMetricFetcher:
|
|
609
|
+
useMetricFetcher: mr,
|
|
610
610
|
useRequest: kr
|
|
611
611
|
}, Le = Symbol("METRICS_PROVIDER_KEY"), qr = (e) => {
|
|
612
612
|
const {
|
|
@@ -615,17 +615,17 @@ const K = {
|
|
|
615
615
|
additionalFilter: a,
|
|
616
616
|
queryReady: n,
|
|
617
617
|
timeframe: i,
|
|
618
|
-
tz:
|
|
619
|
-
hasTrendAccess:
|
|
620
|
-
refreshInterval:
|
|
618
|
+
tz: s,
|
|
619
|
+
hasTrendAccess: f,
|
|
620
|
+
refreshInterval: c,
|
|
621
621
|
abortController: o,
|
|
622
|
-
queryFn:
|
|
622
|
+
queryFn: l
|
|
623
623
|
} = e;
|
|
624
624
|
if (t && !r)
|
|
625
625
|
throw new Error("Must provide a dimension if filtering by a value");
|
|
626
|
-
const
|
|
626
|
+
const u = !!(r && t), d = !!(r && !t), v = g(() => {
|
|
627
627
|
const S = [];
|
|
628
|
-
return
|
|
628
|
+
return u && S.push({
|
|
629
629
|
dimension: r,
|
|
630
630
|
type: "in",
|
|
631
631
|
values: [t]
|
|
@@ -637,40 +637,40 @@ const K = {
|
|
|
637
637
|
// Traffic and error rate cards should only try to query for the dimension if it's going to be used.
|
|
638
638
|
// It isn't used for single entity queries.
|
|
639
639
|
dimensions: [
|
|
640
|
-
...r && !
|
|
640
|
+
...r && !u ? [r] : [],
|
|
641
641
|
"status_code_grouped"
|
|
642
642
|
],
|
|
643
643
|
filter: v,
|
|
644
644
|
queryReady: n,
|
|
645
645
|
timeframe: i,
|
|
646
|
-
tz:
|
|
646
|
+
tz: s,
|
|
647
647
|
// Traffic and error rate cards can't query trend if multiple entities are expected.
|
|
648
|
-
withTrend: g(() =>
|
|
649
|
-
refreshInterval:
|
|
650
|
-
queryFn:
|
|
648
|
+
withTrend: g(() => f.value && !d),
|
|
649
|
+
refreshInterval: c,
|
|
650
|
+
queryFn: l,
|
|
651
651
|
abortController: o
|
|
652
|
-
},
|
|
652
|
+
}, m = {
|
|
653
653
|
metrics: [
|
|
654
654
|
"response_latency_p99"
|
|
655
655
|
],
|
|
656
656
|
// To keep single-entity queries consistent, don't bother querying the dimension for latency
|
|
657
657
|
// in the single-entity case, even though it's possible.
|
|
658
|
-
...r && !
|
|
658
|
+
...r && !u ? { dimensions: [r] } : {},
|
|
659
659
|
filter: v,
|
|
660
660
|
queryReady: n,
|
|
661
661
|
timeframe: i,
|
|
662
|
-
tz:
|
|
662
|
+
tz: s,
|
|
663
663
|
// Don't query latency trends in the multi-entity case: it's possible, but wasteful.
|
|
664
|
-
withTrend: g(() =>
|
|
665
|
-
refreshInterval:
|
|
666
|
-
queryFn:
|
|
664
|
+
withTrend: g(() => f.value && !d),
|
|
665
|
+
refreshInterval: c,
|
|
666
|
+
queryFn: l,
|
|
667
667
|
abortController: o
|
|
668
|
-
}, h = K.useMetricFetcher(b),
|
|
668
|
+
}, h = K.useMetricFetcher(b), x = K.useMetricFetcher(m);
|
|
669
669
|
return {
|
|
670
670
|
trafficData: h,
|
|
671
|
-
latencyData:
|
|
671
|
+
latencyData: x
|
|
672
672
|
};
|
|
673
|
-
},
|
|
673
|
+
}, gi = /* @__PURE__ */ k({
|
|
674
674
|
__name: "MetricsProviderInternal",
|
|
675
675
|
props: {
|
|
676
676
|
maxTimeframe: { default: te.THIRTY_DAY },
|
|
@@ -682,6 +682,7 @@ const K = {
|
|
|
682
682
|
queryReady: { type: Boolean, default: !0 },
|
|
683
683
|
refreshInterval: {},
|
|
684
684
|
longCardTitles: { type: Boolean, default: !1 },
|
|
685
|
+
containerTitle: { default: void 0 },
|
|
685
686
|
description: { default: void 0 },
|
|
686
687
|
abortController: { default: void 0 }
|
|
687
688
|
},
|
|
@@ -689,45 +690,46 @@ const K = {
|
|
|
689
690
|
const r = e;
|
|
690
691
|
if (r.dimension && er.findIndex((d) => d === r.dimension) === -1)
|
|
691
692
|
throw new Error(`Attempted to use MetricsProvider with an invalid dimension: ${r.dimension}`);
|
|
692
|
-
const t =
|
|
693
|
+
const t = xe(pr);
|
|
693
694
|
let a;
|
|
694
695
|
t ? a = t.queryFn : (console.warn("Analytics dashboards require a query bridge supplied via provide / inject."), console.warn("Please ensure your application has a query bridge provided under the key 'analytics-query-provider', as described in"), console.warn("https://github.com/Kong/public-ui-components/blob/main/packages/analytics/analytics-metric-provider/README.md#requirements"), a = () => Promise.reject(new Error("Query bridge required")));
|
|
695
|
-
const i = ar().getConfig(),
|
|
696
|
+
const i = ar().getConfig(), s = g(() => i.value !== null && r.queryReady), f = g(() => {
|
|
696
697
|
var v, b;
|
|
697
698
|
const d = (b = (v = i.value) == null ? void 0 : v.analytics) == null ? void 0 : b.retention_ms;
|
|
698
699
|
return !!d && d > or;
|
|
699
|
-
}),
|
|
700
|
+
}), c = g(() => r.tz ? r.tz : new Intl.DateTimeFormat().resolvedOptions().timeZone), o = g(() => {
|
|
700
701
|
if (r.overrideTimeframe)
|
|
701
702
|
return r.overrideTimeframe;
|
|
702
|
-
const d =
|
|
703
|
+
const d = f.value ? re.get(r.maxTimeframe) : re.get(te.ONE_DAY);
|
|
703
704
|
if (!d)
|
|
704
705
|
throw new Error("Metrics provider failed to resolve fallback timeframe.");
|
|
705
706
|
return d;
|
|
706
707
|
}), {
|
|
707
|
-
trafficData:
|
|
708
|
-
latencyData:
|
|
708
|
+
trafficData: l,
|
|
709
|
+
latencyData: u
|
|
709
710
|
} = qr({
|
|
710
711
|
dimension: r.dimension,
|
|
711
712
|
dimensionFilterValue: r.filterValue,
|
|
712
713
|
additionalFilter: Ge(r, "additionalFilter"),
|
|
713
|
-
queryReady:
|
|
714
|
+
queryReady: s,
|
|
714
715
|
timeframe: o,
|
|
715
|
-
tz:
|
|
716
|
-
hasTrendAccess:
|
|
716
|
+
tz: c,
|
|
717
|
+
hasTrendAccess: f,
|
|
717
718
|
refreshInterval: r.refreshInterval,
|
|
718
719
|
queryFn: a,
|
|
719
720
|
abortController: r.abortController
|
|
720
721
|
});
|
|
721
722
|
return je(Le, {
|
|
722
723
|
data: {
|
|
723
|
-
traffic:
|
|
724
|
-
latency:
|
|
724
|
+
traffic: l,
|
|
725
|
+
latency: u
|
|
725
726
|
},
|
|
726
727
|
description: r.description,
|
|
727
|
-
|
|
728
|
+
containerTitle: r.containerTitle,
|
|
729
|
+
hasTrendAccess: f,
|
|
728
730
|
longCardTitles: r.longCardTitles
|
|
729
731
|
}), (d, v) => ke(d.$slots, "default", {
|
|
730
|
-
hasTrendAccess:
|
|
732
|
+
hasTrendAccess: f.value,
|
|
731
733
|
timeframe: o.value
|
|
732
734
|
});
|
|
733
735
|
}
|
|
@@ -738,33 +740,33 @@ function zr(e) {
|
|
|
738
740
|
var Me = { exports: {} };
|
|
739
741
|
(function(e) {
|
|
740
742
|
(function() {
|
|
741
|
-
function r(o,
|
|
742
|
-
if (
|
|
743
|
+
function r(o, l) {
|
|
744
|
+
if (l.separator === !1 || o < 1e3)
|
|
743
745
|
return o.toString();
|
|
744
|
-
var
|
|
745
|
-
return v.reverse().forEach(function(b,
|
|
746
|
-
|
|
746
|
+
var u = typeof l.separator == "string" ? l.separator : ",", d = [], v = Math.round(o).toString().split("");
|
|
747
|
+
return v.reverse().forEach(function(b, m) {
|
|
748
|
+
m && m % 3 === 0 && d.push(u), d.push(b);
|
|
747
749
|
}), d.reverse().join("");
|
|
748
750
|
}
|
|
749
|
-
function t(o,
|
|
750
|
-
var d = o /
|
|
751
|
-
return
|
|
751
|
+
function t(o, l, u) {
|
|
752
|
+
var d = o / l, v = u.round ? "round" : "floor";
|
|
753
|
+
return u.decimal === !1 ? (o = Math[v](d), o.toString()) : (u.precision ? o = d : o = d < 10 ? Math[v](d * 10) / 10 : Math[v](d), o = o.toString(), typeof u.decimal == "string" && (o = o.replace(".", u.decimal)), o);
|
|
752
754
|
}
|
|
753
|
-
var a = 1e3, n = 1e4, i = 1e6,
|
|
754
|
-
function
|
|
755
|
-
var
|
|
756
|
-
|
|
755
|
+
var a = 1e3, n = 1e4, i = 1e6, s = 1e9, f = 1e12;
|
|
756
|
+
function c(o, l) {
|
|
757
|
+
var u;
|
|
758
|
+
l = l || {};
|
|
757
759
|
var d = o < 0;
|
|
758
|
-
d && (o = Math.abs(o)),
|
|
759
|
-
var v =
|
|
760
|
-
return o < v ||
|
|
760
|
+
d && (o = Math.abs(o)), l.precision && (o = parseFloat(o.toPrecision(l.precision)));
|
|
761
|
+
var v = l.min10k ? n : a;
|
|
762
|
+
return o < v || l.precision && l.precision > Math.log10(o) ? u = r(t(o, 1, l), l) : o < i ? u = t(o, a, l) + "k" : o < s ? u = t(o, i, l) + "m" : o < f ? u = r(t(o, s, l), l) + "b" : u = r(t(o, f, l), l) + "t", d && (u = "-" + u), l.capital && (u = u.toUpperCase()), l.prefix && (u = l.prefix + u), l.suffix && (u = u + l.suffix), u;
|
|
761
763
|
}
|
|
762
|
-
|
|
764
|
+
c.addCommas = r, e.exports = c;
|
|
763
765
|
})();
|
|
764
766
|
})(Me);
|
|
765
|
-
var
|
|
766
|
-
const
|
|
767
|
-
var
|
|
767
|
+
var Vr = Me.exports;
|
|
768
|
+
const Ar = /* @__PURE__ */ zr(Vr);
|
|
769
|
+
var q = /* @__PURE__ */ ((e) => (e.Small = "sm", e.Medium = "md", e.Large = "lg", e.LargeCompact = "lgc", e.ExtraLarge = "xl", e))(q || {});
|
|
768
770
|
const _ = "24px", D = (e, r) => {
|
|
769
771
|
const t = e.__vccOpts || e;
|
|
770
772
|
for (const [a, n] of r)
|
|
@@ -845,14 +847,14 @@ const _ = "24px", D = (e, r) => {
|
|
|
845
847
|
lineHeight: "0",
|
|
846
848
|
width: t.value
|
|
847
849
|
}));
|
|
848
|
-
return (n, i) => (p(),
|
|
850
|
+
return (n, i) => (p(), T(z(e.as), {
|
|
849
851
|
"aria-hidden": e.decorative ? "true" : void 0,
|
|
850
852
|
class: "kui-icon cloud-upload-icon",
|
|
851
853
|
"data-testid": "kui-icon-wrapper-cloud-upload-icon",
|
|
852
|
-
style:
|
|
854
|
+
style: A(a.value)
|
|
853
855
|
}, {
|
|
854
|
-
default:
|
|
855
|
-
(p(),
|
|
856
|
+
default: V(() => [
|
|
857
|
+
(p(), y("svg", {
|
|
856
858
|
"aria-hidden": e.decorative ? "true" : void 0,
|
|
857
859
|
"data-testid": "kui-icon-svg-cloud-upload-icon",
|
|
858
860
|
fill: "none",
|
|
@@ -862,7 +864,7 @@ const _ = "24px", D = (e, r) => {
|
|
|
862
864
|
width: "100%",
|
|
863
865
|
xmlns: "http://www.w3.org/2000/svg"
|
|
864
866
|
}, [
|
|
865
|
-
e.title ? (p(),
|
|
867
|
+
e.title ? (p(), y("title", Dr, R(e.title), 1)) : N("", !0),
|
|
866
868
|
Or
|
|
867
869
|
], 8, Mr))
|
|
868
870
|
]),
|
|
@@ -944,14 +946,14 @@ const _ = "24px", D = (e, r) => {
|
|
|
944
946
|
lineHeight: "0",
|
|
945
947
|
width: t.value
|
|
946
948
|
}));
|
|
947
|
-
return (n, i) => (p(),
|
|
949
|
+
return (n, i) => (p(), T(z(e.as), {
|
|
948
950
|
"aria-hidden": e.decorative ? "true" : void 0,
|
|
949
951
|
class: "kui-icon equal-icon",
|
|
950
952
|
"data-testid": "kui-icon-wrapper-equal-icon",
|
|
951
|
-
style:
|
|
953
|
+
style: A(a.value)
|
|
952
954
|
}, {
|
|
953
|
-
default:
|
|
954
|
-
(p(),
|
|
955
|
+
default: V(() => [
|
|
956
|
+
(p(), y("svg", {
|
|
955
957
|
"aria-hidden": e.decorative ? "true" : void 0,
|
|
956
958
|
"data-testid": "kui-icon-svg-equal-icon",
|
|
957
959
|
fill: "none",
|
|
@@ -961,7 +963,7 @@ const _ = "24px", D = (e, r) => {
|
|
|
961
963
|
width: "100%",
|
|
962
964
|
xmlns: "http://www.w3.org/2000/svg"
|
|
963
965
|
}, [
|
|
964
|
-
e.title ? (p(),
|
|
966
|
+
e.title ? (p(), y("title", Pr, R(e.title), 1)) : N("", !0),
|
|
965
967
|
Kr
|
|
966
968
|
], 8, $r))
|
|
967
969
|
]),
|
|
@@ -1043,14 +1045,14 @@ const _ = "24px", D = (e, r) => {
|
|
|
1043
1045
|
lineHeight: "0",
|
|
1044
1046
|
width: t.value
|
|
1045
1047
|
}));
|
|
1046
|
-
return (n, i) => (p(),
|
|
1048
|
+
return (n, i) => (p(), T(z(e.as), {
|
|
1047
1049
|
"aria-hidden": e.decorative ? "true" : void 0,
|
|
1048
1050
|
class: "kui-icon indeterminate-small-icon",
|
|
1049
1051
|
"data-testid": "kui-icon-wrapper-indeterminate-small-icon",
|
|
1050
|
-
style:
|
|
1052
|
+
style: A(a.value)
|
|
1051
1053
|
}, {
|
|
1052
|
-
default:
|
|
1053
|
-
(p(),
|
|
1054
|
+
default: V(() => [
|
|
1055
|
+
(p(), y("svg", {
|
|
1054
1056
|
"aria-hidden": e.decorative ? "true" : void 0,
|
|
1055
1057
|
"data-testid": "kui-icon-svg-indeterminate-small-icon",
|
|
1056
1058
|
fill: "none",
|
|
@@ -1060,7 +1062,7 @@ const _ = "24px", D = (e, r) => {
|
|
|
1060
1062
|
width: "100%",
|
|
1061
1063
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1062
1064
|
}, [
|
|
1063
|
-
e.title ? (p(),
|
|
1065
|
+
e.title ? (p(), y("title", Yr, R(e.title), 1)) : N("", !0),
|
|
1064
1066
|
Xr
|
|
1065
1067
|
], 8, jr))
|
|
1066
1068
|
]),
|
|
@@ -1142,14 +1144,14 @@ const _ = "24px", D = (e, r) => {
|
|
|
1142
1144
|
lineHeight: "0",
|
|
1143
1145
|
width: t.value
|
|
1144
1146
|
}));
|
|
1145
|
-
return (n, i) => (p(),
|
|
1147
|
+
return (n, i) => (p(), T(z(e.as), {
|
|
1146
1148
|
"aria-hidden": e.decorative ? "true" : void 0,
|
|
1147
1149
|
class: "kui-icon info-icon",
|
|
1148
1150
|
"data-testid": "kui-icon-wrapper-info-icon",
|
|
1149
|
-
style:
|
|
1151
|
+
style: A(a.value)
|
|
1150
1152
|
}, {
|
|
1151
|
-
default:
|
|
1152
|
-
(p(),
|
|
1153
|
+
default: V(() => [
|
|
1154
|
+
(p(), y("svg", {
|
|
1153
1155
|
"aria-hidden": e.decorative ? "true" : void 0,
|
|
1154
1156
|
"data-testid": "kui-icon-svg-info-icon",
|
|
1155
1157
|
fill: "none",
|
|
@@ -1159,7 +1161,7 @@ const _ = "24px", D = (e, r) => {
|
|
|
1159
1161
|
width: "100%",
|
|
1160
1162
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1161
1163
|
}, [
|
|
1162
|
-
e.title ? (p(),
|
|
1164
|
+
e.title ? (p(), y("title", et, R(e.title), 1)) : N("", !0),
|
|
1163
1165
|
rt
|
|
1164
1166
|
], 8, Jr))
|
|
1165
1167
|
]),
|
|
@@ -1169,10 +1171,10 @@ const _ = "24px", D = (e, r) => {
|
|
|
1169
1171
|
}), it = /* @__PURE__ */ D(tt, [["__scopeId", "data-v-60c6b8be"]]), nt = (e) => (L("data-v-9ad4bd00"), e = e(), M(), e), at = ["aria-hidden"], ot = {
|
|
1170
1172
|
key: 0,
|
|
1171
1173
|
"data-testid": "kui-icon-svg-title"
|
|
1172
|
-
},
|
|
1174
|
+
}, lt = /* @__PURE__ */ nt(() => /* @__PURE__ */ I("path", {
|
|
1173
1175
|
d: "M15.25 5C14.9 5 14.6042 4.87917 14.3625 4.6375C14.1208 4.39583 14 4.1 14 3.75C14 3.4 14.1208 3.10417 14.3625 2.8625C14.6042 2.62083 14.9 2.5 15.25 2.5C15.6 2.5 15.8958 2.62083 16.1375 2.8625C16.3792 3.10417 16.5 3.4 16.5 3.75C16.5 4.1 16.3792 4.39583 16.1375 4.6375C15.8958 4.87917 15.6 5 15.25 5ZM15.25 21.5C14.9 21.5 14.6042 21.3792 14.3625 21.1375C14.1208 20.8958 14 20.6 14 20.25C14 19.9 14.1208 19.6042 14.3625 19.3625C14.6042 19.1208 14.9 19 15.25 19C15.6 19 15.8958 19.1208 16.1375 19.3625C16.3792 19.6042 16.5 19.9 16.5 20.25C16.5 20.6 16.3792 20.8958 16.1375 21.1375C15.8958 21.3792 15.6 21.5 15.25 21.5ZM19.25 8.5C18.9 8.5 18.6042 8.37917 18.3625 8.1375C18.1208 7.89583 18 7.6 18 7.25C18 6.9 18.1208 6.60417 18.3625 6.3625C18.6042 6.12083 18.9 6 19.25 6C19.6 6 19.8958 6.12083 20.1375 6.3625C20.3792 6.60417 20.5 6.9 20.5 7.25C20.5 7.6 20.3792 7.89583 20.1375 8.1375C19.8958 8.37917 19.6 8.5 19.25 8.5ZM19.25 18C18.9 18 18.6042 17.8792 18.3625 17.6375C18.1208 17.3958 18 17.1 18 16.75C18 16.4 18.1208 16.1042 18.3625 15.8625C18.6042 15.6208 18.9 15.5 19.25 15.5C19.6 15.5 19.8958 15.6208 20.1375 15.8625C20.3792 16.1042 20.5 16.4 20.5 16.75C20.5 17.1 20.3792 17.3958 20.1375 17.6375C19.8958 17.8792 19.6 18 19.25 18ZM20.75 13.25C20.4 13.25 20.1042 13.1292 19.8625 12.8875C19.6208 12.6458 19.5 12.35 19.5 12C19.5 11.65 19.6208 11.3542 19.8625 11.1125C20.1042 10.8708 20.4 10.75 20.75 10.75C21.1 10.75 21.3958 10.8708 21.6375 11.1125C21.8792 11.3542 22 11.65 22 12C22 12.35 21.8792 12.6458 21.6375 12.8875C21.3958 13.1292 21.1 13.25 20.75 13.25ZM12 22C10.6167 22 9.31667 21.7375 8.1 21.2125C6.88333 20.6875 5.825 19.975 4.925 19.075C4.025 18.175 3.3125 17.1167 2.7875 15.9C2.2625 14.6833 2 13.3833 2 12C2 10.6167 2.2625 9.31667 2.7875 8.1C3.3125 6.88333 4.025 5.825 4.925 4.925C5.825 4.025 6.88333 3.3125 8.1 2.7875C9.31667 2.2625 10.6167 2 12 2V4C9.76667 4 7.875 4.775 6.325 6.325C4.775 7.875 4 9.76667 4 12C4 14.2333 4.775 16.125 6.325 17.675C7.875 19.225 9.76667 20 12 20V22ZM12 14C11.45 14 10.9792 13.8042 10.5875 13.4125C10.1958 13.0208 10 12.55 10 12C10 11.9167 10.0042 11.8292 10.0125 11.7375C10.0208 11.6458 10.0417 11.5583 10.075 11.475L8 9.4L9.4 8L11.475 10.075C11.5417 10.0583 11.7167 10.0333 12 10C12.55 10 13.0208 10.1958 13.4125 10.5875C13.8042 10.9792 14 11.45 14 12C14 12.55 13.8042 13.0208 13.4125 13.4125C13.0208 13.8042 12.55 14 12 14Z",
|
|
1174
1176
|
fill: "currentColor"
|
|
1175
|
-
}, null, -1)),
|
|
1177
|
+
}, null, -1)), st = /* @__PURE__ */ k({
|
|
1176
1178
|
__name: "ResponseIcon",
|
|
1177
1179
|
props: {
|
|
1178
1180
|
/** The accessibility text provided to screen readers */
|
|
@@ -1241,14 +1243,14 @@ const _ = "24px", D = (e, r) => {
|
|
|
1241
1243
|
lineHeight: "0",
|
|
1242
1244
|
width: t.value
|
|
1243
1245
|
}));
|
|
1244
|
-
return (n, i) => (p(),
|
|
1246
|
+
return (n, i) => (p(), T(z(e.as), {
|
|
1245
1247
|
"aria-hidden": e.decorative ? "true" : void 0,
|
|
1246
1248
|
class: "kui-icon response-icon",
|
|
1247
1249
|
"data-testid": "kui-icon-wrapper-response-icon",
|
|
1248
|
-
style:
|
|
1250
|
+
style: A(a.value)
|
|
1249
1251
|
}, {
|
|
1250
|
-
default:
|
|
1251
|
-
(p(),
|
|
1252
|
+
default: V(() => [
|
|
1253
|
+
(p(), y("svg", {
|
|
1252
1254
|
"aria-hidden": e.decorative ? "true" : void 0,
|
|
1253
1255
|
"data-testid": "kui-icon-svg-response-icon",
|
|
1254
1256
|
fill: "none",
|
|
@@ -1258,14 +1260,14 @@ const _ = "24px", D = (e, r) => {
|
|
|
1258
1260
|
width: "100%",
|
|
1259
1261
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1260
1262
|
}, [
|
|
1261
|
-
e.title ? (p(),
|
|
1262
|
-
|
|
1263
|
+
e.title ? (p(), y("title", ot, R(e.title), 1)) : N("", !0),
|
|
1264
|
+
lt
|
|
1263
1265
|
], 8, at))
|
|
1264
1266
|
]),
|
|
1265
1267
|
_: 1
|
|
1266
1268
|
}, 8, ["aria-hidden", "style"]));
|
|
1267
1269
|
}
|
|
1268
|
-
}),
|
|
1270
|
+
}), ut = /* @__PURE__ */ D(st, [["__scopeId", "data-v-9ad4bd00"]]), dt = (e) => (L("data-v-aa775b0e"), e = e(), M(), e), ct = ["aria-hidden"], ft = {
|
|
1269
1271
|
key: 0,
|
|
1270
1272
|
"data-testid": "kui-icon-svg-title"
|
|
1271
1273
|
}, pt = /* @__PURE__ */ dt(() => /* @__PURE__ */ I("path", {
|
|
@@ -1340,14 +1342,14 @@ const _ = "24px", D = (e, r) => {
|
|
|
1340
1342
|
lineHeight: "0",
|
|
1341
1343
|
width: t.value
|
|
1342
1344
|
}));
|
|
1343
|
-
return (n, i) => (p(),
|
|
1345
|
+
return (n, i) => (p(), T(z(e.as), {
|
|
1344
1346
|
"aria-hidden": e.decorative ? "true" : void 0,
|
|
1345
1347
|
class: "kui-icon trend-down-icon",
|
|
1346
1348
|
"data-testid": "kui-icon-wrapper-trend-down-icon",
|
|
1347
|
-
style:
|
|
1349
|
+
style: A(a.value)
|
|
1348
1350
|
}, {
|
|
1349
|
-
default:
|
|
1350
|
-
(p(),
|
|
1351
|
+
default: V(() => [
|
|
1352
|
+
(p(), y("svg", {
|
|
1351
1353
|
"aria-hidden": e.decorative ? "true" : void 0,
|
|
1352
1354
|
"data-testid": "kui-icon-svg-trend-down-icon",
|
|
1353
1355
|
fill: "none",
|
|
@@ -1357,17 +1359,17 @@ const _ = "24px", D = (e, r) => {
|
|
|
1357
1359
|
width: "100%",
|
|
1358
1360
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1359
1361
|
}, [
|
|
1360
|
-
e.title ? (p(),
|
|
1362
|
+
e.title ? (p(), y("title", ft, R(e.title), 1)) : N("", !0),
|
|
1361
1363
|
pt
|
|
1362
1364
|
], 8, ct))
|
|
1363
1365
|
]),
|
|
1364
1366
|
_: 1
|
|
1365
1367
|
}, 8, ["aria-hidden", "style"]));
|
|
1366
1368
|
}
|
|
1367
|
-
}), gt = /* @__PURE__ */ D(vt, [["__scopeId", "data-v-aa775b0e"]]),
|
|
1369
|
+
}), gt = /* @__PURE__ */ D(vt, [["__scopeId", "data-v-aa775b0e"]]), yt = (e) => (L("data-v-cb010004"), e = e(), M(), e), mt = ["aria-hidden"], ht = {
|
|
1368
1370
|
key: 0,
|
|
1369
1371
|
"data-testid": "kui-icon-svg-title"
|
|
1370
|
-
}, Ct = /* @__PURE__ */
|
|
1372
|
+
}, Ct = /* @__PURE__ */ yt(() => /* @__PURE__ */ I("path", {
|
|
1371
1373
|
d: "M3.4 18L2 16.6L9.4 9.15L13.4 13.15L18.6 8H16V6H22V12H20V9.4L13.4 16L9.4 12L3.4 18Z",
|
|
1372
1374
|
fill: "currentColor"
|
|
1373
1375
|
}, null, -1)), bt = /* @__PURE__ */ k({
|
|
@@ -1439,14 +1441,14 @@ const _ = "24px", D = (e, r) => {
|
|
|
1439
1441
|
lineHeight: "0",
|
|
1440
1442
|
width: t.value
|
|
1441
1443
|
}));
|
|
1442
|
-
return (n, i) => (p(),
|
|
1444
|
+
return (n, i) => (p(), T(z(e.as), {
|
|
1443
1445
|
"aria-hidden": e.decorative ? "true" : void 0,
|
|
1444
1446
|
class: "kui-icon trend-up-icon",
|
|
1445
1447
|
"data-testid": "kui-icon-wrapper-trend-up-icon",
|
|
1446
|
-
style:
|
|
1448
|
+
style: A(a.value)
|
|
1447
1449
|
}, {
|
|
1448
|
-
default:
|
|
1449
|
-
(p(),
|
|
1450
|
+
default: V(() => [
|
|
1451
|
+
(p(), y("svg", {
|
|
1450
1452
|
"aria-hidden": e.decorative ? "true" : void 0,
|
|
1451
1453
|
"data-testid": "kui-icon-svg-trend-up-icon",
|
|
1452
1454
|
fill: "none",
|
|
@@ -1456,9 +1458,9 @@ const _ = "24px", D = (e, r) => {
|
|
|
1456
1458
|
width: "100%",
|
|
1457
1459
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1458
1460
|
}, [
|
|
1459
|
-
e.title ? (p(),
|
|
1461
|
+
e.title ? (p(), y("title", ht, R(e.title), 1)) : N("", !0),
|
|
1460
1462
|
Ct
|
|
1461
|
-
], 8,
|
|
1463
|
+
], 8, mt))
|
|
1462
1464
|
]),
|
|
1463
1465
|
_: 1
|
|
1464
1466
|
}, 8, ["aria-hidden", "style"]));
|
|
@@ -1469,7 +1471,7 @@ const _ = "24px", D = (e, r) => {
|
|
|
1469
1471
|
}, Nt = /* @__PURE__ */ wt(() => /* @__PURE__ */ I("path", {
|
|
1470
1472
|
d: "M9 20C8.68333 20 8.4 19.9083 8.15 19.725C7.9 19.5417 7.71667 19.3083 7.6 19.025L5.3 13H1V11H6.7L9 17.1L13.6 4.975C13.7167 4.69167 13.9 4.45833 14.15 4.275C14.4 4.09167 14.6833 4 15 4C15.3167 4 15.6 4.09167 15.85 4.275C16.1 4.45833 16.2833 4.69167 16.4 4.975L18.7 11H23V13H17.3L15 6.9L10.4 19.025C10.2833 19.3083 10.1 19.5417 9.85 19.725C9.6 19.9083 9.31667 20 9 20Z",
|
|
1471
1473
|
fill: "currentColor"
|
|
1472
|
-
}, null, -1)),
|
|
1474
|
+
}, null, -1)), Tt = /* @__PURE__ */ k({
|
|
1473
1475
|
__name: "VitalsIcon",
|
|
1474
1476
|
props: {
|
|
1475
1477
|
/** The accessibility text provided to screen readers */
|
|
@@ -1538,14 +1540,14 @@ const _ = "24px", D = (e, r) => {
|
|
|
1538
1540
|
lineHeight: "0",
|
|
1539
1541
|
width: t.value
|
|
1540
1542
|
}));
|
|
1541
|
-
return (n, i) => (p(),
|
|
1543
|
+
return (n, i) => (p(), T(z(e.as), {
|
|
1542
1544
|
"aria-hidden": e.decorative ? "true" : void 0,
|
|
1543
1545
|
class: "kui-icon vitals-icon",
|
|
1544
1546
|
"data-testid": "kui-icon-wrapper-vitals-icon",
|
|
1545
|
-
style:
|
|
1547
|
+
style: A(a.value)
|
|
1546
1548
|
}, {
|
|
1547
|
-
default:
|
|
1548
|
-
(p(),
|
|
1549
|
+
default: V(() => [
|
|
1550
|
+
(p(), y("svg", {
|
|
1549
1551
|
"aria-hidden": e.decorative ? "true" : void 0,
|
|
1550
1552
|
"data-testid": "kui-icon-svg-vitals-icon",
|
|
1551
1553
|
fill: "none",
|
|
@@ -1555,17 +1557,17 @@ const _ = "24px", D = (e, r) => {
|
|
|
1555
1557
|
width: "100%",
|
|
1556
1558
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1557
1559
|
}, [
|
|
1558
|
-
e.title ? (p(),
|
|
1560
|
+
e.title ? (p(), y("title", Rt, R(e.title), 1)) : N("", !0),
|
|
1559
1561
|
Nt
|
|
1560
1562
|
], 8, _t))
|
|
1561
1563
|
]),
|
|
1562
1564
|
_: 1
|
|
1563
1565
|
}, 8, ["aria-hidden", "style"]));
|
|
1564
1566
|
}
|
|
1565
|
-
}),
|
|
1567
|
+
}), Et = /* @__PURE__ */ D(Tt, [["__scopeId", "data-v-6d3b4073"]]), It = (e) => (L("data-v-0e9cc640"), e = e(), M(), e), xt = ["aria-hidden"], kt = {
|
|
1566
1568
|
key: 0,
|
|
1567
1569
|
"data-testid": "kui-icon-svg-title"
|
|
1568
|
-
}, qt = /* @__PURE__ */
|
|
1570
|
+
}, qt = /* @__PURE__ */ It(() => /* @__PURE__ */ I("path", {
|
|
1569
1571
|
d: "M12.0001 22.025C11.7334 22.025 11.4793 21.975 11.2376 21.875C10.9959 21.775 10.7751 21.6333 10.5751 21.45L2.5501 13.425C2.36676 13.225 2.2251 13.0041 2.1251 12.7625C2.0251 12.5208 1.9751 12.2666 1.9751 12C1.9751 11.7333 2.0251 11.475 2.1251 11.225C2.2251 10.975 2.36676 10.7583 2.5501 10.575L10.5751 2.54998C10.7751 2.34998 10.9959 2.20414 11.2376 2.11248C11.4793 2.02081 11.7334 1.97498 12.0001 1.97498C12.2668 1.97498 12.5251 2.02081 12.7751 2.11248C13.0251 2.20414 13.2418 2.34998 13.4251 2.54998L21.4501 10.575C21.6501 10.7583 21.7959 10.975 21.8876 11.225C21.9793 11.475 22.0251 11.7333 22.0251 12C22.0251 12.2666 21.9793 12.5208 21.8876 12.7625C21.7959 13.0041 21.6501 13.225 21.4501 13.425L13.4251 21.45C13.2418 21.6333 13.0251 21.775 12.7751 21.875C12.5251 21.975 12.2668 22.025 12.0001 22.025ZM12.0001 20.025L20.0251 12L12.0001 3.97498L3.9751 12L12.0001 20.025ZM11.0001 13H13.0001V6.99998H11.0001V13ZM12.0001 16C12.2834 16 12.5209 15.9041 12.7126 15.7125C12.9043 15.5208 13.0001 15.2833 13.0001 15C13.0001 14.7166 12.9043 14.4791 12.7126 14.2875C12.5209 14.0958 12.2834 14 12.0001 14C11.7168 14 11.4793 14.0958 11.2876 14.2875C11.0959 14.4791 11.0001 14.7166 11.0001 15C11.0001 15.2833 11.0959 15.5208 11.2876 15.7125C11.4793 15.9041 11.7168 16 12.0001 16Z",
|
|
1570
1572
|
fill: "currentColor"
|
|
1571
1573
|
}, null, -1)), zt = /* @__PURE__ */ k({
|
|
@@ -1637,14 +1639,14 @@ const _ = "24px", D = (e, r) => {
|
|
|
1637
1639
|
lineHeight: "0",
|
|
1638
1640
|
width: t.value
|
|
1639
1641
|
}));
|
|
1640
|
-
return (n, i) => (p(),
|
|
1642
|
+
return (n, i) => (p(), T(z(e.as), {
|
|
1641
1643
|
"aria-hidden": e.decorative ? "true" : void 0,
|
|
1642
1644
|
class: "kui-icon warning-outline-icon",
|
|
1643
1645
|
"data-testid": "kui-icon-wrapper-warning-outline-icon",
|
|
1644
|
-
style:
|
|
1646
|
+
style: A(a.value)
|
|
1645
1647
|
}, {
|
|
1646
|
-
default:
|
|
1647
|
-
(p(),
|
|
1648
|
+
default: V(() => [
|
|
1649
|
+
(p(), y("svg", {
|
|
1648
1650
|
"aria-hidden": e.decorative ? "true" : void 0,
|
|
1649
1651
|
"data-testid": "kui-icon-svg-warning-outline-icon",
|
|
1650
1652
|
fill: "none",
|
|
@@ -1654,17 +1656,17 @@ const _ = "24px", D = (e, r) => {
|
|
|
1654
1656
|
width: "100%",
|
|
1655
1657
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1656
1658
|
}, [
|
|
1657
|
-
e.title ? (p(),
|
|
1659
|
+
e.title ? (p(), y("title", kt, R(e.title), 1)) : N("", !0),
|
|
1658
1660
|
qt
|
|
1659
|
-
], 8,
|
|
1661
|
+
], 8, xt))
|
|
1660
1662
|
]),
|
|
1661
1663
|
_: 1
|
|
1662
1664
|
}, 8, ["aria-hidden", "style"]));
|
|
1663
1665
|
}
|
|
1664
|
-
}),
|
|
1666
|
+
}), Vt = /* @__PURE__ */ D(zt, [["__scopeId", "data-v-0e9cc640"]]), At = (e) => (L("data-v-d7b122fd"), e = e(), M(), e), Lt = ["aria-hidden"], Mt = {
|
|
1665
1667
|
key: 0,
|
|
1666
1668
|
"data-testid": "kui-icon-svg-title"
|
|
1667
|
-
}, Dt = /* @__PURE__ */
|
|
1669
|
+
}, Dt = /* @__PURE__ */ At(() => /* @__PURE__ */ I("path", {
|
|
1668
1670
|
d: "M12.025 22.05C11.7583 22.05 11.5042 22 11.2625 21.9C11.0208 21.8 10.8 21.6583 10.6 21.475L2.575 13.45C2.39167 13.25 2.25 13.0292 2.15 12.7875C2.05 12.5458 2 12.2917 2 12.025C2 11.7583 2.05 11.5 2.15 11.25C2.25 11 2.39167 10.7833 2.575 10.6L10.6 2.575C10.8 2.375 11.0208 2.22917 11.2625 2.1375C11.5042 2.04583 11.7583 2 12.025 2C12.2917 2 12.55 2.04583 12.8 2.1375C13.05 2.22917 13.2667 2.375 13.45 2.575L21.475 10.6C21.675 10.7833 21.8208 11 21.9125 11.25C22.0042 11.5 22.05 11.7583 22.05 12.025C22.05 12.2917 22.0042 12.5458 21.9125 12.7875C21.8208 13.0292 21.675 13.25 21.475 13.45L13.45 21.475C13.2667 21.6583 13.05 21.8 12.8 21.9C12.55 22 12.2917 22.05 12.025 22.05ZM11.025 13.025H13.025V7.025H11.025V13.025ZM12.025 16.025C12.3083 16.025 12.5458 15.9292 12.7375 15.7375C12.9292 15.5458 13.025 15.3083 13.025 15.025C13.025 14.7417 12.9292 14.5042 12.7375 14.3125C12.5458 14.1208 12.3083 14.025 12.025 14.025C11.7417 14.025 11.5042 14.1208 11.3125 14.3125C11.1208 14.5042 11.025 14.7417 11.025 15.025C11.025 15.3083 11.1208 15.5458 11.3125 15.7375C11.5042 15.9292 11.7417 16.025 12.025 16.025Z",
|
|
1669
1671
|
fill: "currentColor"
|
|
1670
1672
|
}, null, -1)), Ot = /* @__PURE__ */ k({
|
|
@@ -1736,14 +1738,14 @@ const _ = "24px", D = (e, r) => {
|
|
|
1736
1738
|
lineHeight: "0",
|
|
1737
1739
|
width: t.value
|
|
1738
1740
|
}));
|
|
1739
|
-
return (n, i) => (p(),
|
|
1741
|
+
return (n, i) => (p(), T(z(e.as), {
|
|
1740
1742
|
"aria-hidden": e.decorative ? "true" : void 0,
|
|
1741
1743
|
class: "kui-icon warning-icon",
|
|
1742
1744
|
"data-testid": "kui-icon-wrapper-warning-icon",
|
|
1743
|
-
style:
|
|
1745
|
+
style: A(a.value)
|
|
1744
1746
|
}, {
|
|
1745
|
-
default:
|
|
1746
|
-
(p(),
|
|
1747
|
+
default: V(() => [
|
|
1748
|
+
(p(), y("svg", {
|
|
1747
1749
|
"aria-hidden": e.decorative ? "true" : void 0,
|
|
1748
1750
|
"data-testid": "kui-icon-svg-warning-icon",
|
|
1749
1751
|
fill: "none",
|
|
@@ -1753,31 +1755,31 @@ const _ = "24px", D = (e, r) => {
|
|
|
1753
1755
|
width: "100%",
|
|
1754
1756
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1755
1757
|
}, [
|
|
1756
|
-
e.title ? (p(),
|
|
1758
|
+
e.title ? (p(), y("title", Mt, R(e.title), 1)) : N("", !0),
|
|
1757
1759
|
Dt
|
|
1758
1760
|
], 8, Lt))
|
|
1759
1761
|
]),
|
|
1760
1762
|
_: 1
|
|
1761
1763
|
}, 8, ["aria-hidden", "style"]));
|
|
1762
1764
|
}
|
|
1763
|
-
}), Oe = /* @__PURE__ */ D(Ot, [["__scopeId", "data-v-d7b122fd"]]), ge = 2,
|
|
1764
|
-
let a = !r || Number(e.toFixed(
|
|
1765
|
+
}), Oe = /* @__PURE__ */ D(Ot, [["__scopeId", "data-v-d7b122fd"]]), ge = 2, Te = ge + 2, Ft = (e, r, t = !1) => {
|
|
1766
|
+
let a = !r || Number(e.toFixed(Te)) === 0 ? 0 : Number(e.toFixed(Te)) > 0 ? 1 : -1;
|
|
1765
1767
|
return t && (a *= -1), a;
|
|
1766
|
-
}, Ht = (e, r, t) => r ? `${Math.abs(e * 100).toFixed(ge)}%` : t, Bt = (e, r) => r === 0 ? 0 : e / r - 1, $t = (e, r = !1) => (r && (e *= -1), e > 0 ? St : e < 0 ? gt : De), Pt = "#ad000e", fe = "#6c7489",
|
|
1768
|
+
}, Ht = (e, r, t) => r ? `${Math.abs(e * 100).toFixed(ge)}%` : t, Bt = (e, r) => r === 0 ? 0 : e / r - 1, $t = (e, r = !1) => (r && (e *= -1), e > 0 ? St : e < 0 ? gt : De), Pt = "#ad000e", fe = "#6c7489", Ee = "#52596e", Kt = "#007d60", J = "16px", Zt = "20px";
|
|
1767
1769
|
var F = /* @__PURE__ */ ((e) => (e.GENERIC_COUNT = "GenericCount", e.TRAFFIC = "Traffic", e.ERROR_RATE = "ErrorRate", e.LATENCY = "Latency", e))(F || {});
|
|
1768
|
-
const
|
|
1770
|
+
const Ut = { class: "metricscard" }, Gt = {
|
|
1769
1771
|
key: 0,
|
|
1770
1772
|
class: "metricscard-description"
|
|
1771
|
-
},
|
|
1773
|
+
}, jt = {
|
|
1772
1774
|
key: 0,
|
|
1773
1775
|
class: "metricscard-error"
|
|
1774
|
-
},
|
|
1776
|
+
}, Yt = {
|
|
1775
1777
|
key: 2,
|
|
1776
1778
|
class: "metricscard-trend"
|
|
1777
|
-
},
|
|
1779
|
+
}, Xt = { "data-testid": "metric-trend-change" }, Qt = {
|
|
1778
1780
|
key: 0,
|
|
1779
1781
|
class: "metricscard-trend-range"
|
|
1780
|
-
},
|
|
1782
|
+
}, Wt = /* @__PURE__ */ k({
|
|
1781
1783
|
__name: "MetricsCard",
|
|
1782
1784
|
props: {
|
|
1783
1785
|
cardType: {
|
|
@@ -1836,7 +1838,12 @@ const Yt = { class: "metricscard" }, Xt = {
|
|
|
1836
1838
|
cardSize: {
|
|
1837
1839
|
type: String,
|
|
1838
1840
|
required: !1,
|
|
1839
|
-
default: () =>
|
|
1841
|
+
default: () => q.Large
|
|
1842
|
+
},
|
|
1843
|
+
hasContainerTitle: {
|
|
1844
|
+
type: Boolean,
|
|
1845
|
+
required: !1,
|
|
1846
|
+
default: !1
|
|
1840
1847
|
},
|
|
1841
1848
|
titleTag: {
|
|
1842
1849
|
type: String,
|
|
@@ -1845,111 +1852,116 @@ const Yt = { class: "metricscard" }, Xt = {
|
|
|
1845
1852
|
},
|
|
1846
1853
|
setup(e) {
|
|
1847
1854
|
const r = /* @__PURE__ */ new Map([
|
|
1848
|
-
[F.GENERIC_COUNT,
|
|
1855
|
+
[F.GENERIC_COUNT, Et],
|
|
1849
1856
|
[F.TRAFFIC, Hr],
|
|
1850
|
-
[F.ERROR_RATE,
|
|
1851
|
-
[F.LATENCY,
|
|
1852
|
-
]), t = e, a = (
|
|
1853
|
-
const
|
|
1857
|
+
[F.ERROR_RATE, Vt],
|
|
1858
|
+
[F.LATENCY, ut]
|
|
1859
|
+
]), t = e, a = (c) => {
|
|
1860
|
+
const o = {
|
|
1854
1861
|
red: `var(--kong-ui-metric-card-trend-negative, ${Pt})`,
|
|
1855
1862
|
green: `var(--kong-ui-metric-card-trend-positive, ${Kt})`,
|
|
1856
|
-
grey: `var(--kong-ui-metric-card-trend-neutral, ${
|
|
1863
|
+
grey: `var(--kong-ui-metric-card-trend-neutral, ${Ee})`
|
|
1857
1864
|
};
|
|
1858
|
-
return
|
|
1859
|
-
}, n = (
|
|
1860
|
-
return (
|
|
1865
|
+
return c > 0 ? o.green : c < 0 ? o.red : o.grey;
|
|
1866
|
+
}, n = (c) => c > 0 ? "positive" : c < 0 ? "negative" : "neutral", i = [q.Medium, q.Large, q.LargeCompact].includes(t.cardSize), s = g(() => t.cardSize === q.LargeCompact), f = [q.Small, q.LargeCompact].includes(t.cardSize);
|
|
1867
|
+
return (c, o) => {
|
|
1861
1868
|
const l = qe("KTooltip");
|
|
1862
|
-
return p(),
|
|
1869
|
+
return p(), y("div", Ut, [
|
|
1863
1870
|
I("div", {
|
|
1864
1871
|
class: G(["metricscard-title", e.cardSize])
|
|
1865
1872
|
}, [
|
|
1866
|
-
w(f) ?
|
|
1873
|
+
w(f) ? N("", !0) : (p(), T(z(w(r).get(e.cardType)), {
|
|
1867
1874
|
key: 0,
|
|
1868
1875
|
class: "metricscard-icon",
|
|
1869
1876
|
color: w(fe),
|
|
1870
1877
|
size: w(J)
|
|
1871
1878
|
}, null, 8, ["color", "size"])),
|
|
1872
|
-
(p(),
|
|
1873
|
-
default:
|
|
1879
|
+
(p(), T(z(e.titleTag), null, {
|
|
1880
|
+
default: V(() => [
|
|
1874
1881
|
Ye(R(e.title), 1)
|
|
1875
1882
|
]),
|
|
1876
1883
|
_: 1
|
|
1877
1884
|
})),
|
|
1878
|
-
e.tooltip ? (p(),
|
|
1885
|
+
e.tooltip ? (p(), T(l, {
|
|
1879
1886
|
key: 1,
|
|
1880
1887
|
class: "metricscard-tooltip",
|
|
1881
1888
|
placement: "right",
|
|
1882
1889
|
text: e.tooltip
|
|
1883
1890
|
}, {
|
|
1884
|
-
default:
|
|
1891
|
+
default: V(() => [
|
|
1885
1892
|
Y(w(it), {
|
|
1886
1893
|
color: w(fe),
|
|
1887
1894
|
size: w(J)
|
|
1888
1895
|
}, null, 8, ["color", "size"])
|
|
1889
1896
|
]),
|
|
1890
1897
|
_: 1
|
|
1891
|
-
}, 8, ["text"])) :
|
|
1898
|
+
}, 8, ["text"])) : N("", !0)
|
|
1892
1899
|
], 2),
|
|
1893
|
-
e.description && w(i) && !
|
|
1900
|
+
e.description && w(i) && !s.value ? (p(), y("div", Gt, [
|
|
1894
1901
|
I("span", null, R(e.description), 1)
|
|
1895
|
-
])) :
|
|
1902
|
+
])) : N("", !0),
|
|
1896
1903
|
I("div", {
|
|
1897
|
-
class: G(["metricscard-valuetrend", { "is-compact":
|
|
1904
|
+
class: G(["metricscard-valuetrend", { "is-compact": s.value }])
|
|
1898
1905
|
}, [
|
|
1899
|
-
e.hasError ? (p(),
|
|
1906
|
+
e.hasError ? (p(), y("div", jt, [
|
|
1900
1907
|
Y(w(Oe), {
|
|
1901
1908
|
color: w(fe),
|
|
1902
1909
|
size: w(Zt)
|
|
1903
1910
|
}, null, 8, ["color", "size"]),
|
|
1904
1911
|
I("div", null, " " + R(e.errorMessage), 1)
|
|
1905
|
-
])) : (p(),
|
|
1912
|
+
])) : (p(), y("div", {
|
|
1906
1913
|
key: 1,
|
|
1907
1914
|
class: G(["metricscard-value", e.cardSize]),
|
|
1908
|
-
"data-testid": "metric-value"
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
w(i) ? (p(), m("div", Wt, [
|
|
1915
|
+
"data-testid": "metric-value"
|
|
1916
|
+
}, R(e.metricValue), 3)),
|
|
1917
|
+
w(i) ? (p(), y("div", Yt, [
|
|
1912
1918
|
I("div", {
|
|
1913
1919
|
class: G(["metricscard-trend-change", n(e.changePolarity)]),
|
|
1914
1920
|
"data-testid": "metric-trend-parent"
|
|
1915
1921
|
}, [
|
|
1916
|
-
e.changePolarity !== 0 ? (p(),
|
|
1922
|
+
e.changePolarity !== 0 ? (p(), T(z(e.trendIcon), {
|
|
1917
1923
|
key: 0,
|
|
1918
1924
|
color: a(e.changePolarity),
|
|
1919
1925
|
size: w(J)
|
|
1920
|
-
}, null, 8, ["color", "size"])) : (p(),
|
|
1926
|
+
}, null, 8, ["color", "size"])) : (p(), T(w(Ur), {
|
|
1921
1927
|
key: 1,
|
|
1922
|
-
color: w(
|
|
1928
|
+
color: w(Ee),
|
|
1923
1929
|
size: w(J)
|
|
1924
1930
|
}, null, 8, ["color", "size"])),
|
|
1925
|
-
I("div",
|
|
1931
|
+
I("div", Xt, R(e.metricChange), 1)
|
|
1926
1932
|
], 2),
|
|
1927
|
-
e.trendRange && e.cardSize !== w(
|
|
1928
|
-
])) :
|
|
1933
|
+
e.trendRange && e.cardSize !== w(q).LargeCompact ? (p(), y("div", Qt, R(e.trendRange), 1)) : N("", !0)
|
|
1934
|
+
])) : N("", !0)
|
|
1929
1935
|
], 2)
|
|
1930
1936
|
]);
|
|
1931
1937
|
};
|
|
1932
1938
|
}
|
|
1933
|
-
}),
|
|
1939
|
+
}), ye = (e, r) => {
|
|
1934
1940
|
const t = e.__vccOpts || e;
|
|
1935
1941
|
for (const [a, n] of r)
|
|
1936
1942
|
t[a] = n;
|
|
1937
1943
|
return t;
|
|
1938
|
-
},
|
|
1939
|
-
function
|
|
1944
|
+
}, Jt = /* @__PURE__ */ ye(Wt, [["__scopeId", "data-v-bb9e718a"]]), ei = {}, ri = { class: "loading-tabs" };
|
|
1945
|
+
function ti(e, r) {
|
|
1940
1946
|
const t = qe("KSkeletonBox");
|
|
1941
|
-
return p(),
|
|
1947
|
+
return p(), y("div", ri, [
|
|
1942
1948
|
Y(t, { width: "100" }),
|
|
1943
1949
|
Y(t, { width: "75" })
|
|
1944
1950
|
]);
|
|
1945
1951
|
}
|
|
1946
|
-
const
|
|
1952
|
+
const ii = /* @__PURE__ */ ye(ei, [["render", ti], ["__scopeId", "data-v-f7eb9c40"]]), ni = {
|
|
1947
1953
|
key: 0,
|
|
1954
|
+
class: "container-title"
|
|
1955
|
+
}, ai = {
|
|
1956
|
+
key: 1,
|
|
1948
1957
|
class: "error-display"
|
|
1949
|
-
},
|
|
1958
|
+
}, oi = {
|
|
1950
1959
|
key: 0,
|
|
1951
1960
|
class: "error-display-message"
|
|
1952
|
-
}, li =
|
|
1961
|
+
}, li = {
|
|
1962
|
+
key: 2,
|
|
1963
|
+
class: "cards-wrapper"
|
|
1964
|
+
}, si = /* @__PURE__ */ k({
|
|
1953
1965
|
__name: "MetricCardContainer",
|
|
1954
1966
|
props: {
|
|
1955
1967
|
fallbackDisplayText: {
|
|
@@ -1978,56 +1990,65 @@ const oi = /* @__PURE__ */ me(ii, [["render", ai], ["__scopeId", "data-v-f7eb9c4
|
|
|
1978
1990
|
cardSize: {
|
|
1979
1991
|
type: String,
|
|
1980
1992
|
required: !1,
|
|
1981
|
-
default: () =>
|
|
1993
|
+
default: () => q.Large
|
|
1994
|
+
},
|
|
1995
|
+
containerTitle: {
|
|
1996
|
+
type: String,
|
|
1997
|
+
required: !1,
|
|
1998
|
+
default: ""
|
|
1982
1999
|
}
|
|
1983
2000
|
},
|
|
1984
2001
|
setup(e) {
|
|
1985
2002
|
const r = e, t = g(() => r.cards.every((n) => (n == null ? void 0 : n.hasError) === !0)), a = (n) => {
|
|
1986
|
-
const i = Bt(n.currentValue, n.previousValue) || 0,
|
|
2003
|
+
const i = Bt(n.currentValue, n.previousValue) || 0, s = Ft(i, r.hasTrendAccess, n.increaseIsBad);
|
|
1987
2004
|
return {
|
|
1988
|
-
metricValue: n.formatValueFn ? n.formatValueFn(n.currentValue) :
|
|
2005
|
+
metricValue: n.formatValueFn ? n.formatValueFn(n.currentValue) : Ar(n.currentValue, { capital: !0, round: !0 }) || "0",
|
|
1989
2006
|
metricChange: n.formatChangeFn ? n.formatChangeFn(i) : Ht(i, r.hasTrendAccess, r.fallbackDisplayText),
|
|
1990
|
-
changePolarity:
|
|
1991
|
-
trendIcon: $t(
|
|
1992
|
-
cardSize: r.cardSize
|
|
2007
|
+
changePolarity: s,
|
|
2008
|
+
trendIcon: $t(s, n.increaseIsBad),
|
|
2009
|
+
cardSize: r.cardSize,
|
|
2010
|
+
hasContainerTitle: !!r.containerTitle
|
|
1993
2011
|
};
|
|
1994
2012
|
};
|
|
1995
|
-
return (n, i) => (p(),
|
|
2013
|
+
return (n, i) => (p(), y("div", {
|
|
1996
2014
|
class: G(["kong-ui-public-metric-card-container", e.cardSize])
|
|
1997
2015
|
}, [
|
|
1998
|
-
|
|
2016
|
+
r.containerTitle ? (p(), y("div", ni, R(r.containerTitle), 1)) : N("", !0),
|
|
2017
|
+
t.value ? (p(), y("div", ai, [
|
|
1999
2018
|
Y(w(Oe), { class: "error-display-icon" }),
|
|
2000
|
-
e.errorMessage ? (p(),
|
|
2001
|
-
])) : (p(
|
|
2002
|
-
e.
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
"
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2019
|
+
e.errorMessage ? (p(), y("div", oi, R(e.errorMessage), 1)) : N("", !0)
|
|
2020
|
+
])) : (p(), y("div", li, [
|
|
2021
|
+
(p(!0), y(Se, null, Xe(e.cards, (s, f) => (p(), y(Se, null, [
|
|
2022
|
+
e.loading ? (p(), T(ii, {
|
|
2023
|
+
key: `skeleton-${f}`,
|
|
2024
|
+
class: G(e.cardSize === w(q).Small ? "loading-tabs-small" : "loading-tabs-large")
|
|
2025
|
+
}, null, 8, ["class"])) : (p(), T(Jt, Qe({ key: f }, a(s), {
|
|
2026
|
+
"card-size": e.cardSize,
|
|
2027
|
+
"card-type": s.cardType,
|
|
2028
|
+
description: s.description,
|
|
2029
|
+
"error-message": e.errorMessage,
|
|
2030
|
+
"has-error": s.hasError,
|
|
2031
|
+
title: s.title,
|
|
2032
|
+
"title-tag": s.titleTag,
|
|
2033
|
+
tooltip: s.tooltip,
|
|
2034
|
+
"trend-range": s.trendRange
|
|
2035
|
+
}), null, 16, ["card-size", "card-type", "description", "error-message", "has-error", "title", "title-tag", "tooltip", "trend-range"]))
|
|
2036
|
+
], 64))), 256))
|
|
2037
|
+
]))
|
|
2017
2038
|
], 2));
|
|
2018
2039
|
}
|
|
2019
|
-
}),
|
|
2040
|
+
}), ui = /* @__PURE__ */ ye(si, [["__scopeId", "data-v-0483795d"]]), yi = /* @__PURE__ */ k({
|
|
2020
2041
|
__name: "MetricsConsumer",
|
|
2021
2042
|
props: {
|
|
2022
2043
|
lookupKey: { default: void 0 },
|
|
2023
|
-
cardSize: { default:
|
|
2044
|
+
cardSize: { default: q.Large },
|
|
2024
2045
|
cardToDisplay: { default: void 0 }
|
|
2025
2046
|
},
|
|
2026
2047
|
setup(e) {
|
|
2027
|
-
const r = e, t =
|
|
2048
|
+
const r = e, t = xe(Le);
|
|
2028
2049
|
if (!t)
|
|
2029
2050
|
throw new Error("MetricsConsumer must be nested inside a MetricsProvider instance.");
|
|
2030
|
-
const { traffic: a, latency: n } = t.data, { i18n: i } = K.useI18n(),
|
|
2051
|
+
const { traffic: a, latency: n } = t.data, { i18n: i } = K.useI18n(), s = K.useMetricCardBuilder({
|
|
2031
2052
|
cardType: F.TRAFFIC,
|
|
2032
2053
|
title: g(() => t.longCardTitles ? i.t("metricCard.long.traffic") : i.t("metricCard.short.traffic")),
|
|
2033
2054
|
description: t.description,
|
|
@@ -2036,20 +2057,20 @@ const oi = /* @__PURE__ */ me(ii, [["render", ai], ["__scopeId", "data-v-f7eb9c4
|
|
|
2036
2057
|
lookupKey: r.lookupKey,
|
|
2037
2058
|
sumGroupedValues: Q,
|
|
2038
2059
|
trendRange: a.trendRange
|
|
2039
|
-
}),
|
|
2040
|
-
const
|
|
2060
|
+
}), f = (m) => `${m.toFixed(ge)}%`, c = g(() => {
|
|
2061
|
+
const m = a.mapped.value, h = j(m, "current", r.lookupKey, we), x = j(m, "current", r.lookupKey, Q), S = h / x * 100 || 0, C = j(m, "previous", r.lookupKey, we), H = j(m, "previous", r.lookupKey, Q), E = C / H * 100 || 0;
|
|
2041
2062
|
return {
|
|
2042
2063
|
cardType: F.ERROR_RATE,
|
|
2043
2064
|
hasError: a.hasError.value,
|
|
2044
2065
|
currentValue: S,
|
|
2045
2066
|
previousValue: E,
|
|
2046
|
-
formatValueFn:
|
|
2067
|
+
formatValueFn: f,
|
|
2047
2068
|
title: t.longCardTitles ? i.t("metricCard.long.errorRate") : i.t("metricCard.short.errorRate"),
|
|
2048
2069
|
description: t.description,
|
|
2049
2070
|
increaseIsBad: !0,
|
|
2050
2071
|
trendRange: a.trendRange.value
|
|
2051
2072
|
};
|
|
2052
|
-
}), o = (
|
|
2073
|
+
}), o = (m) => `${m}ms`, l = K.useMetricCardBuilder({
|
|
2053
2074
|
cardType: F.LATENCY,
|
|
2054
2075
|
title: g(() => t.longCardTitles ? i.t("metricCard.long.latency") : i.t("metricCard.short.latency")),
|
|
2055
2076
|
description: t.description,
|
|
@@ -2059,60 +2080,62 @@ const oi = /* @__PURE__ */ me(ii, [["render", ai], ["__scopeId", "data-v-f7eb9c4
|
|
|
2059
2080
|
increaseIsBad: !0,
|
|
2060
2081
|
formatValueFn: o,
|
|
2061
2082
|
trendRange: n.trendRange
|
|
2062
|
-
}),
|
|
2063
|
-
cards:
|
|
2083
|
+
}), u = g(() => r.cardToDisplay === "TRAFFIC" ? [s.value] : r.cardToDisplay === "ERROR_RATE" ? [c.value] : r.cardToDisplay === "LATENCY" ? [l.value] : [s.value, c.value, l.value]), d = g(() => r.cardToDisplay === "TRAFFIC" || r.cardToDisplay === "ERROR_RATE" ? a.isLoading.value : r.cardToDisplay === "LATENCY" ? n.isLoading.value : a.isLoading.value || n.isLoading.value), v = g(() => ({
|
|
2084
|
+
cards: u.value,
|
|
2085
|
+
containerTitle: t.containerTitle,
|
|
2064
2086
|
loading: d.value,
|
|
2065
2087
|
hasTrendAccess: t.hasTrendAccess.value,
|
|
2066
2088
|
fallbackDisplayText: i.t("general.notAvailable"),
|
|
2067
|
-
|
|
2089
|
+
// If the parent container has a title, we enforce a Medium card size; otherwise, pass down provided cardSize
|
|
2090
|
+
cardSize: t.containerTitle ? q.Medium : r.cardSize,
|
|
2068
2091
|
hideTitle: !0
|
|
2069
2092
|
})), b = g(() => ({
|
|
2070
2093
|
loading: v.value.loading,
|
|
2071
|
-
trafficCard:
|
|
2072
|
-
errorRateCard:
|
|
2073
|
-
latencyCard:
|
|
2074
|
-
errorRateFormatted: c
|
|
2075
|
-
latencyFormatted: o(
|
|
2094
|
+
trafficCard: s.value,
|
|
2095
|
+
errorRateCard: c.value,
|
|
2096
|
+
latencyCard: l.value,
|
|
2097
|
+
errorRateFormatted: f(c.value.currentValue),
|
|
2098
|
+
latencyFormatted: o(l.value.currentValue)
|
|
2076
2099
|
}));
|
|
2077
|
-
return (
|
|
2078
|
-
Y(w(
|
|
2100
|
+
return (m, h) => ke(m.$slots, "default", { cardValues: b.value }, () => [
|
|
2101
|
+
Y(w(ui), We(Je(v.value)), null, 16)
|
|
2079
2102
|
]);
|
|
2080
2103
|
}
|
|
2081
|
-
}), ee = (e) => new Date(e),
|
|
2104
|
+
}), ee = (e) => new Date(e), mi = (e, r) => {
|
|
2082
2105
|
const t = e.body;
|
|
2083
2106
|
e.reply({
|
|
2084
2107
|
statusCode: 200,
|
|
2085
|
-
body:
|
|
2108
|
+
body: di(t, r)
|
|
2086
2109
|
});
|
|
2087
|
-
},
|
|
2088
|
-
var b,
|
|
2089
|
-
const t = re.get(te.ONE_DAY), a = e.granularity === "trend" ? new rr(t) : new tr(t), n = a.endMs(), i = a.startMs(),
|
|
2110
|
+
}, Ie = (e) => e.reduce((r, t) => (r[t] = { name: t }, r), {}), di = (e, r) => {
|
|
2111
|
+
var b, m;
|
|
2112
|
+
const t = re.get(te.ONE_DAY), a = e.granularity === "trend" ? new rr(t) : new tr(t), n = a.endMs(), i = a.startMs(), s = a.granularityMs(), f = e.granularity === "trend" ? 2 : 1;
|
|
2090
2113
|
if ((e.dimensions ?? []).length > 2)
|
|
2091
2114
|
throw new Error(`Explore only supports 0-2 dimensions; got: ${JSON.stringify(e.dimensions)}`);
|
|
2092
|
-
const
|
|
2093
|
-
for (let h = 0; h <
|
|
2094
|
-
for (let
|
|
2095
|
-
const S =
|
|
2115
|
+
const c = (e.dimensions ?? []).find((h) => h !== "time"), o = (r == null ? void 0 : r.dimensionNames) ?? [], l = Math.max(o.length, 1), u = e.metrics || [], d = [];
|
|
2116
|
+
for (let h = 0; h < f; h++)
|
|
2117
|
+
for (let x = 0; x < l; x++) {
|
|
2118
|
+
const S = c ? { [c]: o[x] } : {};
|
|
2096
2119
|
(b = e.dimensions) != null && b.includes("status_code_grouped") ? Q.forEach((C) => {
|
|
2097
|
-
const H =
|
|
2120
|
+
const H = u.reduce((E, $) => (E[$] = (f - h) * 1e3 + 100 * x + 1, E), { ...S, status_code_grouped: C });
|
|
2098
2121
|
d.push({
|
|
2099
2122
|
version: "v1",
|
|
2100
|
-
timestamp: h === 0 ? ee(i).toISOString() : ee(i +
|
|
2123
|
+
timestamp: h === 0 ? ee(i).toISOString() : ee(i + s).toISOString(),
|
|
2101
2124
|
event: H
|
|
2102
2125
|
});
|
|
2103
2126
|
}) : d.push({
|
|
2104
2127
|
version: "v1",
|
|
2105
|
-
timestamp: h === 0 ? ee(i).toISOString() : ee(i +
|
|
2106
|
-
event:
|
|
2128
|
+
timestamp: h === 0 ? ee(i).toISOString() : ee(i + s).toISOString(),
|
|
2129
|
+
event: u.reduce((C, H) => (C[H] = (f - h) * 1e3 + 100 * x + 1, C), { ...S })
|
|
2107
2130
|
});
|
|
2108
2131
|
}
|
|
2109
2132
|
const v = {
|
|
2110
2133
|
start_ms: i,
|
|
2111
2134
|
end_ms: n,
|
|
2112
|
-
granularity_ms:
|
|
2113
|
-
display:
|
|
2114
|
-
[
|
|
2115
|
-
...(
|
|
2135
|
+
granularity_ms: s,
|
|
2136
|
+
display: c ? {
|
|
2137
|
+
[c]: Ie(o),
|
|
2138
|
+
...(m = e.dimensions) != null && m.includes("status_code_grouped") ? { status_code_grouped: Ie(Q) } : {}
|
|
2116
2139
|
} : {},
|
|
2117
2140
|
metric_names: e.metrics,
|
|
2118
2141
|
query_id: "test"
|
|
@@ -2124,7 +2147,7 @@ const oi = /* @__PURE__ */ me(ii, [["render", ai], ["__scopeId", "data-v-f7eb9c4
|
|
|
2124
2147
|
};
|
|
2125
2148
|
export {
|
|
2126
2149
|
yi as MetricsConsumer,
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2150
|
+
gi as MetricsProviderInternal,
|
|
2151
|
+
di as mockExploreResponse,
|
|
2152
|
+
mi as mockExploreResponseFromCypress
|
|
2130
2153
|
};
|