@ssgc/alert-console 2.9.5 → 2.9.6
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/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +1122 -1122
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as c, jsxs as y, Fragment as ur } from "react/jsx-runtime";
|
|
2
|
-
import { useContext as xa, useMemo as
|
|
3
|
-
import { Select as
|
|
2
|
+
import { useContext as xa, useMemo as Se, createContext as Oa, forwardRef as dr, createElement as qs, useState as g, useEffect as fe, useRef as Ea } from "react";
|
|
3
|
+
import { Select as Me, Table as on, Row as Ue, Col as J, Input as Ma, Tag as Rt, Space as st, Tooltip as An, Button as Le, Progress as Da, Dropdown as Ca, Typography as jt, Spin as Ts, Checkbox as Et, Divider as Zt, TimePicker as Tn, Tabs as ln, Card as Rs, Steps as Ra, Modal as Ua, Carousel as La } from "antd";
|
|
4
4
|
import { MessageOutlined as Fa, MailOutlined as $a, MoreOutlined as Pa, PlusOutlined as Wa, EditOutlined as Va, LeftOutlined as Za, RightOutlined as Ba } from "@ant-design/icons";
|
|
5
|
-
import { toast as
|
|
5
|
+
import { toast as be } from "react-toastify";
|
|
6
6
|
import { useQueryClient as za, useMutation as Ha, useQuery as cn, QueryClient as Ga, QueryClientProvider as qa } from "@tanstack/react-query";
|
|
7
7
|
const Ya = "#FF3B30", ja = "#FF9500", _a = "#FFCC00", Ja = "#34C759", es = {
|
|
8
8
|
critical: Ya,
|
|
@@ -288,66 +288,66 @@ function ci() {
|
|
|
288
288
|
(function(s, n) {
|
|
289
289
|
t.exports = n();
|
|
290
290
|
})(li, (function() {
|
|
291
|
-
var s = 1e3, n = 6e4, r = 36e5, a = "millisecond", i = "second", l = "minute", o = "hour", u = "day", d = "week", m = "month", S = "quarter", p = "year", k = "date",
|
|
292
|
-
var A = ["th", "st", "nd", "rd"], w =
|
|
293
|
-
return "[" +
|
|
294
|
-
} }, W = function(
|
|
295
|
-
var
|
|
296
|
-
return !
|
|
297
|
-
}, N = { s: W, z: function(
|
|
298
|
-
var A = -
|
|
299
|
-
return (A <= 0 ? "+" : "-") + W(
|
|
300
|
-
}, m: function
|
|
301
|
-
if (A.date() < w.date()) return -
|
|
302
|
-
var
|
|
303
|
-
return +(-(
|
|
304
|
-
}, a: function(
|
|
305
|
-
return
|
|
306
|
-
}, p: function(
|
|
307
|
-
return { M: m, y: p, w: d, d: u, D: k, h: o, m: l, s: i, ms: a, Q: S }[
|
|
308
|
-
}, u: function(
|
|
309
|
-
return
|
|
310
|
-
} },
|
|
311
|
-
|
|
312
|
-
var
|
|
313
|
-
return
|
|
314
|
-
}, h = function
|
|
291
|
+
var s = 1e3, n = 6e4, r = 36e5, a = "millisecond", i = "second", l = "minute", o = "hour", u = "day", d = "week", m = "month", S = "quarter", p = "year", k = "date", D = "Invalid Date", C = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, Y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, $ = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(L) {
|
|
292
|
+
var A = ["th", "st", "nd", "rd"], w = L % 100;
|
|
293
|
+
return "[" + L + (A[(w - 20) % 10] || A[w] || A[0]) + "]";
|
|
294
|
+
} }, W = function(L, A, w) {
|
|
295
|
+
var x = String(L);
|
|
296
|
+
return !x || x.length >= A ? L : "" + Array(A + 1 - x.length).join(w) + L;
|
|
297
|
+
}, N = { s: W, z: function(L) {
|
|
298
|
+
var A = -L.utcOffset(), w = Math.abs(A), x = Math.floor(w / 60), T = w % 60;
|
|
299
|
+
return (A <= 0 ? "+" : "-") + W(x, 2, "0") + ":" + W(T, 2, "0");
|
|
300
|
+
}, m: function L(A, w) {
|
|
301
|
+
if (A.date() < w.date()) return -L(w, A);
|
|
302
|
+
var x = 12 * (w.year() - A.year()) + (w.month() - A.month()), T = A.clone().add(x, m), U = w - T < 0, P = A.clone().add(x + (U ? -1 : 1), m);
|
|
303
|
+
return +(-(x + (w - T) / (U ? T - P : P - T)) || 0);
|
|
304
|
+
}, a: function(L) {
|
|
305
|
+
return L < 0 ? Math.ceil(L) || 0 : Math.floor(L);
|
|
306
|
+
}, p: function(L) {
|
|
307
|
+
return { M: m, y: p, w: d, d: u, D: k, h: o, m: l, s: i, ms: a, Q: S }[L] || String(L || "").toLowerCase().replace(/s$/, "");
|
|
308
|
+
}, u: function(L) {
|
|
309
|
+
return L === void 0;
|
|
310
|
+
} }, E = "en", Z = {};
|
|
311
|
+
Z[E] = $;
|
|
312
|
+
var R = "$isDayjsObject", q = function(L) {
|
|
313
|
+
return L instanceof le || !(!L || !L[R]);
|
|
314
|
+
}, h = function L(A, w, x) {
|
|
315
315
|
var T;
|
|
316
|
-
if (!A) return
|
|
316
|
+
if (!A) return E;
|
|
317
317
|
if (typeof A == "string") {
|
|
318
|
-
var
|
|
319
|
-
|
|
318
|
+
var U = A.toLowerCase();
|
|
319
|
+
Z[U] && (T = U), w && (Z[U] = w, T = U);
|
|
320
320
|
var P = A.split("-");
|
|
321
|
-
if (!T && P.length > 1) return
|
|
321
|
+
if (!T && P.length > 1) return L(P[0]);
|
|
322
322
|
} else {
|
|
323
|
-
var
|
|
324
|
-
|
|
323
|
+
var j = A.name;
|
|
324
|
+
Z[j] = A, T = j;
|
|
325
325
|
}
|
|
326
|
-
return !
|
|
327
|
-
}, v = function(
|
|
328
|
-
if (
|
|
326
|
+
return !x && T && (E = T), T || !x && E;
|
|
327
|
+
}, v = function(L, A) {
|
|
328
|
+
if (q(L)) return L.clone();
|
|
329
329
|
var w = typeof A == "object" ? A : {};
|
|
330
|
-
return w.date =
|
|
331
|
-
},
|
|
332
|
-
|
|
333
|
-
return v(
|
|
330
|
+
return w.date = L, w.args = arguments, new le(w);
|
|
331
|
+
}, M = N;
|
|
332
|
+
M.l = h, M.i = q, M.w = function(L, A) {
|
|
333
|
+
return v(L, { locale: A.$L, utc: A.$u, x: A.$x, $offset: A.$offset });
|
|
334
334
|
};
|
|
335
335
|
var le = (function() {
|
|
336
|
-
function
|
|
337
|
-
this.$L = h(w.locale, null, !0), this.parse(w), this.$x = this.$x || w.x || {}, this[
|
|
336
|
+
function L(w) {
|
|
337
|
+
this.$L = h(w.locale, null, !0), this.parse(w), this.$x = this.$x || w.x || {}, this[R] = !0;
|
|
338
338
|
}
|
|
339
|
-
var A =
|
|
339
|
+
var A = L.prototype;
|
|
340
340
|
return A.parse = function(w) {
|
|
341
|
-
this.$d = (function(
|
|
342
|
-
var T =
|
|
341
|
+
this.$d = (function(x) {
|
|
342
|
+
var T = x.date, U = x.utc;
|
|
343
343
|
if (T === null) return /* @__PURE__ */ new Date(NaN);
|
|
344
|
-
if (
|
|
344
|
+
if (M.u(T)) return /* @__PURE__ */ new Date();
|
|
345
345
|
if (T instanceof Date) return new Date(T);
|
|
346
346
|
if (typeof T == "string" && !/Z$/i.test(T)) {
|
|
347
|
-
var P = T.match(
|
|
347
|
+
var P = T.match(C);
|
|
348
348
|
if (P) {
|
|
349
|
-
var
|
|
350
|
-
return
|
|
349
|
+
var j = P[2] - 1 || 0, K = (P[7] || "0").substring(0, 3);
|
|
350
|
+
return U ? new Date(Date.UTC(P[1], j, P[3] || 1, P[4] || 0, P[5] || 0, P[6] || 0, K)) : new Date(P[1], j, P[3] || 1, P[4] || 0, P[5] || 0, P[6] || 0, K);
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
353
|
return new Date(T);
|
|
@@ -356,137 +356,137 @@ function ci() {
|
|
|
356
356
|
var w = this.$d;
|
|
357
357
|
this.$y = w.getFullYear(), this.$M = w.getMonth(), this.$D = w.getDate(), this.$W = w.getDay(), this.$H = w.getHours(), this.$m = w.getMinutes(), this.$s = w.getSeconds(), this.$ms = w.getMilliseconds();
|
|
358
358
|
}, A.$utils = function() {
|
|
359
|
-
return
|
|
359
|
+
return M;
|
|
360
360
|
}, A.isValid = function() {
|
|
361
|
-
return this.$d.toString() !==
|
|
362
|
-
}, A.isSame = function(w,
|
|
361
|
+
return this.$d.toString() !== D;
|
|
362
|
+
}, A.isSame = function(w, x) {
|
|
363
363
|
var T = v(w);
|
|
364
|
-
return this.startOf(
|
|
365
|
-
}, A.isAfter = function(w,
|
|
366
|
-
return v(w) < this.startOf(
|
|
367
|
-
}, A.isBefore = function(w,
|
|
368
|
-
return this.endOf(
|
|
369
|
-
}, A.$g = function(w,
|
|
370
|
-
return
|
|
364
|
+
return this.startOf(x) <= T && T <= this.endOf(x);
|
|
365
|
+
}, A.isAfter = function(w, x) {
|
|
366
|
+
return v(w) < this.startOf(x);
|
|
367
|
+
}, A.isBefore = function(w, x) {
|
|
368
|
+
return this.endOf(x) < v(w);
|
|
369
|
+
}, A.$g = function(w, x, T) {
|
|
370
|
+
return M.u(w) ? this[x] : this.set(T, w);
|
|
371
371
|
}, A.unix = function() {
|
|
372
372
|
return Math.floor(this.valueOf() / 1e3);
|
|
373
373
|
}, A.valueOf = function() {
|
|
374
374
|
return this.$d.getTime();
|
|
375
|
-
}, A.startOf = function(w,
|
|
376
|
-
var T = this,
|
|
377
|
-
var
|
|
378
|
-
return
|
|
379
|
-
},
|
|
380
|
-
return
|
|
381
|
-
},
|
|
375
|
+
}, A.startOf = function(w, x) {
|
|
376
|
+
var T = this, U = !!M.u(x) || x, P = M.p(w), j = function(Te, ie) {
|
|
377
|
+
var oe = M.w(T.$u ? Date.UTC(T.$y, ie, Te) : new Date(T.$y, ie, Te), T);
|
|
378
|
+
return U ? oe : oe.endOf(u);
|
|
379
|
+
}, K = function(Te, ie) {
|
|
380
|
+
return M.w(T.toDate()[Te].apply(T.toDate("s"), (U ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(ie)), T);
|
|
381
|
+
}, te = this.$W, se = this.$M, X = this.$D, Ae = "set" + (this.$u ? "UTC" : "");
|
|
382
382
|
switch (P) {
|
|
383
383
|
case p:
|
|
384
|
-
return
|
|
384
|
+
return U ? j(1, 0) : j(31, 11);
|
|
385
385
|
case m:
|
|
386
|
-
return
|
|
386
|
+
return U ? j(1, se) : j(0, se + 1);
|
|
387
387
|
case d:
|
|
388
|
-
var
|
|
389
|
-
return
|
|
388
|
+
var ce = this.$locale().weekStart || 0, he = (te < ce ? te + 7 : te) - ce;
|
|
389
|
+
return j(U ? X - he : X + (6 - he), se);
|
|
390
390
|
case u:
|
|
391
391
|
case k:
|
|
392
|
-
return
|
|
392
|
+
return K(Ae + "Hours", 0);
|
|
393
393
|
case o:
|
|
394
|
-
return
|
|
394
|
+
return K(Ae + "Minutes", 1);
|
|
395
395
|
case l:
|
|
396
|
-
return
|
|
396
|
+
return K(Ae + "Seconds", 2);
|
|
397
397
|
case i:
|
|
398
|
-
return
|
|
398
|
+
return K(Ae + "Milliseconds", 3);
|
|
399
399
|
default:
|
|
400
400
|
return this.clone();
|
|
401
401
|
}
|
|
402
402
|
}, A.endOf = function(w) {
|
|
403
403
|
return this.startOf(w, !1);
|
|
404
|
-
}, A.$set = function(w,
|
|
405
|
-
var T,
|
|
406
|
-
if (
|
|
407
|
-
var
|
|
408
|
-
|
|
409
|
-
} else
|
|
404
|
+
}, A.$set = function(w, x) {
|
|
405
|
+
var T, U = M.p(w), P = "set" + (this.$u ? "UTC" : ""), j = (T = {}, T[u] = P + "Date", T[k] = P + "Date", T[m] = P + "Month", T[p] = P + "FullYear", T[o] = P + "Hours", T[l] = P + "Minutes", T[i] = P + "Seconds", T[a] = P + "Milliseconds", T)[U], K = U === u ? this.$D + (x - this.$W) : x;
|
|
406
|
+
if (U === m || U === p) {
|
|
407
|
+
var te = this.clone().set(k, 1);
|
|
408
|
+
te.$d[j](K), te.init(), this.$d = te.set(k, Math.min(this.$D, te.daysInMonth())).$d;
|
|
409
|
+
} else j && this.$d[j](K);
|
|
410
410
|
return this.init(), this;
|
|
411
|
-
}, A.set = function(w,
|
|
412
|
-
return this.clone().$set(w,
|
|
411
|
+
}, A.set = function(w, x) {
|
|
412
|
+
return this.clone().$set(w, x);
|
|
413
413
|
}, A.get = function(w) {
|
|
414
|
-
return this[
|
|
415
|
-
}, A.add = function(w,
|
|
416
|
-
var T,
|
|
414
|
+
return this[M.p(w)]();
|
|
415
|
+
}, A.add = function(w, x) {
|
|
416
|
+
var T, U = this;
|
|
417
417
|
w = Number(w);
|
|
418
|
-
var P =
|
|
419
|
-
var X = v(
|
|
420
|
-
return
|
|
418
|
+
var P = M.p(x), j = function(se) {
|
|
419
|
+
var X = v(U);
|
|
420
|
+
return M.w(X.date(X.date() + Math.round(se * w)), U);
|
|
421
421
|
};
|
|
422
422
|
if (P === m) return this.set(m, this.$M + w);
|
|
423
423
|
if (P === p) return this.set(p, this.$y + w);
|
|
424
|
-
if (P === u) return
|
|
425
|
-
if (P === d) return
|
|
426
|
-
var
|
|
427
|
-
return
|
|
428
|
-
}, A.subtract = function(w,
|
|
429
|
-
return this.add(-1 * w,
|
|
424
|
+
if (P === u) return j(1);
|
|
425
|
+
if (P === d) return j(7);
|
|
426
|
+
var K = (T = {}, T[l] = n, T[o] = r, T[i] = s, T)[P] || 1, te = this.$d.getTime() + w * K;
|
|
427
|
+
return M.w(te, this);
|
|
428
|
+
}, A.subtract = function(w, x) {
|
|
429
|
+
return this.add(-1 * w, x);
|
|
430
430
|
}, A.format = function(w) {
|
|
431
|
-
var
|
|
432
|
-
if (!this.isValid()) return T.invalidDate ||
|
|
433
|
-
var
|
|
434
|
-
return ie && (ie[
|
|
431
|
+
var x = this, T = this.$locale();
|
|
432
|
+
if (!this.isValid()) return T.invalidDate || D;
|
|
433
|
+
var U = w || "YYYY-MM-DDTHH:mm:ssZ", P = M.z(this), j = this.$H, K = this.$m, te = this.$M, se = T.weekdays, X = T.months, Ae = T.meridiem, ce = function(ie, oe, ke, Ze) {
|
|
434
|
+
return ie && (ie[oe] || ie(x, U)) || ke[oe].slice(0, Ze);
|
|
435
435
|
}, he = function(ie) {
|
|
436
|
-
return
|
|
437
|
-
},
|
|
436
|
+
return M.s(j % 12 || 12, ie, "0");
|
|
437
|
+
}, Te = Ae || function(ie, oe, ke) {
|
|
438
438
|
var Ze = ie < 12 ? "AM" : "PM";
|
|
439
439
|
return ke ? Ze.toLowerCase() : Ze;
|
|
440
440
|
};
|
|
441
|
-
return
|
|
442
|
-
return
|
|
441
|
+
return U.replace(Y, (function(ie, oe) {
|
|
442
|
+
return oe || (function(ke) {
|
|
443
443
|
switch (ke) {
|
|
444
444
|
case "YY":
|
|
445
|
-
return String(
|
|
445
|
+
return String(x.$y).slice(-2);
|
|
446
446
|
case "YYYY":
|
|
447
|
-
return
|
|
447
|
+
return M.s(x.$y, 4, "0");
|
|
448
448
|
case "M":
|
|
449
|
-
return
|
|
449
|
+
return te + 1;
|
|
450
450
|
case "MM":
|
|
451
|
-
return
|
|
451
|
+
return M.s(te + 1, 2, "0");
|
|
452
452
|
case "MMM":
|
|
453
|
-
return
|
|
453
|
+
return ce(T.monthsShort, te, X, 3);
|
|
454
454
|
case "MMMM":
|
|
455
|
-
return
|
|
455
|
+
return ce(X, te);
|
|
456
456
|
case "D":
|
|
457
|
-
return
|
|
457
|
+
return x.$D;
|
|
458
458
|
case "DD":
|
|
459
|
-
return
|
|
459
|
+
return M.s(x.$D, 2, "0");
|
|
460
460
|
case "d":
|
|
461
|
-
return String(
|
|
461
|
+
return String(x.$W);
|
|
462
462
|
case "dd":
|
|
463
|
-
return
|
|
463
|
+
return ce(T.weekdaysMin, x.$W, se, 2);
|
|
464
464
|
case "ddd":
|
|
465
|
-
return
|
|
465
|
+
return ce(T.weekdaysShort, x.$W, se, 3);
|
|
466
466
|
case "dddd":
|
|
467
|
-
return
|
|
467
|
+
return se[x.$W];
|
|
468
468
|
case "H":
|
|
469
|
-
return String(
|
|
469
|
+
return String(j);
|
|
470
470
|
case "HH":
|
|
471
|
-
return
|
|
471
|
+
return M.s(j, 2, "0");
|
|
472
472
|
case "h":
|
|
473
473
|
return he(1);
|
|
474
474
|
case "hh":
|
|
475
475
|
return he(2);
|
|
476
476
|
case "a":
|
|
477
|
-
return
|
|
477
|
+
return Te(j, K, !0);
|
|
478
478
|
case "A":
|
|
479
|
-
return
|
|
479
|
+
return Te(j, K, !1);
|
|
480
480
|
case "m":
|
|
481
|
-
return String(
|
|
481
|
+
return String(K);
|
|
482
482
|
case "mm":
|
|
483
|
-
return
|
|
483
|
+
return M.s(K, 2, "0");
|
|
484
484
|
case "s":
|
|
485
|
-
return String(
|
|
485
|
+
return String(x.$s);
|
|
486
486
|
case "ss":
|
|
487
|
-
return
|
|
487
|
+
return M.s(x.$s, 2, "0");
|
|
488
488
|
case "SSS":
|
|
489
|
-
return
|
|
489
|
+
return M.s(x.$ms, 3, "0");
|
|
490
490
|
case "Z":
|
|
491
491
|
return P;
|
|
492
492
|
}
|
|
@@ -495,49 +495,49 @@ function ci() {
|
|
|
495
495
|
}));
|
|
496
496
|
}, A.utcOffset = function() {
|
|
497
497
|
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
498
|
-
}, A.diff = function(w,
|
|
499
|
-
var
|
|
500
|
-
return
|
|
498
|
+
}, A.diff = function(w, x, T) {
|
|
499
|
+
var U, P = this, j = M.p(x), K = v(w), te = (K.utcOffset() - this.utcOffset()) * n, se = this - K, X = function() {
|
|
500
|
+
return M.m(P, K);
|
|
501
501
|
};
|
|
502
|
-
switch (
|
|
502
|
+
switch (j) {
|
|
503
503
|
case p:
|
|
504
|
-
|
|
504
|
+
U = X() / 12;
|
|
505
505
|
break;
|
|
506
506
|
case m:
|
|
507
|
-
|
|
507
|
+
U = X();
|
|
508
508
|
break;
|
|
509
509
|
case S:
|
|
510
|
-
|
|
510
|
+
U = X() / 3;
|
|
511
511
|
break;
|
|
512
512
|
case d:
|
|
513
|
-
|
|
513
|
+
U = (se - te) / 6048e5;
|
|
514
514
|
break;
|
|
515
515
|
case u:
|
|
516
|
-
|
|
516
|
+
U = (se - te) / 864e5;
|
|
517
517
|
break;
|
|
518
518
|
case o:
|
|
519
|
-
|
|
519
|
+
U = se / r;
|
|
520
520
|
break;
|
|
521
521
|
case l:
|
|
522
|
-
|
|
522
|
+
U = se / n;
|
|
523
523
|
break;
|
|
524
524
|
case i:
|
|
525
|
-
|
|
525
|
+
U = se / s;
|
|
526
526
|
break;
|
|
527
527
|
default:
|
|
528
|
-
|
|
528
|
+
U = se;
|
|
529
529
|
}
|
|
530
|
-
return T ?
|
|
530
|
+
return T ? U : M.a(U);
|
|
531
531
|
}, A.daysInMonth = function() {
|
|
532
532
|
return this.endOf(m).$D;
|
|
533
533
|
}, A.$locale = function() {
|
|
534
|
-
return
|
|
535
|
-
}, A.locale = function(w,
|
|
534
|
+
return Z[this.$L];
|
|
535
|
+
}, A.locale = function(w, x) {
|
|
536
536
|
if (!w) return this.$L;
|
|
537
|
-
var T = this.clone(),
|
|
538
|
-
return
|
|
537
|
+
var T = this.clone(), U = h(w, x, !0);
|
|
538
|
+
return U && (T.$L = U), T;
|
|
539
539
|
}, A.clone = function() {
|
|
540
|
-
return
|
|
540
|
+
return M.w(this.$d, this);
|
|
541
541
|
}, A.toDate = function() {
|
|
542
542
|
return new Date(this.valueOf());
|
|
543
543
|
}, A.toJSON = function() {
|
|
@@ -546,17 +546,17 @@ function ci() {
|
|
|
546
546
|
return this.$d.toISOString();
|
|
547
547
|
}, A.toString = function() {
|
|
548
548
|
return this.$d.toUTCString();
|
|
549
|
-
},
|
|
549
|
+
}, L;
|
|
550
550
|
})(), ae = le.prototype;
|
|
551
|
-
return v.prototype = ae, [["$ms", a], ["$s", i], ["$m", l], ["$H", o], ["$W", u], ["$M", m], ["$y", p], ["$D", k]].forEach((function(
|
|
552
|
-
ae[
|
|
553
|
-
return this.$g(A,
|
|
551
|
+
return v.prototype = ae, [["$ms", a], ["$s", i], ["$m", l], ["$H", o], ["$W", u], ["$M", m], ["$y", p], ["$D", k]].forEach((function(L) {
|
|
552
|
+
ae[L[1]] = function(A) {
|
|
553
|
+
return this.$g(A, L[0], L[1]);
|
|
554
554
|
};
|
|
555
|
-
})), v.extend = function(
|
|
556
|
-
return
|
|
557
|
-
}, v.locale = h, v.isDayjs =
|
|
558
|
-
return v(1e3 *
|
|
559
|
-
}, v.en =
|
|
555
|
+
})), v.extend = function(L, A) {
|
|
556
|
+
return L.$i || (L(A, le, v), L.$i = !0), v;
|
|
557
|
+
}, v.locale = h, v.isDayjs = q, v.unix = function(L) {
|
|
558
|
+
return v(1e3 * L);
|
|
559
|
+
}, v.en = Z[E], v.Ls = Z, v.p = {}, v;
|
|
560
560
|
}));
|
|
561
561
|
})(ms)), ms.exports;
|
|
562
562
|
}
|
|
@@ -576,7 +576,7 @@ function En(t) {
|
|
|
576
576
|
const { hours: e, minutes: s, seconds: n } = hr(t);
|
|
577
577
|
return di().hour(e).minute(s).second(n).millisecond(0);
|
|
578
578
|
}
|
|
579
|
-
function
|
|
579
|
+
function Ce(t, e) {
|
|
580
580
|
const s = (t || "").replace(/\/+$/, ""), n = e.startsWith("/") ? e : `/${e}`;
|
|
581
581
|
return `${s}${n}`;
|
|
582
582
|
}
|
|
@@ -595,7 +595,7 @@ function ns(t, e) {
|
|
|
595
595
|
r != null && String(r).length > 0 && s.searchParams.set(n, String(r));
|
|
596
596
|
}), s.toString();
|
|
597
597
|
}
|
|
598
|
-
async function
|
|
598
|
+
async function Re(t, e) {
|
|
599
599
|
const s = {
|
|
600
600
|
...e.headers,
|
|
601
601
|
...mi()
|
|
@@ -617,8 +617,8 @@ async function Ue(t, e) {
|
|
|
617
617
|
}
|
|
618
618
|
return a;
|
|
619
619
|
}
|
|
620
|
-
const
|
|
621
|
-
function
|
|
620
|
+
const me = (...t) => t.find((e) => e != null);
|
|
621
|
+
function Bt(t, e, s = {}) {
|
|
622
622
|
const n = {};
|
|
623
623
|
for (const r of e) {
|
|
624
624
|
const a = s[r] ?? r.charAt(0).toUpperCase() + r.slice(1);
|
|
@@ -627,7 +627,7 @@ function zt(t, e, s = {}) {
|
|
|
627
627
|
return n;
|
|
628
628
|
}
|
|
629
629
|
function fi(t) {
|
|
630
|
-
return Array.isArray(t) ? t.map((e) =>
|
|
630
|
+
return Array.isArray(t) ? t.map((e) => Bt(e, [
|
|
631
631
|
"alertLogId",
|
|
632
632
|
"alertId",
|
|
633
633
|
"status",
|
|
@@ -642,31 +642,31 @@ function fi(t) {
|
|
|
642
642
|
function hi(t) {
|
|
643
643
|
return {
|
|
644
644
|
// important: do not fall back to `id` here; only AlertId/alertId are considered the Alert ID
|
|
645
|
-
id: String(
|
|
646
|
-
alertNumber:
|
|
647
|
-
priority:
|
|
648
|
-
timestamp:
|
|
649
|
-
statusType:
|
|
650
|
-
description:
|
|
651
|
-
eventName:
|
|
652
|
-
ruleName:
|
|
653
|
-
spaceId:
|
|
654
|
-
spaceName:
|
|
655
|
-
anomalyId:
|
|
656
|
-
severityId:
|
|
657
|
-
assignTeam:
|
|
658
|
-
cameraName:
|
|
659
|
-
type:
|
|
660
|
-
mediaDetails:
|
|
661
|
-
additionalMedia:
|
|
662
|
-
timeElapsed:
|
|
663
|
-
timeRemaining:
|
|
664
|
-
anomalyName:
|
|
665
|
-
alertDetails:
|
|
666
|
-
statusHistory: fi(
|
|
667
|
-
isEmailSent:
|
|
668
|
-
isSMSSent:
|
|
669
|
-
timeZoneUniqueId:
|
|
645
|
+
id: String(me(t?.AlertId, t?.alertId) ?? ""),
|
|
646
|
+
alertNumber: me(t?.AlertNumber, t?.alertNumber),
|
|
647
|
+
priority: me(t?.Priority, t?.priority, "Low"),
|
|
648
|
+
timestamp: me(t?.UpdatedUtc, t?.timestamp, ""),
|
|
649
|
+
statusType: me(t?.Status, t?.statusType, ""),
|
|
650
|
+
description: me(t?.Description, t?.description, ""),
|
|
651
|
+
eventName: me(t?.EventName, t?.eventName),
|
|
652
|
+
ruleName: me(t?.RuleName, t?.ruleName),
|
|
653
|
+
spaceId: me(t?.SpaceId, t?.spaceId),
|
|
654
|
+
spaceName: me(t?.SpaceName, t?.spaceName),
|
|
655
|
+
anomalyId: me(t?.AnomalyId, t?.anomalyId),
|
|
656
|
+
severityId: me(t?.SeverityId, t?.severityId),
|
|
657
|
+
assignTeam: me(t?.AssignTeam, t?.assignTeam),
|
|
658
|
+
cameraName: me(t?.CameraName, t?.cameraName),
|
|
659
|
+
type: me(t?.Type, t?.type),
|
|
660
|
+
mediaDetails: me(t?.MediaDetails, t?.mediaDetails, t?.MediaUrls, t?.mediaUrls),
|
|
661
|
+
additionalMedia: me(t?.AdditionalMedia, t?.additionalMedia),
|
|
662
|
+
timeElapsed: me(t?.TimeElapsed, t?.timeElapsed),
|
|
663
|
+
timeRemaining: me(t?.TimeRemaining, t?.timeRemaining),
|
|
664
|
+
anomalyName: me(t?.AnomalyName, t?.anomalyName),
|
|
665
|
+
alertDetails: me(t?.AlertDetails, t?.alertDetails),
|
|
666
|
+
statusHistory: fi(me(t?.StatusHistory, t?.statusHistory)),
|
|
667
|
+
isEmailSent: me(t?.IsEmailSent, t?.isEmailSent),
|
|
668
|
+
isSMSSent: me(t?.IsSMSSent, t?.isSMSSent),
|
|
669
|
+
timeZoneUniqueId: me(t?.TimeZoneUniqueId, t?.timeZoneUniqueId)
|
|
670
670
|
};
|
|
671
671
|
}
|
|
672
672
|
function yi(t) {
|
|
@@ -676,7 +676,7 @@ function yi(t) {
|
|
|
676
676
|
};
|
|
677
677
|
return {
|
|
678
678
|
async listAlerts(s) {
|
|
679
|
-
const n =
|
|
679
|
+
const n = Ce(t.baseUrl, "/api/detectionpolicy/alerts"), r = ns(n, {
|
|
680
680
|
customerId: "99e5c8b5-b9d4-4d35-8885-7f121c532664",
|
|
681
681
|
pageSize: s?.pageSize ?? 10,
|
|
682
682
|
page: s?.pageNumber ?? 1,
|
|
@@ -686,58 +686,58 @@ function yi(t) {
|
|
|
686
686
|
...s?.thirdPartyIds?.length && { ThirdPartyIds: s.thirdPartyIds.join(",") },
|
|
687
687
|
...s?.searchText && { searchText: s.searchText },
|
|
688
688
|
isArchived: s?.isArchived ?? !1
|
|
689
|
-
}), a = await
|
|
689
|
+
}), a = await Re(r, {
|
|
690
690
|
method: "GET",
|
|
691
691
|
headers: e
|
|
692
692
|
});
|
|
693
693
|
return { items: Array.isArray(a?.Items) ? a.Items.map(hi) : [], total: a?.Total };
|
|
694
694
|
},
|
|
695
695
|
async getAlertStatusList() {
|
|
696
|
-
const s =
|
|
696
|
+
const s = Ce(t.baseUrl, "/api/detectionpolicy/alerts/StatusList"), n = await Re(s, {
|
|
697
697
|
method: "GET",
|
|
698
698
|
headers: e
|
|
699
699
|
});
|
|
700
|
-
return (Array.isArray(n) ? n : []).map((a) =>
|
|
700
|
+
return (Array.isArray(n) ? n : []).map((a) => Bt(a, [
|
|
701
701
|
"alertStatusId",
|
|
702
702
|
"value",
|
|
703
703
|
"statusName"
|
|
704
704
|
]));
|
|
705
705
|
},
|
|
706
706
|
async getAlertsReport(s) {
|
|
707
|
-
const n =
|
|
707
|
+
const n = Ce(t.baseUrl, "/api/detectionpolicy/alerts/GetAlertsReport"), r = ns(n, s), a = await Re(r, {
|
|
708
708
|
method: "GET",
|
|
709
709
|
headers: e
|
|
710
710
|
});
|
|
711
711
|
return Array.isArray(a) ? a : [];
|
|
712
712
|
},
|
|
713
713
|
async updateAlertStatus(s) {
|
|
714
|
-
const n =
|
|
714
|
+
const n = Ce(t.baseUrl, "/api/detectionpolicy/alerts/Log"), r = {
|
|
715
715
|
AlertId: s.alertId ?? s.alertUniqueId ?? s.AlertId,
|
|
716
716
|
Status: s.status ?? s.Status ?? "",
|
|
717
717
|
Notes: s.notes ?? s.Notes ?? ""
|
|
718
718
|
};
|
|
719
|
-
return
|
|
719
|
+
return Re(n, {
|
|
720
720
|
method: "POST",
|
|
721
721
|
headers: e,
|
|
722
722
|
body: JSON.stringify(r)
|
|
723
723
|
});
|
|
724
724
|
},
|
|
725
725
|
async getAdminSettings() {
|
|
726
|
-
const s =
|
|
726
|
+
const s = Ce(t.baseUrl, "/api/detectionpolicy/alerts/GetAdminSettings"), n = await Re(s, {
|
|
727
727
|
method: "GET",
|
|
728
728
|
headers: e
|
|
729
729
|
});
|
|
730
730
|
if (n && typeof n == "object") {
|
|
731
731
|
const r = n.data ?? n.Data ?? n;
|
|
732
732
|
if (r && typeof r == "object")
|
|
733
|
-
return
|
|
733
|
+
return Bt(r, ["userId", "isAdminSetting", "sortBy"], {
|
|
734
734
|
sortBy: "SortOption"
|
|
735
735
|
});
|
|
736
736
|
}
|
|
737
737
|
return null;
|
|
738
738
|
},
|
|
739
739
|
async setAdminSettings(s) {
|
|
740
|
-
const n =
|
|
740
|
+
const n = Ce(t.baseUrl, "/api/detectionpolicy/alerts/SetAdminSettings"), r = {
|
|
741
741
|
Settings: {
|
|
742
742
|
UserId: 0,
|
|
743
743
|
IsAdminSetting: !0,
|
|
@@ -745,14 +745,14 @@ function yi(t) {
|
|
|
745
745
|
GroupBy: s?.groupBy ?? null
|
|
746
746
|
}
|
|
747
747
|
};
|
|
748
|
-
return
|
|
748
|
+
return Re(n, {
|
|
749
749
|
method: "POST",
|
|
750
750
|
headers: e,
|
|
751
751
|
body: JSON.stringify(r)
|
|
752
752
|
});
|
|
753
753
|
},
|
|
754
754
|
async getPreferenceSettings() {
|
|
755
|
-
const s =
|
|
755
|
+
const s = Ce(t.baseUrl, "/api/detectionpolicy/alerts/GetPreferenceSettings"), n = await Re(s, {
|
|
756
756
|
method: "GET",
|
|
757
757
|
headers: e
|
|
758
758
|
});
|
|
@@ -763,7 +763,7 @@ function yi(t) {
|
|
|
763
763
|
return null;
|
|
764
764
|
},
|
|
765
765
|
async setPreferenceSettings(s) {
|
|
766
|
-
const n =
|
|
766
|
+
const n = Ce(t.baseUrl, "/api/detectionpolicy/alerts/SetPreferenceSettings"), r = (u) => {
|
|
767
767
|
const { hours: d, minutes: m, seconds: S } = hr(u);
|
|
768
768
|
return (d * 3600 + m * 60 + S) * 1e7;
|
|
769
769
|
}, a = {
|
|
@@ -777,7 +777,7 @@ function yi(t) {
|
|
|
777
777
|
Email: !!s?.email,
|
|
778
778
|
SortBy: s?.sortBy ?? ""
|
|
779
779
|
}
|
|
780
|
-
}, i = await
|
|
780
|
+
}, i = await Re(n, {
|
|
781
781
|
method: "POST",
|
|
782
782
|
headers: e,
|
|
783
783
|
body: JSON.stringify(a)
|
|
@@ -790,19 +790,19 @@ function yi(t) {
|
|
|
790
790
|
};
|
|
791
791
|
},
|
|
792
792
|
async sendSMSorEmailNotifications(s, n, r) {
|
|
793
|
-
const a =
|
|
794
|
-
return
|
|
793
|
+
const a = Ce(t.baseUrl, "/api/detectionpolicy/alerts/SendSMSorEmailNotifications"), i = ns(a, { alertId: s, isEmail: n, isSMS: r });
|
|
794
|
+
return Re(i, {
|
|
795
795
|
method: "POST",
|
|
796
796
|
headers: e
|
|
797
797
|
});
|
|
798
798
|
},
|
|
799
799
|
async getAlertNotifications(s) {
|
|
800
|
-
const n =
|
|
800
|
+
const n = Ce(t.baseUrl, "/api/detectionpolicy/alerts/GetNotifications"), r = ns(n, { alertId: s }), a = await Re(r, {
|
|
801
801
|
method: "GET",
|
|
802
802
|
headers: e
|
|
803
803
|
});
|
|
804
804
|
let i = [];
|
|
805
|
-
return Array.isArray(a) ? i = a : Array.isArray(a?.data) && (i = a.data), i.map((l) =>
|
|
805
|
+
return Array.isArray(a) ? i = a : Array.isArray(a?.data) && (i = a.data), i.map((l) => Bt(l, [
|
|
806
806
|
"alertNotificationSentId",
|
|
807
807
|
"alertId",
|
|
808
808
|
"notificationType",
|
|
@@ -816,11 +816,11 @@ function yi(t) {
|
|
|
816
816
|
]));
|
|
817
817
|
},
|
|
818
818
|
async getTimeZoneMasters() {
|
|
819
|
-
const s =
|
|
819
|
+
const s = Ce(t.baseUrl, "/api/TimeZoneMaster"), n = await Re(s, {
|
|
820
820
|
method: "GET",
|
|
821
821
|
headers: e
|
|
822
822
|
});
|
|
823
|
-
return (Array.isArray(n?.Data) ? n.Data : []).map((a) =>
|
|
823
|
+
return (Array.isArray(n?.Data) ? n.Data : []).map((a) => Bt(a, [
|
|
824
824
|
"timeZoneUniqueId",
|
|
825
825
|
"ianaTimeZoneId",
|
|
826
826
|
"timeZoneName",
|
|
@@ -828,7 +828,7 @@ function yi(t) {
|
|
|
828
828
|
]));
|
|
829
829
|
},
|
|
830
830
|
async getAllSpaces() {
|
|
831
|
-
const s = t.spacesBaseUrl || t.baseUrl, n =
|
|
831
|
+
const s = t.spacesBaseUrl || t.baseUrl, n = Ce(s, "/api/AllSpaces"), r = await Re(n, {
|
|
832
832
|
method: "GET",
|
|
833
833
|
headers: e
|
|
834
834
|
});
|
|
@@ -838,12 +838,12 @@ function yi(t) {
|
|
|
838
838
|
}));
|
|
839
839
|
},
|
|
840
840
|
async getMyAppPreferences() {
|
|
841
|
-
const s =
|
|
841
|
+
const s = Ce(t.baseUrl, "/MyProfile"), n = await Re(s, {
|
|
842
842
|
method: "GET",
|
|
843
843
|
headers: e
|
|
844
844
|
}), r = n?.data?.userGuid ?? n?.Data?.userGuid ?? n?.userGuid;
|
|
845
845
|
if (!r) return null;
|
|
846
|
-
const a =
|
|
846
|
+
const a = Ce(t.baseUrl, `/api/GetMyAppPreferences/${r}`), i = await Re(a, {
|
|
847
847
|
method: "GET",
|
|
848
848
|
headers: e
|
|
849
849
|
});
|
|
@@ -926,30 +926,30 @@ function gi(t) {
|
|
|
926
926
|
if (h.status !== "fulfilled") return [];
|
|
927
927
|
const v = h.value;
|
|
928
928
|
return Array.isArray(v) ? v : Array.isArray(v?.Data) ? v.Data : Array.isArray(v?.data) ? v.data : [];
|
|
929
|
-
}, p = S(i), k = S(l),
|
|
929
|
+
}, p = S(i), k = S(l), D = S(o), C = S(u), Y = S(d), $ = m.status === "fulfilled" ? m.value : null;
|
|
930
930
|
let W = [];
|
|
931
931
|
Array.isArray($) ? W = $ : Array.isArray($?.Data) ? W = $.Data : Array.isArray($?.data) && (W = $.data);
|
|
932
932
|
const N = p.map((h) => ({
|
|
933
933
|
actionTypeId: Number(h?.ActionTypeId),
|
|
934
934
|
name: h?.DisplayName ?? h?.Name ?? ""
|
|
935
|
-
})),
|
|
935
|
+
})), E = k.map((h) => ({
|
|
936
936
|
recordId: h?.AnomalyId,
|
|
937
937
|
anomalyName: h?.DisplayName ?? h?.Name ?? ""
|
|
938
|
-
})),
|
|
938
|
+
})), Z = D.map((h) => ({
|
|
939
939
|
thirdPartyId: Number(h?.ThirdPartyId),
|
|
940
940
|
thirdPartyName: h?.ThirdPartyName ?? h?.Name ?? ""
|
|
941
|
-
})),
|
|
941
|
+
})), R = W.map((h) => ({
|
|
942
942
|
userRoleId: h.UserRoleId ?? h.userRoleId ?? h.Id ?? h.id ?? 0,
|
|
943
943
|
userRoleName: h.UserRoleName ?? h.userRoleName ?? h.Name ?? h.name ?? ""
|
|
944
|
-
})),
|
|
944
|
+
})), q = {
|
|
945
945
|
actionTypes: N,
|
|
946
|
-
anomalies:
|
|
947
|
-
thirdParties:
|
|
946
|
+
anomalies: E,
|
|
947
|
+
thirdParties: Z
|
|
948
948
|
};
|
|
949
|
-
return
|
|
949
|
+
return C.length && (q.severities = C.map((h) => ({
|
|
950
950
|
severityId: h?.SeverityId ?? h?.severityId,
|
|
951
951
|
severityName: h?.DisplayName ?? h?.SeverityName ?? h?.Name ?? h?.name ?? ""
|
|
952
|
-
}))),
|
|
952
|
+
}))), Y.length && (q.scheduleTypes = Y), R.length && (q.userRoles = R), q;
|
|
953
953
|
},
|
|
954
954
|
async updateRule(n, r) {
|
|
955
955
|
const a = `${s}/${n}`, { escalationSettings: i, Anomaly: l, Severity: o, ...u } = r ?? {};
|
|
@@ -1027,7 +1027,7 @@ function vi(t) {
|
|
|
1027
1027
|
});
|
|
1028
1028
|
},
|
|
1029
1029
|
async getLookups() {
|
|
1030
|
-
const n = (
|
|
1030
|
+
const n = (R) => new URL(R, t.baseUrl).toString(), r = t.userManagementBaseUrl || t.baseUrl, a = [
|
|
1031
1031
|
ut(n("/api/ActionTypeMaster/GetAll"), { method: "GET", headers: e }),
|
|
1032
1032
|
ut(n("/api/anomaly/anomaly-list"), {
|
|
1033
1033
|
method: "POST",
|
|
@@ -1045,34 +1045,34 @@ function vi(t) {
|
|
|
1045
1045
|
o,
|
|
1046
1046
|
u,
|
|
1047
1047
|
d
|
|
1048
|
-
] = await Promise.allSettled(a), m = (
|
|
1049
|
-
if (
|
|
1050
|
-
const
|
|
1051
|
-
return Array.isArray(
|
|
1052
|
-
}, S = m(i), p = m(l), k = m(o),
|
|
1053
|
-
actionTypeId:
|
|
1054
|
-
name:
|
|
1055
|
-
})), $ = p.map((
|
|
1056
|
-
recordId:
|
|
1057
|
-
anomalyName:
|
|
1058
|
-
})), W = k.map((
|
|
1059
|
-
thirdPartyId: Number(
|
|
1060
|
-
thirdPartyName:
|
|
1048
|
+
] = await Promise.allSettled(a), m = (R) => {
|
|
1049
|
+
if (R.status !== "fulfilled") return [];
|
|
1050
|
+
const q = R.value;
|
|
1051
|
+
return Array.isArray(q) ? q : Array.isArray(q?.data) ? q.data : [];
|
|
1052
|
+
}, S = m(i), p = m(l), k = m(o), D = m(u), C = d.status === "fulfilled" ? d.value : null, Y = S.map((R) => ({
|
|
1053
|
+
actionTypeId: R?.ActionTypeUniqueId,
|
|
1054
|
+
name: R?.Name ?? ""
|
|
1055
|
+
})), $ = p.map((R) => ({
|
|
1056
|
+
recordId: R?.AnomalyId,
|
|
1057
|
+
anomalyName: R?.DisplayName ?? R?.Name ?? ""
|
|
1058
|
+
})), W = k.map((R) => ({
|
|
1059
|
+
thirdPartyId: Number(R?.ThirdPartyId),
|
|
1060
|
+
thirdPartyName: R?.ThirdPartyName ?? R?.Name ?? ""
|
|
1061
1061
|
}));
|
|
1062
1062
|
let N = [];
|
|
1063
|
-
Array.isArray(
|
|
1064
|
-
const
|
|
1065
|
-
userRoleId:
|
|
1066
|
-
userRoleName:
|
|
1067
|
-
})),
|
|
1068
|
-
actionTypes:
|
|
1063
|
+
Array.isArray(C) ? N = C : Array.isArray(C?.Data) ? N = C.Data : Array.isArray(C?.data) && (N = C.data);
|
|
1064
|
+
const E = N.map((R) => ({
|
|
1065
|
+
userRoleId: R.userRoleId ?? 0,
|
|
1066
|
+
userRoleName: R.userRoleName ?? ""
|
|
1067
|
+
})), Z = {
|
|
1068
|
+
actionTypes: Y,
|
|
1069
1069
|
anomalies: $,
|
|
1070
1070
|
thirdParties: W
|
|
1071
1071
|
};
|
|
1072
|
-
return
|
|
1073
|
-
SeverityId:
|
|
1074
|
-
DisplayName:
|
|
1075
|
-
}))),
|
|
1072
|
+
return D.length && (Z.severities = D.map((R) => ({
|
|
1073
|
+
SeverityId: R.SeverityId,
|
|
1074
|
+
DisplayName: R.SeverityName ?? R.DisplayName ?? ""
|
|
1075
|
+
}))), E.length && (Z.userRoles = E), Z;
|
|
1076
1076
|
},
|
|
1077
1077
|
async updateRule(n, r) {
|
|
1078
1078
|
const a = new URL("/update-rule", t.baseUrl).toString(), { escalationSettings: i, ruleId: l, ruleName: o, ruleDesc: u, ...d } = r ?? {}, m = i ?? {}, S = (m.escalationSettingsActionTypeIds ?? []).filter((k) => k != null && !Number.isNaN(k)), p = {
|
|
@@ -1290,7 +1290,7 @@ function Ti({
|
|
|
1290
1290
|
spacesBaseUrl: r,
|
|
1291
1291
|
children: a
|
|
1292
1292
|
}) {
|
|
1293
|
-
const i =
|
|
1293
|
+
const i = Se(() => {
|
|
1294
1294
|
const o = e?.alertsBaseUrl?.trim() || In[t]?.alerts || "";
|
|
1295
1295
|
let u = e?.rulesBaseUrl?.trim() || In[t]?.rules || "";
|
|
1296
1296
|
t === "snl" && (u = o);
|
|
@@ -1304,7 +1304,7 @@ function Ti({
|
|
|
1304
1304
|
s,
|
|
1305
1305
|
n,
|
|
1306
1306
|
r
|
|
1307
|
-
]), l =
|
|
1307
|
+
]), l = Se(() => {
|
|
1308
1308
|
const o = { baseUrl: i.alertsBaseUrl, headers: i.headers }, u = { baseUrl: i.rulesBaseUrl, headers: i.headers }, d = {
|
|
1309
1309
|
schools: () => yi({ ...o, spacesBaseUrl: i.spacesBaseUrl }),
|
|
1310
1310
|
transit: () => Ai(o),
|
|
@@ -1322,7 +1322,7 @@ function Ti({
|
|
|
1322
1322
|
}, [i]);
|
|
1323
1323
|
return /* @__PURE__ */ c(yr.Provider, { value: l, children: a });
|
|
1324
1324
|
}
|
|
1325
|
-
function
|
|
1325
|
+
function Fe() {
|
|
1326
1326
|
const t = xa(yr);
|
|
1327
1327
|
if (!t) throw new Error("useApi must be used inside ApiProvider");
|
|
1328
1328
|
return t;
|
|
@@ -1368,7 +1368,7 @@ function as(t) {
|
|
|
1368
1368
|
}
|
|
1369
1369
|
function Ns({ value: t, onChange: e, options: s, className: n, dropdownWidth: r }) {
|
|
1370
1370
|
return /* @__PURE__ */ c(
|
|
1371
|
-
|
|
1371
|
+
Me,
|
|
1372
1372
|
{
|
|
1373
1373
|
className: n,
|
|
1374
1374
|
options: s,
|
|
@@ -1567,9 +1567,9 @@ const qi = [
|
|
|
1567
1567
|
["path", { d: "M4 14h6v6", key: "rmj7iw" }]
|
|
1568
1568
|
], Yi = bs("minimize-2", qi), wr = ({ isOpen: t, onClose: e, src: s, type: n = "image" }) => {
|
|
1569
1569
|
const [r, a] = g(!1), [i, l] = g(!1);
|
|
1570
|
-
return
|
|
1570
|
+
return fe(() => {
|
|
1571
1571
|
t && l(!1);
|
|
1572
|
-
}, [t, s]),
|
|
1572
|
+
}, [t, s]), fe(() => {
|
|
1573
1573
|
t && (!s || i) && e();
|
|
1574
1574
|
}, [t, s, i, e]), t ? /* @__PURE__ */ c(
|
|
1575
1575
|
"div",
|
|
@@ -1635,8 +1635,8 @@ function ji(t) {
|
|
|
1635
1635
|
return typeof n != "string" || !n.length ? null : { url: n, item: s };
|
|
1636
1636
|
}
|
|
1637
1637
|
function Ar({ record: t }) {
|
|
1638
|
-
const e =
|
|
1639
|
-
if (
|
|
1638
|
+
const e = Se(() => ji(t), [t]), [s, n] = g(!1), [r, a] = g(!1);
|
|
1639
|
+
if (fe(() => {
|
|
1640
1640
|
a(!1);
|
|
1641
1641
|
}, [e?.url]), !e)
|
|
1642
1642
|
return /* @__PURE__ */ c("span", { className: "text-gray-400 text-sm", children: "—" });
|
|
@@ -1692,100 +1692,100 @@ const Tr = [
|
|
|
1692
1692
|
];
|
|
1693
1693
|
function _i(t, e) {
|
|
1694
1694
|
const [s, n] = g(t);
|
|
1695
|
-
return
|
|
1695
|
+
return fe(() => {
|
|
1696
1696
|
const r = window.setTimeout(() => n(t), e);
|
|
1697
1697
|
return () => window.clearTimeout(r);
|
|
1698
1698
|
}, [t, e]), s;
|
|
1699
1699
|
}
|
|
1700
|
-
function Nr({ data: t, loading: e = !1, pageSize: s = 10, total: n, currentPage: r, columns: a, severityOptions: i, anomalyOptions: l, spaceOptions: o, renderActions: u, onAlertIdClick: d, onRefetch: m, onPageChange: S, onFilterChange: p, excludeCompleted: k = !0, resetKey:
|
|
1701
|
-
const [
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
}, [
|
|
1705
|
-
const [
|
|
1700
|
+
function Nr({ data: t, loading: e = !1, pageSize: s = 10, total: n, currentPage: r, columns: a, severityOptions: i, anomalyOptions: l, spaceOptions: o, renderActions: u, onAlertIdClick: d, onRefetch: m, onPageChange: S, onFilterChange: p, excludeCompleted: k = !0, resetKey: D, serverSideFilters: C = !1 }) {
|
|
1701
|
+
const [Y, $] = g("All"), [W, N] = g("All"), [E, Z] = g("All"), [R, q] = g("All"), [h, v] = g("");
|
|
1702
|
+
fe(() => {
|
|
1703
|
+
D !== void 0 && ($("All"), N("All"), Z("All"), q("All"), v(""));
|
|
1704
|
+
}, [D]);
|
|
1705
|
+
const [M, le] = g([{ label: "All", value: "All" }]), [ae, L] = g([]), [A, w] = g([]), [x, T] = g([]), [U, P] = g(/* @__PURE__ */ new Set()), { rules: j, alerts: K, config: te } = Fe(), se = te.tenant === "schools", X = te.tenant === "transit", Ae = _i(h, 600), ce = se && Ae.trim() ? 100 : s, he = {
|
|
1706
1706
|
6: { title: "Email", kind: "icon", icon: /* @__PURE__ */ c($a, {}) },
|
|
1707
1707
|
7: { title: "SMS", kind: "icon", icon: /* @__PURE__ */ c(Fa, {}) }
|
|
1708
|
-
},
|
|
1709
|
-
|
|
1710
|
-
if (!
|
|
1711
|
-
let
|
|
1708
|
+
}, Te = Se(() => ki(t), [t]), ie = Se(() => Ii(t, X), [t, X]);
|
|
1709
|
+
fe(() => {
|
|
1710
|
+
if (!K.getAllSpaces) return;
|
|
1711
|
+
let ne = !0;
|
|
1712
1712
|
return (async () => {
|
|
1713
1713
|
try {
|
|
1714
|
-
const
|
|
1715
|
-
if (
|
|
1716
|
-
const
|
|
1717
|
-
label: X ? String(
|
|
1718
|
-
value: String(X ?
|
|
1714
|
+
const H = await K.getAllSpaces();
|
|
1715
|
+
if (ne) {
|
|
1716
|
+
const we = H.map((ue) => ({
|
|
1717
|
+
label: X ? String(ue.spaceNumber ?? ue.spaceName ?? "") : ue.spaceName,
|
|
1718
|
+
value: String(X ? ue.spaceNumber ?? ue.spaceId : ue.spaceId)
|
|
1719
1719
|
}));
|
|
1720
|
-
|
|
1720
|
+
L([{ label: "All", value: "All" }, ...we]);
|
|
1721
1721
|
}
|
|
1722
|
-
} catch (
|
|
1723
|
-
console.error("Error loading space options",
|
|
1722
|
+
} catch (H) {
|
|
1723
|
+
console.error("Error loading space options", H);
|
|
1724
1724
|
}
|
|
1725
1725
|
})(), () => {
|
|
1726
|
-
|
|
1726
|
+
ne = !1;
|
|
1727
1727
|
};
|
|
1728
|
-
}, [
|
|
1729
|
-
let
|
|
1728
|
+
}, [K, X]), fe(() => {
|
|
1729
|
+
let ne = !0;
|
|
1730
1730
|
return (async () => {
|
|
1731
1731
|
try {
|
|
1732
|
-
const
|
|
1733
|
-
label:
|
|
1734
|
-
value: String(
|
|
1735
|
-
})),
|
|
1736
|
-
label:
|
|
1737
|
-
value: String(
|
|
1738
|
-
})), ze = (Array.isArray(
|
|
1739
|
-
label:
|
|
1740
|
-
value: String(
|
|
1732
|
+
const H = await j.getLookups(), ue = (Array.isArray(H.thirdParties) ? H.thirdParties : []).map((Ne) => ({
|
|
1733
|
+
label: Ne.thirdPartyName,
|
|
1734
|
+
value: String(Ne.thirdPartyId)
|
|
1735
|
+
})), $e = (Array.isArray(H.anomalies) ? H.anomalies : []).map((Ne) => ({
|
|
1736
|
+
label: Ne.anomalyName,
|
|
1737
|
+
value: String(Ne.recordId)
|
|
1738
|
+
})), ze = (Array.isArray(H.severities) ? H.severities : []).map((Ne) => ({
|
|
1739
|
+
label: Ne.severityName,
|
|
1740
|
+
value: String(Ne.severityId)
|
|
1741
1741
|
}));
|
|
1742
|
-
|
|
1743
|
-
} catch (
|
|
1744
|
-
console.error("Error loading filter options",
|
|
1742
|
+
ne && (le([{ label: "All", value: "All" }, ...ue]), $e.length && w([{ label: "All Types", value: "All" }, ...$e]), ze.length && T([{ label: "All levels", value: "All" }, ...ze]));
|
|
1743
|
+
} catch (H) {
|
|
1744
|
+
console.error("Error loading filter options", H);
|
|
1745
1745
|
}
|
|
1746
1746
|
})(), () => {
|
|
1747
|
-
|
|
1747
|
+
ne = !1;
|
|
1748
1748
|
};
|
|
1749
|
-
}, [
|
|
1750
|
-
const
|
|
1751
|
-
() => (t || []).some((
|
|
1749
|
+
}, [j]);
|
|
1750
|
+
const oe = Se(
|
|
1751
|
+
() => (t || []).some((ne) => kn(ne).length > 0),
|
|
1752
1752
|
[t]
|
|
1753
1753
|
);
|
|
1754
|
-
|
|
1754
|
+
fe(() => {
|
|
1755
1755
|
if (!p) return;
|
|
1756
|
-
const
|
|
1756
|
+
const ne = {
|
|
1757
1757
|
anomalyId: A.length > 1 && W !== "All" ? W : void 0,
|
|
1758
|
-
spaceId: !X && ae.length > 1 &&
|
|
1759
|
-
spaceNumber: X && ae.length > 1 &&
|
|
1760
|
-
severityId:
|
|
1761
|
-
thirdPartyIds:
|
|
1762
|
-
searchText:
|
|
1758
|
+
spaceId: !X && ae.length > 1 && E !== "All" ? Number(E) : void 0,
|
|
1759
|
+
spaceNumber: X && ae.length > 1 && E !== "All" ? E : void 0,
|
|
1760
|
+
severityId: x.length > 1 && Y !== "All" ? Number(Y) : void 0,
|
|
1761
|
+
thirdPartyIds: R === "All" ? void 0 : [Number(R)],
|
|
1762
|
+
searchText: se && Ae.trim() || void 0
|
|
1763
1763
|
};
|
|
1764
|
-
p(
|
|
1765
|
-
}, [W,
|
|
1766
|
-
const
|
|
1767
|
-
const
|
|
1768
|
-
return (t || []).filter((
|
|
1769
|
-
const
|
|
1770
|
-
return
|
|
1764
|
+
p(ne), S?.(1);
|
|
1765
|
+
}, [W, E, Y, R, Ae, A.length, ae.length, x.length, X, se]);
|
|
1766
|
+
const ke = Se(() => {
|
|
1767
|
+
const ne = C;
|
|
1768
|
+
return (t || []).filter((H) => {
|
|
1769
|
+
const we = ne || Y === "All" || H.priority === Y, ue = `${H.id} ${H.alertNumber} ${H.description} ${H.statusType}`.toLowerCase(), ge = !h || ue.includes(h.toLowerCase()), $e = ne || W === "All" || (H.anomalyName || "").toLowerCase() === W.toLowerCase(), _e = ne || E === "All" || (H.spaceName || "").toLowerCase() === E.toLowerCase(), ze = ne || !oe || R === "All" || kn(H).includes(Number(R)), Ne = ps(String(H.statusType || "")), pt = !k || !Tr.some((gt) => Ne.includes(ps(gt)));
|
|
1770
|
+
return we && ge && $e && _e && ze && pt;
|
|
1771
1771
|
});
|
|
1772
|
-
}, [t,
|
|
1772
|
+
}, [t, Y, h, W, E, R, oe, k, C]), Ze = l?.length ? l : Te, Be = C && A.length > 1 ? A : Ze, lt = o?.length ? o : ie, ct = C && ae.length > 1 ? ae : lt, Nt = C && x.length > 1 ? x : i, yt = [
|
|
1773
1773
|
{
|
|
1774
1774
|
title: "Severity",
|
|
1775
1775
|
dataIndex: "priority",
|
|
1776
1776
|
key: "priority",
|
|
1777
1777
|
width: 120,
|
|
1778
|
-
render: (
|
|
1778
|
+
render: (ne) => /* @__PURE__ */ c(Rt, { className: "px-[10px] py-[2px]", style: { border: `2px solid ${bi[ne]}`, backgroundColor: Ni[ne] }, children: ne })
|
|
1779
1779
|
},
|
|
1780
1780
|
{
|
|
1781
1781
|
title: "Tracker",
|
|
1782
1782
|
key: "tracker",
|
|
1783
1783
|
width: 140,
|
|
1784
|
-
render: (
|
|
1784
|
+
render: (ne, H) => /* @__PURE__ */ c(
|
|
1785
1785
|
"a",
|
|
1786
1786
|
{
|
|
1787
|
-
onClick: (
|
|
1788
|
-
|
|
1787
|
+
onClick: (we) => {
|
|
1788
|
+
we.preventDefault(), d?.(H, { tab: "track", sourceTab: "active" });
|
|
1789
1789
|
},
|
|
1790
1790
|
className: "text-blue-600 hover:underline",
|
|
1791
1791
|
children: "Tracker"
|
|
@@ -1796,50 +1796,50 @@ function Nr({ data: t, loading: e = !1, pageSize: s = 10, total: n, currentPage:
|
|
|
1796
1796
|
title: "Call to action/Human in the loop",
|
|
1797
1797
|
key: "actions",
|
|
1798
1798
|
width: 320,
|
|
1799
|
-
render: (
|
|
1800
|
-
if (u) return /* @__PURE__ */ c(ur, { children: u(
|
|
1801
|
-
const
|
|
1802
|
-
const
|
|
1803
|
-
P((
|
|
1799
|
+
render: (ne, H) => {
|
|
1800
|
+
if (u) return /* @__PURE__ */ c(ur, { children: u(H) });
|
|
1801
|
+
const we = async (St, Xt) => {
|
|
1802
|
+
const F = Us(H.id, St);
|
|
1803
|
+
P((V) => new Set(V).add(F));
|
|
1804
1804
|
try {
|
|
1805
|
-
const
|
|
1806
|
-
|
|
1807
|
-
} catch (
|
|
1808
|
-
|
|
1805
|
+
const V = await K.sendSMSorEmailNotifications?.(H.id, St, Xt);
|
|
1806
|
+
V?.responseStatus || V?.Success || V?.success ? (be.success(V?.message || V.data || (St ? "Email sent successfully" : "SMS sent successfully")), m?.()) : be.error(V?.message || V?.data || V?.errorMessage || "Failed to send notification");
|
|
1807
|
+
} catch (V) {
|
|
1808
|
+
be.error(V?.message || "Failed to send notification");
|
|
1809
1809
|
} finally {
|
|
1810
|
-
P((
|
|
1811
|
-
const
|
|
1812
|
-
return
|
|
1810
|
+
P((V) => {
|
|
1811
|
+
const _ = new Set(V);
|
|
1812
|
+
return _.delete(F), _;
|
|
1813
1813
|
});
|
|
1814
1814
|
}
|
|
1815
|
-
},
|
|
1815
|
+
}, ue = un, ge = dn, $e = he[ue], _e = he[ge], ze = Mn(ue, H, $e?.title), Ne = Mn(ge, H, _e?.title), pt = Us(H.id, !0), gt = Us(H.id, !1), Wt = as(ue) && U.has(pt), kt = as(ge) && U.has(gt);
|
|
1816
1816
|
return /* @__PURE__ */ y(st, { size: "middle", children: [
|
|
1817
1817
|
/* @__PURE__ */ c(An, { title: ze.tooltipTitle, children: /* @__PURE__ */ c(
|
|
1818
|
-
|
|
1818
|
+
Le,
|
|
1819
1819
|
{
|
|
1820
1820
|
size: "small",
|
|
1821
1821
|
disabled: ze.isDisabled,
|
|
1822
|
-
loading:
|
|
1823
|
-
onClick: as(
|
|
1824
|
-
icon: !
|
|
1822
|
+
loading: Wt,
|
|
1823
|
+
onClick: as(ue) ? () => we(!0, !1) : void 0,
|
|
1824
|
+
icon: !Wt && $e?.icon,
|
|
1825
1825
|
className: "flex flex-col items-center justify-center gap-1",
|
|
1826
1826
|
style: { height: "fit-content" },
|
|
1827
1827
|
children: ze.buttonText
|
|
1828
1828
|
}
|
|
1829
|
-
) }, String(
|
|
1830
|
-
/* @__PURE__ */ c(An, { title:
|
|
1831
|
-
|
|
1829
|
+
) }, String(ue)),
|
|
1830
|
+
/* @__PURE__ */ c(An, { title: Ne.tooltipTitle, children: /* @__PURE__ */ c(
|
|
1831
|
+
Le,
|
|
1832
1832
|
{
|
|
1833
1833
|
size: "small",
|
|
1834
|
-
disabled:
|
|
1835
|
-
loading:
|
|
1836
|
-
onClick: as(
|
|
1837
|
-
icon: !
|
|
1834
|
+
disabled: Ne.isDisabled,
|
|
1835
|
+
loading: kt,
|
|
1836
|
+
onClick: as(ge) ? () => we(!1, !0) : void 0,
|
|
1837
|
+
icon: !kt && _e?.icon,
|
|
1838
1838
|
className: "flex flex-col items-center justify-center gap-1",
|
|
1839
1839
|
style: { height: "fit-content" },
|
|
1840
|
-
children:
|
|
1840
|
+
children: Ne.buttonText
|
|
1841
1841
|
}
|
|
1842
|
-
) }, String(
|
|
1842
|
+
) }, String(ge))
|
|
1843
1843
|
] });
|
|
1844
1844
|
}
|
|
1845
1845
|
},
|
|
@@ -1848,17 +1848,17 @@ function Nr({ data: t, loading: e = !1, pageSize: s = 10, total: n, currentPage:
|
|
|
1848
1848
|
dataIndex: "timestamp",
|
|
1849
1849
|
key: "timestamp",
|
|
1850
1850
|
width: 220,
|
|
1851
|
-
render: (
|
|
1852
|
-
const
|
|
1851
|
+
render: (ne, H) => {
|
|
1852
|
+
const we = H?.timeElapsed, ue = H?.timeRemaining, ge = we ? bn(we) : 0, $e = ue ? bn(ue) : 0, _e = Math.round(ge / (ge + $e) * 100);
|
|
1853
1853
|
return /* @__PURE__ */ y("div", { children: [
|
|
1854
1854
|
/* @__PURE__ */ y("div", { className: "flex items-center gap-2", children: [
|
|
1855
1855
|
/* @__PURE__ */ c("span", { className: "w-[70px]", children: "Elapsed:" }),
|
|
1856
|
-
/* @__PURE__ */ c("span", { className: "font-medium", children:
|
|
1856
|
+
/* @__PURE__ */ c("span", { className: "font-medium", children: we ?? "-" })
|
|
1857
1857
|
] }),
|
|
1858
|
-
/* @__PURE__ */ c(Da, { percent: _e, showInfo: !1, size: "small", strokeColor: Ka(
|
|
1858
|
+
/* @__PURE__ */ c(Da, { percent: _e, showInfo: !1, size: "small", strokeColor: Ka(H.priority) }),
|
|
1859
1859
|
/* @__PURE__ */ y("div", { className: "flex items-center gap-2", children: [
|
|
1860
1860
|
/* @__PURE__ */ c("span", { className: "w-[70px]", children: "Remaining" }),
|
|
1861
|
-
/* @__PURE__ */ c("span", { className: "font-medium", children:
|
|
1861
|
+
/* @__PURE__ */ c("span", { className: "font-medium", children: ue ?? "-" })
|
|
1862
1862
|
] })
|
|
1863
1863
|
] });
|
|
1864
1864
|
}
|
|
@@ -1873,18 +1873,18 @@ function Nr({ data: t, loading: e = !1, pageSize: s = 10, total: n, currentPage:
|
|
|
1873
1873
|
title: "Description",
|
|
1874
1874
|
dataIndex: "description",
|
|
1875
1875
|
key: "description",
|
|
1876
|
-
render: (
|
|
1876
|
+
render: (ne, H) => /* @__PURE__ */ y("div", { children: [
|
|
1877
1877
|
/* @__PURE__ */ c(
|
|
1878
1878
|
"a",
|
|
1879
1879
|
{
|
|
1880
|
-
onClick: (
|
|
1881
|
-
|
|
1880
|
+
onClick: (we) => {
|
|
1881
|
+
we.preventDefault(), d?.(H, { sourceTab: "active" });
|
|
1882
1882
|
},
|
|
1883
1883
|
className: "inline-block mb-1 text-blue-600",
|
|
1884
|
-
children:
|
|
1884
|
+
children: H.alertNumber
|
|
1885
1885
|
}
|
|
1886
1886
|
),
|
|
1887
|
-
/* @__PURE__ */ c("div", { className: "text-black/65", children:
|
|
1887
|
+
/* @__PURE__ */ c("div", { className: "text-black/65", children: ne })
|
|
1888
1888
|
] })
|
|
1889
1889
|
},
|
|
1890
1890
|
{
|
|
@@ -1892,45 +1892,45 @@ function Nr({ data: t, loading: e = !1, pageSize: s = 10, total: n, currentPage:
|
|
|
1892
1892
|
key: "preview",
|
|
1893
1893
|
width: 100,
|
|
1894
1894
|
align: "center",
|
|
1895
|
-
render: (
|
|
1895
|
+
render: (ne, H) => /* @__PURE__ */ c(Ar, { record: H })
|
|
1896
1896
|
}
|
|
1897
|
-
],
|
|
1897
|
+
], bt = a && a.length ? a : yt;
|
|
1898
1898
|
return /* @__PURE__ */ c("div", { children: /* @__PURE__ */ c(
|
|
1899
1899
|
Ui,
|
|
1900
1900
|
{
|
|
1901
1901
|
rowKey: "id",
|
|
1902
|
-
data:
|
|
1903
|
-
columns:
|
|
1902
|
+
data: ke,
|
|
1903
|
+
columns: bt,
|
|
1904
1904
|
loading: e,
|
|
1905
|
-
pageSize:
|
|
1905
|
+
pageSize: ce,
|
|
1906
1906
|
total: n,
|
|
1907
1907
|
currentPage: r,
|
|
1908
1908
|
onPageChange: S,
|
|
1909
|
-
toolbar: /* @__PURE__ */ y(
|
|
1910
|
-
/* @__PURE__ */ c(
|
|
1909
|
+
toolbar: /* @__PURE__ */ y(Ue, { gutter: [12, 12], className: "mb-3", align: "middle", children: [
|
|
1910
|
+
/* @__PURE__ */ c(J, { flex: "none", children: /* @__PURE__ */ y("div", { className: "flex items-center gap-2", children: [
|
|
1911
1911
|
/* @__PURE__ */ c("span", { children: "Severity" }),
|
|
1912
|
-
/* @__PURE__ */ c(Oi, { value:
|
|
1912
|
+
/* @__PURE__ */ c(Oi, { value: Y, onChange: $, options: Nt })
|
|
1913
1913
|
] }) }),
|
|
1914
|
-
/* @__PURE__ */ c(
|
|
1914
|
+
/* @__PURE__ */ c(J, { flex: "none", children: /* @__PURE__ */ y("div", { className: "flex items-center gap-2", children: [
|
|
1915
1915
|
/* @__PURE__ */ c("span", { children: "Anomaly type" }),
|
|
1916
|
-
/* @__PURE__ */ c(Mi, { value: W, onChange: N, options:
|
|
1916
|
+
/* @__PURE__ */ c(Mi, { value: W, onChange: N, options: Be })
|
|
1917
1917
|
] }) }),
|
|
1918
|
-
/* @__PURE__ */ c(
|
|
1918
|
+
/* @__PURE__ */ c(J, { flex: "none", children: /* @__PURE__ */ y("div", { className: "flex items-center gap-2", children: [
|
|
1919
1919
|
/* @__PURE__ */ c("span", { children: X ? "Bus Number" : "Space" }),
|
|
1920
|
-
/* @__PURE__ */ c(Di, { value:
|
|
1920
|
+
/* @__PURE__ */ c(Di, { value: E, onChange: Z, options: ct })
|
|
1921
1921
|
] }) }),
|
|
1922
|
-
/* @__PURE__ */ c(
|
|
1922
|
+
/* @__PURE__ */ c(J, { flex: "none", children: /* @__PURE__ */ y("div", { className: "flex items-center gap-2", children: [
|
|
1923
1923
|
/* @__PURE__ */ c("span", { children: "Action Taken" }),
|
|
1924
|
-
/* @__PURE__ */ c(Ri, { value:
|
|
1924
|
+
/* @__PURE__ */ c(Ri, { value: R, onChange: q, options: M })
|
|
1925
1925
|
] }) }),
|
|
1926
|
-
/* @__PURE__ */ c(
|
|
1927
|
-
/* @__PURE__ */ c(
|
|
1926
|
+
/* @__PURE__ */ c(J, { flex: "auto" }),
|
|
1927
|
+
/* @__PURE__ */ c(J, { flex: "none", children: /* @__PURE__ */ c(
|
|
1928
1928
|
Ma.Search,
|
|
1929
1929
|
{
|
|
1930
1930
|
allowClear: !0,
|
|
1931
1931
|
placeholder: "Search",
|
|
1932
1932
|
onSearch: v,
|
|
1933
|
-
onChange: (
|
|
1933
|
+
onChange: (ne) => v(ne.target.value),
|
|
1934
1934
|
className: "w-[260px] ",
|
|
1935
1935
|
enterButton: !0
|
|
1936
1936
|
}
|
|
@@ -1940,7 +1940,7 @@ function Nr({ data: t, loading: e = !1, pageSize: s = 10, total: n, currentPage:
|
|
|
1940
1940
|
) });
|
|
1941
1941
|
}
|
|
1942
1942
|
function br() {
|
|
1943
|
-
const { alerts: t } =
|
|
1943
|
+
const { alerts: t } = Fe(), e = za();
|
|
1944
1944
|
return Ha({
|
|
1945
1945
|
mutationFn: (s) => t.updateAlertStatus(s),
|
|
1946
1946
|
onSuccess: () => {
|
|
@@ -1965,14 +1965,14 @@ class Qi extends Tt {
|
|
|
1965
1965
|
super(`Invalid Duration: ${e.toMessage()}`);
|
|
1966
1966
|
}
|
|
1967
1967
|
}
|
|
1968
|
-
class
|
|
1968
|
+
class Mt extends Tt {
|
|
1969
1969
|
}
|
|
1970
1970
|
class kr extends Tt {
|
|
1971
1971
|
constructor(e) {
|
|
1972
1972
|
super(`Invalid unit ${e}`);
|
|
1973
1973
|
}
|
|
1974
1974
|
}
|
|
1975
|
-
class
|
|
1975
|
+
class Ie extends Tt {
|
|
1976
1976
|
}
|
|
1977
1977
|
class dt extends Tt {
|
|
1978
1978
|
constructor() {
|
|
@@ -2105,7 +2105,7 @@ const b = "numeric", et = "short", Ve = "long", gs = {
|
|
|
2105
2105
|
second: b,
|
|
2106
2106
|
timeZoneName: Ve
|
|
2107
2107
|
};
|
|
2108
|
-
class
|
|
2108
|
+
class _t {
|
|
2109
2109
|
/**
|
|
2110
2110
|
* The type of zone
|
|
2111
2111
|
* @abstract
|
|
@@ -2190,7 +2190,7 @@ class Jt {
|
|
|
2190
2190
|
}
|
|
2191
2191
|
}
|
|
2192
2192
|
let Ls = null;
|
|
2193
|
-
class ks extends
|
|
2193
|
+
class ks extends _t {
|
|
2194
2194
|
/**
|
|
2195
2195
|
* Get a singleton instance of the local zone
|
|
2196
2196
|
* @return {SystemZone}
|
|
@@ -2216,7 +2216,7 @@ class ks extends Jt {
|
|
|
2216
2216
|
}
|
|
2217
2217
|
/** @override **/
|
|
2218
2218
|
formatOffset(e, s) {
|
|
2219
|
-
return
|
|
2219
|
+
return qt(this.offset(e), s);
|
|
2220
2220
|
}
|
|
2221
2221
|
/** @override **/
|
|
2222
2222
|
offset(e) {
|
|
@@ -2263,12 +2263,12 @@ function ro(t, e) {
|
|
|
2263
2263
|
const s = t.formatToParts(e), n = [];
|
|
2264
2264
|
for (let r = 0; r < s.length; r++) {
|
|
2265
2265
|
const { type: a, value: i } = s[r], l = so[a];
|
|
2266
|
-
a === "era" ? n[l] = i :
|
|
2266
|
+
a === "era" ? n[l] = i : z(l) || (n[l] = parseInt(i, 10));
|
|
2267
2267
|
}
|
|
2268
2268
|
return n;
|
|
2269
2269
|
}
|
|
2270
2270
|
const Fs = /* @__PURE__ */ new Map();
|
|
2271
|
-
class ot extends
|
|
2271
|
+
class ot extends _t {
|
|
2272
2272
|
/**
|
|
2273
2273
|
* @param {string} name - Zone name
|
|
2274
2274
|
* @return {IANAZone}
|
|
@@ -2361,7 +2361,7 @@ class ot extends Jt {
|
|
|
2361
2361
|
* @return {string}
|
|
2362
2362
|
*/
|
|
2363
2363
|
formatOffset(e, s) {
|
|
2364
|
-
return
|
|
2364
|
+
return qt(this.offset(e), s);
|
|
2365
2365
|
}
|
|
2366
2366
|
/**
|
|
2367
2367
|
* Return the offset in minutes for this zone at the specified timestamp.
|
|
@@ -2431,9 +2431,9 @@ function oo(t, e = {}) {
|
|
|
2431
2431
|
let a = Qs.get(r);
|
|
2432
2432
|
return a === void 0 && (a = new Intl.RelativeTimeFormat(t, e), Qs.set(r, a)), a;
|
|
2433
2433
|
}
|
|
2434
|
-
let
|
|
2434
|
+
let zt = null;
|
|
2435
2435
|
function lo() {
|
|
2436
|
-
return
|
|
2436
|
+
return zt || (zt = new Intl.DateTimeFormat().resolvedOptions().locale, zt);
|
|
2437
2437
|
}
|
|
2438
2438
|
const Xs = /* @__PURE__ */ new Map();
|
|
2439
2439
|
function Gr(t) {
|
|
@@ -2473,7 +2473,7 @@ function mo(t, e, s) {
|
|
|
2473
2473
|
function fo(t) {
|
|
2474
2474
|
const e = [];
|
|
2475
2475
|
for (let s = 1; s <= 12; s++) {
|
|
2476
|
-
const n =
|
|
2476
|
+
const n = B.utc(2009, s, 1);
|
|
2477
2477
|
e.push(t(n));
|
|
2478
2478
|
}
|
|
2479
2479
|
return e;
|
|
@@ -2481,7 +2481,7 @@ function fo(t) {
|
|
|
2481
2481
|
function ho(t) {
|
|
2482
2482
|
const e = [];
|
|
2483
2483
|
for (let s = 1; s <= 7; s++) {
|
|
2484
|
-
const n =
|
|
2484
|
+
const n = B.utc(2016, 11, 13 + s);
|
|
2485
2485
|
e.push(t(n));
|
|
2486
2486
|
}
|
|
2487
2487
|
return e;
|
|
@@ -2564,9 +2564,9 @@ const qr = {
|
|
|
2564
2564
|
minimalDays: 4,
|
|
2565
2565
|
weekend: [6, 7]
|
|
2566
2566
|
};
|
|
2567
|
-
class
|
|
2567
|
+
class re {
|
|
2568
2568
|
static fromOpts(e) {
|
|
2569
|
-
return
|
|
2569
|
+
return re.create(
|
|
2570
2570
|
e.locale,
|
|
2571
2571
|
e.numberingSystem,
|
|
2572
2572
|
e.outputCalendar,
|
|
@@ -2576,13 +2576,13 @@ class ne {
|
|
|
2576
2576
|
}
|
|
2577
2577
|
static create(e, s, n, r, a = !1) {
|
|
2578
2578
|
const i = e || pe.defaultLocale, l = i || (a ? "en-US" : lo()), o = s || pe.defaultNumberingSystem, u = n || pe.defaultOutputCalendar, d = sn(r) || pe.defaultWeekSettings;
|
|
2579
|
-
return new
|
|
2579
|
+
return new re(l, o, u, d, i);
|
|
2580
2580
|
}
|
|
2581
2581
|
static resetCache() {
|
|
2582
|
-
|
|
2582
|
+
zt = null, _s.clear(), Ks.clear(), Qs.clear(), Xs.clear(), en.clear();
|
|
2583
2583
|
}
|
|
2584
2584
|
static fromObject({ locale: e, numberingSystem: s, outputCalendar: n, weekSettings: r } = {}) {
|
|
2585
|
-
return
|
|
2585
|
+
return re.create(e, s, n, r);
|
|
2586
2586
|
}
|
|
2587
2587
|
constructor(e, s, n, r, a) {
|
|
2588
2588
|
const [i, l, o] = uo(e);
|
|
@@ -2596,7 +2596,7 @@ class ne {
|
|
|
2596
2596
|
return e && s ? "en" : "intl";
|
|
2597
2597
|
}
|
|
2598
2598
|
clone(e) {
|
|
2599
|
-
return !e || Object.getOwnPropertyNames(e).length === 0 ? this :
|
|
2599
|
+
return !e || Object.getOwnPropertyNames(e).length === 0 ? this : re.create(
|
|
2600
2600
|
e.locale || this.specifiedLocale,
|
|
2601
2601
|
e.numberingSystem || this.numberingSystem,
|
|
2602
2602
|
e.outputCalendar || this.outputCalendar,
|
|
@@ -2638,7 +2638,7 @@ class ne {
|
|
|
2638
2638
|
() => {
|
|
2639
2639
|
if (!this.meridiemCache) {
|
|
2640
2640
|
const e = { hour: "numeric", hourCycle: "h12" };
|
|
2641
|
-
this.meridiemCache = [
|
|
2641
|
+
this.meridiemCache = [B.utc(2016, 11, 13, 9), B.utc(2016, 11, 13, 19)].map(
|
|
2642
2642
|
(s) => this.extract(s, e, "dayperiod")
|
|
2643
2643
|
);
|
|
2644
2644
|
}
|
|
@@ -2649,7 +2649,7 @@ class ne {
|
|
|
2649
2649
|
eras(e) {
|
|
2650
2650
|
return is(this, e, ca, () => {
|
|
2651
2651
|
const s = { era: e };
|
|
2652
|
-
return this.eraCache[e] || (this.eraCache[e] = [
|
|
2652
|
+
return this.eraCache[e] || (this.eraCache[e] = [B.utc(-40, 1, 1), B.utc(2017, 1, 1)].map(
|
|
2653
2653
|
(n) => this.extract(n, s, "era")
|
|
2654
2654
|
)), this.eraCache[e];
|
|
2655
2655
|
});
|
|
@@ -2693,13 +2693,13 @@ class ne {
|
|
|
2693
2693
|
}
|
|
2694
2694
|
}
|
|
2695
2695
|
let $s = null;
|
|
2696
|
-
class
|
|
2696
|
+
class De extends _t {
|
|
2697
2697
|
/**
|
|
2698
2698
|
* Get a singleton instance of UTC
|
|
2699
2699
|
* @return {FixedOffsetZone}
|
|
2700
2700
|
*/
|
|
2701
2701
|
static get utcInstance() {
|
|
2702
|
-
return $s === null && ($s = new
|
|
2702
|
+
return $s === null && ($s = new De(0)), $s;
|
|
2703
2703
|
}
|
|
2704
2704
|
/**
|
|
2705
2705
|
* Get an instance with a specified offset
|
|
@@ -2707,7 +2707,7 @@ class Ce extends Jt {
|
|
|
2707
2707
|
* @return {FixedOffsetZone}
|
|
2708
2708
|
*/
|
|
2709
2709
|
static instance(e) {
|
|
2710
|
-
return e === 0 ?
|
|
2710
|
+
return e === 0 ? De.utcInstance : new De(e);
|
|
2711
2711
|
}
|
|
2712
2712
|
/**
|
|
2713
2713
|
* Get an instance of FixedOffsetZone from a UTC offset string, like "UTC+6"
|
|
@@ -2721,7 +2721,7 @@ class Ce extends Jt {
|
|
|
2721
2721
|
if (e) {
|
|
2722
2722
|
const s = e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);
|
|
2723
2723
|
if (s)
|
|
2724
|
-
return new
|
|
2724
|
+
return new De(Os(s[1], s[2]));
|
|
2725
2725
|
}
|
|
2726
2726
|
return null;
|
|
2727
2727
|
}
|
|
@@ -2743,7 +2743,7 @@ class Ce extends Jt {
|
|
|
2743
2743
|
* @type {string}
|
|
2744
2744
|
*/
|
|
2745
2745
|
get name() {
|
|
2746
|
-
return this.fixed === 0 ? "UTC" : `UTC${
|
|
2746
|
+
return this.fixed === 0 ? "UTC" : `UTC${qt(this.fixed, "narrow")}`;
|
|
2747
2747
|
}
|
|
2748
2748
|
/**
|
|
2749
2749
|
* The IANA name of this zone, i.e. `Etc/UTC` or `Etc/GMT+/-nn`
|
|
@@ -2752,7 +2752,7 @@ class Ce extends Jt {
|
|
|
2752
2752
|
* @type {string}
|
|
2753
2753
|
*/
|
|
2754
2754
|
get ianaName() {
|
|
2755
|
-
return this.fixed === 0 ? "Etc/UTC" : `Etc/GMT${
|
|
2755
|
+
return this.fixed === 0 ? "Etc/UTC" : `Etc/GMT${qt(-this.fixed, "narrow")}`;
|
|
2756
2756
|
}
|
|
2757
2757
|
/**
|
|
2758
2758
|
* Returns the offset's common name at the specified timestamp.
|
|
@@ -2772,7 +2772,7 @@ class Ce extends Jt {
|
|
|
2772
2772
|
* @return {string}
|
|
2773
2773
|
*/
|
|
2774
2774
|
formatOffset(e, s) {
|
|
2775
|
-
return
|
|
2775
|
+
return qt(this.fixed, s);
|
|
2776
2776
|
}
|
|
2777
2777
|
/**
|
|
2778
2778
|
* Returns whether the offset is known to be fixed for the whole year:
|
|
@@ -2812,7 +2812,7 @@ class Ce extends Jt {
|
|
|
2812
2812
|
return !0;
|
|
2813
2813
|
}
|
|
2814
2814
|
}
|
|
2815
|
-
class vo extends
|
|
2815
|
+
class vo extends _t {
|
|
2816
2816
|
constructor(e) {
|
|
2817
2817
|
super(), this.zoneName = e;
|
|
2818
2818
|
}
|
|
@@ -2850,14 +2850,14 @@ class vo extends Jt {
|
|
|
2850
2850
|
}
|
|
2851
2851
|
}
|
|
2852
2852
|
function ft(t, e) {
|
|
2853
|
-
if (
|
|
2853
|
+
if (z(t) || t === null)
|
|
2854
2854
|
return e;
|
|
2855
|
-
if (t instanceof
|
|
2855
|
+
if (t instanceof _t)
|
|
2856
2856
|
return t;
|
|
2857
2857
|
if (ko(t)) {
|
|
2858
2858
|
const s = t.toLowerCase();
|
|
2859
|
-
return s === "default" ? e : s === "local" || s === "system" ? ks.instance : s === "utc" || s === "gmt" ?
|
|
2860
|
-
} else return ht(t) ?
|
|
2859
|
+
return s === "default" ? e : s === "local" || s === "system" ? ks.instance : s === "utc" || s === "gmt" ? De.utcInstance : De.parseSpecifier(s) || ot.create(t);
|
|
2860
|
+
} else return ht(t) ? De.instance(t) : typeof t == "object" && "offset" in t && typeof t.offset == "function" ? t : new vo(t);
|
|
2861
2861
|
}
|
|
2862
2862
|
const mn = {
|
|
2863
2863
|
arab: "[٠-٩]",
|
|
@@ -3068,7 +3068,7 @@ class pe {
|
|
|
3068
3068
|
* @return {void}
|
|
3069
3069
|
*/
|
|
3070
3070
|
static resetCaches() {
|
|
3071
|
-
|
|
3071
|
+
re.resetCache(), ot.resetCache(), B.resetCache(), To();
|
|
3072
3072
|
}
|
|
3073
3073
|
}
|
|
3074
3074
|
class Xe {
|
|
@@ -3093,10 +3093,10 @@ function fn(t, e, s) {
|
|
|
3093
3093
|
return r === 0 ? 7 : r;
|
|
3094
3094
|
}
|
|
3095
3095
|
function _r(t, e, s) {
|
|
3096
|
-
return s + (
|
|
3096
|
+
return s + (Jt(t) ? jr : Yr)[e - 1];
|
|
3097
3097
|
}
|
|
3098
3098
|
function Jr(t, e) {
|
|
3099
|
-
const s =
|
|
3099
|
+
const s = Jt(t) ? jr : Yr, n = s.findIndex((a) => a < e), r = e - s[n];
|
|
3100
3100
|
return { month: n + 1, day: r };
|
|
3101
3101
|
}
|
|
3102
3102
|
function hn(t, e) {
|
|
@@ -3105,12 +3105,12 @@ function hn(t, e) {
|
|
|
3105
3105
|
function Ss(t, e = 4, s = 1) {
|
|
3106
3106
|
const { year: n, month: r, day: a } = t, i = _r(n, r, a), l = hn(fn(n, r, a), s);
|
|
3107
3107
|
let o = Math.floor((i - l + 14 - e) / 7), u;
|
|
3108
|
-
return o < 1 ? (u = n - 1, o =
|
|
3108
|
+
return o < 1 ? (u = n - 1, o = Yt(u, e, s)) : o > Yt(n, e, s) ? (u = n + 1, o = 1) : u = n, { weekYear: u, weekNumber: o, weekday: l, ...Es(t) };
|
|
3109
3109
|
}
|
|
3110
3110
|
function Bn(t, e = 4, s = 1) {
|
|
3111
|
-
const { weekYear: n, weekNumber: r, weekday: a } = t, i = hn(fn(n, 1, e), s), l =
|
|
3111
|
+
const { weekYear: n, weekNumber: r, weekday: a } = t, i = hn(fn(n, 1, e), s), l = Dt(n);
|
|
3112
3112
|
let o = r * 7 + a - i - 7 + e, u;
|
|
3113
|
-
o < 1 ? (u = n - 1, o +=
|
|
3113
|
+
o < 1 ? (u = n - 1, o += Dt(u)) : o > l ? (u = n + 1, o -= Dt(n)) : u = n;
|
|
3114
3114
|
const { month: d, day: m } = Jr(u, o);
|
|
3115
3115
|
return { year: u, month: d, day: m, ...Es(t) };
|
|
3116
3116
|
}
|
|
@@ -3123,12 +3123,12 @@ function zn(t) {
|
|
|
3123
3123
|
return { year: e, month: n, day: r, ...Es(t) };
|
|
3124
3124
|
}
|
|
3125
3125
|
function Hn(t, e) {
|
|
3126
|
-
if (!
|
|
3127
|
-
if (!
|
|
3128
|
-
throw new
|
|
3126
|
+
if (!z(t.localWeekday) || !z(t.localWeekNumber) || !z(t.localWeekYear)) {
|
|
3127
|
+
if (!z(t.weekday) || !z(t.weekNumber) || !z(t.weekYear))
|
|
3128
|
+
throw new Mt(
|
|
3129
3129
|
"Cannot mix locale-based week fields with ISO-based week fields"
|
|
3130
3130
|
);
|
|
3131
|
-
return
|
|
3131
|
+
return z(t.localWeekday) || (t.weekday = t.localWeekday), z(t.localWeekNumber) || (t.weekNumber = t.localWeekNumber), z(t.localWeekYear) || (t.weekYear = t.localWeekYear), delete t.localWeekday, delete t.localWeekNumber, delete t.localWeekYear, {
|
|
3132
3132
|
minDaysInFirstWeek: e.getMinDaysInFirstWeek(),
|
|
3133
3133
|
startOfWeek: e.getStartOfWeek()
|
|
3134
3134
|
};
|
|
@@ -3139,12 +3139,12 @@ function No(t, e = 4, s = 1) {
|
|
|
3139
3139
|
const n = Is(t.weekYear), r = je(
|
|
3140
3140
|
t.weekNumber,
|
|
3141
3141
|
1,
|
|
3142
|
-
|
|
3142
|
+
Yt(t.weekYear, e, s)
|
|
3143
3143
|
), a = je(t.weekday, 1, 7);
|
|
3144
3144
|
return n ? r ? a ? !1 : Ye("weekday", t.weekday) : Ye("week", t.weekNumber) : Ye("weekYear", t.weekYear);
|
|
3145
3145
|
}
|
|
3146
3146
|
function bo(t) {
|
|
3147
|
-
const e = Is(t.year), s = je(t.ordinal, 1,
|
|
3147
|
+
const e = Is(t.year), s = je(t.ordinal, 1, Dt(t.year));
|
|
3148
3148
|
return e ? s ? !1 : Ye("ordinal", t.ordinal) : Ye("year", t.year);
|
|
3149
3149
|
}
|
|
3150
3150
|
function Kr(t) {
|
|
@@ -3155,7 +3155,7 @@ function Qr(t) {
|
|
|
3155
3155
|
const { hour: e, minute: s, second: n, millisecond: r } = t, a = je(e, 0, 23) || e === 24 && s === 0 && n === 0 && r === 0, i = je(s, 0, 59), l = je(n, 0, 59), o = je(r, 0, 999);
|
|
3156
3156
|
return a ? i ? l ? o ? !1 : Ye("millisecond", r) : Ye("second", n) : Ye("minute", s) : Ye("hour", e);
|
|
3157
3157
|
}
|
|
3158
|
-
function
|
|
3158
|
+
function z(t) {
|
|
3159
3159
|
return typeof t > "u";
|
|
3160
3160
|
}
|
|
3161
3161
|
function ht(t) {
|
|
@@ -3197,16 +3197,16 @@ function Gn(t, e, s) {
|
|
|
3197
3197
|
function Oo(t, e) {
|
|
3198
3198
|
return e.reduce((s, n) => (s[n] = t[n], s), {});
|
|
3199
3199
|
}
|
|
3200
|
-
function
|
|
3200
|
+
function Ut(t, e) {
|
|
3201
3201
|
return Object.prototype.hasOwnProperty.call(t, e);
|
|
3202
3202
|
}
|
|
3203
3203
|
function sn(t) {
|
|
3204
3204
|
if (t == null)
|
|
3205
3205
|
return null;
|
|
3206
3206
|
if (typeof t != "object")
|
|
3207
|
-
throw new
|
|
3207
|
+
throw new Ie("Week settings must be an object");
|
|
3208
3208
|
if (!je(t.firstDay, 1, 7) || !je(t.minimalDays, 1, 7) || !Array.isArray(t.weekend) || t.weekend.some((e) => !je(e, 1, 7)))
|
|
3209
|
-
throw new
|
|
3209
|
+
throw new Ie("Invalid week settings");
|
|
3210
3210
|
return {
|
|
3211
3211
|
firstDay: t.firstDay,
|
|
3212
3212
|
minimalDays: t.minimalDays,
|
|
@@ -3225,15 +3225,15 @@ function ve(t, e = 2) {
|
|
|
3225
3225
|
return s ? n = "-" + ("" + -t).padStart(e, "0") : n = ("" + t).padStart(e, "0"), n;
|
|
3226
3226
|
}
|
|
3227
3227
|
function mt(t) {
|
|
3228
|
-
if (!(
|
|
3228
|
+
if (!(z(t) || t === null || t === ""))
|
|
3229
3229
|
return parseInt(t, 10);
|
|
3230
3230
|
}
|
|
3231
3231
|
function vt(t) {
|
|
3232
|
-
if (!(
|
|
3232
|
+
if (!(z(t) || t === null || t === ""))
|
|
3233
3233
|
return parseFloat(t);
|
|
3234
3234
|
}
|
|
3235
3235
|
function yn(t) {
|
|
3236
|
-
if (!(
|
|
3236
|
+
if (!(z(t) || t === null || t === "")) {
|
|
3237
3237
|
const e = parseFloat("0." + t) * 1e3;
|
|
3238
3238
|
return Math.floor(e);
|
|
3239
3239
|
}
|
|
@@ -3255,15 +3255,15 @@ function pn(t, e, s = "round") {
|
|
|
3255
3255
|
throw new RangeError(`Value rounding ${s} is out of range`);
|
|
3256
3256
|
}
|
|
3257
3257
|
}
|
|
3258
|
-
function
|
|
3258
|
+
function Jt(t) {
|
|
3259
3259
|
return t % 4 === 0 && (t % 100 !== 0 || t % 400 === 0);
|
|
3260
3260
|
}
|
|
3261
|
-
function
|
|
3262
|
-
return
|
|
3261
|
+
function Dt(t) {
|
|
3262
|
+
return Jt(t) ? 366 : 365;
|
|
3263
3263
|
}
|
|
3264
3264
|
function vs(t, e) {
|
|
3265
3265
|
const s = Eo(e - 1, 12) + 1, n = t + (e - s) / 12;
|
|
3266
|
-
return s === 2 ?
|
|
3266
|
+
return s === 2 ? Jt(n) ? 29 : 28 : [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][s - 1];
|
|
3267
3267
|
}
|
|
3268
3268
|
function xs(t) {
|
|
3269
3269
|
let e = Date.UTC(
|
|
@@ -3280,9 +3280,9 @@ function xs(t) {
|
|
|
3280
3280
|
function qn(t, e, s) {
|
|
3281
3281
|
return -hn(fn(t, 1, e), s) + e - 1;
|
|
3282
3282
|
}
|
|
3283
|
-
function
|
|
3283
|
+
function Yt(t, e = 4, s = 1) {
|
|
3284
3284
|
const n = qn(t, e, s), r = qn(t + 1, e, s);
|
|
3285
|
-
return (
|
|
3285
|
+
return (Dt(t) - n + r) / 7;
|
|
3286
3286
|
}
|
|
3287
3287
|
function nn(t) {
|
|
3288
3288
|
return t > 99 ? t : t > pe.twoDigitCutoffYear ? 1900 + t : 2e3 + t;
|
|
@@ -3309,20 +3309,20 @@ function Os(t, e) {
|
|
|
3309
3309
|
function sa(t) {
|
|
3310
3310
|
const e = Number(t);
|
|
3311
3311
|
if (typeof t == "boolean" || t === "" || !Number.isFinite(e))
|
|
3312
|
-
throw new
|
|
3312
|
+
throw new Ie(`Invalid unit value ${t}`);
|
|
3313
3313
|
return e;
|
|
3314
3314
|
}
|
|
3315
3315
|
function ws(t, e) {
|
|
3316
3316
|
const s = {};
|
|
3317
3317
|
for (const n in t)
|
|
3318
|
-
if (
|
|
3318
|
+
if (Ut(t, n)) {
|
|
3319
3319
|
const r = t[n];
|
|
3320
3320
|
if (r == null) continue;
|
|
3321
3321
|
s[e(n)] = sa(r);
|
|
3322
3322
|
}
|
|
3323
3323
|
return s;
|
|
3324
3324
|
}
|
|
3325
|
-
function
|
|
3325
|
+
function qt(t, e) {
|
|
3326
3326
|
const s = Math.trunc(Math.abs(t / 60)), n = Math.trunc(Math.abs(t % 60)), r = t >= 0 ? "+" : "-";
|
|
3327
3327
|
switch (e) {
|
|
3328
3328
|
case "short":
|
|
@@ -3482,9 +3482,9 @@ const Zo = {
|
|
|
3482
3482
|
FFF: Br,
|
|
3483
3483
|
FFFF: Hr
|
|
3484
3484
|
};
|
|
3485
|
-
class
|
|
3485
|
+
class xe {
|
|
3486
3486
|
static create(e, s = {}) {
|
|
3487
|
-
return new
|
|
3487
|
+
return new xe(e, s);
|
|
3488
3488
|
}
|
|
3489
3489
|
static parseFormat(e) {
|
|
3490
3490
|
let s = null, n = "", r = !1;
|
|
@@ -3533,7 +3533,7 @@ class Oe {
|
|
|
3533
3533
|
k ? { weekday: p } : { weekday: p, month: "long", day: "numeric" },
|
|
3534
3534
|
"weekday"
|
|
3535
3535
|
), d = (p) => {
|
|
3536
|
-
const k =
|
|
3536
|
+
const k = xe.macroTokenToFormatOpts(p);
|
|
3537
3537
|
return k ? this.formatWithSystemDefault(e, k) : p;
|
|
3538
3538
|
}, m = (p) => n ? Wo(e, p) : a({ era: p }, "era"), S = (p) => {
|
|
3539
3539
|
switch (p) {
|
|
@@ -3678,7 +3678,7 @@ class Oe {
|
|
|
3678
3678
|
return d(p);
|
|
3679
3679
|
}
|
|
3680
3680
|
};
|
|
3681
|
-
return Yn(
|
|
3681
|
+
return Yn(xe.parseFormat(s), S);
|
|
3682
3682
|
}
|
|
3683
3683
|
formatDurationFromString(e, s) {
|
|
3684
3684
|
const n = this.opts.signMode === "negativeLargestOnly" ? -1 : 1, r = (d) => {
|
|
@@ -3706,11 +3706,11 @@ class Oe {
|
|
|
3706
3706
|
const p = r(S);
|
|
3707
3707
|
if (p) {
|
|
3708
3708
|
const k = m.isNegativeDuration && p !== m.largestUnit ? n : 1;
|
|
3709
|
-
let
|
|
3710
|
-
return this.opts.signMode === "negativeLargestOnly" && p !== m.largestUnit ?
|
|
3709
|
+
let D;
|
|
3710
|
+
return this.opts.signMode === "negativeLargestOnly" && p !== m.largestUnit ? D = "never" : this.opts.signMode === "all" ? D = "always" : D = "auto", this.num(d.get(p) * k, S.length, D);
|
|
3711
3711
|
} else
|
|
3712
3712
|
return S;
|
|
3713
|
-
}, i =
|
|
3713
|
+
}, i = xe.parseFormat(s), l = i.reduce(
|
|
3714
3714
|
(d, { literal: m, val: S }) => m ? d : d.concat(S),
|
|
3715
3715
|
[]
|
|
3716
3716
|
), o = e.shiftTo(...l.map(r).filter((d) => d)), u = {
|
|
@@ -3723,11 +3723,11 @@ class Oe {
|
|
|
3723
3723
|
}
|
|
3724
3724
|
}
|
|
3725
3725
|
const ua = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;
|
|
3726
|
-
function
|
|
3726
|
+
function Lt(...t) {
|
|
3727
3727
|
const e = t.reduce((s, n) => s + n.source, "");
|
|
3728
3728
|
return RegExp(`^${e}$`);
|
|
3729
3729
|
}
|
|
3730
|
-
function
|
|
3730
|
+
function Ft(...t) {
|
|
3731
3731
|
return (e) => t.reduce(
|
|
3732
3732
|
([s, n, r], a) => {
|
|
3733
3733
|
const [i, l, o] = a(e, r);
|
|
@@ -3736,7 +3736,7 @@ function Lt(...t) {
|
|
|
3736
3736
|
[{}, null, 1]
|
|
3737
3737
|
).slice(0, 2);
|
|
3738
3738
|
}
|
|
3739
|
-
function
|
|
3739
|
+
function $t(t, ...e) {
|
|
3740
3740
|
if (t == null)
|
|
3741
3741
|
return [null, null];
|
|
3742
3742
|
for (const [s, n] of e) {
|
|
@@ -3758,30 +3758,30 @@ function da(...t) {
|
|
|
3758
3758
|
const ma = /(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/, Bo = `(?:${ma.source}?(?:\\[(${ua.source})\\])?)?`, gn = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/, fa = RegExp(`${gn.source}${Bo}`), Sn = RegExp(`(?:[Tt]${fa.source})?`), zo = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/, Ho = /(\d{4})-?W(\d\d)(?:-?(\d))?/, Go = /(\d{4})-?(\d{3})/, qo = da("weekYear", "weekNumber", "weekDay"), Yo = da("year", "ordinal"), jo = /(\d{4})-(\d\d)-(\d\d)/, ha = RegExp(
|
|
3759
3759
|
`${gn.source} ?(?:${ma.source}|(${ua.source}))?`
|
|
3760
3760
|
), _o = RegExp(`(?: ${ha.source})?`);
|
|
3761
|
-
function
|
|
3761
|
+
function Ct(t, e, s) {
|
|
3762
3762
|
const n = t[e];
|
|
3763
|
-
return
|
|
3763
|
+
return z(n) ? s : mt(n);
|
|
3764
3764
|
}
|
|
3765
3765
|
function Jo(t, e) {
|
|
3766
3766
|
return [{
|
|
3767
|
-
year:
|
|
3768
|
-
month:
|
|
3769
|
-
day:
|
|
3767
|
+
year: Ct(t, e),
|
|
3768
|
+
month: Ct(t, e + 1, 1),
|
|
3769
|
+
day: Ct(t, e + 2, 1)
|
|
3770
3770
|
}, null, e + 3];
|
|
3771
3771
|
}
|
|
3772
|
-
function
|
|
3772
|
+
function Pt(t, e) {
|
|
3773
3773
|
return [{
|
|
3774
|
-
hours:
|
|
3775
|
-
minutes:
|
|
3776
|
-
seconds:
|
|
3774
|
+
hours: Ct(t, e, 0),
|
|
3775
|
+
minutes: Ct(t, e + 1, 0),
|
|
3776
|
+
seconds: Ct(t, e + 2, 0),
|
|
3777
3777
|
milliseconds: yn(t[e + 3])
|
|
3778
3778
|
}, null, e + 4];
|
|
3779
3779
|
}
|
|
3780
|
-
function
|
|
3781
|
-
const s = !t[e] && !t[e + 1], n = Os(t[e + 1], t[e + 2]), r = s ? null :
|
|
3780
|
+
function Kt(t, e) {
|
|
3781
|
+
const s = !t[e] && !t[e + 1], n = Os(t[e + 1], t[e + 2]), r = s ? null : De.instance(n);
|
|
3782
3782
|
return [{}, r, e + 3];
|
|
3783
3783
|
}
|
|
3784
|
-
function
|
|
3784
|
+
function Qt(t, e) {
|
|
3785
3785
|
const s = t[e] ? ot.create(t[e]) : null;
|
|
3786
3786
|
return [{}, s, e + 1];
|
|
3787
3787
|
}
|
|
@@ -3839,7 +3839,7 @@ function sl(t) {
|
|
|
3839
3839
|
m
|
|
3840
3840
|
] = t, S = vn(e, r, n, s, a, i, l);
|
|
3841
3841
|
let p;
|
|
3842
|
-
return o ? p = el[o] : u ? p = 0 : p = Os(d, m), [S, new
|
|
3842
|
+
return o ? p = el[o] : u ? p = 0 : p = Os(d, m), [S, new De(p)];
|
|
3843
3843
|
}
|
|
3844
3844
|
function nl(t) {
|
|
3845
3845
|
return t.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").trim();
|
|
@@ -3847,34 +3847,34 @@ function nl(t) {
|
|
|
3847
3847
|
const rl = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/, al = /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/, il = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;
|
|
3848
3848
|
function jn(t) {
|
|
3849
3849
|
const [, e, s, n, r, a, i, l] = t;
|
|
3850
|
-
return [vn(e, r, n, s, a, i, l),
|
|
3850
|
+
return [vn(e, r, n, s, a, i, l), De.utcInstance];
|
|
3851
3851
|
}
|
|
3852
3852
|
function ol(t) {
|
|
3853
3853
|
const [, e, s, n, r, a, i, l] = t;
|
|
3854
|
-
return [vn(e, l, s, n, r, a, i),
|
|
3854
|
+
return [vn(e, l, s, n, r, a, i), De.utcInstance];
|
|
3855
3855
|
}
|
|
3856
|
-
const ll =
|
|
3856
|
+
const ll = Lt(zo, Sn), cl = Lt(Ho, Sn), ul = Lt(Go, Sn), dl = Lt(fa), ya = Ft(
|
|
3857
3857
|
Jo,
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
), ml =
|
|
3858
|
+
Pt,
|
|
3859
|
+
Kt,
|
|
3860
|
+
Qt
|
|
3861
|
+
), ml = Ft(
|
|
3862
3862
|
qo,
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
), fl =
|
|
3863
|
+
Pt,
|
|
3864
|
+
Kt,
|
|
3865
|
+
Qt
|
|
3866
|
+
), fl = Ft(
|
|
3867
3867
|
Yo,
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
), hl =
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3868
|
+
Pt,
|
|
3869
|
+
Kt,
|
|
3870
|
+
Qt
|
|
3871
|
+
), hl = Ft(
|
|
3872
|
+
Pt,
|
|
3873
|
+
Kt,
|
|
3874
|
+
Qt
|
|
3875
3875
|
);
|
|
3876
3876
|
function yl(t) {
|
|
3877
|
-
return
|
|
3877
|
+
return $t(
|
|
3878
3878
|
t,
|
|
3879
3879
|
[ll, ya],
|
|
3880
3880
|
[cl, ml],
|
|
@@ -3883,10 +3883,10 @@ function yl(t) {
|
|
|
3883
3883
|
);
|
|
3884
3884
|
}
|
|
3885
3885
|
function pl(t) {
|
|
3886
|
-
return
|
|
3886
|
+
return $t(nl(t), [tl, sl]);
|
|
3887
3887
|
}
|
|
3888
3888
|
function gl(t) {
|
|
3889
|
-
return
|
|
3889
|
+
return $t(
|
|
3890
3890
|
t,
|
|
3891
3891
|
[rl, jn],
|
|
3892
3892
|
[al, jn],
|
|
@@ -3894,19 +3894,19 @@ function gl(t) {
|
|
|
3894
3894
|
);
|
|
3895
3895
|
}
|
|
3896
3896
|
function Sl(t) {
|
|
3897
|
-
return
|
|
3897
|
+
return $t(t, [Qo, Xo]);
|
|
3898
3898
|
}
|
|
3899
|
-
const vl =
|
|
3899
|
+
const vl = Ft(Pt);
|
|
3900
3900
|
function wl(t) {
|
|
3901
|
-
return
|
|
3901
|
+
return $t(t, [Ko, vl]);
|
|
3902
3902
|
}
|
|
3903
|
-
const Al =
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3903
|
+
const Al = Lt(jo, _o), Tl = Lt(ha), Nl = Ft(
|
|
3904
|
+
Pt,
|
|
3905
|
+
Kt,
|
|
3906
|
+
Qt
|
|
3907
3907
|
);
|
|
3908
3908
|
function bl(t) {
|
|
3909
|
-
return
|
|
3909
|
+
return $t(
|
|
3910
3910
|
t,
|
|
3911
3911
|
[Al, ya],
|
|
3912
3912
|
[Tl, Nl]
|
|
@@ -3958,7 +3958,7 @@ const _n = "Invalid Duration", pa = {
|
|
|
3958
3958
|
milliseconds: 720 * 60 * 60 * 1e3
|
|
3959
3959
|
},
|
|
3960
3960
|
...pa
|
|
3961
|
-
}, qe = 146097 / 400,
|
|
3961
|
+
}, qe = 146097 / 400, It = 146097 / 4800, Il = {
|
|
3962
3962
|
years: {
|
|
3963
3963
|
quarters: 4,
|
|
3964
3964
|
months: 12,
|
|
@@ -3979,12 +3979,12 @@ const _n = "Invalid Duration", pa = {
|
|
|
3979
3979
|
milliseconds: qe * 24 * 60 * 60 * 1e3 / 4
|
|
3980
3980
|
},
|
|
3981
3981
|
months: {
|
|
3982
|
-
weeks:
|
|
3983
|
-
days:
|
|
3984
|
-
hours:
|
|
3985
|
-
minutes:
|
|
3986
|
-
seconds:
|
|
3987
|
-
milliseconds:
|
|
3982
|
+
weeks: It / 7,
|
|
3983
|
+
days: It,
|
|
3984
|
+
hours: It * 24,
|
|
3985
|
+
minutes: It * 24 * 60,
|
|
3986
|
+
seconds: It * 24 * 60 * 60,
|
|
3987
|
+
milliseconds: It * 24 * 60 * 60 * 1e3
|
|
3988
3988
|
},
|
|
3989
3989
|
...pa
|
|
3990
3990
|
}, At = [
|
|
@@ -4016,7 +4016,7 @@ function ga(t, e) {
|
|
|
4016
4016
|
function Jn(t, e) {
|
|
4017
4017
|
const s = ga(t, e) < 0 ? -1 : 1;
|
|
4018
4018
|
At.reduceRight((n, r) => {
|
|
4019
|
-
if (
|
|
4019
|
+
if (z(e[r]))
|
|
4020
4020
|
return n;
|
|
4021
4021
|
if (n) {
|
|
4022
4022
|
const a = e[n] * s, i = t[r][n], l = Math.floor(a / i);
|
|
@@ -4024,7 +4024,7 @@ function Jn(t, e) {
|
|
|
4024
4024
|
}
|
|
4025
4025
|
return r;
|
|
4026
4026
|
}, null), At.reduce((n, r) => {
|
|
4027
|
-
if (
|
|
4027
|
+
if (z(e[r]))
|
|
4028
4028
|
return n;
|
|
4029
4029
|
if (n) {
|
|
4030
4030
|
const a = e[n] % 1;
|
|
@@ -4046,7 +4046,7 @@ class Q {
|
|
|
4046
4046
|
constructor(e) {
|
|
4047
4047
|
const s = e.conversionAccuracy === "longterm" || !1;
|
|
4048
4048
|
let n = s ? Il : kl;
|
|
4049
|
-
e.matrix && (n = e.matrix), this.values = e.values, this.loc = e.loc ||
|
|
4049
|
+
e.matrix && (n = e.matrix), this.values = e.values, this.loc = e.loc || re.create(), this.conversionAccuracy = s ? "longterm" : "casual", this.invalid = e.invalid || null, this.matrix = n, this.isLuxonDuration = !0;
|
|
4050
4050
|
}
|
|
4051
4051
|
/**
|
|
4052
4052
|
* Create Duration from a number of milliseconds.
|
|
@@ -4082,12 +4082,12 @@ class Q {
|
|
|
4082
4082
|
*/
|
|
4083
4083
|
static fromObject(e, s = {}) {
|
|
4084
4084
|
if (e == null || typeof e != "object")
|
|
4085
|
-
throw new
|
|
4085
|
+
throw new Ie(
|
|
4086
4086
|
`Duration.fromObject: argument expected to be an object, got ${e === null ? "null" : typeof e}`
|
|
4087
4087
|
);
|
|
4088
4088
|
return new Q({
|
|
4089
4089
|
values: ws(e, Q.normalizeUnit),
|
|
4090
|
-
loc:
|
|
4090
|
+
loc: re.fromObject(s),
|
|
4091
4091
|
conversionAccuracy: s.conversionAccuracy,
|
|
4092
4092
|
matrix: s.matrix
|
|
4093
4093
|
});
|
|
@@ -4109,7 +4109,7 @@ class Q {
|
|
|
4109
4109
|
return e;
|
|
4110
4110
|
if (typeof e == "object")
|
|
4111
4111
|
return Q.fromObject(e);
|
|
4112
|
-
throw new
|
|
4112
|
+
throw new Ie(
|
|
4113
4113
|
`Unknown duration argument ${e} of type ${typeof e}`
|
|
4114
4114
|
);
|
|
4115
4115
|
}
|
|
@@ -4159,7 +4159,7 @@ class Q {
|
|
|
4159
4159
|
*/
|
|
4160
4160
|
static invalid(e, s = null) {
|
|
4161
4161
|
if (!e)
|
|
4162
|
-
throw new
|
|
4162
|
+
throw new Ie("need to specify a reason the Duration is invalid");
|
|
4163
4163
|
const n = e instanceof Xe ? e : new Xe(e, s);
|
|
4164
4164
|
if (pe.throwOnInvalid)
|
|
4165
4165
|
throw new Qi(n);
|
|
@@ -4246,7 +4246,7 @@ class Q {
|
|
|
4246
4246
|
...s,
|
|
4247
4247
|
floor: s.round !== !1 && s.floor !== !1
|
|
4248
4248
|
};
|
|
4249
|
-
return this.isValid ?
|
|
4249
|
+
return this.isValid ? xe.create(this.loc, n).formatDurationFromString(this, e) : _n;
|
|
4250
4250
|
}
|
|
4251
4251
|
/**
|
|
4252
4252
|
* Returns a string representation of a Duration with all units included.
|
|
@@ -4268,7 +4268,7 @@ class Q {
|
|
|
4268
4268
|
if (!this.isValid) return _n;
|
|
4269
4269
|
const s = e.showZeros !== !1, n = At.map((r) => {
|
|
4270
4270
|
const a = this.values[r];
|
|
4271
|
-
return
|
|
4271
|
+
return z(a) || a === 0 && !s ? null : this.loc.numberFormatter({ style: "unit", unitDisplay: "long", ...e, unit: r.slice(0, -1) }).format(a);
|
|
4272
4272
|
}).filter((r) => r);
|
|
4273
4273
|
return this.loc.listFormatter({ type: "conjunction", style: e.listStyle || "narrow", ...e }).format(n);
|
|
4274
4274
|
}
|
|
@@ -4321,7 +4321,7 @@ class Q {
|
|
|
4321
4321
|
format: "extended",
|
|
4322
4322
|
...e,
|
|
4323
4323
|
includeOffset: !1
|
|
4324
|
-
},
|
|
4324
|
+
}, B.fromMillis(s, { zone: "UTC" }).toISOTime(e));
|
|
4325
4325
|
}
|
|
4326
4326
|
/**
|
|
4327
4327
|
* Returns an ISO 8601 representation of this Duration appropriate for use in JSON.
|
|
@@ -4367,7 +4367,7 @@ class Q {
|
|
|
4367
4367
|
if (!this.isValid) return this;
|
|
4368
4368
|
const s = Q.fromDurationLike(e), n = {};
|
|
4369
4369
|
for (const r of At)
|
|
4370
|
-
(
|
|
4370
|
+
(Ut(s.values, r) || Ut(this.values, r)) && (n[r] = s.get(r) + this.get(r));
|
|
4371
4371
|
return at(this, { values: n }, !0);
|
|
4372
4372
|
}
|
|
4373
4373
|
/**
|
|
@@ -4635,7 +4635,7 @@ class Q {
|
|
|
4635
4635
|
return !0;
|
|
4636
4636
|
}
|
|
4637
4637
|
}
|
|
4638
|
-
const
|
|
4638
|
+
const xt = "Invalid Interval";
|
|
4639
4639
|
function Ol(t, e) {
|
|
4640
4640
|
return !t || !t.isValid ? ye.invalid("missing or invalid start") : !e || !e.isValid ? ye.invalid("missing or invalid end") : e < t ? ye.invalid(
|
|
4641
4641
|
"end before start",
|
|
@@ -4657,7 +4657,7 @@ class ye {
|
|
|
4657
4657
|
*/
|
|
4658
4658
|
static invalid(e, s = null) {
|
|
4659
4659
|
if (!e)
|
|
4660
|
-
throw new
|
|
4660
|
+
throw new Ie("need to specify a reason the Interval is invalid");
|
|
4661
4661
|
const n = e instanceof Xe ? e : new Xe(e, s);
|
|
4662
4662
|
if (pe.throwOnInvalid)
|
|
4663
4663
|
throw new Ki(n);
|
|
@@ -4670,7 +4670,7 @@ class ye {
|
|
|
4670
4670
|
* @return {Interval}
|
|
4671
4671
|
*/
|
|
4672
4672
|
static fromDateTimes(e, s) {
|
|
4673
|
-
const n =
|
|
4673
|
+
const n = Vt(e), r = Vt(s), a = Ol(n, r);
|
|
4674
4674
|
return a ?? new ye({
|
|
4675
4675
|
start: n,
|
|
4676
4676
|
end: r
|
|
@@ -4683,7 +4683,7 @@ class ye {
|
|
|
4683
4683
|
* @return {Interval}
|
|
4684
4684
|
*/
|
|
4685
4685
|
static after(e, s) {
|
|
4686
|
-
const n = Q.fromDurationLike(s), r =
|
|
4686
|
+
const n = Q.fromDurationLike(s), r = Vt(e);
|
|
4687
4687
|
return ye.fromDateTimes(r, r.plus(n));
|
|
4688
4688
|
}
|
|
4689
4689
|
/**
|
|
@@ -4693,7 +4693,7 @@ class ye {
|
|
|
4693
4693
|
* @return {Interval}
|
|
4694
4694
|
*/
|
|
4695
4695
|
static before(e, s) {
|
|
4696
|
-
const n = Q.fromDurationLike(s), r =
|
|
4696
|
+
const n = Q.fromDurationLike(s), r = Vt(e);
|
|
4697
4697
|
return ye.fromDateTimes(r.minus(n), r);
|
|
4698
4698
|
}
|
|
4699
4699
|
/**
|
|
@@ -4709,13 +4709,13 @@ class ye {
|
|
|
4709
4709
|
if (n && r) {
|
|
4710
4710
|
let a, i;
|
|
4711
4711
|
try {
|
|
4712
|
-
a =
|
|
4712
|
+
a = B.fromISO(n, s), i = a.isValid;
|
|
4713
4713
|
} catch {
|
|
4714
4714
|
i = !1;
|
|
4715
4715
|
}
|
|
4716
4716
|
let l, o;
|
|
4717
4717
|
try {
|
|
4718
|
-
l =
|
|
4718
|
+
l = B.fromISO(r, s), o = l.isValid;
|
|
4719
4719
|
} catch {
|
|
4720
4720
|
o = !1;
|
|
4721
4721
|
}
|
|
@@ -4863,7 +4863,7 @@ class ye {
|
|
|
4863
4863
|
*/
|
|
4864
4864
|
splitAt(...e) {
|
|
4865
4865
|
if (!this.isValid) return [];
|
|
4866
|
-
const s = e.map(
|
|
4866
|
+
const s = e.map(Vt).filter((i) => this.contains(i)).sort((i, l) => i.toMillis() - l.toMillis()), n = [];
|
|
4867
4867
|
let { s: r } = this, a = 0;
|
|
4868
4868
|
for (; r < this.e; ) {
|
|
4869
4869
|
const i = s[a] || this.e, l = +i > +this.e ? this.e : i;
|
|
@@ -5004,7 +5004,7 @@ class ye {
|
|
|
5004
5004
|
* @return {string}
|
|
5005
5005
|
*/
|
|
5006
5006
|
toString() {
|
|
5007
|
-
return this.isValid ? `[${this.s.toISO()} – ${this.e.toISO()})` :
|
|
5007
|
+
return this.isValid ? `[${this.s.toISO()} – ${this.e.toISO()})` : xt;
|
|
5008
5008
|
}
|
|
5009
5009
|
/**
|
|
5010
5010
|
* Returns a string representation of this Interval appropriate for the REPL.
|
|
@@ -5032,7 +5032,7 @@ class ye {
|
|
|
5032
5032
|
* @return {string}
|
|
5033
5033
|
*/
|
|
5034
5034
|
toLocaleString(e = gs, s = {}) {
|
|
5035
|
-
return this.isValid ?
|
|
5035
|
+
return this.isValid ? xe.create(this.s.loc.clone(s), e).formatInterval(this) : xt;
|
|
5036
5036
|
}
|
|
5037
5037
|
/**
|
|
5038
5038
|
* Returns an ISO 8601-compliant string representation of this Interval.
|
|
@@ -5041,7 +5041,7 @@ class ye {
|
|
|
5041
5041
|
* @return {string}
|
|
5042
5042
|
*/
|
|
5043
5043
|
toISO(e) {
|
|
5044
|
-
return this.isValid ? `${this.s.toISO(e)}/${this.e.toISO(e)}` :
|
|
5044
|
+
return this.isValid ? `${this.s.toISO(e)}/${this.e.toISO(e)}` : xt;
|
|
5045
5045
|
}
|
|
5046
5046
|
/**
|
|
5047
5047
|
* Returns an ISO 8601-compliant string representation of date of this Interval.
|
|
@@ -5050,7 +5050,7 @@ class ye {
|
|
|
5050
5050
|
* @return {string}
|
|
5051
5051
|
*/
|
|
5052
5052
|
toISODate() {
|
|
5053
|
-
return this.isValid ? `${this.s.toISODate()}/${this.e.toISODate()}` :
|
|
5053
|
+
return this.isValid ? `${this.s.toISODate()}/${this.e.toISODate()}` : xt;
|
|
5054
5054
|
}
|
|
5055
5055
|
/**
|
|
5056
5056
|
* Returns an ISO 8601-compliant string representation of time of this Interval.
|
|
@@ -5060,7 +5060,7 @@ class ye {
|
|
|
5060
5060
|
* @return {string}
|
|
5061
5061
|
*/
|
|
5062
5062
|
toISOTime(e) {
|
|
5063
|
-
return this.isValid ? `${this.s.toISOTime(e)}/${this.e.toISOTime(e)}` :
|
|
5063
|
+
return this.isValid ? `${this.s.toISOTime(e)}/${this.e.toISOTime(e)}` : xt;
|
|
5064
5064
|
}
|
|
5065
5065
|
/**
|
|
5066
5066
|
* Returns a string representation of this Interval formatted according to the specified format
|
|
@@ -5074,7 +5074,7 @@ class ye {
|
|
|
5074
5074
|
* @return {string}
|
|
5075
5075
|
*/
|
|
5076
5076
|
toFormat(e, { separator: s = " – " } = {}) {
|
|
5077
|
-
return this.isValid ? `${this.s.toFormat(e)}${s}${this.e.toFormat(e)}` :
|
|
5077
|
+
return this.isValid ? `${this.s.toFormat(e)}${s}${this.e.toFormat(e)}` : xt;
|
|
5078
5078
|
}
|
|
5079
5079
|
/**
|
|
5080
5080
|
* Return a Duration representing the time spanned by this interval.
|
|
@@ -5109,7 +5109,7 @@ class os {
|
|
|
5109
5109
|
* @return {boolean}
|
|
5110
5110
|
*/
|
|
5111
5111
|
static hasDST(e = pe.defaultZone) {
|
|
5112
|
-
const s =
|
|
5112
|
+
const s = B.now().setZone(e).set({ month: 12 });
|
|
5113
5113
|
return !e.isUniversal && s.offset !== s.set({ month: 6 }).offset;
|
|
5114
5114
|
}
|
|
5115
5115
|
/**
|
|
@@ -5145,7 +5145,7 @@ class os {
|
|
|
5145
5145
|
* @returns {number} the start of the week, 1 for Monday through 7 for Sunday
|
|
5146
5146
|
*/
|
|
5147
5147
|
static getStartOfWeek({ locale: e = null, locObj: s = null } = {}) {
|
|
5148
|
-
return (s ||
|
|
5148
|
+
return (s || re.create(e)).getStartOfWeek();
|
|
5149
5149
|
}
|
|
5150
5150
|
/**
|
|
5151
5151
|
* Get the minimum number of days necessary in a week before it is considered part of the next year according
|
|
@@ -5156,7 +5156,7 @@ class os {
|
|
|
5156
5156
|
* @returns {number}
|
|
5157
5157
|
*/
|
|
5158
5158
|
static getMinimumDaysInFirstWeek({ locale: e = null, locObj: s = null } = {}) {
|
|
5159
|
-
return (s ||
|
|
5159
|
+
return (s || re.create(e)).getMinDaysInFirstWeek();
|
|
5160
5160
|
}
|
|
5161
5161
|
/**
|
|
5162
5162
|
* Get the weekdays, which are considered the weekend according to the given locale
|
|
@@ -5166,7 +5166,7 @@ class os {
|
|
|
5166
5166
|
* @returns {number[]} an array of weekdays, 1 for Monday through 7 for Sunday
|
|
5167
5167
|
*/
|
|
5168
5168
|
static getWeekendWeekdays({ locale: e = null, locObj: s = null } = {}) {
|
|
5169
|
-
return (s ||
|
|
5169
|
+
return (s || re.create(e)).getWeekendDays().slice();
|
|
5170
5170
|
}
|
|
5171
5171
|
/**
|
|
5172
5172
|
* Return an array of standalone month names.
|
|
@@ -5186,7 +5186,7 @@ class os {
|
|
|
5186
5186
|
* @return {Array}
|
|
5187
5187
|
*/
|
|
5188
5188
|
static months(e = "long", { locale: s = null, numberingSystem: n = null, locObj: r = null, outputCalendar: a = "gregory" } = {}) {
|
|
5189
|
-
return (r ||
|
|
5189
|
+
return (r || re.create(s, n, a)).months(e);
|
|
5190
5190
|
}
|
|
5191
5191
|
/**
|
|
5192
5192
|
* Return an array of format month names.
|
|
@@ -5202,7 +5202,7 @@ class os {
|
|
|
5202
5202
|
* @return {Array}
|
|
5203
5203
|
*/
|
|
5204
5204
|
static monthsFormat(e = "long", { locale: s = null, numberingSystem: n = null, locObj: r = null, outputCalendar: a = "gregory" } = {}) {
|
|
5205
|
-
return (r ||
|
|
5205
|
+
return (r || re.create(s, n, a)).months(e, !0);
|
|
5206
5206
|
}
|
|
5207
5207
|
/**
|
|
5208
5208
|
* Return an array of standalone week names.
|
|
@@ -5219,7 +5219,7 @@ class os {
|
|
|
5219
5219
|
* @return {Array}
|
|
5220
5220
|
*/
|
|
5221
5221
|
static weekdays(e = "long", { locale: s = null, numberingSystem: n = null, locObj: r = null } = {}) {
|
|
5222
|
-
return (r ||
|
|
5222
|
+
return (r || re.create(s, n, null)).weekdays(e);
|
|
5223
5223
|
}
|
|
5224
5224
|
/**
|
|
5225
5225
|
* Return an array of format week names.
|
|
@@ -5234,7 +5234,7 @@ class os {
|
|
|
5234
5234
|
* @return {Array}
|
|
5235
5235
|
*/
|
|
5236
5236
|
static weekdaysFormat(e = "long", { locale: s = null, numberingSystem: n = null, locObj: r = null } = {}) {
|
|
5237
|
-
return (r ||
|
|
5237
|
+
return (r || re.create(s, n, null)).weekdays(e, !0);
|
|
5238
5238
|
}
|
|
5239
5239
|
/**
|
|
5240
5240
|
* Return an array of meridiems.
|
|
@@ -5245,7 +5245,7 @@ class os {
|
|
|
5245
5245
|
* @return {Array}
|
|
5246
5246
|
*/
|
|
5247
5247
|
static meridiems({ locale: e = null } = {}) {
|
|
5248
|
-
return
|
|
5248
|
+
return re.create(e).meridiems();
|
|
5249
5249
|
}
|
|
5250
5250
|
/**
|
|
5251
5251
|
* Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian.
|
|
@@ -5258,7 +5258,7 @@ class os {
|
|
|
5258
5258
|
* @return {Array}
|
|
5259
5259
|
*/
|
|
5260
5260
|
static eras(e = "short", { locale: s = null } = {}) {
|
|
5261
|
-
return
|
|
5261
|
+
return re.create(s, null, "gregory").eras(e);
|
|
5262
5262
|
}
|
|
5263
5263
|
/**
|
|
5264
5264
|
* Return the set of available features in this environment.
|
|
@@ -5306,7 +5306,7 @@ function Ml(t, e, s, n) {
|
|
|
5306
5306
|
return u.length > 0 ? Q.fromMillis(o, n).shiftTo(...u).plus(d) : d;
|
|
5307
5307
|
}
|
|
5308
5308
|
const Dl = "missing Intl.DateTimeFormat.formatToParts support";
|
|
5309
|
-
function
|
|
5309
|
+
function ee(t, e = (s) => s) {
|
|
5310
5310
|
return { regex: t, deser: ([s]) => e(Ao(s)) };
|
|
5311
5311
|
}
|
|
5312
5312
|
const Cl = " ", Sa = `[ ${Cl}]`, va = new RegExp(Sa, "g");
|
|
@@ -5332,10 +5332,10 @@ function Ul(t) {
|
|
|
5332
5332
|
return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
|
|
5333
5333
|
}
|
|
5334
5334
|
function Ll(t, e) {
|
|
5335
|
-
const s = Ke(e), n = Ke(e, "{2}"), r = Ke(e, "{3}"), a = Ke(e, "{4}"), i = Ke(e, "{6}"), l = Ke(e, "{1,2}"), o = Ke(e, "{1,3}"), u = Ke(e, "{1,6}"), d = Ke(e, "{1,9}"), m = Ke(e, "{2,4}"), S = Ke(e, "{4,6}"), p = (
|
|
5335
|
+
const s = Ke(e), n = Ke(e, "{2}"), r = Ke(e, "{3}"), a = Ke(e, "{4}"), i = Ke(e, "{6}"), l = Ke(e, "{1,2}"), o = Ke(e, "{1,3}"), u = Ke(e, "{1,6}"), d = Ke(e, "{1,9}"), m = Ke(e, "{2,4}"), S = Ke(e, "{4,6}"), p = (C) => ({ regex: RegExp(Ul(C.val)), deser: ([Y]) => Y, literal: !0 }), D = ((C) => {
|
|
5336
5336
|
if (t.literal)
|
|
5337
|
-
return p(
|
|
5338
|
-
switch (
|
|
5337
|
+
return p(C);
|
|
5338
|
+
switch (C.val) {
|
|
5339
5339
|
// era
|
|
5340
5340
|
case "G":
|
|
5341
5341
|
return Qe(e.eras("short"), 0);
|
|
@@ -5343,90 +5343,90 @@ function Ll(t, e) {
|
|
|
5343
5343
|
return Qe(e.eras("long"), 0);
|
|
5344
5344
|
// years
|
|
5345
5345
|
case "y":
|
|
5346
|
-
return
|
|
5346
|
+
return ee(u);
|
|
5347
5347
|
case "yy":
|
|
5348
|
-
return
|
|
5348
|
+
return ee(m, nn);
|
|
5349
5349
|
case "yyyy":
|
|
5350
|
-
return
|
|
5350
|
+
return ee(a);
|
|
5351
5351
|
case "yyyyy":
|
|
5352
|
-
return
|
|
5352
|
+
return ee(S);
|
|
5353
5353
|
case "yyyyyy":
|
|
5354
|
-
return
|
|
5354
|
+
return ee(i);
|
|
5355
5355
|
// months
|
|
5356
5356
|
case "M":
|
|
5357
|
-
return
|
|
5357
|
+
return ee(l);
|
|
5358
5358
|
case "MM":
|
|
5359
|
-
return
|
|
5359
|
+
return ee(n);
|
|
5360
5360
|
case "MMM":
|
|
5361
5361
|
return Qe(e.months("short", !0), 1);
|
|
5362
5362
|
case "MMMM":
|
|
5363
5363
|
return Qe(e.months("long", !0), 1);
|
|
5364
5364
|
case "L":
|
|
5365
|
-
return
|
|
5365
|
+
return ee(l);
|
|
5366
5366
|
case "LL":
|
|
5367
|
-
return
|
|
5367
|
+
return ee(n);
|
|
5368
5368
|
case "LLL":
|
|
5369
5369
|
return Qe(e.months("short", !1), 1);
|
|
5370
5370
|
case "LLLL":
|
|
5371
5371
|
return Qe(e.months("long", !1), 1);
|
|
5372
5372
|
// dates
|
|
5373
5373
|
case "d":
|
|
5374
|
-
return
|
|
5374
|
+
return ee(l);
|
|
5375
5375
|
case "dd":
|
|
5376
|
-
return
|
|
5376
|
+
return ee(n);
|
|
5377
5377
|
// ordinals
|
|
5378
5378
|
case "o":
|
|
5379
|
-
return
|
|
5379
|
+
return ee(o);
|
|
5380
5380
|
case "ooo":
|
|
5381
|
-
return
|
|
5381
|
+
return ee(r);
|
|
5382
5382
|
// time
|
|
5383
5383
|
case "HH":
|
|
5384
|
-
return
|
|
5384
|
+
return ee(n);
|
|
5385
5385
|
case "H":
|
|
5386
|
-
return
|
|
5386
|
+
return ee(l);
|
|
5387
5387
|
case "hh":
|
|
5388
|
-
return
|
|
5388
|
+
return ee(n);
|
|
5389
5389
|
case "h":
|
|
5390
|
-
return
|
|
5390
|
+
return ee(l);
|
|
5391
5391
|
case "mm":
|
|
5392
|
-
return
|
|
5392
|
+
return ee(n);
|
|
5393
5393
|
case "m":
|
|
5394
|
-
return
|
|
5394
|
+
return ee(l);
|
|
5395
5395
|
case "q":
|
|
5396
|
-
return
|
|
5396
|
+
return ee(l);
|
|
5397
5397
|
case "qq":
|
|
5398
|
-
return
|
|
5398
|
+
return ee(n);
|
|
5399
5399
|
case "s":
|
|
5400
|
-
return
|
|
5400
|
+
return ee(l);
|
|
5401
5401
|
case "ss":
|
|
5402
|
-
return
|
|
5402
|
+
return ee(n);
|
|
5403
5403
|
case "S":
|
|
5404
|
-
return
|
|
5404
|
+
return ee(o);
|
|
5405
5405
|
case "SSS":
|
|
5406
|
-
return
|
|
5406
|
+
return ee(r);
|
|
5407
5407
|
case "u":
|
|
5408
5408
|
return ls(d);
|
|
5409
5409
|
case "uu":
|
|
5410
5410
|
return ls(l);
|
|
5411
5411
|
case "uuu":
|
|
5412
|
-
return
|
|
5412
|
+
return ee(s);
|
|
5413
5413
|
// meridiem
|
|
5414
5414
|
case "a":
|
|
5415
5415
|
return Qe(e.meridiems(), 0);
|
|
5416
5416
|
// weekYear (k)
|
|
5417
5417
|
case "kkkk":
|
|
5418
|
-
return
|
|
5418
|
+
return ee(a);
|
|
5419
5419
|
case "kk":
|
|
5420
|
-
return
|
|
5420
|
+
return ee(m, nn);
|
|
5421
5421
|
// weekNumber (W)
|
|
5422
5422
|
case "W":
|
|
5423
|
-
return
|
|
5423
|
+
return ee(l);
|
|
5424
5424
|
case "WW":
|
|
5425
|
-
return
|
|
5425
|
+
return ee(n);
|
|
5426
5426
|
// weekdays
|
|
5427
5427
|
case "E":
|
|
5428
5428
|
case "c":
|
|
5429
|
-
return
|
|
5429
|
+
return ee(s);
|
|
5430
5430
|
case "EEE":
|
|
5431
5431
|
return Qe(e.weekdays("short", !1), 1);
|
|
5432
5432
|
case "EEEE":
|
|
@@ -5450,12 +5450,12 @@ function Ll(t, e) {
|
|
|
5450
5450
|
case " ":
|
|
5451
5451
|
return ls(/[^\S\n\r]/);
|
|
5452
5452
|
default:
|
|
5453
|
-
return p(
|
|
5453
|
+
return p(C);
|
|
5454
5454
|
}
|
|
5455
5455
|
})(t) || {
|
|
5456
5456
|
invalidReason: Dl
|
|
5457
5457
|
};
|
|
5458
|
-
return
|
|
5458
|
+
return D.token = t, D;
|
|
5459
5459
|
}
|
|
5460
5460
|
const Fl = {
|
|
5461
5461
|
year: {
|
|
@@ -5527,7 +5527,7 @@ function Wl(t, e, s) {
|
|
|
5527
5527
|
const r = {};
|
|
5528
5528
|
let a = 1;
|
|
5529
5529
|
for (const i in s)
|
|
5530
|
-
if (
|
|
5530
|
+
if (Ut(s, i)) {
|
|
5531
5531
|
const l = s[i], o = l.groups ? l.groups + 1 : 1;
|
|
5532
5532
|
!l.literal && l.token && (r[l.token.val[0]] = l.deser(n.slice(a, a + o))), a += o;
|
|
5533
5533
|
}
|
|
@@ -5570,19 +5570,19 @@ function Vl(t) {
|
|
|
5570
5570
|
}
|
|
5571
5571
|
};
|
|
5572
5572
|
let s = null, n;
|
|
5573
|
-
return
|
|
5573
|
+
return z(t.z) || (s = ot.create(t.z)), z(t.Z) || (s || (s = new De(t.Z)), n = t.Z), z(t.q) || (t.M = (t.q - 1) * 3 + 1), z(t.h) || (t.h < 12 && t.a === 1 ? t.h += 12 : t.h === 12 && t.a === 0 && (t.h = 0)), t.G === 0 && t.y && (t.y = -t.y), z(t.u) || (t.S = yn(t.u)), [Object.keys(t).reduce((a, i) => {
|
|
5574
5574
|
const l = e(i);
|
|
5575
5575
|
return l && (a[l] = t[i]), a;
|
|
5576
5576
|
}, {}), s, n];
|
|
5577
5577
|
}
|
|
5578
5578
|
let Ws = null;
|
|
5579
5579
|
function Zl() {
|
|
5580
|
-
return Ws || (Ws =
|
|
5580
|
+
return Ws || (Ws = B.fromMillis(1555555555555)), Ws;
|
|
5581
5581
|
}
|
|
5582
5582
|
function Bl(t, e) {
|
|
5583
5583
|
if (t.literal)
|
|
5584
5584
|
return t;
|
|
5585
|
-
const s =
|
|
5585
|
+
const s = xe.macroTokenToFormatOpts(t.val), n = Na(s, e);
|
|
5586
5586
|
return n == null || n.includes(void 0) ? t : n;
|
|
5587
5587
|
}
|
|
5588
5588
|
function wa(t, e) {
|
|
@@ -5590,7 +5590,7 @@ function wa(t, e) {
|
|
|
5590
5590
|
}
|
|
5591
5591
|
class Aa {
|
|
5592
5592
|
constructor(e, s) {
|
|
5593
|
-
if (this.locale = e, this.format = s, this.tokens = wa(
|
|
5593
|
+
if (this.locale = e, this.format = s, this.tokens = wa(xe.parseFormat(s), e), this.units = this.tokens.map((n) => Ll(n, e)), this.disqualifyingUnit = this.units.find((n) => n.invalidReason), !this.disqualifyingUnit) {
|
|
5594
5594
|
const [n, r] = Pl(this.units);
|
|
5595
5595
|
this.regex = RegExp(n, "i"), this.handlers = r;
|
|
5596
5596
|
}
|
|
@@ -5598,8 +5598,8 @@ class Aa {
|
|
|
5598
5598
|
explainFromTokens(e) {
|
|
5599
5599
|
if (this.isValid) {
|
|
5600
5600
|
const [s, n] = Wl(e, this.regex, this.handlers), [r, a, i] = n ? Vl(n) : [null, null, void 0];
|
|
5601
|
-
if (
|
|
5602
|
-
throw new
|
|
5601
|
+
if (Ut(n, "a") && Ut(n, "H"))
|
|
5602
|
+
throw new Mt(
|
|
5603
5603
|
"Can't include meridiem when specifying 24-hour format"
|
|
5604
5604
|
);
|
|
5605
5605
|
return {
|
|
@@ -5632,11 +5632,11 @@ function zl(t, e, s) {
|
|
|
5632
5632
|
function Na(t, e) {
|
|
5633
5633
|
if (!t)
|
|
5634
5634
|
return null;
|
|
5635
|
-
const n =
|
|
5635
|
+
const n = xe.create(e, t).dtFormatter(Zl()), r = n.formatToParts(), a = n.resolvedOptions();
|
|
5636
5636
|
return r.map((i) => $l(i, t, a));
|
|
5637
5637
|
}
|
|
5638
5638
|
const Vs = "Invalid DateTime", tr = 864e13;
|
|
5639
|
-
function
|
|
5639
|
+
function Ht(t) {
|
|
5640
5640
|
return new Xe("unsupported zone", `the zone "${t.name}" is not supported`);
|
|
5641
5641
|
}
|
|
5642
5642
|
function Zs(t) {
|
|
@@ -5658,7 +5658,7 @@ function wt(t, e) {
|
|
|
5658
5658
|
loc: t.loc,
|
|
5659
5659
|
invalid: t.invalid
|
|
5660
5660
|
};
|
|
5661
|
-
return new
|
|
5661
|
+
return new B({ ...s, ...e, old: s });
|
|
5662
5662
|
}
|
|
5663
5663
|
function ba(t, e, s) {
|
|
5664
5664
|
let n = t - e * 60 * 1e3;
|
|
@@ -5705,22 +5705,22 @@ function sr(t, e) {
|
|
|
5705
5705
|
let [o, u] = ba(l, s, t.zone);
|
|
5706
5706
|
return i !== 0 && (o += i, u = t.zone.offset(o)), { ts: o, o: u };
|
|
5707
5707
|
}
|
|
5708
|
-
function
|
|
5708
|
+
function Ot(t, e, s, n, r, a) {
|
|
5709
5709
|
const { setZone: i, zone: l } = s;
|
|
5710
5710
|
if (t && Object.keys(t).length !== 0 || e) {
|
|
5711
|
-
const o = e || l, u =
|
|
5711
|
+
const o = e || l, u = B.fromObject(t, {
|
|
5712
5712
|
...s,
|
|
5713
5713
|
zone: o,
|
|
5714
5714
|
specificOffset: a
|
|
5715
5715
|
});
|
|
5716
5716
|
return i ? u : u.setZone(l);
|
|
5717
5717
|
} else
|
|
5718
|
-
return
|
|
5718
|
+
return B.invalid(
|
|
5719
5719
|
new Xe("unparsable", `the input "${r}" can't be parsed as ${n}`)
|
|
5720
5720
|
);
|
|
5721
5721
|
}
|
|
5722
5722
|
function us(t, e, s = !0) {
|
|
5723
|
-
return t.isValid ?
|
|
5723
|
+
return t.isValid ? xe.create(re.create("en-US"), {
|
|
5724
5724
|
allowZ: s,
|
|
5725
5725
|
forceSimple: !0
|
|
5726
5726
|
}).formatDateTimeFromString(t, e) : null;
|
|
@@ -5831,33 +5831,33 @@ function rr(t) {
|
|
|
5831
5831
|
}
|
|
5832
5832
|
}
|
|
5833
5833
|
function jl(t) {
|
|
5834
|
-
if (
|
|
5835
|
-
return t.offset(
|
|
5834
|
+
if (Gt === void 0 && (Gt = pe.now()), t.type !== "iana")
|
|
5835
|
+
return t.offset(Gt);
|
|
5836
5836
|
const e = t.name;
|
|
5837
5837
|
let s = rn.get(e);
|
|
5838
|
-
return s === void 0 && (s = t.offset(
|
|
5838
|
+
return s === void 0 && (s = t.offset(Gt), rn.set(e, s)), s;
|
|
5839
5839
|
}
|
|
5840
5840
|
function ar(t, e) {
|
|
5841
5841
|
const s = ft(e.zone, pe.defaultZone);
|
|
5842
5842
|
if (!s.isValid)
|
|
5843
|
-
return
|
|
5844
|
-
const n =
|
|
5843
|
+
return B.invalid(Ht(s));
|
|
5844
|
+
const n = re.fromObject(e);
|
|
5845
5845
|
let r, a;
|
|
5846
|
-
if (
|
|
5846
|
+
if (z(t.year))
|
|
5847
5847
|
r = pe.now();
|
|
5848
5848
|
else {
|
|
5849
5849
|
for (const o of hs)
|
|
5850
|
-
|
|
5850
|
+
z(t[o]) && (t[o] = ka[o]);
|
|
5851
5851
|
const i = Kr(t) || Qr(t);
|
|
5852
5852
|
if (i)
|
|
5853
|
-
return
|
|
5853
|
+
return B.invalid(i);
|
|
5854
5854
|
const l = jl(s);
|
|
5855
5855
|
[r, a] = fs(t, l, s);
|
|
5856
5856
|
}
|
|
5857
|
-
return new
|
|
5857
|
+
return new B({ ts: r, zone: s, loc: n, o: a });
|
|
5858
5858
|
}
|
|
5859
5859
|
function ir(t, e, s) {
|
|
5860
|
-
const n =
|
|
5860
|
+
const n = z(s.round) ? !0 : s.round, r = z(s.rounding) ? "trunc" : s.rounding, a = (l, o) => (l = pn(l, n || s.calendary ? 0 : 2, s.calendary ? "round" : r), e.loc.clone(s).relFormatter(s).format(l, o)), i = (l) => s.calendary ? e.hasSame(t, l) ? 0 : e.startOf(l).diff(t.startOf(l), l).get(l) : e.diff(t, l).get(l);
|
|
5861
5861
|
if (s.unit)
|
|
5862
5862
|
return a(i(s.unit), s.unit);
|
|
5863
5863
|
for (const l of s.units) {
|
|
@@ -5871,16 +5871,16 @@ function or(t) {
|
|
|
5871
5871
|
let e = {}, s;
|
|
5872
5872
|
return t.length > 0 && typeof t[t.length - 1] == "object" ? (e = t[t.length - 1], s = Array.from(t).slice(0, t.length - 1)) : s = Array.from(t), [e, s];
|
|
5873
5873
|
}
|
|
5874
|
-
let
|
|
5874
|
+
let Gt;
|
|
5875
5875
|
const rn = /* @__PURE__ */ new Map();
|
|
5876
|
-
class
|
|
5876
|
+
class B {
|
|
5877
5877
|
/**
|
|
5878
5878
|
* @access private
|
|
5879
5879
|
*/
|
|
5880
5880
|
constructor(e) {
|
|
5881
5881
|
const s = e.zone || pe.defaultZone;
|
|
5882
|
-
let n = e.invalid || (Number.isNaN(e.ts) ? new Xe("invalid input") : null) || (s.isValid ? null :
|
|
5883
|
-
this.ts =
|
|
5882
|
+
let n = e.invalid || (Number.isNaN(e.ts) ? new Xe("invalid input") : null) || (s.isValid ? null : Ht(s));
|
|
5883
|
+
this.ts = z(e.ts) ? pe.now() : e.ts;
|
|
5884
5884
|
let r = null, a = null;
|
|
5885
5885
|
if (!n)
|
|
5886
5886
|
if (e.old && e.old.ts === this.ts && e.old.zone.equals(s))
|
|
@@ -5889,7 +5889,7 @@ class Z {
|
|
|
5889
5889
|
const l = ht(e.o) && !e.old ? e.o : s.offset(this.ts);
|
|
5890
5890
|
r = cs(this.ts, l), n = Number.isNaN(r.year) ? new Xe("invalid input") : null, r = n ? null : r, a = n ? null : l;
|
|
5891
5891
|
}
|
|
5892
|
-
this._zone = s, this.loc = e.loc ||
|
|
5892
|
+
this._zone = s, this.loc = e.loc || re.create(), this.invalid = n, this.weekData = null, this.localWeekData = null, this.c = r, this.o = a, this.isLuxonDateTime = !0;
|
|
5893
5893
|
}
|
|
5894
5894
|
// CONSTRUCT
|
|
5895
5895
|
/**
|
|
@@ -5900,7 +5900,7 @@ class Z {
|
|
|
5900
5900
|
* @return {DateTime}
|
|
5901
5901
|
*/
|
|
5902
5902
|
static now() {
|
|
5903
|
-
return new
|
|
5903
|
+
return new B({});
|
|
5904
5904
|
}
|
|
5905
5905
|
/**
|
|
5906
5906
|
* Create a local DateTime
|
|
@@ -5954,7 +5954,7 @@ class Z {
|
|
|
5954
5954
|
*/
|
|
5955
5955
|
static utc() {
|
|
5956
5956
|
const [e, s] = or(arguments), [n, r, a, i, l, o, u] = s;
|
|
5957
|
-
return e.zone =
|
|
5957
|
+
return e.zone = De.utcInstance, ar({ year: n, month: r, day: a, hour: i, minute: l, second: o, millisecond: u }, e);
|
|
5958
5958
|
}
|
|
5959
5959
|
/**
|
|
5960
5960
|
* Create a DateTime from a JavaScript Date object. Uses the default zone.
|
|
@@ -5966,13 +5966,13 @@ class Z {
|
|
|
5966
5966
|
static fromJSDate(e, s = {}) {
|
|
5967
5967
|
const n = Io(e) ? e.valueOf() : NaN;
|
|
5968
5968
|
if (Number.isNaN(n))
|
|
5969
|
-
return
|
|
5969
|
+
return B.invalid("invalid input");
|
|
5970
5970
|
const r = ft(s.zone, pe.defaultZone);
|
|
5971
|
-
return r.isValid ? new
|
|
5971
|
+
return r.isValid ? new B({
|
|
5972
5972
|
ts: n,
|
|
5973
5973
|
zone: r,
|
|
5974
|
-
loc:
|
|
5975
|
-
}) :
|
|
5974
|
+
loc: re.fromObject(s)
|
|
5975
|
+
}) : B.invalid(Ht(r));
|
|
5976
5976
|
}
|
|
5977
5977
|
/**
|
|
5978
5978
|
* Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.
|
|
@@ -5987,12 +5987,12 @@ class Z {
|
|
|
5987
5987
|
*/
|
|
5988
5988
|
static fromMillis(e, s = {}) {
|
|
5989
5989
|
if (ht(e))
|
|
5990
|
-
return e < -tr || e > tr ?
|
|
5990
|
+
return e < -tr || e > tr ? B.invalid("Timestamp out of range") : new B({
|
|
5991
5991
|
ts: e,
|
|
5992
5992
|
zone: ft(s.zone, pe.defaultZone),
|
|
5993
|
-
loc:
|
|
5993
|
+
loc: re.fromObject(s)
|
|
5994
5994
|
});
|
|
5995
|
-
throw new
|
|
5995
|
+
throw new Ie(
|
|
5996
5996
|
`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`
|
|
5997
5997
|
);
|
|
5998
5998
|
}
|
|
@@ -6009,12 +6009,12 @@ class Z {
|
|
|
6009
6009
|
*/
|
|
6010
6010
|
static fromSeconds(e, s = {}) {
|
|
6011
6011
|
if (ht(e))
|
|
6012
|
-
return new
|
|
6012
|
+
return new B({
|
|
6013
6013
|
ts: e * 1e3,
|
|
6014
6014
|
zone: ft(s.zone, pe.defaultZone),
|
|
6015
|
-
loc:
|
|
6015
|
+
loc: re.fromObject(s)
|
|
6016
6016
|
});
|
|
6017
|
-
throw new
|
|
6017
|
+
throw new Ie("fromSeconds requires a numerical input");
|
|
6018
6018
|
}
|
|
6019
6019
|
/**
|
|
6020
6020
|
* Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults.
|
|
@@ -6053,35 +6053,35 @@ class Z {
|
|
|
6053
6053
|
e = e || {};
|
|
6054
6054
|
const n = ft(s.zone, pe.defaultZone);
|
|
6055
6055
|
if (!n.isValid)
|
|
6056
|
-
return
|
|
6057
|
-
const r =
|
|
6056
|
+
return B.invalid(Ht(n));
|
|
6057
|
+
const r = re.fromObject(s), a = ws(e, rr), { minDaysInFirstWeek: i, startOfWeek: l } = Hn(a, r), o = pe.now(), u = z(s.specificOffset) ? n.offset(o) : s.specificOffset, d = !z(a.ordinal), m = !z(a.year), S = !z(a.month) || !z(a.day), p = m || S, k = a.weekYear || a.weekNumber;
|
|
6058
6058
|
if ((p || d) && k)
|
|
6059
|
-
throw new
|
|
6059
|
+
throw new Mt(
|
|
6060
6060
|
"Can't mix weekYear/weekNumber units with year/month/day or ordinals"
|
|
6061
6061
|
);
|
|
6062
6062
|
if (S && d)
|
|
6063
|
-
throw new
|
|
6064
|
-
const
|
|
6065
|
-
let
|
|
6066
|
-
|
|
6063
|
+
throw new Mt("Can't mix ordinal dates with month/day");
|
|
6064
|
+
const D = k || a.weekday && !p;
|
|
6065
|
+
let C, Y, $ = cs(o, u);
|
|
6066
|
+
D ? (C = ql, Y = Hl, $ = Ss($, i, l)) : d ? (C = Yl, Y = Gl, $ = Ps($)) : (C = hs, Y = ka);
|
|
6067
6067
|
let W = !1;
|
|
6068
|
-
for (const v of
|
|
6069
|
-
const
|
|
6070
|
-
|
|
6068
|
+
for (const v of C) {
|
|
6069
|
+
const M = a[v];
|
|
6070
|
+
z(M) ? W ? a[v] = Y[v] : a[v] = $[v] : W = !0;
|
|
6071
6071
|
}
|
|
6072
|
-
const N =
|
|
6073
|
-
if (
|
|
6074
|
-
return
|
|
6075
|
-
const
|
|
6076
|
-
ts:
|
|
6072
|
+
const N = D ? No(a, i, l) : d ? bo(a) : Kr(a), E = N || Qr(a);
|
|
6073
|
+
if (E)
|
|
6074
|
+
return B.invalid(E);
|
|
6075
|
+
const Z = D ? Bn(a, i, l) : d ? zn(a) : a, [R, q] = fs(Z, u, n), h = new B({
|
|
6076
|
+
ts: R,
|
|
6077
6077
|
zone: n,
|
|
6078
|
-
o:
|
|
6078
|
+
o: q,
|
|
6079
6079
|
loc: r
|
|
6080
6080
|
});
|
|
6081
|
-
return a.weekday && p && e.weekday !== h.weekday ?
|
|
6081
|
+
return a.weekday && p && e.weekday !== h.weekday ? B.invalid(
|
|
6082
6082
|
"mismatched weekday",
|
|
6083
6083
|
`you can't specify both a weekday of ${a.weekday} and a date of ${h.toISO()}`
|
|
6084
|
-
) : h.isValid ? h :
|
|
6084
|
+
) : h.isValid ? h : B.invalid(h.invalid);
|
|
6085
6085
|
}
|
|
6086
6086
|
/**
|
|
6087
6087
|
* Create a DateTime from an ISO 8601 string
|
|
@@ -6102,7 +6102,7 @@ class Z {
|
|
|
6102
6102
|
*/
|
|
6103
6103
|
static fromISO(e, s = {}) {
|
|
6104
6104
|
const [n, r] = yl(e);
|
|
6105
|
-
return
|
|
6105
|
+
return Ot(n, r, s, "ISO 8601", e);
|
|
6106
6106
|
}
|
|
6107
6107
|
/**
|
|
6108
6108
|
* Create a DateTime from an RFC 2822 string
|
|
@@ -6121,7 +6121,7 @@ class Z {
|
|
|
6121
6121
|
*/
|
|
6122
6122
|
static fromRFC2822(e, s = {}) {
|
|
6123
6123
|
const [n, r] = pl(e);
|
|
6124
|
-
return
|
|
6124
|
+
return Ot(n, r, s, "RFC 2822", e);
|
|
6125
6125
|
}
|
|
6126
6126
|
/**
|
|
6127
6127
|
* Create a DateTime from an HTTP header date
|
|
@@ -6141,7 +6141,7 @@ class Z {
|
|
|
6141
6141
|
*/
|
|
6142
6142
|
static fromHTTP(e, s = {}) {
|
|
6143
6143
|
const [n, r] = gl(e);
|
|
6144
|
-
return
|
|
6144
|
+
return Ot(n, r, s, "HTTP", s);
|
|
6145
6145
|
}
|
|
6146
6146
|
/**
|
|
6147
6147
|
* Create a DateTime from an input string and format string.
|
|
@@ -6158,20 +6158,20 @@ class Z {
|
|
|
6158
6158
|
* @return {DateTime}
|
|
6159
6159
|
*/
|
|
6160
6160
|
static fromFormat(e, s, n = {}) {
|
|
6161
|
-
if (
|
|
6162
|
-
throw new
|
|
6163
|
-
const { locale: r = null, numberingSystem: a = null } = n, i =
|
|
6161
|
+
if (z(e) || z(s))
|
|
6162
|
+
throw new Ie("fromFormat requires an input string and a format");
|
|
6163
|
+
const { locale: r = null, numberingSystem: a = null } = n, i = re.fromOpts({
|
|
6164
6164
|
locale: r,
|
|
6165
6165
|
numberingSystem: a,
|
|
6166
6166
|
defaultToEN: !0
|
|
6167
6167
|
}), [l, o, u, d] = zl(i, e, s);
|
|
6168
|
-
return d ?
|
|
6168
|
+
return d ? B.invalid(d) : Ot(l, o, n, `format ${s}`, e, u);
|
|
6169
6169
|
}
|
|
6170
6170
|
/**
|
|
6171
6171
|
* @deprecated use fromFormat instead
|
|
6172
6172
|
*/
|
|
6173
6173
|
static fromString(e, s, n = {}) {
|
|
6174
|
-
return
|
|
6174
|
+
return B.fromFormat(e, s, n);
|
|
6175
6175
|
}
|
|
6176
6176
|
/**
|
|
6177
6177
|
* Create a DateTime from a SQL date, time, or datetime
|
|
@@ -6196,7 +6196,7 @@ class Z {
|
|
|
6196
6196
|
*/
|
|
6197
6197
|
static fromSQL(e, s = {}) {
|
|
6198
6198
|
const [n, r] = bl(e);
|
|
6199
|
-
return
|
|
6199
|
+
return Ot(n, r, s, "SQL", e);
|
|
6200
6200
|
}
|
|
6201
6201
|
/**
|
|
6202
6202
|
* Create an invalid DateTime.
|
|
@@ -6206,11 +6206,11 @@ class Z {
|
|
|
6206
6206
|
*/
|
|
6207
6207
|
static invalid(e, s = null) {
|
|
6208
6208
|
if (!e)
|
|
6209
|
-
throw new
|
|
6209
|
+
throw new Ie("need to specify a reason the DateTime is invalid");
|
|
6210
6210
|
const n = e instanceof Xe ? e : new Xe(e, s);
|
|
6211
6211
|
if (pe.throwOnInvalid)
|
|
6212
6212
|
throw new Ji(n);
|
|
6213
|
-
return new
|
|
6213
|
+
return new B({ invalid: n });
|
|
6214
6214
|
}
|
|
6215
6215
|
/**
|
|
6216
6216
|
* Check if an object is an instance of DateTime. Works across context boundaries
|
|
@@ -6227,7 +6227,7 @@ class Z {
|
|
|
6227
6227
|
* @returns {string}
|
|
6228
6228
|
*/
|
|
6229
6229
|
static parseFormatForOpts(e, s = {}) {
|
|
6230
|
-
const n = Na(e,
|
|
6230
|
+
const n = Na(e, re.fromObject(s));
|
|
6231
6231
|
return n ? n.map((r) => r ? r.val : null).join("") : null;
|
|
6232
6232
|
}
|
|
6233
6233
|
/**
|
|
@@ -6238,10 +6238,10 @@ class Z {
|
|
|
6238
6238
|
* @returns {string}
|
|
6239
6239
|
*/
|
|
6240
6240
|
static expandFormat(e, s = {}) {
|
|
6241
|
-
return wa(
|
|
6241
|
+
return wa(xe.parseFormat(e), re.fromObject(s)).map((r) => r.val).join("");
|
|
6242
6242
|
}
|
|
6243
6243
|
static resetCache() {
|
|
6244
|
-
|
|
6244
|
+
Gt = void 0, rn.clear();
|
|
6245
6245
|
}
|
|
6246
6246
|
// INFO
|
|
6247
6247
|
/**
|
|
@@ -6552,7 +6552,7 @@ class Z {
|
|
|
6552
6552
|
* @type {boolean}
|
|
6553
6553
|
*/
|
|
6554
6554
|
get isInLeapYear() {
|
|
6555
|
-
return
|
|
6555
|
+
return Jt(this.year);
|
|
6556
6556
|
}
|
|
6557
6557
|
/**
|
|
6558
6558
|
* Returns the number of days in this DateTime's month
|
|
@@ -6570,7 +6570,7 @@ class Z {
|
|
|
6570
6570
|
* @type {number}
|
|
6571
6571
|
*/
|
|
6572
6572
|
get daysInYear() {
|
|
6573
|
-
return this.isValid ?
|
|
6573
|
+
return this.isValid ? Dt(this.year) : NaN;
|
|
6574
6574
|
}
|
|
6575
6575
|
/**
|
|
6576
6576
|
* Returns the number of weeks in this DateTime's year
|
|
@@ -6580,7 +6580,7 @@ class Z {
|
|
|
6580
6580
|
* @type {number}
|
|
6581
6581
|
*/
|
|
6582
6582
|
get weeksInWeekYear() {
|
|
6583
|
-
return this.isValid ?
|
|
6583
|
+
return this.isValid ? Yt(this.weekYear) : NaN;
|
|
6584
6584
|
}
|
|
6585
6585
|
/**
|
|
6586
6586
|
* Returns the number of weeks in this DateTime's local week year
|
|
@@ -6589,7 +6589,7 @@ class Z {
|
|
|
6589
6589
|
* @type {number}
|
|
6590
6590
|
*/
|
|
6591
6591
|
get weeksInLocalWeekYear() {
|
|
6592
|
-
return this.isValid ?
|
|
6592
|
+
return this.isValid ? Yt(
|
|
6593
6593
|
this.localWeekYear,
|
|
6594
6594
|
this.loc.getMinDaysInFirstWeek(),
|
|
6595
6595
|
this.loc.getStartOfWeek()
|
|
@@ -6602,7 +6602,7 @@ class Z {
|
|
|
6602
6602
|
* @return {Object}
|
|
6603
6603
|
*/
|
|
6604
6604
|
resolvedLocaleOptions(e = {}) {
|
|
6605
|
-
const { locale: s, numberingSystem: n, calendar: r } =
|
|
6605
|
+
const { locale: s, numberingSystem: n, calendar: r } = xe.create(
|
|
6606
6606
|
this.loc.clone(e),
|
|
6607
6607
|
e
|
|
6608
6608
|
).resolvedOptions(this);
|
|
@@ -6618,7 +6618,7 @@ class Z {
|
|
|
6618
6618
|
* @return {DateTime}
|
|
6619
6619
|
*/
|
|
6620
6620
|
toUTC(e = 0, s = {}) {
|
|
6621
|
-
return this.setZone(
|
|
6621
|
+
return this.setZone(De.instance(e), s);
|
|
6622
6622
|
}
|
|
6623
6623
|
/**
|
|
6624
6624
|
* "Set" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime.
|
|
@@ -6649,7 +6649,7 @@ class Z {
|
|
|
6649
6649
|
}
|
|
6650
6650
|
return wt(this, { ts: r, zone: e });
|
|
6651
6651
|
} else
|
|
6652
|
-
return
|
|
6652
|
+
return B.invalid(Ht(e));
|
|
6653
6653
|
}
|
|
6654
6654
|
/**
|
|
6655
6655
|
* "Set" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime.
|
|
@@ -6685,19 +6685,19 @@ class Z {
|
|
|
6685
6685
|
*/
|
|
6686
6686
|
set(e) {
|
|
6687
6687
|
if (!this.isValid) return this;
|
|
6688
|
-
const s = ws(e, rr), { minDaysInFirstWeek: n, startOfWeek: r } = Hn(s, this.loc), a = !
|
|
6688
|
+
const s = ws(e, rr), { minDaysInFirstWeek: n, startOfWeek: r } = Hn(s, this.loc), a = !z(s.weekYear) || !z(s.weekNumber) || !z(s.weekday), i = !z(s.ordinal), l = !z(s.year), o = !z(s.month) || !z(s.day), u = l || o, d = s.weekYear || s.weekNumber;
|
|
6689
6689
|
if ((u || i) && d)
|
|
6690
|
-
throw new
|
|
6690
|
+
throw new Mt(
|
|
6691
6691
|
"Can't mix weekYear/weekNumber units with year/month/day or ordinals"
|
|
6692
6692
|
);
|
|
6693
6693
|
if (o && i)
|
|
6694
|
-
throw new
|
|
6694
|
+
throw new Mt("Can't mix ordinal dates with month/day");
|
|
6695
6695
|
let m;
|
|
6696
6696
|
a ? m = Bn(
|
|
6697
6697
|
{ ...Ss(this.c, n, r), ...s },
|
|
6698
6698
|
n,
|
|
6699
6699
|
r
|
|
6700
|
-
) :
|
|
6700
|
+
) : z(s.ordinal) ? (m = { ...this.toObject(), ...s }, z(s.day) && (m.day = Math.min(vs(m.year, m.month), m.day))) : m = zn({ ...Ps(this.c), ...s });
|
|
6701
6701
|
const [S, p] = fs(m, this.o, this.zone);
|
|
6702
6702
|
return wt(this, { ts: S, o: p });
|
|
6703
6703
|
}
|
|
@@ -6808,7 +6808,7 @@ class Z {
|
|
|
6808
6808
|
* @return {string}
|
|
6809
6809
|
*/
|
|
6810
6810
|
toFormat(e, s = {}) {
|
|
6811
|
-
return this.isValid ?
|
|
6811
|
+
return this.isValid ? xe.create(this.loc.redefaultToEN(s)).formatDateTimeFromString(this, e) : Vs;
|
|
6812
6812
|
}
|
|
6813
6813
|
/**
|
|
6814
6814
|
* Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`.
|
|
@@ -6830,7 +6830,7 @@ class Z {
|
|
|
6830
6830
|
* @return {string}
|
|
6831
6831
|
*/
|
|
6832
6832
|
toLocaleString(e = gs, s = {}) {
|
|
6833
|
-
return this.isValid ?
|
|
6833
|
+
return this.isValid ? xe.create(this.loc.clone(s), e).formatDateTime(this) : Vs;
|
|
6834
6834
|
}
|
|
6835
6835
|
/**
|
|
6836
6836
|
* Returns an array of format "parts", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.
|
|
@@ -6846,7 +6846,7 @@ class Z {
|
|
|
6846
6846
|
* //=> ]
|
|
6847
6847
|
*/
|
|
6848
6848
|
toLocaleParts(e = {}) {
|
|
6849
|
-
return this.isValid ?
|
|
6849
|
+
return this.isValid ? xe.create(this.loc.clone(e), e).formatDateTimeParts(this) : [];
|
|
6850
6850
|
}
|
|
6851
6851
|
/**
|
|
6852
6852
|
* Returns an ISO 8601-compliant string representation of this DateTime
|
|
@@ -7110,7 +7110,7 @@ class Z {
|
|
|
7110
7110
|
* @return {Duration}
|
|
7111
7111
|
*/
|
|
7112
7112
|
diffNow(e = "milliseconds", s = {}) {
|
|
7113
|
-
return this.diff(
|
|
7113
|
+
return this.diff(B.now(), e, s);
|
|
7114
7114
|
}
|
|
7115
7115
|
/**
|
|
7116
7116
|
* Return an Interval spanning between this DateTime and another DateTime
|
|
@@ -7167,7 +7167,7 @@ class Z {
|
|
|
7167
7167
|
*/
|
|
7168
7168
|
toRelative(e = {}) {
|
|
7169
7169
|
if (!this.isValid) return null;
|
|
7170
|
-
const s = e.base ||
|
|
7170
|
+
const s = e.base || B.fromObject({}, { zone: this.zone }), n = e.padding ? this < s ? -e.padding : e.padding : 0;
|
|
7171
7171
|
let r = ["years", "months", "days", "hours", "minutes", "seconds"], a = e.unit;
|
|
7172
7172
|
return Array.isArray(e.unit) && (r = e.unit, a = void 0), ir(s, this.plus(n), {
|
|
7173
7173
|
...e,
|
|
@@ -7190,7 +7190,7 @@ class Z {
|
|
|
7190
7190
|
* @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> "2 days ago"
|
|
7191
7191
|
*/
|
|
7192
7192
|
toRelativeCalendar(e = {}) {
|
|
7193
|
-
return this.isValid ? ir(e.base ||
|
|
7193
|
+
return this.isValid ? ir(e.base || B.fromObject({}, { zone: this.zone }), this, {
|
|
7194
7194
|
...e,
|
|
7195
7195
|
numeric: "auto",
|
|
7196
7196
|
units: ["years", "months", "days"],
|
|
@@ -7203,8 +7203,8 @@ class Z {
|
|
|
7203
7203
|
* @return {DateTime} the min DateTime, or undefined if called with no argument
|
|
7204
7204
|
*/
|
|
7205
7205
|
static min(...e) {
|
|
7206
|
-
if (!e.every(
|
|
7207
|
-
throw new
|
|
7206
|
+
if (!e.every(B.isDateTime))
|
|
7207
|
+
throw new Ie("min requires all arguments be DateTimes");
|
|
7208
7208
|
return Gn(e, (s) => s.valueOf(), Math.min);
|
|
7209
7209
|
}
|
|
7210
7210
|
/**
|
|
@@ -7213,8 +7213,8 @@ class Z {
|
|
|
7213
7213
|
* @return {DateTime} the max DateTime, or undefined if called with no argument
|
|
7214
7214
|
*/
|
|
7215
7215
|
static max(...e) {
|
|
7216
|
-
if (!e.every(
|
|
7217
|
-
throw new
|
|
7216
|
+
if (!e.every(B.isDateTime))
|
|
7217
|
+
throw new Ie("max requires all arguments be DateTimes");
|
|
7218
7218
|
return Gn(e, (s) => s.valueOf(), Math.max);
|
|
7219
7219
|
}
|
|
7220
7220
|
// MISC
|
|
@@ -7226,7 +7226,7 @@ class Z {
|
|
|
7226
7226
|
* @return {Object}
|
|
7227
7227
|
*/
|
|
7228
7228
|
static fromFormatExplain(e, s, n = {}) {
|
|
7229
|
-
const { locale: r = null, numberingSystem: a = null } = n, i =
|
|
7229
|
+
const { locale: r = null, numberingSystem: a = null } = n, i = re.fromOpts({
|
|
7230
7230
|
locale: r,
|
|
7231
7231
|
numberingSystem: a,
|
|
7232
7232
|
defaultToEN: !0
|
|
@@ -7237,7 +7237,7 @@ class Z {
|
|
|
7237
7237
|
* @deprecated use fromFormatExplain instead
|
|
7238
7238
|
*/
|
|
7239
7239
|
static fromStringExplain(e, s, n = {}) {
|
|
7240
|
-
return
|
|
7240
|
+
return B.fromFormatExplain(e, s, n);
|
|
7241
7241
|
}
|
|
7242
7242
|
/**
|
|
7243
7243
|
* Build a parser for `fmt` using the given locale. This parser can be passed
|
|
@@ -7252,7 +7252,7 @@ class Z {
|
|
|
7252
7252
|
* @returns {TokenParser} - opaque object to be used
|
|
7253
7253
|
*/
|
|
7254
7254
|
static buildFormatParser(e, s = {}) {
|
|
7255
|
-
const { locale: n = null, numberingSystem: r = null } = s, a =
|
|
7255
|
+
const { locale: n = null, numberingSystem: r = null } = s, a = re.fromOpts({
|
|
7256
7256
|
locale: n,
|
|
7257
7257
|
numberingSystem: r,
|
|
7258
7258
|
defaultToEN: !0
|
|
@@ -7270,21 +7270,21 @@ class Z {
|
|
|
7270
7270
|
* @returns {DateTime}
|
|
7271
7271
|
*/
|
|
7272
7272
|
static fromFormatParser(e, s, n = {}) {
|
|
7273
|
-
if (
|
|
7274
|
-
throw new
|
|
7273
|
+
if (z(e) || z(s))
|
|
7274
|
+
throw new Ie(
|
|
7275
7275
|
"fromFormatParser requires an input string and a format parser"
|
|
7276
7276
|
);
|
|
7277
|
-
const { locale: r = null, numberingSystem: a = null } = n, i =
|
|
7277
|
+
const { locale: r = null, numberingSystem: a = null } = n, i = re.fromOpts({
|
|
7278
7278
|
locale: r,
|
|
7279
7279
|
numberingSystem: a,
|
|
7280
7280
|
defaultToEN: !0
|
|
7281
7281
|
});
|
|
7282
7282
|
if (!i.equals(s.locale))
|
|
7283
|
-
throw new
|
|
7283
|
+
throw new Ie(
|
|
7284
7284
|
`fromFormatParser called with a locale of ${i}, but the format parser was created for ${s.locale}`
|
|
7285
7285
|
);
|
|
7286
7286
|
const { result: l, zone: o, specificOffset: u, invalidReason: d } = s.explainFromTokens(e);
|
|
7287
|
-
return d ?
|
|
7287
|
+
return d ? B.invalid(d) : Ot(
|
|
7288
7288
|
l,
|
|
7289
7289
|
o,
|
|
7290
7290
|
n,
|
|
@@ -7449,14 +7449,14 @@ class Z {
|
|
|
7449
7449
|
return Hr;
|
|
7450
7450
|
}
|
|
7451
7451
|
}
|
|
7452
|
-
function
|
|
7453
|
-
if (
|
|
7452
|
+
function Vt(t) {
|
|
7453
|
+
if (B.isDateTime(t))
|
|
7454
7454
|
return t;
|
|
7455
7455
|
if (t && t.valueOf && ht(t.valueOf()))
|
|
7456
|
-
return
|
|
7456
|
+
return B.fromJSDate(t);
|
|
7457
7457
|
if (t && typeof t == "object")
|
|
7458
|
-
return
|
|
7459
|
-
throw new
|
|
7458
|
+
return B.fromObject(t);
|
|
7459
|
+
throw new Ie(
|
|
7460
7460
|
`Unknown datetime argument: ${t}, of type ${typeof t}`
|
|
7461
7461
|
);
|
|
7462
7462
|
}
|
|
@@ -7471,7 +7471,7 @@ function _l(t, e) {
|
|
|
7471
7471
|
}
|
|
7472
7472
|
function Jl(t, e) {
|
|
7473
7473
|
try {
|
|
7474
|
-
const s =
|
|
7474
|
+
const s = B.fromJSDate(t, { zone: "utc" }).setZone(e), n = s.toJSDate().toLocaleString("en-US", { timeZone: e, timeZoneName: "short" }).split(" ").pop() || void 0, r = s.toFormat("ZZ") || void 0;
|
|
7475
7475
|
return { abbr: n, offset: r };
|
|
7476
7476
|
} catch {
|
|
7477
7477
|
return {};
|
|
@@ -7488,7 +7488,7 @@ function Kl(t) {
|
|
|
7488
7488
|
}
|
|
7489
7489
|
function As(t, e = "UTC") {
|
|
7490
7490
|
if (!t) return "-";
|
|
7491
|
-
const s =
|
|
7491
|
+
const s = B.fromISO(t, { zone: "utc" }).setZone(e);
|
|
7492
7492
|
if (!s.isValid) return "-";
|
|
7493
7493
|
const n = s.offsetNameShort, r = s.toFormat("ZZZZ"), a = n.startsWith("GMT") || n === r ? r : `${n}/${r}`;
|
|
7494
7494
|
return `${s.toFormat("MM/dd/yyyy, hh:mm:ss a")} (${a})`;
|
|
@@ -7520,7 +7520,7 @@ function ec({
|
|
|
7520
7520
|
resetKey: S,
|
|
7521
7521
|
serverSideFilters: p
|
|
7522
7522
|
}) {
|
|
7523
|
-
const k = br(),
|
|
7523
|
+
const k = br(), D = async ($) => {
|
|
7524
7524
|
try {
|
|
7525
7525
|
const W = await k.mutateAsync({
|
|
7526
7526
|
alertUniqueId: $.alertId ?? $.id,
|
|
@@ -7531,22 +7531,22 @@ function ec({
|
|
|
7531
7531
|
});
|
|
7532
7532
|
if (W?.responseStatus || W?.Success) {
|
|
7533
7533
|
const N = W?.Message || W?.data || "Alert reopened successfully.";
|
|
7534
|
-
|
|
7534
|
+
be.success(N);
|
|
7535
7535
|
} else {
|
|
7536
7536
|
const N = W?.errorMessage || W?.Message || "Failed to reopen alert";
|
|
7537
|
-
|
|
7537
|
+
be.error(N);
|
|
7538
7538
|
}
|
|
7539
7539
|
} catch {
|
|
7540
|
-
|
|
7540
|
+
be.error("Failed to reopen alert. Please try again.");
|
|
7541
7541
|
}
|
|
7542
|
-
},
|
|
7542
|
+
}, C = [
|
|
7543
7543
|
{
|
|
7544
7544
|
title: "Severity",
|
|
7545
7545
|
dataIndex: "priority",
|
|
7546
7546
|
key: "priority",
|
|
7547
7547
|
width: 120,
|
|
7548
7548
|
render: ($) => /* @__PURE__ */ c(
|
|
7549
|
-
|
|
7549
|
+
Rt,
|
|
7550
7550
|
{
|
|
7551
7551
|
className: "px-[10px] py-[2px]",
|
|
7552
7552
|
style: {
|
|
@@ -7609,26 +7609,26 @@ function ec({
|
|
|
7609
7609
|
{ key: "reopen", label: "Reopen" }
|
|
7610
7610
|
],
|
|
7611
7611
|
onClick: ({ key: N }) => {
|
|
7612
|
-
N === "reopen" &&
|
|
7612
|
+
N === "reopen" && D(W);
|
|
7613
7613
|
}
|
|
7614
7614
|
},
|
|
7615
|
-
children: /* @__PURE__ */ c(
|
|
7615
|
+
children: /* @__PURE__ */ c(Le, { type: "text", icon: /* @__PURE__ */ c(Pa, {}) })
|
|
7616
7616
|
}
|
|
7617
7617
|
)
|
|
7618
7618
|
}
|
|
7619
|
-
],
|
|
7619
|
+
], Y = u && p ? t : (t || []).filter(($) => {
|
|
7620
7620
|
const W = ps($.statusType || "");
|
|
7621
7621
|
return Tr.some((N) => W.includes(ps(N)));
|
|
7622
7622
|
});
|
|
7623
7623
|
return /* @__PURE__ */ c(
|
|
7624
7624
|
Nr,
|
|
7625
7625
|
{
|
|
7626
|
-
data:
|
|
7626
|
+
data: Y,
|
|
7627
7627
|
loading: e,
|
|
7628
7628
|
pageSize: s,
|
|
7629
7629
|
total: n,
|
|
7630
7630
|
currentPage: r,
|
|
7631
|
-
columns:
|
|
7631
|
+
columns: C,
|
|
7632
7632
|
severityOptions: a,
|
|
7633
7633
|
anomalyOptions: i,
|
|
7634
7634
|
spaceOptions: l,
|
|
@@ -7648,7 +7648,7 @@ function tc({
|
|
|
7648
7648
|
time: e,
|
|
7649
7649
|
timeZone: s = "America/New_York"
|
|
7650
7650
|
}) {
|
|
7651
|
-
const { hours: n, minutes: r, seconds: a } =
|
|
7651
|
+
const { hours: n, minutes: r, seconds: a } = Se(() => {
|
|
7652
7652
|
const m = new Intl.DateTimeFormat("en-US", {
|
|
7653
7653
|
timeZone: s,
|
|
7654
7654
|
hour: "numeric",
|
|
@@ -7671,7 +7671,7 @@ function tc({
|
|
|
7671
7671
|
"aria-label": "Analog Clock",
|
|
7672
7672
|
children: [
|
|
7673
7673
|
[...Array(12)].map((d, m) => {
|
|
7674
|
-
const S = m * 30, p = 6, k = u - 4,
|
|
7674
|
+
const S = m * 30, p = 6, k = u - 4, D = k - p, C = (S - 90) * (Math.PI / 180), Y = u + D * Math.cos(C), $ = u + D * Math.sin(C), W = u + k * Math.cos(C), N = u + k * Math.sin(C);
|
|
7675
7675
|
return /* @__PURE__ */ c(
|
|
7676
7676
|
"svg",
|
|
7677
7677
|
{
|
|
@@ -7681,7 +7681,7 @@ function tc({
|
|
|
7681
7681
|
children: /* @__PURE__ */ c(
|
|
7682
7682
|
"line",
|
|
7683
7683
|
{
|
|
7684
|
-
x1:
|
|
7684
|
+
x1: Y,
|
|
7685
7685
|
y1: $,
|
|
7686
7686
|
x2: W,
|
|
7687
7687
|
y2: N,
|
|
@@ -7775,11 +7775,11 @@ function tc({
|
|
|
7775
7775
|
}
|
|
7776
7776
|
function sc({ label: t = "USA", timeZone: e = "America/New_York", updateIntervalMs: s = 1e3, className: n }) {
|
|
7777
7777
|
const [r, a] = g(/* @__PURE__ */ new Date());
|
|
7778
|
-
|
|
7778
|
+
fe(() => {
|
|
7779
7779
|
const u = setInterval(() => a(/* @__PURE__ */ new Date()), s);
|
|
7780
7780
|
return () => clearInterval(u);
|
|
7781
7781
|
}, [s]);
|
|
7782
|
-
const i =
|
|
7782
|
+
const i = Se(() => _l(r, e), [r, e]), { abbr: l, offset: o } = Se(() => Jl(r, e), [r, e]);
|
|
7783
7783
|
return /* @__PURE__ */ y("div", { className: `flex items-center gap-3 ${n || ""}`, children: [
|
|
7784
7784
|
/* @__PURE__ */ c(tc, { time: r, timeZone: e, size: 80 }),
|
|
7785
7785
|
/* @__PURE__ */ y("div", { className: "flex flex-col items-baseline gap-1", children: [
|
|
@@ -7795,13 +7795,13 @@ function sc({ label: t = "USA", timeZone: e = "America/New_York", updateInterval
|
|
|
7795
7795
|
] })
|
|
7796
7796
|
] });
|
|
7797
7797
|
}
|
|
7798
|
-
const { Text: nc } =
|
|
7798
|
+
const { Text: nc } = jt;
|
|
7799
7799
|
function rc({ sortBy: t, onChange: e, showActions: s, onSave: n, onClear: r, saving: a }) {
|
|
7800
|
-
return /* @__PURE__ */ y(
|
|
7801
|
-
/* @__PURE__ */ c(
|
|
7800
|
+
return /* @__PURE__ */ y(Ue, { gutter: [16, 16], align: "middle", children: [
|
|
7801
|
+
/* @__PURE__ */ c(J, { xs: 24, md: 8, lg: 5, children: /* @__PURE__ */ y(st, { className: "w-full items-center", direction: "horizontal", size: 12, children: [
|
|
7802
7802
|
/* @__PURE__ */ c(nc, { className: "text-gray-600 whitespace-nowrap", children: "Sort By:" }),
|
|
7803
7803
|
/* @__PURE__ */ c(
|
|
7804
|
-
|
|
7804
|
+
Me,
|
|
7805
7805
|
{
|
|
7806
7806
|
placeholder: "By Severity",
|
|
7807
7807
|
value: t,
|
|
@@ -7815,18 +7815,18 @@ function rc({ sortBy: t, onChange: e, showActions: s, onSave: n, onClear: r, sav
|
|
|
7815
7815
|
}
|
|
7816
7816
|
)
|
|
7817
7817
|
] }) }),
|
|
7818
|
-
/* @__PURE__ */ c(
|
|
7819
|
-
/* @__PURE__ */ c(
|
|
7820
|
-
/* @__PURE__ */ c(
|
|
7818
|
+
/* @__PURE__ */ c(J, { xs: 24, md: 8, style: { alignSelf: "end" }, children: s ? /* @__PURE__ */ y(st, { className: "w-full", direction: "horizontal", size: 8, children: [
|
|
7819
|
+
/* @__PURE__ */ c(Le, { onClick: r, disabled: a, children: "Clear" }),
|
|
7820
|
+
/* @__PURE__ */ c(Le, { type: "primary", onClick: n, loading: a, children: "Save" })
|
|
7821
7821
|
] }) : null })
|
|
7822
7822
|
] });
|
|
7823
7823
|
}
|
|
7824
|
-
const an = (t) => /* @__PURE__ */ y(
|
|
7824
|
+
const an = (t) => /* @__PURE__ */ y(Rt, { children: [
|
|
7825
7825
|
/* @__PURE__ */ c(Wa, {}),
|
|
7826
7826
|
" ",
|
|
7827
7827
|
t.length,
|
|
7828
7828
|
" more"
|
|
7829
|
-
] }), { Text: it } =
|
|
7829
|
+
] }), { Text: it } = jt;
|
|
7830
7830
|
function ac(t) {
|
|
7831
7831
|
const {
|
|
7832
7832
|
// escBasis, setEscBasis,
|
|
@@ -7845,49 +7845,49 @@ function ac(t) {
|
|
|
7845
7845
|
l2role: S,
|
|
7846
7846
|
setL2role: p,
|
|
7847
7847
|
l3mins: k,
|
|
7848
|
-
setL3mins:
|
|
7849
|
-
l3role:
|
|
7850
|
-
setL3role:
|
|
7848
|
+
setL3mins: D,
|
|
7849
|
+
l3role: C,
|
|
7850
|
+
setL3role: Y,
|
|
7851
7851
|
actions: $,
|
|
7852
7852
|
setActions: W,
|
|
7853
7853
|
thirdPartyIds: N,
|
|
7854
|
-
setThirdPartyIds:
|
|
7855
|
-
humanLoop:
|
|
7856
|
-
setHumanLoop:
|
|
7857
|
-
isAutoExpire:
|
|
7854
|
+
setThirdPartyIds: E,
|
|
7855
|
+
humanLoop: Z,
|
|
7856
|
+
setHumanLoop: R,
|
|
7857
|
+
isAutoExpire: q,
|
|
7858
7858
|
setAutoExpire: h,
|
|
7859
7859
|
onClear: v,
|
|
7860
|
-
onSave:
|
|
7860
|
+
onSave: M,
|
|
7861
7861
|
saving: le,
|
|
7862
7862
|
onActionTypesLoaded: ae
|
|
7863
|
-
} = t, { rules:
|
|
7864
|
-
|
|
7865
|
-
let
|
|
7863
|
+
} = t, { rules: L, config: A } = Fe(), w = A.tenant === "schools", [x, T] = g([]), [U, P] = g([]), [j, K] = g(!1);
|
|
7864
|
+
fe(() => {
|
|
7865
|
+
let ce = !1;
|
|
7866
7866
|
return (async () => {
|
|
7867
7867
|
try {
|
|
7868
|
-
|
|
7869
|
-
const he = await
|
|
7870
|
-
if (
|
|
7871
|
-
const
|
|
7872
|
-
T(
|
|
7873
|
-
const ie = Array.isArray(he.thirdParties) ? he.thirdParties.map((
|
|
7868
|
+
K(!0);
|
|
7869
|
+
const he = await L.getLookups();
|
|
7870
|
+
if (ce || !he || !Array.isArray(he.actionTypes)) return;
|
|
7871
|
+
const Te = he.actionTypes.map((oe) => ({ label: oe.name, value: String(oe.actionTypeId) }));
|
|
7872
|
+
T(Te), ae && ae(he.actionTypes);
|
|
7873
|
+
const ie = Array.isArray(he.thirdParties) ? he.thirdParties.map((oe) => ({ label: oe.thirdPartyName, value: oe.thirdPartyIds ?? oe.thirdPartyId })) : [];
|
|
7874
7874
|
P(ie);
|
|
7875
7875
|
} catch (he) {
|
|
7876
7876
|
console.error("Error loading lookups", he);
|
|
7877
7877
|
} finally {
|
|
7878
|
-
|
|
7878
|
+
ce || K(!1);
|
|
7879
7879
|
}
|
|
7880
7880
|
})(), () => {
|
|
7881
|
-
|
|
7881
|
+
ce = !0;
|
|
7882
7882
|
};
|
|
7883
7883
|
}, []);
|
|
7884
|
-
const
|
|
7885
|
-
return /* @__PURE__ */ y(Ts, { spinning: !!le ||
|
|
7886
|
-
/* @__PURE__ */ y(
|
|
7887
|
-
/* @__PURE__ */ c(
|
|
7884
|
+
const te = typeof i == "number" || typeof o == "number", se = typeof d == "number" || typeof S == "number", X = typeof i == "number" || typeof o == "number" || typeof d == "number" || typeof S == "number" || typeof k == "number" || typeof C == "number" || Array.isArray($) && $.length > 0 || Array.isArray(N) && N.length > 0 || !!Z || !!q;
|
|
7885
|
+
return /* @__PURE__ */ y(Ts, { spinning: !!le || j, children: [
|
|
7886
|
+
/* @__PURE__ */ y(Ue, { gutter: [16, 16], align: "bottom", children: [
|
|
7887
|
+
/* @__PURE__ */ c(J, { xs: 24, sm: 12, md: 8, lg: 4, children: /* @__PURE__ */ y("div", { children: [
|
|
7888
7888
|
/* @__PURE__ */ c(it, { className: "text-gray-700 font-medium block mb-1", children: "Rules" }),
|
|
7889
7889
|
/* @__PURE__ */ c(
|
|
7890
|
-
|
|
7890
|
+
Me,
|
|
7891
7891
|
{
|
|
7892
7892
|
placeholder: "Rules",
|
|
7893
7893
|
value: e,
|
|
@@ -7897,14 +7897,14 @@ function ac(t) {
|
|
|
7897
7897
|
}
|
|
7898
7898
|
)
|
|
7899
7899
|
] }) }),
|
|
7900
|
-
/* @__PURE__ */ c(
|
|
7901
|
-
/* @__PURE__ */ y(
|
|
7902
|
-
/* @__PURE__ */ c(
|
|
7903
|
-
/* @__PURE__ */ c(
|
|
7900
|
+
/* @__PURE__ */ c(J, { xs: 24, sm: 12, md: 8, lg: 4, children: /* @__PURE__ */ y("div", { children: [
|
|
7901
|
+
/* @__PURE__ */ y(Ue, { gutter: 8, children: [
|
|
7902
|
+
/* @__PURE__ */ c(J, { span: 10, children: /* @__PURE__ */ c(it, { className: "text-gray-700 font-medium block mb-1", children: "Level 1 (mins)" }) }),
|
|
7903
|
+
/* @__PURE__ */ c(J, { span: 14, children: /* @__PURE__ */ c(it, { className: "text-gray-700 font-medium block mb-1", children: "Escalate to" }) })
|
|
7904
7904
|
] }),
|
|
7905
|
-
/* @__PURE__ */ y(
|
|
7906
|
-
/* @__PURE__ */ c(
|
|
7907
|
-
|
|
7905
|
+
/* @__PURE__ */ y(Ue, { gutter: 8, children: [
|
|
7906
|
+
/* @__PURE__ */ c(J, { span: 10, children: /* @__PURE__ */ c(
|
|
7907
|
+
Me,
|
|
7908
7908
|
{
|
|
7909
7909
|
className: "w-full",
|
|
7910
7910
|
placeholder: "Mins",
|
|
@@ -7913,8 +7913,8 @@ function ac(t) {
|
|
|
7913
7913
|
options: r
|
|
7914
7914
|
}
|
|
7915
7915
|
) }),
|
|
7916
|
-
/* @__PURE__ */ c(
|
|
7917
|
-
|
|
7916
|
+
/* @__PURE__ */ c(J, { span: 14, children: /* @__PURE__ */ c(
|
|
7917
|
+
Me,
|
|
7918
7918
|
{
|
|
7919
7919
|
placeholder: "Escalate to",
|
|
7920
7920
|
className: "w-full",
|
|
@@ -7925,14 +7925,14 @@ function ac(t) {
|
|
|
7925
7925
|
) })
|
|
7926
7926
|
] })
|
|
7927
7927
|
] }) }),
|
|
7928
|
-
|
|
7929
|
-
/* @__PURE__ */ y(
|
|
7930
|
-
/* @__PURE__ */ c(
|
|
7931
|
-
/* @__PURE__ */ c(
|
|
7928
|
+
te && /* @__PURE__ */ c(J, { xs: 24, sm: 12, md: 8, lg: 4, children: /* @__PURE__ */ y("div", { children: [
|
|
7929
|
+
/* @__PURE__ */ y(Ue, { gutter: 8, children: [
|
|
7930
|
+
/* @__PURE__ */ c(J, { span: 10, children: /* @__PURE__ */ c(it, { className: "text-gray-700 font-medium block mb-1", children: "Level 2 (mins)" }) }),
|
|
7931
|
+
/* @__PURE__ */ c(J, { span: 14, children: /* @__PURE__ */ c(it, { className: "text-gray-700 font-medium block mb-1", children: "Escalate to" }) })
|
|
7932
7932
|
] }),
|
|
7933
|
-
/* @__PURE__ */ y(
|
|
7934
|
-
/* @__PURE__ */ c(
|
|
7935
|
-
|
|
7933
|
+
/* @__PURE__ */ y(Ue, { gutter: 8, children: [
|
|
7934
|
+
/* @__PURE__ */ c(J, { span: 10, children: /* @__PURE__ */ c(
|
|
7935
|
+
Me,
|
|
7936
7936
|
{
|
|
7937
7937
|
className: "w-full",
|
|
7938
7938
|
placeholder: "Mins",
|
|
@@ -7941,8 +7941,8 @@ function ac(t) {
|
|
|
7941
7941
|
options: r
|
|
7942
7942
|
}
|
|
7943
7943
|
) }),
|
|
7944
|
-
/* @__PURE__ */ c(
|
|
7945
|
-
|
|
7944
|
+
/* @__PURE__ */ c(J, { span: 14, children: /* @__PURE__ */ c(
|
|
7945
|
+
Me,
|
|
7946
7946
|
{
|
|
7947
7947
|
placeholder: "Escalate to",
|
|
7948
7948
|
className: "w-full",
|
|
@@ -7953,81 +7953,81 @@ function ac(t) {
|
|
|
7953
7953
|
) })
|
|
7954
7954
|
] })
|
|
7955
7955
|
] }) }),
|
|
7956
|
-
|
|
7957
|
-
/* @__PURE__ */ y(
|
|
7958
|
-
/* @__PURE__ */ c(
|
|
7959
|
-
/* @__PURE__ */ c(
|
|
7956
|
+
se && /* @__PURE__ */ c(J, { xs: 24, sm: 12, md: 8, lg: 4, children: /* @__PURE__ */ y("div", { children: [
|
|
7957
|
+
/* @__PURE__ */ y(Ue, { gutter: 8, children: [
|
|
7958
|
+
/* @__PURE__ */ c(J, { span: 10, children: /* @__PURE__ */ c(it, { className: "text-gray-700 font-medium block mb-1", children: "Level 3 (mins)" }) }),
|
|
7959
|
+
/* @__PURE__ */ c(J, { span: 14, children: /* @__PURE__ */ c(it, { className: "text-gray-700 font-medium block mb-1", children: "Escalate to" }) })
|
|
7960
7960
|
] }),
|
|
7961
|
-
/* @__PURE__ */ y(
|
|
7962
|
-
/* @__PURE__ */ c(
|
|
7963
|
-
|
|
7961
|
+
/* @__PURE__ */ y(Ue, { gutter: 8, children: [
|
|
7962
|
+
/* @__PURE__ */ c(J, { span: 10, children: /* @__PURE__ */ c(
|
|
7963
|
+
Me,
|
|
7964
7964
|
{
|
|
7965
7965
|
className: "w-full",
|
|
7966
7966
|
placeholder: "Mins",
|
|
7967
7967
|
value: k,
|
|
7968
|
-
onChange:
|
|
7968
|
+
onChange: D,
|
|
7969
7969
|
options: r
|
|
7970
7970
|
}
|
|
7971
7971
|
) }),
|
|
7972
|
-
/* @__PURE__ */ c(
|
|
7973
|
-
|
|
7972
|
+
/* @__PURE__ */ c(J, { span: 14, children: /* @__PURE__ */ c(
|
|
7973
|
+
Me,
|
|
7974
7974
|
{
|
|
7975
7975
|
placeholder: "Escalate to",
|
|
7976
7976
|
className: "w-full",
|
|
7977
|
-
value:
|
|
7978
|
-
onChange:
|
|
7977
|
+
value: C,
|
|
7978
|
+
onChange: Y,
|
|
7979
7979
|
options: a
|
|
7980
7980
|
}
|
|
7981
7981
|
) })
|
|
7982
7982
|
] })
|
|
7983
7983
|
] }) }),
|
|
7984
|
-
/* @__PURE__ */ c(
|
|
7984
|
+
/* @__PURE__ */ c(J, { xs: 24, sm: 12, md: 8, lg: 4, children: /* @__PURE__ */ y("div", { children: [
|
|
7985
7985
|
/* @__PURE__ */ c(it, { className: "text-gray-700 font-medium block mb-1", children: "Pick Actions" }),
|
|
7986
7986
|
/* @__PURE__ */ c(
|
|
7987
|
-
|
|
7987
|
+
Me,
|
|
7988
7988
|
{
|
|
7989
7989
|
mode: "multiple",
|
|
7990
7990
|
placeholder: "Select response actions",
|
|
7991
7991
|
className: "w-full",
|
|
7992
7992
|
value: $,
|
|
7993
7993
|
onChange: W,
|
|
7994
|
-
options:
|
|
7994
|
+
options: x,
|
|
7995
7995
|
maxTagCount: 1,
|
|
7996
7996
|
maxTagPlaceholder: an
|
|
7997
7997
|
}
|
|
7998
7998
|
)
|
|
7999
7999
|
] }) }),
|
|
8000
|
-
/* @__PURE__ */ c(
|
|
8000
|
+
/* @__PURE__ */ c(J, { xs: 24, sm: 12, md: 8, lg: 4, children: /* @__PURE__ */ y("div", { children: [
|
|
8001
8001
|
/* @__PURE__ */ c(it, { className: "text-gray-700 font-medium block mb-1", children: "Notify" }),
|
|
8002
8002
|
/* @__PURE__ */ c(
|
|
8003
|
-
|
|
8003
|
+
Me,
|
|
8004
8004
|
{
|
|
8005
8005
|
mode: "multiple",
|
|
8006
8006
|
placeholder: "Notify",
|
|
8007
8007
|
className: "w-full",
|
|
8008
8008
|
value: N,
|
|
8009
|
-
onChange:
|
|
8010
|
-
options:
|
|
8009
|
+
onChange: E,
|
|
8010
|
+
options: U,
|
|
8011
8011
|
maxCount: 2,
|
|
8012
8012
|
maxTagPlaceholder: an
|
|
8013
8013
|
}
|
|
8014
8014
|
)
|
|
8015
8015
|
] }) })
|
|
8016
8016
|
] }),
|
|
8017
|
-
/* @__PURE__ */ y(
|
|
8018
|
-
/* @__PURE__ */ c(
|
|
8019
|
-
!w && /* @__PURE__ */ c(
|
|
8020
|
-
/* @__PURE__ */ c(
|
|
8017
|
+
/* @__PURE__ */ y(Ue, { gutter: [16, 16], align: "bottom", className: "mt-4 items-center", children: [
|
|
8018
|
+
/* @__PURE__ */ c(J, { xs: 24, sm: 12, md: 8, lg: 7, children: /* @__PURE__ */ y("div", { className: "flex items-center h-full gap-8", children: [
|
|
8019
|
+
!w && /* @__PURE__ */ c(Et, { checked: Z, onChange: (ce) => R(ce.target.checked), className: "w-full", children: "Human-In-The-Loop" }),
|
|
8020
|
+
/* @__PURE__ */ c(Et, { checked: q, onChange: (ce) => h(ce.target.checked), className: "w-full", children: "Auto-expire in 5 minutes" })
|
|
8021
8021
|
] }) }),
|
|
8022
|
-
/* @__PURE__ */ c(
|
|
8023
|
-
/* @__PURE__ */ c(
|
|
8024
|
-
/* @__PURE__ */ c(
|
|
8022
|
+
/* @__PURE__ */ c(J, { xs: 24, sm: 12, md: 8, children: /* @__PURE__ */ y("div", { className: "flex items-center gap-2", children: [
|
|
8023
|
+
/* @__PURE__ */ c(Le, { onClick: v, children: "Clear" }),
|
|
8024
|
+
/* @__PURE__ */ c(Le, { type: "primary", onClick: M, loading: !!le, disabled: !(!!e && X && !le), children: "Save" })
|
|
8025
8025
|
] }) })
|
|
8026
8026
|
] })
|
|
8027
8027
|
] });
|
|
8028
8028
|
}
|
|
8029
8029
|
function ic({ entries: t, userRoles: e, onEdit: s, loading: n }) {
|
|
8030
|
-
const { config: r } =
|
|
8030
|
+
const { config: r } = Fe(), a = r.tenant === "schools", i = new Map(e.map((o) => [o.userRoleId, o.userRoleName])), l = (o) => o.map((u) => i.get(u) || String(u)).join(", ");
|
|
8031
8031
|
return /* @__PURE__ */ c(
|
|
8032
8032
|
on,
|
|
8033
8033
|
{
|
|
@@ -8088,29 +8088,29 @@ function ic({ entries: t, userRoles: e, onEdit: s, loading: n }) {
|
|
|
8088
8088
|
{
|
|
8089
8089
|
title: "Actions",
|
|
8090
8090
|
key: "ops",
|
|
8091
|
-
render: (o, u) => /* @__PURE__ */ c(
|
|
8091
|
+
render: (o, u) => /* @__PURE__ */ c(Le, { type: "text", onClick: () => s(u.id), children: /* @__PURE__ */ c(Va, {}) })
|
|
8092
8092
|
}
|
|
8093
8093
|
]
|
|
8094
8094
|
}
|
|
8095
8095
|
);
|
|
8096
8096
|
}
|
|
8097
|
-
const { Title: oc, Text: Hs } =
|
|
8097
|
+
const { Title: oc, Text: Hs } = jt;
|
|
8098
8098
|
function lc({ userRoles: t, rules: e, rawRules: s }) {
|
|
8099
|
-
const { rules: n } =
|
|
8100
|
-
() => (e || []).map((N,
|
|
8101
|
-
key: N.RuleId || N.Name || String(
|
|
8099
|
+
const { rules: n } = Fe(), [r, a] = g(!1), [i, l] = g(!1), [o, u] = g(s), [d, m] = g(), [S, p] = g([]), k = Se(() => t.map((N) => ({ label: N.userRoleName, value: N.userRoleId })), [t]), D = Se(() => (e || []).map((N) => ({ label: N.Name || "-", value: N.RuleId || N.Name || "" })), [e]), C = Se(
|
|
8100
|
+
() => (e || []).map((N, E) => ({
|
|
8101
|
+
key: N.RuleId || N.Name || String(E),
|
|
8102
8102
|
ruleName: N.Name || "-",
|
|
8103
8103
|
ruleDesc: N.Description || ""
|
|
8104
8104
|
})),
|
|
8105
8105
|
[e]
|
|
8106
8106
|
);
|
|
8107
|
-
|
|
8107
|
+
fe(() => {
|
|
8108
8108
|
let N = !1;
|
|
8109
8109
|
return (async () => {
|
|
8110
8110
|
try {
|
|
8111
8111
|
a(!0);
|
|
8112
|
-
const
|
|
8113
|
-
N || u(Array.isArray(
|
|
8112
|
+
const E = await n.getRules();
|
|
8113
|
+
N || u(Array.isArray(E) ? E : []);
|
|
8114
8114
|
} catch {
|
|
8115
8115
|
!N && Array.isArray(s) && u(s);
|
|
8116
8116
|
} finally {
|
|
@@ -8119,49 +8119,49 @@ function lc({ userRoles: t, rules: e, rawRules: s }) {
|
|
|
8119
8119
|
})(), () => {
|
|
8120
8120
|
N = !0;
|
|
8121
8121
|
};
|
|
8122
|
-
}, []),
|
|
8122
|
+
}, []), fe(() => {
|
|
8123
8123
|
!o && Array.isArray(s) && u(s);
|
|
8124
|
-
}, [s]),
|
|
8124
|
+
}, [s]), fe(() => {
|
|
8125
8125
|
if (!d || !Array.isArray(o)) {
|
|
8126
8126
|
p([]);
|
|
8127
8127
|
return;
|
|
8128
8128
|
}
|
|
8129
8129
|
const N = o.find(
|
|
8130
|
-
(
|
|
8131
|
-
),
|
|
8132
|
-
p(Array.isArray(
|
|
8130
|
+
(Z) => Z?.ruleId === d || Z?.RuleId === d || Z?.ruleName === d
|
|
8131
|
+
), E = N?.userRoleIds ?? N?.UserRoleIds;
|
|
8132
|
+
p(Array.isArray(E) ? E : []);
|
|
8133
8133
|
}, [d, o]);
|
|
8134
|
-
const
|
|
8134
|
+
const Y = Se(() => {
|
|
8135
8135
|
if (!Array.isArray(o) || !o.length) return {};
|
|
8136
8136
|
const N = {};
|
|
8137
|
-
for (const
|
|
8138
|
-
const
|
|
8139
|
-
(h) => h?.ruleId ===
|
|
8140
|
-
),
|
|
8141
|
-
|
|
8137
|
+
for (const E of C) {
|
|
8138
|
+
const Z = o.find(
|
|
8139
|
+
(h) => h?.ruleId === E.key || h?.ruleName === E.key || h?.RuleId === E.key || h?.ruleName === E.ruleName || h?.Name === E.ruleName
|
|
8140
|
+
), R = Z?.userRoleIds ?? Z?.UserRoleIds, q = Array.isArray(R) ? R : [];
|
|
8141
|
+
q.length && (N[E.key] = q);
|
|
8142
8142
|
}
|
|
8143
8143
|
return N;
|
|
8144
|
-
}, [o,
|
|
8144
|
+
}, [o, C]);
|
|
8145
8145
|
return /* @__PURE__ */ y("div", { className: "w-full", children: [
|
|
8146
8146
|
/* @__PURE__ */ c(oc, { level: 4, className: "!mb-4", children: "Alert Assignment" }),
|
|
8147
|
-
/* @__PURE__ */ c(Ts, { spinning: i || r, children: /* @__PURE__ */ y(
|
|
8148
|
-
/* @__PURE__ */ c(
|
|
8147
|
+
/* @__PURE__ */ c(Ts, { spinning: i || r, children: /* @__PURE__ */ y(Ue, { gutter: [16, 16], align: "bottom", className: "mb-6", children: [
|
|
8148
|
+
/* @__PURE__ */ c(J, { xs: 24, sm: 12, md: 8, lg: 6, children: /* @__PURE__ */ y("div", { children: [
|
|
8149
8149
|
/* @__PURE__ */ c(Hs, { className: "text-gray-700 font-medium block mb-1", children: "Rules" }),
|
|
8150
8150
|
/* @__PURE__ */ c(
|
|
8151
|
-
|
|
8151
|
+
Me,
|
|
8152
8152
|
{
|
|
8153
8153
|
placeholder: "Rules",
|
|
8154
8154
|
value: d,
|
|
8155
8155
|
onChange: m,
|
|
8156
|
-
options:
|
|
8156
|
+
options: D,
|
|
8157
8157
|
className: "w-full"
|
|
8158
8158
|
}
|
|
8159
8159
|
)
|
|
8160
8160
|
] }) }),
|
|
8161
|
-
/* @__PURE__ */ c(
|
|
8161
|
+
/* @__PURE__ */ c(J, { xs: 24, sm: 12, md: 8, lg: 8, children: /* @__PURE__ */ y("div", { children: [
|
|
8162
8162
|
/* @__PURE__ */ c(Hs, { className: "text-gray-700 font-medium block mb-1", children: "Alert Notification To" }),
|
|
8163
8163
|
/* @__PURE__ */ c(
|
|
8164
|
-
|
|
8164
|
+
Me,
|
|
8165
8165
|
{
|
|
8166
8166
|
mode: "multiple",
|
|
8167
8167
|
placeholder: "Select roles",
|
|
@@ -8174,39 +8174,39 @@ function lc({ userRoles: t, rules: e, rawRules: s }) {
|
|
|
8174
8174
|
}
|
|
8175
8175
|
)
|
|
8176
8176
|
] }) }),
|
|
8177
|
-
/* @__PURE__ */ c(
|
|
8178
|
-
/* @__PURE__ */ c(
|
|
8177
|
+
/* @__PURE__ */ c(J, { xs: 24, sm: 12, md: 8, lg: 4, children: /* @__PURE__ */ y("div", { className: "flex items-center gap-2", children: [
|
|
8178
|
+
/* @__PURE__ */ c(Le, { onClick: () => {
|
|
8179
8179
|
m(void 0), p([]);
|
|
8180
8180
|
}, disabled: i, children: "Cancel" }),
|
|
8181
8181
|
/* @__PURE__ */ c(
|
|
8182
|
-
|
|
8182
|
+
Le,
|
|
8183
8183
|
{
|
|
8184
8184
|
type: "primary",
|
|
8185
8185
|
onClick: async () => {
|
|
8186
8186
|
if (!d) {
|
|
8187
|
-
|
|
8187
|
+
be.info("Please select a rule");
|
|
8188
8188
|
return;
|
|
8189
8189
|
}
|
|
8190
8190
|
try {
|
|
8191
8191
|
l(!0);
|
|
8192
8192
|
const N = Array.isArray(o) ? o.find(
|
|
8193
8193
|
(h) => h?.ruleId === d || h?.RuleId === d || h?.ruleName === d
|
|
8194
|
-
) : void 0,
|
|
8195
|
-
if (!N || !
|
|
8194
|
+
) : void 0, E = typeof N?.recordId == "number" ? N.recordId : N?.ruleId || N?.RuleId || void 0;
|
|
8195
|
+
if (!N || !E)
|
|
8196
8196
|
throw new Error(`Unable to find rule identifier for rule ${d}`);
|
|
8197
|
-
const
|
|
8198
|
-
const v = t.find((
|
|
8197
|
+
const Z = S.map((h) => {
|
|
8198
|
+
const v = t.find((M) => M.userRoleId === h);
|
|
8199
8199
|
return { id: h, name: v?.userRoleName ?? String(h) };
|
|
8200
|
-
}),
|
|
8200
|
+
}), R = {
|
|
8201
8201
|
...N,
|
|
8202
8202
|
ruleId: d,
|
|
8203
8203
|
userRoleIds: S,
|
|
8204
|
-
userRoles:
|
|
8205
|
-
},
|
|
8206
|
-
if (!
|
|
8207
|
-
|
|
8204
|
+
userRoles: Z
|
|
8205
|
+
}, q = await n.updateRule(E, R);
|
|
8206
|
+
if (!q?.responseStatus && !q?.Success && !q?.success)
|
|
8207
|
+
be.error(q?.errorMessage || q?.Message || "Error saving Alert Assignment");
|
|
8208
8208
|
else {
|
|
8209
|
-
|
|
8209
|
+
be.success("Alert assignment saved"), m(void 0), p([]);
|
|
8210
8210
|
try {
|
|
8211
8211
|
const h = await n.getRules();
|
|
8212
8212
|
u(Array.isArray(h) ? h : []);
|
|
@@ -8215,7 +8215,7 @@ function lc({ userRoles: t, rules: e, rawRules: s }) {
|
|
|
8215
8215
|
}
|
|
8216
8216
|
}
|
|
8217
8217
|
} catch (N) {
|
|
8218
|
-
console.error("Failed to save alert assignment", N),
|
|
8218
|
+
console.error("Failed to save alert assignment", N), be.error(N instanceof Error ? N.message : "Error saving Alert Assignment");
|
|
8219
8219
|
} finally {
|
|
8220
8220
|
l(!1);
|
|
8221
8221
|
}
|
|
@@ -8231,12 +8231,12 @@ function lc({ userRoles: t, rules: e, rawRules: s }) {
|
|
|
8231
8231
|
on,
|
|
8232
8232
|
{
|
|
8233
8233
|
rowKey: "key",
|
|
8234
|
-
dataSource:
|
|
8234
|
+
dataSource: C,
|
|
8235
8235
|
loading: r,
|
|
8236
8236
|
pagination: {
|
|
8237
8237
|
pageSize: 10,
|
|
8238
8238
|
showSizeChanger: !0,
|
|
8239
|
-
showTotal: (N,
|
|
8239
|
+
showTotal: (N, E) => `${E[0]}-${E[1]} of ${N} items`
|
|
8240
8240
|
},
|
|
8241
8241
|
columns: [
|
|
8242
8242
|
{ title: "Rule Name", dataIndex: "ruleName", key: "ruleName" },
|
|
@@ -8244,11 +8244,11 @@ function lc({ userRoles: t, rules: e, rawRules: s }) {
|
|
|
8244
8244
|
{
|
|
8245
8245
|
title: "Alert Notification To",
|
|
8246
8246
|
key: "assign",
|
|
8247
|
-
render: (N,
|
|
8248
|
-
const
|
|
8249
|
-
return
|
|
8250
|
-
const
|
|
8251
|
-
return /* @__PURE__ */ c(
|
|
8247
|
+
render: (N, E) => {
|
|
8248
|
+
const Z = Y[E.key] ?? [];
|
|
8249
|
+
return Z.length ? /* @__PURE__ */ c("div", { className: "flex flex-wrap gap-1", children: Z.map((R) => {
|
|
8250
|
+
const q = t.find((h) => h.userRoleId === R);
|
|
8251
|
+
return /* @__PURE__ */ c(Rt, { children: q?.userRoleName ?? String(R) }, R);
|
|
8252
8252
|
}) }) : /* @__PURE__ */ c(Hs, { type: "secondary", children: "—" });
|
|
8253
8253
|
}
|
|
8254
8254
|
}
|
|
@@ -8257,7 +8257,7 @@ function lc({ userRoles: t, rules: e, rawRules: s }) {
|
|
|
8257
8257
|
)
|
|
8258
8258
|
] });
|
|
8259
8259
|
}
|
|
8260
|
-
const { Title: lr } =
|
|
8260
|
+
const { Title: lr } = jt;
|
|
8261
8261
|
function Gs(t) {
|
|
8262
8262
|
return !t || typeof t != "object" ? {} : {
|
|
8263
8263
|
level1UserRoleId: t.level1UserRoleId ?? t.Level1UserRoleId,
|
|
@@ -8273,126 +8273,126 @@ function Gs(t) {
|
|
|
8273
8273
|
};
|
|
8274
8274
|
}
|
|
8275
8275
|
function cc({ severities: t, rules: e, userRoles: s, rawRules: n, loadingRules: r, onSave: a }) {
|
|
8276
|
-
const { rules: i, alerts: l } =
|
|
8277
|
-
|
|
8278
|
-
n && n.length &&
|
|
8279
|
-
}, [n]),
|
|
8280
|
-
if (!
|
|
8281
|
-
const
|
|
8282
|
-
if (yt.length && !
|
|
8283
|
-
const
|
|
8284
|
-
const
|
|
8276
|
+
const { rules: i, alerts: l } = Fe(), [o, u] = g("By Severity"), [d, m] = g("By severity"), [S, p] = g("By Severity"), [k, D] = g(!1), [C, Y] = g(!1), [$, W] = g(!1), [N, E] = g(null), [Z, R] = g("rules"), [q, h] = g(), [v, M] = g(), [le, ae] = g(), [L, A] = g(), [w, x] = g(), [T, U] = g(), [P, j] = g(), [K, te] = g(), [se, X] = g([]), [Ae, ce] = g([]), [he, Te] = g(!1), [ie, oe] = g(!1), [ke, Ze] = g({}), [Be, lt] = g({}), [ct, Nt] = g(s || []), [yt, bt] = g([]), [ne, H] = g(!1), [we, ue] = g(!1), [ge, $e] = g(n || []);
|
|
8277
|
+
fe(() => {
|
|
8278
|
+
n && n.length && $e(n);
|
|
8279
|
+
}, [n]), fe(() => {
|
|
8280
|
+
if (!ge || !ge.length) return;
|
|
8281
|
+
const F = Object.keys(ke).length > 0 || Object.keys(Be).length > 0;
|
|
8282
|
+
if (yt.length && !F) return;
|
|
8283
|
+
const V = ge.map((_, f) => {
|
|
8284
|
+
const O = e.find((Ee) => Ee.RuleId === (_.ruleId || _.ruleName))?.Name || _.ruleName || _.Name || "-", I = Gs(_.escalationSettings), G = typeof I.level1UserRoleId == "number" && I.level1UserRoleId > 0 ? [I.level1UserRoleId] : [], Oe = typeof I.level2UserRoleId == "number" && I.level2UserRoleId > 0 ? [I.level2UserRoleId] : [], de = typeof I.level3UserRoleId == "number" && I.level3UserRoleId > 0 ? [I.level3UserRoleId] : [], nt = (Array.isArray(I.escalationSettingsActionTypeIds) ? I.escalationSettingsActionTypeIds : []).map((Ee) => ke[Ee] || String(Ee)), wn = (Array.isArray(I.thirdPartyId) ? I.thirdPartyId : []).map((Ee) => Be[Ee] || String(Ee)), Ds = typeof I.humanLoop == "boolean" ? I.humanLoop : null, Cs = typeof I.isAutoExpire == "boolean" ? I.isAutoExpire : null;
|
|
8285
8285
|
return {
|
|
8286
|
-
id: String(
|
|
8287
|
-
ruleOrSeverityLabel:
|
|
8288
|
-
l1: { minutes:
|
|
8289
|
-
l2: { minutes:
|
|
8290
|
-
l3: { minutes:
|
|
8286
|
+
id: String(_.ruleId || _.ruleName || f),
|
|
8287
|
+
ruleOrSeverityLabel: O,
|
|
8288
|
+
l1: { minutes: I.level1PostAssistTime ?? void 0, roles: G },
|
|
8289
|
+
l2: { minutes: I.level2PostAssistTime ?? void 0, roles: Oe },
|
|
8290
|
+
l3: { minutes: I.level3PostAssistTime ?? void 0, roles: de },
|
|
8291
8291
|
actions: nt,
|
|
8292
8292
|
notify: wn,
|
|
8293
8293
|
humanLoop: Ds,
|
|
8294
8294
|
isAutoExpire: Cs
|
|
8295
8295
|
};
|
|
8296
8296
|
});
|
|
8297
|
-
|
|
8298
|
-
}, [
|
|
8299
|
-
const
|
|
8300
|
-
() => t.map((
|
|
8297
|
+
bt(V);
|
|
8298
|
+
}, [ge, e, ke, Be]);
|
|
8299
|
+
const _e = Se(
|
|
8300
|
+
() => t.map((F) => ({ label: F.DisplayName, value: F.SeverityId })),
|
|
8301
8301
|
[t]
|
|
8302
|
-
),
|
|
8303
|
-
() => e.map((
|
|
8302
|
+
), ze = Se(
|
|
8303
|
+
() => e.map((F) => ({ label: F.Name, value: F.RuleId })),
|
|
8304
8304
|
[e]
|
|
8305
|
-
),
|
|
8306
|
-
() => ct.map((
|
|
8305
|
+
), Ne = Se(
|
|
8306
|
+
() => ct.map((F) => ({ label: F.userRoleName, value: F.userRoleId })),
|
|
8307
8307
|
[ct]
|
|
8308
|
-
),
|
|
8309
|
-
|
|
8310
|
-
let
|
|
8311
|
-
async function
|
|
8308
|
+
), pt = Se(() => [1, 3, 5, 10, 15, 20, 30, 45, 60].map((F) => ({ label: `${F}`, value: F })), []);
|
|
8309
|
+
fe(() => {
|
|
8310
|
+
let F = !1;
|
|
8311
|
+
async function V() {
|
|
8312
8312
|
try {
|
|
8313
|
-
W(!0),
|
|
8314
|
-
const
|
|
8315
|
-
if (!
|
|
8316
|
-
const f = fr(
|
|
8317
|
-
u(f), p(f),
|
|
8313
|
+
W(!0), E(null);
|
|
8314
|
+
const _ = await l.getAdminSettings();
|
|
8315
|
+
if (!F && _) {
|
|
8316
|
+
const f = fr(_.sortBy);
|
|
8317
|
+
u(f), p(f), D(!1);
|
|
8318
8318
|
}
|
|
8319
|
-
} catch (
|
|
8320
|
-
if (!
|
|
8321
|
-
const f =
|
|
8322
|
-
|
|
8319
|
+
} catch (_) {
|
|
8320
|
+
if (!F) {
|
|
8321
|
+
const f = _ instanceof Error ? _.message : "Failed to load admin settings";
|
|
8322
|
+
E(f);
|
|
8323
8323
|
}
|
|
8324
8324
|
} finally {
|
|
8325
|
-
|
|
8325
|
+
F || W(!1);
|
|
8326
8326
|
}
|
|
8327
8327
|
}
|
|
8328
|
-
return
|
|
8329
|
-
|
|
8328
|
+
return V(), () => {
|
|
8329
|
+
F = !0;
|
|
8330
8330
|
};
|
|
8331
|
-
}, []),
|
|
8331
|
+
}, []), fe(() => {
|
|
8332
8332
|
if (!v) return;
|
|
8333
|
-
const
|
|
8334
|
-
const
|
|
8335
|
-
return !isNaN(
|
|
8336
|
-
},
|
|
8337
|
-
const
|
|
8338
|
-
return !isNaN(
|
|
8339
|
-
},
|
|
8340
|
-
(
|
|
8341
|
-
), f = Gs(
|
|
8333
|
+
const F = (O) => {
|
|
8334
|
+
const I = Number(O);
|
|
8335
|
+
return !isNaN(I) && I > 0 ? I : void 0;
|
|
8336
|
+
}, V = (O) => {
|
|
8337
|
+
const I = Number(O);
|
|
8338
|
+
return !isNaN(I) && I > 0 ? I : void 0;
|
|
8339
|
+
}, _ = (ge || []).find(
|
|
8340
|
+
(O) => O?.ruleId === v || O?.ruleName === v || O?.RuleId === v
|
|
8341
|
+
), f = Gs(_?.escalationSettings);
|
|
8342
8342
|
if (f && typeof f == "object") {
|
|
8343
|
-
ae(
|
|
8344
|
-
const
|
|
8345
|
-
X(
|
|
8343
|
+
ae(V(f.level1PostAssistTime)), A(F(f.level1UserRoleId)), x(V(f.level2PostAssistTime)), U(F(f.level2UserRoleId)), j(V(f.level3PostAssistTime)), te(F(f.level3UserRoleId));
|
|
8344
|
+
const O = Array.isArray(f.escalationSettingsActionTypeIds) ? f.escalationSettingsActionTypeIds : [];
|
|
8345
|
+
X(O.map((I) => String(I))), ce(Array.isArray(f.thirdPartyId) ? f.thirdPartyId : []), Te(!!f.humanLoop), oe(!!f.isAutoExpire);
|
|
8346
8346
|
}
|
|
8347
|
-
}, [
|
|
8348
|
-
const
|
|
8347
|
+
}, [Z, v, ge]);
|
|
8348
|
+
const gt = async () => {
|
|
8349
8349
|
try {
|
|
8350
|
-
|
|
8351
|
-
const
|
|
8352
|
-
|
|
8353
|
-
const
|
|
8354
|
-
const
|
|
8350
|
+
ue(!0);
|
|
8351
|
+
const F = await i.getRules(), V = Array.isArray(F) ? F : Array.isArray(F?.data) ? F.data : [];
|
|
8352
|
+
$e(V);
|
|
8353
|
+
const _ = V.map((f, O) => {
|
|
8354
|
+
const I = e.find((Ee) => Ee.RuleId === (f.ruleId || f.ruleName))?.Name || f.ruleName || f.Name || "-", G = Gs(f.escalationSettings ?? f.EscalationSettings), Oe = typeof G.level1UserRoleId == "number" && G.level1UserRoleId > 0 ? [G.level1UserRoleId] : [], de = typeof G.level2UserRoleId == "number" && G.level2UserRoleId > 0 ? [G.level2UserRoleId] : [], Je = typeof G.level3UserRoleId == "number" && G.level3UserRoleId > 0 ? [G.level3UserRoleId] : [], tt = (Array.isArray(G.escalationSettingsActionTypeIds) ? G.escalationSettingsActionTypeIds : []).map((Ee) => ke[Ee] || String(Ee)), Ds = (Array.isArray(G.thirdPartyId) ? G.thirdPartyId : []).map((Ee) => Be[Ee] || String(Ee)), Cs = typeof G.humanLoop == "boolean" ? G.humanLoop : null;
|
|
8355
8355
|
return {
|
|
8356
|
-
id: String(f.ruleId || f.ruleName ||
|
|
8357
|
-
ruleOrSeverityLabel:
|
|
8358
|
-
l1: { minutes:
|
|
8359
|
-
l2: { minutes:
|
|
8360
|
-
l3: { minutes:
|
|
8356
|
+
id: String(f.ruleId || f.ruleName || O),
|
|
8357
|
+
ruleOrSeverityLabel: I,
|
|
8358
|
+
l1: { minutes: G.level1PostAssistTime ?? void 0, roles: Oe },
|
|
8359
|
+
l2: { minutes: G.level2PostAssistTime ?? void 0, roles: de },
|
|
8360
|
+
l3: { minutes: G.level3PostAssistTime ?? void 0, roles: Je },
|
|
8361
8361
|
actions: tt,
|
|
8362
8362
|
notify: Ds,
|
|
8363
8363
|
humanLoop: Cs
|
|
8364
8364
|
};
|
|
8365
8365
|
});
|
|
8366
|
-
|
|
8367
|
-
} catch (
|
|
8368
|
-
console.error("Failed to refetch entries",
|
|
8366
|
+
bt(_);
|
|
8367
|
+
} catch (F) {
|
|
8368
|
+
console.error("Failed to refetch entries", F);
|
|
8369
8369
|
} finally {
|
|
8370
|
-
|
|
8370
|
+
ue(!1);
|
|
8371
8371
|
}
|
|
8372
8372
|
};
|
|
8373
|
-
return
|
|
8374
|
-
let
|
|
8373
|
+
return fe(() => {
|
|
8374
|
+
let F = !1;
|
|
8375
8375
|
return (async () => {
|
|
8376
8376
|
try {
|
|
8377
|
-
const
|
|
8378
|
-
if (
|
|
8379
|
-
const
|
|
8380
|
-
if (Array.isArray(
|
|
8381
|
-
for (const
|
|
8382
|
-
const
|
|
8383
|
-
typeof
|
|
8377
|
+
const V = await i.getLookups();
|
|
8378
|
+
if (F || !V) return;
|
|
8379
|
+
const _ = {};
|
|
8380
|
+
if (Array.isArray(V.thirdParties))
|
|
8381
|
+
for (const O of V.thirdParties) {
|
|
8382
|
+
const I = O.thirdPartyIds ?? O.thirdPartyId;
|
|
8383
|
+
typeof I == "number" && (_[I] = O.thirdPartyName);
|
|
8384
8384
|
}
|
|
8385
|
-
lt(
|
|
8386
|
-
const f = Array.isArray(
|
|
8387
|
-
userRoleId:
|
|
8388
|
-
userRoleName:
|
|
8385
|
+
lt(_);
|
|
8386
|
+
const f = Array.isArray(V.userRoles) ? V.userRoles.map((O) => ({
|
|
8387
|
+
userRoleId: O.userRoleId ?? O.id,
|
|
8388
|
+
userRoleName: O.userRoleName ?? O.name
|
|
8389
8389
|
})) : [];
|
|
8390
|
-
|
|
8391
|
-
} catch (
|
|
8392
|
-
console.error("Error loading lookups",
|
|
8390
|
+
F || Nt(f.length ? f : s || []);
|
|
8391
|
+
} catch (V) {
|
|
8392
|
+
console.error("Error loading lookups", V);
|
|
8393
8393
|
}
|
|
8394
8394
|
})(), () => {
|
|
8395
|
-
|
|
8395
|
+
F = !0;
|
|
8396
8396
|
};
|
|
8397
8397
|
}, []), /* @__PURE__ */ y("div", { className: "w-full", children: [
|
|
8398
8398
|
/* @__PURE__ */ y("div", { className: "mb-6", children: [
|
|
@@ -8407,177 +8407,177 @@ function cc({ severities: t, rules: e, userRoles: s, rawRules: n, loadingRules:
|
|
|
8407
8407
|
{
|
|
8408
8408
|
sortBy: o,
|
|
8409
8409
|
groupBy: d,
|
|
8410
|
-
onChange: (
|
|
8411
|
-
|
|
8410
|
+
onChange: (F) => {
|
|
8411
|
+
F.sortBy && (u(F.sortBy), D(!0)), F.groupBy && (m(F.groupBy), D(!0));
|
|
8412
8412
|
},
|
|
8413
8413
|
showActions: k,
|
|
8414
8414
|
onSave: async () => {
|
|
8415
|
-
|
|
8415
|
+
Y(!0);
|
|
8416
8416
|
try {
|
|
8417
|
-
const
|
|
8418
|
-
|
|
8419
|
-
} catch (
|
|
8420
|
-
console.error("Error saving admin settings",
|
|
8417
|
+
const F = await l.setAdminSettings({ sortBy: o, groupBy: "string" });
|
|
8418
|
+
F?.responseStatus && F?.data && be.success(F.data), p(o), D(!1);
|
|
8419
|
+
} catch (F) {
|
|
8420
|
+
console.error("Error saving admin settings", F);
|
|
8421
8421
|
} finally {
|
|
8422
|
-
|
|
8422
|
+
Y(!1);
|
|
8423
8423
|
}
|
|
8424
8424
|
},
|
|
8425
8425
|
onClear: () => {
|
|
8426
|
-
u(S),
|
|
8426
|
+
u(S), D(!1);
|
|
8427
8427
|
},
|
|
8428
|
-
saving:
|
|
8428
|
+
saving: C
|
|
8429
8429
|
}
|
|
8430
8430
|
)
|
|
8431
8431
|
] })
|
|
8432
8432
|
] }),
|
|
8433
|
-
/* @__PURE__ */ c(
|
|
8433
|
+
/* @__PURE__ */ c(Zt, { className: "my-6" }),
|
|
8434
8434
|
/* @__PURE__ */ y("div", { children: [
|
|
8435
8435
|
/* @__PURE__ */ c(lr, { level: 4, className: "!mb-4", children: "Escalation Settings" }),
|
|
8436
8436
|
/* @__PURE__ */ c(
|
|
8437
8437
|
ac,
|
|
8438
8438
|
{
|
|
8439
|
-
escBasis:
|
|
8440
|
-
setEscBasis:
|
|
8441
|
-
selectedSeverity:
|
|
8439
|
+
escBasis: Z,
|
|
8440
|
+
setEscBasis: R,
|
|
8441
|
+
selectedSeverity: q,
|
|
8442
8442
|
setSelectedSeverity: h,
|
|
8443
8443
|
selectedRule: v,
|
|
8444
|
-
setSelectedRule:
|
|
8445
|
-
severityOptions:
|
|
8446
|
-
ruleOptions:
|
|
8447
|
-
minsOptions:
|
|
8448
|
-
roleOptions:
|
|
8444
|
+
setSelectedRule: M,
|
|
8445
|
+
severityOptions: _e,
|
|
8446
|
+
ruleOptions: ze,
|
|
8447
|
+
minsOptions: pt,
|
|
8448
|
+
roleOptions: Ne,
|
|
8449
8449
|
l1mins: le,
|
|
8450
8450
|
setL1mins: ae,
|
|
8451
|
-
l1role:
|
|
8451
|
+
l1role: L,
|
|
8452
8452
|
setL1role: A,
|
|
8453
8453
|
l2mins: w,
|
|
8454
|
-
setL2mins:
|
|
8454
|
+
setL2mins: x,
|
|
8455
8455
|
l2role: T,
|
|
8456
|
-
setL2role:
|
|
8456
|
+
setL2role: U,
|
|
8457
8457
|
l3mins: P,
|
|
8458
|
-
setL3mins:
|
|
8459
|
-
l3role:
|
|
8460
|
-
setL3role:
|
|
8461
|
-
actions:
|
|
8458
|
+
setL3mins: j,
|
|
8459
|
+
l3role: K,
|
|
8460
|
+
setL3role: te,
|
|
8461
|
+
actions: se,
|
|
8462
8462
|
setActions: X,
|
|
8463
|
-
thirdPartyIds:
|
|
8464
|
-
setThirdPartyIds:
|
|
8463
|
+
thirdPartyIds: Ae,
|
|
8464
|
+
setThirdPartyIds: ce,
|
|
8465
8465
|
humanLoop: he,
|
|
8466
|
-
setHumanLoop:
|
|
8466
|
+
setHumanLoop: Te,
|
|
8467
8467
|
onClear: () => {
|
|
8468
|
-
u("By Severity"), m("By severity"),
|
|
8468
|
+
u("By Severity"), m("By severity"), R("rules"), h(void 0), M(void 0), ae(void 0), A(void 0), x(void 0), U(void 0), j(void 0), te(void 0), X([]), ce([]), Te(!1), oe(!1);
|
|
8469
8469
|
},
|
|
8470
8470
|
onSave: async () => {
|
|
8471
|
-
|
|
8471
|
+
H(!0), a?.({
|
|
8472
8472
|
ruleId: v,
|
|
8473
8473
|
levels: [
|
|
8474
|
-
{ minutes: le, role:
|
|
8474
|
+
{ minutes: le, role: L },
|
|
8475
8475
|
{ minutes: w, role: T },
|
|
8476
|
-
{ minutes: P, role:
|
|
8476
|
+
{ minutes: P, role: K }
|
|
8477
8477
|
],
|
|
8478
|
-
actions:
|
|
8479
|
-
thirdPartyIds:
|
|
8478
|
+
actions: se,
|
|
8479
|
+
thirdPartyIds: Ae,
|
|
8480
8480
|
humanLoop: he,
|
|
8481
8481
|
isAutoExpire: ie
|
|
8482
8482
|
});
|
|
8483
8483
|
try {
|
|
8484
8484
|
if (v) {
|
|
8485
|
-
const
|
|
8486
|
-
(
|
|
8487
|
-
), f = typeof
|
|
8488
|
-
if (!
|
|
8489
|
-
|
|
8485
|
+
const V = Array.isArray(se) ? se.map((G) => Number.isNaN(Number(G)) ? G : Number(G)) : [], _ = (ge || []).find(
|
|
8486
|
+
(G) => G?.ruleId === v || G?.ruleName === v || G?.RuleId === v
|
|
8487
|
+
), f = typeof _?.recordId == "number" ? _.recordId : _?.ruleId || _?.RuleId || void 0;
|
|
8488
|
+
if (!_ || !f) {
|
|
8489
|
+
be.error("Unable to find rule identifier for update");
|
|
8490
8490
|
return;
|
|
8491
8491
|
}
|
|
8492
|
-
const
|
|
8493
|
-
...
|
|
8492
|
+
const O = {
|
|
8493
|
+
..._,
|
|
8494
8494
|
escalationSettings: {
|
|
8495
|
-
level1UserRoleId:
|
|
8495
|
+
level1UserRoleId: L ?? 0,
|
|
8496
8496
|
level1PostAssistTime: le ?? 0,
|
|
8497
8497
|
level2UserRoleId: T ?? 0,
|
|
8498
8498
|
level2PostAssistTime: w ?? 0,
|
|
8499
|
-
level3UserRoleId:
|
|
8499
|
+
level3UserRoleId: K ?? 0,
|
|
8500
8500
|
level3PostAssistTime: P ?? 0,
|
|
8501
|
-
escalationSettingsActionTypeIds:
|
|
8502
|
-
thirdPartyId: Array.isArray(
|
|
8501
|
+
escalationSettingsActionTypeIds: V,
|
|
8502
|
+
thirdPartyId: Array.isArray(Ae) ? Ae : [],
|
|
8503
8503
|
humanLoop: he,
|
|
8504
8504
|
isAutoExpire: ie
|
|
8505
8505
|
}
|
|
8506
|
-
},
|
|
8507
|
-
|
|
8506
|
+
}, I = await i.updateRule(f, O);
|
|
8507
|
+
I?.responseStatus || I?.Success || I?.success ? (be.success("Escalation settings saved"), await gt(), M(void 0), ae(void 0), A(void 0), x(void 0), U(void 0), j(void 0), te(void 0), X([]), ce([]), Te(!1), oe(!1)) : be.error(I?.errorMessage || I?.Message || "Error saving Escalation Settings");
|
|
8508
8508
|
}
|
|
8509
|
-
} catch (
|
|
8510
|
-
console.error("Error saving escalation settings",
|
|
8509
|
+
} catch (V) {
|
|
8510
|
+
console.error("Error saving escalation settings", V);
|
|
8511
8511
|
} finally {
|
|
8512
|
-
|
|
8512
|
+
H(!1);
|
|
8513
8513
|
}
|
|
8514
8514
|
},
|
|
8515
|
-
saving:
|
|
8516
|
-
onActionTypesLoaded: (
|
|
8517
|
-
const
|
|
8518
|
-
for (const
|
|
8519
|
-
typeof
|
|
8520
|
-
Ze(
|
|
8515
|
+
saving: ne,
|
|
8516
|
+
onActionTypesLoaded: (F) => {
|
|
8517
|
+
const V = {};
|
|
8518
|
+
for (const _ of F)
|
|
8519
|
+
typeof _.actionTypeId == "number" && (V[_.actionTypeId] = _.name);
|
|
8520
|
+
Ze(V);
|
|
8521
8521
|
},
|
|
8522
8522
|
isAutoExpire: ie,
|
|
8523
|
-
setAutoExpire:
|
|
8523
|
+
setAutoExpire: oe
|
|
8524
8524
|
}
|
|
8525
8525
|
)
|
|
8526
8526
|
] }),
|
|
8527
|
-
/* @__PURE__ */ c(
|
|
8527
|
+
/* @__PURE__ */ c(Zt, { className: "my-6" }),
|
|
8528
8528
|
/* @__PURE__ */ c(
|
|
8529
8529
|
ic,
|
|
8530
8530
|
{
|
|
8531
8531
|
entries: yt,
|
|
8532
8532
|
userRoles: ct,
|
|
8533
|
-
loading:
|
|
8534
|
-
onEdit: (
|
|
8535
|
-
|
|
8536
|
-
const
|
|
8537
|
-
|
|
8533
|
+
loading: we || r,
|
|
8534
|
+
onEdit: (F) => {
|
|
8535
|
+
R("rules");
|
|
8536
|
+
const V = yt.find((f) => f.id === F), _ = e.find((f) => f.RuleId === F) || (V ? e.find((f) => f.Name === V.ruleOrSeverityLabel) : void 0);
|
|
8537
|
+
M(_ ? _.RuleId : F);
|
|
8538
8538
|
}
|
|
8539
8539
|
}
|
|
8540
8540
|
),
|
|
8541
|
-
/* @__PURE__ */ c(
|
|
8541
|
+
/* @__PURE__ */ c(Zt, { className: "my-6" }),
|
|
8542
8542
|
/* @__PURE__ */ c(lc, { userRoles: ct, rules: e, rawRules: n }),
|
|
8543
|
-
/* @__PURE__ */ c(
|
|
8543
|
+
/* @__PURE__ */ c(Zt, {})
|
|
8544
8544
|
] });
|
|
8545
8545
|
}
|
|
8546
|
-
const { Title: cr, Text: ds } =
|
|
8546
|
+
const { Title: cr, Text: ds } = jt;
|
|
8547
8547
|
function Dc({ severities: t, rules: e, onSave: s, onCancel: n }) {
|
|
8548
|
-
const { rules: r, alerts: a } =
|
|
8548
|
+
const { rules: r, alerts: a } = Fe(), i = [
|
|
8549
8549
|
{ label: "By Severity", value: "By Severity" },
|
|
8550
8550
|
{ label: "By Created Date", value: "By Created Date" }
|
|
8551
|
-
], [l, o] = g("By Severity"), [u, d] = g(/* @__PURE__ */ new Set()), [m, S] = g(null), [p, k] = g(null), [
|
|
8552
|
-
|
|
8551
|
+
], [l, o] = g("By Severity"), [u, d] = g(/* @__PURE__ */ new Set()), [m, S] = g(null), [p, k] = g(null), [D, C] = g({ inApp: !1, sms: !1, email: !1 }), [Y, $] = g([]), [W, N] = g(!0), [E, Z] = g(!1);
|
|
8552
|
+
fe(() => {
|
|
8553
8553
|
let h = !1;
|
|
8554
8554
|
return (async () => {
|
|
8555
8555
|
try {
|
|
8556
8556
|
const v = await a.getPreferenceSettings();
|
|
8557
8557
|
if (h || !v) return;
|
|
8558
|
-
|
|
8558
|
+
C({
|
|
8559
8559
|
inApp: !!v.inApp,
|
|
8560
8560
|
//convert to bool - as the resp is str
|
|
8561
8561
|
sms: !!v.sms,
|
|
8562
8562
|
email: !!v.email
|
|
8563
8563
|
});
|
|
8564
|
-
const
|
|
8565
|
-
o(
|
|
8564
|
+
const M = fr(v.sortBy);
|
|
8565
|
+
o(M === "By Created Date" ? "By Created Date" : "By Severity"), S(En(v.doNotDisturbStart)), k(En(v.doNotDisturbEnd)), Array.isArray(v.anomalyIds) && d(new Set(v.anomalyIds.map((le) => String(le))));
|
|
8566
8566
|
} catch (v) {
|
|
8567
8567
|
console.error("Error in loading my preferences: ", v);
|
|
8568
8568
|
}
|
|
8569
8569
|
})(), () => {
|
|
8570
8570
|
h = !0;
|
|
8571
8571
|
};
|
|
8572
|
-
}, []),
|
|
8572
|
+
}, []), fe(() => {
|
|
8573
8573
|
let h = !1;
|
|
8574
8574
|
return (async () => {
|
|
8575
8575
|
try {
|
|
8576
8576
|
N(!0);
|
|
8577
8577
|
const v = await r.getLookups();
|
|
8578
8578
|
if (h || !v) return;
|
|
8579
|
-
const
|
|
8580
|
-
$(
|
|
8579
|
+
const M = Array.isArray(v.anomalies) ? v.anomalies : [];
|
|
8580
|
+
$(M);
|
|
8581
8581
|
} catch (v) {
|
|
8582
8582
|
console.error("Failed to load anomalies lookups", v);
|
|
8583
8583
|
} finally {
|
|
@@ -8587,12 +8587,12 @@ function Dc({ severities: t, rules: e, onSave: s, onCancel: n }) {
|
|
|
8587
8587
|
h = !0;
|
|
8588
8588
|
};
|
|
8589
8589
|
}, []);
|
|
8590
|
-
const
|
|
8590
|
+
const R = (h) => {
|
|
8591
8591
|
d((v) => {
|
|
8592
|
-
const
|
|
8593
|
-
return
|
|
8592
|
+
const M = new Set(v);
|
|
8593
|
+
return M.has(h) ? M.delete(h) : M.add(h), M;
|
|
8594
8594
|
});
|
|
8595
|
-
},
|
|
8595
|
+
}, q = async () => {
|
|
8596
8596
|
s?.({
|
|
8597
8597
|
sortBy: l,
|
|
8598
8598
|
subscribedRuleIds: Array.from(u),
|
|
@@ -8600,41 +8600,41 @@ function Dc({ severities: t, rules: e, onSave: s, onCancel: n }) {
|
|
|
8600
8600
|
from: m,
|
|
8601
8601
|
to: p
|
|
8602
8602
|
},
|
|
8603
|
-
channels:
|
|
8603
|
+
channels: D
|
|
8604
8604
|
});
|
|
8605
8605
|
try {
|
|
8606
|
-
|
|
8607
|
-
const h = m ? m.format?.("HH:mm:ss") ?? "00:00:00" : "00:00:00", v = p ? p.format?.("HH:mm:ss") ?? "00:00:00" : "00:00:00",
|
|
8608
|
-
anomalyIds:
|
|
8606
|
+
Z(!0);
|
|
8607
|
+
const h = m ? m.format?.("HH:mm:ss") ?? "00:00:00" : "00:00:00", v = p ? p.format?.("HH:mm:ss") ?? "00:00:00" : "00:00:00", M = Array.from(u).map((ae) => Number(ae)).filter((ae) => Number.isFinite(ae)), le = await a.setPreferenceSettings({
|
|
8608
|
+
anomalyIds: M,
|
|
8609
8609
|
doNotDisturbStart: h,
|
|
8610
8610
|
doNotDisturbEnd: v,
|
|
8611
|
-
inApp: !!
|
|
8612
|
-
sms: !!
|
|
8613
|
-
email: !!
|
|
8611
|
+
inApp: !!D.inApp,
|
|
8612
|
+
sms: !!D.sms,
|
|
8613
|
+
email: !!D.email,
|
|
8614
8614
|
sortBy: l
|
|
8615
8615
|
});
|
|
8616
|
-
le?.responseStatus &&
|
|
8616
|
+
le?.responseStatus && be.success(le?.data || "Preferences updated successfully.");
|
|
8617
8617
|
} catch (h) {
|
|
8618
8618
|
console.error("Error in saving my preferences: ", h);
|
|
8619
8619
|
} finally {
|
|
8620
|
-
|
|
8620
|
+
Z(!1);
|
|
8621
8621
|
}
|
|
8622
8622
|
};
|
|
8623
8623
|
return /* @__PURE__ */ y("div", { className: "w-full", children: [
|
|
8624
|
-
/* @__PURE__ */ c(
|
|
8624
|
+
/* @__PURE__ */ c(Ue, { gutter: [16, 16], align: "middle", className: "mb-4", children: /* @__PURE__ */ c(J, { xs: 24, md: 8, children: /* @__PURE__ */ y(st, { direction: "horizontal", size: 12, className: "w-full items-center", children: [
|
|
8625
8625
|
/* @__PURE__ */ c(ds, { className: "text-gray-600", children: "Sort By:" }),
|
|
8626
|
-
/* @__PURE__ */ c(
|
|
8626
|
+
/* @__PURE__ */ c(Me, { className: "w-[240px]", value: l, options: i, onChange: o })
|
|
8627
8627
|
] }) }) }),
|
|
8628
8628
|
/* @__PURE__ */ y("div", { className: "mb-4", children: [
|
|
8629
8629
|
/* @__PURE__ */ c(cr, { level: 5, className: "!mb-2", children: "Anomalies" }),
|
|
8630
|
-
W ? /* @__PURE__ */ c("div", { className: "py-4", children: /* @__PURE__ */ c(Ts, {}) }) : /* @__PURE__ */ c(st, { direction: "vertical", size: 10, className: "w-full", children: (Array.isArray(
|
|
8631
|
-
const v = String(h.recordId),
|
|
8632
|
-
return /* @__PURE__ */ c(
|
|
8630
|
+
W ? /* @__PURE__ */ c("div", { className: "py-4", children: /* @__PURE__ */ c(Ts, {}) }) : /* @__PURE__ */ c(st, { direction: "vertical", size: 10, className: "w-full", children: (Array.isArray(Y) ? Y : []).map((h) => {
|
|
8631
|
+
const v = String(h.recordId), M = h.anomalyName;
|
|
8632
|
+
return /* @__PURE__ */ c(Et, { checked: u.has(v), onChange: () => R(v), children: M }, v);
|
|
8633
8633
|
}) })
|
|
8634
8634
|
] }),
|
|
8635
8635
|
/* @__PURE__ */ y("div", { className: "mb-4", children: [
|
|
8636
8636
|
/* @__PURE__ */ c(cr, { level: 5, className: "!mb-2", children: "Notification Timing & Channels" }),
|
|
8637
|
-
/* @__PURE__ */ c(
|
|
8637
|
+
/* @__PURE__ */ c(Ue, { gutter: [16, 16], align: "middle", className: "mb-3", children: /* @__PURE__ */ c(J, { xs: 24, md: 12, children: /* @__PURE__ */ y(st, { direction: "horizontal", size: 12, className: "w-full items-center", children: [
|
|
8638
8638
|
/* @__PURE__ */ c(ds, { children: "Do Not Disturb mode:" }),
|
|
8639
8639
|
/* @__PURE__ */ y(st, { size: 12, className: "w-full", children: [
|
|
8640
8640
|
/* @__PURE__ */ y(st, { direction: "horizontal", size: 8, className: "items-center", children: [
|
|
@@ -8647,16 +8647,16 @@ function Dc({ severities: t, rules: e, onSave: s, onCancel: n }) {
|
|
|
8647
8647
|
] })
|
|
8648
8648
|
] })
|
|
8649
8649
|
] }) }) }),
|
|
8650
|
-
/* @__PURE__ */ y(
|
|
8651
|
-
/* @__PURE__ */ c(
|
|
8652
|
-
/* @__PURE__ */ c(
|
|
8653
|
-
/* @__PURE__ */ c(
|
|
8650
|
+
/* @__PURE__ */ y(Ue, { gutter: [24, 12], children: [
|
|
8651
|
+
/* @__PURE__ */ c(J, { children: /* @__PURE__ */ c(Et, { checked: D.inApp, onChange: (h) => C({ ...D, inApp: h.target.checked }), children: "In-app" }) }),
|
|
8652
|
+
/* @__PURE__ */ c(J, { children: /* @__PURE__ */ c(Et, { checked: D.sms, onChange: (h) => C({ ...D, sms: h.target.checked }), children: "SMS" }) }),
|
|
8653
|
+
/* @__PURE__ */ c(J, { children: /* @__PURE__ */ c(Et, { checked: D.email, onChange: (h) => C({ ...D, email: h.target.checked }), children: "Email" }) })
|
|
8654
8654
|
] })
|
|
8655
8655
|
] }),
|
|
8656
|
-
/* @__PURE__ */ c(
|
|
8656
|
+
/* @__PURE__ */ c(Zt, {}),
|
|
8657
8657
|
/* @__PURE__ */ y(st, { className: "gap-3", children: [
|
|
8658
|
-
/* @__PURE__ */ c(
|
|
8659
|
-
/* @__PURE__ */ c(
|
|
8658
|
+
/* @__PURE__ */ c(Le, { onClick: n, disabled: E, children: "Cancel" }),
|
|
8659
|
+
/* @__PURE__ */ c(Le, { type: "primary", onClick: q, loading: E, children: "Save" })
|
|
8660
8660
|
] })
|
|
8661
8661
|
] });
|
|
8662
8662
|
}
|
|
@@ -8665,8 +8665,8 @@ function uc({ severities: t, rules: e, userRoles: s, rawRules: n, loadingRules:
|
|
|
8665
8665
|
}
|
|
8666
8666
|
const dc = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAIZSURBVHgBnZW/b9NAFMe/z3H6i1ZNJUBFQsL/QQkLCFBtRhhKF1ibhBmpXbtgFlYqsTG0gRGWwgAjMb8EYmjYGN0pCCrVVaX+SBxf37PiqHWcOu5Xsux79+6j77vz3RH66IbdsDTQPCFngmBwqMCPBwVXoe204Fd/2ZfrSWMpHrDshtGCvsY9FlKkFNYD+Es/7EtuX+itp1sLnLrScTWoPMYsfnty/lUPtAOs4syiUgQOoWHJpG9kdBiX11Z+UaZCk1YT+vOzACuzYxgf7hZbyBGvhTi9af+7SkQbyKi7M8N4ZJ5D+eU2dg9UN07KvyNOS8io6UkNFXMMj1/vnACKAuTmNXZpIqME+LF+iIbX7ukjkClODWTQw+ujuGYMYfXzXnICbxSBDrxAUvYDhkrZp6ggUC8+sDI7mpj9YmESb3/uJ5Z9TJ5A3eORvzsBpgs6lufGT2TKPNY3fbxh6Knis0FTSjnx+LP3u5DJicDi/t7MCFadPaRJQTl02/5vKcKnpITluYkwrWjksebs48Pvg3SoUkXtq32hxt+1pITI8Zc/zcGACN59ty/WdWnklV5ukZ+49wU8MUJIF3mBGlqUr3Dv1+wpl20v9UuP75pElyrgc3XK7UJFbLvK4DJiv9ggDmWcjO9G4imWvW00yV/hjvtpOFnpQOVLkcO+0EhyevGrROG1ol1hREFc8ZGxyddIje+v9c4i9+gI5z7MozLxclgAAAAASUVORK5CYII=", mc = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAKeSURBVHgBjVVdbtpAEJ5ZmygPfTBSaVWpUt0bwFuURgJOUG5QeoLACbw+QeAEwA3SGxgJokh9CDeI+xSpTRU/Imw8nbFZx6QQGAl5d2fm229+dkDYI2f6oaUAOwhWExBcPnL4FwFBSLCexpCMf+qPi12++PKgpR/cGOwRa1pwQIjgOoWkf6s/hOVzVd588R+/xWjf5YAY8Y0+ErQrZFfnXg3lK3uGm7A+RISOxfbit5NprqBxxgBoeEIVHehqtI9lSz+5McaaITaA2J17bycFaBayMOS8IaT+zHuv4Ui58P9oAvB4Ga0paUgqbFGswL5idIcIx3P9DCiXrQB7iJawcTiCkMMIUlj7Jo8zr6Yv/EfRXXIqRnzUxnP9u46Id8Q5Sslq3+pqWErHAPKqvxROC/ZMuJwKJ8bkPouUkrYUqgt5IgMDKAxfAYT8nAZnmR2A5J47YSjrFKyOYpZN2SiIJ8YjRqVfASyAFVg9s2F2gXwRsClMXdnYcFpq5PyiQ8KEilaywc79+aEow2i7fdCF46SIpuTvCGi2kWSXjCM4QqS4Zl3yjwQ0UySwrBfGRJNjQKW4ZrmEpL45CxUDTGWdgmoZgxOoDA6zxYgr7ZudhWk3x6Sp4kl0nZmgujQhcH5Cvqy/Hxi5hdL+dgsWxR2rma4FkLeDw+PMM243+t2YB0jDDI9nMBquyWqI3tjmLYguQfqDzxebty/DIcnePr9jfePVfDhSzv2/Hs8LAY3kMmFfTCl+rl3uu1GWF6Jx+X3vkpa+58jeeNyXvY3Pd8N+a0hvgK9ge3hMTmG5CPTnSICWcFpXaDfZUcAck99yOnZM/id3hcmAFV/hgEilU6p0TcH2gpZYS98xc/kXUJ8YImPFzfeLh0cgXbMp8n/yD3ySPZSK0MWKAAAAAElFTkSuQmCC";
|
|
8667
8667
|
function Ms() {
|
|
8668
|
-
const { config: t } =
|
|
8669
|
-
return { timeZoneDetails:
|
|
8668
|
+
const { config: t } = Fe();
|
|
8669
|
+
return { timeZoneDetails: Se(() => {
|
|
8670
8670
|
const s = t.timeZone || Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
8671
8671
|
return { timeZoneUniqueId: "", ianaTimeZoneId: s, timeZoneName: s, offset: "" };
|
|
8672
8672
|
}, [t.timeZone]), loading: !1 };
|
|
@@ -8846,34 +8846,34 @@ const yc = ({
|
|
|
8846
8846
|
"brandished guns & knives": "weapon",
|
|
8847
8847
|
"brandished guns and knives": "weapon"
|
|
8848
8848
|
}, vc = ({ isModalOpen: t, handleModalClose: e, selectedRow: s, fetchAlertLogs: n, alertStatusList: r = [], alertStatusLoading: a = !1, initialTab: i = "details", sourceTab: l }) => {
|
|
8849
|
-
const [o, u] = g(), [d, m] = g(""), [S, p] = g(!1), k = Ea(null), [
|
|
8850
|
-
const
|
|
8851
|
-
return T[f] === !1 && !
|
|
8849
|
+
const [o, u] = g(), [d, m] = g(""), [S, p] = g(!1), k = Ea(null), [D, C] = g("details"), [Y, $] = g(void 0), W = br(), { alerts: N, rules: E, config: Z } = Fe(), { timeZoneDetails: R } = Ms(), [q, h] = g(null), [v, M] = g(!1), [le, ae] = g(!1), [L, A] = g(void 0), [w, x] = g(void 0), [T, U] = g({}), [P, j] = g({}), K = (f, O, I) => {
|
|
8850
|
+
const G = P[f];
|
|
8851
|
+
return T[f] === !1 && !G ? /* @__PURE__ */ y("div", { className: "w-full flex flex-col items-center justify-center min-h-[200px] bg-gray-100 rounded-lg gap-2 text-gray-400", children: [
|
|
8852
8852
|
/* @__PURE__ */ c(Sr, { size: 40 }),
|
|
8853
8853
|
/* @__PURE__ */ c("span", { className: "text-sm", children: "Media not available" })
|
|
8854
8854
|
] }) : /* @__PURE__ */ y("div", { className: "relative w-full flex justify-center items-center min-h-[200px]", children: [
|
|
8855
|
-
|
|
8855
|
+
G && /* @__PURE__ */ c("div", { className: "absolute inset-0 flex items-center justify-center bg-gray-100 rounded-lg z-10", children: /* @__PURE__ */ c(Hi, { size: 32, className: "animate-spin text-gray-400" }) }),
|
|
8856
8856
|
/* @__PURE__ */ c(
|
|
8857
8857
|
"img",
|
|
8858
8858
|
{
|
|
8859
8859
|
src: f,
|
|
8860
|
-
alt:
|
|
8861
|
-
className: `max-w-full max-h-[90vh] object-contain rounded-lg shadow-lg transition-opacity duration-200 ${
|
|
8862
|
-
onLoad: () =>
|
|
8863
|
-
onError: () =>
|
|
8860
|
+
alt: O.caption || `media-${I}`,
|
|
8861
|
+
className: `max-w-full max-h-[90vh] object-contain rounded-lg shadow-lg transition-opacity duration-200 ${G ? "opacity-0" : "opacity-100"}`,
|
|
8862
|
+
onLoad: () => j((Oe) => ({ ...Oe, [f]: !1 })),
|
|
8863
|
+
onError: () => j((Oe) => ({ ...Oe, [f]: !1 }))
|
|
8864
8864
|
},
|
|
8865
8865
|
f
|
|
8866
8866
|
)
|
|
8867
8867
|
] });
|
|
8868
|
-
},
|
|
8869
|
-
eventName:
|
|
8868
|
+
}, te = s?.originalData || {}, {
|
|
8869
|
+
eventName: se,
|
|
8870
8870
|
eventDisplayName: X,
|
|
8871
|
-
anomalyName:
|
|
8872
|
-
alertId:
|
|
8871
|
+
anomalyName: Ae,
|
|
8872
|
+
alertId: ce,
|
|
8873
8873
|
timestamp: he,
|
|
8874
|
-
description:
|
|
8874
|
+
description: Te,
|
|
8875
8875
|
spaceName: ie,
|
|
8876
|
-
assignTeam:
|
|
8876
|
+
assignTeam: oe,
|
|
8877
8877
|
priority: ke,
|
|
8878
8878
|
statusType: Ze,
|
|
8879
8879
|
id: Be,
|
|
@@ -8881,144 +8881,144 @@ const yc = ({
|
|
|
8881
8881
|
statusHistory: ct,
|
|
8882
8882
|
mediaDetails: Nt,
|
|
8883
8883
|
alertNumber: yt
|
|
8884
|
-
} =
|
|
8885
|
-
const
|
|
8886
|
-
return
|
|
8887
|
-
},
|
|
8884
|
+
} = te, bt = Z.tenant === "snl" ? X || se || "Alert Event" : se || "Alert Event", ne = (f) => {
|
|
8885
|
+
const O = String(f || "").toLowerCase();
|
|
8886
|
+
return O === "delivered" || O === "sent" ? "Delivered" : O === "failed" ? "Failed" : "Queued";
|
|
8887
|
+
}, H = (f) => ({
|
|
8888
8888
|
name: f?.receipientName || f?.recipientName || "-",
|
|
8889
8889
|
role: f?.receipientRoleName || "",
|
|
8890
8890
|
phone: f?.receipentPhoneNumber || f?.recipientPhoneNumber || f?.receipientEmail || f?.recipientEmail || "",
|
|
8891
|
-
status:
|
|
8891
|
+
status: ne(f?.messageStatus),
|
|
8892
8892
|
notificationReceipientType: f?.notificationReceipientType || ""
|
|
8893
|
-
}),
|
|
8894
|
-
const
|
|
8893
|
+
}), we = (f, O) => {
|
|
8894
|
+
const I = O.map(H), G = I.filter((nt) => nt.status === "Delivered").length, Oe = O.map((nt) => nt?.sentAt).filter(Boolean).sort((nt, tt) => new Date(tt).getTime() - new Date(nt).getTime())[0], Je = (O[0] || {})?.severityName || `${f} Notification`;
|
|
8895
8895
|
return {
|
|
8896
8896
|
channelLabel: `${f} Notification`,
|
|
8897
|
-
sentAt:
|
|
8897
|
+
sentAt: Oe || "",
|
|
8898
8898
|
messageTitle: Je,
|
|
8899
8899
|
messageBody: "",
|
|
8900
|
-
total:
|
|
8901
|
-
delivered:
|
|
8902
|
-
recipients:
|
|
8900
|
+
total: I.length,
|
|
8901
|
+
delivered: G,
|
|
8902
|
+
recipients: I
|
|
8903
8903
|
};
|
|
8904
|
-
},
|
|
8905
|
-
const
|
|
8906
|
-
return (f || []).forEach((
|
|
8907
|
-
const
|
|
8908
|
-
|
|
8909
|
-
}), Array.from(
|
|
8910
|
-
},
|
|
8904
|
+
}, ue = (f) => {
|
|
8905
|
+
const O = /* @__PURE__ */ new Map();
|
|
8906
|
+
return (f || []).forEach((I) => {
|
|
8907
|
+
const G = String(I?.notificationType || "Unknown"), Oe = O.get(G) || [];
|
|
8908
|
+
Oe.push(I), O.set(G, Oe);
|
|
8909
|
+
}), Array.from(O.entries()).map(([I, G]) => we(I, G));
|
|
8910
|
+
}, ge = async (f) => {
|
|
8911
8911
|
try {
|
|
8912
|
-
const
|
|
8913
|
-
$(
|
|
8912
|
+
const O = await N.getAlertNotifications(f), I = ue(O);
|
|
8913
|
+
$(I);
|
|
8914
8914
|
} catch {
|
|
8915
8915
|
$(void 0);
|
|
8916
8916
|
}
|
|
8917
8917
|
};
|
|
8918
|
-
|
|
8919
|
-
if (
|
|
8918
|
+
fe(() => {
|
|
8919
|
+
if (D !== "track" || !Be) return;
|
|
8920
8920
|
let f = !1;
|
|
8921
|
-
return
|
|
8921
|
+
return ge(Be).then(() => {
|
|
8922
8922
|
f && $(void 0);
|
|
8923
8923
|
}), () => {
|
|
8924
8924
|
f = !0;
|
|
8925
8925
|
};
|
|
8926
|
-
}, [
|
|
8927
|
-
t ?
|
|
8928
|
-
}, [t, i]),
|
|
8929
|
-
if (!t ||
|
|
8926
|
+
}, [D, Be]), fe(() => {
|
|
8927
|
+
t ? C(i) : (u(void 0), m(""));
|
|
8928
|
+
}, [t, i]), fe(() => {
|
|
8929
|
+
if (!t || Z.tenant !== "snl") return;
|
|
8930
8930
|
let f = !1;
|
|
8931
|
-
return
|
|
8932
|
-
f || (h(
|
|
8931
|
+
return M(!0), E.getLookups().then((O) => {
|
|
8932
|
+
f || (h(O.alertStatusTypes ?? []), M(!1));
|
|
8933
8933
|
}).catch(() => {
|
|
8934
|
-
f || (h([]),
|
|
8934
|
+
f || (h([]), M(!1));
|
|
8935
8935
|
}), () => {
|
|
8936
8936
|
f = !0;
|
|
8937
8937
|
};
|
|
8938
|
-
}, [t,
|
|
8939
|
-
const
|
|
8940
|
-
const
|
|
8941
|
-
return
|
|
8942
|
-
},
|
|
8943
|
-
const
|
|
8944
|
-
return typeof l < "u" ? l === "archived" ?
|
|
8945
|
-
}).map((f) => ({ value: f.value, label: f.statusName })),
|
|
8946
|
-
switch (
|
|
8938
|
+
}, [t, Z.tenant]);
|
|
8939
|
+
const _e = l === "archived" || ["completed", "false positive"].includes(String(Ze || "").toLowerCase()), ze = (f) => {
|
|
8940
|
+
const O = String(f?.value || "").toLowerCase(), I = String(f?.statusName || "").toLowerCase();
|
|
8941
|
+
return O.includes("reopen") || I.includes("reopen");
|
|
8942
|
+
}, Ne = String(Ae || "").trim().toLowerCase(), pt = Sc[Ne] ?? "general", gt = r.filter((f) => {
|
|
8943
|
+
const O = ze(f);
|
|
8944
|
+
return typeof l < "u" ? l === "archived" ? O : !O : _e ? O : !O;
|
|
8945
|
+
}).map((f) => ({ value: f.value, label: f.statusName })), Wt = q ?? [], kt = (f) => !!f.isWatchListStatus, St = (f) => !!f.isWeapontStatus, Xt = Wt.filter((f) => {
|
|
8946
|
+
switch (pt) {
|
|
8947
8947
|
case "elopement":
|
|
8948
8948
|
return f.isElopementStatus;
|
|
8949
8949
|
case "watchlist":
|
|
8950
|
-
return
|
|
8950
|
+
return kt(f);
|
|
8951
8951
|
case "weapon":
|
|
8952
|
-
return
|
|
8952
|
+
return St(f);
|
|
8953
8953
|
default:
|
|
8954
|
-
return !f.isElopementStatus && !
|
|
8954
|
+
return !f.isElopementStatus && !kt(f) && !St(f);
|
|
8955
8955
|
}
|
|
8956
|
-
}).map((f) => ({ value: f.alertStatusTypeName, label: f.alertStatusTypeName })),
|
|
8957
|
-
return
|
|
8956
|
+
}).map((f) => ({ value: f.alertStatusTypeName, label: f.alertStatusTypeName })), F = Z.tenant === "snl" && q !== null ? Xt : gt, V = Se(() => pr(Nt), [Nt]);
|
|
8957
|
+
return fe(() => {
|
|
8958
8958
|
let f = !1;
|
|
8959
|
-
const
|
|
8960
|
-
if (
|
|
8961
|
-
f ||
|
|
8959
|
+
const O = new AbortController(), I = async (de) => {
|
|
8960
|
+
if (de) {
|
|
8961
|
+
f || U((Je) => ({ ...Je, [de]: !1 }));
|
|
8962
8962
|
try {
|
|
8963
|
-
const Je = await fetch(
|
|
8963
|
+
const Je = await fetch(de, { method: "HEAD", signal: O.signal });
|
|
8964
8964
|
if (Je.ok) {
|
|
8965
|
-
f ||
|
|
8965
|
+
f || U((tt) => ({ ...tt, [de]: !0 }));
|
|
8966
8966
|
return;
|
|
8967
8967
|
}
|
|
8968
8968
|
if (Je.status === 404) {
|
|
8969
|
-
f ||
|
|
8969
|
+
f || U((tt) => ({ ...tt, [de]: !1 }));
|
|
8970
8970
|
return;
|
|
8971
8971
|
}
|
|
8972
|
-
if (!(await fetch(
|
|
8973
|
-
f ||
|
|
8972
|
+
if (!(await fetch(de, { method: "GET", signal: O.signal })).ok) throw new Error("Media not available");
|
|
8973
|
+
f || U((tt) => ({ ...tt, [de]: !0 }));
|
|
8974
8974
|
} catch {
|
|
8975
|
-
f ||
|
|
8975
|
+
f || U((Je) => ({ ...Je, [de]: !1 }));
|
|
8976
8976
|
}
|
|
8977
8977
|
}
|
|
8978
8978
|
};
|
|
8979
|
-
|
|
8980
|
-
const
|
|
8981
|
-
return
|
|
8982
|
-
|
|
8983
|
-
}),
|
|
8984
|
-
f = !0,
|
|
8979
|
+
U({});
|
|
8980
|
+
const G = V.filter((de) => !Ys(de)).map((de) => de?.mediaUrl || de).filter((de) => typeof de == "string" && de.length > 0), Oe = {};
|
|
8981
|
+
return G.forEach((de) => {
|
|
8982
|
+
Oe[de] = !0;
|
|
8983
|
+
}), j(Oe), G.forEach((de) => I(de)), () => {
|
|
8984
|
+
f = !0, O.abort();
|
|
8985
8985
|
};
|
|
8986
|
-
}, [
|
|
8986
|
+
}, [V]), /* @__PURE__ */ c(
|
|
8987
8987
|
Ua,
|
|
8988
8988
|
{
|
|
8989
8989
|
open: t,
|
|
8990
8990
|
onCancel: e,
|
|
8991
8991
|
width: 1e3,
|
|
8992
|
-
footer:
|
|
8993
|
-
/* @__PURE__ */ c(
|
|
8992
|
+
footer: D === "details" ? /* @__PURE__ */ y("div", { className: "flex flex-row gap-2 justify-start", children: [
|
|
8993
|
+
/* @__PURE__ */ c(Le, { onClick: e, className: "bg-[#6C757D] text-white", children: "Cancel" }),
|
|
8994
8994
|
/* @__PURE__ */ c(
|
|
8995
|
-
|
|
8995
|
+
Le,
|
|
8996
8996
|
{
|
|
8997
8997
|
type: "primary",
|
|
8998
8998
|
onClick: async () => {
|
|
8999
8999
|
try {
|
|
9000
9000
|
p(!0);
|
|
9001
9001
|
const f = {
|
|
9002
|
-
alertUniqueId:
|
|
9002
|
+
alertUniqueId: ce,
|
|
9003
9003
|
alertId: Be,
|
|
9004
9004
|
status: o ? String(o) : void 0,
|
|
9005
9005
|
notes: d.trim(),
|
|
9006
9006
|
modifiedBy: 0
|
|
9007
|
-
},
|
|
9008
|
-
if (
|
|
9009
|
-
const
|
|
9010
|
-
|
|
9007
|
+
}, O = await W.mutateAsync(f);
|
|
9008
|
+
if (O?.responseStatus || O?.Success) {
|
|
9009
|
+
const I = O?.Message || O?.data || "Alert updated successfully.";
|
|
9010
|
+
be.success(I, {
|
|
9011
9011
|
autoClose: 1500,
|
|
9012
9012
|
onClose: () => {
|
|
9013
9013
|
n(), e();
|
|
9014
9014
|
}
|
|
9015
9015
|
}), u(void 0), m("");
|
|
9016
9016
|
} else {
|
|
9017
|
-
const
|
|
9018
|
-
|
|
9017
|
+
const I = O?.errorMessage || O?.Message || "Failed to update alert status";
|
|
9018
|
+
be.error(I);
|
|
9019
9019
|
}
|
|
9020
9020
|
} catch (f) {
|
|
9021
|
-
console.error("Error updating alert status:", f),
|
|
9021
|
+
console.error("Error updating alert status:", f), be.error("Failed to update alert status. Please try again.");
|
|
9022
9022
|
} finally {
|
|
9023
9023
|
p(!1);
|
|
9024
9024
|
}
|
|
@@ -9031,15 +9031,15 @@ const yc = ({
|
|
|
9031
9031
|
children: s && /* @__PURE__ */ c(
|
|
9032
9032
|
ln,
|
|
9033
9033
|
{
|
|
9034
|
-
activeKey:
|
|
9035
|
-
onChange: (f) =>
|
|
9034
|
+
activeKey: D,
|
|
9035
|
+
onChange: (f) => C(f),
|
|
9036
9036
|
items: [
|
|
9037
9037
|
{
|
|
9038
9038
|
key: "details",
|
|
9039
9039
|
label: "Alert Detail",
|
|
9040
9040
|
children: /* @__PURE__ */ y("div", { className: "grid grid-cols-2 gap-2", style: { maxHeight: "50vh", overflowY: "auto" }, children: [
|
|
9041
9041
|
/* @__PURE__ */ y("div", { className: "flex flex-col gap-2", children: [
|
|
9042
|
-
/* @__PURE__ */ c("div", { className: "text-sm font-bold", children:
|
|
9042
|
+
/* @__PURE__ */ c("div", { className: "text-sm font-bold", children: bt }),
|
|
9043
9043
|
lt?.firstName ? /* @__PURE__ */ y("div", { className: "text-sm text-gray-500", children: [
|
|
9044
9044
|
"Resident ID/Name: ",
|
|
9045
9045
|
lt?.firstName,
|
|
@@ -9050,24 +9050,24 @@ const yc = ({
|
|
|
9050
9050
|
] }) : null,
|
|
9051
9051
|
/* @__PURE__ */ y("div", { className: "text-sm text-gray-500", children: [
|
|
9052
9052
|
"Timestamp: ",
|
|
9053
|
-
As(he,
|
|
9053
|
+
As(he, R?.ianaTimeZoneId)
|
|
9054
9054
|
] }),
|
|
9055
9055
|
/* @__PURE__ */ y("div", { className: "font-sm text-gray-500", children: [
|
|
9056
9056
|
/* @__PURE__ */ c("b", { className: "text-black text-sm/6", children: "Description:" }),
|
|
9057
9057
|
" ",
|
|
9058
|
-
|
|
9058
|
+
Te || "No description available"
|
|
9059
9059
|
] }),
|
|
9060
9060
|
ie && /* @__PURE__ */ y("div", { className: "font-sm text-gray-500", children: [
|
|
9061
9061
|
"Space: ",
|
|
9062
9062
|
ie
|
|
9063
9063
|
] }),
|
|
9064
|
-
|
|
9064
|
+
oe && /* @__PURE__ */ y("div", { className: "font-sm text-gray-500", children: [
|
|
9065
9065
|
"Assigned to: ",
|
|
9066
|
-
|
|
9066
|
+
oe
|
|
9067
9067
|
] }),
|
|
9068
9068
|
/* @__PURE__ */ y("div", { className: "flex gap-2 justify-start mt-3", children: [
|
|
9069
9069
|
/* @__PURE__ */ y(
|
|
9070
|
-
|
|
9070
|
+
Rt,
|
|
9071
9071
|
{
|
|
9072
9072
|
className: "font-sm text-gray-500 rounded-[8px] py-2 px-3",
|
|
9073
9073
|
style: {
|
|
@@ -9081,7 +9081,7 @@ const yc = ({
|
|
|
9081
9081
|
}
|
|
9082
9082
|
),
|
|
9083
9083
|
/* @__PURE__ */ y(
|
|
9084
|
-
|
|
9084
|
+
Rt,
|
|
9085
9085
|
{
|
|
9086
9086
|
className: "font-sm text-gray-500 rounded-[8px] py-2 px-3",
|
|
9087
9087
|
style: String(Ze || "").toLowerCase() === "completed" ? { background: "#E7F6EC", border: "0.68px solid var(--Green, #34C759)" } : { background: "#E0EDFF", border: "1px solid var(--Grays-Gray-4, #D1D1D6)" },
|
|
@@ -9094,14 +9094,14 @@ const yc = ({
|
|
|
9094
9094
|
] }),
|
|
9095
9095
|
/* @__PURE__ */ c("div", { className: "w-full flex flex-col justify-start items-start mt-2 font-bold", children: /* @__PURE__ */ y("div", { className: "w-full mt-4", children: [
|
|
9096
9096
|
/* @__PURE__ */ c("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ c(
|
|
9097
|
-
|
|
9097
|
+
Me,
|
|
9098
9098
|
{
|
|
9099
9099
|
placeholder: "Change Status",
|
|
9100
9100
|
className: "w-full text-gray-500",
|
|
9101
9101
|
onChange: (f) => u(f),
|
|
9102
9102
|
value: o,
|
|
9103
|
-
options:
|
|
9104
|
-
loading:
|
|
9103
|
+
options: F,
|
|
9104
|
+
loading: Z.tenant === "snl" ? v : a
|
|
9105
9105
|
}
|
|
9106
9106
|
) }),
|
|
9107
9107
|
/* @__PURE__ */ y("div", { className: "flex flex-col gap-2 mt-3", children: [
|
|
@@ -9122,7 +9122,7 @@ const yc = ({
|
|
|
9122
9122
|
/* @__PURE__ */ c("div", { className: "flex flex-col gap-4", children: /* @__PURE__ */ y("div", { className: "w-full mt-1", children: [
|
|
9123
9123
|
/* @__PURE__ */ y("div", { className: "w-full flex items-center justify-between", children: [
|
|
9124
9124
|
/* @__PURE__ */ c("h3", { className: "text-black font-bold text-sm", children: "Camera Footage" }),
|
|
9125
|
-
|
|
9125
|
+
V.length > 1 ? /* @__PURE__ */ y("div", { className: "flex items-center gap-2", children: [
|
|
9126
9126
|
/* @__PURE__ */ c(
|
|
9127
9127
|
"button",
|
|
9128
9128
|
{
|
|
@@ -9145,10 +9145,10 @@ const yc = ({
|
|
|
9145
9145
|
)
|
|
9146
9146
|
] }) : null
|
|
9147
9147
|
] }),
|
|
9148
|
-
|
|
9149
|
-
const
|
|
9148
|
+
V.length ? /* @__PURE__ */ c("div", { className: "w-full", children: /* @__PURE__ */ c(La, { ref: k, dots: !0, className: "w-full", children: V.map((f, O) => {
|
|
9149
|
+
const I = f.mediaUrl || f, G = Ys(f);
|
|
9150
9150
|
return /* @__PURE__ */ y("div", { className: "flex justify-center items-center relative", children: [
|
|
9151
|
-
|
|
9151
|
+
G ? /* @__PURE__ */ y(
|
|
9152
9152
|
"video",
|
|
9153
9153
|
{
|
|
9154
9154
|
width: "240",
|
|
@@ -9156,23 +9156,23 @@ const yc = ({
|
|
|
9156
9156
|
controls: !0,
|
|
9157
9157
|
className: "max-w-full max-h-[90vh] object-contain rounded-lg shadow-lg",
|
|
9158
9158
|
children: [
|
|
9159
|
-
/* @__PURE__ */ c("source", { src:
|
|
9159
|
+
/* @__PURE__ */ c("source", { src: I }),
|
|
9160
9160
|
"Your browser does not support the video tag."
|
|
9161
9161
|
]
|
|
9162
9162
|
}
|
|
9163
|
-
) :
|
|
9163
|
+
) : K(String(I), f, O),
|
|
9164
9164
|
f.caption && /* @__PURE__ */ c("p", { className: "text-xs text-gray-500 mt-1", children: f.caption }),
|
|
9165
|
-
!
|
|
9165
|
+
!G && T[String(I)] ? /* @__PURE__ */ c(
|
|
9166
9166
|
"button",
|
|
9167
9167
|
{
|
|
9168
9168
|
onClick: () => {
|
|
9169
|
-
ae(!0), A(
|
|
9169
|
+
ae(!0), A(I), x(f.type || "image");
|
|
9170
9170
|
},
|
|
9171
9171
|
className: "absolute bottom-3 right-3 text-white bg-black/50 rounded-full p-2 hover:bg-black/70",
|
|
9172
9172
|
children: /* @__PURE__ */ c(vr, { size: 20 })
|
|
9173
9173
|
}
|
|
9174
9174
|
) : null
|
|
9175
|
-
] }, String(
|
|
9175
|
+
] }, String(I) || O);
|
|
9176
9176
|
}) }) }) : null
|
|
9177
9177
|
] }) }),
|
|
9178
9178
|
/* @__PURE__ */ c(
|
|
@@ -9180,7 +9180,7 @@ const yc = ({
|
|
|
9180
9180
|
{
|
|
9181
9181
|
isOpen: le,
|
|
9182
9182
|
onClose: () => ae(!1),
|
|
9183
|
-
src:
|
|
9183
|
+
src: L || "",
|
|
9184
9184
|
type: w || "image"
|
|
9185
9185
|
}
|
|
9186
9186
|
)
|
|
@@ -9192,13 +9192,13 @@ const yc = ({
|
|
|
9192
9192
|
children: /* @__PURE__ */ c(
|
|
9193
9193
|
yc,
|
|
9194
9194
|
{
|
|
9195
|
-
alertId:
|
|
9195
|
+
alertId: ce,
|
|
9196
9196
|
id: Be,
|
|
9197
9197
|
priority: ke,
|
|
9198
9198
|
spaceName: ie,
|
|
9199
9199
|
alertNumber: yt,
|
|
9200
9200
|
statusHistory: ct,
|
|
9201
|
-
notifGroups:
|
|
9201
|
+
notifGroups: Y
|
|
9202
9202
|
}
|
|
9203
9203
|
)
|
|
9204
9204
|
}
|
|
@@ -9209,7 +9209,7 @@ const yc = ({
|
|
|
9209
9209
|
);
|
|
9210
9210
|
};
|
|
9211
9211
|
function wc() {
|
|
9212
|
-
const { alerts: t } =
|
|
9212
|
+
const { alerts: t } = Fe(), e = cn({
|
|
9213
9213
|
queryKey: ["alerts", "statusList"],
|
|
9214
9214
|
queryFn: () => t.getAlertStatusList(),
|
|
9215
9215
|
staleTime: 5 * 6e4
|
|
@@ -9222,14 +9222,14 @@ function wc() {
|
|
|
9222
9222
|
};
|
|
9223
9223
|
}
|
|
9224
9224
|
function Ia({ alerts: t, loading: e = !1, columns: s, total: n, currentPage: r, onRefetch: a, onPageChange: i, onFilterChange: l }) {
|
|
9225
|
-
const [o, u] = g(!1), [d, m] = g(null), [S, p] = g("details"), { list: k, loading:
|
|
9226
|
-
function
|
|
9227
|
-
m(le), p(ae?.tab ?? "details"),
|
|
9225
|
+
const [o, u] = g(!1), [d, m] = g(null), [S, p] = g("details"), { list: k, loading: D } = wc(), { config: C } = Fe(), Y = C.tenant === "schools", { timeZoneDetails: $ } = Ms(), W = $?.timeZoneName ?? "UTC", N = $?.ianaTimeZoneId ?? "UTC";
|
|
9226
|
+
function E(le, ae) {
|
|
9227
|
+
m(le), p(ae?.tab ?? "details"), q(ae?.sourceTab ?? "active"), u(!0);
|
|
9228
9228
|
}
|
|
9229
|
-
function
|
|
9229
|
+
function Z() {
|
|
9230
9230
|
u(!1);
|
|
9231
9231
|
}
|
|
9232
|
-
const [
|
|
9232
|
+
const [R, q] = g("active"), [h, v] = g(0), M = d ? {
|
|
9233
9233
|
originalData: {
|
|
9234
9234
|
// include the full selected alert so alll modal fieldsare present
|
|
9235
9235
|
...d,
|
|
@@ -9251,18 +9251,18 @@ function Ia({ alerts: t, loading: e = !1, columns: s, total: n, currentPage: r,
|
|
|
9251
9251
|
tabBarStyle: { fontSize: "medium" },
|
|
9252
9252
|
onChange: (le) => {
|
|
9253
9253
|
const ae = le === "archived";
|
|
9254
|
-
v((
|
|
9254
|
+
v((L) => L + 1), i?.(1), l?.({ isArchived: ae });
|
|
9255
9255
|
},
|
|
9256
9256
|
items: [
|
|
9257
9257
|
{
|
|
9258
9258
|
key: "active",
|
|
9259
9259
|
label: "Active",
|
|
9260
|
-
children: /* @__PURE__ */ c(Nr, { data: t, loading: e, pageSize: 10, total: n, currentPage: r, columns: s || [], onAlertIdClick:
|
|
9260
|
+
children: /* @__PURE__ */ c(Nr, { data: t, loading: e, pageSize: 10, total: n, currentPage: r, columns: s || [], onAlertIdClick: E, onRefetch: a, onPageChange: i, onFilterChange: l, resetKey: h, serverSideFilters: Y })
|
|
9261
9261
|
},
|
|
9262
9262
|
{
|
|
9263
9263
|
key: "archived",
|
|
9264
9264
|
label: "Archived",
|
|
9265
|
-
children: /* @__PURE__ */ c(ec, { alerts: t, loading: e, columns: s || [], total: n, currentPage: r, onAlertIdClick:
|
|
9265
|
+
children: /* @__PURE__ */ c(ec, { alerts: t, loading: e, columns: s || [], total: n, currentPage: r, onAlertIdClick: E, onFilterChange: l, onPageChange: i, onRefetch: a, resetKey: h, serverSideFilters: Y })
|
|
9266
9266
|
},
|
|
9267
9267
|
{
|
|
9268
9268
|
key: "settings",
|
|
@@ -9281,40 +9281,40 @@ function Ia({ alerts: t, loading: e = !1, columns: s, total: n, currentPage: r,
|
|
|
9281
9281
|
vc,
|
|
9282
9282
|
{
|
|
9283
9283
|
isModalOpen: o,
|
|
9284
|
-
handleModalClose:
|
|
9285
|
-
selectedRow:
|
|
9284
|
+
handleModalClose: Z,
|
|
9285
|
+
selectedRow: M,
|
|
9286
9286
|
fetchAlertLogs: () => {
|
|
9287
9287
|
},
|
|
9288
9288
|
alertStatusList: k,
|
|
9289
|
-
alertStatusLoading:
|
|
9289
|
+
alertStatusLoading: D,
|
|
9290
9290
|
initialTab: S,
|
|
9291
|
-
sourceTab:
|
|
9291
|
+
sourceTab: R
|
|
9292
9292
|
}
|
|
9293
9293
|
)
|
|
9294
9294
|
] });
|
|
9295
9295
|
}
|
|
9296
9296
|
function Ac() {
|
|
9297
|
-
const [t, e] = g([]), [s, n] = g([]), [r, a] = g([]), [i, l] = g([]), [o, u] = g(!0), { rules: d } =
|
|
9298
|
-
return
|
|
9297
|
+
const [t, e] = g([]), [s, n] = g([]), [r, a] = g([]), [i, l] = g([]), [o, u] = g(!0), { rules: d } = Fe();
|
|
9298
|
+
return fe(() => {
|
|
9299
9299
|
let m = !0;
|
|
9300
9300
|
return (async () => {
|
|
9301
9301
|
try {
|
|
9302
9302
|
const S = await d.getRules();
|
|
9303
9303
|
if (!m) return;
|
|
9304
9304
|
l(Array.isArray(S) ? S : []);
|
|
9305
|
-
const p = (S || []).map((k,
|
|
9306
|
-
RuleId: k.ruleId || k.ruleName || String(
|
|
9305
|
+
const p = (S || []).map((k, D) => ({
|
|
9306
|
+
RuleId: k.ruleId || k.ruleName || String(D),
|
|
9307
9307
|
Name: k.ruleName || k.Name || "-",
|
|
9308
9308
|
Description: k.ruleDesc || k.Description || "",
|
|
9309
9309
|
SeverityId: 0
|
|
9310
9310
|
}));
|
|
9311
9311
|
e(p);
|
|
9312
9312
|
try {
|
|
9313
|
-
const k = await d.getLookups(),
|
|
9314
|
-
userRoleId:
|
|
9315
|
-
userRoleName:
|
|
9313
|
+
const k = await d.getLookups(), D = Array.isArray(k?.userRoles) ? k.userRoles.map((C) => ({
|
|
9314
|
+
userRoleId: C.userRoleId ?? C.id,
|
|
9315
|
+
userRoleName: C.userRoleName ?? C.name
|
|
9316
9316
|
})) : [];
|
|
9317
|
-
n(
|
|
9317
|
+
n(D), a(Array.isArray(k?.severities) ? k.severities : []);
|
|
9318
9318
|
} catch {
|
|
9319
9319
|
}
|
|
9320
9320
|
} catch {
|
|
@@ -9339,11 +9339,11 @@ function Tc(t) {
|
|
|
9339
9339
|
return Array.isArray(t) ? { items: t } : t;
|
|
9340
9340
|
}
|
|
9341
9341
|
function Nc(t = 1, e) {
|
|
9342
|
-
const { alerts: s, config: n } =
|
|
9342
|
+
const { alerts: s, config: n } = Fe(), r = n.tenant === "schools" && !!String(e?.searchText ?? "").trim(), a = cn({
|
|
9343
9343
|
queryKey: ["alerts", "list", n.tenant, t, e],
|
|
9344
9344
|
queryFn: () => {
|
|
9345
9345
|
const i = { ...e };
|
|
9346
|
-
return
|
|
9346
|
+
return n.tenant === "transit" ? (i.pageNumber = t, i.pageSize = 10) : n.tenant === "schools" && (i.pageNumber = t, i.pageSize = r ? 100 : 10), s.listAlerts(i).then(Tc);
|
|
9347
9347
|
},
|
|
9348
9348
|
staleTime: r ? 0 : 3e4
|
|
9349
9349
|
});
|
|
@@ -9373,7 +9373,7 @@ function Cc({
|
|
|
9373
9373
|
loading: o,
|
|
9374
9374
|
columns: u
|
|
9375
9375
|
}) {
|
|
9376
|
-
const [d] = g(() => new Ga()), m =
|
|
9376
|
+
const [d] = g(() => new Ga()), m = Se(
|
|
9377
9377
|
() => ({
|
|
9378
9378
|
alertsBaseUrl: e,
|
|
9379
9379
|
rulesBaseUrl: s || e,
|
|
@@ -9384,7 +9384,7 @@ function Cc({
|
|
|
9384
9384
|
return /* @__PURE__ */ c(qa, { client: d, children: /* @__PURE__ */ c(Ti, { tenant: t, override: m, timeZone: r, userManagementDomain: a, spacesBaseUrl: i, children: Array.isArray(l) ? /* @__PURE__ */ c(Ia, { alerts: l, loading: !!o, columns: u }) : /* @__PURE__ */ c(bc, { columns: u }) }) });
|
|
9385
9385
|
}
|
|
9386
9386
|
function Rc(t) {
|
|
9387
|
-
const { alerts: e } =
|
|
9387
|
+
const { alerts: e } = Fe(), s = cn({
|
|
9388
9388
|
queryKey: ["alerts", "report", t],
|
|
9389
9389
|
queryFn: () => e.getAlertsReport(t),
|
|
9390
9390
|
staleTime: 6e4
|
|
@@ -9419,7 +9419,7 @@ export {
|
|
|
9419
9419
|
wc as useAlertStatusList,
|
|
9420
9420
|
Nc as useAlerts,
|
|
9421
9421
|
Rc as useAlertsReport,
|
|
9422
|
-
|
|
9422
|
+
Fe as useApi,
|
|
9423
9423
|
br as useUpdateAlertStatus
|
|
9424
9424
|
};
|
|
9425
9425
|
//# sourceMappingURL=index.es.js.map
|