@kong-ui-public/analytics-metric-provider 1.1.34 → 1.1.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.
|
@@ -1,7 +1,108 @@
|
|
|
1
|
-
import { ref as De, watchEffect as Dt, computed as E, getCurrentInstance as Et, reactive as wt, onMounted as St, onUnmounted as Rt, watch as _t, isReadonly as It, toRefs as Nt, defineComponent as se, toRef as He, provide as Ct, renderSlot as st, resolveComponent as ee, openBlock as S, createElementBlock as M, normalizeClass as te, unref as B, createVNode as
|
|
1
|
+
import { ref as De, watchEffect as Dt, computed as E, getCurrentInstance as Et, reactive as wt, onMounted as St, onUnmounted as Rt, watch as _t, isReadonly as It, toRefs as Nt, defineComponent as se, toRef as He, provide as Ct, renderSlot as st, resolveComponent as ee, openBlock as S, createElementBlock as M, normalizeClass as te, unref as B, createVNode as $, toDisplayString as K, createCommentVNode as X, Fragment as Ve, renderList as At, createBlock as re, mergeProps as Mt, createElementVNode as q, withCtx as bt, normalizeStyle as Ot, inject as Ut, normalizeProps as Yt, guardReactiveProps as xt } from "vue";
|
|
2
2
|
import { createI18n as Lt, i18nTComponent as Pt } from "@kong-ui-public/i18n";
|
|
3
3
|
var Ft = Object.defineProperty, kt = (e, t, r) => t in e ? Ft(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, I = (e, t, r) => (kt(e, typeof t != "symbol" ? t + "" : t, r), r), v = /* @__PURE__ */ ((e) => (e.MINUTELY = "Minutely", e.HOURLY = "Hourly", e.DAILY = "Daily", e.WEEKLY = "Weekly", e))(v || {}), p = /* @__PURE__ */ ((e) => (e.FIFTEEN_MIN = "15m", e.ONE_HOUR = "1h", e.SIX_HOUR = "6h", e.TWELVE_HOUR = "12h", e.ONE_DAY = "24h", e.SEVEN_DAY = "7d", e.THIRTY_DAY = "30d", e.CURRENT_WEEK = "current_week", e.CURRENT_MONTH = "current_month", e.CURRENT_QUARTER = "current_quarter", e.PREVIOUS_WEEK = "previous_week", e.PREVIOUS_MONTH = "previous_month", e.PREVIOUS_QUARTER = "previous_quarter", e))(p || {});
|
|
4
|
-
function
|
|
4
|
+
function ne(e) {
|
|
5
|
+
"@babel/helpers - typeof";
|
|
6
|
+
return ne = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
7
|
+
return typeof t;
|
|
8
|
+
} : function(t) {
|
|
9
|
+
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
10
|
+
}, ne(e);
|
|
11
|
+
}
|
|
12
|
+
function N(e) {
|
|
13
|
+
if (e === null || e === !0 || e === !1)
|
|
14
|
+
return NaN;
|
|
15
|
+
var t = Number(e);
|
|
16
|
+
return isNaN(t) ? t : t < 0 ? Math.ceil(t) : Math.floor(t);
|
|
17
|
+
}
|
|
18
|
+
function R(e, t) {
|
|
19
|
+
if (t.length < e)
|
|
20
|
+
throw new TypeError(e + " argument" + (e > 1 ? "s" : "") + " required, but only " + t.length + " present");
|
|
21
|
+
}
|
|
22
|
+
function P(e) {
|
|
23
|
+
R(1, arguments);
|
|
24
|
+
var t = Object.prototype.toString.call(e);
|
|
25
|
+
return e instanceof Date || ne(e) === "object" && t === "[object Date]" ? new Date(e.getTime()) : typeof e == "number" || t === "[object Number]" ? new Date(e) : ((typeof e == "string" || t === "[object String]") && typeof console < "u" && (console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"), console.warn(new Error().stack)), /* @__PURE__ */ new Date(NaN));
|
|
26
|
+
}
|
|
27
|
+
function Ee(e, t) {
|
|
28
|
+
R(2, arguments);
|
|
29
|
+
var r = P(e), n = N(t);
|
|
30
|
+
return isNaN(n) ? /* @__PURE__ */ new Date(NaN) : (n && r.setDate(r.getDate() + n), r);
|
|
31
|
+
}
|
|
32
|
+
function Ht(e, t) {
|
|
33
|
+
R(2, arguments);
|
|
34
|
+
var r = P(e), n = N(t);
|
|
35
|
+
if (isNaN(n))
|
|
36
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
37
|
+
if (!n)
|
|
38
|
+
return r;
|
|
39
|
+
var i = r.getDate(), a = new Date(r.getTime());
|
|
40
|
+
a.setMonth(r.getMonth() + n + 1, 0);
|
|
41
|
+
var o = a.getDate();
|
|
42
|
+
return i >= o ? a : (r.setFullYear(a.getFullYear(), a.getMonth(), i), r);
|
|
43
|
+
}
|
|
44
|
+
var Vt = {};
|
|
45
|
+
function zt() {
|
|
46
|
+
return Vt;
|
|
47
|
+
}
|
|
48
|
+
function ae(e, t) {
|
|
49
|
+
var r, n, i, a, o, l, d, s;
|
|
50
|
+
R(1, arguments);
|
|
51
|
+
var u = zt(), c = N((r = (n = (i = (a = t == null ? void 0 : t.weekStartsOn) !== null && a !== void 0 ? a : t == null || (o = t.locale) === null || o === void 0 || (l = o.options) === null || l === void 0 ? void 0 : l.weekStartsOn) !== null && i !== void 0 ? i : u.weekStartsOn) !== null && n !== void 0 ? n : (d = u.locale) === null || d === void 0 || (s = d.options) === null || s === void 0 ? void 0 : s.weekStartsOn) !== null && r !== void 0 ? r : 0);
|
|
52
|
+
if (!(c >= 0 && c <= 6))
|
|
53
|
+
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
|
|
54
|
+
var f = P(e), m = f.getDay(), h = (m < c ? 7 : 0) + m - c;
|
|
55
|
+
return f.setDate(f.getDate() - h), f.setHours(0, 0, 0, 0), f;
|
|
56
|
+
}
|
|
57
|
+
function ze(e) {
|
|
58
|
+
R(1, arguments);
|
|
59
|
+
var t = P(e);
|
|
60
|
+
return t.setHours(0, 0, 0, 0), t;
|
|
61
|
+
}
|
|
62
|
+
var $t = 60, jt = 3600;
|
|
63
|
+
function V(e) {
|
|
64
|
+
R(1, arguments);
|
|
65
|
+
var t = P(e);
|
|
66
|
+
return t.setDate(1), t.setHours(0, 0, 0, 0), t;
|
|
67
|
+
}
|
|
68
|
+
function Zt(e) {
|
|
69
|
+
R(1, arguments);
|
|
70
|
+
var t = P(e), r = t.getFullYear(), n = t.getMonth(), i = /* @__PURE__ */ new Date(0);
|
|
71
|
+
return i.setFullYear(r, n + 1, 0), i.setHours(0, 0, 0, 0), i.getDate();
|
|
72
|
+
}
|
|
73
|
+
function we(e) {
|
|
74
|
+
R(1, arguments);
|
|
75
|
+
var t = P(e), r = t.getTime();
|
|
76
|
+
return r;
|
|
77
|
+
}
|
|
78
|
+
function $e(e) {
|
|
79
|
+
return R(1, arguments), Math.floor(we(e) / 1e3);
|
|
80
|
+
}
|
|
81
|
+
function Gt(e) {
|
|
82
|
+
return R(1, arguments), Math.floor(e * jt);
|
|
83
|
+
}
|
|
84
|
+
function qt(e, t) {
|
|
85
|
+
R(2, arguments);
|
|
86
|
+
var r = N(t);
|
|
87
|
+
return Ee(e, -r);
|
|
88
|
+
}
|
|
89
|
+
function Kt(e) {
|
|
90
|
+
R(1, arguments);
|
|
91
|
+
var t = e / $t;
|
|
92
|
+
return Math.floor(t);
|
|
93
|
+
}
|
|
94
|
+
function Me(e, t) {
|
|
95
|
+
R(2, arguments);
|
|
96
|
+
var r = N(t);
|
|
97
|
+
return Ht(e, -r);
|
|
98
|
+
}
|
|
99
|
+
function Wt(e, t) {
|
|
100
|
+
if (R(2, arguments), !t || ne(t) !== "object")
|
|
101
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
102
|
+
var r = t.years ? N(t.years) : 0, n = t.months ? N(t.months) : 0, i = t.weeks ? N(t.weeks) : 0, a = t.days ? N(t.days) : 0, o = t.hours ? N(t.hours) : 0, l = t.minutes ? N(t.minutes) : 0, d = t.seconds ? N(t.seconds) : 0, s = Me(e, n + r * 12), u = qt(s, a + i * 7), c = l + o * 60, f = d + c * 60, m = f * 1e3, h = new Date(u.getTime() - m);
|
|
103
|
+
return h;
|
|
104
|
+
}
|
|
105
|
+
function be(e) {
|
|
5
106
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
6
107
|
}
|
|
7
108
|
var ot = { exports: {} };
|
|
@@ -13,7 +114,7 @@ var ot = { exports: {} };
|
|
|
13
114
|
}
|
|
14
115
|
e.exports = t, e.exports.__esModule = !0, e.exports.default = e.exports;
|
|
15
116
|
})(ot);
|
|
16
|
-
var
|
|
117
|
+
var Bt = ot.exports, Se = { exports: {} };
|
|
17
118
|
(function(e, t) {
|
|
18
119
|
Object.defineProperty(t, "__esModule", {
|
|
19
120
|
value: !0
|
|
@@ -25,10 +126,10 @@ var Ht = ot.exports, Ee = { exports: {} };
|
|
|
25
126
|
return isNaN(i) ? i : i < 0 ? Math.ceil(i) : Math.floor(i);
|
|
26
127
|
}
|
|
27
128
|
e.exports = t.default;
|
|
28
|
-
})(
|
|
29
|
-
var
|
|
30
|
-
const
|
|
31
|
-
var
|
|
129
|
+
})(Se, Se.exports);
|
|
130
|
+
var Qt = Se.exports;
|
|
131
|
+
const Jt = /* @__PURE__ */ be(Qt);
|
|
132
|
+
var Re = { exports: {} };
|
|
32
133
|
(function(e, t) {
|
|
33
134
|
Object.defineProperty(t, "__esModule", {
|
|
34
135
|
value: !0
|
|
@@ -38,14 +139,14 @@ var we = { exports: {} };
|
|
|
38
139
|
return i.setUTCFullYear(n.getFullYear()), n.getTime() - i.getTime();
|
|
39
140
|
}
|
|
40
141
|
e.exports = t.default;
|
|
41
|
-
})(
|
|
42
|
-
var
|
|
43
|
-
const
|
|
44
|
-
function
|
|
45
|
-
var r =
|
|
46
|
-
return r.formatToParts ?
|
|
47
|
-
}
|
|
48
|
-
var
|
|
142
|
+
})(Re, Re.exports);
|
|
143
|
+
var Xt = Re.exports;
|
|
144
|
+
const je = /* @__PURE__ */ be(Xt);
|
|
145
|
+
function er(e, t) {
|
|
146
|
+
var r = ar(t);
|
|
147
|
+
return r.formatToParts ? rr(r, e) : nr(r, e);
|
|
148
|
+
}
|
|
149
|
+
var tr = {
|
|
49
150
|
year: 0,
|
|
50
151
|
month: 1,
|
|
51
152
|
day: 2,
|
|
@@ -53,10 +154,10 @@ var Zt = {
|
|
|
53
154
|
minute: 4,
|
|
54
155
|
second: 5
|
|
55
156
|
};
|
|
56
|
-
function
|
|
157
|
+
function rr(e, t) {
|
|
57
158
|
try {
|
|
58
159
|
for (var r = e.formatToParts(t), n = [], i = 0; i < r.length; i++) {
|
|
59
|
-
var a =
|
|
160
|
+
var a = tr[r[i].type];
|
|
60
161
|
a >= 0 && (n[a] = parseInt(r[i].value, 10));
|
|
61
162
|
}
|
|
62
163
|
return n;
|
|
@@ -66,12 +167,12 @@ function Gt(e, t) {
|
|
|
66
167
|
throw o;
|
|
67
168
|
}
|
|
68
169
|
}
|
|
69
|
-
function
|
|
170
|
+
function nr(e, t) {
|
|
70
171
|
var r = e.format(t).replace(/\u200E/g, ""), n = /(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(r);
|
|
71
172
|
return [n[3], n[1], n[2], n[4], n[5], n[6]];
|
|
72
173
|
}
|
|
73
174
|
var fe = {};
|
|
74
|
-
function
|
|
175
|
+
function ar(e) {
|
|
75
176
|
if (!fe[e]) {
|
|
76
177
|
var t = new Intl.DateTimeFormat("en-US", {
|
|
77
178
|
hour12: !1,
|
|
@@ -105,11 +206,11 @@ function qt(e) {
|
|
|
105
206
|
}
|
|
106
207
|
return fe[e];
|
|
107
208
|
}
|
|
108
|
-
function
|
|
209
|
+
function Oe(e, t, r, n, i, a, o) {
|
|
109
210
|
var l = /* @__PURE__ */ new Date(0);
|
|
110
211
|
return l.setUTCFullYear(e, t, r), l.setUTCHours(n, i, a, o), l;
|
|
111
212
|
}
|
|
112
|
-
var
|
|
213
|
+
var Ze = 36e5, ir = 6e4, me = {
|
|
113
214
|
timezone: /([Z+-].*)$/,
|
|
114
215
|
timezoneZ: /^(Z)$/,
|
|
115
216
|
timezoneHH: /^([+-]\d{2})$/,
|
|
@@ -121,21 +222,21 @@ function oe(e, t, r) {
|
|
|
121
222
|
return 0;
|
|
122
223
|
var a;
|
|
123
224
|
if (n = me.timezoneHH.exec(e), n)
|
|
124
|
-
return a = parseInt(n[1], 10),
|
|
225
|
+
return a = parseInt(n[1], 10), Ge(a) ? -(a * Ze) : NaN;
|
|
125
226
|
if (n = me.timezoneHHMM.exec(e), n) {
|
|
126
227
|
a = parseInt(n[1], 10);
|
|
127
228
|
var o = parseInt(n[2], 10);
|
|
128
|
-
return
|
|
229
|
+
return Ge(a, o) ? (i = Math.abs(a) * Ze + o * ir, a > 0 ? -i : i) : NaN;
|
|
129
230
|
}
|
|
130
|
-
if (
|
|
231
|
+
if (ur(e)) {
|
|
131
232
|
t = new Date(t || Date.now());
|
|
132
|
-
var l = r ? t :
|
|
233
|
+
var l = r ? t : sr(t), d = _e(l, e), s = r ? d : or(t, d, e);
|
|
133
234
|
return -s;
|
|
134
235
|
}
|
|
135
236
|
return NaN;
|
|
136
237
|
}
|
|
137
|
-
function
|
|
138
|
-
return
|
|
238
|
+
function sr(e) {
|
|
239
|
+
return Oe(
|
|
139
240
|
e.getFullYear(),
|
|
140
241
|
e.getMonth(),
|
|
141
242
|
e.getDate(),
|
|
@@ -145,8 +246,8 @@ function Bt(e) {
|
|
|
145
246
|
e.getMilliseconds()
|
|
146
247
|
);
|
|
147
248
|
}
|
|
148
|
-
function
|
|
149
|
-
var r =
|
|
249
|
+
function _e(e, t) {
|
|
250
|
+
var r = er(e, t), n = Oe(
|
|
150
251
|
r[0],
|
|
151
252
|
r[1] - 1,
|
|
152
253
|
r[2],
|
|
@@ -157,30 +258,30 @@ function Se(e, t) {
|
|
|
157
258
|
).getTime(), i = e.getTime(), a = i % 1e3;
|
|
158
259
|
return i -= a >= 0 ? a : 1e3 + a, n - i;
|
|
159
260
|
}
|
|
160
|
-
function
|
|
161
|
-
var n = e.getTime(), i = n - t, a =
|
|
261
|
+
function or(e, t, r) {
|
|
262
|
+
var n = e.getTime(), i = n - t, a = _e(new Date(i), r);
|
|
162
263
|
if (t === a)
|
|
163
264
|
return t;
|
|
164
265
|
i -= a - t;
|
|
165
|
-
var o =
|
|
266
|
+
var o = _e(new Date(i), r);
|
|
166
267
|
return a === o ? a : Math.max(a, o);
|
|
167
268
|
}
|
|
168
|
-
function
|
|
269
|
+
function Ge(e, t) {
|
|
169
270
|
return -23 <= e && e <= 23 && (t == null || 0 <= t && t <= 59);
|
|
170
271
|
}
|
|
171
|
-
var
|
|
172
|
-
function
|
|
173
|
-
if (
|
|
272
|
+
var qe = {};
|
|
273
|
+
function ur(e) {
|
|
274
|
+
if (qe[e])
|
|
174
275
|
return !0;
|
|
175
276
|
try {
|
|
176
|
-
return new Intl.DateTimeFormat(void 0, { timeZone: e }),
|
|
277
|
+
return new Intl.DateTimeFormat(void 0, { timeZone: e }), qe[e] = !0, !0;
|
|
177
278
|
} catch {
|
|
178
279
|
return !1;
|
|
179
280
|
}
|
|
180
281
|
}
|
|
181
|
-
var
|
|
182
|
-
const ut =
|
|
183
|
-
var ve = 36e5,
|
|
282
|
+
var lr = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/;
|
|
283
|
+
const ut = lr;
|
|
284
|
+
var ve = 36e5, Ke = 6e4, cr = 2, w = {
|
|
184
285
|
dateTimePattern: /^([0-9W+-]+)(T| )(.*)/,
|
|
185
286
|
datePattern: /^([0-9W+-]+)(.*)/,
|
|
186
287
|
plainTime: /:/,
|
|
@@ -215,12 +316,12 @@ var ve = 36e5, Ge = 6e4, er = 2, w = {
|
|
|
215
316
|
// time zone tokens (to identify the presence of a tz)
|
|
216
317
|
timeZone: ut
|
|
217
318
|
};
|
|
218
|
-
function
|
|
319
|
+
function Ie(e, t) {
|
|
219
320
|
if (arguments.length < 1)
|
|
220
321
|
throw new TypeError("1 argument required, but only " + arguments.length + " present");
|
|
221
322
|
if (e === null)
|
|
222
323
|
return /* @__PURE__ */ new Date(NaN);
|
|
223
|
-
var r = t || {}, n = r.additionalDigits == null ?
|
|
324
|
+
var r = t || {}, n = r.additionalDigits == null ? cr : Jt(r.additionalDigits);
|
|
224
325
|
if (n !== 2 && n !== 1 && n !== 0)
|
|
225
326
|
throw new RangeError("additionalDigits must be 0, 1 or 2");
|
|
226
327
|
if (e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]")
|
|
@@ -229,23 +330,23 @@ function Re(e, t) {
|
|
|
229
330
|
return new Date(e);
|
|
230
331
|
if (!(typeof e == "string" || Object.prototype.toString.call(e) === "[object String]"))
|
|
231
332
|
return /* @__PURE__ */ new Date(NaN);
|
|
232
|
-
var i =
|
|
333
|
+
var i = dr(e), a = fr(i.date, n), o = a.year, l = a.restDateString, d = mr(l, o);
|
|
233
334
|
if (isNaN(d))
|
|
234
335
|
return /* @__PURE__ */ new Date(NaN);
|
|
235
336
|
if (d) {
|
|
236
337
|
var s = d.getTime(), u = 0, c;
|
|
237
|
-
if (i.time && (u =
|
|
338
|
+
if (i.time && (u = vr(i.time), isNaN(u)))
|
|
238
339
|
return /* @__PURE__ */ new Date(NaN);
|
|
239
340
|
if (i.timeZone || r.timeZone) {
|
|
240
341
|
if (c = oe(i.timeZone || r.timeZone, new Date(s + u)), isNaN(c))
|
|
241
342
|
return /* @__PURE__ */ new Date(NaN);
|
|
242
343
|
} else
|
|
243
|
-
c =
|
|
344
|
+
c = je(new Date(s + u)), c = je(new Date(s + u + c));
|
|
244
345
|
return new Date(s + u + c);
|
|
245
346
|
} else
|
|
246
347
|
return /* @__PURE__ */ new Date(NaN);
|
|
247
348
|
}
|
|
248
|
-
function
|
|
349
|
+
function dr(e) {
|
|
249
350
|
var t = {}, r = w.dateTimePattern.exec(e), n;
|
|
250
351
|
if (r ? (t.date = r[1], n = r[3]) : (r = w.datePattern.exec(e), r ? (t.date = r[1], n = r[2]) : (t.date = null, n = e)), n) {
|
|
251
352
|
var i = w.timeZone.exec(n);
|
|
@@ -253,7 +354,7 @@ function tr(e) {
|
|
|
253
354
|
}
|
|
254
355
|
return t;
|
|
255
356
|
}
|
|
256
|
-
function
|
|
357
|
+
function fr(e, t) {
|
|
257
358
|
var r = w.YYY[t], n = w.YYYYY[t], i;
|
|
258
359
|
if (i = w.YYYY.exec(e) || n.exec(e), i) {
|
|
259
360
|
var a = i[1];
|
|
@@ -273,82 +374,82 @@ function rr(e, t) {
|
|
|
273
374
|
year: null
|
|
274
375
|
};
|
|
275
376
|
}
|
|
276
|
-
function
|
|
377
|
+
function mr(e, t) {
|
|
277
378
|
if (t === null)
|
|
278
379
|
return null;
|
|
279
380
|
var r, n, i, a;
|
|
280
381
|
if (e.length === 0)
|
|
281
382
|
return n = /* @__PURE__ */ new Date(0), n.setUTCFullYear(t), n;
|
|
282
383
|
if (r = w.MM.exec(e), r)
|
|
283
|
-
return n = /* @__PURE__ */ new Date(0), i = parseInt(r[1], 10) - 1,
|
|
384
|
+
return n = /* @__PURE__ */ new Date(0), i = parseInt(r[1], 10) - 1, Be(t, i) ? (n.setUTCFullYear(t, i), n) : /* @__PURE__ */ new Date(NaN);
|
|
284
385
|
if (r = w.DDD.exec(e), r) {
|
|
285
386
|
n = /* @__PURE__ */ new Date(0);
|
|
286
387
|
var o = parseInt(r[1], 10);
|
|
287
|
-
return
|
|
388
|
+
return yr(t, o) ? (n.setUTCFullYear(t, 0, o), n) : /* @__PURE__ */ new Date(NaN);
|
|
288
389
|
}
|
|
289
390
|
if (r = w.MMDD.exec(e), r) {
|
|
290
391
|
n = /* @__PURE__ */ new Date(0), i = parseInt(r[1], 10) - 1;
|
|
291
392
|
var l = parseInt(r[2], 10);
|
|
292
|
-
return
|
|
393
|
+
return Be(t, i, l) ? (n.setUTCFullYear(t, i, l), n) : /* @__PURE__ */ new Date(NaN);
|
|
293
394
|
}
|
|
294
395
|
if (r = w.Www.exec(e), r)
|
|
295
|
-
return a = parseInt(r[1], 10) - 1,
|
|
396
|
+
return a = parseInt(r[1], 10) - 1, Qe(t, a) ? We(t, a) : /* @__PURE__ */ new Date(NaN);
|
|
296
397
|
if (r = w.WwwD.exec(e), r) {
|
|
297
398
|
a = parseInt(r[1], 10) - 1;
|
|
298
399
|
var d = parseInt(r[2], 10) - 1;
|
|
299
|
-
return
|
|
400
|
+
return Qe(t, a, d) ? We(t, a, d) : /* @__PURE__ */ new Date(NaN);
|
|
300
401
|
}
|
|
301
402
|
return null;
|
|
302
403
|
}
|
|
303
|
-
function
|
|
404
|
+
function vr(e) {
|
|
304
405
|
var t, r, n;
|
|
305
406
|
if (t = w.HH.exec(e), t)
|
|
306
407
|
return r = parseFloat(t[1].replace(",", ".")), he(r) ? r % 24 * ve : NaN;
|
|
307
408
|
if (t = w.HHMM.exec(e), t)
|
|
308
|
-
return r = parseInt(t[1], 10), n = parseFloat(t[2].replace(",", ".")), he(r, n) ? r % 24 * ve + n *
|
|
409
|
+
return r = parseInt(t[1], 10), n = parseFloat(t[2].replace(",", ".")), he(r, n) ? r % 24 * ve + n * Ke : NaN;
|
|
309
410
|
if (t = w.HHMMSS.exec(e), t) {
|
|
310
411
|
r = parseInt(t[1], 10), n = parseInt(t[2], 10);
|
|
311
412
|
var i = parseFloat(t[3].replace(",", "."));
|
|
312
|
-
return he(r, n, i) ? r % 24 * ve + n *
|
|
413
|
+
return he(r, n, i) ? r % 24 * ve + n * Ke + i * 1e3 : NaN;
|
|
313
414
|
}
|
|
314
415
|
return null;
|
|
315
416
|
}
|
|
316
|
-
function
|
|
417
|
+
function We(e, t, r) {
|
|
317
418
|
t = t || 0, r = r || 0;
|
|
318
419
|
var n = /* @__PURE__ */ new Date(0);
|
|
319
420
|
n.setUTCFullYear(e, 0, 4);
|
|
320
421
|
var i = n.getUTCDay() || 7, a = t * 7 + r + 1 - i;
|
|
321
422
|
return n.setUTCDate(n.getUTCDate() + a), n;
|
|
322
423
|
}
|
|
323
|
-
var
|
|
424
|
+
var hr = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], gr = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
324
425
|
function lt(e) {
|
|
325
426
|
return e % 400 === 0 || e % 4 === 0 && e % 100 !== 0;
|
|
326
427
|
}
|
|
327
|
-
function
|
|
428
|
+
function Be(e, t, r) {
|
|
328
429
|
if (t < 0 || t > 11)
|
|
329
430
|
return !1;
|
|
330
431
|
if (r != null) {
|
|
331
432
|
if (r < 1)
|
|
332
433
|
return !1;
|
|
333
434
|
var n = lt(e);
|
|
334
|
-
if (n && r >
|
|
435
|
+
if (n && r > gr[t] || !n && r > hr[t])
|
|
335
436
|
return !1;
|
|
336
437
|
}
|
|
337
438
|
return !0;
|
|
338
439
|
}
|
|
339
|
-
function
|
|
440
|
+
function yr(e, t) {
|
|
340
441
|
if (t < 1)
|
|
341
442
|
return !1;
|
|
342
443
|
var r = lt(e);
|
|
343
444
|
return !(r && t > 366 || !r && t > 365);
|
|
344
445
|
}
|
|
345
|
-
function
|
|
446
|
+
function Qe(e, t, r) {
|
|
346
447
|
return !(t < 0 || t > 52 || r != null && (r < 0 || r > 6));
|
|
347
448
|
}
|
|
348
449
|
function he(e, t, r) {
|
|
349
450
|
return !(e != null && (e < 0 || e >= 25) || t != null && (t < 0 || t >= 60) || r != null && (r < 0 || r >= 60));
|
|
350
451
|
}
|
|
351
|
-
var
|
|
452
|
+
var Ne = { exports: {} }, Ce = { exports: {} };
|
|
352
453
|
(function(e, t) {
|
|
353
454
|
Object.defineProperty(t, "__esModule", {
|
|
354
455
|
value: !0
|
|
@@ -361,34 +462,34 @@ var _e = { exports: {} }, Ie = { exports: {} };
|
|
|
361
462
|
return n;
|
|
362
463
|
}
|
|
363
464
|
e.exports = t.default;
|
|
364
|
-
})(
|
|
365
|
-
var
|
|
465
|
+
})(Ce, Ce.exports);
|
|
466
|
+
var pr = Ce.exports;
|
|
366
467
|
(function(e, t) {
|
|
367
|
-
var r =
|
|
468
|
+
var r = Bt.default;
|
|
368
469
|
Object.defineProperty(t, "__esModule", {
|
|
369
470
|
value: !0
|
|
370
471
|
}), t.default = i;
|
|
371
|
-
var n = r(
|
|
472
|
+
var n = r(pr);
|
|
372
473
|
function i(a) {
|
|
373
474
|
return (0, n.default)({}, a);
|
|
374
475
|
}
|
|
375
476
|
e.exports = t.default;
|
|
376
|
-
})(
|
|
377
|
-
var
|
|
378
|
-
const
|
|
379
|
-
function
|
|
380
|
-
var n =
|
|
477
|
+
})(Ne, Ne.exports);
|
|
478
|
+
var Tr = Ne.exports;
|
|
479
|
+
const Dr = /* @__PURE__ */ be(Tr);
|
|
480
|
+
function Er(e, t, r) {
|
|
481
|
+
var n = Ie(e, r), i = oe(t, n, !0), a = new Date(n.getTime() - i), o = /* @__PURE__ */ new Date(0);
|
|
381
482
|
return o.setFullYear(a.getUTCFullYear(), a.getUTCMonth(), a.getUTCDate()), o.setHours(a.getUTCHours(), a.getUTCMinutes(), a.getUTCSeconds(), a.getUTCMilliseconds()), o;
|
|
382
483
|
}
|
|
383
484
|
function ct(e, t) {
|
|
384
485
|
return -oe(e, t);
|
|
385
486
|
}
|
|
386
|
-
function
|
|
487
|
+
function wr(e, t, r) {
|
|
387
488
|
if (typeof e == "string" && !e.match(ut)) {
|
|
388
|
-
var n =
|
|
389
|
-
return n.timeZone = t,
|
|
489
|
+
var n = Dr(r);
|
|
490
|
+
return n.timeZone = t, Ie(e, n);
|
|
390
491
|
}
|
|
391
|
-
var i =
|
|
492
|
+
var i = Ie(e, r), a = Oe(
|
|
392
493
|
i.getFullYear(),
|
|
393
494
|
i.getMonth(),
|
|
394
495
|
i.getDate(),
|
|
@@ -399,13 +500,13 @@ function fr(e, t, r) {
|
|
|
399
500
|
).getTime(), o = oe(t, new Date(a));
|
|
400
501
|
return new Date(a + o);
|
|
401
502
|
}
|
|
402
|
-
const
|
|
503
|
+
const Je = {
|
|
403
504
|
[v.MINUTELY]: 60 * 1e3,
|
|
404
505
|
[v.HOURLY]: 60 * 60 * 1e3,
|
|
405
506
|
[v.DAILY]: 60 * 60 * 24 * 1e3,
|
|
406
507
|
[v.WEEKLY]: 60 * 60 * 24 * 7 * 1e3
|
|
407
508
|
};
|
|
408
|
-
function
|
|
509
|
+
function Sr(e, t) {
|
|
409
510
|
return e ? {
|
|
410
511
|
duration: e,
|
|
411
512
|
type: "duration",
|
|
@@ -413,117 +514,16 @@ function mr(e, t) {
|
|
|
413
514
|
} : null;
|
|
414
515
|
}
|
|
415
516
|
function dt(e, t, r, n) {
|
|
416
|
-
const i =
|
|
517
|
+
const i = Je[r];
|
|
417
518
|
let a = 0;
|
|
418
|
-
return i >=
|
|
519
|
+
return i >= Je[v.DAILY] && (n ? a = -ct(n, t) : a = t.getTimezoneOffset() * 60 * 1e3), new Date(e((t.getTime() - a) / i) * i + a);
|
|
419
520
|
}
|
|
420
|
-
function
|
|
521
|
+
function Xe(e, t, r) {
|
|
421
522
|
return dt(Math.floor, e, t, r);
|
|
422
523
|
}
|
|
423
|
-
function
|
|
524
|
+
function Rr(e, t, r) {
|
|
424
525
|
return dt(Math.ceil, e, t, r);
|
|
425
526
|
}
|
|
426
|
-
function ne(e) {
|
|
427
|
-
"@babel/helpers - typeof";
|
|
428
|
-
return ne = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
429
|
-
return typeof t;
|
|
430
|
-
} : function(t) {
|
|
431
|
-
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
432
|
-
}, ne(e);
|
|
433
|
-
}
|
|
434
|
-
function N(e) {
|
|
435
|
-
if (e === null || e === !0 || e === !1)
|
|
436
|
-
return NaN;
|
|
437
|
-
var t = Number(e);
|
|
438
|
-
return isNaN(t) ? t : t < 0 ? Math.ceil(t) : Math.floor(t);
|
|
439
|
-
}
|
|
440
|
-
function R(e, t) {
|
|
441
|
-
if (t.length < e)
|
|
442
|
-
throw new TypeError(e + " argument" + (e > 1 ? "s" : "") + " required, but only " + t.length + " present");
|
|
443
|
-
}
|
|
444
|
-
function P(e) {
|
|
445
|
-
R(1, arguments);
|
|
446
|
-
var t = Object.prototype.toString.call(e);
|
|
447
|
-
return e instanceof Date || ne(e) === "object" && t === "[object Date]" ? new Date(e.getTime()) : typeof e == "number" || t === "[object Number]" ? new Date(e) : ((typeof e == "string" || t === "[object String]") && typeof console < "u" && (console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"), console.warn(new Error().stack)), /* @__PURE__ */ new Date(NaN));
|
|
448
|
-
}
|
|
449
|
-
function Ne(e, t) {
|
|
450
|
-
R(2, arguments);
|
|
451
|
-
var r = P(e), n = N(t);
|
|
452
|
-
return isNaN(n) ? /* @__PURE__ */ new Date(NaN) : (n && r.setDate(r.getDate() + n), r);
|
|
453
|
-
}
|
|
454
|
-
function hr(e, t) {
|
|
455
|
-
R(2, arguments);
|
|
456
|
-
var r = P(e), n = N(t);
|
|
457
|
-
if (isNaN(n))
|
|
458
|
-
return /* @__PURE__ */ new Date(NaN);
|
|
459
|
-
if (!n)
|
|
460
|
-
return r;
|
|
461
|
-
var i = r.getDate(), a = new Date(r.getTime());
|
|
462
|
-
a.setMonth(r.getMonth() + n + 1, 0);
|
|
463
|
-
var o = a.getDate();
|
|
464
|
-
return i >= o ? a : (r.setFullYear(a.getFullYear(), a.getMonth(), i), r);
|
|
465
|
-
}
|
|
466
|
-
var gr = {};
|
|
467
|
-
function yr() {
|
|
468
|
-
return gr;
|
|
469
|
-
}
|
|
470
|
-
function ae(e, t) {
|
|
471
|
-
var r, n, i, a, o, l, d, s;
|
|
472
|
-
R(1, arguments);
|
|
473
|
-
var u = yr(), c = N((r = (n = (i = (a = t == null ? void 0 : t.weekStartsOn) !== null && a !== void 0 ? a : t == null || (o = t.locale) === null || o === void 0 || (l = o.options) === null || l === void 0 ? void 0 : l.weekStartsOn) !== null && i !== void 0 ? i : u.weekStartsOn) !== null && n !== void 0 ? n : (d = u.locale) === null || d === void 0 || (s = d.options) === null || s === void 0 ? void 0 : s.weekStartsOn) !== null && r !== void 0 ? r : 0);
|
|
474
|
-
if (!(c >= 0 && c <= 6))
|
|
475
|
-
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
|
|
476
|
-
var f = P(e), m = f.getDay(), h = (m < c ? 7 : 0) + m - c;
|
|
477
|
-
return f.setDate(f.getDate() - h), f.setHours(0, 0, 0, 0), f;
|
|
478
|
-
}
|
|
479
|
-
function Je(e) {
|
|
480
|
-
R(1, arguments);
|
|
481
|
-
var t = P(e);
|
|
482
|
-
return t.setHours(0, 0, 0, 0), t;
|
|
483
|
-
}
|
|
484
|
-
var pr = 60, Tr = 3600;
|
|
485
|
-
function V(e) {
|
|
486
|
-
R(1, arguments);
|
|
487
|
-
var t = P(e);
|
|
488
|
-
return t.setDate(1), t.setHours(0, 0, 0, 0), t;
|
|
489
|
-
}
|
|
490
|
-
function Dr(e) {
|
|
491
|
-
R(1, arguments);
|
|
492
|
-
var t = P(e), r = t.getFullYear(), n = t.getMonth(), i = /* @__PURE__ */ new Date(0);
|
|
493
|
-
return i.setFullYear(r, n + 1, 0), i.setHours(0, 0, 0, 0), i.getDate();
|
|
494
|
-
}
|
|
495
|
-
function Ce(e) {
|
|
496
|
-
R(1, arguments);
|
|
497
|
-
var t = P(e), r = t.getTime();
|
|
498
|
-
return r;
|
|
499
|
-
}
|
|
500
|
-
function Xe(e) {
|
|
501
|
-
return R(1, arguments), Math.floor(Ce(e) / 1e3);
|
|
502
|
-
}
|
|
503
|
-
function Er(e) {
|
|
504
|
-
return R(1, arguments), Math.floor(e * Tr);
|
|
505
|
-
}
|
|
506
|
-
function wr(e, t) {
|
|
507
|
-
R(2, arguments);
|
|
508
|
-
var r = N(t);
|
|
509
|
-
return Ne(e, -r);
|
|
510
|
-
}
|
|
511
|
-
function Sr(e) {
|
|
512
|
-
R(1, arguments);
|
|
513
|
-
var t = e / pr;
|
|
514
|
-
return Math.floor(t);
|
|
515
|
-
}
|
|
516
|
-
function Oe(e, t) {
|
|
517
|
-
R(2, arguments);
|
|
518
|
-
var r = N(t);
|
|
519
|
-
return hr(e, -r);
|
|
520
|
-
}
|
|
521
|
-
function Rr(e, t) {
|
|
522
|
-
if (R(2, arguments), !t || ne(t) !== "object")
|
|
523
|
-
return /* @__PURE__ */ new Date(NaN);
|
|
524
|
-
var r = t.years ? N(t.years) : 0, n = t.months ? N(t.months) : 0, i = t.weeks ? N(t.weeks) : 0, a = t.days ? N(t.days) : 0, o = t.hours ? N(t.hours) : 0, l = t.minutes ? N(t.minutes) : 0, d = t.seconds ? N(t.seconds) : 0, s = Oe(e, n + r * 12), u = wr(s, a + i * 7), c = l + o * 60, f = d + c * 60, m = f * 1e3, h = new Date(u.getTime() - m);
|
|
525
|
-
return h;
|
|
526
|
-
}
|
|
527
527
|
let _r = class ft {
|
|
528
528
|
constructor(t, r) {
|
|
529
529
|
if (I(this, "timeframe"), I(this, "tz"), this.constructor === ft)
|
|
@@ -534,8 +534,8 @@ let _r = class ft {
|
|
|
534
534
|
if (t)
|
|
535
535
|
return new Date(this.endDate().getTime() - this.timeframe.timeframeLengthMs() * n);
|
|
536
536
|
{
|
|
537
|
-
const i = this.endDate(), a = this.timeframe.rawStart(this.tz), o =
|
|
538
|
-
return
|
|
537
|
+
const i = this.endDate(), a = this.timeframe.rawStart(this.tz), o = Xe(a, r, this.tz), l = (i.getTime() - o.getTime()) * (n - 1);
|
|
538
|
+
return Xe(
|
|
539
539
|
new Date(a.getTime() - l),
|
|
540
540
|
r,
|
|
541
541
|
this.tz
|
|
@@ -546,27 +546,27 @@ let _r = class ft {
|
|
|
546
546
|
return Math.floor(this.granularityMs() / 1e3);
|
|
547
547
|
}
|
|
548
548
|
granularityDruid() {
|
|
549
|
-
return
|
|
549
|
+
return Sr(this.granularityMs(), this.startDate().toISOString());
|
|
550
550
|
}
|
|
551
551
|
// Return a UNIX timestamp suitable for use in the `start` query param.
|
|
552
552
|
startSeconds() {
|
|
553
|
-
return
|
|
553
|
+
return $e(this.startDate());
|
|
554
554
|
}
|
|
555
555
|
// Return a UNIX timestamp suitable for use in the `end` query param.
|
|
556
556
|
endSeconds() {
|
|
557
|
-
return
|
|
557
|
+
return $e(this.endDate());
|
|
558
558
|
}
|
|
559
559
|
// Return epoch time in milliseconds, suitable for use in the `startMs` query param.
|
|
560
560
|
startMs() {
|
|
561
|
-
return
|
|
561
|
+
return we(this.startDate());
|
|
562
562
|
}
|
|
563
563
|
// Return epoch time in milliseconds, suitable for use in the `endMs` query param.
|
|
564
564
|
endMs() {
|
|
565
|
-
return
|
|
565
|
+
return we(this.endDate());
|
|
566
566
|
}
|
|
567
567
|
// Return whether the timeframe's bounds are within the allotment for a free tier user.
|
|
568
568
|
withinFreeTier() {
|
|
569
|
-
return this.startDate() >=
|
|
569
|
+
return this.startDate() >= Wt(/* @__PURE__ */ new Date(), { days: 1 });
|
|
570
570
|
}
|
|
571
571
|
};
|
|
572
572
|
class mt extends _r {
|
|
@@ -574,7 +574,7 @@ class mt extends _r {
|
|
|
574
574
|
return this.calculateStartDate(this.timeframe.isRelative, this.timeframe.dataGranularity);
|
|
575
575
|
}
|
|
576
576
|
endDate() {
|
|
577
|
-
return
|
|
577
|
+
return Rr(this.timeframe.rawEnd(this.tz), this.timeframe.dataGranularity, this.tz);
|
|
578
578
|
}
|
|
579
579
|
granularityMs() {
|
|
580
580
|
return this.endDate().getTime() - this.startDate().getTime();
|
|
@@ -589,7 +589,7 @@ class Ir extends mt {
|
|
|
589
589
|
}
|
|
590
590
|
}
|
|
591
591
|
const j = (e, t) => new Date(e.getTime() - ct(t, e));
|
|
592
|
-
|
|
592
|
+
class C {
|
|
593
593
|
constructor(t) {
|
|
594
594
|
I(this, "timeframeText"), I(this, "key"), I(this, "display"), I(this, "timeframeLength"), I(this, "allowedTiers"), I(this, "defaultResponseGranularity"), I(this, "dataGranularity"), I(this, "isRelative"), I(this, "_startCustom"), I(this, "_endCustom"), this.display = t.display, this.timeframeText = t.timeframeText, this.key = t.key, this.timeframeLength = t.timeframeLength, this.allowedTiers = t.allowedTiers, this.defaultResponseGranularity = t.defaultResponseGranularity, this.dataGranularity = t.dataGranularity, this.isRelative = t.isRelative, this._startCustom = t.startCustom, this._endCustom = t.endCustom;
|
|
595
595
|
}
|
|
@@ -618,10 +618,10 @@ let C = class {
|
|
|
618
618
|
tzAdjustedDate(t) {
|
|
619
619
|
if (!t)
|
|
620
620
|
return /* @__PURE__ */ new Date();
|
|
621
|
-
const r =
|
|
622
|
-
return
|
|
621
|
+
const r = wr(/* @__PURE__ */ new Date(), new Intl.DateTimeFormat().resolvedOptions().timeZone);
|
|
622
|
+
return Er(r, t);
|
|
623
623
|
}
|
|
624
|
-
}
|
|
624
|
+
}
|
|
625
625
|
class Nr extends C {
|
|
626
626
|
rawStart(t) {
|
|
627
627
|
let r = ae(this.tzAdjustedDate(t), { weekStartsOn: 1 });
|
|
@@ -659,7 +659,7 @@ class Mr extends C {
|
|
|
659
659
|
return t && (r = j(r, t)), r;
|
|
660
660
|
}
|
|
661
661
|
rawStart(t) {
|
|
662
|
-
let r = V(
|
|
662
|
+
let r = V(Me(this.tzAdjustedDate(t), 1));
|
|
663
663
|
return t && (r = j(r, t)), r;
|
|
664
664
|
}
|
|
665
665
|
}
|
|
@@ -763,7 +763,7 @@ const et = /* @__PURE__ */ new Map([
|
|
|
763
763
|
timeframeText: "Week",
|
|
764
764
|
timeframeLength: () => {
|
|
765
765
|
const e = ae(/* @__PURE__ */ new Date(), { weekStartsOn: 1 });
|
|
766
|
-
return (
|
|
766
|
+
return (ze(Ee(/* @__PURE__ */ new Date(), 1)).getTime() - e.getTime()) / 1e3;
|
|
767
767
|
},
|
|
768
768
|
defaultResponseGranularity: v.DAILY,
|
|
769
769
|
dataGranularity: v.DAILY,
|
|
@@ -779,7 +779,7 @@ const et = /* @__PURE__ */ new Map([
|
|
|
779
779
|
timeframeText: "Month",
|
|
780
780
|
timeframeLength: () => {
|
|
781
781
|
const e = V(/* @__PURE__ */ new Date());
|
|
782
|
-
return (
|
|
782
|
+
return (ze(Ee(/* @__PURE__ */ new Date(), 1)).getTime() - e.getTime()) / 1e3;
|
|
783
783
|
},
|
|
784
784
|
defaultResponseGranularity: v.DAILY,
|
|
785
785
|
dataGranularity: v.DAILY,
|
|
@@ -808,8 +808,8 @@ const et = /* @__PURE__ */ new Map([
|
|
|
808
808
|
timeframeText: "Month",
|
|
809
809
|
timeframeLength: () => {
|
|
810
810
|
let e = 0;
|
|
811
|
-
const t = V(/* @__PURE__ */ new Date()), r = V(
|
|
812
|
-
return t.getTimezoneOffset() !== r.getTimezoneOffset() && (e = br(t, r)), 60 * 60 * 24 *
|
|
811
|
+
const t = V(/* @__PURE__ */ new Date()), r = V(Me(/* @__PURE__ */ new Date(), 1));
|
|
812
|
+
return t.getTimezoneOffset() !== r.getTimezoneOffset() && (e = br(t, r)), 60 * 60 * 24 * Zt((/* @__PURE__ */ new Date()).setMonth((/* @__PURE__ */ new Date()).getMonth() - 1)) + Gt(e);
|
|
813
813
|
},
|
|
814
814
|
defaultResponseGranularity: v.DAILY,
|
|
815
815
|
dataGranularity: v.DAILY,
|
|
@@ -819,7 +819,7 @@ const et = /* @__PURE__ */ new Map([
|
|
|
819
819
|
]
|
|
820
820
|
]);
|
|
821
821
|
function br(e, t) {
|
|
822
|
-
return
|
|
822
|
+
return Kt(e.getTimezoneOffset() - t.getTimezoneOffset());
|
|
823
823
|
}
|
|
824
824
|
const Or = {
|
|
825
825
|
notAvailable: "N/A"
|
|
@@ -927,7 +927,7 @@ function Hr(e) {
|
|
|
927
927
|
return null;
|
|
928
928
|
const c = (m = e.filter) != null && m.value ? JSON.stringify(e.filter.value) : "";
|
|
929
929
|
return `metric-fetcher-${n.value}-${(h = e.dimensions) == null ? void 0 : h.join("-")}-${(g = e.metrics) == null ? void 0 : g.join("-")}-${c}`;
|
|
930
|
-
}), { response: a, error: o, isValidating: l } =
|
|
930
|
+
}), { response: a, error: o, isValidating: l } = z.useRequest(
|
|
931
931
|
() => i.value,
|
|
932
932
|
() => e.dataFetcher(t.value, r.value),
|
|
933
933
|
{
|
|
@@ -981,7 +981,7 @@ function Vr(e) {
|
|
|
981
981
|
});
|
|
982
982
|
}
|
|
983
983
|
var ye = /* @__PURE__ */ new WeakMap(), nt = 0;
|
|
984
|
-
function
|
|
984
|
+
function zr(e) {
|
|
985
985
|
if (!e.length)
|
|
986
986
|
return "";
|
|
987
987
|
for (var t = "arg", r = 0; r < e.length; ++r) {
|
|
@@ -990,14 +990,14 @@ function $r(e) {
|
|
|
990
990
|
}
|
|
991
991
|
return t;
|
|
992
992
|
}
|
|
993
|
-
function
|
|
993
|
+
function $r(e) {
|
|
994
994
|
if (typeof e == "function")
|
|
995
995
|
try {
|
|
996
996
|
e = e();
|
|
997
997
|
} catch {
|
|
998
998
|
e = "";
|
|
999
999
|
}
|
|
1000
|
-
return Array.isArray(e) ? e =
|
|
1000
|
+
return Array.isArray(e) ? e = zr(e) : e = String(e || ""), e;
|
|
1001
1001
|
}
|
|
1002
1002
|
var Ue = (
|
|
1003
1003
|
/** @class */
|
|
@@ -1006,7 +1006,7 @@ var Ue = (
|
|
|
1006
1006
|
t === void 0 && (t = 0), this.items = /* @__PURE__ */ new Map(), this.ttl = t;
|
|
1007
1007
|
}
|
|
1008
1008
|
return e.prototype.serializeKey = function(t) {
|
|
1009
|
-
return
|
|
1009
|
+
return $r(t);
|
|
1010
1010
|
}, e.prototype.get = function(t) {
|
|
1011
1011
|
var r = this.serializeKey(t);
|
|
1012
1012
|
return this.items.get(r);
|
|
@@ -1143,7 +1143,7 @@ var b = globalThis && globalThis.__assign || function() {
|
|
|
1143
1143
|
throw s[1];
|
|
1144
1144
|
return { value: s[0] ? s[1] : void 0, done: !0 };
|
|
1145
1145
|
}
|
|
1146
|
-
},
|
|
1146
|
+
}, qr = globalThis && globalThis.__read || function(e, t) {
|
|
1147
1147
|
var r = typeof Symbol == "function" && e[Symbol.iterator];
|
|
1148
1148
|
if (!r)
|
|
1149
1149
|
return e;
|
|
@@ -1162,7 +1162,7 @@ var b = globalThis && globalThis.__assign || function() {
|
|
|
1162
1162
|
}
|
|
1163
1163
|
}
|
|
1164
1164
|
return a;
|
|
1165
|
-
},
|
|
1165
|
+
}, Kr = globalThis && globalThis.__spreadArray || function(e, t, r) {
|
|
1166
1166
|
if (r || arguments.length === 2)
|
|
1167
1167
|
for (var n = 0, i = t.length, a; n < i; n++)
|
|
1168
1168
|
(a || !(n in t)) && (a || (a = Array.prototype.slice.call(t, 0, n)), a[n] = t[n]);
|
|
@@ -1271,7 +1271,7 @@ function Qr() {
|
|
|
1271
1271
|
return k(this, function(Q) {
|
|
1272
1272
|
switch (Q.label) {
|
|
1273
1273
|
case 0:
|
|
1274
|
-
return x = Te.get(_), x ? [3, 2] : (Fe = Array.isArray(_) ? _ : [_], de = ue.apply(void 0,
|
|
1274
|
+
return x = Te.get(_), x ? [3, 2] : (Fe = Array.isArray(_) ? _ : [_], de = ue.apply(void 0, Kr([], qr(Fe), !1)), Te.set(_, de, a.dedupingInterval), [4, at(_, de, a.cache, c)]);
|
|
1275
1275
|
case 1:
|
|
1276
1276
|
return Q.sent(), [3, 4];
|
|
1277
1277
|
case 2:
|
|
@@ -1392,7 +1392,7 @@ function Xr(e, t, r) {
|
|
|
1392
1392
|
revalidate: o
|
|
1393
1393
|
};
|
|
1394
1394
|
}
|
|
1395
|
-
const
|
|
1395
|
+
const z = {
|
|
1396
1396
|
useI18n: xr,
|
|
1397
1397
|
useMetricCardBuilder: Vr,
|
|
1398
1398
|
useMetricFetcher: Hr,
|
|
@@ -1448,12 +1448,12 @@ const $ = {
|
|
|
1448
1448
|
withTrend: o && !u,
|
|
1449
1449
|
refreshInterval: l,
|
|
1450
1450
|
dataFetcher: d
|
|
1451
|
-
}, h =
|
|
1451
|
+
}, h = z.useMetricFetcher(f), g = z.useMetricFetcher(m);
|
|
1452
1452
|
return {
|
|
1453
1453
|
trafficData: h,
|
|
1454
1454
|
latencyData: g
|
|
1455
1455
|
};
|
|
1456
|
-
},
|
|
1456
|
+
}, _n = /* @__PURE__ */ se({
|
|
1457
1457
|
__name: "MetricsProviderInternal",
|
|
1458
1458
|
props: {
|
|
1459
1459
|
maxTimeframe: { default: p.THIRTY_DAY },
|
|
@@ -1606,10 +1606,10 @@ const Ye = 2, it = Ye + 2, an = (e, t, r = !1) => {
|
|
|
1606
1606
|
return (o, l) => {
|
|
1607
1607
|
const d = ee("KIcon"), s = ee("KTooltip");
|
|
1608
1608
|
return S(), M("div", ln, [
|
|
1609
|
-
|
|
1609
|
+
q("div", {
|
|
1610
1610
|
class: te(["metricscard-title", e.cardSize])
|
|
1611
1611
|
}, [
|
|
1612
|
-
|
|
1612
|
+
q("span", null, K(e.title), 1),
|
|
1613
1613
|
e.tooltip ? (S(), re(s, {
|
|
1614
1614
|
key: 0,
|
|
1615
1615
|
class: "metricscard-tooltip",
|
|
@@ -1617,7 +1617,7 @@ const Ye = 2, it = Ye + 2, an = (e, t, r = !1) => {
|
|
|
1617
1617
|
placement: "right"
|
|
1618
1618
|
}, {
|
|
1619
1619
|
default: bt(() => [
|
|
1620
|
-
|
|
1620
|
+
$(d, {
|
|
1621
1621
|
icon: "info",
|
|
1622
1622
|
size: "12"
|
|
1623
1623
|
})
|
|
@@ -1626,15 +1626,15 @@ const Ye = 2, it = Ye + 2, an = (e, t, r = !1) => {
|
|
|
1626
1626
|
}, 8, ["label"])) : X("", !0)
|
|
1627
1627
|
], 2),
|
|
1628
1628
|
e.hasError ? (S(), M("div", cn, [
|
|
1629
|
-
|
|
1629
|
+
$(d, {
|
|
1630
1630
|
icon: "warning",
|
|
1631
1631
|
size: "20"
|
|
1632
1632
|
}),
|
|
1633
|
-
|
|
1633
|
+
q("div", null, K(e.errorMessage), 1)
|
|
1634
1634
|
])) : (S(), M("div", dn, [
|
|
1635
|
-
|
|
1635
|
+
q("div", {
|
|
1636
1636
|
style: Ot(`font-size:${B(a)}`)
|
|
1637
|
-
},
|
|
1637
|
+
}, K(e.metricValue), 5),
|
|
1638
1638
|
B(i) ? (S(), M("div", {
|
|
1639
1639
|
key: 0,
|
|
1640
1640
|
class: te(["metricscard-value-trend", n(e.changePolarity)])
|
|
@@ -1645,7 +1645,7 @@ const Ye = 2, it = Ye + 2, an = (e, t, r = !1) => {
|
|
|
1645
1645
|
icon: e.icon,
|
|
1646
1646
|
size: "18"
|
|
1647
1647
|
}, null, 8, ["color", "icon"])) : X("", !0),
|
|
1648
|
-
|
|
1648
|
+
q("div", null, K(e.metricChange), 1)
|
|
1649
1649
|
], 2)) : X("", !0)
|
|
1650
1650
|
]))
|
|
1651
1651
|
]);
|
|
@@ -1660,8 +1660,8 @@ const Ye = 2, it = Ye + 2, an = (e, t, r = !1) => {
|
|
|
1660
1660
|
function gn(e, t) {
|
|
1661
1661
|
const r = ee("KSkeletonBox");
|
|
1662
1662
|
return S(), M("div", hn, [
|
|
1663
|
-
|
|
1664
|
-
|
|
1663
|
+
$(r, { width: "100" }),
|
|
1664
|
+
$(r, { width: "75" })
|
|
1665
1665
|
]);
|
|
1666
1666
|
}
|
|
1667
1667
|
const yn = /* @__PURE__ */ xe(vn, [["render", gn], ["__scopeId", "data-v-e4239529"]]), pn = {
|
|
@@ -1719,12 +1719,12 @@ const yn = /* @__PURE__ */ xe(vn, [["render", gn], ["__scopeId", "data-v-e423952
|
|
|
1719
1719
|
class: te(["kong-ui-public-metric-card-container", e.cardSize])
|
|
1720
1720
|
}, [
|
|
1721
1721
|
B(r) ? (S(), M("div", pn, [
|
|
1722
|
-
|
|
1722
|
+
$(o, {
|
|
1723
1723
|
class: "error-display-icon",
|
|
1724
1724
|
icon: "warning",
|
|
1725
1725
|
size: "24"
|
|
1726
1726
|
}),
|
|
1727
|
-
e.errorMessage ? (S(), M("div", Tn,
|
|
1727
|
+
e.errorMessage ? (S(), M("div", Tn, K(e.errorMessage), 1)) : X("", !0)
|
|
1728
1728
|
])) : (S(!0), M(Ve, { key: 1 }, At(e.cards, (l, d) => (S(), M(Ve, null, [
|
|
1729
1729
|
e.loading ? (S(), re(yn, {
|
|
1730
1730
|
key: `skeleton-${d}`,
|
|
@@ -1741,7 +1741,7 @@ const yn = /* @__PURE__ */ xe(vn, [["render", gn], ["__scopeId", "data-v-e423952
|
|
|
1741
1741
|
};
|
|
1742
1742
|
}
|
|
1743
1743
|
}), En = /* @__PURE__ */ xe(Dn, [["__scopeId", "data-v-390af84f"]]);
|
|
1744
|
-
const
|
|
1744
|
+
const In = /* @__PURE__ */ se({
|
|
1745
1745
|
__name: "MetricsConsumer",
|
|
1746
1746
|
props: {
|
|
1747
1747
|
lookupKey: { default: void 0 },
|
|
@@ -1752,7 +1752,7 @@ const Nn = /* @__PURE__ */ se({
|
|
|
1752
1752
|
const t = e, r = Ut(pt);
|
|
1753
1753
|
if (!r)
|
|
1754
1754
|
throw new Error("MetricsConsumer must be nested inside a MetricsProvider instance.");
|
|
1755
|
-
const { traffic: n, latency: i } = r.data, { i18n: a } =
|
|
1755
|
+
const { traffic: n, latency: i } = r.data, { i18n: a } = z.useI18n(), o = z.useMetricCardBuilder({
|
|
1756
1756
|
title: E(() => r.longCardTitles ? a.t("metricCard.long.traffic") : a.t("metricCard.short.traffic")),
|
|
1757
1757
|
record: n.mapped,
|
|
1758
1758
|
hasError: n.hasError,
|
|
@@ -1768,7 +1768,7 @@ const Nn = /* @__PURE__ */ se({
|
|
|
1768
1768
|
title: r.longCardTitles ? a.t("metricCard.long.errorRate") : a.t("metricCard.short.errorRate"),
|
|
1769
1769
|
increaseIsBad: !0
|
|
1770
1770
|
};
|
|
1771
|
-
}), s = (g) => `${g}ms`, u =
|
|
1771
|
+
}), s = (g) => `${g}ms`, u = z.useMetricCardBuilder({
|
|
1772
1772
|
title: E(() => r.longCardTitles ? a.t("metricCard.long.latency") : a.t("metricCard.short.latency")),
|
|
1773
1773
|
hasError: i.hasError,
|
|
1774
1774
|
record: i.mapped,
|
|
@@ -1791,10 +1791,10 @@ const Nn = /* @__PURE__ */ se({
|
|
|
1791
1791
|
latencyFormatted: s(u.value.currentValue)
|
|
1792
1792
|
}));
|
|
1793
1793
|
return (g, D) => st(g.$slots, "default", { cardValues: h.value }, () => [
|
|
1794
|
-
|
|
1794
|
+
$(B(En), Yt(xt(m.value)), null, 16)
|
|
1795
1795
|
]);
|
|
1796
1796
|
}
|
|
1797
|
-
}), J = (e) => new Date(e),
|
|
1797
|
+
}), J = (e) => new Date(e), Nn = (e, t) => {
|
|
1798
1798
|
const r = e.body, { startMs: n, endMs: i } = e.query, a = typeof n != "number" ? parseInt(n, 10) : n, o = typeof i != "number" ? parseInt(i, 10) : i;
|
|
1799
1799
|
e.reply({
|
|
1800
1800
|
statusCode: 200,
|
|
@@ -1845,9 +1845,9 @@ export {
|
|
|
1845
1845
|
Ae as EXPLORE_V2_AGGREGATIONS,
|
|
1846
1846
|
L as EXPLORE_V2_DIMENSIONS,
|
|
1847
1847
|
vt as EXPLORE_V2_FILTER_TYPES,
|
|
1848
|
-
|
|
1849
|
-
|
|
1848
|
+
In as MetricsConsumer,
|
|
1849
|
+
_n as MetricsProviderInternal,
|
|
1850
1850
|
wn as mockExploreResponse,
|
|
1851
|
-
|
|
1851
|
+
Nn as mockExploreResponseFromCypress
|
|
1852
1852
|
};
|
|
1853
1853
|
//# sourceMappingURL=vitals-metric-provider.es.js.map
|