@kong-ui-public/dashboard-renderer 0.23.34 → 0.23.35
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/dashboard-renderer.es.js +128 -132
- package/dist/dashboard-renderer.umd.js +4 -4
- package/package.json +5 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ref as v, watchEffect as Ve, defineComponent as E, inject as ie, onUnmounted as Se, computed as g, resolveComponent as
|
|
2
|
-
import { ChartMetricDisplay as tt, ChartTypesSimple as rt, SimpleChart as nt, ChartTypes as re, AnalyticsChart as
|
|
1
|
+
import { ref as v, watchEffect as Ve, defineComponent as E, inject as ie, onUnmounted as Se, computed as g, resolveComponent as F, unref as m, openBlock as h, createBlock as A, withCtx as x, createTextVNode as ke, toDisplayString as K, renderSlot as ae, createCommentVNode as M, useCssVars as G, createElementVNode as V, createVNode as N, createElementBlock as C, normalizeProps as xe, guardReactiveProps as Be, withModifiers as Me, watch as He, resolveDynamicComponent as Te, normalizeStyle as te, pushScopeId as Ge, popScopeId as Ye, createSlots as We, mergeProps as Ze, onMounted as Qe, Fragment as Je, renderList as Xe, normalizeClass as et } from "vue";
|
|
2
|
+
import { ChartMetricDisplay as tt, ChartTypesSimple as rt, SimpleChart as nt, ChartTypes as re, AnalyticsChart as Ie, TopNTable as it } from "@kong-ui-public/analytics-chart";
|
|
3
3
|
import at from "swrv";
|
|
4
4
|
import ce from "axios";
|
|
5
5
|
import { createI18n as Ae, i18nTComponent as Ce } from "@kong-ui-public/i18n";
|
|
@@ -9,7 +9,7 @@ import "@kong/kongponents";
|
|
|
9
9
|
import "vue-router";
|
|
10
10
|
import { useAnalyticsConfigStore as ut } from "@kong-ui-public/analytics-config-store";
|
|
11
11
|
const Z = 170, Ee = "analytics-query-provider", ue = "{entity-id}", pt = "{cp-id}", dt = "{timeframe}", yt = 30 * 1e3;
|
|
12
|
-
var
|
|
12
|
+
var I = /* @__PURE__ */ ((e) => (e.HorizontalBar = "horizontal_bar", e.VerticalBar = "vertical_bar", e.Gauge = "gauge", e.TimeseriesLine = "timeseries_line", e.GoldenSignals = "golden_signals", e.TopN = "top_n", e.Slottable = "slottable", e))(I || {});
|
|
13
13
|
const Q = {
|
|
14
14
|
type: "string"
|
|
15
15
|
}, Y = {
|
|
@@ -348,7 +348,7 @@ const Q = {
|
|
|
348
348
|
}, xt = {
|
|
349
349
|
// TODO: Build out basic as its own schema.
|
|
350
350
|
oneOf: [kt]
|
|
351
|
-
},
|
|
351
|
+
}, Tt = {
|
|
352
352
|
type: "object",
|
|
353
353
|
properties: {
|
|
354
354
|
query: xt,
|
|
@@ -358,7 +358,7 @@ const Q = {
|
|
|
358
358
|
},
|
|
359
359
|
required: ["query", "chart"],
|
|
360
360
|
additionalProperties: !1
|
|
361
|
-
},
|
|
361
|
+
}, It = {
|
|
362
362
|
type: "object",
|
|
363
363
|
properties: {
|
|
364
364
|
position: {
|
|
@@ -398,8 +398,8 @@ const Q = {
|
|
|
398
398
|
}, At = {
|
|
399
399
|
type: "object",
|
|
400
400
|
properties: {
|
|
401
|
-
definition:
|
|
402
|
-
layout:
|
|
401
|
+
definition: Tt,
|
|
402
|
+
layout: It
|
|
403
403
|
},
|
|
404
404
|
required: ["definition", "layout"],
|
|
405
405
|
additionalProperties: !1
|
|
@@ -511,7 +511,7 @@ const Re = {
|
|
|
511
511
|
Se(() => {
|
|
512
512
|
s.abort();
|
|
513
513
|
});
|
|
514
|
-
const { data: u, error:
|
|
514
|
+
const { data: u, error: l, isValidating: d } = at(o, async () => {
|
|
515
515
|
var O, R, $, f;
|
|
516
516
|
try {
|
|
517
517
|
const _ = [];
|
|
@@ -541,9 +541,9 @@ const Re = {
|
|
|
541
541
|
}, {
|
|
542
542
|
refreshInterval: r.context.refreshInterval,
|
|
543
543
|
revalidateOnFocus: !1
|
|
544
|
-
}), { state:
|
|
544
|
+
}), { state: c, swrvState: y } = Et(u, l, d), p = v(null), w = g(() => c.value === y.ERROR || !!p.value), q = g(() => !r.queryReady || c.value === y.PENDING);
|
|
545
545
|
return (O, R) => {
|
|
546
|
-
const $ =
|
|
546
|
+
const $ = F("KSkeleton"), f = F("KEmptyState");
|
|
547
547
|
return q.value || !m(u) && !w.value ? (h(), A($, {
|
|
548
548
|
key: 0,
|
|
549
549
|
class: "chart-skeleton",
|
|
@@ -578,7 +578,7 @@ const Re = {
|
|
|
578
578
|
"8c62ff26": `${n.height}px`
|
|
579
579
|
}));
|
|
580
580
|
const t = e, r = {
|
|
581
|
-
[
|
|
581
|
+
[I.Gauge]: rt.GAUGE
|
|
582
582
|
}, i = g(() => ({
|
|
583
583
|
...t.chartOptions,
|
|
584
584
|
type: r[t.chartOptions.type]
|
|
@@ -619,8 +619,8 @@ const Re = {
|
|
|
619
619
|
"1eed717c": `${n.height}px`
|
|
620
620
|
}));
|
|
621
621
|
const t = e, r = {
|
|
622
|
-
[
|
|
623
|
-
[
|
|
622
|
+
[I.HorizontalBar]: re.HORIZONTAL_BAR,
|
|
623
|
+
[I.VerticalBar]: re.VERTICAL_BAR
|
|
624
624
|
}, i = g(() => ({
|
|
625
625
|
type: r[t.chartOptions.type],
|
|
626
626
|
stacked: t.chartOptions.stacked,
|
|
@@ -633,7 +633,7 @@ const Re = {
|
|
|
633
633
|
}, {
|
|
634
634
|
default: x(({ data: o }) => [
|
|
635
635
|
V("div", $t, [
|
|
636
|
-
N(m(
|
|
636
|
+
N(m(Ie), {
|
|
637
637
|
"allow-csv-export": n.chartOptions.allowCsvExport,
|
|
638
638
|
"chart-data": o,
|
|
639
639
|
"chart-options": i.value,
|
|
@@ -648,7 +648,7 @@ const Re = {
|
|
|
648
648
|
_: 1
|
|
649
649
|
}, 8, ["context", "query", "query-ready"]));
|
|
650
650
|
}
|
|
651
|
-
}), pe = /* @__PURE__ */ j(zt, [["__scopeId", "data-v-36598a1b"]]), Pt = { class: "analytics-chart" },
|
|
651
|
+
}), pe = /* @__PURE__ */ j(zt, [["__scopeId", "data-v-36598a1b"]]), Pt = { class: "analytics-chart" }, Ut = /* @__PURE__ */ E({
|
|
652
652
|
__name: "TimeseriesChartRenderer",
|
|
653
653
|
props: {
|
|
654
654
|
query: {},
|
|
@@ -662,7 +662,7 @@ const Re = {
|
|
|
662
662
|
"4efa9c90": `${n.height}px`
|
|
663
663
|
}));
|
|
664
664
|
const t = e, r = {
|
|
665
|
-
[
|
|
665
|
+
[I.TimeseriesLine]: re.TIMESERIES_LINE
|
|
666
666
|
// TODO: Timeseries bar
|
|
667
667
|
}, i = g(() => {
|
|
668
668
|
const n = t.chartOptions.stacked ?? !1;
|
|
@@ -679,7 +679,7 @@ const Re = {
|
|
|
679
679
|
}, {
|
|
680
680
|
default: x(({ data: o }) => [
|
|
681
681
|
V("div", Pt, [
|
|
682
|
-
N(m(
|
|
682
|
+
N(m(Ie), {
|
|
683
683
|
"allow-csv-export": n.chartOptions.allowCsvExport,
|
|
684
684
|
"chart-data": o,
|
|
685
685
|
"chart-options": i.value,
|
|
@@ -693,7 +693,7 @@ const Re = {
|
|
|
693
693
|
_: 1
|
|
694
694
|
}, 8, ["context", "query", "query-ready"]));
|
|
695
695
|
}
|
|
696
|
-
}),
|
|
696
|
+
}), Ft = /* @__PURE__ */ j(Ut, [["__scopeId", "data-v-ceb07ca8"]]), Kt = { class: "metric-card-tile-wrapper" }, Vt = /* @__PURE__ */ E({
|
|
697
697
|
__name: "GoldenSignalsRenderer",
|
|
698
698
|
props: {
|
|
699
699
|
query: {},
|
|
@@ -747,7 +747,7 @@ const Re = {
|
|
|
747
747
|
]));
|
|
748
748
|
}
|
|
749
749
|
}), Bt = /* @__PURE__ */ j(Vt, [["__scopeId", "data-v-6d704e9d"]]), Le = "20px";
|
|
750
|
-
var
|
|
750
|
+
var U = /* @__PURE__ */ ((e) => (e[e.Loading = 0] = "Loading", e[e.Idle = 1] = "Idle", e[e.NoResults = 2] = "NoResults", e[e.Error = 3] = "Error", e))(U || {});
|
|
751
751
|
function Mt() {
|
|
752
752
|
return {
|
|
753
753
|
getAxiosInstance: (e = {}) => {
|
|
@@ -955,35 +955,32 @@ function ir(e, t, r, i = {
|
|
|
955
955
|
r || (r = "1000");
|
|
956
956
|
const { axiosInstance: n } = oe(e.axiosRequestConfig), { i18n: { t: a } } = X(), { debounce: o } = Ht(), s = o(async (f) => {
|
|
957
957
|
await $(f);
|
|
958
|
-
}, 200), u = v(!1),
|
|
958
|
+
}, 200), u = v(!1), l = v(""), d = v(""), c = v([]), y = v([]), p = v(void 0), w = g(() => {
|
|
959
959
|
const f = `${e.apiBaseUrl}${m(t)}`;
|
|
960
960
|
return e.app === "konnect" ? f.replace(/{controlPlaneId}/gi, (e == null ? void 0 : e.controlPlaneId) || "") : e.app === "kongManager" ? f.replace(/\/{workspace}/gi, e != null && e.workspace ? `/${e.workspace}` : "") : f;
|
|
961
961
|
}), { isValidUuid: q } = De(), O = async () => {
|
|
962
962
|
try {
|
|
963
963
|
u.value = !0;
|
|
964
964
|
const { data: f } = await n.get(`${w.value}?size=${r}`);
|
|
965
|
-
f != null && f.next || (p.value = i.fetchedItemsKey in f ? f[i.fetchedItemsKey] : []), y.value = i.fetchedItemsKey in f ? f[i.fetchedItemsKey] : [],
|
|
965
|
+
f != null && f.next || (p.value = i.fetchedItemsKey in f ? f[i.fetchedItemsKey] : []), y.value = i.fetchedItemsKey in f ? f[i.fetchedItemsKey] : [], c.value = y.value;
|
|
966
966
|
} catch {
|
|
967
|
-
|
|
967
|
+
c.value = [], l.value = a("debouncedFilter.errors.fetch");
|
|
968
968
|
} finally {
|
|
969
969
|
u.value = !1;
|
|
970
970
|
}
|
|
971
971
|
}, R = v(""), $ = async (f) => {
|
|
972
972
|
var _, z, W;
|
|
973
973
|
if (R.value !== f) {
|
|
974
|
-
if (f
|
|
975
|
-
|
|
974
|
+
if (R.value = f ?? "", !f) {
|
|
975
|
+
c.value = y.value;
|
|
976
976
|
return;
|
|
977
|
-
}
|
|
978
|
-
R.value = f || "";
|
|
977
|
+
}
|
|
979
978
|
if (p.value === void 0)
|
|
980
979
|
try {
|
|
981
|
-
if (u.value = !0,
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
i.fetchedItemsKey in I ? l.value = I[i.fetchedItemsKey] : I != null && I[i.exactMatchKey ?? "id"] ? l.value = [I] : l.value = [];
|
|
986
|
-
} else if (f) {
|
|
980
|
+
if (u.value = !0, l.value = "", d.value = "", e.app === "konnect") {
|
|
981
|
+
const S = `${w.value}/${f}`, { data: T } = await n.get(`${S}?size=${r}`);
|
|
982
|
+
i.fetchedItemsKey in T ? c.value = T[i.fetchedItemsKey] : T != null && T[i.exactMatchKey ?? "id"] ? c.value = [T] : c.value = [];
|
|
983
|
+
} else {
|
|
987
984
|
const S = [];
|
|
988
985
|
q(f) && i.searchKeys.includes("id") ? S.push((async () => {
|
|
989
986
|
const { data: k } = await n.get(`${w.value}/${f}`);
|
|
@@ -994,37 +991,36 @@ function ir(e, t, r, i = {
|
|
|
994
991
|
return L[i.fetchedItemsKey];
|
|
995
992
|
})
|
|
996
993
|
);
|
|
997
|
-
const
|
|
998
|
-
|
|
994
|
+
const T = await Promise.all(S), B = /* @__PURE__ */ new Set();
|
|
995
|
+
c.value = [], (_ = T == null ? void 0 : T.forEach) == null || _.call(T, (k) => {
|
|
999
996
|
var L;
|
|
1000
997
|
(L = k == null ? void 0 : k.forEach) == null || L.call(k, (ee) => {
|
|
1001
|
-
B.has(ee.id) || (B.add(ee.id),
|
|
998
|
+
B.has(ee.id) || (B.add(ee.id), c.value.push(ee));
|
|
1002
999
|
});
|
|
1003
1000
|
});
|
|
1004
|
-
}
|
|
1005
|
-
l.value = y.value;
|
|
1001
|
+
}
|
|
1006
1002
|
} catch (S) {
|
|
1007
|
-
((z = S == null ? void 0 : S.response) == null ? void 0 : z.status) === 404 ? d.value = a("debouncedFilter.errors.invalid") : (
|
|
1003
|
+
((z = S == null ? void 0 : S.response) == null ? void 0 : z.status) === 404 ? d.value = a("debouncedFilter.errors.invalid") : (c.value = [], l.value = a("debouncedFilter.errors.fetch"));
|
|
1008
1004
|
} finally {
|
|
1009
1005
|
u.value = !1;
|
|
1010
1006
|
}
|
|
1011
1007
|
else
|
|
1012
|
-
u.value = !0, d.value = "",
|
|
1013
|
-
var
|
|
1008
|
+
u.value = !0, d.value = "", c.value = (W = p.value) == null ? void 0 : W.filter((S) => {
|
|
1009
|
+
var T;
|
|
1014
1010
|
let B = !1;
|
|
1015
1011
|
for (const k of i.searchKeys) {
|
|
1016
|
-
const L = typeof S[k] == "string" ? (
|
|
1012
|
+
const L = typeof S[k] == "string" ? (T = S[k]) == null ? void 0 : T.toLowerCase() : S[k];
|
|
1017
1013
|
L != null && L.includes(f.toLowerCase()) && (B = !0);
|
|
1018
1014
|
}
|
|
1019
1015
|
return B;
|
|
1020
|
-
}), (!
|
|
1016
|
+
}), (!c.value || !c.value.length) && (d.value = a("debouncedFilter.errors.invalid")), u.value = !1;
|
|
1021
1017
|
}
|
|
1022
1018
|
};
|
|
1023
1019
|
return {
|
|
1024
1020
|
loading: u,
|
|
1025
|
-
error:
|
|
1021
|
+
error: l,
|
|
1026
1022
|
validationError: d,
|
|
1027
|
-
results:
|
|
1023
|
+
results: c,
|
|
1028
1024
|
allRecords: p,
|
|
1029
1025
|
loadItems: O,
|
|
1030
1026
|
debouncedQueryChange: s
|
|
@@ -1084,12 +1080,12 @@ function je(e, t) {
|
|
|
1084
1080
|
() => i.value.startsWith("/") ? new URL(`${window.location.origin}${i.value}`) : new URL(i.value)
|
|
1085
1081
|
);
|
|
1086
1082
|
return (o) => {
|
|
1087
|
-
const { page: s, pageSize: u, offset:
|
|
1083
|
+
const { page: s, pageSize: u, offset: l, sortColumnKey: d, sortColumnOrder: c, query: y } = o;
|
|
1088
1084
|
try {
|
|
1089
1085
|
let p = new URL(a.value.href);
|
|
1090
1086
|
return n.value && y ? (p.search = "", p = r.value.isExactMatch ? new URL(`${p.href}/${y}/`) : new URL(`${p.href}?filter[name][contains]=${y}`)) : (n.value || new URLSearchParams(y).forEach((w, q) => {
|
|
1091
1087
|
p.searchParams.append(q, w);
|
|
1092
|
-
}), d && p.searchParams.append("sort_by", d),
|
|
1088
|
+
}), d && p.searchParams.append("sort_by", d), c === "desc" && p.searchParams.append("sort_desc", "1"), p.searchParams.append("size", String(u))), l && s !== 1 && p.searchParams.append("offset", String(l)), p.href;
|
|
1093
1089
|
} catch (p) {
|
|
1094
1090
|
return console.error("RouteList(fetcher)", p), i.value;
|
|
1095
1091
|
}
|
|
@@ -1097,46 +1093,46 @@ function je(e, t) {
|
|
|
1097
1093
|
}
|
|
1098
1094
|
function lr(e, t, r = "data") {
|
|
1099
1095
|
const i = m(t), { axiosInstance: n } = oe(e.axiosRequestConfig), a = je(e, i), o = v({
|
|
1100
|
-
status:
|
|
1096
|
+
status: U.Idle
|
|
1101
1097
|
});
|
|
1102
1098
|
return { fetcher: async (s) => {
|
|
1103
1099
|
var u;
|
|
1104
1100
|
try {
|
|
1105
|
-
o.value = { status:
|
|
1106
|
-
let
|
|
1107
|
-
|
|
1108
|
-
const d = await n.get(
|
|
1101
|
+
o.value = { status: U.Loading };
|
|
1102
|
+
let l = a(s);
|
|
1103
|
+
l.includes("filter[name]") && (l = `${l}&page[size]=${s.pageSize}&page[number]=${s.page}`);
|
|
1104
|
+
const d = await n.get(l);
|
|
1109
1105
|
if (d.status >= 400)
|
|
1110
1106
|
throw d;
|
|
1111
|
-
const
|
|
1107
|
+
const c = d.data, y = r && r.replace(/[^\w-_]/gi, "");
|
|
1112
1108
|
let p;
|
|
1113
|
-
|
|
1109
|
+
c[y] && Array.isArray(c[y]) ? p = c[y] : Array.isArray(c) ? p = c : p = Object.keys(c).length ? [c] : [];
|
|
1114
1110
|
const w = {
|
|
1115
1111
|
data: p,
|
|
1116
1112
|
total: p.length,
|
|
1117
|
-
...
|
|
1113
|
+
...c.offset ? {
|
|
1118
1114
|
pagination: {
|
|
1119
|
-
offset:
|
|
1115
|
+
offset: c.offset
|
|
1120
1116
|
}
|
|
1121
1117
|
} : null
|
|
1122
1118
|
};
|
|
1123
1119
|
return o.value = {
|
|
1124
|
-
status:
|
|
1120
|
+
status: U.Idle,
|
|
1125
1121
|
response: w
|
|
1126
1122
|
}, w;
|
|
1127
|
-
} catch (
|
|
1123
|
+
} catch (l) {
|
|
1128
1124
|
const d = {
|
|
1129
1125
|
data: [],
|
|
1130
1126
|
total: 0
|
|
1131
1127
|
};
|
|
1132
|
-
return s.query && (((u =
|
|
1133
|
-
status:
|
|
1128
|
+
return s.query && (((u = l.response) == null ? void 0 : u.status) === 404 || l.status === 404) ? (o.value = {
|
|
1129
|
+
status: U.NoResults,
|
|
1134
1130
|
response: d,
|
|
1135
|
-
error:
|
|
1131
|
+
error: l.response ? l : { response: l }
|
|
1136
1132
|
}, d) : (o.value = {
|
|
1137
|
-
status:
|
|
1133
|
+
status: U.Error,
|
|
1138
1134
|
response: d,
|
|
1139
|
-
error:
|
|
1135
|
+
error: l.response ? l : { response: l }
|
|
1140
1136
|
}, d);
|
|
1141
1137
|
}
|
|
1142
1138
|
}, fetcherState: o };
|
|
@@ -1260,30 +1256,30 @@ function xr(e, t) {
|
|
|
1260
1256
|
r += e;
|
|
1261
1257
|
return r;
|
|
1262
1258
|
}
|
|
1263
|
-
function
|
|
1259
|
+
function Tr(e) {
|
|
1264
1260
|
return e === 0 && Number.NEGATIVE_INFINITY === 1 / e;
|
|
1265
1261
|
}
|
|
1266
|
-
var
|
|
1267
|
-
isNothing:
|
|
1262
|
+
var Ir = Pe, Ar = wr, Cr = Sr, Er = xr, qr = Tr, Nr = kr, se = {
|
|
1263
|
+
isNothing: Ir,
|
|
1268
1264
|
isObject: Ar,
|
|
1269
1265
|
toArray: Cr,
|
|
1270
1266
|
repeat: Er,
|
|
1271
1267
|
isNegativeZero: qr,
|
|
1272
1268
|
extend: Nr
|
|
1273
1269
|
};
|
|
1274
|
-
function
|
|
1270
|
+
function Ue(e, t) {
|
|
1275
1271
|
var r = "", i = e.reason || "(unknown reason)";
|
|
1276
1272
|
return e.mark ? (e.mark.name && (r += 'in "' + e.mark.name + '" '), r += "(" + (e.mark.line + 1) + ":" + (e.mark.column + 1) + ")", !t && e.mark.snippet && (r += `
|
|
1277
1273
|
|
|
1278
1274
|
` + e.mark.snippet), i + " " + r) : i;
|
|
1279
1275
|
}
|
|
1280
1276
|
function H(e, t) {
|
|
1281
|
-
Error.call(this), this.name = "YAMLException", this.reason = e, this.mark = t, this.message =
|
|
1277
|
+
Error.call(this), this.name = "YAMLException", this.reason = e, this.mark = t, this.message = Ue(this, !1), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack || "";
|
|
1282
1278
|
}
|
|
1283
1279
|
H.prototype = Object.create(Error.prototype);
|
|
1284
1280
|
H.prototype.constructor = H;
|
|
1285
1281
|
H.prototype.toString = function(e) {
|
|
1286
|
-
return this.name + ": " +
|
|
1282
|
+
return this.name + ": " + Ue(this, e);
|
|
1287
1283
|
};
|
|
1288
1284
|
var D = H, Or = [
|
|
1289
1285
|
"kind",
|
|
@@ -1387,16 +1383,16 @@ var $r = ne, zr = new b("tag:yaml.org,2002:str", {
|
|
|
1387
1383
|
construct: function(e) {
|
|
1388
1384
|
return e !== null ? e : [];
|
|
1389
1385
|
}
|
|
1390
|
-
}),
|
|
1386
|
+
}), Ur = new b("tag:yaml.org,2002:map", {
|
|
1391
1387
|
kind: "mapping",
|
|
1392
1388
|
construct: function(e) {
|
|
1393
1389
|
return e !== null ? e : {};
|
|
1394
1390
|
}
|
|
1395
|
-
}),
|
|
1391
|
+
}), Fr = new $r({
|
|
1396
1392
|
explicit: [
|
|
1397
1393
|
zr,
|
|
1398
1394
|
Pr,
|
|
1399
|
-
|
|
1395
|
+
Ur
|
|
1400
1396
|
]
|
|
1401
1397
|
});
|
|
1402
1398
|
function Kr(e) {
|
|
@@ -1609,24 +1605,24 @@ var un = new b("tag:yaml.org,2002:float", {
|
|
|
1609
1605
|
predicate: cn,
|
|
1610
1606
|
represent: ln,
|
|
1611
1607
|
defaultStyle: "lowercase"
|
|
1612
|
-
}), pn =
|
|
1608
|
+
}), pn = Fr.extend({
|
|
1613
1609
|
implicit: [
|
|
1614
1610
|
Mr,
|
|
1615
1611
|
Wr,
|
|
1616
1612
|
rn,
|
|
1617
1613
|
un
|
|
1618
1614
|
]
|
|
1619
|
-
}), dn = pn,
|
|
1615
|
+
}), dn = pn, Fe = new RegExp(
|
|
1620
1616
|
"^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
|
|
1621
1617
|
), Ke = new RegExp(
|
|
1622
1618
|
"^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"
|
|
1623
1619
|
);
|
|
1624
1620
|
function yn(e) {
|
|
1625
|
-
return e === null ? !1 :
|
|
1621
|
+
return e === null ? !1 : Fe.exec(e) !== null || Ke.exec(e) !== null;
|
|
1626
1622
|
}
|
|
1627
1623
|
function fn(e) {
|
|
1628
|
-
var t, r, i, n, a, o, s, u = 0,
|
|
1629
|
-
if (t =
|
|
1624
|
+
var t, r, i, n, a, o, s, u = 0, l = null, d, c, y;
|
|
1625
|
+
if (t = Fe.exec(e), t === null && (t = Ke.exec(e)), t === null) throw new Error("Date resolve error");
|
|
1630
1626
|
if (r = +t[1], i = +t[2] - 1, n = +t[3], !t[4])
|
|
1631
1627
|
return new Date(Date.UTC(r, i, n));
|
|
1632
1628
|
if (a = +t[4], o = +t[5], s = +t[6], t[7]) {
|
|
@@ -1634,7 +1630,7 @@ function fn(e) {
|
|
|
1634
1630
|
u += "0";
|
|
1635
1631
|
u = +u;
|
|
1636
1632
|
}
|
|
1637
|
-
return t[9] && (d = +t[10],
|
|
1633
|
+
return t[9] && (d = +t[10], c = +(t[11] || 0), l = (d * 60 + c) * 6e4, t[9] === "-" && (l = -l)), y = new Date(Date.UTC(r, i, n, a, o, s, u)), l && y.setTime(y.getTime() - l), y;
|
|
1638
1634
|
}
|
|
1639
1635
|
function hn(e) {
|
|
1640
1636
|
return e.toISOString();
|
|
@@ -1685,12 +1681,12 @@ var kn = new b("tag:yaml.org,2002:binary", {
|
|
|
1685
1681
|
construct: bn,
|
|
1686
1682
|
predicate: Sn,
|
|
1687
1683
|
represent: wn
|
|
1688
|
-
}), xn = Object.prototype.hasOwnProperty,
|
|
1689
|
-
function
|
|
1684
|
+
}), xn = Object.prototype.hasOwnProperty, Tn = Object.prototype.toString;
|
|
1685
|
+
function In(e) {
|
|
1690
1686
|
if (e === null) return !0;
|
|
1691
1687
|
var t = [], r, i, n, a, o, s = e;
|
|
1692
1688
|
for (r = 0, i = s.length; r < i; r += 1) {
|
|
1693
|
-
if (n = s[r], o = !1,
|
|
1689
|
+
if (n = s[r], o = !1, Tn.call(n) !== "[object Object]") return !1;
|
|
1694
1690
|
for (a in n)
|
|
1695
1691
|
if (xn.call(n, a))
|
|
1696
1692
|
if (!o) o = !0;
|
|
@@ -1706,7 +1702,7 @@ function An(e) {
|
|
|
1706
1702
|
}
|
|
1707
1703
|
var Cn = new b("tag:yaml.org,2002:omap", {
|
|
1708
1704
|
kind: "sequence",
|
|
1709
|
-
resolve:
|
|
1705
|
+
resolve: In,
|
|
1710
1706
|
construct: An
|
|
1711
1707
|
}), En = Object.prototype.toString;
|
|
1712
1708
|
function qn(e) {
|
|
@@ -1770,10 +1766,10 @@ const we = "24px", Pn = (e, t) => {
|
|
|
1770
1766
|
for (const [i, n] of t)
|
|
1771
1767
|
r[i] = n;
|
|
1772
1768
|
return r;
|
|
1773
|
-
},
|
|
1769
|
+
}, Un = (e) => (Ge("data-v-cd88dfcc"), e = e(), Ye(), e), Fn = ["aria-hidden"], Kn = {
|
|
1774
1770
|
key: 0,
|
|
1775
1771
|
"data-testid": "kui-icon-svg-title"
|
|
1776
|
-
}, Vn = /* @__PURE__ */
|
|
1772
|
+
}, Vn = /* @__PURE__ */ Un(() => /* @__PURE__ */ V("path", {
|
|
1777
1773
|
d: "M5 22C4.45 22 3.97917 21.8042 3.5875 21.4125C3.19583 21.0208 3 20.55 3 20V6H5V20H16V22H5ZM9 18C8.45 18 7.97917 17.8042 7.5875 17.4125C7.19583 17.0208 7 16.55 7 16V4C7 3.45 7.19583 2.97917 7.5875 2.5875C7.97917 2.19583 8.45 2 9 2H18C18.55 2 19.0208 2.19583 19.4125 2.5875C19.8042 2.97917 20 3.45 20 4V16C20 16.55 19.8042 17.0208 19.4125 17.4125C19.0208 17.8042 18.55 18 18 18H9ZM9 16H18V4H9V16Z",
|
|
1778
1774
|
fill: "currentColor"
|
|
1779
1775
|
}, null, -1)), Bn = /* @__PURE__ */ E({
|
|
@@ -1846,7 +1842,7 @@ const we = "24px", Pn = (e, t) => {
|
|
|
1846
1842
|
lineHeight: "0",
|
|
1847
1843
|
width: r.value
|
|
1848
1844
|
}));
|
|
1849
|
-
return (n, a) => (h(), A(
|
|
1845
|
+
return (n, a) => (h(), A(Te(e.as), {
|
|
1850
1846
|
"aria-hidden": e.decorative ? "true" : void 0,
|
|
1851
1847
|
class: "kui-icon copy-icon",
|
|
1852
1848
|
"data-testid": "kui-icon-wrapper-copy-icon",
|
|
@@ -1865,7 +1861,7 @@ const we = "24px", Pn = (e, t) => {
|
|
|
1865
1861
|
}, [
|
|
1866
1862
|
e.title ? (h(), C("title", Kn, K(e.title), 1)) : M("", !0),
|
|
1867
1863
|
Vn
|
|
1868
|
-
], 8,
|
|
1864
|
+
], 8, Fn))
|
|
1869
1865
|
]),
|
|
1870
1866
|
_: 1
|
|
1871
1867
|
}, 8, ["aria-hidden", "style"]));
|
|
@@ -1905,20 +1901,20 @@ const Gn = {
|
|
|
1905
1901
|
},
|
|
1906
1902
|
setup(e) {
|
|
1907
1903
|
const t = e, r = v(), { isTruncated: i } = ve.useTruncationDetector(r), { i18n: { t: n } } = ve.useI18n(), a = n("global.actions.copyId"), o = v(a), s = g(() => t.entityLinkData.deleted ?? !1), u = g(() => {
|
|
1908
|
-
var
|
|
1909
|
-
return (
|
|
1910
|
-
}),
|
|
1911
|
-
var
|
|
1912
|
-
return `${(
|
|
1913
|
-
}), d = async (
|
|
1914
|
-
await
|
|
1904
|
+
var c;
|
|
1905
|
+
return (c = t.entityLinkData.id) != null && c.toString().includes(":") ? t.entityLinkData.id.toString().split(":")[1] : t.entityLinkData.id;
|
|
1906
|
+
}), l = g(() => {
|
|
1907
|
+
var c;
|
|
1908
|
+
return `${(c = u.value) == null ? void 0 : c.toString().slice(0, 5)} (deleted)`;
|
|
1909
|
+
}), d = async (c) => {
|
|
1910
|
+
await c(u.value || "") && (o.value = n("global.actions.copyToClipboard"), setTimeout(() => {
|
|
1915
1911
|
o.value = a;
|
|
1916
1912
|
}, 1800));
|
|
1917
1913
|
};
|
|
1918
|
-
return (
|
|
1919
|
-
const p =
|
|
1914
|
+
return (c, y) => {
|
|
1915
|
+
const p = F("KTooltip"), w = F("KExternalLink"), q = F("KClipboardProvider");
|
|
1920
1916
|
return h(), C("div", Gn, [
|
|
1921
|
-
s.value ? (h(), C("div", Yn, K(
|
|
1917
|
+
s.value ? (h(), C("div", Yn, K(l.value), 1)) : u.value ? u.value ? (h(), A(w, {
|
|
1922
1918
|
key: 2,
|
|
1923
1919
|
class: "entity-link",
|
|
1924
1920
|
"hide-icon": !e.newWindow,
|
|
@@ -2035,13 +2031,13 @@ const Gn = {
|
|
|
2035
2031
|
58871060: `${a.height}px`
|
|
2036
2032
|
}));
|
|
2037
2033
|
const t = parseInt(Le, 10), r = e, i = {
|
|
2038
|
-
[
|
|
2039
|
-
[
|
|
2040
|
-
[
|
|
2041
|
-
[
|
|
2042
|
-
[
|
|
2043
|
-
[
|
|
2044
|
-
[
|
|
2034
|
+
[I.TimeseriesLine]: Ft,
|
|
2035
|
+
[I.HorizontalBar]: pe,
|
|
2036
|
+
[I.VerticalBar]: pe,
|
|
2037
|
+
[I.Gauge]: jt,
|
|
2038
|
+
[I.GoldenSignals]: Bt,
|
|
2039
|
+
[I.TopN]: Xn,
|
|
2040
|
+
[I.Slottable]: void 0
|
|
2045
2041
|
}, n = g(() => {
|
|
2046
2042
|
const a = i[r.definition.chart.type];
|
|
2047
2043
|
return a && {
|
|
@@ -2056,7 +2052,7 @@ const Gn = {
|
|
|
2056
2052
|
};
|
|
2057
2053
|
});
|
|
2058
2054
|
return (a, o) => (h(), C("div", ei, [
|
|
2059
|
-
n.value ? (h(), A(
|
|
2055
|
+
n.value ? (h(), A(Te(n.value.component), xe(Ze({ key: 0 }, n.value.rendererProps)), null, 16)) : M("", !0)
|
|
2060
2056
|
]));
|
|
2061
2057
|
}
|
|
2062
2058
|
}), ri = /* @__PURE__ */ j(ti, [["__scopeId", "data-v-69b5e552"]]), ni = (e, t, r) => {
|
|
@@ -2119,16 +2115,16 @@ const Gn = {
|
|
|
2119
2115
|
ref: r,
|
|
2120
2116
|
class: "kong-ui-public-grid-layout"
|
|
2121
2117
|
}, [
|
|
2122
|
-
(h(!0), C(Je, null, Xe(o.value, (
|
|
2123
|
-
key:
|
|
2118
|
+
(h(!0), C(Je, null, Xe(o.value, (l) => (h(), C("div", {
|
|
2119
|
+
key: l.key,
|
|
2124
2120
|
class: et(["grid-cell", {
|
|
2125
|
-
"empty-cell": !
|
|
2121
|
+
"empty-cell": !l.tile
|
|
2126
2122
|
}]),
|
|
2127
|
-
style: te(
|
|
2123
|
+
style: te(l.style)
|
|
2128
2124
|
}, [
|
|
2129
2125
|
ae(s.$slots, "tile", {
|
|
2130
|
-
style: te(
|
|
2131
|
-
tile:
|
|
2126
|
+
style: te(l.style),
|
|
2127
|
+
tile: l.tile
|
|
2132
2128
|
}, void 0, !0)
|
|
2133
2129
|
], 6))), 128))
|
|
2134
2130
|
], 512));
|
|
@@ -2148,60 +2144,60 @@ const Gn = {
|
|
|
2148
2144
|
const n = ut(), a = g(() => t.context.timeSpec ? t.context.timeSpec : {
|
|
2149
2145
|
type: "relative",
|
|
2150
2146
|
time_range: n.defaultQueryTimeForOrg
|
|
2151
|
-
}), o = g(() => !!t.context.timeSpec || !n.loading), s = g(() => t.config.tiles.map((
|
|
2147
|
+
}), o = g(() => !!t.context.timeSpec || !n.loading), s = g(() => t.config.tiles.map((l, d) => {
|
|
2152
2148
|
var y;
|
|
2153
|
-
let
|
|
2154
|
-
if ("description" in
|
|
2155
|
-
const p = (y =
|
|
2149
|
+
let c = l.definition;
|
|
2150
|
+
if ("description" in c.chart) {
|
|
2151
|
+
const p = (y = c.chart.description) == null ? void 0 : y.replace(dt, () => {
|
|
2156
2152
|
const q = `renderer.trendRange.${a.value.type === "absolute" ? "custom" : a.value.time_range}`;
|
|
2157
2153
|
return r.te(q) ? r.t(q) : "";
|
|
2158
2154
|
});
|
|
2159
|
-
|
|
2160
|
-
...
|
|
2155
|
+
c = {
|
|
2156
|
+
...c,
|
|
2161
2157
|
chart: {
|
|
2162
|
-
...
|
|
2158
|
+
...c.chart,
|
|
2163
2159
|
description: p
|
|
2164
2160
|
}
|
|
2165
2161
|
};
|
|
2166
2162
|
}
|
|
2167
2163
|
return {
|
|
2168
|
-
layout:
|
|
2169
|
-
meta:
|
|
2164
|
+
layout: l.layout,
|
|
2165
|
+
meta: c,
|
|
2170
2166
|
// Add a unique key to each tile internally.
|
|
2171
2167
|
id: d
|
|
2172
2168
|
};
|
|
2173
2169
|
})), u = g(() => {
|
|
2174
|
-
let { tz:
|
|
2175
|
-
return
|
|
2170
|
+
let { tz: l, refreshInterval: d } = t.context;
|
|
2171
|
+
return l || (l = new Intl.DateTimeFormat().resolvedOptions().timeZone), d === void 0 && (d = yt), {
|
|
2176
2172
|
...t.context,
|
|
2177
|
-
tz:
|
|
2173
|
+
tz: l,
|
|
2178
2174
|
timeSpec: a.value,
|
|
2179
2175
|
refreshInterval: d
|
|
2180
2176
|
};
|
|
2181
2177
|
});
|
|
2182
|
-
return (
|
|
2183
|
-
const
|
|
2178
|
+
return (l, d) => {
|
|
2179
|
+
const c = F("KAlert");
|
|
2184
2180
|
return h(), C("div", oi, [
|
|
2185
2181
|
m(i) ? (h(), A(ai, {
|
|
2186
2182
|
key: 1,
|
|
2187
|
-
"grid-size":
|
|
2188
|
-
"tile-height":
|
|
2183
|
+
"grid-size": l.config.gridSize,
|
|
2184
|
+
"tile-height": l.config.tileHeight,
|
|
2189
2185
|
tiles: s.value
|
|
2190
2186
|
}, {
|
|
2191
2187
|
tile: x(({ tile: y }) => [
|
|
2192
|
-
y.meta.chart.type === m(
|
|
2193
|
-
ae(
|
|
2188
|
+
y.meta.chart.type === m(I).Slottable ? (h(), C("div", si, [
|
|
2189
|
+
ae(l.$slots, y.meta.chart.id, {}, void 0, !0)
|
|
2194
2190
|
])) : (h(), A(ri, {
|
|
2195
2191
|
key: 1,
|
|
2196
2192
|
class: "tile-container",
|
|
2197
2193
|
context: u.value,
|
|
2198
2194
|
definition: y.meta,
|
|
2199
|
-
height: y.layout.size.rows * (
|
|
2195
|
+
height: y.layout.size.rows * (l.config.tileHeight || m(Z)) + parseInt(m(Le), 10),
|
|
2200
2196
|
"query-ready": o.value
|
|
2201
2197
|
}, null, 8, ["context", "definition", "height", "query-ready"]))
|
|
2202
2198
|
]),
|
|
2203
2199
|
_: 3
|
|
2204
|
-
}, 8, ["grid-size", "tile-height", "tiles"])) : (h(), A(
|
|
2200
|
+
}, 8, ["grid-size", "tile-height", "tiles"])) : (h(), A(c, {
|
|
2205
2201
|
key: 0,
|
|
2206
2202
|
appearance: "danger"
|
|
2207
2203
|
}, {
|
|
@@ -2216,7 +2212,7 @@ const Gn = {
|
|
|
2216
2212
|
}), bi = /* @__PURE__ */ j(li, [["__scopeId", "data-v-2dd03268"]]);
|
|
2217
2213
|
export {
|
|
2218
2214
|
pt as CP_ID_TOKEN,
|
|
2219
|
-
|
|
2215
|
+
I as ChartTypes,
|
|
2220
2216
|
Z as DEFAULT_TILE_HEIGHT,
|
|
2221
2217
|
yt as DEFAULT_TILE_REFRESH_INTERVAL_MS,
|
|
2222
2218
|
bi as DashboardRenderer,
|
|
@@ -2231,8 +2227,8 @@ export {
|
|
|
2231
2227
|
_t as metricCardSchema,
|
|
2232
2228
|
ft as slottableSchema,
|
|
2233
2229
|
At as tileConfigSchema,
|
|
2234
|
-
|
|
2235
|
-
|
|
2230
|
+
Tt as tileDefinitionSchema,
|
|
2231
|
+
It as tileLayoutSchema,
|
|
2236
2232
|
mt as timeseriesChartSchema,
|
|
2237
2233
|
vt as topNTableSchema,
|
|
2238
2234
|
xt as validDashboardQuery
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(d,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("@kong-ui-public/analytics-chart"),require("swrv"),require("axios"),require("@kong-ui-public/i18n"),require("@kong-ui-public/analytics-metric-provider"),require("@kong-ui-public/analytics-utilities"),require("@kong/kongponents"),require("vue-router"),require("@kong-ui-public/analytics-config-store")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/analytics-chart","swrv","axios","@kong-ui-public/i18n","@kong-ui-public/analytics-metric-provider","@kong-ui-public/analytics-utilities","@kong/kongponents","vue-router","@kong-ui-public/analytics-config-store"],n):(d=typeof globalThis<"u"?globalThis:d||self,n(d["kong-ui-public-dashboard-renderer"]={},d.Vue,d["kong-ui-public-analytics-chart"],d.swrv,d.axios,d["kong-ui-public-i18n"],d["kong-ui-public-analytics-metric-provider"],d["kong-ui-public-analytics-utilities"],d.Kongponents,d.VueRouter,d["kong-ui-public-analytics-config-store"]))})(this,function(d,n,v,je,Q,V,W,J,yn,fn,Ve){"use strict";const P="analytics-query-provider",K="{entity-id}",X="{cp-id}",ee="{timeframe}";var w=(e=>(e.HorizontalBar="horizontal_bar",e.VerticalBar="vertical_bar",e.Gauge="gauge",e.TimeseriesLine="timeseries_line",e.GoldenSignals="golden_signals",e.TopN="top_n",e.Slottable="slottable",e))(w||{});const $={type:"string"},D={type:"string"},te={type:"boolean"},re={type:["object","array"],items:{type:"string"},additionalProperties:{type:"string"}},ne={type:"object",properties:{type:{type:"string",enum:["slottable"]},id:{type:"string"}},required:["type","id"],additionalProperties:!1},ie={type:"object",properties:{type:{type:"string",enum:["horizontal_bar","vertical_bar"]},stacked:{type:"boolean"},chartDatasetColors:re,syntheticsDataKey:$,chartTitle:D,allowCsvExport:te},required:["type"],additionalProperties:!1},oe={type:"object",properties:{type:{type:"string",enum:["timeseries_line"]},stacked:{type:"boolean"},chartDatasetColors:re,syntheticsDataKey:$,chartTitle:D,allowCsvExport:te},required:["type"],additionalProperties:!1},ae={type:"object",properties:{type:{type:"string",enum:["gauge"]},metricDisplay:{type:"string",enum:Object.values(v.ChartMetricDisplay)},reverseDataset:{type:"boolean"},numerator:{type:"number"},syntheticsDataKey:$,chartTitle:D},required:["type"],additionalProperties:!1},se={type:"object",properties:{chartTitle:D,syntheticsDataKey:$,type:{type:"string",enum:["top_n"]},description:{type:"string"},entityLink:{type:"string"}},required:["type"],additionalProperties:!1},ce={type:"object",properties:{chartTitle:D,type:{type:"string",enum:["golden_signals"]},longCardTitles:{type:"boolean"},description:{type:"string"},percentileLatency:{type:"boolean"}},required:["type"]},le={type:"object",description:"A query to launch at the API",properties:{datasource:{type:"string",enum:["advanced","basic"]},metrics:{type:"array",description:"List of aggregated metrics to collect across the requested time span.",items:{type:"string",enum:["request_count","request_per_minute","response_latency_p99","response_latency_p95","response_latency_p50","response_latency_average","upstream_latency_p99","upstream_latency_p95","upstream_latency_p50","upstream_latency_average","kong_latency_p99","kong_latency_p95","kong_latency_p50","kong_latency_average","response_size_p99","response_size_p95","response_size_p50","request_size_p99","request_size_p95","request_size_p50","request_size_average","response_size_average"]}},dimensions:{type:"array",description:"List of attributes or entity types to group by.",minItems:0,maxItems:2,items:{type:"string",enum:["api_product","api_product_version","application","consumer","control_plane","control_plane_group","data_plane_node","gateway_service","route","status_code","status_code_grouped","time"]}},filters:{type:"array",description:"A list of filters to apply to the query.",items:{type:"object",description:"A filter that specifies which data to include in the query",properties:{dimension:{type:"string",enum:["api_product","api_product_version","application","consumer","control_plane","control_plane_group","data_plane_node","gateway_service","route","status_code","status_code_grouped","time"]},type:{type:"string",enum:["in","not_in","selector"]},values:{type:"array",items:{type:"string"}}},required:["dimension","type","values"]}},granularity_ms:{type:"number",description:'Force time grouping into buckets of this duration in milliseconds. Only has an effect if "time" is in the "dimensions" list.',minimum:6e4},time_range:{description:"The time range to query.",oneOf:[{type:"object",properties:{tz:{type:"string",default:"Etc/UTC"},type:{type:"string",enum:["relative"]},time_range:{type:"string",enum:["15m","1h","6h","12h","24h","7d","30d","current_week","current_month","previous_week","previous_month"],default:"1h"}},required:["type","time_range"]},{type:"object",description:"A duration representing an exact start and end time.",properties:{tz:{type:"string",default:"Etc/UTC"},type:{type:"string",enum:["absolute"]},start:{type:"string"},end:{type:"string"}},required:["type"]}],default:{type:"relative",time_range:"1h"}},limit:{type:"number"},meta:{type:"object"}},required:["datasource"],additionalProperties:!1},ue={oneOf:[le]},pe={type:"object",properties:{query:ue,chart:{oneOf:[ie,ae,oe,ce,se,ne]}},required:["query","chart"],additionalProperties:!1},de={type:"object",properties:{position:{type:"object",properties:{col:{type:"number"},row:{type:"number"}},description:"Position of the tile in the grid.",required:["col","row"],additionalProperties:!1},size:{type:"object",properties:{cols:{type:"number"},rows:{type:"number"},fitToContent:{type:"boolean"}},description:"Number of columns and rows the tile occupies. If fitToContent is true for every tile in a row, and each tile only occupies 1 row, then the row will auto-fit to its content.",required:["cols","rows"],additionalProperties:!1}},required:["position","size"],additionalProperties:!1},ye={type:"object",properties:{definition:pe,layout:de},required:["definition","layout"],additionalProperties:!1},$e={type:"object",properties:{tiles:{type:"array",items:ye},tileHeight:{type:"number",description:"Height of each tile in pixels. Default: 170"},gridSize:{type:"object",properties:{cols:{type:"number"},rows:{type:"number"}},description:"Number of columns and rows in the grid.",required:["cols","rows"],additionalProperties:!1}},required:["tiles","gridSize"],additionalProperties:!1};var fe=(e=>(e.VALIDATING="VALIDATING",e.VALIDATING_HAS_DATA="VALIDATING_HAS_DATA",e.PENDING="PENDING",e.SUCCESS="SUCCESS",e.SUCCESS_HAS_DATA="SUCCESS_HAS_DATA",e.ERROR="ERROR",e.STALE_IF_ERROR="STALE_IF_ERROR",e))(fe||{});const Fe=e=>{var t,r,o,i,a;return e?!!((t=Object.keys(e))!=null&&t.length||(r=e.data)!=null&&r.length||(i=(o=e.data)==null?void 0:o.data)!=null&&i.length||!((a=e.data)!=null&&a.data)&&typeof e.data=="object"&&Object.keys(e==null?void 0:e.data).length):!1};function ze(e=n.ref({}),t,r,o=Fe){const i=n.ref("PENDING");return n.watchEffect(()=>{const a=o(e.value);if(e.value&&a&&r.value){i.value="VALIDATING_HAS_DATA";return}if(e.value&&r.value){i.value="VALIDATING";return}if(e.value&&t.value){i.value="STALE_IF_ERROR";return}if(e.value===void 0&&!t.value){i.value="PENDING";return}if(e.value&&!t.value&&a){i.value="SUCCESS_HAS_DATA";return}if(e.value&&!t.value){i.value="SUCCESS";return}e.value===void 0&&t&&(i.value="ERROR")}),{state:i,swrvState:fe}}const Ue={renderer:{noQueryBridge:"No query bridge provided. Unable to render dashboard.",trendRange:{"24h":"Last 24-Hour Summary","7d":"Last 7-Day Summary","30d":"Last 30-Day Summary"}},queryDataProvider:{timeRangeExceeded:"The time range for this report is outside of your organization's data retention period"}};function Pe(){const e=V.createI18n("en-us",Ue);return{i18n:e,i18nT:V.i18nTComponent(e)}}const me={useI18n:Pe},F=n.defineComponent({__name:"QueryDataProvider",props:{context:{},query:{},queryReady:{type:Boolean}},emits:["queryComplete"],setup(e,{emit:t}){const r=e,o=t,{i18n:i}=me.useI18n(),a=n.inject(P),s=()=>r.queryReady&&a?JSON.stringify([r.query,r.context]):null,c=new AbortController;n.onUnmounted(()=>{c.abort()});const{data:p,error:u,isValidating:f}=je(s,async()=>{var C,A,L,h;try{const _=[];r.query.filters&&_.push(...r.query.filters),_.push(...r.context.filters);let{datasource:O,...U}=r.query;!O&&a&&(O=a.evaluateFeatureFlagFn("MA-2527-analytics-sku-config-endpoint",!1)?"basic":"advanced");const k={datasource:O,query:{...U,time_range:{...r.context.timeSpec,tz:r.context.tz},filters:_}};return a==null?void 0:a.queryFn(k,c)}catch(_){y.value=((A=(C=_==null?void 0:_.response)==null?void 0:C.data)==null?void 0:A.message)==="Range not allowed for this tier"?i.t("queryDataProvider.timeRangeExceeded"):((h=(L=_==null?void 0:_.response)==null?void 0:L.data)==null?void 0:h.message)||(_==null?void 0:_.message)}finally{o("queryComplete")}},{refreshInterval:r.context.refreshInterval,revalidateOnFocus:!1}),{state:l,swrvState:m}=ze(p,u,f),y=n.ref(null),b=n.computed(()=>l.value===m.ERROR||!!y.value),T=n.computed(()=>!r.queryReady||l.value===m.PENDING);return(C,A)=>{const L=n.resolveComponent("KSkeleton"),h=n.resolveComponent("KEmptyState");return T.value||!n.unref(p)&&!b.value?(n.openBlock(),n.createBlock(L,{key:0,class:"chart-skeleton",type:"table"})):b.value?(n.openBlock(),n.createBlock(h,{key:1,"action-button-visible":!1,"data-testid":"chart-empty-state","icon-variant":"error"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(y.value),1)]),_:1})):n.unref(p)?n.renderSlot(C.$slots,"default",{key:2,data:n.unref(p)}):n.createCommentVNode("",!0)}}}),Ke={class:"analytics-chart"},He=n.defineComponent({__name:"SimpleChartRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{}},setup(e){n.useCssVars(i=>({"8c62ff26":`${i.height}px`}));const t=e,r={[w.Gauge]:v.ChartTypesSimple.GAUGE},o=n.computed(()=>({...t.chartOptions,type:r[t.chartOptions.type]}));return(i,a)=>(n.openBlock(),n.createBlock(F,{context:i.context,query:i.query,"query-ready":i.queryReady},{default:n.withCtx(({data:s})=>[n.createElementVNode("div",Ke,[n.createVNode(n.unref(v.SimpleChart),{"chart-data":s,"chart-options":o.value,"synthetics-data-key":i.chartOptions.syntheticsDataKey},null,8,["chart-data","chart-options","synthetics-data-key"])])]),_:1},8,["context","query","query-ready"]))}}),I=(e,t)=>{const r=e.__vccOpts||e;for(const[o,i]of t)r[o]=i;return r},Me=I(He,[["__scopeId","data-v-f0f6ed41"]]),Ge={class:"analytics-chart"},he=I(n.defineComponent({__name:"BarChartRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{}},setup(e){n.useCssVars(i=>({"1eed717c":`${i.height}px`}));const t=e,r={[w.HorizontalBar]:v.ChartTypes.HORIZONTAL_BAR,[w.VerticalBar]:v.ChartTypes.VERTICAL_BAR},o=n.computed(()=>({type:r[t.chartOptions.type],stacked:t.chartOptions.stacked,chartDatasetColors:t.chartOptions.chartDatasetColors}));return(i,a)=>(n.openBlock(),n.createBlock(F,{context:i.context,query:i.query,"query-ready":i.queryReady},{default:n.withCtx(({data:s})=>[n.createElementVNode("div",Ge,[n.createVNode(n.unref(v.AnalyticsChart),{"allow-csv-export":i.chartOptions.allowCsvExport,"chart-data":s,"chart-options":o.value,"chart-title":i.chartOptions.chartTitle,"legend-position":"bottom","show-annotations":!1,"synthetics-data-key":i.chartOptions.syntheticsDataKey,"tooltip-title":""},null,8,["allow-csv-export","chart-data","chart-options","chart-title","synthetics-data-key"])])]),_:1},8,["context","query","query-ready"]))}}),[["__scopeId","data-v-36598a1b"]]),Ye={class:"analytics-chart"},Ze=I(n.defineComponent({__name:"TimeseriesChartRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{}},setup(e){n.useCssVars(i=>({"4efa9c90":`${i.height}px`}));const t=e,r={[w.TimeseriesLine]:v.ChartTypes.TIMESERIES_LINE},o=n.computed(()=>{const i=t.chartOptions.stacked??!1;return{type:r[t.chartOptions.type],stacked:i,chartDatasetColors:t.chartOptions.chartDatasetColors}});return(i,a)=>(n.openBlock(),n.createBlock(F,{context:i.context,query:i.query,"query-ready":i.queryReady},{default:n.withCtx(({data:s})=>[n.createElementVNode("div",Ye,[n.createVNode(n.unref(v.AnalyticsChart),{"allow-csv-export":i.chartOptions.allowCsvExport,"chart-data":s,"chart-options":o.value,"chart-title":i.chartOptions.chartTitle,"legend-position":"bottom","synthetics-data-key":i.chartOptions.syntheticsDataKey,"tooltip-title":""},null,8,["allow-csv-export","chart-data","chart-options","chart-title","synthetics-data-key"])])]),_:1},8,["context","query","query-ready"]))}}),[["__scopeId","data-v-ceb07ca8"]]),Qe={class:"metric-card-tile-wrapper"},We=I(n.defineComponent({__name:"GoldenSignalsRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{}},setup(e){const t=e,r=n.computed(()=>{const i=t.context.timeSpec;if(i.type==="absolute")return new J.Timeframe({key:"custom",timeframeText:"custom",display:"custom",startCustom:i.start,endCustom:i.end,timeframeLength:()=>0,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["free","plus","enterprise"]});const a=J.TimePeriods.get(i.time_range);if(!a)throw new Error("Unknown time range");return a}),o=n.computed(()=>{var i;return{datasource:(i=t.query)==null?void 0:i.datasource,overrideTimeframe:r.value,tz:t.context.tz,additionalFilter:t.context.filters,longCardTitles:t.chartOptions.longCardTitles,containerTitle:t.chartOptions.chartTitle,description:t.chartOptions.description,percentileLatency:t.chartOptions.percentileLatency,refreshInterval:t.context.refreshInterval,queryReady:t.queryReady}});return(i,a)=>(n.openBlock(),n.createElementBlock("div",Qe,[n.createVNode(n.unref(W.MetricsProvider),n.normalizeProps(n.guardReactiveProps(o.value)),{default:n.withCtx(()=>[n.createVNode(n.unref(W.MetricsConsumer))]),_:1},16)]))}}),[["__scopeId","data-v-6d704e9d"]]),ge="20px";var q=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(q||{});function Je(){return{getAxiosInstance:(e={})=>{try{const t=n.inject("get-axios-instance",void 0);return typeof t=="function"?t(e):Q.create({withCredentials:!0,timeout:3e4,...e})}catch(t){return console.warn("getAxiosInstance:",t.message||t),Q.create({withCredentials:!0,timeout:3e4,...e})}},getTraceIdFromError:e=>{var t;return((t=e==null?void 0:e.response)==null?void 0:t.headers["x-datadog-trace-id"])||""}}}function Xe(){return{debounce:(e,t)=>{let r;return(...o)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...o)},t)}}}}function H(e={}){const{getAxiosInstance:t}=Je();return{axiosInstance:t(e)}}const et={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},tt={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},rt={actions:{viewConfiguration:"View Configuration",save:"Save",cancel:"Cancel",back:"Back"},configuration:{title:"Configuration",message:"Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML or JSON. This allows for straightforward importing into APIOps tools like decK with YAML, or Insomnia and cURL with JSON.",yaml:"YAML",json:"JSON"},errors:{edit:"The entity could not be edited at this time."}},nt={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},it={title:"Configuration",actions:{copy:"Copy JSON"},sections:{advanced:"Advanced",plugin:"Plugin Specific Configuration"},commonFields:{id_label:"ID",name_label:"Name",enabled_label:"Enabled",enabled_tooltip:"Enabled is FTW",updated_at_label:"Last Updated",created_at_label:"Created",tags_label:"Tags",link:"Link"},statusBadge:{enabledLabel:"Enabled",disabledLabel:"Disabled"},copy:{tooltip:"Copy {label}",success:"Copied!"},errors:{load:"The entity configuration data could not be loaded at this time.",copy:"Failed to copy to clipboard"},general:{entryTitle:"Entry {index}",structuredFormat:"Structured"}},ot={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},at={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},st={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},ct={utf8Name:"The name can be any string containing characters, letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."},lt={enable:{title:"Enable {entityType}",message:"Are you sure you want to enable the {entityType} {entityName}?",confirmText:"Yes, enable"},disable:{title:"Disable {entityType}",message:"Are you sure you want to disable the {entityType} {entityName}?",confirmText:"Yes, disable"}},ut={global:et,deleteModal:tt,baseForm:rt,baseTable:nt,baseConfigCard:it,filter:ot,debouncedFilter:at,errors:st,validationErrors:ct,toggleModal:lt};function z(){const e=V.createI18n("en-us",ut);return{i18n:e,i18nT:V.i18nTComponent(e)}}function _e(){const e=(r,o)=>(o==null?void 0:o[r])??void 0,t=(r,o)=>{if(r.length!==o.length)return!1;const i=new Set([...r,...o]);for(const a of i){const s=r.filter(p=>p===a).length,c=o.filter(p=>p===a).length;if(s!==c)return!1}return!0};return{getPropValue:e,objectsAreEqual:(r,o,i)=>{if(i){if(Object.keys(r).length===Object.keys(o).length)for(const a in r)if(Array.isArray(r[a])&&Array.isArray(o[a])){if(t(r[a],o[a]))continue;return!1}else{if(r[a]===o[a])continue;return!1}else return!1;return!0}try{return JSON.stringify(r)===JSON.stringify(o)}catch{return!1}},sortAlpha:r=>(o,i)=>{let a=o[r]===void 0||o[r]===null?"":o[r],s=i[r]===void 0||i[r]===null?"":i[r];return Array.isArray(o[r])&&(a=o[r][0]),Array.isArray(i[r])&&(s=i[r][0]),a.localeCompare(s)},isValidUuid:r=>r?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(r):!1}}function pt(e,t,r,o={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="1000");const{axiosInstance:i}=H(e.axiosRequestConfig),{i18n:{t:a}}=z(),{debounce:s}=Xe(),c=s(async h=>{await L(h)},200),p=n.ref(!1),u=n.ref(""),f=n.ref(""),l=n.ref([]),m=n.ref([]),y=n.ref(void 0),b=n.computed(()=>{const h=`${e.apiBaseUrl}${n.unref(t)}`;return e.app==="konnect"?h.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"?h.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""):h}),{isValidUuid:T}=_e(),C=async()=>{try{p.value=!0;const{data:h}=await i.get(`${b.value}?size=${r}`);h!=null&&h.next||(y.value=o.fetchedItemsKey in h?h[o.fetchedItemsKey]:[]),m.value=o.fetchedItemsKey in h?h[o.fetchedItemsKey]:[],l.value=m.value}catch{l.value=[],u.value=a("debouncedFilter.errors.fetch")}finally{p.value=!1}},A=n.ref(""),L=async h=>{var _,O,U;if(A.value!==h){if(h===""){l.value=m.value;return}else A.value=h||"";if(y.value===void 0)try{if(p.value=!0,u.value="",f.value="",e.app==="konnect"){let k=b.value+"";h&&(k+=`/${h}`);const{data:E}=await i.get(`${k}?size=${r}`);o.fetchedItemsKey in E?l.value=E[o.fetchedItemsKey]:E!=null&&E[o.exactMatchKey??"id"]?l.value=[E]:l.value=[]}else if(h){const k=[];T(h)&&o.searchKeys.includes("id")?k.push((async()=>{const{data:S}=await i.get(`${b.value}/${h}`);return[S[o.fetchedItemsKey]??S]})()):k.push(...o.searchKeys.filter(S=>S!=="id").map(async S=>{const{data:N}=await i.get(`${b.value}?${S}=${h}`);return N[o.fetchedItemsKey]}));const E=await Promise.all(k),j=new Set;l.value=[],(_=E==null?void 0:E.forEach)==null||_.call(E,S=>{var N;(N=S==null?void 0:S.forEach)==null||N.call(S,Z=>{j.has(Z.id)||(j.add(Z.id),l.value.push(Z))})})}else l.value=m.value}catch(k){((O=k==null?void 0:k.response)==null?void 0:O.status)===404?f.value=a("debouncedFilter.errors.invalid"):(l.value=[],u.value=a("debouncedFilter.errors.fetch"))}finally{p.value=!1}else p.value=!0,f.value="",h?(l.value=(U=y.value)==null?void 0:U.filter(k=>{var E;let j=!1;for(const S of o.searchKeys){const N=typeof k[S]=="string"?(E=k[S])==null?void 0:E.toLowerCase():k[S];N!=null&&N.includes(h.toLowerCase())&&(j=!0)}return j}),(!l.value||!l.value.length)&&(f.value=a("debouncedFilter.errors.invalid"))):l.value=y.value,p.value=!1}};return{loading:p,error:u,validationError:f,results:l,allRecords:y,loadItems:C,debouncedQueryChange:c}}function dt(e,t){const r=n.unref(t),o=n.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${r}`):new URL(r));return o.value.search="",i=>`${o.value.href}/${i}`}function yt(){const{i18n:{t:e}}=z();return{getMessageFromError:t=>{var r,o,i,a;if(!t)return e("errors.unexpected");if(((r=t==null?void 0:t.response)==null?void 0:r.status)===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if((o=t==null?void 0:t.response)!=null&&o.data){if(t.response.data.detail)return t.response.data.detail;if((i=t.response.data.details)!=null&&i.length)return t.response.data.details.map(s=>{let c=e("errors.unexpected");return s.messages&&typeof s.messages=="object"&&s.messages.length&&(c=s.messages.join(", ")),s.field?`${s.field} - ${c}`:c}).join("; ");if(t.response.data.message){const{message:s}=t.response.data;return Array.isArray(s)?(a=s[0])!=null&&a.constraints?Object.values(s[0].constraints)[0]:s[0]:s}if(typeof t.response.data=="string")return t.response.data;if(typeof t.response.data=="object")return Object.keys(t.response.data).map(s=>`${s} ${t.response.data[s]}`).join(", ")}return t.message||e("errors.unexpected")}}}function ft(e){const t=window.location.origin,r=t.endsWith("/")?t:`${t}/`;try{const o=e.join("/"),i=`${r}${o}`,a=e.some(s=>s.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(i)&&!a&&new URL(i))return`${r}${o}`;throw new Error("Invalid url")}catch(o){return console.warn("Failed to build valid URL:",o),""}}function be(e,t){const r=n.ref(n.unref(e)),o=n.ref(n.unref(t)),i=n.computed(()=>!!(r.value.app==="konnect"||r.value.isExactMatch)),a=n.computed(()=>o.value.startsWith("/")?new URL(`${window.location.origin}${o.value}`):new URL(o.value));return s=>{const{page:c,pageSize:p,offset:u,sortColumnKey:f,sortColumnOrder:l,query:m}=s;try{let y=new URL(a.value.href);return i.value&&m?(y.search="",y=r.value.isExactMatch?new URL(`${y.href}/${m}/`):new URL(`${y.href}?filter[name][contains]=${m}`)):(i.value||new URLSearchParams(m).forEach((b,T)=>{y.searchParams.append(T,b)}),f&&y.searchParams.append("sort_by",f),l==="desc"&&y.searchParams.append("sort_desc","1"),y.searchParams.append("size",String(p))),u&&c!==1&&y.searchParams.append("offset",String(u)),y.href}catch(y){return console.error("RouteList(fetcher)",y),o.value}}}function mt(e,t,r="data"){const o=n.unref(t),{axiosInstance:i}=H(e.axiosRequestConfig),a=be(e,o),s=n.ref({status:q.Idle});return{fetcher:async c=>{var p;try{s.value={status:q.Loading};let u=a(c);u.includes("filter[name]")&&(u=`${u}&page[size]=${c.pageSize}&page[number]=${c.page}`);const f=await i.get(u);if(f.status>=400)throw f;const l=f.data,m=r&&r.replace(/[^\w-_]/gi,"");let y;l[m]&&Array.isArray(l[m])?y=l[m]:Array.isArray(l)?y=l:y=Object.keys(l).length?[l]:[];const b={data:y,total:y.length,...l.offset?{pagination:{offset:l.offset}}:null};return s.value={status:q.Idle,response:b},b}catch(u){const f={data:[],total:0};return c.query&&(((p=u.response)==null?void 0:p.status)===404||u.status===404)?(s.value={status:q.NoResults,response:f,error:u.response?u:{response:u}},f):(s.value={status:q.Error,response:f,error:u.response?u:{response:u}},f)}},fetcherState:s}}function ht(){const e=(r,o="_")=>r?r.split(o).map(i=>i.toLowerCase()==="id"?i.toUpperCase():i.charAt(0).toUpperCase()+i.substring(1)).join(" "):"",t=/(?:^|[\s-:'"])\w/g;return{capitalize:r=>r?r.replace(t,o=>o.toUpperCase()):"",convertKeyToTitle:e}}const ke=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,we=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(ke);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},Se=e=>e==="*"||e==="x"||e==="X",Ee=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},gt=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],_t=(e,t)=>{if(Se(e)||Se(t))return 0;const[r,o]=gt(Ee(e),Ee(t));return r>o?1:r<o?-1:0},Te=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const o=_t(e[r]||"0",t[r]||"0");if(o!==0)return o}return 0},bt=(e,t)=>{const r=we(e),o=we(t),i=r.pop(),a=o.pop(),s=Te(r,o);return s!==0?s:i&&a?Te(i.split("."),a.split(".")):i||a?i?-1:1:0},ve=(e,t,r)=>{kt(r);const o=bt(e,t);return Ce[r].includes(o)},Ce={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Ie=Object.keys(Ce),kt=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Ie.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Ie.join("|")}`)},wt=e=>typeof e=="string"&&/^[v\d]/.test(e)&&ke.test(e);function St(e){const{gatewayInfo:t,supportedRange:r}=e;if(!t)return!0;const{edition:o,version:i}=t;if(!wt(i))return console.error("Invalid version"),!1;const a=r[o];if(!a)return!1;const[s,c]=a;return!(s&&ve(i,s,"<")||c&&ve(i,c,">"))}function Et(e){const t=n.ref(0),r=n.ref(0),o=n.ref(!1);return n.watch(e,i=>{i&&!o.value&&(t.value=i.offsetWidth,r.value=i.scrollWidth,o.value=!0)}),{isTruncated:n.computed(()=>t.value<r.value)}}function Tt(){const{i18n:{t:e}}=z();return{utf8Name:t=>/^[\p{N}\p{L}.\-_~]*$/u.test(t)?"":e("validationErrors.utf8Name")}}const xe={useAxios:H,useDebouncedFilter:pt,useDeleteUrlBuilder:dt,useErrors:yt,useExternalLinkCreator:ft,useFetcher:mt,useFetchUrlBuilder:be,useHelpers:_e,useStringHelpers:ht,useI18n:z,useGatewayFeatureSupported:St,useTruncationDetector:Et,useValidators:Tt},vt=(e,t)=>{const r=e.__vccOpts||e;for(const[o,i]of t)r[o]=i;return r},Ct="#0044f4",It="16px";/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Ae(e){return typeof e>"u"||e===null}function xt(e){return typeof e=="object"&&e!==null}function At(e){return Array.isArray(e)?e:Ae(e)?[]:[e]}function Nt(e,t){var r,o,i,a;if(t)for(a=Object.keys(t),r=0,o=a.length;r<o;r+=1)i=a[r],e[i]=t[i];return e}function qt(e,t){var r="",o;for(o=0;o<t;o+=1)r+=e;return r}function Rt(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Lt=Ae,Ot=xt,Dt=At,Bt=qt,jt=Rt,Vt=Nt,M={isNothing:Lt,isObject:Ot,toArray:Dt,repeat:Bt,isNegativeZero:jt,extend:Vt};function Ne(e,t){var r="",o=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
|
|
1
|
+
(function(d,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("@kong-ui-public/analytics-chart"),require("swrv"),require("axios"),require("@kong-ui-public/i18n"),require("@kong-ui-public/analytics-metric-provider"),require("@kong-ui-public/analytics-utilities"),require("@kong/kongponents"),require("vue-router"),require("@kong-ui-public/analytics-config-store")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/analytics-chart","swrv","axios","@kong-ui-public/i18n","@kong-ui-public/analytics-metric-provider","@kong-ui-public/analytics-utilities","@kong/kongponents","vue-router","@kong-ui-public/analytics-config-store"],n):(d=typeof globalThis<"u"?globalThis:d||self,n(d["kong-ui-public-dashboard-renderer"]={},d.Vue,d["kong-ui-public-analytics-chart"],d.swrv,d.axios,d["kong-ui-public-i18n"],d["kong-ui-public-analytics-metric-provider"],d["kong-ui-public-analytics-utilities"],d.Kongponents,d.VueRouter,d["kong-ui-public-analytics-config-store"]))})(this,function(d,n,v,je,Q,$,W,J,yn,fn,$e){"use strict";const P="analytics-query-provider",K="{entity-id}",X="{cp-id}",ee="{timeframe}";var k=(e=>(e.HorizontalBar="horizontal_bar",e.VerticalBar="vertical_bar",e.Gauge="gauge",e.TimeseriesLine="timeseries_line",e.GoldenSignals="golden_signals",e.TopN="top_n",e.Slottable="slottable",e))(k||{});const V={type:"string"},D={type:"string"},te={type:"boolean"},re={type:["object","array"],items:{type:"string"},additionalProperties:{type:"string"}},ne={type:"object",properties:{type:{type:"string",enum:["slottable"]},id:{type:"string"}},required:["type","id"],additionalProperties:!1},ie={type:"object",properties:{type:{type:"string",enum:["horizontal_bar","vertical_bar"]},stacked:{type:"boolean"},chartDatasetColors:re,syntheticsDataKey:V,chartTitle:D,allowCsvExport:te},required:["type"],additionalProperties:!1},oe={type:"object",properties:{type:{type:"string",enum:["timeseries_line"]},stacked:{type:"boolean"},chartDatasetColors:re,syntheticsDataKey:V,chartTitle:D,allowCsvExport:te},required:["type"],additionalProperties:!1},ae={type:"object",properties:{type:{type:"string",enum:["gauge"]},metricDisplay:{type:"string",enum:Object.values(v.ChartMetricDisplay)},reverseDataset:{type:"boolean"},numerator:{type:"number"},syntheticsDataKey:V,chartTitle:D},required:["type"],additionalProperties:!1},se={type:"object",properties:{chartTitle:D,syntheticsDataKey:V,type:{type:"string",enum:["top_n"]},description:{type:"string"},entityLink:{type:"string"}},required:["type"],additionalProperties:!1},ce={type:"object",properties:{chartTitle:D,type:{type:"string",enum:["golden_signals"]},longCardTitles:{type:"boolean"},description:{type:"string"},percentileLatency:{type:"boolean"}},required:["type"]},le={type:"object",description:"A query to launch at the API",properties:{datasource:{type:"string",enum:["advanced","basic"]},metrics:{type:"array",description:"List of aggregated metrics to collect across the requested time span.",items:{type:"string",enum:["request_count","request_per_minute","response_latency_p99","response_latency_p95","response_latency_p50","response_latency_average","upstream_latency_p99","upstream_latency_p95","upstream_latency_p50","upstream_latency_average","kong_latency_p99","kong_latency_p95","kong_latency_p50","kong_latency_average","response_size_p99","response_size_p95","response_size_p50","request_size_p99","request_size_p95","request_size_p50","request_size_average","response_size_average"]}},dimensions:{type:"array",description:"List of attributes or entity types to group by.",minItems:0,maxItems:2,items:{type:"string",enum:["api_product","api_product_version","application","consumer","control_plane","control_plane_group","data_plane_node","gateway_service","route","status_code","status_code_grouped","time"]}},filters:{type:"array",description:"A list of filters to apply to the query.",items:{type:"object",description:"A filter that specifies which data to include in the query",properties:{dimension:{type:"string",enum:["api_product","api_product_version","application","consumer","control_plane","control_plane_group","data_plane_node","gateway_service","route","status_code","status_code_grouped","time"]},type:{type:"string",enum:["in","not_in","selector"]},values:{type:"array",items:{type:"string"}}},required:["dimension","type","values"]}},granularity_ms:{type:"number",description:'Force time grouping into buckets of this duration in milliseconds. Only has an effect if "time" is in the "dimensions" list.',minimum:6e4},time_range:{description:"The time range to query.",oneOf:[{type:"object",properties:{tz:{type:"string",default:"Etc/UTC"},type:{type:"string",enum:["relative"]},time_range:{type:"string",enum:["15m","1h","6h","12h","24h","7d","30d","current_week","current_month","previous_week","previous_month"],default:"1h"}},required:["type","time_range"]},{type:"object",description:"A duration representing an exact start and end time.",properties:{tz:{type:"string",default:"Etc/UTC"},type:{type:"string",enum:["absolute"]},start:{type:"string"},end:{type:"string"}},required:["type"]}],default:{type:"relative",time_range:"1h"}},limit:{type:"number"},meta:{type:"object"}},required:["datasource"],additionalProperties:!1},ue={oneOf:[le]},pe={type:"object",properties:{query:ue,chart:{oneOf:[ie,ae,oe,ce,se,ne]}},required:["query","chart"],additionalProperties:!1},de={type:"object",properties:{position:{type:"object",properties:{col:{type:"number"},row:{type:"number"}},description:"Position of the tile in the grid.",required:["col","row"],additionalProperties:!1},size:{type:"object",properties:{cols:{type:"number"},rows:{type:"number"},fitToContent:{type:"boolean"}},description:"Number of columns and rows the tile occupies. If fitToContent is true for every tile in a row, and each tile only occupies 1 row, then the row will auto-fit to its content.",required:["cols","rows"],additionalProperties:!1}},required:["position","size"],additionalProperties:!1},ye={type:"object",properties:{definition:pe,layout:de},required:["definition","layout"],additionalProperties:!1},Ve={type:"object",properties:{tiles:{type:"array",items:ye},tileHeight:{type:"number",description:"Height of each tile in pixels. Default: 170"},gridSize:{type:"object",properties:{cols:{type:"number"},rows:{type:"number"}},description:"Number of columns and rows in the grid.",required:["cols","rows"],additionalProperties:!1}},required:["tiles","gridSize"],additionalProperties:!1};var fe=(e=>(e.VALIDATING="VALIDATING",e.VALIDATING_HAS_DATA="VALIDATING_HAS_DATA",e.PENDING="PENDING",e.SUCCESS="SUCCESS",e.SUCCESS_HAS_DATA="SUCCESS_HAS_DATA",e.ERROR="ERROR",e.STALE_IF_ERROR="STALE_IF_ERROR",e))(fe||{});const Fe=e=>{var t,r,o,i,a;return e?!!((t=Object.keys(e))!=null&&t.length||(r=e.data)!=null&&r.length||(i=(o=e.data)==null?void 0:o.data)!=null&&i.length||!((a=e.data)!=null&&a.data)&&typeof e.data=="object"&&Object.keys(e==null?void 0:e.data).length):!1};function ze(e=n.ref({}),t,r,o=Fe){const i=n.ref("PENDING");return n.watchEffect(()=>{const a=o(e.value);if(e.value&&a&&r.value){i.value="VALIDATING_HAS_DATA";return}if(e.value&&r.value){i.value="VALIDATING";return}if(e.value&&t.value){i.value="STALE_IF_ERROR";return}if(e.value===void 0&&!t.value){i.value="PENDING";return}if(e.value&&!t.value&&a){i.value="SUCCESS_HAS_DATA";return}if(e.value&&!t.value){i.value="SUCCESS";return}e.value===void 0&&t&&(i.value="ERROR")}),{state:i,swrvState:fe}}const Ue={renderer:{noQueryBridge:"No query bridge provided. Unable to render dashboard.",trendRange:{"24h":"Last 24-Hour Summary","7d":"Last 7-Day Summary","30d":"Last 30-Day Summary"}},queryDataProvider:{timeRangeExceeded:"The time range for this report is outside of your organization's data retention period"}};function Pe(){const e=$.createI18n("en-us",Ue);return{i18n:e,i18nT:$.i18nTComponent(e)}}const me={useI18n:Pe},F=n.defineComponent({__name:"QueryDataProvider",props:{context:{},query:{},queryReady:{type:Boolean}},emits:["queryComplete"],setup(e,{emit:t}){const r=e,o=t,{i18n:i}=me.useI18n(),a=n.inject(P),s=()=>r.queryReady&&a?JSON.stringify([r.query,r.context]):null,c=new AbortController;n.onUnmounted(()=>{c.abort()});const{data:p,error:l,isValidating:f}=je(s,async()=>{var C,A,L,h;try{const _=[];r.query.filters&&_.push(...r.query.filters),_.push(...r.context.filters);let{datasource:O,...U}=r.query;!O&&a&&(O=a.evaluateFeatureFlagFn("MA-2527-analytics-sku-config-endpoint",!1)?"basic":"advanced");const w={datasource:O,query:{...U,time_range:{...r.context.timeSpec,tz:r.context.tz},filters:_}};return a==null?void 0:a.queryFn(w,c)}catch(_){y.value=((A=(C=_==null?void 0:_.response)==null?void 0:C.data)==null?void 0:A.message)==="Range not allowed for this tier"?i.t("queryDataProvider.timeRangeExceeded"):((h=(L=_==null?void 0:_.response)==null?void 0:L.data)==null?void 0:h.message)||(_==null?void 0:_.message)}finally{o("queryComplete")}},{refreshInterval:r.context.refreshInterval,revalidateOnFocus:!1}),{state:u,swrvState:m}=ze(p,l,f),y=n.ref(null),b=n.computed(()=>u.value===m.ERROR||!!y.value),E=n.computed(()=>!r.queryReady||u.value===m.PENDING);return(C,A)=>{const L=n.resolveComponent("KSkeleton"),h=n.resolveComponent("KEmptyState");return E.value||!n.unref(p)&&!b.value?(n.openBlock(),n.createBlock(L,{key:0,class:"chart-skeleton",type:"table"})):b.value?(n.openBlock(),n.createBlock(h,{key:1,"action-button-visible":!1,"data-testid":"chart-empty-state","icon-variant":"error"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(y.value),1)]),_:1})):n.unref(p)?n.renderSlot(C.$slots,"default",{key:2,data:n.unref(p)}):n.createCommentVNode("",!0)}}}),Ke={class:"analytics-chart"},He=n.defineComponent({__name:"SimpleChartRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{}},setup(e){n.useCssVars(i=>({"8c62ff26":`${i.height}px`}));const t=e,r={[k.Gauge]:v.ChartTypesSimple.GAUGE},o=n.computed(()=>({...t.chartOptions,type:r[t.chartOptions.type]}));return(i,a)=>(n.openBlock(),n.createBlock(F,{context:i.context,query:i.query,"query-ready":i.queryReady},{default:n.withCtx(({data:s})=>[n.createElementVNode("div",Ke,[n.createVNode(n.unref(v.SimpleChart),{"chart-data":s,"chart-options":o.value,"synthetics-data-key":i.chartOptions.syntheticsDataKey},null,8,["chart-data","chart-options","synthetics-data-key"])])]),_:1},8,["context","query","query-ready"]))}}),I=(e,t)=>{const r=e.__vccOpts||e;for(const[o,i]of t)r[o]=i;return r},Me=I(He,[["__scopeId","data-v-f0f6ed41"]]),Ge={class:"analytics-chart"},he=I(n.defineComponent({__name:"BarChartRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{}},setup(e){n.useCssVars(i=>({"1eed717c":`${i.height}px`}));const t=e,r={[k.HorizontalBar]:v.ChartTypes.HORIZONTAL_BAR,[k.VerticalBar]:v.ChartTypes.VERTICAL_BAR},o=n.computed(()=>({type:r[t.chartOptions.type],stacked:t.chartOptions.stacked,chartDatasetColors:t.chartOptions.chartDatasetColors}));return(i,a)=>(n.openBlock(),n.createBlock(F,{context:i.context,query:i.query,"query-ready":i.queryReady},{default:n.withCtx(({data:s})=>[n.createElementVNode("div",Ge,[n.createVNode(n.unref(v.AnalyticsChart),{"allow-csv-export":i.chartOptions.allowCsvExport,"chart-data":s,"chart-options":o.value,"chart-title":i.chartOptions.chartTitle,"legend-position":"bottom","show-annotations":!1,"synthetics-data-key":i.chartOptions.syntheticsDataKey,"tooltip-title":""},null,8,["allow-csv-export","chart-data","chart-options","chart-title","synthetics-data-key"])])]),_:1},8,["context","query","query-ready"]))}}),[["__scopeId","data-v-36598a1b"]]),Ye={class:"analytics-chart"},Ze=I(n.defineComponent({__name:"TimeseriesChartRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{}},setup(e){n.useCssVars(i=>({"4efa9c90":`${i.height}px`}));const t=e,r={[k.TimeseriesLine]:v.ChartTypes.TIMESERIES_LINE},o=n.computed(()=>{const i=t.chartOptions.stacked??!1;return{type:r[t.chartOptions.type],stacked:i,chartDatasetColors:t.chartOptions.chartDatasetColors}});return(i,a)=>(n.openBlock(),n.createBlock(F,{context:i.context,query:i.query,"query-ready":i.queryReady},{default:n.withCtx(({data:s})=>[n.createElementVNode("div",Ye,[n.createVNode(n.unref(v.AnalyticsChart),{"allow-csv-export":i.chartOptions.allowCsvExport,"chart-data":s,"chart-options":o.value,"chart-title":i.chartOptions.chartTitle,"legend-position":"bottom","synthetics-data-key":i.chartOptions.syntheticsDataKey,"tooltip-title":""},null,8,["allow-csv-export","chart-data","chart-options","chart-title","synthetics-data-key"])])]),_:1},8,["context","query","query-ready"]))}}),[["__scopeId","data-v-ceb07ca8"]]),Qe={class:"metric-card-tile-wrapper"},We=I(n.defineComponent({__name:"GoldenSignalsRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{}},setup(e){const t=e,r=n.computed(()=>{const i=t.context.timeSpec;if(i.type==="absolute")return new J.Timeframe({key:"custom",timeframeText:"custom",display:"custom",startCustom:i.start,endCustom:i.end,timeframeLength:()=>0,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["free","plus","enterprise"]});const a=J.TimePeriods.get(i.time_range);if(!a)throw new Error("Unknown time range");return a}),o=n.computed(()=>{var i;return{datasource:(i=t.query)==null?void 0:i.datasource,overrideTimeframe:r.value,tz:t.context.tz,additionalFilter:t.context.filters,longCardTitles:t.chartOptions.longCardTitles,containerTitle:t.chartOptions.chartTitle,description:t.chartOptions.description,percentileLatency:t.chartOptions.percentileLatency,refreshInterval:t.context.refreshInterval,queryReady:t.queryReady}});return(i,a)=>(n.openBlock(),n.createElementBlock("div",Qe,[n.createVNode(n.unref(W.MetricsProvider),n.normalizeProps(n.guardReactiveProps(o.value)),{default:n.withCtx(()=>[n.createVNode(n.unref(W.MetricsConsumer))]),_:1},16)]))}}),[["__scopeId","data-v-6d704e9d"]]),ge="20px";var q=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(q||{});function Je(){return{getAxiosInstance:(e={})=>{try{const t=n.inject("get-axios-instance",void 0);return typeof t=="function"?t(e):Q.create({withCredentials:!0,timeout:3e4,...e})}catch(t){return console.warn("getAxiosInstance:",t.message||t),Q.create({withCredentials:!0,timeout:3e4,...e})}},getTraceIdFromError:e=>{var t;return((t=e==null?void 0:e.response)==null?void 0:t.headers["x-datadog-trace-id"])||""}}}function Xe(){return{debounce:(e,t)=>{let r;return(...o)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...o)},t)}}}}function H(e={}){const{getAxiosInstance:t}=Je();return{axiosInstance:t(e)}}const et={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},tt={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},rt={actions:{viewConfiguration:"View Configuration",save:"Save",cancel:"Cancel",back:"Back"},configuration:{title:"Configuration",message:"Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML or JSON. This allows for straightforward importing into APIOps tools like decK with YAML, or Insomnia and cURL with JSON.",yaml:"YAML",json:"JSON"},errors:{edit:"The entity could not be edited at this time."}},nt={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},it={title:"Configuration",actions:{copy:"Copy JSON"},sections:{advanced:"Advanced",plugin:"Plugin Specific Configuration"},commonFields:{id_label:"ID",name_label:"Name",enabled_label:"Enabled",enabled_tooltip:"Enabled is FTW",updated_at_label:"Last Updated",created_at_label:"Created",tags_label:"Tags",link:"Link"},statusBadge:{enabledLabel:"Enabled",disabledLabel:"Disabled"},copy:{tooltip:"Copy {label}",success:"Copied!"},errors:{load:"The entity configuration data could not be loaded at this time.",copy:"Failed to copy to clipboard"},general:{entryTitle:"Entry {index}",structuredFormat:"Structured"}},ot={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},at={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},st={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},ct={utf8Name:"The name can be any string containing characters, letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."},lt={enable:{title:"Enable {entityType}",message:"Are you sure you want to enable the {entityType} {entityName}?",confirmText:"Yes, enable"},disable:{title:"Disable {entityType}",message:"Are you sure you want to disable the {entityType} {entityName}?",confirmText:"Yes, disable"}},ut={global:et,deleteModal:tt,baseForm:rt,baseTable:nt,baseConfigCard:it,filter:ot,debouncedFilter:at,errors:st,validationErrors:ct,toggleModal:lt};function z(){const e=$.createI18n("en-us",ut);return{i18n:e,i18nT:$.i18nTComponent(e)}}function _e(){const e=(r,o)=>(o==null?void 0:o[r])??void 0,t=(r,o)=>{if(r.length!==o.length)return!1;const i=new Set([...r,...o]);for(const a of i){const s=r.filter(p=>p===a).length,c=o.filter(p=>p===a).length;if(s!==c)return!1}return!0};return{getPropValue:e,objectsAreEqual:(r,o,i)=>{if(i){if(Object.keys(r).length===Object.keys(o).length)for(const a in r)if(Array.isArray(r[a])&&Array.isArray(o[a])){if(t(r[a],o[a]))continue;return!1}else{if(r[a]===o[a])continue;return!1}else return!1;return!0}try{return JSON.stringify(r)===JSON.stringify(o)}catch{return!1}},sortAlpha:r=>(o,i)=>{let a=o[r]===void 0||o[r]===null?"":o[r],s=i[r]===void 0||i[r]===null?"":i[r];return Array.isArray(o[r])&&(a=o[r][0]),Array.isArray(i[r])&&(s=i[r][0]),a.localeCompare(s)},isValidUuid:r=>r?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(r):!1}}function pt(e,t,r,o={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="1000");const{axiosInstance:i}=H(e.axiosRequestConfig),{i18n:{t:a}}=z(),{debounce:s}=Xe(),c=s(async h=>{await L(h)},200),p=n.ref(!1),l=n.ref(""),f=n.ref(""),u=n.ref([]),m=n.ref([]),y=n.ref(void 0),b=n.computed(()=>{const h=`${e.apiBaseUrl}${n.unref(t)}`;return e.app==="konnect"?h.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"?h.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""):h}),{isValidUuid:E}=_e(),C=async()=>{try{p.value=!0;const{data:h}=await i.get(`${b.value}?size=${r}`);h!=null&&h.next||(y.value=o.fetchedItemsKey in h?h[o.fetchedItemsKey]:[]),m.value=o.fetchedItemsKey in h?h[o.fetchedItemsKey]:[],u.value=m.value}catch{u.value=[],l.value=a("debouncedFilter.errors.fetch")}finally{p.value=!1}},A=n.ref(""),L=async h=>{var _,O,U;if(A.value!==h){if(A.value=h??"",!h){u.value=m.value;return}if(y.value===void 0)try{if(p.value=!0,l.value="",f.value="",e.app==="konnect"){const w=`${b.value}/${h}`,{data:T}=await i.get(`${w}?size=${r}`);o.fetchedItemsKey in T?u.value=T[o.fetchedItemsKey]:T!=null&&T[o.exactMatchKey??"id"]?u.value=[T]:u.value=[]}else{const w=[];E(h)&&o.searchKeys.includes("id")?w.push((async()=>{const{data:S}=await i.get(`${b.value}/${h}`);return[S[o.fetchedItemsKey]??S]})()):w.push(...o.searchKeys.filter(S=>S!=="id").map(async S=>{const{data:N}=await i.get(`${b.value}?${S}=${h}`);return N[o.fetchedItemsKey]}));const T=await Promise.all(w),j=new Set;u.value=[],(_=T==null?void 0:T.forEach)==null||_.call(T,S=>{var N;(N=S==null?void 0:S.forEach)==null||N.call(S,Z=>{j.has(Z.id)||(j.add(Z.id),u.value.push(Z))})})}}catch(w){((O=w==null?void 0:w.response)==null?void 0:O.status)===404?f.value=a("debouncedFilter.errors.invalid"):(u.value=[],l.value=a("debouncedFilter.errors.fetch"))}finally{p.value=!1}else p.value=!0,f.value="",u.value=(U=y.value)==null?void 0:U.filter(w=>{var T;let j=!1;for(const S of o.searchKeys){const N=typeof w[S]=="string"?(T=w[S])==null?void 0:T.toLowerCase():w[S];N!=null&&N.includes(h.toLowerCase())&&(j=!0)}return j}),(!u.value||!u.value.length)&&(f.value=a("debouncedFilter.errors.invalid")),p.value=!1}};return{loading:p,error:l,validationError:f,results:u,allRecords:y,loadItems:C,debouncedQueryChange:c}}function dt(e,t){const r=n.unref(t),o=n.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${r}`):new URL(r));return o.value.search="",i=>`${o.value.href}/${i}`}function yt(){const{i18n:{t:e}}=z();return{getMessageFromError:t=>{var r,o,i,a;if(!t)return e("errors.unexpected");if(((r=t==null?void 0:t.response)==null?void 0:r.status)===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if((o=t==null?void 0:t.response)!=null&&o.data){if(t.response.data.detail)return t.response.data.detail;if((i=t.response.data.details)!=null&&i.length)return t.response.data.details.map(s=>{let c=e("errors.unexpected");return s.messages&&typeof s.messages=="object"&&s.messages.length&&(c=s.messages.join(", ")),s.field?`${s.field} - ${c}`:c}).join("; ");if(t.response.data.message){const{message:s}=t.response.data;return Array.isArray(s)?(a=s[0])!=null&&a.constraints?Object.values(s[0].constraints)[0]:s[0]:s}if(typeof t.response.data=="string")return t.response.data;if(typeof t.response.data=="object")return Object.keys(t.response.data).map(s=>`${s} ${t.response.data[s]}`).join(", ")}return t.message||e("errors.unexpected")}}}function ft(e){const t=window.location.origin,r=t.endsWith("/")?t:`${t}/`;try{const o=e.join("/"),i=`${r}${o}`,a=e.some(s=>s.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(i)&&!a&&new URL(i))return`${r}${o}`;throw new Error("Invalid url")}catch(o){return console.warn("Failed to build valid URL:",o),""}}function be(e,t){const r=n.ref(n.unref(e)),o=n.ref(n.unref(t)),i=n.computed(()=>!!(r.value.app==="konnect"||r.value.isExactMatch)),a=n.computed(()=>o.value.startsWith("/")?new URL(`${window.location.origin}${o.value}`):new URL(o.value));return s=>{const{page:c,pageSize:p,offset:l,sortColumnKey:f,sortColumnOrder:u,query:m}=s;try{let y=new URL(a.value.href);return i.value&&m?(y.search="",y=r.value.isExactMatch?new URL(`${y.href}/${m}/`):new URL(`${y.href}?filter[name][contains]=${m}`)):(i.value||new URLSearchParams(m).forEach((b,E)=>{y.searchParams.append(E,b)}),f&&y.searchParams.append("sort_by",f),u==="desc"&&y.searchParams.append("sort_desc","1"),y.searchParams.append("size",String(p))),l&&c!==1&&y.searchParams.append("offset",String(l)),y.href}catch(y){return console.error("RouteList(fetcher)",y),o.value}}}function mt(e,t,r="data"){const o=n.unref(t),{axiosInstance:i}=H(e.axiosRequestConfig),a=be(e,o),s=n.ref({status:q.Idle});return{fetcher:async c=>{var p;try{s.value={status:q.Loading};let l=a(c);l.includes("filter[name]")&&(l=`${l}&page[size]=${c.pageSize}&page[number]=${c.page}`);const f=await i.get(l);if(f.status>=400)throw f;const u=f.data,m=r&&r.replace(/[^\w-_]/gi,"");let y;u[m]&&Array.isArray(u[m])?y=u[m]:Array.isArray(u)?y=u:y=Object.keys(u).length?[u]:[];const b={data:y,total:y.length,...u.offset?{pagination:{offset:u.offset}}:null};return s.value={status:q.Idle,response:b},b}catch(l){const f={data:[],total:0};return c.query&&(((p=l.response)==null?void 0:p.status)===404||l.status===404)?(s.value={status:q.NoResults,response:f,error:l.response?l:{response:l}},f):(s.value={status:q.Error,response:f,error:l.response?l:{response:l}},f)}},fetcherState:s}}function ht(){const e=(r,o="_")=>r?r.split(o).map(i=>i.toLowerCase()==="id"?i.toUpperCase():i.charAt(0).toUpperCase()+i.substring(1)).join(" "):"",t=/(?:^|[\s-:'"])\w/g;return{capitalize:r=>r?r.replace(t,o=>o.toUpperCase()):"",convertKeyToTitle:e}}const ke=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,we=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(ke);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},Se=e=>e==="*"||e==="x"||e==="X",Te=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},gt=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],_t=(e,t)=>{if(Se(e)||Se(t))return 0;const[r,o]=gt(Te(e),Te(t));return r>o?1:r<o?-1:0},Ee=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const o=_t(e[r]||"0",t[r]||"0");if(o!==0)return o}return 0},bt=(e,t)=>{const r=we(e),o=we(t),i=r.pop(),a=o.pop(),s=Ee(r,o);return s!==0?s:i&&a?Ee(i.split("."),a.split(".")):i||a?i?-1:1:0},ve=(e,t,r)=>{kt(r);const o=bt(e,t);return Ce[r].includes(o)},Ce={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Ie=Object.keys(Ce),kt=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Ie.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Ie.join("|")}`)},wt=e=>typeof e=="string"&&/^[v\d]/.test(e)&&ke.test(e);function St(e){const{gatewayInfo:t,supportedRange:r}=e;if(!t)return!0;const{edition:o,version:i}=t;if(!wt(i))return console.error("Invalid version"),!1;const a=r[o];if(!a)return!1;const[s,c]=a;return!(s&&ve(i,s,"<")||c&&ve(i,c,">"))}function Tt(e){const t=n.ref(0),r=n.ref(0),o=n.ref(!1);return n.watch(e,i=>{i&&!o.value&&(t.value=i.offsetWidth,r.value=i.scrollWidth,o.value=!0)}),{isTruncated:n.computed(()=>t.value<r.value)}}function Et(){const{i18n:{t:e}}=z();return{utf8Name:t=>/^[\p{N}\p{L}.\-_~]*$/u.test(t)?"":e("validationErrors.utf8Name")}}const xe={useAxios:H,useDebouncedFilter:pt,useDeleteUrlBuilder:dt,useErrors:yt,useExternalLinkCreator:ft,useFetcher:mt,useFetchUrlBuilder:be,useHelpers:_e,useStringHelpers:ht,useI18n:z,useGatewayFeatureSupported:St,useTruncationDetector:Tt,useValidators:Et},vt=(e,t)=>{const r=e.__vccOpts||e;for(const[o,i]of t)r[o]=i;return r},Ct="#0044f4",It="16px";/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Ae(e){return typeof e>"u"||e===null}function xt(e){return typeof e=="object"&&e!==null}function At(e){return Array.isArray(e)?e:Ae(e)?[]:[e]}function Nt(e,t){var r,o,i,a;if(t)for(a=Object.keys(t),r=0,o=a.length;r<o;r+=1)i=a[r],e[i]=t[i];return e}function qt(e,t){var r="",o;for(o=0;o<t;o+=1)r+=e;return r}function Rt(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Lt=Ae,Ot=xt,Dt=At,Bt=qt,jt=Rt,$t=Nt,M={isNothing:Lt,isObject:Ot,toArray:Dt,repeat:Bt,isNegativeZero:jt,extend:$t};function Ne(e,t){var r="",o=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
|
|
2
2
|
|
|
3
|
-
`+e.mark.snippet),o+" "+r):o}function B(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Ne(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}B.prototype=Object.create(Error.prototype),B.prototype.constructor=B,B.prototype.toString=function(e){return this.name+": "+Ne(this,e)};var x=B
|
|
4
|
-
\r`;function vr(e){if(e===null)return!1;var t,r,o=0,i=e.length,a=Y;for(r=0;r<i;r++)if(t=a.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;o+=6}return o%8===0}function Cr(e){var t,r,o=e.replace(/[\r\n=]/g,""),i=o.length,a=Y,s=0,c=[];for(t=0;t<i;t++)t%4===0&&t&&(c.push(s>>16&255),c.push(s>>8&255),c.push(s&255)),s=s<<6|a.indexOf(o.charAt(t));return r=i%4*6,r===0?(c.push(s>>16&255),c.push(s>>8&255),c.push(s&255)):r===18?(c.push(s>>10&255),c.push(s>>2&255)):r===12&&c.push(s>>4&255),new Uint8Array(c)}function Ir(e){var t="",r=0,o,i,a=e.length,s=Y;for(o=0;o<a;o++)o%3===0&&o&&(t+=s[r>>18&63],t+=s[r>>12&63],t+=s[r>>6&63],t+=s[r&63]),r=(r<<8)+e[o];return i=a%3,i===0?(t+=s[r>>18&63],t+=s[r>>12&63],t+=s[r>>6&63],t+=s[r&63]):i===2?(t+=s[r>>10&63],t+=s[r>>4&63],t+=s[r<<2&63],t+=s[64]):i===1&&(t+=s[r>>2&63],t+=s[r<<4&63],t+=s[64],t+=s[64]),t}function xr(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Ar=new g("tag:yaml.org,2002:binary",{kind:"scalar",resolve:vr,construct:Cr,predicate:xr,represent:Ir}),Nr=Object.prototype.hasOwnProperty,qr=Object.prototype.toString;function Rr(e){if(e===null)return!0;var t=[],r,o,i,a,s,c=e;for(r=0,o=c.length;r<o;r+=1){if(i=c[r],s=!1,qr.call(i)!=="[object Object]")return!1;for(a in i)if(Nr.call(i,a))if(!s)s=!0;else return!1;if(!s)return!1;if(t.indexOf(a)===-1)t.push(a);else return!1}return!0}function Lr(e){return e!==null?e:[]}var Or=new g("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Rr,construct:Lr}),Dr=Object.prototype.toString;function Br(e){if(e===null)return!0;var t,r,o,i,a,s=e;for(a=new Array(s.length),t=0,r=s.length;t<r;t+=1){if(o=s[t],Dr.call(o)!=="[object Object]"||(i=Object.keys(o),i.length!==1))return!1;a[t]=[i[0],o[i[0]]]}return!0}function jr(e){if(e===null)return[];var t,r,o,i,a,s=e;for(a=new Array(s.length),t=0,r=s.length;t<r;t+=1)o=s[t],i=Object.keys(o),a[t]=[i[0],o[i[0]]];return a}var
|
|
5
|
-
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"
":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}for(var Pr=new Array(256),Kr=new Array(256),R=0;R<256;R++)Pr[R]=Oe(R)?1:0,Kr[R]=Oe(R);const De="24px",Hr=(e,t)=>{const r=e.__vccOpts||e;for(const[o,i]of t)r[o]=i;return r},Mr=e=>(n.pushScopeId("data-v-cd88dfcc"),e=e(),n.popScopeId(),e),Gr=["aria-hidden"],Yr={key:0,"data-testid":"kui-icon-svg-title"},Zr=Mr(()=>n.createElementVNode("path",{d:"M5 22C4.45 22 3.97917 21.8042 3.5875 21.4125C3.19583 21.0208 3 20.55 3 20V6H5V20H16V22H5ZM9 18C8.45 18 7.97917 17.8042 7.5875 17.4125C7.19583 17.0208 7 16.55 7 16V4C7 3.45 7.19583 2.97917 7.5875 2.5875C7.97917 2.19583 8.45 2 9 2H18C18.55 2 19.0208 2.19583 19.4125 2.5875C19.8042 2.97917 20 3.45 20 4V16C20 16.55 19.8042 17.0208 19.4125 17.4125C19.0208 17.8042 18.55 18 18 18H9ZM9 16H18V4H9V16Z",fill:"currentColor"},null,-1)),Qr=n.defineComponent({__name:"CopyIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:De,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const i=String(t.size).replace(/px/gi,""),a=Number(i);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return`${a}px`}return De}),o=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,flexShrink:"0",height:r.value,lineHeight:"0",width:r.value}));return(i,a)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon copy-icon","data-testid":"kui-icon-wrapper-copy-icon",style:n.normalizeStyle(o.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-copy-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",Yr,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),Zr],8,Gr))]),_:1},8,["aria-hidden","style"]))}}),Wr=Hr(Qr,[["__scopeId","data-v-cd88dfcc"]]),Jr=[];for(let e=0;e<256;++e)Jr.push((e+256).toString(16).slice(1));typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Xr={class:"kong-ui-public-entity-link","data-testid":"entity-link-parent"},en={key:0,class:"deleted-entity"},tn={key:1},rn=["onClick"],nn=n.defineComponent({__name:"EntityLink",props:{entityLinkData:{type:Object,required:!0},externalLink:{type:String,required:!1,default:""},newWindow:{type:Boolean,required:!1,default:!1},allowCopy:{type:Boolean,required:!1,default:!1}},setup(e){const t=e,r=n.ref(),{isTruncated:o}=xe.useTruncationDetector(r),{i18n:{t:i}}=xe.useI18n(),a=i("global.actions.copyId"),s=n.ref(a),c=n.computed(()=>t.entityLinkData.deleted??!1),p=n.computed(()=>{var l;return(l=t.entityLinkData.id)!=null&&l.toString().includes(":")?t.entityLinkData.id.toString().split(":")[1]:t.entityLinkData.id}),u=n.computed(()=>{var l;return`${(l=p.value)==null?void 0:l.toString().slice(0,5)} (deleted)`}),f=async l=>{await l(p.value||"")&&(s.value=i("global.actions.copyToClipboard"),setTimeout(()=>{s.value=a},1800))};return(l,m)=>{const y=n.resolveComponent("KTooltip"),b=n.resolveComponent("KExternalLink"),T=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",Xr,[c.value?(n.openBlock(),n.createElementBlock("div",en,n.toDisplayString(u.value),1)):p.value?p.value?(n.openBlock(),n.createBlock(b,{key:2,class:"entity-link","hide-icon":!e.newWindow,href:e.externalLink,target:e.newWindow?"_blank":"_self"},{default:n.withCtx(()=>[n.createVNode(y,{text:n.unref(o)&&e.entityLinkData.label||""},{default:n.withCtx(()=>[n.createElementVNode("span",{ref_key:"textContent",ref:r,class:"entity-link-label"},n.toDisplayString(e.entityLinkData.label),513)]),_:1},8,["text"])]),_:1},8,["hide-icon","href","target"])):n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",tn,n.toDisplayString(" – "))),p.value&&e.allowCopy?(n.openBlock(),n.createBlock(y,{key:s.value,class:"copy-uuid-tooltip","max-width":"160",placement:"bottom-end",text:s.value},{default:n.withCtx(()=>[n.createVNode(T,null,{default:n.withCtx(({copyToClipboard:C})=>[n.createElementVNode("span",{class:"entity-link-copy-id",onClick:n.withModifiers(A=>f(C),["stop"])},[n.createVNode(n.unref(Wr),{class:"copy-icon",color:n.unref(Ct),"data-testid":"copy-id",size:n.unref(It)},null,8,["color","size"])],8,rn)]),_:1})]),_:1},8,["text"])):n.createCommentVNode("",!0)])}}}),on=vt(nn,[["__scopeId","data-v-60e3ef7c"]]),an=n.defineComponent({__name:"TopNTableRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{}},setup(e){const t=e,r=o=>{var i;if((i=t.chartOptions)!=null&&i.entityLink)if(o.id.includes(":")){const[a,s]=o.id.split(":");return t.chartOptions.entityLink.replace(X,a).replace(K,s)}else return t.chartOptions.entityLink.replace(K,o.id);return""};return(o,i)=>(n.openBlock(),n.createBlock(F,{context:o.context,query:o.query,"query-ready":o.queryReady},{default:n.withCtx(({data:a})=>[n.createVNode(n.unref(v.TopNTable),{data:a,description:o.chartOptions.description,"synthetics-data-key":o.chartOptions.syntheticsDataKey,title:o.chartOptions.chartTitle||""},n.createSlots({_:2},[t.chartOptions.entityLink?{name:"name",fn:n.withCtx(({record:s})=>[n.createVNode(n.unref(on),{"entity-link-data":{id:s.id,label:s.name,deleted:s.deleted},"external-link":r(s)},null,8,["entity-link-data","external-link"])]),key:"0"}:void 0]),1032,["data","description","synthetics-data-key","title"])]),_:1},8,["context","query","query-ready"]))}}),sn={class:"tile-boundary"},cn=I(n.defineComponent({__name:"DashboardTile",props:{definition:{},context:{},height:{default:170},queryReady:{type:Boolean}},setup(e){n.useCssVars(a=>({58871060:`${a.height}px`}));const t=parseInt(ge,10),r=e,o={[w.TimeseriesLine]:Ze,[w.HorizontalBar]:he,[w.VerticalBar]:he,[w.Gauge]:Me,[w.GoldenSignals]:We,[w.TopN]:an,[w.Slottable]:void 0},i=n.computed(()=>{const a=o[r.definition.chart.type];return a&&{component:a,rendererProps:{query:r.definition.query,context:r.context,queryReady:r.queryReady,chartOptions:r.definition.chart,height:r.height-t*2}}});return(a,s)=>(n.openBlock(),n.createElementBlock("div",sn,[i.value?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(i.value.component),n.normalizeProps(n.mergeProps({key:0},i.value.rendererProps)),null,16)):n.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-69b5e552"]]),ln=(e,t,r)=>{const o=new Map;r.forEach(a=>{const s=a.layout.position.row,c=o.get(s),p=a.layout.size.rows===1&&!!a.layout.size.fitToContent;c===void 0?o.set(s,p):o.set(s,c&&p)});const i=[];for(let a=0;a<e;a++)o.get(a)?i.push("auto"):i.push(`${t}px`);return i},Be=I(n.defineComponent({__name:"GridLayout",props:{gridSize:{type:Object,required:!0},tileHeight:{type:Number,required:!1,default:()=>170},tiles:{type:Array,required:!0}},setup(e){n.useCssVars(c=>({cfb759a4:e.gridSize.cols,"208951e1":a.value}));const t=e,r=n.ref(null),o=n.ref(0),i=new ResizeObserver(c=>{window.requestAnimationFrame(()=>{!Array.isArray(c)||!c.length||(o.value=c[0].contentRect.width)})});n.onMounted(()=>{r.value&&i.observe(r.value)}),n.onUnmounted(()=>{r.value&&i.unobserve(r.value)});const a=n.computed(()=>{var p;return ln((p=t.gridSize)==null?void 0:p.rows,t.tileHeight,t.tiles).join(" ")}),s=n.computed(()=>t.tiles.map((c,p)=>({key:`tile-${p}`,tile:c,style:{"grid-column-start":c.layout.position.col+1,"grid-column-end":c.layout.position.col+1+c.layout.size.cols,"grid-row-start":c.layout.position.row+1,"grid-row-end":c.layout.position.row+1+c.layout.size.rows}})));return(c,p)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"gridContainer",ref:r,class:"kong-ui-public-grid-layout"},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(s.value,u=>(n.openBlock(),n.createElementBlock("div",{key:u.key,class:n.normalizeClass(["grid-cell",{"empty-cell":!u.tile}]),style:n.normalizeStyle(u.style)},[n.renderSlot(c.$slots,"tile",{style:n.normalizeStyle(u.style),tile:u.tile},void 0,!0)],6))),128))],512))}}),[["__scopeId","data-v-056142a9"]]),un={class:"kong-ui-public-dashboard-renderer"},pn={key:0,class:"tile-container"},dn=I(n.defineComponent({__name:"DashboardRenderer",props:{context:{},config:{}},setup(e){const t=e,{i18n:r}=me.useI18n(),o=n.inject(P);o||(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/dashboard-renderer/README.md#requirements"));const i=Ve.useAnalyticsConfigStore(),a=n.computed(()=>t.context.timeSpec?t.context.timeSpec:{type:"relative",time_range:i.defaultQueryTimeForOrg}),s=n.computed(()=>!!t.context.timeSpec||!i.loading),c=n.computed(()=>t.config.tiles.map((u,f)=>{var m;let l=u.definition;if("description"in l.chart){const y=(m=l.chart.description)==null?void 0:m.replace(ee,()=>{const T=`renderer.trendRange.${a.value.type==="absolute"?"custom":a.value.time_range}`;return r.te(T)?r.t(T):""});l={...l,chart:{...l.chart,description:y}}}return{layout:u.layout,meta:l,id:f}})),p=n.computed(()=>{let{tz:u,refreshInterval:f}=t.context;return u||(u=new Intl.DateTimeFormat().resolvedOptions().timeZone),f===void 0&&(f=3e4),{...t.context,tz:u,timeSpec:a.value,refreshInterval:f}});return(u,f)=>{const l=n.resolveComponent("KAlert");return n.openBlock(),n.createElementBlock("div",un,[n.unref(o)?(n.openBlock(),n.createBlock(Be,{key:1,"grid-size":u.config.gridSize,"tile-height":u.config.tileHeight,tiles:c.value},{tile:n.withCtx(({tile:m})=>[m.meta.chart.type===n.unref(w).Slottable?(n.openBlock(),n.createElementBlock("div",pn,[n.renderSlot(u.$slots,m.meta.chart.id,{},void 0,!0)])):(n.openBlock(),n.createBlock(cn,{key:1,class:"tile-container",context:p.value,definition:m.meta,height:m.layout.size.rows*(u.config.tileHeight||n.unref(170))+parseInt(n.unref(ge),10),"query-ready":s.value},null,8,["context","definition","height","query-ready"]))]),_:3},8,["grid-size","tile-height","tiles"])):(n.openBlock(),n.createBlock(l,{key:0,appearance:"danger"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(r).t("renderer.noQueryBridge")),1)]),_:1}))])}}}),[["__scopeId","data-v-2dd03268"]]);d.CP_ID_TOKEN=X,d.ChartTypes=w,d.DEFAULT_TILE_HEIGHT=170,d.DEFAULT_TILE_REFRESH_INTERVAL_MS=3e4,d.DashboardRenderer=dn,d.ENTITY_ID_TOKEN=K,d.GridLayout=Be,d.INJECT_QUERY_PROVIDER=P,d.TIMEFRAME_TOKEN=ee,d.barChartSchema=ie,d.dashboardConfigSchema=$e,d.exploreV4QuerySchema=le,d.gaugeChartSchema=ae,d.metricCardSchema=ce,d.slottableSchema=ne,d.tileConfigSchema=ye,d.tileDefinitionSchema=pe,d.tileLayoutSchema=de,d.timeseriesChartSchema=oe,d.topNTableSchema=se,d.validDashboardQuery=ue,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
|
3
|
+
`+e.mark.snippet),o+" "+r):o}function B(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Ne(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}B.prototype=Object.create(Error.prototype),B.prototype.constructor=B,B.prototype.toString=function(e){return this.name+": "+Ne(this,e)};var x=B,Vt=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Ft=["scalar","sequence","mapping"];function zt(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(o){t[String(o)]=r})}),t}function Ut(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(Vt.indexOf(r)===-1)throw new x('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=zt(t.styleAliases||null),Ft.indexOf(this.kind)===-1)throw new x('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var g=Ut;function qe(e,t){var r=[];return e[t].forEach(function(o){var i=r.length;r.forEach(function(a,s){a.tag===o.tag&&a.kind===o.kind&&a.multi===o.multi&&(i=s)}),r[i]=o}),r}function Pt(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function o(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(o);return e}function G(e){return this.extend(e)}G.prototype.extend=function(e){var t=[],r=[];if(e instanceof g)r.push(e);else if(Array.isArray(e))r=r.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(r=r.concat(e.explicit));else throw new x("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.forEach(function(i){if(!(i instanceof g))throw new x("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(i.loadKind&&i.loadKind!=="scalar")throw new x("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(i.multi)throw new x("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(i){if(!(i instanceof g))throw new x("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var o=Object.create(G.prototype);return o.implicit=(this.implicit||[]).concat(t),o.explicit=(this.explicit||[]).concat(r),o.compiledImplicit=qe(o,"implicit"),o.compiledExplicit=qe(o,"explicit"),o.compiledTypeMap=Pt(o.compiledImplicit,o.compiledExplicit),o};var Kt=G,Ht=new g("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Mt=new g("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Gt=new g("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Yt=new Kt({explicit:[Ht,Mt,Gt]});function Zt(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Qt(){return null}function Wt(e){return e===null}var Jt=new g("tag:yaml.org,2002:null",{kind:"scalar",resolve:Zt,construct:Qt,predicate:Wt,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Xt(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function er(e){return e==="true"||e==="True"||e==="TRUE"}function tr(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var rr=new g("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Xt,construct:er,predicate:tr,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function nr(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function ir(e){return 48<=e&&e<=55}function or(e){return 48<=e&&e<=57}function ar(e){if(e===null)return!1;var t=e.length,r=0,o=!1,i;if(!t)return!1;if(i=e[r],(i==="-"||i==="+")&&(i=e[++r]),i==="0"){if(r+1===t)return!0;if(i=e[++r],i==="b"){for(r++;r<t;r++)if(i=e[r],i!=="_"){if(i!=="0"&&i!=="1")return!1;o=!0}return o&&i!=="_"}if(i==="x"){for(r++;r<t;r++)if(i=e[r],i!=="_"){if(!nr(e.charCodeAt(r)))return!1;o=!0}return o&&i!=="_"}if(i==="o"){for(r++;r<t;r++)if(i=e[r],i!=="_"){if(!ir(e.charCodeAt(r)))return!1;o=!0}return o&&i!=="_"}}if(i==="_")return!1;for(;r<t;r++)if(i=e[r],i!=="_"){if(!or(e.charCodeAt(r)))return!1;o=!0}return!(!o||i==="_")}function sr(e){var t=e,r=1,o;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),o=t[0],(o==="-"||o==="+")&&(o==="-"&&(r=-1),t=t.slice(1),o=t[0]),t==="0")return 0;if(o==="0"){if(t[1]==="b")return r*parseInt(t.slice(2),2);if(t[1]==="x")return r*parseInt(t.slice(2),16);if(t[1]==="o")return r*parseInt(t.slice(2),8)}return r*parseInt(t,10)}function cr(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!M.isNegativeZero(e)}var lr=new g("tag:yaml.org,2002:int",{kind:"scalar",resolve:ar,construct:sr,predicate:cr,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),ur=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function pr(e){return!(e===null||!ur.test(e)||e[e.length-1]==="_")}function dr(e){var t,r;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:r*parseFloat(t,10)}var yr=/^[-+]?[0-9]+e/;function fr(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(M.isNegativeZero(e))return"-0.0";return r=e.toString(10),yr.test(r)?r.replace("e",".e"):r}function mr(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||M.isNegativeZero(e))}var hr=new g("tag:yaml.org,2002:float",{kind:"scalar",resolve:pr,construct:dr,predicate:mr,represent:fr,defaultStyle:"lowercase"}),gr=Yt.extend({implicit:[Jt,rr,lr,hr]}),_r=gr,Re=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Le=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function br(e){return e===null?!1:Re.exec(e)!==null||Le.exec(e)!==null}function kr(e){var t,r,o,i,a,s,c,p=0,l=null,f,u,m;if(t=Re.exec(e),t===null&&(t=Le.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],o=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(r,o,i));if(a=+t[4],s=+t[5],c=+t[6],t[7]){for(p=t[7].slice(0,3);p.length<3;)p+="0";p=+p}return t[9]&&(f=+t[10],u=+(t[11]||0),l=(f*60+u)*6e4,t[9]==="-"&&(l=-l)),m=new Date(Date.UTC(r,o,i,a,s,c,p)),l&&m.setTime(m.getTime()-l),m}function wr(e){return e.toISOString()}var Sr=new g("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:br,construct:kr,instanceOf:Date,represent:wr});function Tr(e){return e==="<<"||e===null}var Er=new g("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Tr}),Y=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
4
|
+
\r`;function vr(e){if(e===null)return!1;var t,r,o=0,i=e.length,a=Y;for(r=0;r<i;r++)if(t=a.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;o+=6}return o%8===0}function Cr(e){var t,r,o=e.replace(/[\r\n=]/g,""),i=o.length,a=Y,s=0,c=[];for(t=0;t<i;t++)t%4===0&&t&&(c.push(s>>16&255),c.push(s>>8&255),c.push(s&255)),s=s<<6|a.indexOf(o.charAt(t));return r=i%4*6,r===0?(c.push(s>>16&255),c.push(s>>8&255),c.push(s&255)):r===18?(c.push(s>>10&255),c.push(s>>2&255)):r===12&&c.push(s>>4&255),new Uint8Array(c)}function Ir(e){var t="",r=0,o,i,a=e.length,s=Y;for(o=0;o<a;o++)o%3===0&&o&&(t+=s[r>>18&63],t+=s[r>>12&63],t+=s[r>>6&63],t+=s[r&63]),r=(r<<8)+e[o];return i=a%3,i===0?(t+=s[r>>18&63],t+=s[r>>12&63],t+=s[r>>6&63],t+=s[r&63]):i===2?(t+=s[r>>10&63],t+=s[r>>4&63],t+=s[r<<2&63],t+=s[64]):i===1&&(t+=s[r>>2&63],t+=s[r<<4&63],t+=s[64],t+=s[64]),t}function xr(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Ar=new g("tag:yaml.org,2002:binary",{kind:"scalar",resolve:vr,construct:Cr,predicate:xr,represent:Ir}),Nr=Object.prototype.hasOwnProperty,qr=Object.prototype.toString;function Rr(e){if(e===null)return!0;var t=[],r,o,i,a,s,c=e;for(r=0,o=c.length;r<o;r+=1){if(i=c[r],s=!1,qr.call(i)!=="[object Object]")return!1;for(a in i)if(Nr.call(i,a))if(!s)s=!0;else return!1;if(!s)return!1;if(t.indexOf(a)===-1)t.push(a);else return!1}return!0}function Lr(e){return e!==null?e:[]}var Or=new g("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Rr,construct:Lr}),Dr=Object.prototype.toString;function Br(e){if(e===null)return!0;var t,r,o,i,a,s=e;for(a=new Array(s.length),t=0,r=s.length;t<r;t+=1){if(o=s[t],Dr.call(o)!=="[object Object]"||(i=Object.keys(o),i.length!==1))return!1;a[t]=[i[0],o[i[0]]]}return!0}function jr(e){if(e===null)return[];var t,r,o,i,a,s=e;for(a=new Array(s.length),t=0,r=s.length;t<r;t+=1)o=s[t],i=Object.keys(o),a[t]=[i[0],o[i[0]]];return a}var $r=new g("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Br,construct:jr}),Vr=Object.prototype.hasOwnProperty;function Fr(e){if(e===null)return!0;var t,r=e;for(t in r)if(Vr.call(r,t)&&r[t]!==null)return!1;return!0}function zr(e){return e!==null?e:{}}var Ur=new g("tag:yaml.org,2002:set",{kind:"mapping",resolve:Fr,construct:zr});_r.extend({implicit:[Sr,Er],explicit:[Ar,Or,$r,Ur]});function Oe(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
|
5
|
+
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"
":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}for(var Pr=new Array(256),Kr=new Array(256),R=0;R<256;R++)Pr[R]=Oe(R)?1:0,Kr[R]=Oe(R);const De="24px",Hr=(e,t)=>{const r=e.__vccOpts||e;for(const[o,i]of t)r[o]=i;return r},Mr=e=>(n.pushScopeId("data-v-cd88dfcc"),e=e(),n.popScopeId(),e),Gr=["aria-hidden"],Yr={key:0,"data-testid":"kui-icon-svg-title"},Zr=Mr(()=>n.createElementVNode("path",{d:"M5 22C4.45 22 3.97917 21.8042 3.5875 21.4125C3.19583 21.0208 3 20.55 3 20V6H5V20H16V22H5ZM9 18C8.45 18 7.97917 17.8042 7.5875 17.4125C7.19583 17.0208 7 16.55 7 16V4C7 3.45 7.19583 2.97917 7.5875 2.5875C7.97917 2.19583 8.45 2 9 2H18C18.55 2 19.0208 2.19583 19.4125 2.5875C19.8042 2.97917 20 3.45 20 4V16C20 16.55 19.8042 17.0208 19.4125 17.4125C19.0208 17.8042 18.55 18 18 18H9ZM9 16H18V4H9V16Z",fill:"currentColor"},null,-1)),Qr=n.defineComponent({__name:"CopyIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:De,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const i=String(t.size).replace(/px/gi,""),a=Number(i);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return`${a}px`}return De}),o=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,flexShrink:"0",height:r.value,lineHeight:"0",width:r.value}));return(i,a)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon copy-icon","data-testid":"kui-icon-wrapper-copy-icon",style:n.normalizeStyle(o.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-copy-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",Yr,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),Zr],8,Gr))]),_:1},8,["aria-hidden","style"]))}}),Wr=Hr(Qr,[["__scopeId","data-v-cd88dfcc"]]),Jr=[];for(let e=0;e<256;++e)Jr.push((e+256).toString(16).slice(1));typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Xr={class:"kong-ui-public-entity-link","data-testid":"entity-link-parent"},en={key:0,class:"deleted-entity"},tn={key:1},rn=["onClick"],nn=n.defineComponent({__name:"EntityLink",props:{entityLinkData:{type:Object,required:!0},externalLink:{type:String,required:!1,default:""},newWindow:{type:Boolean,required:!1,default:!1},allowCopy:{type:Boolean,required:!1,default:!1}},setup(e){const t=e,r=n.ref(),{isTruncated:o}=xe.useTruncationDetector(r),{i18n:{t:i}}=xe.useI18n(),a=i("global.actions.copyId"),s=n.ref(a),c=n.computed(()=>t.entityLinkData.deleted??!1),p=n.computed(()=>{var u;return(u=t.entityLinkData.id)!=null&&u.toString().includes(":")?t.entityLinkData.id.toString().split(":")[1]:t.entityLinkData.id}),l=n.computed(()=>{var u;return`${(u=p.value)==null?void 0:u.toString().slice(0,5)} (deleted)`}),f=async u=>{await u(p.value||"")&&(s.value=i("global.actions.copyToClipboard"),setTimeout(()=>{s.value=a},1800))};return(u,m)=>{const y=n.resolveComponent("KTooltip"),b=n.resolveComponent("KExternalLink"),E=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",Xr,[c.value?(n.openBlock(),n.createElementBlock("div",en,n.toDisplayString(l.value),1)):p.value?p.value?(n.openBlock(),n.createBlock(b,{key:2,class:"entity-link","hide-icon":!e.newWindow,href:e.externalLink,target:e.newWindow?"_blank":"_self"},{default:n.withCtx(()=>[n.createVNode(y,{text:n.unref(o)&&e.entityLinkData.label||""},{default:n.withCtx(()=>[n.createElementVNode("span",{ref_key:"textContent",ref:r,class:"entity-link-label"},n.toDisplayString(e.entityLinkData.label),513)]),_:1},8,["text"])]),_:1},8,["hide-icon","href","target"])):n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",tn,n.toDisplayString(" – "))),p.value&&e.allowCopy?(n.openBlock(),n.createBlock(y,{key:s.value,class:"copy-uuid-tooltip","max-width":"160",placement:"bottom-end",text:s.value},{default:n.withCtx(()=>[n.createVNode(E,null,{default:n.withCtx(({copyToClipboard:C})=>[n.createElementVNode("span",{class:"entity-link-copy-id",onClick:n.withModifiers(A=>f(C),["stop"])},[n.createVNode(n.unref(Wr),{class:"copy-icon",color:n.unref(Ct),"data-testid":"copy-id",size:n.unref(It)},null,8,["color","size"])],8,rn)]),_:1})]),_:1},8,["text"])):n.createCommentVNode("",!0)])}}}),on=vt(nn,[["__scopeId","data-v-60e3ef7c"]]),an=n.defineComponent({__name:"TopNTableRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{}},setup(e){const t=e,r=o=>{var i;if((i=t.chartOptions)!=null&&i.entityLink)if(o.id.includes(":")){const[a,s]=o.id.split(":");return t.chartOptions.entityLink.replace(X,a).replace(K,s)}else return t.chartOptions.entityLink.replace(K,o.id);return""};return(o,i)=>(n.openBlock(),n.createBlock(F,{context:o.context,query:o.query,"query-ready":o.queryReady},{default:n.withCtx(({data:a})=>[n.createVNode(n.unref(v.TopNTable),{data:a,description:o.chartOptions.description,"synthetics-data-key":o.chartOptions.syntheticsDataKey,title:o.chartOptions.chartTitle||""},n.createSlots({_:2},[t.chartOptions.entityLink?{name:"name",fn:n.withCtx(({record:s})=>[n.createVNode(n.unref(on),{"entity-link-data":{id:s.id,label:s.name,deleted:s.deleted},"external-link":r(s)},null,8,["entity-link-data","external-link"])]),key:"0"}:void 0]),1032,["data","description","synthetics-data-key","title"])]),_:1},8,["context","query","query-ready"]))}}),sn={class:"tile-boundary"},cn=I(n.defineComponent({__name:"DashboardTile",props:{definition:{},context:{},height:{default:170},queryReady:{type:Boolean}},setup(e){n.useCssVars(a=>({58871060:`${a.height}px`}));const t=parseInt(ge,10),r=e,o={[k.TimeseriesLine]:Ze,[k.HorizontalBar]:he,[k.VerticalBar]:he,[k.Gauge]:Me,[k.GoldenSignals]:We,[k.TopN]:an,[k.Slottable]:void 0},i=n.computed(()=>{const a=o[r.definition.chart.type];return a&&{component:a,rendererProps:{query:r.definition.query,context:r.context,queryReady:r.queryReady,chartOptions:r.definition.chart,height:r.height-t*2}}});return(a,s)=>(n.openBlock(),n.createElementBlock("div",sn,[i.value?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(i.value.component),n.normalizeProps(n.mergeProps({key:0},i.value.rendererProps)),null,16)):n.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-69b5e552"]]),ln=(e,t,r)=>{const o=new Map;r.forEach(a=>{const s=a.layout.position.row,c=o.get(s),p=a.layout.size.rows===1&&!!a.layout.size.fitToContent;c===void 0?o.set(s,p):o.set(s,c&&p)});const i=[];for(let a=0;a<e;a++)o.get(a)?i.push("auto"):i.push(`${t}px`);return i},Be=I(n.defineComponent({__name:"GridLayout",props:{gridSize:{type:Object,required:!0},tileHeight:{type:Number,required:!1,default:()=>170},tiles:{type:Array,required:!0}},setup(e){n.useCssVars(c=>({cfb759a4:e.gridSize.cols,"208951e1":a.value}));const t=e,r=n.ref(null),o=n.ref(0),i=new ResizeObserver(c=>{window.requestAnimationFrame(()=>{!Array.isArray(c)||!c.length||(o.value=c[0].contentRect.width)})});n.onMounted(()=>{r.value&&i.observe(r.value)}),n.onUnmounted(()=>{r.value&&i.unobserve(r.value)});const a=n.computed(()=>{var p;return ln((p=t.gridSize)==null?void 0:p.rows,t.tileHeight,t.tiles).join(" ")}),s=n.computed(()=>t.tiles.map((c,p)=>({key:`tile-${p}`,tile:c,style:{"grid-column-start":c.layout.position.col+1,"grid-column-end":c.layout.position.col+1+c.layout.size.cols,"grid-row-start":c.layout.position.row+1,"grid-row-end":c.layout.position.row+1+c.layout.size.rows}})));return(c,p)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"gridContainer",ref:r,class:"kong-ui-public-grid-layout"},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(s.value,l=>(n.openBlock(),n.createElementBlock("div",{key:l.key,class:n.normalizeClass(["grid-cell",{"empty-cell":!l.tile}]),style:n.normalizeStyle(l.style)},[n.renderSlot(c.$slots,"tile",{style:n.normalizeStyle(l.style),tile:l.tile},void 0,!0)],6))),128))],512))}}),[["__scopeId","data-v-056142a9"]]),un={class:"kong-ui-public-dashboard-renderer"},pn={key:0,class:"tile-container"},dn=I(n.defineComponent({__name:"DashboardRenderer",props:{context:{},config:{}},setup(e){const t=e,{i18n:r}=me.useI18n(),o=n.inject(P);o||(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/dashboard-renderer/README.md#requirements"));const i=$e.useAnalyticsConfigStore(),a=n.computed(()=>t.context.timeSpec?t.context.timeSpec:{type:"relative",time_range:i.defaultQueryTimeForOrg}),s=n.computed(()=>!!t.context.timeSpec||!i.loading),c=n.computed(()=>t.config.tiles.map((l,f)=>{var m;let u=l.definition;if("description"in u.chart){const y=(m=u.chart.description)==null?void 0:m.replace(ee,()=>{const E=`renderer.trendRange.${a.value.type==="absolute"?"custom":a.value.time_range}`;return r.te(E)?r.t(E):""});u={...u,chart:{...u.chart,description:y}}}return{layout:l.layout,meta:u,id:f}})),p=n.computed(()=>{let{tz:l,refreshInterval:f}=t.context;return l||(l=new Intl.DateTimeFormat().resolvedOptions().timeZone),f===void 0&&(f=3e4),{...t.context,tz:l,timeSpec:a.value,refreshInterval:f}});return(l,f)=>{const u=n.resolveComponent("KAlert");return n.openBlock(),n.createElementBlock("div",un,[n.unref(o)?(n.openBlock(),n.createBlock(Be,{key:1,"grid-size":l.config.gridSize,"tile-height":l.config.tileHeight,tiles:c.value},{tile:n.withCtx(({tile:m})=>[m.meta.chart.type===n.unref(k).Slottable?(n.openBlock(),n.createElementBlock("div",pn,[n.renderSlot(l.$slots,m.meta.chart.id,{},void 0,!0)])):(n.openBlock(),n.createBlock(cn,{key:1,class:"tile-container",context:p.value,definition:m.meta,height:m.layout.size.rows*(l.config.tileHeight||n.unref(170))+parseInt(n.unref(ge),10),"query-ready":s.value},null,8,["context","definition","height","query-ready"]))]),_:3},8,["grid-size","tile-height","tiles"])):(n.openBlock(),n.createBlock(u,{key:0,appearance:"danger"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(r).t("renderer.noQueryBridge")),1)]),_:1}))])}}}),[["__scopeId","data-v-2dd03268"]]);d.CP_ID_TOKEN=X,d.ChartTypes=k,d.DEFAULT_TILE_HEIGHT=170,d.DEFAULT_TILE_REFRESH_INTERVAL_MS=3e4,d.DashboardRenderer=dn,d.ENTITY_ID_TOKEN=K,d.GridLayout=Be,d.INJECT_QUERY_PROVIDER=P,d.TIMEFRAME_TOKEN=ee,d.barChartSchema=ie,d.dashboardConfigSchema=Ve,d.exploreV4QuerySchema=le,d.gaugeChartSchema=ae,d.metricCardSchema=ce,d.slottableSchema=ne,d.tileConfigSchema=ye,d.tileDefinitionSchema=pe,d.tileLayoutSchema=de,d.timeseriesChartSchema=oe,d.topNTableSchema=se,d.validDashboardQuery=ue,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kong-ui-public/dashboard-renderer",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.35",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/dashboard-renderer.umd.js",
|
|
6
6
|
"module": "./dist/dashboard-renderer.es.js",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"vue": "^3.4.31",
|
|
30
30
|
"@kong-ui-public/analytics-chart": "^4.2.20",
|
|
31
31
|
"@kong-ui-public/analytics-config-store": "^0.7.11",
|
|
32
|
-
"@kong-ui-public/analytics-utilities": "^4.3.1",
|
|
33
32
|
"@kong-ui-public/i18n": "^2.2.2",
|
|
33
|
+
"@kong-ui-public/analytics-utilities": "^4.3.1",
|
|
34
34
|
"@kong-ui-public/sandbox-layout": "^2.1.19",
|
|
35
35
|
"@kong-ui-public/analytics-metric-provider": "^8.0.19"
|
|
36
36
|
},
|
|
@@ -58,13 +58,13 @@
|
|
|
58
58
|
"@kong-ui-public/analytics-chart": "^4.2.20",
|
|
59
59
|
"@kong-ui-public/analytics-config-store": "^0.7.11",
|
|
60
60
|
"@kong-ui-public/analytics-metric-provider": "^8.0.19",
|
|
61
|
-
"@kong-ui-public/
|
|
62
|
-
"@kong-ui-public/
|
|
61
|
+
"@kong-ui-public/analytics-utilities": "^4.3.1",
|
|
62
|
+
"@kong-ui-public/i18n": "^2.2.2"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"ajv": "^8.12.0",
|
|
66
66
|
"@kong-ui-public/core": "^1.7.7",
|
|
67
|
-
"@kong-ui-public/entities-shared": "^3.6.
|
|
67
|
+
"@kong-ui-public/entities-shared": "^3.6.3"
|
|
68
68
|
},
|
|
69
69
|
"scripts": {
|
|
70
70
|
"dev": "cross-env USE_SANDBOX=true vite",
|