urfu-ui-kit-react 2.1.1 → 2.1.2
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/README.md +5 -2
- package/dist/components/Calendar/Calendar.d.ts +1 -1
- package/dist/components/Calendar/Calendar.d.ts.map +1 -1
- package/dist/components/Calendar/Calendar.types.d.ts +3 -0
- package/dist/components/Calendar/Calendar.types.d.ts.map +1 -1
- package/dist/components/Modal/Modal.d.ts.map +1 -1
- package/dist/components/Modal/useModalFocus.d.ts +3 -1
- package/dist/components/Modal/useModalFocus.d.ts.map +1 -1
- package/dist/components/Notification/Notification.d.ts.map +1 -1
- package/dist/components/Table/Filter/FilterDateBox.d.ts +7 -3
- package/dist/components/Table/Filter/FilterDateBox.d.ts.map +1 -1
- package/dist/components/Table/Table.filterTypes.d.ts +4 -1
- package/dist/components/Table/Table.filterTypes.d.ts.map +1 -1
- package/dist/dev/index.js +429 -407
- package/dist/dev/types/vanilla/src/dev/intercept.d.ts +5 -2
- package/dist/dev/types/vanilla/src/dev/store.d.ts +3 -1
- package/dist/fonts/montserrat/Montserrat-Bold.woff2 +0 -0
- package/dist/fonts/montserrat/Montserrat-Medium.woff2 +0 -0
- package/dist/fonts/montserrat/Montserrat-Regular.woff2 +0 -0
- package/dist/fonts/montserrat/Montserrat-SemiBold.woff2 +0 -0
- package/dist/hooks/useAutoId.d.ts +3 -0
- package/dist/hooks/useAutoId.d.ts.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/responsive/uiKitResponsive.d.ts +2 -1
- package/dist/responsive/uiKitResponsive.d.ts.map +1 -1
- package/dist/shared/kitCopy.d.ts +21 -0
- package/dist/shared/kitCopy.d.ts.map +1 -0
- package/dist/shared/kitRegistry.d.ts +89 -0
- package/dist/shared/kitRegistry.d.ts.map +1 -0
- package/dist/style.css +8 -8
- package/dist/style.layer.css +8 -8
- package/dist/style.shell.css +16 -12
- package/dist/urfu-ui-kit-react.js +5465 -5277
- package/dist/utils/inputMode.d.ts +2 -1
- package/dist/utils/inputMode.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/dev/index.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { useSyncExternalStore as
|
|
2
|
-
let
|
|
3
|
-
const
|
|
4
|
-
let
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { useSyncExternalStore as Ft } from "react";
|
|
2
|
+
let O = [], Ht = 1;
|
|
3
|
+
const B = /* @__PURE__ */ new Set();
|
|
4
|
+
let R = !1;
|
|
5
|
+
function K() {
|
|
6
|
+
R || (R = !0, setTimeout(() => {
|
|
7
|
+
R = !1, B.forEach((t) => t());
|
|
8
8
|
}, 16));
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
let
|
|
14
|
-
return (
|
|
15
|
-
|
|
10
|
+
function jt(t, e, n) {
|
|
11
|
+
const o = Date.now(), r = { id: Ht++, service: t, method: e.toUpperCase(), path: n, status: "pending", duration: null, endedAt: null, faked: !1 };
|
|
12
|
+
O = [...O.slice(-49), r], K();
|
|
13
|
+
let a = !1;
|
|
14
|
+
return (s, i) => {
|
|
15
|
+
a || (a = !0, r.status = s, r.faked = i, r.endedAt = Date.now(), r.duration = r.endedAt - o, K());
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
return [...
|
|
18
|
+
function et() {
|
|
19
|
+
return [...O].reverse();
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
|
|
21
|
+
function dt() {
|
|
22
|
+
O = [], R = !1, K();
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
return
|
|
26
|
-
|
|
24
|
+
function Ut(t) {
|
|
25
|
+
return B.add(t), () => {
|
|
26
|
+
B.delete(t);
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
const
|
|
30
|
-
let
|
|
31
|
-
const
|
|
29
|
+
const ft = "urfu-ui-kit:dev:", w = /* @__PURE__ */ new Map(), J = /* @__PURE__ */ new Set();
|
|
30
|
+
let pt;
|
|
31
|
+
const ht = (t) => `${ft}${t}`, Nt = ["offline", "network", "slow"];
|
|
32
32
|
let E = null;
|
|
33
|
-
const
|
|
34
|
-
function
|
|
33
|
+
const I = /* @__PURE__ */ new Set();
|
|
34
|
+
function _t() {
|
|
35
35
|
let t;
|
|
36
36
|
try {
|
|
37
37
|
t = new URLSearchParams(window.location.search).get("dev");
|
|
@@ -42,11 +42,11 @@ function Ut() {
|
|
|
42
42
|
if (t === "off") {
|
|
43
43
|
E = null;
|
|
44
44
|
try {
|
|
45
|
-
Object.keys(localStorage).filter((e) => e.startsWith(
|
|
45
|
+
Object.keys(localStorage).filter((e) => e.startsWith(ft)).forEach((e) => localStorage.removeItem(e));
|
|
46
46
|
} catch {
|
|
47
47
|
}
|
|
48
48
|
} else
|
|
49
|
-
E = t.split(",").map((e) => e.trim()).filter(Boolean),
|
|
49
|
+
E = t.split(",").map((e) => e.trim()).filter(Boolean), I.clear();
|
|
50
50
|
try {
|
|
51
51
|
const e = new URL(window.location.href);
|
|
52
52
|
e.searchParams.delete("dev"), window.history.replaceState(window.history.state, "", e.href);
|
|
@@ -54,17 +54,17 @@ function Ut() {
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
return [...
|
|
57
|
+
function Wt(t) {
|
|
58
|
+
return [...Nt, ...t.builtins ?? [], ...(t.groups ?? []).flatMap((e) => e.items.map((n) => n.id))];
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
if (!E ||
|
|
62
|
-
const e = new Set(
|
|
63
|
-
n.length && (
|
|
60
|
+
function Bt(t) {
|
|
61
|
+
if (!E || I.has(t.config.service)) return;
|
|
62
|
+
const e = new Set(Wt(t.config)), n = E.filter((o) => e.has(o));
|
|
63
|
+
n.length && (I.add(t.config.service), t.state = { ...t.state, faults: n }, N(t.config.service, t.state));
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function Kt(t) {
|
|
66
66
|
try {
|
|
67
|
-
const e = JSON.parse(localStorage.getItem(
|
|
67
|
+
const e = JSON.parse(localStorage.getItem(ht(t)) ?? "null");
|
|
68
68
|
return {
|
|
69
69
|
faults: Array.isArray(e == null ? void 0 : e.faults) ? e.faults.filter((n) => typeof n == "string") : [],
|
|
70
70
|
rules: Array.isArray(e == null ? void 0 : e.rules) ? e.rules : [],
|
|
@@ -74,145 +74,145 @@ function Nt(t) {
|
|
|
74
74
|
return { faults: [], rules: [] };
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function N(t, e) {
|
|
78
78
|
try {
|
|
79
|
-
localStorage.setItem(
|
|
79
|
+
localStorage.setItem(ht(t), JSON.stringify(e));
|
|
80
80
|
} catch {
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
function
|
|
84
|
-
t && (
|
|
83
|
+
function Jt(t) {
|
|
84
|
+
t && (pt = t);
|
|
85
85
|
}
|
|
86
|
-
function
|
|
87
|
-
return
|
|
86
|
+
function Xt() {
|
|
87
|
+
return pt;
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
const
|
|
91
|
-
return
|
|
89
|
+
function Zt(t, e) {
|
|
90
|
+
const n = { config: t, state: Kt(t.service), kit: e };
|
|
91
|
+
return Bt(n), w.set(t.service, n), M(), n;
|
|
92
92
|
}
|
|
93
|
-
function
|
|
94
|
-
|
|
93
|
+
function Vt(t) {
|
|
94
|
+
w.delete(t), w.size || (E = null, I.clear()), M();
|
|
95
95
|
}
|
|
96
96
|
function v() {
|
|
97
|
-
return [...
|
|
97
|
+
return [...w.values()];
|
|
98
98
|
}
|
|
99
|
-
function
|
|
100
|
-
return t ?
|
|
99
|
+
function Gt(t) {
|
|
100
|
+
return t ? w.get(t) : w.values().next().value;
|
|
101
101
|
}
|
|
102
|
-
function
|
|
103
|
-
return
|
|
104
|
-
|
|
102
|
+
function bt(t) {
|
|
103
|
+
return J.add(t), () => {
|
|
104
|
+
J.delete(t);
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
|
-
function
|
|
108
|
-
|
|
107
|
+
function M() {
|
|
108
|
+
J.forEach((t) => t());
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
t.state = e,
|
|
110
|
+
function _(t, e) {
|
|
111
|
+
t.state = e, N(t.config.service, e), M();
|
|
112
112
|
}
|
|
113
|
-
function
|
|
114
|
-
const
|
|
115
|
-
|
|
113
|
+
function Yt(t, e, n) {
|
|
114
|
+
const o = t.state.faults.filter((r) => r !== e);
|
|
115
|
+
_(t, { ...t.state, faults: n ? [...o, e] : o });
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function Qt(t, e) {
|
|
118
118
|
const n = `rule-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 6)}`;
|
|
119
|
-
|
|
119
|
+
_(t, { ...t.state, rules: [...t.state.rules, { ...e, id: n, enabled: !0 }] });
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
|
|
121
|
+
function te(t, e, n) {
|
|
122
|
+
_(t, { ...t.state, rules: t.state.rules.map((o) => o.id === e ? { ...o, enabled: n } : o) });
|
|
123
123
|
}
|
|
124
|
-
function
|
|
125
|
-
|
|
124
|
+
function ee(t, e) {
|
|
125
|
+
_(t, { ...t.state, rules: t.state.rules.filter((n) => n.id !== e) });
|
|
126
126
|
}
|
|
127
|
-
function
|
|
128
|
-
|
|
129
|
-
t.state = { faults: [], rules: [], ...t.state.launcher ? { launcher: t.state.launcher } : {} },
|
|
130
|
-
}),
|
|
127
|
+
function ne() {
|
|
128
|
+
w.forEach((t) => {
|
|
129
|
+
t.state = { faults: [], rules: [], ...t.state.launcher ? { launcher: t.state.launcher } : {} }, N(t.config.service, t.state);
|
|
130
|
+
}), M();
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function q(t) {
|
|
133
133
|
return t.state.faults.length + t.state.rules.filter((e) => e.enabled).length;
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function oe(t) {
|
|
136
136
|
return t.state.launcher ?? t.config.launcher ?? "visible";
|
|
137
137
|
}
|
|
138
|
-
function
|
|
139
|
-
|
|
140
|
-
e.state = { ...e.state, launcher: t },
|
|
141
|
-
}),
|
|
138
|
+
function ot(t) {
|
|
139
|
+
w.forEach((e) => {
|
|
140
|
+
e.state = { ...e.state, launcher: t }, N(e.config.service, e.state);
|
|
141
|
+
}), M();
|
|
142
142
|
}
|
|
143
|
-
const
|
|
144
|
-
let
|
|
145
|
-
const
|
|
146
|
-
let
|
|
147
|
-
const
|
|
143
|
+
const ae = 1e4, at = 200, L = ".u-error-screen, .u-notification-fail, .u-notification-warning, .u-offline-banner-offline";
|
|
144
|
+
let z = [], re = 1;
|
|
145
|
+
const X = /* @__PURE__ */ new WeakMap(), F = /* @__PURE__ */ new Set();
|
|
146
|
+
let x = null;
|
|
147
|
+
const y = (t) => {
|
|
148
148
|
const e = (t ?? "").replace(/\s+/g, " ").trim();
|
|
149
|
-
return e.length >
|
|
150
|
-
},
|
|
151
|
-
function
|
|
152
|
-
var
|
|
153
|
-
const n = v().map((
|
|
154
|
-
if (!
|
|
155
|
-
const
|
|
156
|
-
return n.length > 1 ? `${
|
|
149
|
+
return e.length > at ? `${e.slice(0, at - 1)}…` : e;
|
|
150
|
+
}, se = (t) => t.status === "network" || typeof t.status == "number" && t.status >= 400;
|
|
151
|
+
function ie(t, e) {
|
|
152
|
+
var i;
|
|
153
|
+
const n = v().map((f) => f.config.service), o = (i = e.closest("[data-name]")) == null ? void 0 : i.getAttribute("data-name"), r = o && n.includes(o) ? o : null, a = et().find((f) => se(f) && f.endedAt !== null && t - f.endedAt <= ae && (!r || f.service === r));
|
|
154
|
+
if (!a) return;
|
|
155
|
+
const s = `${a.method} ${a.path} → ${a.status === "network" ? "сеть" : a.status}`;
|
|
156
|
+
return n.length > 1 ? `${a.service}: ${s}` : s;
|
|
157
157
|
}
|
|
158
|
-
function
|
|
159
|
-
var
|
|
158
|
+
function le(t) {
|
|
159
|
+
var o, r, a;
|
|
160
160
|
if (t.classList.contains("u-error-screen"))
|
|
161
161
|
return {
|
|
162
162
|
kind: "screen",
|
|
163
163
|
// Код — в data-error-code на корне заглушки: крупный код рисуется не у всех вариантов (forbidden, serverError).
|
|
164
164
|
// .u-error-screen-code — для разметки кита до появления атрибута.
|
|
165
|
-
code:
|
|
166
|
-
title:
|
|
167
|
-
text:
|
|
165
|
+
code: y(t.dataset.errorCode || ((o = t.querySelector(".u-error-screen-code")) == null ? void 0 : o.textContent)) || void 0,
|
|
166
|
+
title: y((r = t.querySelector(".u-error-screen-title")) == null ? void 0 : r.textContent) || y(t.getAttribute("aria-label")) || "Заглушка",
|
|
167
|
+
text: y((a = t.querySelector(".u-error-screen-description")) == null ? void 0 : a.textContent) || void 0
|
|
168
168
|
};
|
|
169
169
|
if (t.classList.contains("u-offline-banner-offline"))
|
|
170
|
-
return { kind: "offline", title:
|
|
170
|
+
return { kind: "offline", title: y(t.textContent) || "Нет связи" };
|
|
171
171
|
const e = t.classList.contains("u-notification-fail") ? "fail" : "warning", n = t.querySelector(".u-notification-content") ?? t;
|
|
172
|
-
return { kind: "notification", variant: e, title:
|
|
172
|
+
return { kind: "notification", variant: e, title: y(n.textContent) || "Уведомление" };
|
|
173
173
|
}
|
|
174
|
-
function
|
|
174
|
+
function rt(t) {
|
|
175
175
|
if (!t.isConnected || !t.matches(L)) return;
|
|
176
|
-
const e =
|
|
176
|
+
const e = le(t);
|
|
177
177
|
if (!e) return;
|
|
178
178
|
const n = JSON.stringify(e);
|
|
179
|
-
if (
|
|
180
|
-
|
|
181
|
-
const
|
|
182
|
-
|
|
179
|
+
if (X.get(t) === n) return;
|
|
180
|
+
X.set(t, n);
|
|
181
|
+
const o = Date.now();
|
|
182
|
+
z = [...z.slice(-29), { id: re++, at: o, ...e, cause: ie(o, t) }], F.forEach((r) => r());
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function ce(t, e) {
|
|
185
185
|
t instanceof Element && (t.matches(L) && e.push(t), t.querySelectorAll(L).forEach((n) => e.push(n)));
|
|
186
186
|
}
|
|
187
|
-
function
|
|
188
|
-
|
|
187
|
+
function ue() {
|
|
188
|
+
x || typeof MutationObserver > "u" || (x = new MutationObserver((t) => {
|
|
189
189
|
const e = [];
|
|
190
190
|
t.forEach((n) => {
|
|
191
191
|
if (n.type === "childList") {
|
|
192
|
-
n.addedNodes.forEach((r) =>
|
|
192
|
+
n.addedNodes.forEach((r) => ce(r, e));
|
|
193
193
|
return;
|
|
194
194
|
}
|
|
195
|
-
const
|
|
196
|
-
|
|
197
|
-
}), e.length && setTimeout(() => e.forEach(
|
|
198
|
-
}),
|
|
195
|
+
const o = n.target;
|
|
196
|
+
o.matches(L) ? e.push(o) : X.delete(o);
|
|
197
|
+
}), e.length && setTimeout(() => e.forEach(rt), 0);
|
|
198
|
+
}), x.observe(document.documentElement, { childList: !0, subtree: !0, attributes: !0, attributeFilter: ["data-error-code", "class"] }), document.querySelectorAll(L).forEach(rt));
|
|
199
199
|
}
|
|
200
|
-
function
|
|
201
|
-
|
|
200
|
+
function de() {
|
|
201
|
+
x == null || x.disconnect(), x = null;
|
|
202
202
|
}
|
|
203
|
-
function
|
|
204
|
-
return [...
|
|
203
|
+
function Z() {
|
|
204
|
+
return [...z].reverse();
|
|
205
205
|
}
|
|
206
|
-
function
|
|
207
|
-
|
|
206
|
+
function gt() {
|
|
207
|
+
z = [], F.forEach((t) => t());
|
|
208
208
|
}
|
|
209
|
-
function
|
|
210
|
-
return
|
|
211
|
-
|
|
209
|
+
function fe(t) {
|
|
210
|
+
return F.add(t), () => {
|
|
211
|
+
F.delete(t);
|
|
212
212
|
};
|
|
213
213
|
}
|
|
214
|
-
const
|
|
215
|
-
function
|
|
214
|
+
const vt = 4e3, pe = /* @__PURE__ */ new Set(["GET", "HEAD"]);
|
|
215
|
+
function he(t, e) {
|
|
216
216
|
let n;
|
|
217
217
|
try {
|
|
218
218
|
n = new URL(t, window.location.href).pathname;
|
|
@@ -220,21 +220,21 @@ function ue(t, e) {
|
|
|
220
220
|
return null;
|
|
221
221
|
}
|
|
222
222
|
if (!e) return n;
|
|
223
|
-
const
|
|
223
|
+
const o = e.replace(/\/+$/, ""), r = n.indexOf(o);
|
|
224
224
|
if (r < 0) return null;
|
|
225
|
-
const
|
|
226
|
-
return
|
|
225
|
+
const a = n.slice(r + o.length);
|
|
226
|
+
return a.startsWith("/") || a === "" ? a || "/" : null;
|
|
227
227
|
}
|
|
228
|
-
function
|
|
229
|
-
const n = (
|
|
230
|
-
return
|
|
228
|
+
function be(t, e) {
|
|
229
|
+
const n = (s) => s.split("/").filter(Boolean), o = n(t.trim()), r = n(e), a = (s, i) => s === o.length ? i === r.length : o[s] === "**" ? a(s + 1, i) || i < r.length && a(s, i + 1) : i === r.length ? !1 : (o[s] === "*" || o[s] === r[i]) && a(s + 1, i + 1);
|
|
230
|
+
return a(0, 0);
|
|
231
231
|
}
|
|
232
|
-
function
|
|
233
|
-
var
|
|
234
|
-
const n = (
|
|
235
|
-
return !n || n === "*" ? !0 : n === "WRITE" ? !
|
|
232
|
+
function ge(t, e) {
|
|
233
|
+
var o;
|
|
234
|
+
const n = (o = t.method) == null ? void 0 : o.trim().toUpperCase();
|
|
235
|
+
return !n || n === "*" ? !0 : n === "WRITE" ? !pe.has(e) : n === e;
|
|
236
236
|
}
|
|
237
|
-
function
|
|
237
|
+
function ve(t, e) {
|
|
238
238
|
return t.html ? {
|
|
239
239
|
kind: "response",
|
|
240
240
|
delay: e,
|
|
@@ -249,158 +249,158 @@ function pe(t, e) {
|
|
|
249
249
|
body: JSON.stringify({ statusCode: t.status, message: t.message ?? `Сбой из dev-панели: ${t.status}` })
|
|
250
250
|
};
|
|
251
251
|
}
|
|
252
|
-
function
|
|
252
|
+
function me(t) {
|
|
253
253
|
const e = new Set(t.state.faults);
|
|
254
|
-
return [...(t.config.groups ?? []).flatMap((
|
|
254
|
+
return [...(t.config.groups ?? []).flatMap((o) => o.items).filter((o) => e.has(o.id)).flatMap((o) => [].concat(o.request ?? [])), ...t.state.rules.filter((o) => o.enabled)];
|
|
255
255
|
}
|
|
256
|
-
function
|
|
256
|
+
function mt(t) {
|
|
257
257
|
for (const e of v()) {
|
|
258
|
-
const n =
|
|
258
|
+
const n = he(t, e.config.apiBase);
|
|
259
259
|
if (n !== null) return { entry: e, path: n };
|
|
260
260
|
}
|
|
261
261
|
return null;
|
|
262
262
|
}
|
|
263
|
-
function
|
|
264
|
-
const
|
|
265
|
-
if (r.has("offline") || r.has("network")) return { kind: "network", delay:
|
|
266
|
-
const
|
|
267
|
-
return
|
|
263
|
+
function wt({ entry: t, path: e }, n) {
|
|
264
|
+
const o = n.toUpperCase(), r = new Set(t.state.faults), a = r.has("slow") ? vt : 0;
|
|
265
|
+
if (r.has("offline") || r.has("network")) return { kind: "network", delay: a };
|
|
266
|
+
const s = me(t).find((i) => ge(i, o) && be(i.path, e));
|
|
267
|
+
return s ? ve(s, a) : a ? { kind: "pass", delay: a } : null;
|
|
268
268
|
}
|
|
269
|
-
const
|
|
270
|
-
function
|
|
271
|
-
return new Promise((n,
|
|
269
|
+
const xt = (t, e) => jt(t.entry.config.service, e, t.path), V = (t) => t.reason ?? new DOMException("The operation was aborted.", "AbortError");
|
|
270
|
+
function we(t, e) {
|
|
271
|
+
return new Promise((n, o) => {
|
|
272
272
|
if (e != null && e.aborted) {
|
|
273
|
-
|
|
273
|
+
o(V(e));
|
|
274
274
|
return;
|
|
275
275
|
}
|
|
276
276
|
const r = setTimeout(n, t);
|
|
277
277
|
e == null || e.addEventListener("abort", () => {
|
|
278
|
-
clearTimeout(r),
|
|
278
|
+
clearTimeout(r), o(V(e));
|
|
279
279
|
}, { once: !0 });
|
|
280
280
|
});
|
|
281
281
|
}
|
|
282
|
-
const
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
282
|
+
const yt = /* @__PURE__ */ new Set([204, 205, 304]), P = /* @__PURE__ */ new WeakSet();
|
|
283
|
+
function xe(t) {
|
|
284
|
+
if (typeof window > "u") return;
|
|
285
|
+
const e = t ?? window;
|
|
286
|
+
P.has(e) || (P.add(e), ye(e)), typeof XMLHttpRequest < "u" && !P.has(XMLHttpRequest.prototype) && (P.add(XMLHttpRequest.prototype), ke());
|
|
286
287
|
}
|
|
287
|
-
function
|
|
288
|
-
var
|
|
289
|
-
const
|
|
290
|
-
|
|
291
|
-
const
|
|
292
|
-
if (!
|
|
293
|
-
const i = (
|
|
288
|
+
function ye(t) {
|
|
289
|
+
var n;
|
|
290
|
+
const e = (n = t.fetch) == null ? void 0 : n.bind(t);
|
|
291
|
+
e && (t.fetch = async (o, r) => {
|
|
292
|
+
const a = typeof o == "object" && "url" in o ? o : null, s = mt(a ? a.url : String(o));
|
|
293
|
+
if (!s) return e(o, r);
|
|
294
|
+
const i = (r == null ? void 0 : r.method) ?? (a == null ? void 0 : a.method) ?? "GET", f = xt(s, i), u = wt(s, i), p = (r == null ? void 0 : r.signal) ?? (a == null ? void 0 : a.signal);
|
|
294
295
|
try {
|
|
295
|
-
if (
|
|
296
|
-
if ((
|
|
297
|
-
throw
|
|
298
|
-
if ((
|
|
299
|
-
return
|
|
300
|
-
status:
|
|
301
|
-
headers: { "Content-Type":
|
|
296
|
+
if (u != null && u.delay && await we(u.delay, p), p != null && p.aborted) throw V(p);
|
|
297
|
+
if ((u == null ? void 0 : u.kind) === "network")
|
|
298
|
+
throw f("network", !0), new TypeError("Failed to fetch");
|
|
299
|
+
if ((u == null ? void 0 : u.kind) === "response")
|
|
300
|
+
return f(u.status, !0), new Response(yt.has(u.status) ? null : u.body, {
|
|
301
|
+
status: u.status,
|
|
302
|
+
headers: { "Content-Type": u.contentType }
|
|
302
303
|
});
|
|
303
|
-
const
|
|
304
|
-
return
|
|
305
|
-
} catch (
|
|
306
|
-
throw
|
|
304
|
+
const m = await e(o, r);
|
|
305
|
+
return f(m.status, !1), m;
|
|
306
|
+
} catch (m) {
|
|
307
|
+
throw f(p != null && p.aborted ? "abort" : "network", !1), m;
|
|
307
308
|
}
|
|
308
309
|
});
|
|
309
310
|
}
|
|
310
|
-
const
|
|
311
|
-
function
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
n.call(this, o);
|
|
311
|
+
const st = /* @__PURE__ */ new WeakMap(), it = /* @__PURE__ */ new WeakMap(), H = /* @__PURE__ */ new WeakMap(), $e = ["readyState", "responseURL", "status", "statusText", "responseText", "response", "getAllResponseHeaders", "getResponseHeader"];
|
|
312
|
+
function ke() {
|
|
313
|
+
const t = XMLHttpRequest.prototype, e = t.open, n = t.send, o = t.abort;
|
|
314
|
+
t.open = function(a, s, ...i) {
|
|
315
|
+
lt(this), $e.forEach((f) => {
|
|
316
|
+
Reflect.deleteProperty(this, f);
|
|
317
|
+
}), st.set(this, { method: a, url: String(s) }), e.call(this, a, s, ...i);
|
|
318
|
+
}, t.send = function(a) {
|
|
319
|
+
const s = st.get(this), i = s ? mt(s.url) : null;
|
|
320
|
+
if (!s || !i) {
|
|
321
|
+
n.call(this, a);
|
|
322
322
|
return;
|
|
323
323
|
}
|
|
324
|
-
const
|
|
325
|
-
|
|
326
|
-
const
|
|
327
|
-
this.addEventListener("abort", () =>
|
|
324
|
+
const f = xt(i, s.method);
|
|
325
|
+
it.set(this, f);
|
|
326
|
+
const u = wt(i, s.method), p = () => {
|
|
327
|
+
this.addEventListener("abort", () => f("abort", !1), { once: !0 }), this.addEventListener("loadend", () => f(this.status || "network", !1), { once: !0 }), n.call(this, a);
|
|
328
328
|
};
|
|
329
|
-
if (!
|
|
329
|
+
if (!u) {
|
|
330
330
|
p();
|
|
331
331
|
return;
|
|
332
332
|
}
|
|
333
|
-
|
|
334
|
-
if (
|
|
333
|
+
H.set(this, setTimeout(() => {
|
|
334
|
+
if (H.delete(this), u.kind === "pass") {
|
|
335
335
|
p();
|
|
336
336
|
return;
|
|
337
337
|
}
|
|
338
|
-
|
|
339
|
-
},
|
|
338
|
+
f(u.kind === "network" ? "network" : u.status, !0), Se(this, u, s.url);
|
|
339
|
+
}, u.delay));
|
|
340
340
|
}, t.abort = function() {
|
|
341
|
-
var
|
|
342
|
-
if (!
|
|
343
|
-
|
|
341
|
+
var s;
|
|
342
|
+
if (!lt(this)) {
|
|
343
|
+
o.call(this);
|
|
344
344
|
return;
|
|
345
345
|
}
|
|
346
|
-
(
|
|
347
|
-
const
|
|
348
|
-
|
|
346
|
+
(s = it.get(this)) == null || s("abort", !1);
|
|
347
|
+
const a = $t(this);
|
|
348
|
+
a("readyState", 4), a("status", 0), G(this, ["readystatechange", "abort", "loadend"]), a("readyState", 0);
|
|
349
349
|
};
|
|
350
350
|
}
|
|
351
|
-
function
|
|
352
|
-
const e =
|
|
353
|
-
return e === void 0 ? !1 : (clearTimeout(e),
|
|
351
|
+
function lt(t) {
|
|
352
|
+
const e = H.get(t);
|
|
353
|
+
return e === void 0 ? !1 : (clearTimeout(e), H.delete(t), !0);
|
|
354
354
|
}
|
|
355
|
-
const
|
|
355
|
+
const $t = (t) => (e, n) => {
|
|
356
356
|
Object.defineProperty(t, e, { configurable: !0, get: () => n });
|
|
357
|
-
},
|
|
357
|
+
}, G = (t, e) => {
|
|
358
358
|
e.forEach((n) => t.dispatchEvent(new ProgressEvent(n)));
|
|
359
359
|
};
|
|
360
|
-
function
|
|
361
|
-
const
|
|
362
|
-
if (
|
|
363
|
-
|
|
360
|
+
function Se(t, e, n) {
|
|
361
|
+
const o = $t(t);
|
|
362
|
+
if (o("readyState", 4), o("responseURL", n), e.kind === "network") {
|
|
363
|
+
o("status", 0), o("statusText", ""), G(t, ["readystatechange", "error", "loadend"]);
|
|
364
364
|
return;
|
|
365
365
|
}
|
|
366
|
-
const r =
|
|
367
|
-
let
|
|
366
|
+
const r = yt.has(e.status) ? "" : e.body;
|
|
367
|
+
let a = r;
|
|
368
368
|
if (t.responseType === "json")
|
|
369
369
|
try {
|
|
370
|
-
|
|
370
|
+
a = e.contentType === "application/json" && r ? JSON.parse(r) : null;
|
|
371
371
|
} catch {
|
|
372
|
-
|
|
372
|
+
a = null;
|
|
373
373
|
}
|
|
374
|
-
|
|
375
|
-
const
|
|
374
|
+
o("status", e.status), o("statusText", String(e.status)), o("responseText", r), o("response", a);
|
|
375
|
+
const s = `content-type: ${e.contentType}\r
|
|
376
376
|
`;
|
|
377
|
-
Object.defineProperty(t, "getAllResponseHeaders", { configurable: !0, value: () =>
|
|
377
|
+
Object.defineProperty(t, "getAllResponseHeaders", { configurable: !0, value: () => s }), Object.defineProperty(t, "getResponseHeader", {
|
|
378
378
|
configurable: !0,
|
|
379
|
-
value: (
|
|
380
|
-
}),
|
|
379
|
+
value: (i) => i.toLowerCase() === "content-type" ? e.contentType : null
|
|
380
|
+
}), G(t, ["readystatechange", "load", "loadend"]);
|
|
381
381
|
}
|
|
382
|
-
function
|
|
382
|
+
function nt(t) {
|
|
383
383
|
try {
|
|
384
384
|
t ? Reflect.deleteProperty(navigator, "onLine") : Object.defineProperty(navigator, "onLine", { configurable: !0, get: () => !1 }), window.dispatchEvent(new Event(t ? "online" : "offline"));
|
|
385
385
|
} catch {
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
|
-
function
|
|
388
|
+
function kt() {
|
|
389
389
|
const t = v().some((e) => e.state.faults.includes("offline"));
|
|
390
|
-
|
|
390
|
+
ne(), dt(), gt(), t && nt(!0);
|
|
391
391
|
}
|
|
392
|
-
const
|
|
392
|
+
const Ee = {
|
|
393
393
|
title: "Сеть",
|
|
394
394
|
items: [
|
|
395
395
|
{ id: "offline", label: "Офлайн браузера", hint: "Полоса «Нет связи», запросы к API падают" },
|
|
396
396
|
{ id: "network", label: "Обрыв соединения", hint: "Сеть есть, а сервер не отвечает" },
|
|
397
|
-
{ id: "slow", label: "Медленные ответы", hint: `Задержка ${
|
|
397
|
+
{ id: "slow", label: "Медленные ответы", hint: `Задержка ${vt / 1e3} с на запросы к API` }
|
|
398
398
|
]
|
|
399
|
-
},
|
|
399
|
+
}, Le = {
|
|
400
400
|
authFail: { label: "Сбой входа", hint: "После перезагрузки сервис рисует заглушку входа" },
|
|
401
401
|
crashApp: { label: "Падение приложения", hint: "Ошибка рендера над каркасом сервиса" },
|
|
402
402
|
crashPage: { label: "Падение страницы", hint: "Каждая открытая страница падает, пока флаг включён" }
|
|
403
|
-
},
|
|
403
|
+
}, Y = [["", "Любой"], ["GET", "GET"], ["write", "Запись"], ["POST", "POST"], ["PUT", "PUT"], ["PATCH", "PATCH"], ["DELETE", "DELETE"]], Te = [400, 401, 403, 404, 409, 422, 429, 500, 502, 503, 504], d = (t) => String(t ?? "").replace(/[&<>"']/g, (e) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" })[e]), Ae = '<svg viewBox="0 0 36 36" fill="none" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M28 0L20 16H36L28 0ZM28 5.11101L23.6984 13.7143H32.3016L28 5.11101Z" fill="#3BA68C"/><path fill-rule="evenodd" clip-rule="evenodd" d="M9 33.7143C12.1559 33.7143 14.7143 31.1559 14.7143 28C14.7143 24.8441 12.1559 22.2857 9 22.2857C5.84409 22.2857 3.28571 24.8441 3.28571 28C3.28571 31.1559 5.84409 33.7143 9 33.7143ZM9 36C13.4183 36 17 32.4183 17 28C17 23.5817 13.4183 20 9 20C4.58172 20 1 23.5817 1 28C1 32.4183 4.58172 36 9 36Z" fill="#E54B6A"/><path fill-rule="evenodd" clip-rule="evenodd" d="M33.7143 22.2857H22.2857V33.7143H33.7143V22.2857ZM20 20V36H36V20H20Z" fill="#1E4391"/><path fill-rule="evenodd" clip-rule="evenodd" d="M12.0593 4.9091L9 0L5.94073 4.9091L0 6.11146L4.05 10.3478L3.43769 16L9 13.7091L14.5623 16L13.95 10.3478L18 6.11146L12.0593 4.9091ZM14.0262 7.31822L10.7085 6.64674L9 3.90515L7.29149 6.64674L3.97378 7.31822L6.23558 9.68408L5.89362 12.8407L9 11.5613L12.1064 12.8407L11.7644 9.68408L14.0262 7.31822Z" fill="#E98446"/></svg>', Ce = `
|
|
404
404
|
:host { all: initial; }
|
|
405
405
|
* { box-sizing: border-box; }
|
|
406
406
|
.root { --p: #1e4391; --p-soft: #e8eef9; --fg: #222; --muted: #6b7280; --line: #d9dee8; --bg: #fff; --soft: #f5f7fb;
|
|
@@ -491,289 +491,289 @@ dd { margin: 0; font-family: Consolas, monospace; font-size: 12px; overflow-wrap
|
|
|
491
491
|
.panel ~ .pill { display: none; }
|
|
492
492
|
}
|
|
493
493
|
@media (prefers-reduced-motion: reduce) { .switch::after, .pill .label { transition: none; } }
|
|
494
|
-
`,
|
|
495
|
-
let
|
|
496
|
-
const
|
|
494
|
+
`, Me = 6e3;
|
|
495
|
+
let Q, h = null, c = null, k = null, $ = null, T = !1, S = !1;
|
|
496
|
+
const St = { open: !1, tab: "faults", search: "", service: void 0, hint: "" }, l = { ...St };
|
|
497
497
|
function D() {
|
|
498
498
|
const t = v();
|
|
499
|
-
return t.find((e) => e.config.service ===
|
|
499
|
+
return t.find((e) => e.config.service === l.service) ?? t[0];
|
|
500
500
|
}
|
|
501
|
-
function
|
|
502
|
-
const e = (t.config.builtins ?? []).map((n) => ({ id: n,
|
|
501
|
+
function Et(t) {
|
|
502
|
+
const e = (t.config.builtins ?? []).map((n) => ({ id: n, ...Le[n] }));
|
|
503
503
|
return [
|
|
504
504
|
...e.length ? [{ title: "Весь сервис", items: e }] : [],
|
|
505
|
-
|
|
505
|
+
Ee,
|
|
506
506
|
...t.config.groups ?? []
|
|
507
507
|
];
|
|
508
508
|
}
|
|
509
|
-
function
|
|
509
|
+
function De(t, e) {
|
|
510
510
|
var n;
|
|
511
|
-
return ((n =
|
|
511
|
+
return ((n = Et(t).flatMap((o) => o.items).find((o) => o.id === e)) == null ? void 0 : n.label) ?? e;
|
|
512
512
|
}
|
|
513
|
-
function
|
|
513
|
+
function Lt(t) {
|
|
514
514
|
return [
|
|
515
|
-
...t.state.faults.map((e) =>
|
|
515
|
+
...t.state.faults.map((e) => De(t, e)),
|
|
516
516
|
...t.state.rules.filter((e) => e.enabled).map((e) => `${e.path} → ${e.status}`)
|
|
517
517
|
];
|
|
518
518
|
}
|
|
519
|
-
function
|
|
520
|
-
const r = t % 100,
|
|
521
|
-
return r >= 11 && r <= 14 ?
|
|
522
|
-
}
|
|
523
|
-
const
|
|
524
|
-
function
|
|
525
|
-
const e = new Set(t.state.faults), n =
|
|
526
|
-
const
|
|
527
|
-
return
|
|
528
|
-
<label class="row"><span class="text">${d(
|
|
529
|
-
<input class="switch" type="checkbox" role="switch" data-fault="${d(
|
|
530
|
-
aria-label="${d(
|
|
531
|
-
}).join(""),
|
|
532
|
-
var
|
|
533
|
-
return ((
|
|
519
|
+
function Pe(t, e, n, o) {
|
|
520
|
+
const r = t % 100, a = t % 10;
|
|
521
|
+
return r >= 11 && r <= 14 ? o : a === 1 ? e : a >= 2 && a <= 4 ? n : o;
|
|
522
|
+
}
|
|
523
|
+
const ct = (t) => !l.search || t.toLowerCase().includes(l.search.toLowerCase());
|
|
524
|
+
function Re(t) {
|
|
525
|
+
const e = new Set(t.state.faults), n = Et(t).map((a) => {
|
|
526
|
+
const s = a.items.filter((i) => ct(`${i.label} ${i.hint ?? ""} ${i.id}`));
|
|
527
|
+
return s.length ? `<div><div class="group-title">${d(a.title)}</div>${s.map((i) => `
|
|
528
|
+
<label class="row"><span class="text">${d(i.label)}${i.hint ? `<small>${d(i.hint)}</small>` : ""}</span>
|
|
529
|
+
<input class="switch" type="checkbox" role="switch" data-fault="${d(i.id)}" ${e.has(i.id) ? "checked" : ""}
|
|
530
|
+
aria-label="${d(i.label)}"></label>`).join("")}</div>` : "";
|
|
531
|
+
}).join(""), o = t.state.rules.filter((a) => ct(`${a.method ?? ""} ${a.path} ${a.status}`)), r = (a) => {
|
|
532
|
+
var s;
|
|
533
|
+
return ((s = Y.find(([i]) => i === (a ?? ""))) == null ? void 0 : s[1]) ?? a;
|
|
534
534
|
};
|
|
535
535
|
return `
|
|
536
|
-
<input class="search" type="search" data-search placeholder="Поиск: 503, офлайн, роли…" aria-label="Поиск по сценариям" value="${d(
|
|
537
|
-
${n || (
|
|
536
|
+
<input class="search" type="search" data-search placeholder="Поиск: 503, офлайн, роли…" aria-label="Поиск по сценариям" value="${d(l.search)}">
|
|
537
|
+
${n || (o.length ? "" : '<div class="empty">Ничего не найдено.</div>')}
|
|
538
538
|
<div><div class="group-title">Ответы сервера</div>
|
|
539
|
-
${
|
|
540
|
-
<input class="switch" type="checkbox" role="switch" data-rule="${d(
|
|
541
|
-
aria-label="${d(`${
|
|
542
|
-
<button class="remove" type="button" data-remove="${d(
|
|
539
|
+
${o.map((a) => `<div class="rule"><span class="text">${d(r(a.method))} ${d(a.path)} → ${a.status}</span>
|
|
540
|
+
<input class="switch" type="checkbox" role="switch" data-rule="${d(a.id)}" ${a.enabled ? "checked" : ""}
|
|
541
|
+
aria-label="${d(`${a.path} → ${a.status}`)}">
|
|
542
|
+
<button class="remove" type="button" data-remove="${d(a.id)}" aria-label="Удалить правило">×</button></div>`).join("")}
|
|
543
543
|
<form class="add" data-add>
|
|
544
|
-
<select name="method" aria-label="Метод">${
|
|
544
|
+
<select name="method" aria-label="Метод">${Y.map(([a, s]) => `<option value="${a}">${s}</option>`).join("")}</select>
|
|
545
545
|
<input name="path" required placeholder="/assets/*" aria-label="Путь после ${d(t.config.apiBase ?? "адреса сайта")}">
|
|
546
|
-
<select name="status" aria-label="Код ответа">${
|
|
546
|
+
<select name="status" aria-label="Код ответа">${Te.map((a) => `<option${a === 503 ? " selected" : ""}>${a}</option>`).join("")}</select>
|
|
547
547
|
<button class="btn primary" type="submit">Добавить</button>
|
|
548
548
|
</form>
|
|
549
549
|
</div>`;
|
|
550
550
|
}
|
|
551
|
-
function
|
|
551
|
+
function Oe() {
|
|
552
552
|
const t = document.documentElement.getAttribute("data-u-viewport");
|
|
553
553
|
return t || (window.matchMedia("(max-width: 576px)").matches ? "mobile" : window.matchMedia("(max-width: 900px)").matches ? "tablet" : "desktop");
|
|
554
554
|
}
|
|
555
|
-
function
|
|
556
|
-
var
|
|
557
|
-
const e = document.documentElement, n = getComputedStyle(e).getPropertyValue("--u-unit").trim(),
|
|
555
|
+
function Ie(t) {
|
|
556
|
+
var i, f, u;
|
|
557
|
+
const e = document.documentElement, n = getComputedStyle(e).getPropertyValue("--u-unit").trim(), o = t.kit ?? Xt();
|
|
558
558
|
let r = "—";
|
|
559
559
|
try {
|
|
560
|
-
const p = (
|
|
561
|
-
p && (r = [p.name, (
|
|
560
|
+
const p = (f = (i = t.config).user) == null ? void 0 : f.call(i);
|
|
561
|
+
p && (r = [p.name, (u = p.roles) != null && u.length ? p.roles.join(", ") : "без ролей"].filter(Boolean).join(" · "));
|
|
562
562
|
} catch {
|
|
563
563
|
r = "не удалось прочитать";
|
|
564
564
|
}
|
|
565
|
-
const
|
|
565
|
+
const a = Lt(t);
|
|
566
566
|
return `<dl>${[
|
|
567
|
-
["Ширина", `${window.innerWidth} px · ${
|
|
567
|
+
["Ширина", `${window.innerWidth} px · ${Oe()}`],
|
|
568
568
|
["Шкала", `${e.getAttribute("data-u-responsive") ?? "legacy"}${n ? ` · --u-unit ${n}` : ""}`],
|
|
569
|
-
["Кит",
|
|
569
|
+
["Кит", o ? `${o.name} ${o.version}` : "—"],
|
|
570
570
|
["Сервис", [t.config.service, t.config.version].filter(Boolean).join(" ")],
|
|
571
571
|
["API", t.config.apiBase ?? "все запросы"],
|
|
572
572
|
["Оболочка ЛК", window.__POWERED_BY_QIANKUN__ ? "да (Qiankun)" : "нет"],
|
|
573
573
|
["Ввод", e.getAttribute("data-input-mode") ?? "—"],
|
|
574
574
|
["Сеть", navigator.onLine ? "онлайн" : "офлайн"],
|
|
575
575
|
["Пользователь", r],
|
|
576
|
-
["Включено",
|
|
577
|
-
].map(([p,
|
|
576
|
+
["Включено", a.length ? a.join("; ") : "ничего"]
|
|
577
|
+
].map(([p, m]) => `<dt>${d(p)}</dt><dd>${d(m)}</dd>`).join("")}</dl>`;
|
|
578
578
|
}
|
|
579
579
|
function g() {
|
|
580
|
-
if (!
|
|
580
|
+
if (!c) return;
|
|
581
581
|
const t = D();
|
|
582
582
|
if (!t) {
|
|
583
|
-
|
|
583
|
+
c.innerHTML = "";
|
|
584
584
|
return;
|
|
585
585
|
}
|
|
586
|
-
const e = v().flatMap(
|
|
587
|
-
<section class="panel${
|
|
588
|
-
<div class="head"><span class="title">${
|
|
586
|
+
const e = v().flatMap(Lt), n = e.length, o = n ? `Dev · ${n === 1 ? e[0] : `${n} ${Pe(n, "сбой", "сбоя", "сбоев")}`}` : "Dev", r = v(), a = r.every((b) => oe(b) === "hidden"), s = !a || n > 0, i = r.length > 1 ? `<select data-service aria-label="Сервис">${r.map((b) => `<option value="${d(b.config.service)}"${b === t ? " selected" : ""}>Dev · ${d(b.config.service)}</option>`).join("")}</select>` : `Dev · ${d(t.config.service)}`, f = l.open ? `
|
|
587
|
+
<section class="panel${s ? "" : " alone"}" role="region" aria-label="Панель разработки">
|
|
588
|
+
<div class="head"><span class="title">${i}</span>
|
|
589
589
|
<button class="reset" type="button" data-reset>Сбросить всё</button>
|
|
590
590
|
<button class="close" type="button" data-close aria-label="Свернуть панель">×</button></div>
|
|
591
591
|
<div class="escape">Без панели: адрес с ?dev=off · открыть и закрыть: Ctrl+Alt+D</div>
|
|
592
592
|
<div class="tabs" role="tablist">
|
|
593
|
-
<button class="tab" type="button" role="tab" data-tab="faults" aria-selected="${
|
|
594
|
-
<button class="tab" type="button" role="tab" data-tab="requests" aria-selected="${
|
|
595
|
-
<button class="tab" type="button" role="tab" data-tab="errors" aria-selected="${
|
|
596
|
-
<button class="tab" type="button" role="tab" data-tab="view" aria-selected="${
|
|
593
|
+
<button class="tab" type="button" role="tab" data-tab="faults" aria-selected="${l.tab === "faults"}">Сбои${q(t) ? ` · ${q(t)}` : ""}</button>
|
|
594
|
+
<button class="tab" type="button" role="tab" data-tab="requests" aria-selected="${l.tab === "requests"}">Запросы</button>
|
|
595
|
+
<button class="tab" type="button" role="tab" data-tab="errors" aria-selected="${l.tab === "errors"}">Ошибки${Z().length ? ` · ${Z().length}` : ""}</button>
|
|
596
|
+
<button class="tab" type="button" role="tab" data-tab="view" aria-selected="${l.tab === "view"}">Смотреть</button>
|
|
597
597
|
</div>
|
|
598
|
-
<div class="body">${
|
|
599
|
-
${
|
|
598
|
+
<div class="body">${l.tab === "faults" ? Re(t) : l.tab === "requests" ? Ct(t) : l.tab === "errors" ? je() : Ie(t)}</div>
|
|
599
|
+
${l.hint ? `<div class="note" role="status">${d(l.hint)}</div>` : ""}
|
|
600
600
|
<div class="foot">
|
|
601
601
|
${t.config.onRefetch ? '<button class="btn" type="button" data-refetch>Перезапросить данные</button>' : ""}
|
|
602
602
|
<button class="btn" type="button" data-reload>Перезагрузить</button>
|
|
603
603
|
${r.some((b) => b.state.faults.length) ? '<button class="btn" type="button" data-share>Ссылка на сбои</button>' : ""}
|
|
604
|
-
<button class="btn" type="button" data-launcher="${
|
|
604
|
+
<button class="btn" type="button" data-launcher="${a ? "visible" : "hidden"}">${a ? "Показывать кнопку" : "Скрыть кнопку"}</button>
|
|
605
605
|
</div>
|
|
606
|
-
</section>` : "",
|
|
607
|
-
|
|
608
|
-
const
|
|
606
|
+
</section>` : "", u = c.activeElement, p = Tt(u), m = (u == null ? void 0 : u.dataset.search) !== void 0 ? u.selectionStart : null, Ot = tt ?? _e();
|
|
607
|
+
tt = null;
|
|
608
|
+
const It = [
|
|
609
609
|
e.length ? `Включено: ${e.join(", ")}` : "Панель разработки (Ctrl+Alt+D)",
|
|
610
|
-
|
|
611
|
-
].filter(Boolean).join(". "),
|
|
612
|
-
<button class="pill${n ? " on" : ""}" type="button" data-toggle aria-expanded="${
|
|
613
|
-
title="${d(
|
|
614
|
-
if (
|
|
615
|
-
const b =
|
|
616
|
-
b == null || b.focus(), b instanceof HTMLInputElement &&
|
|
610
|
+
a ? "Кнопка скрыта и видна, пока включены сбои" : ""
|
|
611
|
+
].filter(Boolean).join(". "), qt = s ? `
|
|
612
|
+
<button class="pill${n ? " on" : ""}" type="button" data-toggle aria-expanded="${l.open}"
|
|
613
|
+
title="${d(It)}"><span class="logo">${Ae}</span><span class="label">${d(o)}</span></button>` : "", zt = l.hint && !l.open ? `<div class="hint" role="status">${d(l.hint)}</div>` : "";
|
|
614
|
+
if (c.innerHTML = `<style>${Ce}</style><div class="root">${f}${qt}${zt}</div>`, We(Ot), p) {
|
|
615
|
+
const b = c.querySelector(p);
|
|
616
|
+
b == null || b.focus(), b instanceof HTMLInputElement && m !== null && b.setSelectionRange(m, m);
|
|
617
617
|
}
|
|
618
618
|
}
|
|
619
|
-
const
|
|
620
|
-
function
|
|
619
|
+
const qe = ["search", "fault", "rule", "tab", "service", "reset", "close", "toggle", "ruleFrom", "clearJournal"];
|
|
620
|
+
function Tt(t) {
|
|
621
621
|
if (!t) return null;
|
|
622
622
|
const e = t.getAttribute("name");
|
|
623
623
|
if (e && t.closest("[data-add]")) return `[data-add] [name="${e}"]`;
|
|
624
|
-
const n =
|
|
624
|
+
const n = qe.find((a) => t.dataset[a] !== void 0);
|
|
625
625
|
if (!n) return null;
|
|
626
|
-
const
|
|
627
|
-
return
|
|
628
|
-
}
|
|
629
|
-
const
|
|
630
|
-
let
|
|
631
|
-
const
|
|
632
|
-
function
|
|
633
|
-
const e =
|
|
626
|
+
const o = t.dataset[n], r = `data-${n.replace(/[A-Z]/g, (a) => `-${a.toLowerCase()}`)}`;
|
|
627
|
+
return o ? `[${r}="${o.replace(/["\\]/g, "\\$&")}"]` : `[${r}]`;
|
|
628
|
+
}
|
|
629
|
+
const At = ["method", "path", "status"];
|
|
630
|
+
let tt = null;
|
|
631
|
+
const ze = { network: "сеть", abort: "отмена", pending: "…" };
|
|
632
|
+
function Ct(t) {
|
|
633
|
+
const e = et().filter((n) => n.service === t.config.service);
|
|
634
634
|
return e.length ? `<div class="requests-head"><span>Последние ${e.length}, новые сверху</span>
|
|
635
635
|
<button class="btn" type="button" data-clear-journal>Очистить</button></div>
|
|
636
636
|
<div class="requests">${e.map((n) => {
|
|
637
|
-
const
|
|
637
|
+
const o = typeof n.status == "number" ? String(n.status) : ze[n.status], r = n.status === "network" || typeof n.status == "number" && n.status >= 400, a = [n.duration === null ? "" : `${n.duration} мс`, n.faked ? "подменён панелью" : ""].filter(Boolean).join(" · ");
|
|
638
638
|
return `<div class="req"><span>${d(n.method)}</span>
|
|
639
|
-
<span class="path">${d(n.path)}${
|
|
640
|
-
<span class="status${r ? " bad" : ""}">${d(
|
|
639
|
+
<span class="path">${d(n.path)}${a ? `<small>${d(a)}</small>` : ""}</span>
|
|
640
|
+
<span class="status${r ? " bad" : ""}">${d(o)}</span>
|
|
641
641
|
<button class="btn" type="button" data-rule-from="${n.id}" title="Ответ на этот адрес — в «Ответах сервера»">Правило</button></div>`;
|
|
642
642
|
}).join("")}</div>` : '<div class="empty">Запросов к API пока не было. Журнал помнит последние 50 и очищается при перезагрузке.</div>';
|
|
643
643
|
}
|
|
644
|
-
const
|
|
644
|
+
const Fe = {
|
|
645
645
|
screen: "Заглушка",
|
|
646
646
|
fail: "Уведомление об ошибке",
|
|
647
647
|
warning: "Предупреждение",
|
|
648
648
|
offline: "Нет связи"
|
|
649
|
-
},
|
|
650
|
-
function
|
|
651
|
-
const t =
|
|
649
|
+
}, He = (t) => Fe[t.kind === "notification" ? t.variant ?? "fail" : t.kind];
|
|
650
|
+
function je() {
|
|
651
|
+
const t = Z();
|
|
652
652
|
return t.length ? `<div class="requests-head"><span>Последние ${t.length}, новые сверху</span>
|
|
653
653
|
<button class="btn" type="button" data-clear-shown>Очистить</button></div>
|
|
654
654
|
<div>${t.map((e) => `<div class="shown">
|
|
655
|
-
<div class="shown-head"><span class="kind${e.variant === "warning" ? " warning" : ""}">${d(
|
|
655
|
+
<div class="shown-head"><span class="kind${e.variant === "warning" ? " warning" : ""}">${d(He(e))}${e.code ? ` · ${d(e.code)}` : ""}</span>
|
|
656
656
|
<time>${d(new Date(e.at).toLocaleTimeString("ru-RU"))}</time></div>
|
|
657
657
|
<div class="shown-title">${d(e.title)}</div>
|
|
658
658
|
${e.text ? `<small>${d(e.text)}</small>` : ""}
|
|
659
659
|
<div class="cause">${e.cause ? `← ${d(e.cause)}` : "<small>Неудачных запросов к API перед показом не было</small>"}</div>
|
|
660
660
|
</div>`).join("")}</div>` : '<div class="empty">Ошибок пользователю пока не показывали. Здесь появятся заглушки, уведомления об ошибке и полоса «Нет связи» — с причиной из запросов к API.</div>';
|
|
661
661
|
}
|
|
662
|
-
function
|
|
663
|
-
var
|
|
664
|
-
const e =
|
|
662
|
+
function Ue(t) {
|
|
663
|
+
var o;
|
|
664
|
+
const e = et().find((r) => String(r.id) === String(t));
|
|
665
665
|
if (!e) return;
|
|
666
|
-
|
|
666
|
+
tt = { method: Y.some(([r]) => r === e.method) ? e.method : "", path: e.path, status: "503" }, l.tab = "faults", l.search = "", g(), (o = c == null ? void 0 : c.querySelector('[data-add] [name="status"]')) == null || o.focus();
|
|
667
667
|
}
|
|
668
|
-
function
|
|
669
|
-
const t = [...new Set(v().flatMap((
|
|
668
|
+
function Ne() {
|
|
669
|
+
const t = [...new Set(v().flatMap((i) => i.state.faults))], e = new URL(window.location.href);
|
|
670
670
|
e.searchParams.set("dev", t.join(","));
|
|
671
|
-
const n = e.href.replace(/%2C/gi, ","), r = v().some((
|
|
671
|
+
const n = e.href.replace(/%2C/gi, ","), r = v().some((i) => i.state.rules.some((f) => f.enabled)) ? " Свои правила «адрес → код» в неё не входят." : "", a = () => {
|
|
672
672
|
A(`Ссылка скопирована.${r}`), g();
|
|
673
|
-
},
|
|
673
|
+
}, s = () => {
|
|
674
674
|
A(`Ссылка: ${n}${r}`), g();
|
|
675
675
|
};
|
|
676
676
|
try {
|
|
677
|
-
navigator.clipboard.writeText(n).then(
|
|
677
|
+
navigator.clipboard.writeText(n).then(a, s);
|
|
678
678
|
} catch {
|
|
679
|
-
|
|
679
|
+
s();
|
|
680
680
|
}
|
|
681
681
|
}
|
|
682
|
-
function
|
|
683
|
-
const t =
|
|
684
|
-
return t ? Object.fromEntries(
|
|
682
|
+
function _e() {
|
|
683
|
+
const t = c == null ? void 0 : c.querySelector("[data-add]");
|
|
684
|
+
return t ? Object.fromEntries(At.map((e) => {
|
|
685
685
|
var n;
|
|
686
686
|
return [e, ((n = t.elements.namedItem(e)) == null ? void 0 : n.value) ?? ""];
|
|
687
687
|
})) : null;
|
|
688
688
|
}
|
|
689
|
-
function
|
|
690
|
-
const e =
|
|
691
|
-
!e || !t ||
|
|
692
|
-
const
|
|
693
|
-
|
|
689
|
+
function We(t) {
|
|
690
|
+
const e = c == null ? void 0 : c.querySelector("[data-add]");
|
|
691
|
+
!e || !t || At.forEach((n) => {
|
|
692
|
+
const o = e.elements.namedItem(n);
|
|
693
|
+
o && (o.value = t[n]);
|
|
694
694
|
});
|
|
695
695
|
}
|
|
696
|
-
function
|
|
696
|
+
function Be(t) {
|
|
697
697
|
if (!t) {
|
|
698
|
-
A(""),
|
|
698
|
+
A(""), ot("visible");
|
|
699
699
|
return;
|
|
700
700
|
}
|
|
701
|
-
|
|
702
|
-
const e = v().some((n) =>
|
|
703
|
-
A(`Кнопка Dev скрыта${e ? " и видна, пока включены сбои" : ""}. Панель: Ctrl+Alt+D`),
|
|
701
|
+
l.open = !1;
|
|
702
|
+
const e = v().some((n) => q(n) > 0);
|
|
703
|
+
A(`Кнопка Dev скрыта${e ? " и видна, пока включены сбои" : ""}. Панель: Ctrl+Alt+D`), ot("hidden");
|
|
704
704
|
}
|
|
705
705
|
function A(t) {
|
|
706
|
-
clearTimeout(
|
|
707
|
-
|
|
708
|
-
},
|
|
706
|
+
clearTimeout(Q), l.hint = t, t && (Q = setTimeout(() => {
|
|
707
|
+
l.hint = "", g();
|
|
708
|
+
}, Me));
|
|
709
709
|
}
|
|
710
|
-
function j(t = !
|
|
710
|
+
function j(t = !l.open) {
|
|
711
711
|
var e, n;
|
|
712
|
-
t && A(""),
|
|
712
|
+
t && A(""), l.open = t, g(), t ? (e = c == null ? void 0 : c.querySelector("[data-search], [data-tab]")) == null || e.focus() : (n = c == null ? void 0 : c.querySelector("[data-toggle]")) == null || n.focus();
|
|
713
713
|
}
|
|
714
|
-
function
|
|
715
|
-
var
|
|
714
|
+
function Ke(t) {
|
|
715
|
+
var o, r, a, s;
|
|
716
716
|
const e = t.target, n = D();
|
|
717
717
|
if (n)
|
|
718
718
|
if (e.closest("[data-toggle]")) j();
|
|
719
719
|
else if (e.closest("[data-close]")) j(!1);
|
|
720
720
|
else if (e.closest("[data-reset]"))
|
|
721
|
-
|
|
721
|
+
kt(), (r = (o = n.config).onRefetch) == null || r.call(o);
|
|
722
722
|
else if (e.closest("[data-reload]")) window.location.reload();
|
|
723
|
-
else if (e.closest("[data-rule-from]"))
|
|
723
|
+
else if (e.closest("[data-rule-from]")) Ue(Number(e.closest("[data-rule-from]").dataset.ruleFrom));
|
|
724
724
|
else if (e.closest("[data-clear-journal]"))
|
|
725
|
-
|
|
726
|
-
else if (e.closest("[data-clear-shown]"))
|
|
727
|
-
else if (e.closest("[data-share]"))
|
|
728
|
-
else if (e.closest("[data-launcher]"))
|
|
729
|
-
else if (e.closest("[data-refetch]")) (
|
|
725
|
+
dt(), g();
|
|
726
|
+
else if (e.closest("[data-clear-shown]")) gt();
|
|
727
|
+
else if (e.closest("[data-share]")) Ne();
|
|
728
|
+
else if (e.closest("[data-launcher]")) Be(e.closest("[data-launcher]").dataset.launcher === "hidden");
|
|
729
|
+
else if (e.closest("[data-refetch]")) (s = (a = n.config).onRefetch) == null || s.call(a);
|
|
730
730
|
else if (e.closest("[data-tab]")) {
|
|
731
|
-
const
|
|
732
|
-
|
|
733
|
-
} else e.closest("[data-remove]") &&
|
|
731
|
+
const i = e.closest("[data-tab]").dataset.tab;
|
|
732
|
+
l.tab = i === "view" || i === "requests" || i === "errors" ? i : "faults", g();
|
|
733
|
+
} else e.closest("[data-remove]") && ee(n, e.closest("[data-remove]").dataset.remove);
|
|
734
734
|
}
|
|
735
|
-
function
|
|
735
|
+
function Je(t) {
|
|
736
736
|
const e = t.target, n = D();
|
|
737
737
|
if (n)
|
|
738
738
|
if (e.dataset.fault) {
|
|
739
|
-
const
|
|
740
|
-
|
|
741
|
-
} else e.dataset.rule ?
|
|
739
|
+
const o = e.checked;
|
|
740
|
+
Yt(n, e.dataset.fault, o), e.dataset.fault === "offline" && nt(!o);
|
|
741
|
+
} else e.dataset.rule ? te(n, e.dataset.rule, e.checked) : e.dataset.service !== void 0 && (l.service = e.value, g());
|
|
742
742
|
}
|
|
743
|
-
function
|
|
743
|
+
function Xe(t) {
|
|
744
744
|
const e = t.target;
|
|
745
|
-
e.dataset.search !== void 0 && (
|
|
745
|
+
e.dataset.search !== void 0 && (l.search = e.value, g());
|
|
746
746
|
}
|
|
747
|
-
function
|
|
747
|
+
function Ze(t) {
|
|
748
748
|
const e = t.target;
|
|
749
749
|
if (e.dataset.add === void 0) return;
|
|
750
750
|
t.preventDefault();
|
|
751
|
-
const n = D(),
|
|
752
|
-
!n || !r || (e.reset(),
|
|
753
|
-
method: String(
|
|
751
|
+
const n = D(), o = new FormData(e), r = String(o.get("path") ?? "").trim();
|
|
752
|
+
!n || !r || (e.reset(), Qt(n, {
|
|
753
|
+
method: String(o.get("method") ?? "") || void 0,
|
|
754
754
|
path: r.startsWith("/") ? r : `/${r}`,
|
|
755
|
-
status: Number(
|
|
756
|
-
html: Number(
|
|
755
|
+
status: Number(o.get("status")) || 500,
|
|
756
|
+
html: Number(o.get("status")) === 502 || void 0
|
|
757
757
|
}));
|
|
758
758
|
}
|
|
759
|
-
function
|
|
760
|
-
t.ctrlKey && t.altKey && t.code === "KeyD" ? (t.preventDefault(), j()) : t.key === "Escape" &&
|
|
759
|
+
function Mt(t) {
|
|
760
|
+
t.ctrlKey && t.altKey && t.code === "KeyD" ? (t.preventDefault(), j()) : t.key === "Escape" && l.open && h && t.composedPath().includes(h) && (t.preventDefault(), t.stopPropagation(), j(!1));
|
|
761
761
|
}
|
|
762
|
-
function
|
|
762
|
+
function Ve() {
|
|
763
763
|
if (h || typeof document > "u") return;
|
|
764
|
-
h = document.createElement("div"), h.id = "urfu-ui-kit-dev", h.setAttribute("data-urfu-ui-kit-dev", ""),
|
|
765
|
-
(!(h != null && h.isConnected) ||
|
|
766
|
-
}),
|
|
767
|
-
const t =
|
|
768
|
-
|
|
769
|
-
const n =
|
|
770
|
-
|
|
764
|
+
h = document.createElement("div"), h.id = "urfu-ui-kit-dev", h.setAttribute("data-urfu-ui-kit-dev", ""), c = h.attachShadow({ mode: "open" }), c.addEventListener("click", Ke), c.addEventListener("change", Je), c.addEventListener("input", Xe), c.addEventListener("submit", Ze), window.addEventListener("keydown", Mt, !0), ut(), $ = new MutationObserver((o) => {
|
|
765
|
+
(!(h != null && h.isConnected) || o.some((r) => r.type === "attributes")) && ut();
|
|
766
|
+
}), $.observe(document.documentElement, { childList: !0, subtree: !0, attributes: !0, attributeFilter: ["open"] }), l.open = v().some((o) => q(o) > 0);
|
|
767
|
+
const t = bt(g), e = Ut(Dt);
|
|
768
|
+
c.addEventListener("pointerdown", Ye), window.addEventListener("pointerup", U, !0), window.addEventListener("pointercancel", U, !0);
|
|
769
|
+
const n = fe(() => {
|
|
770
|
+
l.open && g();
|
|
771
771
|
});
|
|
772
|
-
|
|
773
|
-
t(), e(), n(),
|
|
772
|
+
ue(), k = () => {
|
|
773
|
+
t(), e(), n(), de();
|
|
774
774
|
}, g();
|
|
775
775
|
}
|
|
776
|
-
function
|
|
776
|
+
function Ge() {
|
|
777
777
|
try {
|
|
778
778
|
const t = document.querySelectorAll("dialog:modal");
|
|
779
779
|
return t[t.length - 1] ?? null;
|
|
@@ -781,14 +781,14 @@ function Je() {
|
|
|
781
781
|
return null;
|
|
782
782
|
}
|
|
783
783
|
}
|
|
784
|
-
function
|
|
784
|
+
function ut() {
|
|
785
785
|
if (!h) return;
|
|
786
|
-
const t =
|
|
786
|
+
const t = Ge() ?? document.documentElement;
|
|
787
787
|
h.parentNode !== t && t.appendChild(h);
|
|
788
788
|
}
|
|
789
|
-
function
|
|
789
|
+
function Dt() {
|
|
790
790
|
var r;
|
|
791
|
-
if (!
|
|
791
|
+
if (!l.open || l.tab !== "requests") {
|
|
792
792
|
S = !1;
|
|
793
793
|
return;
|
|
794
794
|
}
|
|
@@ -797,56 +797,78 @@ function Ct() {
|
|
|
797
797
|
return;
|
|
798
798
|
}
|
|
799
799
|
S = !1;
|
|
800
|
-
const t =
|
|
801
|
-
if (!
|
|
800
|
+
const t = c == null ? void 0 : c.querySelector(".body"), e = D();
|
|
801
|
+
if (!c || !t || !e) {
|
|
802
802
|
g();
|
|
803
803
|
return;
|
|
804
804
|
}
|
|
805
|
-
const n =
|
|
806
|
-
t.innerHTML =
|
|
805
|
+
const n = c.activeElement, o = n && t.contains(n) ? Tt(n) : null;
|
|
806
|
+
t.innerHTML = Ct(e), o && ((r = t.querySelector(o)) == null || r.focus());
|
|
807
807
|
}
|
|
808
|
-
function
|
|
808
|
+
function Ye() {
|
|
809
809
|
T = !0;
|
|
810
810
|
}
|
|
811
811
|
function U() {
|
|
812
|
-
T && (T = !1, S && setTimeout(
|
|
812
|
+
T && (T = !1, S && setTimeout(Dt, 0));
|
|
813
|
+
}
|
|
814
|
+
function Qe() {
|
|
815
|
+
k == null || k(), k = null, $ == null || $.disconnect(), $ = null, window.removeEventListener("keydown", Mt, !0), window.removeEventListener("pointerup", U, !0), window.removeEventListener("pointercancel", U, !0), T = !1, S = !1, clearTimeout(Q), h == null || h.remove(), h = null, c = null, Object.assign(l, St);
|
|
816
|
+
}
|
|
817
|
+
const Pt = Symbol.for("urfu-ui-kit.dev-panel"), C = {
|
|
818
|
+
version: 1,
|
|
819
|
+
mount(t, e, n) {
|
|
820
|
+
return _t(), Jt(e), Zt(t, e).state.faults.includes("offline") && nt(!1), xe(n), Ve(), () => {
|
|
821
|
+
Vt(t.service), v().length || Qe();
|
|
822
|
+
};
|
|
823
|
+
},
|
|
824
|
+
isFault: (t, e) => {
|
|
825
|
+
var n;
|
|
826
|
+
return ((n = Gt(e)) == null ? void 0 : n.state.faults.includes(t)) ?? !1;
|
|
827
|
+
},
|
|
828
|
+
subscribe: bt,
|
|
829
|
+
reset: kt
|
|
830
|
+
}, Rt = () => typeof document > "u" ? null : document.defaultView;
|
|
831
|
+
function W() {
|
|
832
|
+
var e;
|
|
833
|
+
const t = (e = Rt()) == null ? void 0 : e[Pt];
|
|
834
|
+
return t && typeof t.version == "number" && t.version >= 1 ? t : null;
|
|
813
835
|
}
|
|
814
|
-
function
|
|
815
|
-
|
|
836
|
+
function tn() {
|
|
837
|
+
const t = W();
|
|
838
|
+
if (t) return t;
|
|
839
|
+
const e = Rt();
|
|
840
|
+
return e && (e[Pt] = C), C;
|
|
816
841
|
}
|
|
817
|
-
function
|
|
842
|
+
function en(t, e) {
|
|
818
843
|
return typeof window > "u" ? () => {
|
|
819
|
-
} : (
|
|
820
|
-
Kt(t.service), v().length || Xe();
|
|
821
|
-
});
|
|
844
|
+
} : tn().mount(t, e, window);
|
|
822
845
|
}
|
|
823
|
-
function
|
|
824
|
-
|
|
825
|
-
return ((n = Jt(e)) == null ? void 0 : n.state.faults.includes(t)) ?? !1;
|
|
846
|
+
function nn(t, e) {
|
|
847
|
+
return (W() ?? C).isFault(t, e);
|
|
826
848
|
}
|
|
827
|
-
function
|
|
828
|
-
return
|
|
849
|
+
function on(t) {
|
|
850
|
+
return (W() ?? C).subscribe(t);
|
|
829
851
|
}
|
|
830
|
-
function
|
|
831
|
-
|
|
852
|
+
function ln() {
|
|
853
|
+
(W() ?? C).reset();
|
|
832
854
|
}
|
|
833
|
-
const
|
|
834
|
-
function
|
|
835
|
-
return
|
|
855
|
+
const an = () => "2.1.2";
|
|
856
|
+
function cn(t) {
|
|
857
|
+
return en(t, { name: "urfu-ui-kit-react", version: an() });
|
|
836
858
|
}
|
|
837
|
-
function
|
|
838
|
-
return
|
|
859
|
+
function rn(t, e) {
|
|
860
|
+
return Ft(on, () => nn(t, e), () => !1);
|
|
839
861
|
}
|
|
840
|
-
function
|
|
841
|
-
if (
|
|
862
|
+
function un({ scope: t, service: e }) {
|
|
863
|
+
if (rn(t === "app" ? "crashApp" : "crashPage", e)) throw new Error(`Сбой из dev-панели: падение ${t === "app" ? "приложения" : "страницы"}`);
|
|
842
864
|
return null;
|
|
843
865
|
}
|
|
844
866
|
export {
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
867
|
+
un as DevCrashProbe,
|
|
868
|
+
nn as isDevFault,
|
|
869
|
+
be as matchPath,
|
|
870
|
+
cn as mountDevPanel,
|
|
871
|
+
ln as resetDevFaults,
|
|
872
|
+
on as subscribeDevFaults,
|
|
873
|
+
rn as useDevFault
|
|
852
874
|
};
|