urfu-ui-kit-react 2.1.5 → 2.1.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/components/Accordion/Accordion.d.ts +1 -1
- package/dist/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/components/Accordion/Accordion.js +9 -8
- package/dist/components/Accordion/Accordion.types.d.ts +2 -0
- package/dist/components/Accordion/Accordion.types.d.ts.map +1 -1
- package/dist/components/BreadCrumbs/BreadCrumbs.d.ts.map +1 -1
- package/dist/components/BreadCrumbs/BreadCrumbs.js +20 -19
- package/dist/components/Calendar/Calendar.d.ts.map +1 -1
- package/dist/components/Calendar/Calendar.js +145 -144
- package/dist/components/Calendar/Calendar.types.d.ts +9 -4
- package/dist/components/Calendar/Calendar.types.d.ts.map +1 -1
- package/dist/components/Card/Card.d.ts.map +1 -1
- package/dist/components/Card/Card.js +37 -31
- package/dist/components/ColumnSettings/ColumnSettings.d.ts.map +1 -1
- package/dist/components/ColumnSettings/ColumnSettings.js +72 -72
- package/dist/components/Drawer/Drawer.d.ts +11 -0
- package/dist/components/Drawer/Drawer.d.ts.map +1 -0
- package/dist/components/Drawer/Drawer.js +87 -0
- package/dist/components/Drawer/Drawer.types.d.ts +44 -0
- package/dist/components/Drawer/Drawer.types.d.ts.map +1 -0
- package/dist/components/ErrorScreen/ErrorScreen.d.ts.map +1 -1
- package/dist/components/ErrorScreen/ErrorScreen.js +172 -138
- package/dist/components/FormField/FormField.d.ts +1 -1
- package/dist/components/FormField/FormField.d.ts.map +1 -1
- package/dist/components/FormField/FormField.js +42 -29
- package/dist/components/FormField/FormField.types.d.ts +6 -0
- package/dist/components/FormField/FormField.types.d.ts.map +1 -1
- package/dist/components/InfiniteScroll/InfiniteScroll.d.ts +22 -0
- package/dist/components/InfiniteScroll/InfiniteScroll.d.ts.map +1 -0
- package/dist/components/InfiniteScroll/InfiniteScroll.js +27 -0
- package/dist/components/InputText/InputText.d.ts +39 -2
- package/dist/components/InputText/InputText.d.ts.map +1 -1
- package/dist/components/InputText/InputText.js +103 -94
- package/dist/components/InputText/InputText.types.d.ts +11 -0
- package/dist/components/InputText/InputText.types.d.ts.map +1 -1
- package/dist/components/InputTime/inputTimeKeyDown.d.ts +17 -2
- package/dist/components/InputTime/inputTimeKeyDown.d.ts.map +1 -1
- package/dist/components/InputTime/useInputTimeWheel.d.ts +13 -1
- package/dist/components/InputTime/useInputTimeWheel.d.ts.map +1 -1
- package/dist/components/Menu/Menu.d.ts.map +1 -1
- package/dist/components/Menu/Menu.js +54 -49
- package/dist/components/Modal/Modal.d.ts.map +1 -1
- package/dist/components/Modal/Modal.js +52 -49
- package/dist/components/Modal/Modal.types.d.ts +4 -2
- package/dist/components/Modal/Modal.types.d.ts.map +1 -1
- package/dist/components/Notification/Notification.d.ts.map +1 -1
- package/dist/components/Notification/Notification.js +97 -86
- package/dist/components/OfflineBanner/OfflineBanner.d.ts.map +1 -1
- package/dist/components/OfflineBanner/OfflineBanner.js +40 -32
- package/dist/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/components/Pagination/Pagination.js +61 -66
- package/dist/components/SearchSelect/SearchSelect.d.ts.map +1 -1
- package/dist/components/SearchSelect/SearchSelect.js +137 -134
- package/dist/components/TabPanels/TabPanels.d.ts +13 -0
- package/dist/components/TabPanels/TabPanels.d.ts.map +1 -0
- package/dist/components/TabPanels/TabPanels.js +8 -0
- package/dist/components/Table/Filter/Filter.d.ts.map +1 -1
- package/dist/components/Table/Filter/Filter.js +47 -47
- package/dist/components/Table/Filter/Filter.types.d.ts +2 -1
- package/dist/components/Table/Filter/Filter.types.d.ts.map +1 -1
- package/dist/components/Table/Filter/SelectFilter.d.ts.map +1 -1
- package/dist/components/Table/Filter/SelectFilter.js +9 -9
- package/dist/components/Table/Table.d.ts +1 -1
- package/dist/components/Table/Table.d.ts.map +1 -1
- package/dist/components/Table/Table.dataPipeline.d.ts +4 -3
- package/dist/components/Table/Table.dataPipeline.d.ts.map +1 -1
- package/dist/components/Table/Table.dataPipeline.js +64 -63
- package/dist/components/Table/Table.js +299 -299
- package/dist/components/Table/Table.rowTypes.d.ts +6 -0
- package/dist/components/Table/Table.rowTypes.d.ts.map +1 -0
- package/dist/components/Table/Table.types.d.ts +10 -3
- package/dist/components/Table/Table.types.d.ts.map +1 -1
- package/dist/components/Table/TableHead.d.ts +27 -19
- package/dist/components/Table/TableHead.d.ts.map +1 -1
- package/dist/components/Table/TableHead.js +1 -1
- package/dist/components/Table/TableMobileCard.d.ts +11 -11
- package/dist/components/Table/TableMobileCard.d.ts.map +1 -1
- package/dist/components/Table/TableMobileCard.js +81 -84
- package/dist/components/Table/TableMobileView.d.ts +7 -5
- package/dist/components/Table/TableMobileView.d.ts.map +1 -1
- package/dist/components/Table/TableRow.d.ts +10 -8
- package/dist/components/Table/TableRow.d.ts.map +1 -1
- package/dist/components/Table/TableRow.js +116 -112
- package/dist/components/Table/useTableColumnPinning.d.ts.map +1 -1
- package/dist/components/Table/useTableVirtualization.d.ts +5 -5
- package/dist/components/Table/useTableVirtualization.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.d.ts +1 -1
- package/dist/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.js +109 -104
- package/dist/components/Tabs/Tabs.types.d.ts +29 -1
- package/dist/components/Tabs/Tabs.types.d.ts.map +1 -1
- package/dist/components/Tabs/distributeTabs.d.ts +6 -0
- package/dist/components/Tabs/distributeTabs.d.ts.map +1 -1
- package/dist/components/Tabs/tabsIndicator.d.ts +7 -3
- package/dist/components/Tabs/tabsIndicator.d.ts.map +1 -1
- package/dist/components/Tabs/tabsScroll.d.ts +20 -0
- package/dist/components/Tabs/tabsScroll.d.ts.map +1 -0
- package/dist/components/Tabs/useTabsOverflow.d.ts +3 -1
- package/dist/components/Tabs/useTabsOverflow.d.ts.map +1 -1
- package/dist/components/Tabs/useTabsOverflow.js +33 -33
- package/dist/components/Tabs/useTabsScroll.d.ts +4 -0
- package/dist/components/Tabs/useTabsScroll.d.ts.map +1 -0
- package/dist/components/Tabs/useTabsScroll.js +17 -0
- package/dist/components/Textarea/Textarea.d.ts +22 -2
- package/dist/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.js +48 -43
- package/dist/components/Textarea/Textarea.types.d.ts +1 -0
- package/dist/components/Textarea/Textarea.types.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.js +150 -131
- package/dist/components/Tooltip/Tooltip.types.d.ts +7 -2
- package/dist/components/Tooltip/Tooltip.types.d.ts.map +1 -1
- package/dist/components/TreeView/TreeView.js +95 -95
- package/dist/components/TreeView/TreeView.types.d.ts +1 -1
- package/dist/components/TreeView/TreeView.types.d.ts.map +1 -1
- package/dist/components/VirtualList/VirtualList.d.ts +45 -0
- package/dist/components/VirtualList/VirtualList.d.ts.map +1 -0
- package/dist/components/VirtualList/VirtualList.js +62 -0
- package/dist/dev/index.js +1306 -584
- package/dist/dev/types/react/src/dev/index.d.ts +1 -1
- package/dist/dev/types/vanilla/src/core/motion.d.ts +41 -0
- package/dist/dev/types/vanilla/src/core/requestLog.d.ts +29 -0
- package/dist/dev/types/vanilla/src/dev/highlight.d.ts +32 -0
- package/dist/dev/types/vanilla/src/dev/intercept.d.ts +4 -1
- package/dist/dev/types/vanilla/src/dev/motionModes.d.ts +30 -0
- package/dist/dev/types/vanilla/src/dev/panelKit.d.ts +49 -0
- package/dist/dev/types/vanilla/src/dev/panelStyles.d.ts +7 -0
- package/dist/dev/types/vanilla/src/dev/rules.d.ts +31 -0
- package/dist/dev/types/vanilla/src/dev/store.d.ts +7 -4
- package/dist/dev/types/vanilla/src/dev/types.d.ts +14 -3
- package/dist/dev/types/vanilla/src/dev/viewModes.d.ts +22 -0
- package/dist/hooks/useCollapseMotion.d.ts +18 -0
- package/dist/hooks/useCollapseMotion.d.ts.map +1 -0
- package/dist/hooks/useCollapseMotion.js +9 -0
- package/dist/hooks/useDismiss.d.ts +7 -1
- package/dist/hooks/useDismiss.d.ts.map +1 -1
- package/dist/hooks/useDismiss.js +19 -17
- package/dist/hooks/useEnterMotion.d.ts +9 -0
- package/dist/hooks/useEnterMotion.d.ts.map +1 -0
- package/dist/hooks/useEnterMotion.js +10 -0
- package/dist/hooks/useForwardedRef.d.ts +8 -0
- package/dist/hooks/useForwardedRef.d.ts.map +1 -0
- package/dist/hooks/useForwardedRef.js +8 -0
- package/dist/hooks/useInfiniteScroll.d.ts +27 -0
- package/dist/hooks/useInfiniteScroll.d.ts.map +1 -0
- package/dist/hooks/useInfiniteScroll.js +13 -0
- package/dist/hooks/useMountTransition.d.ts +1 -1
- package/dist/hooks/useMountTransition.d.ts.map +1 -1
- package/dist/hooks/useMountTransition.js +14 -13
- package/dist/hooks/useVirtualList.d.ts +34 -0
- package/dist/hooks/useVirtualList.d.ts.map +1 -0
- package/dist/hooks/useVirtualList.js +21 -0
- package/dist/index.d.ts +15 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/shared/collapseMotion.d.ts +32 -0
- package/dist/shared/collapseMotion.d.ts.map +1 -0
- package/dist/shared/infiniteScroll.d.ts +42 -0
- package/dist/shared/infiniteScroll.d.ts.map +1 -0
- package/dist/shared/kitCopy.js +1 -1
- package/dist/shared/linkClick.d.ts +7 -0
- package/dist/shared/linkClick.d.ts.map +1 -0
- package/dist/shared/motion.d.ts +42 -0
- package/dist/shared/motion.d.ts.map +1 -0
- package/dist/shared/popupTransition.d.ts +10 -2
- package/dist/shared/popupTransition.d.ts.map +1 -1
- package/dist/shared/popupTransition.js +6 -5
- package/dist/shared/virtualList.d.ts +103 -0
- package/dist/shared/virtualList.d.ts.map +1 -0
- package/dist/style-no-fonts.css +1 -1
- package/dist/style.css +1 -1
- package/dist/style.layer.css +2 -2
- package/dist/style.shell.css +5 -5
- package/dist/urfu-ui-kit-react.js +53 -45
- package/dist/utils/describeError.d.ts +12 -1
- package/dist/utils/describeError.d.ts.map +1 -1
- package/dist/vanilla/core/collapseMotion.js +58 -0
- package/dist/vanilla/core/describeError.js +172 -115
- package/dist/vanilla/core/distributeTabs.js +23 -20
- package/dist/vanilla/core/infiniteScroll.js +79 -0
- package/dist/vanilla/core/linkClick.js +2 -0
- package/dist/vanilla/core/motion.js +29 -0
- package/dist/vanilla/core/requestLog.js +40 -0
- package/dist/vanilla/core/tabsIndicator.js +29 -26
- package/dist/vanilla/core/tabsScroll.js +29 -0
- package/dist/vanilla/core/virtualList.js +213 -0
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { startRequestLog$u as j, getRequestLog$u as k } from "./requestLog.js";
|
|
2
|
+
const N = {
|
|
2
3
|
auth: { title: "Требуется вход", text: "Сессия закончилась. Войдите снова — данные на странице сохранятся.", action: "login", actionLabel: "Войти снова" },
|
|
3
4
|
forbidden: { title: "Нет доступа", text: "У вашей роли нет прав на это действие или раздел. Если доступ нужен для работы, обратитесь к руководителю подразделения.", action: "home", actionLabel: "На главную" },
|
|
4
5
|
notFound: { title: "Страница не найдена", text: "Возможно, её удалили или в адресе ошибка.", action: "home", actionLabel: "На главную" },
|
|
@@ -12,166 +13,169 @@ const A = {
|
|
|
12
13
|
parsing: { title: "Сервер вернул неожиданный ответ", text: "Попробуйте ещё раз. Если ошибка повторится, обратитесь в техническую поддержку.", action: "retry", actionLabel: "Повторить" },
|
|
13
14
|
render: { title: "Что-то пошло не так", text: "Не удалось показать страницу. Обновите её — если ошибка повторится, обратитесь в техническую поддержку.", action: "reload", actionLabel: "Обновить страницу" }
|
|
14
15
|
};
|
|
15
|
-
let
|
|
16
|
-
function
|
|
17
|
-
const n =
|
|
18
|
-
|
|
16
|
+
let p = { ...N };
|
|
17
|
+
function nt(t) {
|
|
18
|
+
const n = p;
|
|
19
|
+
p = { ...p };
|
|
19
20
|
for (const [e, o] of Object.entries(t))
|
|
20
|
-
|
|
21
|
+
p[e] = { ...p[e], ...o };
|
|
21
22
|
return () => {
|
|
22
|
-
|
|
23
|
+
p = n;
|
|
23
24
|
};
|
|
24
25
|
}
|
|
25
|
-
const
|
|
26
|
-
function
|
|
26
|
+
const q = /failed to fetch|network\s?error|network request failed|load failed|connection appears to be offline/i;
|
|
27
|
+
function $(t) {
|
|
27
28
|
return t === 401 ? "auth" : t === 403 ? "forbidden" : t === 404 || t === 410 ? "notFound" : t === 400 || t === 422 ? "invalid" : t === 409 || t === 412 ? "conflict" : t === 413 ? "tooLarge" : t === 429 ? "rateLimit" : t === 408 || t === 504 ? "timeout" : "server";
|
|
28
29
|
}
|
|
29
|
-
const
|
|
30
|
-
function
|
|
31
|
-
const n = t, e =
|
|
32
|
-
return [n.status, n.statusCode, e == null ? void 0 : e.status].find((
|
|
30
|
+
const d = (t) => typeof t == "object" && t !== null;
|
|
31
|
+
function L(t) {
|
|
32
|
+
const n = t, e = d(n.response) ? n.response : void 0;
|
|
33
|
+
return [n.status, n.statusCode, e == null ? void 0 : e.status].find((r) => typeof r == "number");
|
|
33
34
|
}
|
|
34
35
|
const h = (t) => [t.message, t.error].find((n) => typeof n == "string");
|
|
35
|
-
function
|
|
36
|
+
function B(t) {
|
|
36
37
|
const n = typeof t.name == "string" ? t.name : "", e = typeof t.code == "string" ? t.code : "", o = h(t) ?? "";
|
|
37
38
|
if (n === "AbortError" || n === "CanceledError" || e === "ERR_CANCELED" || /^AbortError\b/.test(o)) return "aborted";
|
|
38
39
|
if (n === "TimeoutError" || e === "ECONNABORTED" || e === "ETIMEDOUT" || /timeout of \d+ms exceeded/i.test(o)) return "timeout";
|
|
39
|
-
if (e === "ERR_NETWORK" || t.status === "FETCH_ERROR" ||
|
|
40
|
+
if (e === "ERR_NETWORK" || t.status === "FETCH_ERROR" || q.test(o)) return "network";
|
|
40
41
|
}
|
|
41
|
-
function
|
|
42
|
+
function C(t) {
|
|
42
43
|
if (typeof t == "string") return t.trim() || void 0;
|
|
43
|
-
if (
|
|
44
|
+
if (d(t))
|
|
44
45
|
for (const n of ["message", "detail", "title", "error_description", "error"]) {
|
|
45
46
|
const e = t[n];
|
|
46
47
|
if (typeof e == "string" && e.trim()) return e.trim();
|
|
47
48
|
if (Array.isArray(e) && e.every((o) => typeof o == "string") && e.length) return e.join("; ");
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
|
-
function
|
|
51
|
-
if (
|
|
51
|
+
function D(t) {
|
|
52
|
+
if (d(t))
|
|
52
53
|
for (const n of ["requestId", "request_id", "traceId", "trace_id", "correlationId"]) {
|
|
53
54
|
const e = t[n];
|
|
54
55
|
if (typeof e == "string" && e) return e;
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
|
-
function
|
|
58
|
+
function A(t) {
|
|
58
59
|
return !t || t.length > 300 || /\n\s+at |<\/?[a-z][\s\S]*>|Exception|Error:|ОШИБКА:|SQLSTATE|^[A-Z_]+$/.test(t) ? !1 : /[А-Яа-яЁё]/.test(t);
|
|
59
60
|
}
|
|
60
|
-
function
|
|
61
|
-
if (typeof t == "number") return { group:
|
|
62
|
-
if (typeof Response < "u" && t instanceof Response) return { group:
|
|
63
|
-
if (!
|
|
64
|
-
if (
|
|
65
|
-
const
|
|
66
|
-
if (
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
69
|
-
if (t instanceof Error &&
|
|
61
|
+
function O(t) {
|
|
62
|
+
if (typeof t == "number") return { group: $(t), code: t };
|
|
63
|
+
if (typeof Response < "u" && t instanceof Response) return { group: $(t.status), code: t.status };
|
|
64
|
+
if (!d(t)) return { group: "server", code: null };
|
|
65
|
+
if (L(t) === void 0) {
|
|
66
|
+
const r = typeof t.status == "string" ? t.status : void 0;
|
|
67
|
+
if (r === "TIMEOUT_ERROR") return { group: "timeout", code: null, status: r, message: h(t) };
|
|
68
|
+
const i = B(t);
|
|
69
|
+
if (i) return { group: i, code: null, status: r, message: h(t) };
|
|
70
|
+
if (t instanceof Error && r === void 0) return { group: "render", code: null, message: t.message };
|
|
70
71
|
}
|
|
71
|
-
const n =
|
|
72
|
-
if (typeof e == "number") return { group:
|
|
72
|
+
const n = d(t.response) ? t.response : void 0, e = L(t) ?? t.status, o = "data" in t ? t.data : n == null ? void 0 : n.data;
|
|
73
|
+
if (typeof e == "number") return { group: $(e), code: e, body: o, message: C(o) };
|
|
73
74
|
if (e === "PARSING_ERROR") {
|
|
74
|
-
const
|
|
75
|
-
return { group:
|
|
75
|
+
const r = typeof t.originalStatus == "number" ? t.originalStatus : null, i = r !== null && r >= 400 ? r : null;
|
|
76
|
+
return { group: i ? $(i) : "parsing", code: i, status: e, body: o, message: typeof t.error == "string" ? t.error : void 0 };
|
|
76
77
|
}
|
|
77
78
|
return { group: "server", code: null, status: typeof e == "string" ? e : void 0, message: h(t) };
|
|
78
79
|
}
|
|
79
|
-
function
|
|
80
|
+
function P(t) {
|
|
80
81
|
return t === "forbidden" || t === "auth" ? "forbidden" : t === "notFound" ? "notFound" : "serverError";
|
|
81
82
|
}
|
|
82
|
-
function
|
|
83
|
-
const e =
|
|
83
|
+
function w(t, n = {}) {
|
|
84
|
+
const e = O(t);
|
|
84
85
|
let o = e.group;
|
|
85
86
|
o === "notFound" && n.notFoundIsPage === !1 && (o = "server");
|
|
86
|
-
const
|
|
87
|
+
const r = {
|
|
87
88
|
code: e.code,
|
|
88
89
|
status: e.status,
|
|
89
90
|
method: n.method,
|
|
90
91
|
url: n.url,
|
|
91
92
|
serverMessage: e.message,
|
|
92
|
-
requestId:
|
|
93
|
+
requestId: D(e.body),
|
|
93
94
|
time: (/* @__PURE__ */ new Date()).toISOString()
|
|
94
95
|
};
|
|
95
96
|
if (o === "aborted")
|
|
96
|
-
return { group: o, code: null, variant: "serverError", title: "", text: "", action: "none", actionLabel: "", message: "", details:
|
|
97
|
-
const
|
|
98
|
-
return { group: o, code: e.code, variant:
|
|
97
|
+
return { group: o, code: null, variant: "serverError", title: "", text: "", action: "none", actionLabel: "", message: "", details: r };
|
|
98
|
+
const i = p[o], a = n.operation ? `Не удалось ${n.operation}` : n.subject ? `Не удалось загрузить ${n.subject}` : void 0, f = (a && (o === "server" || o === "parsing") ? a : void 0) ?? i.title, m = A(e.message) ? e.message : void 0, v = a && (o === "network" || o === "timeout") ? `${a}. ${i.text}` : void 0, y = m ?? v ?? i.text, E = m ? `${f}. ${m}` : f;
|
|
99
|
+
return { group: o, code: e.code, variant: P(o), title: f, text: y, action: i.action, actionLabel: i.actionLabel, message: E, details: r };
|
|
99
100
|
}
|
|
100
|
-
const
|
|
101
|
-
function
|
|
101
|
+
const U = ["field", "property", "path", "name", "key"], W = ["message", "msg", "detail", "error"];
|
|
102
|
+
function R(t) {
|
|
102
103
|
if (typeof t == "string") return t.trim() || void 0;
|
|
103
104
|
if (Array.isArray(t)) {
|
|
104
105
|
const n = t.filter((e) => typeof e == "string" && !!e.trim());
|
|
105
106
|
return n.length ? n.join("; ") : void 0;
|
|
106
107
|
}
|
|
107
108
|
}
|
|
108
|
-
function
|
|
109
|
-
for (const n of
|
|
109
|
+
function M(t) {
|
|
110
|
+
for (const n of U) {
|
|
110
111
|
const e = t[n];
|
|
111
112
|
if (typeof e == "string" && e) return e;
|
|
112
113
|
if (Array.isArray(e) && e.length && e.every((o) => typeof o == "string" || typeof o == "number")) return e.join(".");
|
|
113
114
|
}
|
|
114
115
|
}
|
|
115
|
-
function
|
|
116
|
-
for (const n of
|
|
117
|
-
const e =
|
|
116
|
+
function K(t) {
|
|
117
|
+
for (const n of W) {
|
|
118
|
+
const e = R(t[n]);
|
|
118
119
|
if (e) return e;
|
|
119
120
|
}
|
|
120
|
-
return
|
|
121
|
+
return d(t.constraints) ? R(Object.values(t.constraints)) : void 0;
|
|
121
122
|
}
|
|
122
|
-
function
|
|
123
|
-
const { requiredText: e = "Заполните обязательное поле", ...o } = n,
|
|
124
|
-
const
|
|
125
|
-
a.set(
|
|
123
|
+
function ot(t, n = {}) {
|
|
124
|
+
const { requiredText: e = "Заполните обязательное поле", ...o } = n, r = O(t), i = r.group === "invalid" && d(r.body) ? r.body : void 0, a = /* @__PURE__ */ new Map(), l = [], f = (u, g) => {
|
|
125
|
+
const c = a.get(u);
|
|
126
|
+
a.set(u, c && c !== g ? `${c}; ${g}` : g);
|
|
126
127
|
};
|
|
127
|
-
let
|
|
128
|
-
if (
|
|
129
|
-
|
|
130
|
-
for (const
|
|
131
|
-
if (typeof
|
|
132
|
-
|
|
128
|
+
let m = !1;
|
|
129
|
+
if (i && Array.isArray(i.errors)) {
|
|
130
|
+
m = !0;
|
|
131
|
+
for (const u of i.errors) {
|
|
132
|
+
if (typeof u == "string") {
|
|
133
|
+
u.trim() && l.push(u.trim());
|
|
133
134
|
continue;
|
|
134
135
|
}
|
|
135
|
-
if (!
|
|
136
|
-
const
|
|
137
|
-
|
|
136
|
+
if (!d(u)) continue;
|
|
137
|
+
const g = M(u), c = K(u);
|
|
138
|
+
g ? f(g, c ?? e) : c && l.push(c);
|
|
138
139
|
}
|
|
139
|
-
} else if (
|
|
140
|
-
|
|
141
|
-
for (const [
|
|
142
|
-
const
|
|
143
|
-
|
|
140
|
+
} else if (i && d(i.errors)) {
|
|
141
|
+
m = !0;
|
|
142
|
+
for (const [u, g] of Object.entries(i.errors)) {
|
|
143
|
+
const c = R(g);
|
|
144
|
+
c && f(u, c);
|
|
144
145
|
}
|
|
145
146
|
}
|
|
146
|
-
if (
|
|
147
|
-
for (const
|
|
148
|
-
typeof
|
|
147
|
+
if (i && Array.isArray(i.missingFields))
|
|
148
|
+
for (const u of i.missingFields)
|
|
149
|
+
typeof u == "string" && u && !a.has(u) && f(u, e);
|
|
149
150
|
const v = Object.fromEntries(a), y = [...a.keys()];
|
|
150
|
-
if (!y.length) return { fields: v, message:
|
|
151
|
-
if (!
|
|
152
|
-
return { fields: v, firstField: y[0], message:
|
|
153
|
-
const E =
|
|
154
|
-
return { fields: v, firstField: y[0], message:
|
|
155
|
-
}
|
|
156
|
-
const
|
|
157
|
-
let
|
|
158
|
-
function
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
151
|
+
if (!y.length) return { fields: v, message: w(t, o).message };
|
|
152
|
+
if (!m)
|
|
153
|
+
return { fields: v, firstField: y[0], message: w(t, o).message };
|
|
154
|
+
const E = l.filter(A), I = E.length ? E.join("; ") : l.length ? w(t, o).title : "";
|
|
155
|
+
return { fields: v, firstField: y[0], message: I };
|
|
156
|
+
}
|
|
157
|
+
const Y = "support@urfu.ru", rt = "Написать в техподдержку";
|
|
158
|
+
let s = {}, b = null;
|
|
159
|
+
function _() {
|
|
160
|
+
s.diagnostics && !b ? b = j() : !s.diagnostics && b && (b(), b = null);
|
|
161
|
+
}
|
|
162
|
+
function it(t) {
|
|
163
|
+
const n = s;
|
|
164
|
+
return s = { ...s, ...t }, _(), () => {
|
|
165
|
+
s = n, _();
|
|
162
166
|
};
|
|
163
167
|
}
|
|
164
|
-
function
|
|
165
|
-
return
|
|
168
|
+
function st() {
|
|
169
|
+
return s;
|
|
166
170
|
}
|
|
167
|
-
const
|
|
168
|
-
function
|
|
169
|
-
if (
|
|
171
|
+
const T = "__qiankun_microapp_wrapper_for_";
|
|
172
|
+
function S() {
|
|
173
|
+
if (s.service) return s.service;
|
|
170
174
|
if (typeof document > "u") return;
|
|
171
|
-
const t = document.querySelector(`[id^="${
|
|
172
|
-
return t ? t.id.slice(
|
|
175
|
+
const t = document.querySelector(`[id^="${T}"]`);
|
|
176
|
+
return t ? t.id.slice(T.length).replace(/_+$/, "").replace(/_/g, "-") : typeof location > "u" ? void 0 : location.host;
|
|
173
177
|
}
|
|
174
|
-
function
|
|
178
|
+
function X(t) {
|
|
175
179
|
const n = [
|
|
176
180
|
[/YaBrowser\/(\d+)/, "Яндекс Браузер"],
|
|
177
181
|
[/Edg\/(\d+)/, "Edge"],
|
|
@@ -181,12 +185,12 @@ function M(t) {
|
|
|
181
185
|
[/Version\/(\d+)[\d.]* .*Safari/, "Safari"]
|
|
182
186
|
];
|
|
183
187
|
for (const [e, o] of n) {
|
|
184
|
-
const
|
|
185
|
-
if (
|
|
188
|
+
const r = t.match(e);
|
|
189
|
+
if (r) return `${o} ${r[1]}`;
|
|
186
190
|
}
|
|
187
191
|
return t.slice(0, 120);
|
|
188
192
|
}
|
|
189
|
-
function
|
|
193
|
+
function H(t) {
|
|
190
194
|
if (/Windows NT 10/.test(t)) return "Windows 10 или 11";
|
|
191
195
|
if (/Windows NT 6\.3/.test(t)) return "Windows 8.1";
|
|
192
196
|
if (/Windows NT 6\.1/.test(t)) return "Windows 7";
|
|
@@ -195,7 +199,7 @@ function U(t) {
|
|
|
195
199
|
const e = t.match(/(?:iPhone|iPad).*OS ([\d_]+)/);
|
|
196
200
|
return e ? `iOS ${e[1].replace(/_/g, ".")}` : /Mac OS X/.test(t) ? "macOS" : /Linux/.test(t) ? "Linux" : "не определена";
|
|
197
201
|
}
|
|
198
|
-
function
|
|
202
|
+
function Q(t) {
|
|
199
203
|
const n = new Date(t);
|
|
200
204
|
return Number.isNaN(n.getTime()) ? t : `${n.toLocaleString("ru-RU", {
|
|
201
205
|
timeZone: "Asia/Yekaterinburg",
|
|
@@ -207,37 +211,90 @@ function W(t) {
|
|
|
207
211
|
second: "2-digit"
|
|
208
212
|
})} по Екатеринбургу (${t})`;
|
|
209
213
|
}
|
|
210
|
-
function
|
|
211
|
-
|
|
214
|
+
function V(t) {
|
|
215
|
+
return new Date(t).toLocaleTimeString("ru-RU", { timeZone: "Asia/Yekaterinburg", hour12: !1 });
|
|
216
|
+
}
|
|
217
|
+
function Z(t) {
|
|
218
|
+
return `${V(t.time)} ${t.status ? t.status : "—"} ${t.path} ${t.duration} мс`;
|
|
219
|
+
}
|
|
220
|
+
function G() {
|
|
221
|
+
if (typeof document > "u" || typeof window > "u") return;
|
|
222
|
+
const t = document.documentElement, n = t.getAttribute("data-u-viewport");
|
|
223
|
+
if (n && t.getAttribute("data-u-responsive") === "urfu") return n;
|
|
224
|
+
const e = window.innerWidth;
|
|
225
|
+
return `${e <= 576 ? "mobile" : e <= 900 ? "tablet" : "desktop"} (по ширине окна, шкала urfu не включена)`;
|
|
226
|
+
}
|
|
227
|
+
function x() {
|
|
228
|
+
return "2.1.6";
|
|
229
|
+
}
|
|
230
|
+
function z(t) {
|
|
231
|
+
if (!(!s.roles && !t))
|
|
232
|
+
try {
|
|
233
|
+
const n = s.roles ? s.roles() : t ?? [];
|
|
234
|
+
return `Роли: ${n.length ? n.join(", ") : "нет"}`;
|
|
235
|
+
} catch {
|
|
236
|
+
return "Роли: не удалось получить";
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
function J() {
|
|
240
|
+
var n, e;
|
|
241
|
+
if (typeof document > "u") return null;
|
|
242
|
+
const t = document.defaultView;
|
|
243
|
+
try {
|
|
244
|
+
return ((e = (n = t == null ? void 0 : t[/* @__PURE__ */ Symbol.for("urfu-ui-kit.dev-panel")]) == null ? void 0 : n.diagnostics) == null ? void 0 : e.call(n)) ?? null;
|
|
245
|
+
} catch {
|
|
246
|
+
return null;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
function tt(t, n) {
|
|
250
|
+
const e = G(), o = z(n == null ? void 0 : n.roles);
|
|
251
|
+
if (!t)
|
|
252
|
+
return ["Дополнительные сведения: " + [`кит ${x()}`, e && `брейкпоинт ${e.split(" ")[0]}`, o && o.charAt(0).toLowerCase() + o.slice(1)].filter(Boolean).join("; ")];
|
|
253
|
+
const r = n ? n.requests : k();
|
|
254
|
+
return [
|
|
255
|
+
"",
|
|
256
|
+
"Дополнительные сведения:",
|
|
257
|
+
`Версия кита: ${x()}`,
|
|
258
|
+
e ? `Брейкпоинт: ${e}` : void 0,
|
|
259
|
+
o,
|
|
260
|
+
...r.length ? ["Последние запросы (время по Екатеринбургу):", ...r.map(Z)] : ["Последние запросы: нет"]
|
|
261
|
+
];
|
|
262
|
+
}
|
|
263
|
+
function ut(t) {
|
|
264
|
+
return F(t, !0);
|
|
265
|
+
}
|
|
266
|
+
function F(t, n) {
|
|
267
|
+
const { details: e } = t, o = typeof window < "u", r = typeof navigator > "u" ? "" : navigator.userAgent, i = S(), a = o && !!window.__POWERED_BY_QIANKUN__, l = s.diagnostics === void 0 ? J() : null;
|
|
212
268
|
return [
|
|
213
269
|
`Ошибка: ${t.title}`,
|
|
214
|
-
|
|
215
|
-
i ? `Сервис: ${[i,
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
`Время: ${
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
270
|
+
e.code !== null ? `Код: ${e.code}` : e.status ? `Статус: ${e.status}` : "Код: нет ответа сервера",
|
|
271
|
+
i ? `Сервис: ${[i, s.version].filter(Boolean).join(", ")}` : void 0,
|
|
272
|
+
o ? `Где открыт: ${a ? "в личном кабинете" : "отдельно, без личного кабинета"}` : void 0,
|
|
273
|
+
o ? `Страница: ${window.location.href}` : void 0,
|
|
274
|
+
e.method || e.url ? `Запрос: ${[e.method, e.url].filter(Boolean).join(" ")}` : void 0,
|
|
275
|
+
e.requestId ? `ID запроса: ${e.requestId}` : void 0,
|
|
276
|
+
e.serverMessage ? `Сообщение сервера: ${e.serverMessage}` : void 0,
|
|
277
|
+
`Время: ${Q(e.time)}`,
|
|
278
|
+
r ? `Браузер: ${X(r)}` : void 0,
|
|
279
|
+
r ? `Система: ${H(r)}` : void 0,
|
|
280
|
+
o ? `Окно: ${window.innerWidth}×${window.innerHeight}, масштаб ${Math.round((window.devicePixelRatio || 1) * 100)}%` : void 0,
|
|
225
281
|
typeof navigator < "u" && navigator.onLine === !1 ? "Сеть: браузер без связи" : void 0,
|
|
226
|
-
|
|
227
|
-
|
|
282
|
+
s.user ? `Пользователь: ${s.user}` : void 0,
|
|
283
|
+
...s.diagnostics || l ? tt(n, l) : []
|
|
284
|
+
].filter((f) => f !== void 0).join(`
|
|
228
285
|
`);
|
|
229
286
|
}
|
|
230
|
-
function
|
|
231
|
-
const e = t.code !== null ? ` (${t.code})` : "", o =
|
|
287
|
+
function at(t, n = Y) {
|
|
288
|
+
const e = t.code !== null ? ` (${t.code})` : "", o = S(), r = `Ошибка в личном кабинете: ${o ? `${o} — ` : ""}${t.title}${e}`, i = [
|
|
232
289
|
"Здравствуйте!",
|
|
233
290
|
"",
|
|
234
291
|
"Что я делал(а), когда появилась ошибка:",
|
|
235
292
|
"",
|
|
236
293
|
"",
|
|
237
294
|
"Подробности для технической поддержки:",
|
|
238
|
-
|
|
295
|
+
F(t, !1)
|
|
239
296
|
].join(`\r
|
|
240
297
|
`);
|
|
241
|
-
return `mailto:${n}?subject=${encodeURIComponent(
|
|
298
|
+
return `mailto:${n}?subject=${encodeURIComponent(r)}&body=${encodeURIComponent(i)}`;
|
|
242
299
|
}
|
|
243
|
-
export {
|
|
300
|
+
export { N as DEFAULT_ERROR_TEXTS$u, Y as DEFAULT_SUPPORT_EMAIL$u, rt as DEFAULT_SUPPORT_LABEL$u, it as configureErrorReport$u, nt as configureErrorTexts$u, w as describeError$u, ot as describeFieldErrors$u, ut as formatErrorDetails$u, st as getErrorReportConfig$u, A as isHumanMessage$u, at as supportMailto$u };
|
|
@@ -1,25 +1,28 @@
|
|
|
1
|
-
const
|
|
2
|
-
const b =
|
|
3
|
-
if (
|
|
4
|
-
const
|
|
5
|
-
return
|
|
6
|
-
},
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
const T = 0.4, O = (n, u, o, l, r, c, f) => {
|
|
2
|
+
const b = n.length + Number(f), h = n.reduce((t, s) => t + u[s], 0) + (f ? c : 0) + Math.max(0, b - 1) * r - l;
|
|
3
|
+
if (h <= 0.01) return 0;
|
|
4
|
+
const a = n.reduce((t, s) => t + (o[s] ?? 0), 0);
|
|
5
|
+
return a > 0 ? Math.min(1, (h + 0.5) / a) : 0;
|
|
6
|
+
}, q = (n, u, o, l, r) => {
|
|
7
|
+
const c = O(n, u, o, l, r, 0, !1);
|
|
8
|
+
return c < 1 ? c : 0;
|
|
9
|
+
}, z = (n, u, o, l, r, c, f = !1, b = []) => {
|
|
10
|
+
const m = (e) => e <= o + 0.01, h = (e) => u[e] - (f ? 0 : b[e] ?? 0), a = (e, p) => {
|
|
11
|
+
const g = f ? Math.max(0, ...e.map((i) => u[i])) * e.length : e.reduce((i, N) => i + h(N), 0), x = e.length + Number(p);
|
|
12
|
+
return g + (p ? r : 0) + Math.max(0, x - 1) * l;
|
|
10
13
|
};
|
|
11
|
-
if (
|
|
12
|
-
return { visible:
|
|
14
|
+
if (o <= 0 || m(a(n, !1)))
|
|
15
|
+
return { visible: n, overflow: [] };
|
|
13
16
|
const t = [];
|
|
14
|
-
for (const
|
|
15
|
-
if (!
|
|
16
|
-
t.push(
|
|
17
|
+
for (const e of n) {
|
|
18
|
+
if (!m(a([...t, e], !0))) break;
|
|
19
|
+
t.push(e);
|
|
17
20
|
}
|
|
18
|
-
const s =
|
|
19
|
-
for (s !== void 0 && !t.includes(s) && (t.length && t.pop(), t.push(s)); t.length > 1 && !
|
|
20
|
-
const
|
|
21
|
-
t.splice(
|
|
21
|
+
const s = n.includes(c) ? c : n[0];
|
|
22
|
+
for (s !== void 0 && !t.includes(s) && (t.length && t.pop(), t.push(s)); t.length > 1 && !m(a(t, !0)); ) {
|
|
23
|
+
const e = t.map((p) => p !== s).lastIndexOf(!0);
|
|
24
|
+
t.splice(e, 1);
|
|
22
25
|
}
|
|
23
|
-
return { visible: t, overflow:
|
|
26
|
+
return { visible: t, overflow: n.filter((e) => !t.includes(e)) };
|
|
24
27
|
};
|
|
25
|
-
export {
|
|
28
|
+
export { T as TAB_PADDING_MIN_RATIO$u, z as distributeTabs$u, q as lineTabsSqueeze$u, O as tabsSqueeze$u };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
var c = Object.defineProperty;
|
|
2
|
+
var f = (i, e, t) => e in i ? c(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
|
+
var s = (i, e, t) => f(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { findScrollParent$u as d } from "./virtualList.js";
|
|
5
|
+
const g = (i) => typeof i == "object" && i !== null && typeof i.then == "function";
|
|
6
|
+
class p {
|
|
7
|
+
constructor() {
|
|
8
|
+
s(this, "options", { onLoadMore: () => {
|
|
9
|
+
}, hasMore: !1 });
|
|
10
|
+
s(this, "sentinel", null);
|
|
11
|
+
s(this, "observer", null);
|
|
12
|
+
s(this, "intersecting", !1);
|
|
13
|
+
s(this, "locked", !1);
|
|
14
|
+
s(this, "failed", !1);
|
|
15
|
+
s(this, "generation", 0);
|
|
16
|
+
}
|
|
17
|
+
setOptions(e) {
|
|
18
|
+
const t = this.options;
|
|
19
|
+
if (this.options = e, this.sentinel && (t.rootMargin !== e.rootMargin || t.root !== e.root)) {
|
|
20
|
+
this.attach(this.sentinel);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (this.locked && t.loading && !e.loading) {
|
|
24
|
+
this.release(!0);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
this.maybeLoad();
|
|
28
|
+
}
|
|
29
|
+
/** Подключает датчик; `null` — отключить. */
|
|
30
|
+
attach(e) {
|
|
31
|
+
var o;
|
|
32
|
+
if ((o = this.observer) == null || o.disconnect(), this.observer = null, this.sentinel = e, this.intersecting = !1, !e || typeof IntersectionObserver > "u") return;
|
|
33
|
+
const t = this.options.root === void 0 ? d(e.parentElement) : this.options.root;
|
|
34
|
+
this.observer = new IntersectionObserver((a) => {
|
|
35
|
+
const r = a[a.length - 1];
|
|
36
|
+
if (!r) return;
|
|
37
|
+
const n = this.intersecting;
|
|
38
|
+
this.intersecting = r.isIntersecting, this.intersecting && !n && (this.failed = !1), this.maybeLoad();
|
|
39
|
+
}, { root: t, rootMargin: this.options.rootMargin ?? "200px" }), this.observer.observe(e);
|
|
40
|
+
}
|
|
41
|
+
/** Повторить подгрузку после ошибки. */
|
|
42
|
+
retry() {
|
|
43
|
+
this.failed = !1, this.maybeLoad();
|
|
44
|
+
}
|
|
45
|
+
destroy() {
|
|
46
|
+
this.generation++, this.attach(null);
|
|
47
|
+
}
|
|
48
|
+
maybeLoad() {
|
|
49
|
+
const { hasMore: e, loading: t, disabled: o, onLoadMore: a } = this.options;
|
|
50
|
+
if (this.locked || this.failed || !this.intersecting || !e || t || o) return;
|
|
51
|
+
this.locked = !0;
|
|
52
|
+
const r = ++this.generation;
|
|
53
|
+
let n;
|
|
54
|
+
try {
|
|
55
|
+
n = a();
|
|
56
|
+
} catch (h) {
|
|
57
|
+
throw this.locked = !1, this.failed = !0, h;
|
|
58
|
+
}
|
|
59
|
+
if (g(n)) {
|
|
60
|
+
n.then(
|
|
61
|
+
() => {
|
|
62
|
+
r === this.generation && this.release(!0);
|
|
63
|
+
},
|
|
64
|
+
() => {
|
|
65
|
+
r === this.generation && (this.failed = !0, this.release(!1));
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const l = typeof requestAnimationFrame == "function" ? requestAnimationFrame : (h) => setTimeout(h, 16);
|
|
71
|
+
l(() => l(() => {
|
|
72
|
+
r === this.generation && this.locked && !this.options.loading && this.release(!0);
|
|
73
|
+
}));
|
|
74
|
+
}
|
|
75
|
+
release(e) {
|
|
76
|
+
this.locked = !1, !(!e || !this.observer || !this.sentinel) && (this.intersecting = !1, this.observer.unobserve(this.sentinel), this.observer.observe(this.sentinel));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
export { p as InfiniteScrollCore$u };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const i = { instant: 100, fast: 150, base: 200, moderate: 250, slow: 300 }, r = {
|
|
2
|
+
move: "cubic-bezier(.2, 0, 0, 1)",
|
|
3
|
+
enter: "cubic-bezier(0, 0, .2, 1)",
|
|
4
|
+
exit: "cubic-bezier(.4, 0, 1, 1)"
|
|
5
|
+
}, a = 4, s = "data-u-motion", u = "data-u-motion-scale", c = () => typeof document > "u" ? null : document.documentElement, d = () => {
|
|
6
|
+
var t, e;
|
|
7
|
+
return ((t = c()) == null ? void 0 : t.getAttribute(s)) === "reduce" || typeof window < "u" && ((e = window.matchMedia) == null ? void 0 : e.call(window, "(prefers-reduced-motion: reduce)").matches) === !0;
|
|
8
|
+
}, f = () => {
|
|
9
|
+
var e;
|
|
10
|
+
const t = Number((e = c()) == null ? void 0 : e.getAttribute(u));
|
|
11
|
+
return Number.isFinite(t) && t > 0 ? t : 1;
|
|
12
|
+
}, m = (t) => (typeof t == "number" ? t : i[t]) * f(), n = /* @__PURE__ */ new WeakMap(), b = (t) => {
|
|
13
|
+
var o;
|
|
14
|
+
if (!t) return () => {
|
|
15
|
+
};
|
|
16
|
+
if ((o = n.get(t)) == null || o.cancel(), n.delete(t), typeof t.animate != "function" || d()) return () => {
|
|
17
|
+
};
|
|
18
|
+
const e = t.animate(
|
|
19
|
+
[
|
|
20
|
+
{ opacity: 0, transform: `translateY(${a}px)` },
|
|
21
|
+
{ opacity: 1, transform: "none" }
|
|
22
|
+
],
|
|
23
|
+
{ duration: m("base"), easing: r.enter }
|
|
24
|
+
);
|
|
25
|
+
return n.set(t, e), () => {
|
|
26
|
+
e.cancel(), n.get(t) === e && n.delete(t);
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export { r as MOTION_EASE$u, i as MOTION_MS$u, s as MOTION_REDUCE_ATTR$u, u as MOTION_SCALE_ATTR$u, a as MOTION_SHIFT_SM$u, m as motionMs$u, f as motionScale$u, b as playEnterMotion$u, d as prefersReducedMotion$u };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const c = 10, i = /* @__PURE__ */ new Set(["fetch", "xmlhttprequest"]);
|
|
2
|
+
let r = [];
|
|
3
|
+
function s(t, n = typeof location > "u" ? "" : location.href) {
|
|
4
|
+
try {
|
|
5
|
+
const e = new URL(t, n || void 0), o = n ? new URL(n).origin : "";
|
|
6
|
+
return e.origin === o ? e.pathname : `${e.host}${e.pathname}`;
|
|
7
|
+
} catch {
|
|
8
|
+
return t.split(/[?#]/)[0];
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function u(t) {
|
|
12
|
+
for (const n of t) {
|
|
13
|
+
const e = n;
|
|
14
|
+
i.has(e.initiatorType) && r.push({
|
|
15
|
+
time: Math.round((performance.timeOrigin || 0) + e.startTime),
|
|
16
|
+
path: s(e.name),
|
|
17
|
+
status: typeof e.responseStatus == "number" ? e.responseStatus : void 0,
|
|
18
|
+
duration: Math.round(e.duration)
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
r.length > 10 && (r = r.slice(-10));
|
|
22
|
+
}
|
|
23
|
+
function a() {
|
|
24
|
+
return r;
|
|
25
|
+
}
|
|
26
|
+
function f() {
|
|
27
|
+
if (typeof PerformanceObserver > "u") return () => {
|
|
28
|
+
};
|
|
29
|
+
let t;
|
|
30
|
+
try {
|
|
31
|
+
t = new PerformanceObserver((n) => u(n.getEntries())), t.observe({ type: "resource", buffered: !0 });
|
|
32
|
+
} catch {
|
|
33
|
+
return () => {
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return () => {
|
|
37
|
+
t.disconnect(), r = [];
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export { c as REQUEST_LOG_SIZE$u, a as getRequestLog$u, s as sanitizeRequestUrl$u, f as startRequestLog$u };
|