@ibdop/platform-kit 1.0.11 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,12 +1,6 @@
1
- import Ze, { useState as R, useRef as Dt, useCallback as k, useEffect as V, useMemo as Ge, Component as $t, createContext as Lt, useContext as Ut } from "react";
1
+ import Qe, { useState as R, useRef as et, useCallback as C, useEffect as B, useMemo as Ye, Component as $t, createContext as Lt, useContext as Ut } from "react";
2
2
  import Vt from "axios";
3
- const Ye = {
4
- log: (...t) => {
5
- },
6
- warn: (...t) => {
7
- }
8
- };
9
- function he() {
3
+ function V() {
10
4
  if (typeof window > "u") return null;
11
5
  const t = window;
12
6
  if (t.__SHELL_AUTH_INSTANCE__)
@@ -14,41 +8,69 @@ function he() {
14
8
  const r = window;
15
9
  return r.__SHELL_AUTH__?.authInstance ? r.__SHELL_AUTH__.authInstance : null;
16
10
  }
17
- function ne() {
18
- const [t, r] = R(null), [o, u] = R(!0), a = Dt(0), d = 20, s = k(() => he(), []);
19
- V(() => {
20
- const E = s();
21
- if (E) {
22
- r(E), u(!1);
11
+ function Bt() {
12
+ const t = V();
13
+ return t ? {
14
+ isAuthenticated: t.isAuthenticated,
15
+ user: t.user ?? void 0
16
+ } : { isAuthenticated: !1 };
17
+ }
18
+ function fr() {
19
+ const t = V();
20
+ return t?.isAuthenticated ? t.user?.profile?.access_token ?? null : null;
21
+ }
22
+ function dr() {
23
+ return V()?.isAuthenticated ?? !1;
24
+ }
25
+ async function Wt() {
26
+ const t = V();
27
+ t?.signinRedirect ? await t.signinRedirect() : typeof window < "u" && (window.location.href = "/");
28
+ }
29
+ async function pr() {
30
+ const t = V();
31
+ t?.removeUser && await t.removeUser();
32
+ }
33
+ const Je = {
34
+ log: (...t) => {
35
+ },
36
+ warn: (...t) => {
37
+ }
38
+ };
39
+ function se() {
40
+ const [t, r] = R(null), [s, i] = R(!0), c = et(0), p = 20, n = C(() => V(), []);
41
+ B(() => {
42
+ const y = n();
43
+ if (y) {
44
+ r(y), i(!1);
23
45
  return;
24
46
  }
25
- const l = (c) => {
26
- r(c.detail), u(!1);
27
- }, m = setInterval(() => {
28
- a.current++;
29
- const c = s();
30
- c ? (Ye.log("Auth found via polling, attempts:", a.current), r(c), u(!1), clearInterval(m)) : a.current >= d && (u(!1), clearInterval(m));
47
+ const f = (u) => {
48
+ r(u.detail), i(!1);
49
+ }, h = setInterval(() => {
50
+ c.current++;
51
+ const u = n();
52
+ u ? (Je.log("Auth found via polling, attempts:", c.current), r(u), i(!1), clearInterval(h)) : c.current >= p && (i(!1), clearInterval(h));
31
53
  }, 500);
32
- return window.addEventListener("shell-auth-ready", l), () => {
33
- clearInterval(m), window.removeEventListener("shell-auth-ready", l);
54
+ return window.addEventListener("shell-auth-ready", f), () => {
55
+ clearInterval(h), window.removeEventListener("shell-auth-ready", f);
34
56
  };
35
- }, [s]);
36
- const f = t || {
57
+ }, [n]);
58
+ const l = t || {
37
59
  user: null,
38
60
  isAuthenticated: !1,
39
- isLoading: o,
61
+ isLoading: s,
40
62
  signinRedirect: async () => {
41
- const E = he();
42
- E?.signinRedirect ? await E.signinRedirect() : typeof window < "u" && (window.location.href = "/");
63
+ const y = V();
64
+ y?.signinRedirect ? await y.signinRedirect() : typeof window < "u" && (window.location.href = "/");
43
65
  },
44
66
  removeUser: async () => {
45
- const E = he();
46
- E?.removeUser && await E.removeUser();
67
+ const y = V();
68
+ y?.removeUser && await y.removeUser();
47
69
  }
48
70
  };
49
- return Ye.log("Auth result:", { isAuthenticated: f.isAuthenticated, isLoading: f.isLoading }), f;
71
+ return Je.log("Auth result:", { isAuthenticated: l.isAuthenticated, isLoading: l.isLoading }), l;
50
72
  }
51
- const Bt = {
73
+ const zt = {
52
74
  log: (...t) => {
53
75
  },
54
76
  warn: (...t) => {
@@ -65,31 +87,31 @@ function Ht(t) {
65
87
  }
66
88
  return "unknown-mfe";
67
89
  }
68
- function zt(t) {
69
- const [r, o] = R(null), [u, a] = R(!0), [d, s] = R(null), x = k(() => {
70
- const E = Ht(t?.mfeName).replace("@ib-dop/", "");
71
- a(!0), s(null), fetch(`/svc/${E}/info.json`).then((l) => {
72
- if (!l.ok)
73
- throw new Error(`HTTP ${l.status}: ${l.statusText}`);
74
- return l.json();
75
- }).then((l) => {
76
- o(l);
77
- }).catch((l) => {
78
- Bt.error("Failed to load info:", l), s(l instanceof Error ? l.message : String(l));
90
+ function Gt(t) {
91
+ const [r, s] = R(null), [i, c] = R(!0), [p, n] = R(null), m = C(() => {
92
+ const y = Ht(t?.mfeName).replace("@ib-dop/", "");
93
+ c(!0), n(null), fetch(`/svc/${y}/info.json`).then((f) => {
94
+ if (!f.ok)
95
+ throw new Error(`HTTP ${f.status}: ${f.statusText}`);
96
+ return f.json();
97
+ }).then((f) => {
98
+ s(f);
99
+ }).catch((f) => {
100
+ zt.error("Failed to load info:", f), n(f instanceof Error ? f.message : String(f));
79
101
  }).finally(() => {
80
- a(!1);
102
+ c(!1);
81
103
  });
82
104
  }, [t?.mfeName]);
83
- return V(() => {
84
- x();
85
- }, [x]), {
105
+ return B(() => {
106
+ m();
107
+ }, [m]), {
86
108
  data: r,
87
- isLoading: u,
88
- error: d,
89
- refetch: x
109
+ isLoading: i,
110
+ error: p,
111
+ refetch: m
90
112
  };
91
113
  }
92
- const ge = {
114
+ const me = {
93
115
  log: (...t) => {
94
116
  },
95
117
  warn: (...t) => {
@@ -97,52 +119,52 @@ const ge = {
97
119
  error: (...t) => {
98
120
  console.error("[useV1Config]", ...t);
99
121
  }
100
- }, ee = {
122
+ }, te = {
101
123
  authority: "",
102
124
  client_id: "",
103
125
  environment: "development"
104
126
  };
105
- function ar() {
106
- const [t, r] = R(null), [o, u] = R(!0), [a, d] = R(null);
107
- return V(() => {
127
+ function hr() {
128
+ const [t, r] = R(null), [s, i] = R(!0), [c, p] = R(null);
129
+ return B(() => {
108
130
  (() => {
109
131
  if (typeof sessionStorage > "u") {
110
- d("sessionStorage not available"), r(ee), u(!1);
132
+ p("sessionStorage not available"), r(te), i(!1);
111
133
  return;
112
134
  }
113
135
  try {
114
- const x = sessionStorage.getItem("config");
115
- if (x) {
116
- const f = JSON.parse(x);
117
- r({ ...ee, ...f }), d(null), ge.log("Config loaded successfully");
136
+ const m = sessionStorage.getItem("config");
137
+ if (m) {
138
+ const l = JSON.parse(m);
139
+ r({ ...te, ...l }), p(null), me.log("Config loaded successfully");
118
140
  } else
119
- r(ee), d("Config not found in sessionStorage"), ge.warn("Config not found in sessionStorage");
120
- } catch (x) {
121
- ge.error("Error parsing config:", x), r(ee), d("Error parsing config");
141
+ r(te), p("Config not found in sessionStorage"), me.warn("Config not found in sessionStorage");
142
+ } catch (m) {
143
+ me.error("Error parsing config:", m), r(te), p("Error parsing config");
122
144
  } finally {
123
- u(!1);
145
+ i(!1);
124
146
  }
125
147
  })();
126
148
  }, []), {
127
149
  data: t,
128
- isLoading: o,
129
- error: a
150
+ isLoading: s,
151
+ error: c
130
152
  };
131
153
  }
132
- function Qe(t) {
154
+ function tt(t) {
133
155
  if (typeof window > "u") return;
134
- const r = window.__MF_NAME__ || "unknown", o = {
156
+ const r = window.__MF_NAME__ || "unknown", s = {
135
157
  ...t,
136
158
  mfeName: r,
137
159
  timestamp: Date.now()
138
160
  };
139
161
  window.dispatchEvent(new CustomEvent("mfe-notification", {
140
- detail: o,
162
+ detail: s,
141
163
  bubbles: !0
142
164
  }));
143
165
  }
144
- function Je(t, r) {
145
- const o = {
166
+ function qe(t, r) {
167
+ const s = {
146
168
  network: {
147
169
  title: "Нет подключения",
148
170
  message: "Сервер недоступен. Проверьте подключение к интернету."
@@ -171,60 +193,76 @@ function Je(t, r) {
171
193
  title: "Неизвестная ошибка",
172
194
  message: t.message || "Произошла неизвестная ошибка."
173
195
  }
174
- }, u = o[t.type] || o.unknown;
175
- Qe({
196
+ }, i = s[t.type] || s.unknown;
197
+ tt({
176
198
  type: t.type === "network" ? "warning" : "error",
177
- title: u.title,
178
- message: r ? `${u.message} (${r})` : u.message
199
+ title: i.title,
200
+ message: r ? `${i.message} (${r})` : i.message
179
201
  });
180
202
  }
181
- function ir(t, r = {}) {
203
+ function Yt(t) {
204
+ return t instanceof Error && t.name === "AbortError";
205
+ }
206
+ function gr(t, r = {}) {
182
207
  const {
183
- notifyOnError: o = !0,
184
- notifyOnSuccess: u = !1,
185
- successMessage: a,
186
- errorContext: d,
187
- onSuccess: s,
188
- onError: x
189
- } = r, [f, E] = R(null), [l, m] = R(null), [c, _] = R(!1), w = l !== null, N = f !== null && !c && !w, C = k(async () => {
190
- _(!0), m(null);
208
+ notifyOnError: s = !0,
209
+ notifyOnSuccess: i = !1,
210
+ successMessage: c,
211
+ errorContext: p,
212
+ onSuccess: n,
213
+ onError: m
214
+ } = r, [l, y] = R(null), [f, h] = R(null), [u, E] = R(!1), v = et(null), N = f !== null, T = l !== null && !u && !N;
215
+ B(() => () => {
216
+ v.current && v.current.abort();
217
+ }, []);
218
+ const x = C(() => {
219
+ v.current && (v.current.abort(), v.current = null, E(!1));
220
+ }, []), _ = C(async () => {
221
+ v.current && v.current.abort(), v.current = new AbortController();
222
+ const j = v.current.signal;
223
+ E(!0), h(null);
191
224
  try {
192
- const p = await t();
193
- if (p.ok)
194
- return E(p.data), u && a && Qe({
225
+ const O = await t(j);
226
+ if (j.aborted)
227
+ return null;
228
+ if (O.ok)
229
+ return y(O.data), i && c && tt({
195
230
  type: "success",
196
231
  title: "Успешно",
197
- message: a
198
- }), s?.(p.data), p.data;
232
+ message: c
233
+ }), n?.(O.data), O.data;
199
234
  {
200
- const A = {
201
- message: p.data || "Request failed",
202
- status: p.status,
235
+ const L = {
236
+ message: O.data || "Request failed",
237
+ status: O.status,
203
238
  type: "client",
204
239
  timestamp: Date.now()
205
240
  };
206
- return m(A), o && Je(A, d), x?.(A), null;
241
+ return h(L), s && qe(L, p), m?.(L), null;
207
242
  }
208
- } catch (p) {
209
- const A = p;
210
- return m(A), o && Je(A, d), x?.(A), null;
243
+ } catch (O) {
244
+ if (Yt(O))
245
+ return null;
246
+ const L = O;
247
+ return h(L), s && qe(L, p), m?.(L), null;
211
248
  } finally {
212
- _(!1);
249
+ j.aborted || E(!1), v.current = null;
213
250
  }
214
- }, [t, o, u, a, d, s, x]), b = k(() => {
215
- E(null), m(null), _(!1);
251
+ }, [t, s, i, c, p, n, m]), k = C(() => {
252
+ y(null), h(null), E(!1);
216
253
  }, []);
217
254
  return {
218
- data: f,
219
- error: l,
220
- isLoading: c,
221
- isError: w,
222
- isSuccess: N,
223
- execute: C,
224
- reset: b
255
+ data: l,
256
+ error: f,
257
+ isLoading: u,
258
+ isError: N,
259
+ isSuccess: T,
260
+ execute: _,
261
+ reset: k,
262
+ abort: x
225
263
  };
226
264
  }
227
- const Wt = {
265
+ const Jt = {
228
266
  canView: ["all"],
229
267
  canEdit: ["ibdop-user", "ibdop-admin", "ibdop-devops"],
230
268
  canDelete: ["ibdop-admin", "ibdop-devops"],
@@ -233,330 +271,330 @@ const Wt = {
233
271
  canExportData: ["ibdop-user"],
234
272
  canManageUsers: ["ibdop-admin"]
235
273
  };
236
- function ur(t = {}) {
237
- const r = ne(), o = Ge(() => ({
238
- ...Wt,
274
+ function mr(t = {}) {
275
+ const r = se(), s = Ye(() => ({
276
+ ...Jt,
239
277
  ...t
240
- }), [t]), u = Ge(() => {
241
- const d = r.user?.profile?.realm_roles || r.user?.profile?.roles || [];
242
- return Array.isArray(d) ? d : [d];
243
- }, [r.user]), a = (d) => d.includes("all") ? !0 : d.some((s) => u.includes(s));
278
+ }), [t]), i = Ye(() => {
279
+ const p = r.user?.profile?.realm_roles || r.user?.profile?.roles || [];
280
+ return Array.isArray(p) ? p : [p];
281
+ }, [r.user]), c = (p) => p.includes("all") ? !0 : p.some((n) => i.includes(n));
244
282
  return {
245
- canView: a(o.canView),
246
- canEdit: a(o.canEdit),
247
- canDelete: a(o.canDelete),
248
- canAdmin: a(o.canAdmin),
249
- canViewSensitiveData: a(o.canViewSensitiveData),
250
- canExportData: a(o.canExportData),
251
- canManageUsers: a(o.canManageUsers)
283
+ canView: c(s.canView),
284
+ canEdit: c(s.canEdit),
285
+ canDelete: c(s.canDelete),
286
+ canAdmin: c(s.canAdmin),
287
+ canViewSensitiveData: c(s.canViewSensitiveData),
288
+ canExportData: c(s.canExportData),
289
+ canManageUsers: c(s.canManageUsers)
252
290
  };
253
291
  }
254
- function cr() {
255
- const t = ne(), [r, o] = R([]), [u, a] = R(0), [d, s] = R([]), [x, f] = R(!0), [E, l] = R(null), m = k(async () => {
292
+ function _r() {
293
+ const t = se(), [r, s] = R([]), [i, c] = R(0), [p, n] = R([]), [m, l] = R(!0), [y, f] = R(null), h = C(async () => {
256
294
  if (!t.isAuthenticated) {
257
- console.debug("[useFeatures] Not authenticated"), f(!1);
295
+ console.debug("[useFeatures] Not authenticated"), l(!1);
258
296
  return;
259
297
  }
260
- f(!0), l(null);
298
+ l(!0), f(null);
261
299
  try {
262
- const w = {
300
+ const v = {
263
301
  "Content-Type": "application/json"
264
302
  }, N = t.user?.access_token;
265
- N && (w.Authorization = `Bearer ${N}`);
266
- const C = await fetch("/api/features", { headers: w });
267
- if (!C.ok)
268
- throw new Error(`HTTP ${C.status}: ${C.statusText}`);
269
- const b = await C.json();
270
- o(b.features || []), a(b.totalCount || 0), s(b.userRoles || []);
271
- } catch (w) {
272
- console.debug("Features fetch error:", w), l(w instanceof Error ? w.message : String(w)), o([]), s([]);
303
+ N && (v.Authorization = `Bearer ${N}`);
304
+ const T = await fetch("/api/features", { headers: v });
305
+ if (!T.ok)
306
+ throw new Error(`HTTP ${T.status}: ${T.statusText}`);
307
+ const x = await T.json();
308
+ s(x.features || []), c(x.totalCount || 0), n(x.userRoles || []);
309
+ } catch (v) {
310
+ console.debug("Features fetch error:", v), f(v instanceof Error ? v.message : String(v)), s([]), n([]);
273
311
  } finally {
274
- f(!1);
312
+ l(!1);
275
313
  }
276
314
  }, [t.isAuthenticated, t.user?.access_token]);
277
- V(() => {
278
- m();
279
- }, [m]);
280
- const c = k(
281
- (w) => r.find((C) => C.name === w)?.userEnabled ?? !1,
315
+ B(() => {
316
+ h();
317
+ }, [h]);
318
+ const u = C(
319
+ (v) => r.find((T) => T.name === v)?.userEnabled ?? !1,
282
320
  [r]
283
- ), _ = k(
284
- (w) => r.filter((N) => N.mfDependencies?.includes(w)),
321
+ ), E = C(
322
+ (v) => r.filter((N) => N.mfDependencies?.includes(v)),
285
323
  [r]
286
324
  );
287
325
  return {
288
326
  features: r,
289
- totalCount: u,
290
- userRoles: d,
291
- isLoading: x,
292
- error: E,
293
- refetch: m,
294
- isFeatureEnabled: c,
295
- getFeaturesByMf: _
327
+ totalCount: i,
328
+ userRoles: p,
329
+ isLoading: m,
330
+ error: y,
331
+ refetch: h,
332
+ isFeatureEnabled: u,
333
+ getFeaturesByMf: E
296
334
  };
297
335
  }
298
- function lr() {
299
- const t = ne(), [r, o] = R([]), [u, a] = R([]), [d, s] = R(!1), [x, f] = R(!0), [E, l] = R(null), m = k(async () => {
336
+ function vr() {
337
+ const t = se(), [r, s] = R([]), [i, c] = R([]), [p, n] = R(!1), [m, l] = R(!0), [y, f] = R(null), h = C(async () => {
300
338
  if (!t.isAuthenticated) {
301
- console.debug("[useFeatureAdmin] Not authenticated"), f(!1);
339
+ console.debug("[useFeatureAdmin] Not authenticated"), l(!1);
302
340
  return;
303
341
  }
304
- f(!0), l(null);
342
+ l(!0), f(null);
305
343
  try {
306
- const C = {
344
+ const T = {
307
345
  "Content-Type": "application/json"
308
- }, b = t.user?.access_token;
309
- b && (C.Authorization = `Bearer ${b}`);
310
- const p = await fetch("/api/features/admin", { headers: C });
311
- if (!p.ok) {
312
- if (p.status === 403) {
313
- console.warn("[useFeatureAdmin] 403 Forbidden - checking if token has admin role"), s(!1), o([]), a([]), f(!1);
346
+ }, x = t.user?.access_token;
347
+ x && (T.Authorization = `Bearer ${x}`);
348
+ const _ = await fetch("/api/features/admin", { headers: T });
349
+ if (!_.ok) {
350
+ if (_.status === 403) {
351
+ console.warn("[useFeatureAdmin] 403 Forbidden - checking if token has admin role"), n(!1), s([]), c([]), l(!1);
314
352
  return;
315
353
  }
316
- throw new Error(`HTTP ${p.status}: ${p.statusText}`);
354
+ throw new Error(`HTTP ${_.status}: ${_.statusText}`);
317
355
  }
318
- const A = await p.json();
319
- o(A.featureToggles || []), a(A.microfrontends || []), s(A.isAdmin || !1);
320
- } catch (C) {
321
- console.debug("FeatureAdmin fetch error:", C), o([]), a([]), s(!1);
356
+ const k = await _.json();
357
+ s(k.featureToggles || []), c(k.microfrontends || []), n(k.isAdmin || !1);
358
+ } catch (T) {
359
+ console.debug("FeatureAdmin fetch error:", T), s([]), c([]), n(!1);
322
360
  } finally {
323
- f(!1);
361
+ l(!1);
324
362
  }
325
- }, [t.isAuthenticated, t.user?.access_token]), c = k(
326
- async (C) => {
363
+ }, [t.isAuthenticated, t.user?.access_token]), u = C(
364
+ async (T) => {
327
365
  try {
328
- const b = {
366
+ const x = {
329
367
  "Content-Type": "application/json"
330
- }, p = t.user?.access_token;
331
- p && (b.Authorization = `Bearer ${p}`);
332
- const A = await fetch("/api/features/admin", {
368
+ }, _ = t.user?.access_token;
369
+ _ && (x.Authorization = `Bearer ${_}`);
370
+ const k = await fetch("/api/features/admin", {
333
371
  method: "POST",
334
- headers: b,
335
- body: JSON.stringify(C)
372
+ headers: x,
373
+ body: JSON.stringify(T)
336
374
  });
337
- if (!A.ok) {
338
- const P = await A.json().catch(() => ({}));
339
- throw new Error(P.error || `HTTP ${A.status}`);
375
+ if (!k.ok) {
376
+ const j = await k.json().catch(() => ({}));
377
+ throw new Error(j.error || `HTTP ${k.status}`);
340
378
  }
341
- return await m(), !0;
342
- } catch (b) {
343
- return l(b instanceof Error ? b.message : String(b)), !1;
379
+ return await h(), !0;
380
+ } catch (x) {
381
+ return f(x instanceof Error ? x.message : String(x)), !1;
344
382
  }
345
383
  },
346
- [m]
347
- ), _ = k(
348
- async (C, b) => {
384
+ [h]
385
+ ), E = C(
386
+ async (T, x) => {
349
387
  try {
350
- const p = {
388
+ const _ = {
351
389
  "Content-Type": "application/json"
352
- }, A = t.user?.access_token;
353
- A && (p.Authorization = `Bearer ${A}`);
354
- const P = await fetch(`/api/features/admin/${encodeURIComponent(C)}`, {
390
+ }, k = t.user?.access_token;
391
+ k && (_.Authorization = `Bearer ${k}`);
392
+ const j = await fetch(`/api/features/admin/${encodeURIComponent(T)}`, {
355
393
  method: "PUT",
356
- headers: p,
357
- body: JSON.stringify(b)
394
+ headers: _,
395
+ body: JSON.stringify(x)
358
396
  });
359
- if (!P.ok) {
360
- const z = await P.json().catch(() => ({}));
361
- throw new Error(z.error || `HTTP ${P.status}`);
397
+ if (!j.ok) {
398
+ const O = await j.json().catch(() => ({}));
399
+ throw new Error(O.error || `HTTP ${j.status}`);
362
400
  }
363
- return await m(), !0;
364
- } catch (p) {
365
- return l(p instanceof Error ? p.message : String(p)), !1;
401
+ return await h(), !0;
402
+ } catch (_) {
403
+ return f(_ instanceof Error ? _.message : String(_)), !1;
366
404
  }
367
405
  },
368
- [m]
369
- ), w = k(
370
- async (C, b) => {
406
+ [h]
407
+ ), v = C(
408
+ async (T, x) => {
371
409
  try {
372
- const p = {}, A = t.user?.access_token;
373
- A && (p.Authorization = `Bearer ${A}`);
374
- const P = await fetch(
375
- `/api/features/admin/${encodeURIComponent(C)}/toggle?enabled=${b}`,
410
+ const _ = {}, k = t.user?.access_token;
411
+ k && (_.Authorization = `Bearer ${k}`);
412
+ const j = await fetch(
413
+ `/api/features/admin/${encodeURIComponent(T)}/toggle?enabled=${x}`,
376
414
  {
377
415
  method: "POST",
378
- headers: p
416
+ headers: _
379
417
  }
380
418
  );
381
- if (!P.ok) {
382
- const z = await P.json().catch(() => ({}));
383
- throw new Error(z.error || `HTTP ${P.status}`);
419
+ if (!j.ok) {
420
+ const O = await j.json().catch(() => ({}));
421
+ throw new Error(O.error || `HTTP ${j.status}`);
384
422
  }
385
- return await m(), !0;
386
- } catch (p) {
387
- return l(p instanceof Error ? p.message : String(p)), !1;
423
+ return await h(), !0;
424
+ } catch (_) {
425
+ return f(_ instanceof Error ? _.message : String(_)), !1;
388
426
  }
389
427
  },
390
- [m]
391
- ), N = k(
392
- async (C) => {
428
+ [h]
429
+ ), N = C(
430
+ async (T) => {
393
431
  try {
394
- const b = {}, p = t.user?.access_token;
395
- p && (b.Authorization = `Bearer ${p}`);
396
- const A = await fetch(`/api/features/admin/${encodeURIComponent(C)}`, {
432
+ const x = {}, _ = t.user?.access_token;
433
+ _ && (x.Authorization = `Bearer ${_}`);
434
+ const k = await fetch(`/api/features/admin/${encodeURIComponent(T)}`, {
397
435
  method: "DELETE",
398
- headers: b
436
+ headers: x
399
437
  });
400
- if (!A.ok) {
401
- const P = await A.json().catch(() => ({}));
402
- throw new Error(P.error || `HTTP ${A.status}`);
438
+ if (!k.ok) {
439
+ const j = await k.json().catch(() => ({}));
440
+ throw new Error(j.error || `HTTP ${k.status}`);
403
441
  }
404
- return await m(), !0;
405
- } catch (b) {
406
- return l(b instanceof Error ? b.message : String(b)), !1;
442
+ return await h(), !0;
443
+ } catch (x) {
444
+ return f(x instanceof Error ? x.message : String(x)), !1;
407
445
  }
408
446
  },
409
- [m]
447
+ [h]
410
448
  );
411
- return V(() => {
412
- m();
413
- }, [m]), {
449
+ return B(() => {
450
+ h();
451
+ }, [h]), {
414
452
  features: r,
415
- microfrontends: u,
416
- isAdmin: d,
417
- isLoading: x,
418
- error: E,
419
- refetch: m,
420
- createFeature: c,
421
- updateFeature: _,
422
- toggleFeature: w,
453
+ microfrontends: i,
454
+ isAdmin: p,
455
+ isLoading: m,
456
+ error: y,
457
+ refetch: h,
458
+ createFeature: u,
459
+ updateFeature: E,
460
+ toggleFeature: v,
423
461
  deleteFeature: N
424
462
  };
425
463
  }
426
- function fr() {
427
- const t = ne(), [r, o] = R([]), [u, a] = R(0), [d, s] = R(!0), [x, f] = R(null), E = k(async () => {
464
+ function yr() {
465
+ const t = se(), [r, s] = R([]), [i, c] = R(0), [p, n] = R(!0), [m, l] = R(null), y = C(async () => {
428
466
  if (!t.isAuthenticated) {
429
- s(!1);
467
+ n(!1);
430
468
  return;
431
469
  }
432
- s(!0), f(null);
470
+ n(!0), l(null);
433
471
  try {
434
- const l = {
472
+ const f = {
435
473
  "Content-Type": "application/json"
436
- }, m = t.user?.access_token;
437
- m && (l.Authorization = `Bearer ${m}`);
438
- const c = await fetch("/api/features/microfrontends", { headers: l });
439
- if (!c.ok)
440
- throw new Error(`HTTP ${c.status}: ${c.statusText}`);
441
- const _ = await c.json();
442
- o(_.microfrontends || []), a(_.totalCount || 0);
443
- } catch (l) {
444
- f(l instanceof Error ? l.message : String(l));
474
+ }, h = t.user?.access_token;
475
+ h && (f.Authorization = `Bearer ${h}`);
476
+ const u = await fetch("/api/features/microfrontends", { headers: f });
477
+ if (!u.ok)
478
+ throw new Error(`HTTP ${u.status}: ${u.statusText}`);
479
+ const E = await u.json();
480
+ s(E.microfrontends || []), c(E.totalCount || 0);
481
+ } catch (f) {
482
+ l(f instanceof Error ? f.message : String(f));
445
483
  } finally {
446
- s(!1);
484
+ n(!1);
447
485
  }
448
486
  }, [t.isAuthenticated, t.user?.access_token]);
449
- return V(() => {
450
- E();
451
- }, [E]), {
487
+ return B(() => {
488
+ y();
489
+ }, [y]), {
452
490
  microfrontends: r,
453
- totalCount: u,
454
- isLoading: d,
455
- error: x,
456
- refetch: E
491
+ totalCount: i,
492
+ isLoading: p,
493
+ error: m,
494
+ refetch: y
457
495
  };
458
496
  }
459
- var te = { exports: {} }, Y = {};
460
- var qe;
461
- function Gt() {
462
- if (qe) return Y;
463
- qe = 1;
464
- var t = Ze, r = /* @__PURE__ */ Symbol.for("react.element"), o = /* @__PURE__ */ Symbol.for("react.fragment"), u = Object.prototype.hasOwnProperty, a = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, d = { key: !0, ref: !0, __self: !0, __source: !0 };
465
- function s(x, f, E) {
466
- var l, m = {}, c = null, _ = null;
467
- E !== void 0 && (c = "" + E), f.key !== void 0 && (c = "" + f.key), f.ref !== void 0 && (_ = f.ref);
468
- for (l in f) u.call(f, l) && !d.hasOwnProperty(l) && (m[l] = f[l]);
469
- if (x && x.defaultProps) for (l in f = x.defaultProps, f) m[l] === void 0 && (m[l] = f[l]);
470
- return { $$typeof: r, type: x, key: c, ref: _, props: m, _owner: a.current };
497
+ var re = { exports: {} }, q = {};
498
+ var Ke;
499
+ function qt() {
500
+ if (Ke) return q;
501
+ Ke = 1;
502
+ var t = Qe, r = /* @__PURE__ */ Symbol.for("react.element"), s = /* @__PURE__ */ Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, c = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p = { key: !0, ref: !0, __self: !0, __source: !0 };
503
+ function n(m, l, y) {
504
+ var f, h = {}, u = null, E = null;
505
+ y !== void 0 && (u = "" + y), l.key !== void 0 && (u = "" + l.key), l.ref !== void 0 && (E = l.ref);
506
+ for (f in l) i.call(l, f) && !p.hasOwnProperty(f) && (h[f] = l[f]);
507
+ if (m && m.defaultProps) for (f in l = m.defaultProps, l) h[f] === void 0 && (h[f] = l[f]);
508
+ return { $$typeof: r, type: m, key: u, ref: E, props: h, _owner: c.current };
471
509
  }
472
- return Y.Fragment = o, Y.jsx = s, Y.jsxs = s, Y;
510
+ return q.Fragment = s, q.jsx = n, q.jsxs = n, q;
473
511
  }
474
- var J = {};
475
- var Ke;
476
- function Yt() {
477
- return Ke || (Ke = 1, process.env.NODE_ENV !== "production" && (function() {
478
- var t = Ze, r = /* @__PURE__ */ Symbol.for("react.element"), o = /* @__PURE__ */ Symbol.for("react.portal"), u = /* @__PURE__ */ Symbol.for("react.fragment"), a = /* @__PURE__ */ Symbol.for("react.strict_mode"), d = /* @__PURE__ */ Symbol.for("react.profiler"), s = /* @__PURE__ */ Symbol.for("react.provider"), x = /* @__PURE__ */ Symbol.for("react.context"), f = /* @__PURE__ */ Symbol.for("react.forward_ref"), E = /* @__PURE__ */ Symbol.for("react.suspense"), l = /* @__PURE__ */ Symbol.for("react.suspense_list"), m = /* @__PURE__ */ Symbol.for("react.memo"), c = /* @__PURE__ */ Symbol.for("react.lazy"), _ = /* @__PURE__ */ Symbol.for("react.offscreen"), w = Symbol.iterator, N = "@@iterator";
479
- function C(e) {
512
+ var K = {};
513
+ var Xe;
514
+ function Kt() {
515
+ return Xe || (Xe = 1, process.env.NODE_ENV !== "production" && (function() {
516
+ var t = Qe, r = /* @__PURE__ */ Symbol.for("react.element"), s = /* @__PURE__ */ Symbol.for("react.portal"), i = /* @__PURE__ */ Symbol.for("react.fragment"), c = /* @__PURE__ */ Symbol.for("react.strict_mode"), p = /* @__PURE__ */ Symbol.for("react.profiler"), n = /* @__PURE__ */ Symbol.for("react.provider"), m = /* @__PURE__ */ Symbol.for("react.context"), l = /* @__PURE__ */ Symbol.for("react.forward_ref"), y = /* @__PURE__ */ Symbol.for("react.suspense"), f = /* @__PURE__ */ Symbol.for("react.suspense_list"), h = /* @__PURE__ */ Symbol.for("react.memo"), u = /* @__PURE__ */ Symbol.for("react.lazy"), E = /* @__PURE__ */ Symbol.for("react.offscreen"), v = Symbol.iterator, N = "@@iterator";
517
+ function T(e) {
480
518
  if (e === null || typeof e != "object")
481
519
  return null;
482
- var n = w && e[w] || e[N];
483
- return typeof n == "function" ? n : null;
520
+ var o = v && e[v] || e[N];
521
+ return typeof o == "function" ? o : null;
484
522
  }
485
- var b = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
486
- function p(e) {
523
+ var x = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
524
+ function _(e) {
487
525
  {
488
- for (var n = arguments.length, i = new Array(n > 1 ? n - 1 : 0), h = 1; h < n; h++)
489
- i[h - 1] = arguments[h];
490
- A("error", e, i);
526
+ for (var o = arguments.length, a = new Array(o > 1 ? o - 1 : 0), d = 1; d < o; d++)
527
+ a[d - 1] = arguments[d];
528
+ k("error", e, a);
491
529
  }
492
530
  }
493
- function A(e, n, i) {
531
+ function k(e, o, a) {
494
532
  {
495
- var h = b.ReactDebugCurrentFrame, S = h.getStackAddendum();
496
- S !== "" && (n += "%s", i = i.concat([S]));
497
- var T = i.map(function(y) {
498
- return String(y);
533
+ var d = x.ReactDebugCurrentFrame, A = d.getStackAddendum();
534
+ A !== "" && (o += "%s", a = a.concat([A]));
535
+ var S = a.map(function(b) {
536
+ return String(b);
499
537
  });
500
- T.unshift("Warning: " + n), Function.prototype.apply.call(console[e], console, T);
538
+ S.unshift("Warning: " + o), Function.prototype.apply.call(console[e], console, S);
501
539
  }
502
540
  }
503
- var P = !1, z = !1, st = !1, at = !1, it = !1, we;
504
- we = /* @__PURE__ */ Symbol.for("react.module.reference");
505
- function ut(e) {
506
- return !!(typeof e == "string" || typeof e == "function" || e === u || e === d || it || e === a || e === E || e === l || at || e === _ || P || z || st || typeof e == "object" && e !== null && (e.$$typeof === c || e.$$typeof === m || e.$$typeof === s || e.$$typeof === x || e.$$typeof === f || // This needs to include all possible module reference object
541
+ var j = !1, O = !1, L = !1, it = !1, ut = !1, be;
542
+ be = /* @__PURE__ */ Symbol.for("react.module.reference");
543
+ function ct(e) {
544
+ return !!(typeof e == "string" || typeof e == "function" || e === i || e === p || ut || e === c || e === y || e === f || it || e === E || j || O || L || typeof e == "object" && e !== null && (e.$$typeof === u || e.$$typeof === h || e.$$typeof === n || e.$$typeof === m || e.$$typeof === l || // This needs to include all possible module reference object
507
545
  // types supported by any Flight configuration anywhere since
508
546
  // we don't know which Flight build this will end up being used
509
547
  // with.
510
- e.$$typeof === we || e.getModuleId !== void 0));
548
+ e.$$typeof === be || e.getModuleId !== void 0));
511
549
  }
512
- function ct(e, n, i) {
513
- var h = e.displayName;
514
- if (h)
515
- return h;
516
- var S = n.displayName || n.name || "";
517
- return S !== "" ? i + "(" + S + ")" : i;
550
+ function lt(e, o, a) {
551
+ var d = e.displayName;
552
+ if (d)
553
+ return d;
554
+ var A = o.displayName || o.name || "";
555
+ return A !== "" ? a + "(" + A + ")" : a;
518
556
  }
519
- function be(e) {
557
+ function xe(e) {
520
558
  return e.displayName || "Context";
521
559
  }
522
- function $(e) {
560
+ function U(e) {
523
561
  if (e == null)
524
562
  return null;
525
- if (typeof e.tag == "number" && p("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
563
+ if (typeof e.tag == "number" && _("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
526
564
  return e.displayName || e.name || null;
527
565
  if (typeof e == "string")
528
566
  return e;
529
567
  switch (e) {
530
- case u:
568
+ case i:
531
569
  return "Fragment";
532
- case o:
570
+ case s:
533
571
  return "Portal";
534
- case d:
572
+ case p:
535
573
  return "Profiler";
536
- case a:
574
+ case c:
537
575
  return "StrictMode";
538
- case E:
576
+ case y:
539
577
  return "Suspense";
540
- case l:
578
+ case f:
541
579
  return "SuspenseList";
542
580
  }
543
581
  if (typeof e == "object")
544
582
  switch (e.$$typeof) {
545
- case x:
546
- var n = e;
547
- return be(n) + ".Consumer";
548
- case s:
549
- var i = e;
550
- return be(i._context) + ".Provider";
551
- case f:
552
- return ct(e, e.render, "ForwardRef");
553
583
  case m:
554
- var h = e.displayName || null;
555
- return h !== null ? h : $(e.type) || "Memo";
556
- case c: {
557
- var S = e, T = S._payload, y = S._init;
584
+ var o = e;
585
+ return xe(o) + ".Consumer";
586
+ case n:
587
+ var a = e;
588
+ return xe(a._context) + ".Provider";
589
+ case l:
590
+ return lt(e, e.render, "ForwardRef");
591
+ case h:
592
+ var d = e.displayName || null;
593
+ return d !== null ? d : U(e.type) || "Memo";
594
+ case u: {
595
+ var A = e, S = A._payload, b = A._init;
558
596
  try {
559
- return $(y(T));
597
+ return U(b(S));
560
598
  } catch {
561
599
  return null;
562
600
  }
@@ -564,18 +602,18 @@ function Yt() {
564
602
  }
565
603
  return null;
566
604
  }
567
- var L = Object.assign, W = 0, xe, Se, Ae, Te, Re, Ce, Ie;
568
- function ke() {
605
+ var W = Object.assign, Y = 0, Ae, Se, Re, Te, Ce, ke, Me;
606
+ function Ie() {
569
607
  }
570
- ke.__reactDisabledLog = !0;
571
- function lt() {
608
+ Ie.__reactDisabledLog = !0;
609
+ function ft() {
572
610
  {
573
- if (W === 0) {
574
- xe = console.log, Se = console.info, Ae = console.warn, Te = console.error, Re = console.group, Ce = console.groupCollapsed, Ie = console.groupEnd;
611
+ if (Y === 0) {
612
+ Ae = console.log, Se = console.info, Re = console.warn, Te = console.error, Ce = console.group, ke = console.groupCollapsed, Me = console.groupEnd;
575
613
  var e = {
576
614
  configurable: !0,
577
615
  enumerable: !0,
578
- value: ke,
616
+ value: Ie,
579
617
  writable: !0
580
618
  };
581
619
  Object.defineProperties(console, {
@@ -588,332 +626,332 @@ function Yt() {
588
626
  groupEnd: e
589
627
  });
590
628
  }
591
- W++;
629
+ Y++;
592
630
  }
593
631
  }
594
- function ft() {
632
+ function dt() {
595
633
  {
596
- if (W--, W === 0) {
634
+ if (Y--, Y === 0) {
597
635
  var e = {
598
636
  configurable: !0,
599
637
  enumerable: !0,
600
638
  writable: !0
601
639
  };
602
640
  Object.defineProperties(console, {
603
- log: L({}, e, {
604
- value: xe
641
+ log: W({}, e, {
642
+ value: Ae
605
643
  }),
606
- info: L({}, e, {
644
+ info: W({}, e, {
607
645
  value: Se
608
646
  }),
609
- warn: L({}, e, {
610
- value: Ae
647
+ warn: W({}, e, {
648
+ value: Re
611
649
  }),
612
- error: L({}, e, {
650
+ error: W({}, e, {
613
651
  value: Te
614
652
  }),
615
- group: L({}, e, {
616
- value: Re
617
- }),
618
- groupCollapsed: L({}, e, {
653
+ group: W({}, e, {
619
654
  value: Ce
620
655
  }),
621
- groupEnd: L({}, e, {
622
- value: Ie
656
+ groupCollapsed: W({}, e, {
657
+ value: ke
658
+ }),
659
+ groupEnd: W({}, e, {
660
+ value: Me
623
661
  })
624
662
  });
625
663
  }
626
- W < 0 && p("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
664
+ Y < 0 && _("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
627
665
  }
628
666
  }
629
- var ae = b.ReactCurrentDispatcher, ie;
630
- function K(e, n, i) {
667
+ var ue = x.ReactCurrentDispatcher, ce;
668
+ function X(e, o, a) {
631
669
  {
632
- if (ie === void 0)
670
+ if (ce === void 0)
633
671
  try {
634
672
  throw Error();
635
- } catch (S) {
636
- var h = S.stack.trim().match(/\n( *(at )?)/);
637
- ie = h && h[1] || "";
673
+ } catch (A) {
674
+ var d = A.stack.trim().match(/\n( *(at )?)/);
675
+ ce = d && d[1] || "";
638
676
  }
639
677
  return `
640
- ` + ie + e;
678
+ ` + ce + e;
641
679
  }
642
680
  }
643
- var ue = !1, X;
681
+ var le = !1, Z;
644
682
  {
645
- var dt = typeof WeakMap == "function" ? WeakMap : Map;
646
- X = new dt();
683
+ var pt = typeof WeakMap == "function" ? WeakMap : Map;
684
+ Z = new pt();
647
685
  }
648
- function Me(e, n) {
649
- if (!e || ue)
686
+ function Ne(e, o) {
687
+ if (!e || le)
650
688
  return "";
651
689
  {
652
- var i = X.get(e);
653
- if (i !== void 0)
654
- return i;
690
+ var a = Z.get(e);
691
+ if (a !== void 0)
692
+ return a;
655
693
  }
656
- var h;
657
- ue = !0;
658
- var S = Error.prepareStackTrace;
694
+ var d;
695
+ le = !0;
696
+ var A = Error.prepareStackTrace;
659
697
  Error.prepareStackTrace = void 0;
660
- var T;
661
- T = ae.current, ae.current = null, lt();
698
+ var S;
699
+ S = ue.current, ue.current = null, ft();
662
700
  try {
663
- if (n) {
664
- var y = function() {
701
+ if (o) {
702
+ var b = function() {
665
703
  throw Error();
666
704
  };
667
- if (Object.defineProperty(y.prototype, "props", {
705
+ if (Object.defineProperty(b.prototype, "props", {
668
706
  set: function() {
669
707
  throw Error();
670
708
  }
671
709
  }), typeof Reflect == "object" && Reflect.construct) {
672
710
  try {
673
- Reflect.construct(y, []);
674
- } catch (O) {
675
- h = O;
711
+ Reflect.construct(b, []);
712
+ } catch (F) {
713
+ d = F;
676
714
  }
677
- Reflect.construct(e, [], y);
715
+ Reflect.construct(e, [], b);
678
716
  } else {
679
717
  try {
680
- y.call();
681
- } catch (O) {
682
- h = O;
718
+ b.call();
719
+ } catch (F) {
720
+ d = F;
683
721
  }
684
- e.call(y.prototype);
722
+ e.call(b.prototype);
685
723
  }
686
724
  } else {
687
725
  try {
688
726
  throw Error();
689
- } catch (O) {
690
- h = O;
727
+ } catch (F) {
728
+ d = F;
691
729
  }
692
730
  e();
693
731
  }
694
- } catch (O) {
695
- if (O && h && typeof O.stack == "string") {
696
- for (var v = O.stack.split(`
697
- `), j = h.stack.split(`
698
- `), I = v.length - 1, M = j.length - 1; I >= 1 && M >= 0 && v[I] !== j[M]; )
699
- M--;
700
- for (; I >= 1 && M >= 0; I--, M--)
701
- if (v[I] !== j[M]) {
702
- if (I !== 1 || M !== 1)
732
+ } catch (F) {
733
+ if (F && d && typeof F.stack == "string") {
734
+ for (var w = F.stack.split(`
735
+ `), P = d.stack.split(`
736
+ `), M = w.length - 1, I = P.length - 1; M >= 1 && I >= 0 && w[M] !== P[I]; )
737
+ I--;
738
+ for (; M >= 1 && I >= 0; M--, I--)
739
+ if (w[M] !== P[I]) {
740
+ if (M !== 1 || I !== 1)
703
741
  do
704
- if (I--, M--, M < 0 || v[I] !== j[M]) {
705
- var F = `
706
- ` + v[I].replace(" at new ", " at ");
707
- return e.displayName && F.includes("<anonymous>") && (F = F.replace("<anonymous>", e.displayName)), typeof e == "function" && X.set(e, F), F;
742
+ if (M--, I--, I < 0 || w[M] !== P[I]) {
743
+ var D = `
744
+ ` + w[M].replace(" at new ", " at ");
745
+ return e.displayName && D.includes("<anonymous>") && (D = D.replace("<anonymous>", e.displayName)), typeof e == "function" && Z.set(e, D), D;
708
746
  }
709
- while (I >= 1 && M >= 0);
747
+ while (M >= 1 && I >= 0);
710
748
  break;
711
749
  }
712
750
  }
713
751
  } finally {
714
- ue = !1, ae.current = T, ft(), Error.prepareStackTrace = S;
752
+ le = !1, ue.current = S, dt(), Error.prepareStackTrace = A;
715
753
  }
716
- var H = e ? e.displayName || e.name : "", U = H ? K(H) : "";
717
- return typeof e == "function" && X.set(e, U), U;
754
+ var G = e ? e.displayName || e.name : "", z = G ? X(G) : "";
755
+ return typeof e == "function" && Z.set(e, z), z;
718
756
  }
719
- function pt(e, n, i) {
720
- return Me(e, !1);
757
+ function ht(e, o, a) {
758
+ return Ne(e, !1);
721
759
  }
722
- function ht(e) {
723
- var n = e.prototype;
724
- return !!(n && n.isReactComponent);
760
+ function gt(e) {
761
+ var o = e.prototype;
762
+ return !!(o && o.isReactComponent);
725
763
  }
726
- function Z(e, n, i) {
764
+ function Q(e, o, a) {
727
765
  if (e == null)
728
766
  return "";
729
767
  if (typeof e == "function")
730
- return Me(e, ht(e));
768
+ return Ne(e, gt(e));
731
769
  if (typeof e == "string")
732
- return K(e);
770
+ return X(e);
733
771
  switch (e) {
734
- case E:
735
- return K("Suspense");
736
- case l:
737
- return K("SuspenseList");
772
+ case y:
773
+ return X("Suspense");
774
+ case f:
775
+ return X("SuspenseList");
738
776
  }
739
777
  if (typeof e == "object")
740
778
  switch (e.$$typeof) {
741
- case f:
742
- return pt(e.render);
743
- case m:
744
- return Z(e.type, n, i);
745
- case c: {
746
- var h = e, S = h._payload, T = h._init;
779
+ case l:
780
+ return ht(e.render);
781
+ case h:
782
+ return Q(e.type, o, a);
783
+ case u: {
784
+ var d = e, A = d._payload, S = d._init;
747
785
  try {
748
- return Z(T(S), n, i);
786
+ return Q(S(A), o, a);
749
787
  } catch {
750
788
  }
751
789
  }
752
790
  }
753
791
  return "";
754
792
  }
755
- var G = Object.prototype.hasOwnProperty, Ne = {}, je = b.ReactDebugCurrentFrame;
756
- function Q(e) {
793
+ var J = Object.prototype.hasOwnProperty, je = {}, Oe = x.ReactDebugCurrentFrame;
794
+ function ee(e) {
757
795
  if (e) {
758
- var n = e._owner, i = Z(e.type, e._source, n ? n.type : null);
759
- je.setExtraStackFrame(i);
796
+ var o = e._owner, a = Q(e.type, e._source, o ? o.type : null);
797
+ Oe.setExtraStackFrame(a);
760
798
  } else
761
- je.setExtraStackFrame(null);
799
+ Oe.setExtraStackFrame(null);
762
800
  }
763
- function gt(e, n, i, h, S) {
801
+ function mt(e, o, a, d, A) {
764
802
  {
765
- var T = Function.call.bind(G);
766
- for (var y in e)
767
- if (T(e, y)) {
768
- var v = void 0;
803
+ var S = Function.call.bind(J);
804
+ for (var b in e)
805
+ if (S(e, b)) {
806
+ var w = void 0;
769
807
  try {
770
- if (typeof e[y] != "function") {
771
- var j = Error((h || "React class") + ": " + i + " type `" + y + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[y] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
772
- throw j.name = "Invariant Violation", j;
808
+ if (typeof e[b] != "function") {
809
+ var P = Error((d || "React class") + ": " + a + " type `" + b + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[b] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
810
+ throw P.name = "Invariant Violation", P;
773
811
  }
774
- v = e[y](n, y, h, i, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
775
- } catch (I) {
776
- v = I;
812
+ w = e[b](o, b, d, a, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
813
+ } catch (M) {
814
+ w = M;
777
815
  }
778
- v && !(v instanceof Error) && (Q(S), p("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", h || "React class", i, y, typeof v), Q(null)), v instanceof Error && !(v.message in Ne) && (Ne[v.message] = !0, Q(S), p("Failed %s type: %s", i, v.message), Q(null));
816
+ w && !(w instanceof Error) && (ee(A), _("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", d || "React class", a, b, typeof w), ee(null)), w instanceof Error && !(w.message in je) && (je[w.message] = !0, ee(A), _("Failed %s type: %s", a, w.message), ee(null));
779
817
  }
780
818
  }
781
819
  }
782
- var mt = Array.isArray;
783
- function ce(e) {
784
- return mt(e);
820
+ var _t = Array.isArray;
821
+ function fe(e) {
822
+ return _t(e);
785
823
  }
786
- function _t(e) {
824
+ function vt(e) {
787
825
  {
788
- var n = typeof Symbol == "function" && Symbol.toStringTag, i = n && e[Symbol.toStringTag] || e.constructor.name || "Object";
789
- return i;
826
+ var o = typeof Symbol == "function" && Symbol.toStringTag, a = o && e[Symbol.toStringTag] || e.constructor.name || "Object";
827
+ return a;
790
828
  }
791
829
  }
792
- function vt(e) {
830
+ function yt(e) {
793
831
  try {
794
- return Oe(e), !1;
832
+ return Pe(e), !1;
795
833
  } catch {
796
834
  return !0;
797
835
  }
798
836
  }
799
- function Oe(e) {
837
+ function Pe(e) {
800
838
  return "" + e;
801
839
  }
802
- function Pe(e) {
803
- if (vt(e))
804
- return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", _t(e)), Oe(e);
840
+ function Fe(e) {
841
+ if (yt(e))
842
+ return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", vt(e)), Pe(e);
805
843
  }
806
- var Fe = b.ReactCurrentOwner, Et = {
844
+ var De = x.ReactCurrentOwner, Et = {
807
845
  key: !0,
808
846
  ref: !0,
809
847
  __self: !0,
810
848
  __source: !0
811
- }, De, $e;
812
- function yt(e) {
813
- if (G.call(e, "ref")) {
814
- var n = Object.getOwnPropertyDescriptor(e, "ref").get;
815
- if (n && n.isReactWarning)
849
+ }, $e, Le;
850
+ function wt(e) {
851
+ if (J.call(e, "ref")) {
852
+ var o = Object.getOwnPropertyDescriptor(e, "ref").get;
853
+ if (o && o.isReactWarning)
816
854
  return !1;
817
855
  }
818
856
  return e.ref !== void 0;
819
857
  }
820
- function wt(e) {
821
- if (G.call(e, "key")) {
822
- var n = Object.getOwnPropertyDescriptor(e, "key").get;
823
- if (n && n.isReactWarning)
858
+ function bt(e) {
859
+ if (J.call(e, "key")) {
860
+ var o = Object.getOwnPropertyDescriptor(e, "key").get;
861
+ if (o && o.isReactWarning)
824
862
  return !1;
825
863
  }
826
864
  return e.key !== void 0;
827
865
  }
828
- function bt(e, n) {
829
- typeof e.ref == "string" && Fe.current;
866
+ function xt(e, o) {
867
+ typeof e.ref == "string" && De.current;
830
868
  }
831
- function xt(e, n) {
869
+ function At(e, o) {
832
870
  {
833
- var i = function() {
834
- De || (De = !0, p("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n));
871
+ var a = function() {
872
+ $e || ($e = !0, _("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", o));
835
873
  };
836
- i.isReactWarning = !0, Object.defineProperty(e, "key", {
837
- get: i,
874
+ a.isReactWarning = !0, Object.defineProperty(e, "key", {
875
+ get: a,
838
876
  configurable: !0
839
877
  });
840
878
  }
841
879
  }
842
- function St(e, n) {
880
+ function St(e, o) {
843
881
  {
844
- var i = function() {
845
- $e || ($e = !0, p("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n));
882
+ var a = function() {
883
+ Le || (Le = !0, _("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", o));
846
884
  };
847
- i.isReactWarning = !0, Object.defineProperty(e, "ref", {
848
- get: i,
885
+ a.isReactWarning = !0, Object.defineProperty(e, "ref", {
886
+ get: a,
849
887
  configurable: !0
850
888
  });
851
889
  }
852
890
  }
853
- var At = function(e, n, i, h, S, T, y) {
854
- var v = {
891
+ var Rt = function(e, o, a, d, A, S, b) {
892
+ var w = {
855
893
  // This tag allows us to uniquely identify this as a React Element
856
894
  $$typeof: r,
857
895
  // Built-in properties that belong on the element
858
896
  type: e,
859
- key: n,
860
- ref: i,
861
- props: y,
897
+ key: o,
898
+ ref: a,
899
+ props: b,
862
900
  // Record the component responsible for creating this element.
863
- _owner: T
901
+ _owner: S
864
902
  };
865
- return v._store = {}, Object.defineProperty(v._store, "validated", {
903
+ return w._store = {}, Object.defineProperty(w._store, "validated", {
866
904
  configurable: !1,
867
905
  enumerable: !1,
868
906
  writable: !0,
869
907
  value: !1
870
- }), Object.defineProperty(v, "_self", {
908
+ }), Object.defineProperty(w, "_self", {
871
909
  configurable: !1,
872
910
  enumerable: !1,
873
911
  writable: !1,
874
- value: h
875
- }), Object.defineProperty(v, "_source", {
912
+ value: d
913
+ }), Object.defineProperty(w, "_source", {
876
914
  configurable: !1,
877
915
  enumerable: !1,
878
916
  writable: !1,
879
- value: S
880
- }), Object.freeze && (Object.freeze(v.props), Object.freeze(v)), v;
917
+ value: A
918
+ }), Object.freeze && (Object.freeze(w.props), Object.freeze(w)), w;
881
919
  };
882
- function Tt(e, n, i, h, S) {
920
+ function Tt(e, o, a, d, A) {
883
921
  {
884
- var T, y = {}, v = null, j = null;
885
- i !== void 0 && (Pe(i), v = "" + i), wt(n) && (Pe(n.key), v = "" + n.key), yt(n) && (j = n.ref, bt(n, S));
886
- for (T in n)
887
- G.call(n, T) && !Et.hasOwnProperty(T) && (y[T] = n[T]);
922
+ var S, b = {}, w = null, P = null;
923
+ a !== void 0 && (Fe(a), w = "" + a), bt(o) && (Fe(o.key), w = "" + o.key), wt(o) && (P = o.ref, xt(o, A));
924
+ for (S in o)
925
+ J.call(o, S) && !Et.hasOwnProperty(S) && (b[S] = o[S]);
888
926
  if (e && e.defaultProps) {
889
- var I = e.defaultProps;
890
- for (T in I)
891
- y[T] === void 0 && (y[T] = I[T]);
927
+ var M = e.defaultProps;
928
+ for (S in M)
929
+ b[S] === void 0 && (b[S] = M[S]);
892
930
  }
893
- if (v || j) {
894
- var M = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
895
- v && xt(y, M), j && St(y, M);
931
+ if (w || P) {
932
+ var I = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
933
+ w && At(b, I), P && St(b, I);
896
934
  }
897
- return At(e, v, j, S, h, Fe.current, y);
935
+ return Rt(e, w, P, A, d, De.current, b);
898
936
  }
899
937
  }
900
- var le = b.ReactCurrentOwner, Le = b.ReactDebugCurrentFrame;
901
- function B(e) {
938
+ var de = x.ReactCurrentOwner, Ue = x.ReactDebugCurrentFrame;
939
+ function H(e) {
902
940
  if (e) {
903
- var n = e._owner, i = Z(e.type, e._source, n ? n.type : null);
904
- Le.setExtraStackFrame(i);
941
+ var o = e._owner, a = Q(e.type, e._source, o ? o.type : null);
942
+ Ue.setExtraStackFrame(a);
905
943
  } else
906
- Le.setExtraStackFrame(null);
944
+ Ue.setExtraStackFrame(null);
907
945
  }
908
- var fe;
909
- fe = !1;
910
- function de(e) {
946
+ var pe;
947
+ pe = !1;
948
+ function he(e) {
911
949
  return typeof e == "object" && e !== null && e.$$typeof === r;
912
950
  }
913
- function Ue() {
951
+ function Ve() {
914
952
  {
915
- if (le.current) {
916
- var e = $(le.current.type);
953
+ if (de.current) {
954
+ var e = U(de.current.type);
917
955
  if (e)
918
956
  return `
919
957
 
@@ -922,161 +960,161 @@ Check the render method of \`` + e + "`.";
922
960
  return "";
923
961
  }
924
962
  }
925
- function Rt(e) {
963
+ function Ct(e) {
926
964
  return "";
927
965
  }
928
- var Ve = {};
929
- function Ct(e) {
966
+ var Be = {};
967
+ function kt(e) {
930
968
  {
931
- var n = Ue();
932
- if (!n) {
933
- var i = typeof e == "string" ? e : e.displayName || e.name;
934
- i && (n = `
969
+ var o = Ve();
970
+ if (!o) {
971
+ var a = typeof e == "string" ? e : e.displayName || e.name;
972
+ a && (o = `
935
973
 
936
- Check the top-level render call using <` + i + ">.");
974
+ Check the top-level render call using <` + a + ">.");
937
975
  }
938
- return n;
976
+ return o;
939
977
  }
940
978
  }
941
- function Be(e, n) {
979
+ function We(e, o) {
942
980
  {
943
981
  if (!e._store || e._store.validated || e.key != null)
944
982
  return;
945
983
  e._store.validated = !0;
946
- var i = Ct(n);
947
- if (Ve[i])
984
+ var a = kt(o);
985
+ if (Be[a])
948
986
  return;
949
- Ve[i] = !0;
950
- var h = "";
951
- e && e._owner && e._owner !== le.current && (h = " It was passed a child from " + $(e._owner.type) + "."), B(e), p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', i, h), B(null);
987
+ Be[a] = !0;
988
+ var d = "";
989
+ e && e._owner && e._owner !== de.current && (d = " It was passed a child from " + U(e._owner.type) + "."), H(e), _('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', a, d), H(null);
952
990
  }
953
991
  }
954
- function He(e, n) {
992
+ function ze(e, o) {
955
993
  {
956
994
  if (typeof e != "object")
957
995
  return;
958
- if (ce(e))
959
- for (var i = 0; i < e.length; i++) {
960
- var h = e[i];
961
- de(h) && Be(h, n);
996
+ if (fe(e))
997
+ for (var a = 0; a < e.length; a++) {
998
+ var d = e[a];
999
+ he(d) && We(d, o);
962
1000
  }
963
- else if (de(e))
1001
+ else if (he(e))
964
1002
  e._store && (e._store.validated = !0);
965
1003
  else if (e) {
966
- var S = C(e);
967
- if (typeof S == "function" && S !== e.entries)
968
- for (var T = S.call(e), y; !(y = T.next()).done; )
969
- de(y.value) && Be(y.value, n);
1004
+ var A = T(e);
1005
+ if (typeof A == "function" && A !== e.entries)
1006
+ for (var S = A.call(e), b; !(b = S.next()).done; )
1007
+ he(b.value) && We(b.value, o);
970
1008
  }
971
1009
  }
972
1010
  }
973
- function It(e) {
1011
+ function Mt(e) {
974
1012
  {
975
- var n = e.type;
976
- if (n == null || typeof n == "string")
1013
+ var o = e.type;
1014
+ if (o == null || typeof o == "string")
977
1015
  return;
978
- var i;
979
- if (typeof n == "function")
980
- i = n.propTypes;
981
- else if (typeof n == "object" && (n.$$typeof === f || // Note: Memo only checks outer props here.
1016
+ var a;
1017
+ if (typeof o == "function")
1018
+ a = o.propTypes;
1019
+ else if (typeof o == "object" && (o.$$typeof === l || // Note: Memo only checks outer props here.
982
1020
  // Inner props are checked in the reconciler.
983
- n.$$typeof === m))
984
- i = n.propTypes;
1021
+ o.$$typeof === h))
1022
+ a = o.propTypes;
985
1023
  else
986
1024
  return;
987
- if (i) {
988
- var h = $(n);
989
- gt(i, e.props, "prop", h, e);
990
- } else if (n.PropTypes !== void 0 && !fe) {
991
- fe = !0;
992
- var S = $(n);
993
- p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", S || "Unknown");
1025
+ if (a) {
1026
+ var d = U(o);
1027
+ mt(a, e.props, "prop", d, e);
1028
+ } else if (o.PropTypes !== void 0 && !pe) {
1029
+ pe = !0;
1030
+ var A = U(o);
1031
+ _("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", A || "Unknown");
994
1032
  }
995
- typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved && p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
1033
+ typeof o.getDefaultProps == "function" && !o.getDefaultProps.isReactClassApproved && _("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
996
1034
  }
997
1035
  }
998
- function kt(e) {
1036
+ function It(e) {
999
1037
  {
1000
- for (var n = Object.keys(e.props), i = 0; i < n.length; i++) {
1001
- var h = n[i];
1002
- if (h !== "children" && h !== "key") {
1003
- B(e), p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", h), B(null);
1038
+ for (var o = Object.keys(e.props), a = 0; a < o.length; a++) {
1039
+ var d = o[a];
1040
+ if (d !== "children" && d !== "key") {
1041
+ H(e), _("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", d), H(null);
1004
1042
  break;
1005
1043
  }
1006
1044
  }
1007
- e.ref !== null && (B(e), p("Invalid attribute `ref` supplied to `React.Fragment`."), B(null));
1045
+ e.ref !== null && (H(e), _("Invalid attribute `ref` supplied to `React.Fragment`."), H(null));
1008
1046
  }
1009
1047
  }
1010
- var ze = {};
1011
- function We(e, n, i, h, S, T) {
1048
+ var He = {};
1049
+ function Ge(e, o, a, d, A, S) {
1012
1050
  {
1013
- var y = ut(e);
1014
- if (!y) {
1015
- var v = "";
1016
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (v += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
1017
- var j = Rt();
1018
- j ? v += j : v += Ue();
1019
- var I;
1020
- e === null ? I = "null" : ce(e) ? I = "array" : e !== void 0 && e.$$typeof === r ? (I = "<" + ($(e.type) || "Unknown") + " />", v = " Did you accidentally export a JSX literal instead of a component?") : I = typeof e, p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", I, v);
1051
+ var b = ct(e);
1052
+ if (!b) {
1053
+ var w = "";
1054
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (w += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
1055
+ var P = Ct();
1056
+ P ? w += P : w += Ve();
1057
+ var M;
1058
+ e === null ? M = "null" : fe(e) ? M = "array" : e !== void 0 && e.$$typeof === r ? (M = "<" + (U(e.type) || "Unknown") + " />", w = " Did you accidentally export a JSX literal instead of a component?") : M = typeof e, _("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", M, w);
1021
1059
  }
1022
- var M = Tt(e, n, i, S, T);
1023
- if (M == null)
1024
- return M;
1025
- if (y) {
1026
- var F = n.children;
1027
- if (F !== void 0)
1028
- if (h)
1029
- if (ce(F)) {
1030
- for (var H = 0; H < F.length; H++)
1031
- He(F[H], e);
1032
- Object.freeze && Object.freeze(F);
1060
+ var I = Tt(e, o, a, A, S);
1061
+ if (I == null)
1062
+ return I;
1063
+ if (b) {
1064
+ var D = o.children;
1065
+ if (D !== void 0)
1066
+ if (d)
1067
+ if (fe(D)) {
1068
+ for (var G = 0; G < D.length; G++)
1069
+ ze(D[G], e);
1070
+ Object.freeze && Object.freeze(D);
1033
1071
  } else
1034
- p("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
1072
+ _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
1035
1073
  else
1036
- He(F, e);
1074
+ ze(D, e);
1037
1075
  }
1038
- if (G.call(n, "key")) {
1039
- var U = $(e), O = Object.keys(n).filter(function(Ft) {
1040
- return Ft !== "key";
1041
- }), pe = O.length > 0 ? "{key: someKey, " + O.join(": ..., ") + ": ...}" : "{key: someKey}";
1042
- if (!ze[U + pe]) {
1043
- var Pt = O.length > 0 ? "{" + O.join(": ..., ") + ": ...}" : "{}";
1044
- p(`A props object containing a "key" prop is being spread into JSX:
1076
+ if (J.call(o, "key")) {
1077
+ var z = U(e), F = Object.keys(o).filter(function(Dt) {
1078
+ return Dt !== "key";
1079
+ }), ge = F.length > 0 ? "{key: someKey, " + F.join(": ..., ") + ": ...}" : "{key: someKey}";
1080
+ if (!He[z + ge]) {
1081
+ var Ft = F.length > 0 ? "{" + F.join(": ..., ") + ": ...}" : "{}";
1082
+ _(`A props object containing a "key" prop is being spread into JSX:
1045
1083
  let props = %s;
1046
1084
  <%s {...props} />
1047
1085
  React keys must be passed directly to JSX without using spread:
1048
1086
  let props = %s;
1049
- <%s key={someKey} {...props} />`, pe, U, Pt, U), ze[U + pe] = !0;
1087
+ <%s key={someKey} {...props} />`, ge, z, Ft, z), He[z + ge] = !0;
1050
1088
  }
1051
1089
  }
1052
- return e === u ? kt(M) : It(M), M;
1090
+ return e === i ? It(I) : Mt(I), I;
1053
1091
  }
1054
1092
  }
1055
- function Mt(e, n, i) {
1056
- return We(e, n, i, !0);
1093
+ function Nt(e, o, a) {
1094
+ return Ge(e, o, a, !0);
1057
1095
  }
1058
- function Nt(e, n, i) {
1059
- return We(e, n, i, !1);
1096
+ function jt(e, o, a) {
1097
+ return Ge(e, o, a, !1);
1060
1098
  }
1061
- var jt = Nt, Ot = Mt;
1062
- J.Fragment = u, J.jsx = jt, J.jsxs = Ot;
1063
- })()), J;
1099
+ var Ot = jt, Pt = Nt;
1100
+ K.Fragment = i, K.jsx = Ot, K.jsxs = Pt;
1101
+ })()), K;
1064
1102
  }
1065
- var Xe;
1066
- function Jt() {
1067
- return Xe || (Xe = 1, process.env.NODE_ENV === "production" ? te.exports = Gt() : te.exports = Yt()), te.exports;
1103
+ var Ze;
1104
+ function Xt() {
1105
+ return Ze || (Ze = 1, process.env.NODE_ENV === "production" ? re.exports = qt() : re.exports = Kt()), re.exports;
1068
1106
  }
1069
- var g = Jt();
1070
- const et = "platform-kit", qt = !1, me = {
1107
+ var g = Xt();
1108
+ const rt = "platform-kit", Zt = !1, _e = {
1071
1109
  log: (...t) => {
1072
1110
  },
1073
1111
  warn: (...t) => {
1074
1112
  },
1075
1113
  error: (...t) => {
1076
- console.error(`[${et}]`, ...t);
1114
+ console.error(`[${rt}]`, ...t);
1077
1115
  }
1078
1116
  };
1079
- class dr extends $t {
1117
+ class Er extends $t {
1080
1118
  hasDispatched = !1;
1081
1119
  constructor(r) {
1082
1120
  super(r), this.state = { hasError: !1 };
@@ -1090,7 +1128,7 @@ class dr extends $t {
1090
1128
  const r = window;
1091
1129
  if (r.__MF_NAME__) return r.__MF_NAME__;
1092
1130
  }
1093
- return et;
1131
+ return rt;
1094
1132
  }
1095
1133
  /**
1096
1134
  * Определить нужно ли показывать детали ошибки
@@ -1102,35 +1140,35 @@ class dr extends $t {
1102
1140
  try {
1103
1141
  const r = sessionStorage.getItem("config");
1104
1142
  if (r) {
1105
- const o = JSON.parse(r);
1106
- if (o.showErrorDetails !== void 0)
1107
- return o.showErrorDetails;
1143
+ const s = JSON.parse(r);
1144
+ if (s.showErrorDetails !== void 0)
1145
+ return s.showErrorDetails;
1108
1146
  }
1109
1147
  } catch {
1110
1148
  }
1111
- return qt;
1149
+ return Zt;
1112
1150
  }
1113
1151
  /**
1114
1152
  * Dispatch ошибки в shell
1115
1153
  */
1116
- dispatchError(r, o) {
1154
+ dispatchError(r, s) {
1117
1155
  if (this.hasDispatched || typeof window > "u") return;
1118
1156
  this.hasDispatched = !0;
1119
- const u = this.getMfeName();
1120
- me.error("ErrorBoundary caught:", r);
1157
+ const i = this.getMfeName();
1158
+ _e.error("ErrorBoundary caught:", r);
1121
1159
  try {
1122
1160
  window.dispatchEvent(new CustomEvent("mfe-error", {
1123
1161
  detail: {
1124
- mfeName: u,
1162
+ mfeName: i,
1125
1163
  error: r.message || String(r),
1126
1164
  stack: r.stack,
1127
- componentStack: o?.componentStack,
1165
+ componentStack: s?.componentStack,
1128
1166
  timestamp: Date.now()
1129
1167
  },
1130
1168
  bubbles: !0
1131
1169
  }));
1132
- } catch (a) {
1133
- me.error("Failed to dispatch mfe-error event:", a);
1170
+ } catch (c) {
1171
+ _e.error("Failed to dispatch mfe-error event:", c);
1134
1172
  }
1135
1173
  }
1136
1174
  /**
@@ -1142,8 +1180,8 @@ class dr extends $t {
1142
1180
  /**
1143
1181
  * Обработать ошибку
1144
1182
  */
1145
- componentDidCatch(r, o) {
1146
- this.dispatchError(r, o), me.error("Error info:", o.componentStack);
1183
+ componentDidCatch(r, s) {
1184
+ this.dispatchError(r, s), _e.error("Error info:", s.componentStack);
1147
1185
  }
1148
1186
  /**
1149
1187
  * Копировать ошибку в буфер обмена
@@ -1175,7 +1213,7 @@ ${this.state.error?.stack}`;
1175
1213
  */
1176
1214
  render() {
1177
1215
  if (this.state.hasError) {
1178
- const r = this.state.error?.message || "Unknown error", o = this.state.error?.stack || "", u = this.shouldShowDetails(), a = this.getMfeName();
1216
+ const r = this.state.error?.message || "Unknown error", s = this.state.error?.stack || "", i = this.shouldShowDetails(), c = this.getMfeName();
1179
1217
  return /* @__PURE__ */ g.jsxs("div", { style: {
1180
1218
  padding: "20px",
1181
1219
  textAlign: "center",
@@ -1188,10 +1226,10 @@ ${this.state.error?.stack}`;
1188
1226
  }, children: [
1189
1227
  /* @__PURE__ */ g.jsxs("h2", { style: { fontSize: "16px", margin: "0 0 8px 0" }, children: [
1190
1228
  "⚠️ Ошибка в ",
1191
- a
1229
+ c
1192
1230
  ] }),
1193
1231
  /* @__PURE__ */ g.jsx("p", { style: { fontSize: "12px", margin: 0 }, children: "Произошла ошибка в микрофронтенде. Сообщение отправлено в shell." }),
1194
- u && /* @__PURE__ */ g.jsxs("details", { style: {
1232
+ i && /* @__PURE__ */ g.jsxs("details", { style: {
1195
1233
  whiteSpace: "pre-wrap",
1196
1234
  textAlign: "left",
1197
1235
  marginTop: "10px",
@@ -1210,9 +1248,9 @@ ${this.state.error?.stack}`;
1210
1248
  borderRadius: "4px"
1211
1249
  }, children: [
1212
1250
  r,
1213
- o && `
1251
+ s && `
1214
1252
 
1215
- ${o}`
1253
+ ${s}`
1216
1254
  ] })
1217
1255
  ] }),
1218
1256
  /* @__PURE__ */ g.jsxs("div", { style: { marginTop: "12px", display: "flex", gap: "8px", justifyContent: "center" }, children: [
@@ -1267,7 +1305,7 @@ ${o}`
1267
1305
  return this.props.children == null ? null : this.props.children;
1268
1306
  }
1269
1307
  }
1270
- const D = {
1308
+ const $ = {
1271
1309
  info: "ℹ️",
1272
1310
  code: "💻",
1273
1311
  link: "🔗",
@@ -1278,24 +1316,24 @@ const D = {
1278
1316
  tags: "🏷️",
1279
1317
  spreadsheet: "📊"
1280
1318
  };
1281
- function pr({ mfeName: t }) {
1282
- const { data: r, isLoading: o, error: u } = zt({ mfeName: t }), [a, d] = R(!1);
1283
- if (o)
1319
+ function wr({ mfeName: t }) {
1320
+ const { data: r, isLoading: s, error: i } = Gt({ mfeName: t }), [c, p] = R(!1);
1321
+ if (s)
1284
1322
  return /* @__PURE__ */ g.jsxs("span", { className: "text-muted small me-2", children: [
1285
1323
  /* @__PURE__ */ g.jsx("span", { className: "me-1", children: "⏳" }),
1286
1324
  "Загрузка..."
1287
1325
  ] });
1288
- if (u || !r)
1289
- return /* @__PURE__ */ g.jsxs("span", { className: "text-muted small me-2", title: `Ошибка: ${u || "нет данных"}`, children: [
1326
+ if (i || !r)
1327
+ return /* @__PURE__ */ g.jsxs("span", { className: "text-muted small me-2", title: `Ошибка: ${i || "нет данных"}`, children: [
1290
1328
  /* @__PURE__ */ g.jsx("span", { className: "me-1", children: "ℹ️" }),
1291
1329
  "N/A"
1292
1330
  ] });
1293
- const s = r, x = s.BUILD_VERSION || s.IMAGE_VERSION || s.APP_NAME || "N/A", f = [];
1294
- return s.APP_NAME && f.push({ key: "APP_NAME", value: s.APP_NAME, label: "Приложение", icon: D.apps }), s.BUILD_VERSION && f.push({ key: "BUILD_VERSION", value: s.BUILD_VERSION, label: "Версия", icon: D.tags }), s.IMAGE_VERSION && f.push({ key: "IMAGE_VERSION", value: s.IMAGE_VERSION, label: "Образ", icon: D.storage }), s.GIT_COMMIT && f.push({ key: "GIT_COMMIT", value: s.GIT_COMMIT, label: "Commit", icon: D.spreadsheet }), s.GIT_BRANCH && f.push({ key: "GIT_BRANCH", value: s.GIT_BRANCH, label: "Ветка", icon: D.spreadsheet }), s.CI_COMMIT_AUTHOR && f.push({ key: "CI_COMMIT_AUTHOR", value: s.CI_COMMIT_AUTHOR, label: "Автор", icon: D.user }), s.CI_COMMIT_TIMESTAMP && f.push({ key: "CI_COMMIT_TIMESTAMP", value: s.CI_COMMIT_TIMESTAMP, label: "Дата", icon: D.clock }), s.CI_JOB_URL && f.push({ key: "CI_JOB_URL", value: s.CI_JOB_URL, label: "CI Job", icon: D.link }), s.CI_PIPELINE_URL && f.push({ key: "CI_PIPELINE_URL", value: s.CI_PIPELINE_URL, label: "Pipeline", icon: D.link }), s.CI_COMMIT_MESSAGE && (s.CI_COMMIT_MESSAGE.length > 60 ? s.CI_COMMIT_MESSAGE.substring(0, 57) + "" : s.CI_COMMIT_MESSAGE, f.push({ key: "CI_COMMIT_MESSAGE", value: s.CI_COMMIT_MESSAGE, label: "Сообщение", icon: D.code })), /* @__PURE__ */ g.jsxs("div", { style: { display: "inline-block", position: "relative" }, children: [
1331
+ const n = r, m = n.BUILD_VERSION || n.IMAGE_VERSION || n.APP_NAME || "N/A", l = [];
1332
+ return n.APP_NAME && l.push({ key: "APP_NAME", value: n.APP_NAME, label: "Приложение", icon: $.apps }), n.BUILD_VERSION && l.push({ key: "BUILD_VERSION", value: n.BUILD_VERSION, label: "Версия", icon: $.tags }), n.IMAGE_VERSION && l.push({ key: "IMAGE_VERSION", value: n.IMAGE_VERSION, label: "Образ", icon: $.storage }), n.GIT_COMMIT && l.push({ key: "GIT_COMMIT", value: n.GIT_COMMIT, label: "Commit", icon: $.spreadsheet }), n.GIT_BRANCH && l.push({ key: "GIT_BRANCH", value: n.GIT_BRANCH, label: "Ветка", icon: $.spreadsheet }), n.CI_COMMIT_AUTHOR && l.push({ key: "CI_COMMIT_AUTHOR", value: n.CI_COMMIT_AUTHOR, label: "Автор", icon: $.user }), n.CI_COMMIT_TIMESTAMP && l.push({ key: "CI_COMMIT_TIMESTAMP", value: n.CI_COMMIT_TIMESTAMP, label: "Дата", icon: $.clock }), n.CI_JOB_URL && l.push({ key: "CI_JOB_URL", value: n.CI_JOB_URL, label: "CI Job", icon: $.link }), n.CI_PIPELINE_URL && l.push({ key: "CI_PIPELINE_URL", value: n.CI_PIPELINE_URL, label: "Pipeline", icon: $.link }), n.CI_COMMIT_MESSAGE && (n.CI_COMMIT_MESSAGE.length > 60 ? n.CI_COMMIT_MESSAGE.substring(0, 57) + "" : n.CI_COMMIT_MESSAGE, l.push({ key: "CI_COMMIT_MESSAGE", value: n.CI_COMMIT_MESSAGE, label: "Сообщение", icon: $.code })), /* @__PURE__ */ g.jsxs("div", { style: { display: "inline-block", position: "relative" }, children: [
1295
1333
  /* @__PURE__ */ g.jsxs(
1296
1334
  "button",
1297
1335
  {
1298
- onClick: () => d(!a),
1336
+ onClick: () => p(!c),
1299
1337
  style: {
1300
1338
  background: "transparent",
1301
1339
  border: "none",
@@ -1307,12 +1345,12 @@ function pr({ mfeName: t }) {
1307
1345
  },
1308
1346
  title: "Информация о версии",
1309
1347
  children: [
1310
- /* @__PURE__ */ g.jsx("span", { className: "me-1", children: D.info }),
1311
- /* @__PURE__ */ g.jsx("span", { className: "text-dark", children: x })
1348
+ /* @__PURE__ */ g.jsx("span", { className: "me-1", children: $.info }),
1349
+ /* @__PURE__ */ g.jsx("span", { className: "text-dark", children: m })
1312
1350
  ]
1313
1351
  }
1314
1352
  ),
1315
- a && /* @__PURE__ */ g.jsxs(
1353
+ c && /* @__PURE__ */ g.jsxs(
1316
1354
  "div",
1317
1355
  {
1318
1356
  style: {
@@ -1336,41 +1374,41 @@ function pr({ mfeName: t }) {
1336
1374
  display: "flex",
1337
1375
  alignItems: "center"
1338
1376
  }, children: [
1339
- /* @__PURE__ */ g.jsx("span", { className: "me-2", children: D.apps }),
1340
- /* @__PURE__ */ g.jsx("strong", { children: s.APP_NAME || t })
1377
+ /* @__PURE__ */ g.jsx("span", { className: "me-2", children: $.apps }),
1378
+ /* @__PURE__ */ g.jsx("strong", { children: n.APP_NAME || t })
1341
1379
  ] }),
1342
1380
  /* @__PURE__ */ g.jsxs("div", { style: { marginBottom: "12px" }, children: [
1343
1381
  /* @__PURE__ */ g.jsx("span", { className: "text-muted", children: "Версия: " }),
1344
- /* @__PURE__ */ g.jsx("strong", { children: x })
1382
+ /* @__PURE__ */ g.jsx("strong", { children: m })
1345
1383
  ] }),
1346
- f.length > 0 && /* @__PURE__ */ g.jsx("div", { style: { fontSize: "13px" }, children: f.map(({ key: E, value: l, label: m, icon: c }) => {
1347
- const _ = l.length > 40 && (E.includes("URL") || E.includes("MESSAGE")) ? `${l.substring(0, 37)}...` : l;
1384
+ l.length > 0 && /* @__PURE__ */ g.jsx("div", { style: { fontSize: "13px" }, children: l.map(({ key: y, value: f, label: h, icon: u }) => {
1385
+ const E = f.length > 40 && (y.includes("URL") || y.includes("MESSAGE")) ? `${f.substring(0, 37)}...` : f;
1348
1386
  return /* @__PURE__ */ g.jsxs("div", { style: { marginBottom: "8px", display: "flex", alignItems: "flex-start" }, children: [
1349
- /* @__PURE__ */ g.jsx("span", { className: "me-2", style: { flexShrink: 0 }, children: c }),
1387
+ /* @__PURE__ */ g.jsx("span", { className: "me-2", style: { flexShrink: 0 }, children: u }),
1350
1388
  /* @__PURE__ */ g.jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
1351
- /* @__PURE__ */ g.jsx("div", { className: "small text-muted", children: m }),
1389
+ /* @__PURE__ */ g.jsx("div", { className: "small text-muted", children: h }),
1352
1390
  /* @__PURE__ */ g.jsx(
1353
1391
  "div",
1354
1392
  {
1355
1393
  className: "font-monospace small text-truncate",
1356
1394
  style: { maxWidth: "100%" },
1357
- title: l,
1358
- children: E.includes("URL") ? /* @__PURE__ */ g.jsx(
1395
+ title: f,
1396
+ children: y.includes("URL") ? /* @__PURE__ */ g.jsx(
1359
1397
  "a",
1360
1398
  {
1361
- href: l,
1399
+ href: f,
1362
1400
  target: "_blank",
1363
1401
  rel: "noopener noreferrer",
1364
1402
  style: { color: "#007bff" },
1365
- children: _
1403
+ children: E
1366
1404
  }
1367
- ) : _
1405
+ ) : E
1368
1406
  }
1369
1407
  )
1370
1408
  ] })
1371
- ] }, E);
1409
+ ] }, y);
1372
1410
  }) }),
1373
- f.length === 0 && /* @__PURE__ */ g.jsx("div", { className: "text-center text-muted py-2 small", children: "Нет информации о версии" }),
1411
+ l.length === 0 && /* @__PURE__ */ g.jsx("div", { className: "text-center text-muted py-2 small", children: "Нет информации о версии" }),
1374
1412
  /* @__PURE__ */ g.jsx("div", { style: {
1375
1413
  marginTop: "12px",
1376
1414
  paddingTop: "8px",
@@ -1382,7 +1420,7 @@ function pr({ mfeName: t }) {
1382
1420
  /* @__PURE__ */ g.jsx(
1383
1421
  "button",
1384
1422
  {
1385
- onClick: () => d(!1),
1423
+ onClick: () => p(!1),
1386
1424
  style: {
1387
1425
  position: "absolute",
1388
1426
  top: "8px",
@@ -1399,10 +1437,10 @@ function pr({ mfeName: t }) {
1399
1437
  ]
1400
1438
  }
1401
1439
  ),
1402
- a && /* @__PURE__ */ g.jsx(
1440
+ c && /* @__PURE__ */ g.jsx(
1403
1441
  "div",
1404
1442
  {
1405
- onClick: () => d(!1),
1443
+ onClick: () => p(!1),
1406
1444
  style: {
1407
1445
  position: "fixed",
1408
1446
  top: 0,
@@ -1415,61 +1453,61 @@ function pr({ mfeName: t }) {
1415
1453
  )
1416
1454
  ] });
1417
1455
  }
1418
- const _e = "platform-kit", tt = Lt(null);
1419
- function hr({ children: t }) {
1420
- const [r, o] = R([]), u = typeof window < "u" && window.__MF_NAME__ || _e, a = k((c, _, w, N) => ({
1456
+ const ve = "platform-kit", nt = Lt(null);
1457
+ function br({ children: t }) {
1458
+ const [r, s] = R([]), i = typeof window < "u" && window.__MF_NAME__ || ve, c = C((u, E, v, N) => ({
1421
1459
  id: `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
1422
- type: c,
1423
- title: _,
1424
- message: w,
1425
- mfeName: u,
1460
+ type: u,
1461
+ title: E,
1462
+ message: v,
1463
+ mfeName: i,
1426
1464
  timestamp: Date.now(),
1427
1465
  duration: N
1428
- }), [u]), d = k((c) => {
1429
- o((w) => [...w, c].slice(0, 5));
1430
- const _ = c.duration || 5e3;
1431
- _ > 0 && setTimeout(() => {
1432
- o((w) => w.filter((N) => N.id !== c.id));
1433
- }, _);
1434
- }, []), s = k((c) => {
1435
- const _ = a(c.type, c.title, c.message, c.duration);
1436
- d(_), typeof window < "u" && window.dispatchEvent(new CustomEvent("mfe-notification", {
1437
- detail: _,
1466
+ }), [i]), p = C((u) => {
1467
+ s((v) => [...v, u].slice(0, 5));
1468
+ const E = u.duration || 5e3;
1469
+ E > 0 && setTimeout(() => {
1470
+ s((v) => v.filter((N) => N.id !== u.id));
1471
+ }, E);
1472
+ }, []), n = C((u) => {
1473
+ const E = c(u.type, u.title, u.message, u.duration);
1474
+ p(E), typeof window < "u" && window.dispatchEvent(new CustomEvent("mfe-notification", {
1475
+ detail: E,
1438
1476
  bubbles: !0
1439
1477
  }));
1440
- }, [a, d]), x = k((c, _ = "Успешно") => {
1441
- s({ type: "success", title: _, message: c });
1442
- }, [s]), f = k((c, _ = "Ошибка") => {
1443
- s({ type: "error", title: _, message: c });
1444
- }, [s]), E = k((c, _ = "Предупреждение") => {
1445
- s({ type: "warning", title: _, message: c });
1446
- }, [s]), l = k((c, _ = "Информация") => {
1447
- s({ type: "info", title: _, message: c });
1448
- }, [s]), m = k((c) => {
1449
- o((_) => _.filter((w) => w.id !== c));
1478
+ }, [c, p]), m = C((u, E = "Успешно") => {
1479
+ n({ type: "success", title: E, message: u });
1480
+ }, [n]), l = C((u, E = "Ошибка") => {
1481
+ n({ type: "error", title: E, message: u });
1482
+ }, [n]), y = C((u, E = "Предупреждение") => {
1483
+ n({ type: "warning", title: E, message: u });
1484
+ }, [n]), f = C((u, E = "Информация") => {
1485
+ n({ type: "info", title: E, message: u });
1486
+ }, [n]), h = C((u) => {
1487
+ s((E) => E.filter((v) => v.id !== u));
1450
1488
  }, []);
1451
- return V(() => {
1489
+ return B(() => {
1452
1490
  if (typeof window > "u") return;
1453
- const c = (_) => {
1454
- const w = _.detail;
1455
- if (w && w.type && w.title && w.message) {
1491
+ const u = (E) => {
1492
+ const v = E.detail;
1493
+ if (v && v.type && v.title && v.message) {
1456
1494
  const N = {
1457
- ...w,
1495
+ ...v,
1458
1496
  id: `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`
1459
1497
  };
1460
- d(N);
1498
+ p(N);
1461
1499
  }
1462
1500
  };
1463
- return window.addEventListener("mfe-notification", c), () => {
1464
- window.removeEventListener("mfe-notification", c);
1501
+ return window.addEventListener("mfe-notification", u), () => {
1502
+ window.removeEventListener("mfe-notification", u);
1465
1503
  };
1466
- }, [d]), /* @__PURE__ */ g.jsxs(tt.Provider, { value: {
1467
- notify: s,
1468
- notifySuccess: x,
1469
- notifyError: f,
1470
- notifyWarning: E,
1471
- notifyInfo: l,
1472
- removeNotification: m
1504
+ }, [p]), /* @__PURE__ */ g.jsxs(nt.Provider, { value: {
1505
+ notify: n,
1506
+ notifySuccess: m,
1507
+ notifyError: l,
1508
+ notifyWarning: y,
1509
+ notifyInfo: f,
1510
+ removeNotification: h
1473
1511
  }, children: [
1474
1512
  t,
1475
1513
  r.length > 0 && /* @__PURE__ */ g.jsx(
@@ -1487,16 +1525,16 @@ function hr({ children: t }) {
1487
1525
  gap: "8px",
1488
1526
  pointerEvents: "none"
1489
1527
  },
1490
- children: r.map((c) => /* @__PURE__ */ g.jsxs(
1528
+ children: r.map((u) => /* @__PURE__ */ g.jsxs(
1491
1529
  "div",
1492
1530
  {
1493
- className: `notification notification-${c.type}`,
1531
+ className: `notification notification-${u.type}`,
1494
1532
  style: {
1495
1533
  pointerEvents: "auto",
1496
1534
  padding: "12px 16px",
1497
1535
  borderRadius: "8px",
1498
- background: c.type === "success" ? "#d4edda" : c.type === "error" ? "#f8d7da" : c.type === "warning" ? "#fff3cd" : "#d1ecf1",
1499
- color: c.type === "success" ? "#155724" : c.type === "error" ? "#721c24" : c.type === "warning" ? "#856404" : "#0c5460",
1536
+ background: u.type === "success" ? "#d4edda" : u.type === "error" ? "#f8d7da" : u.type === "warning" ? "#fff3cd" : "#d1ecf1",
1537
+ color: u.type === "success" ? "#155724" : u.type === "error" ? "#721c24" : u.type === "warning" ? "#856404" : "#0c5460",
1500
1538
  boxShadow: "0 4px 12px rgba(0,0,0,0.15)",
1501
1539
  display: "flex",
1502
1540
  alignItems: "flex-start",
@@ -1504,14 +1542,14 @@ function hr({ children: t }) {
1504
1542
  },
1505
1543
  children: [
1506
1544
  /* @__PURE__ */ g.jsxs("div", { style: { flex: 1 }, children: [
1507
- /* @__PURE__ */ g.jsx("strong", { style: { display: "block", marginBottom: "4px" }, children: c.title }),
1508
- /* @__PURE__ */ g.jsx("p", { style: { margin: 0, fontSize: "14px" }, children: c.message }),
1509
- /* @__PURE__ */ g.jsx("small", { style: { opacity: 0.7, fontSize: "12px" }, children: c.mfeName })
1545
+ /* @__PURE__ */ g.jsx("strong", { style: { display: "block", marginBottom: "4px" }, children: u.title }),
1546
+ /* @__PURE__ */ g.jsx("p", { style: { margin: 0, fontSize: "14px" }, children: u.message }),
1547
+ /* @__PURE__ */ g.jsx("small", { style: { opacity: 0.7, fontSize: "12px" }, children: u.mfeName })
1510
1548
  ] }),
1511
1549
  /* @__PURE__ */ g.jsx(
1512
1550
  "button",
1513
1551
  {
1514
- onClick: () => m(c.id),
1552
+ onClick: () => h(u.id),
1515
1553
  style: {
1516
1554
  background: "transparent",
1517
1555
  border: "none",
@@ -1525,14 +1563,14 @@ function hr({ children: t }) {
1525
1563
  )
1526
1564
  ]
1527
1565
  },
1528
- c.id
1566
+ u.id
1529
1567
  ))
1530
1568
  }
1531
1569
  )
1532
1570
  ] });
1533
1571
  }
1534
- function gr() {
1535
- const t = Ut(tt);
1572
+ function xr() {
1573
+ const t = Ut(nt);
1536
1574
  return t || {
1537
1575
  notify: () => {
1538
1576
  },
@@ -1548,137 +1586,134 @@ function gr() {
1548
1586
  }
1549
1587
  };
1550
1588
  }
1551
- function mr(t) {
1589
+ function Ar(t) {
1552
1590
  if (typeof window > "u") return;
1553
- const r = window.__MF_NAME__ || _e, o = {
1591
+ const r = window.__MF_NAME__ || ve, s = {
1554
1592
  ...t,
1555
1593
  mfeName: r,
1556
1594
  timestamp: Date.now()
1557
1595
  };
1558
1596
  window.dispatchEvent(new CustomEvent("mfe-notification", {
1559
- detail: o,
1597
+ detail: s,
1560
1598
  bubbles: !0
1561
1599
  }));
1562
1600
  }
1563
- const rt = "platform-kit", q = {
1601
+ const ot = "platform-kit", ne = {
1564
1602
  log: (...t) => {
1565
1603
  },
1566
1604
  warn: (...t) => {
1567
1605
  },
1568
1606
  error: (...t) => {
1569
- console.error(`[${rt}]`, ...t);
1607
+ console.error(`[${ot}]`, ...t);
1570
1608
  },
1571
1609
  info: (...t) => {
1572
1610
  }
1573
1611
  };
1574
- function Kt() {
1575
- if (typeof window > "u")
1576
- return { isAuthenticated: !1 };
1577
- const t = window.__SHELL_AUTH_INSTANCE__;
1578
- if (t)
1579
- return t;
1580
- const r = window.__SHELL_AUTH__;
1581
- return r?.authInstance ? r.authInstance : { isAuthenticated: !1 };
1582
- }
1583
- function Xt() {
1584
- if (typeof window > "u") return;
1585
- const t = window.__SHELL_AUTH_INSTANCE__;
1586
- t?.signinRedirect ? t.signinRedirect().catch((r) => {
1587
- q.error("Failed to redirect to login:", r);
1588
- }) : window.location.href = "/";
1589
- }
1590
- function Zt(t) {
1612
+ function Qt(t) {
1591
1613
  const r = t.response;
1592
- let o = "unknown";
1593
- return r ? r.status === 401 ? o = "unauthorized" : r.status === 403 ? o = "forbidden" : r.status === 404 ? o = "not_found" : r.status >= 500 && (o = "server") : o = "network", {
1614
+ let s = "unknown";
1615
+ return r ? r.status === 401 ? s = "unauthorized" : r.status === 403 ? s = "forbidden" : r.status === 404 ? s = "not_found" : r.status >= 500 && (s = "server") : s = "network", {
1594
1616
  message: r?.data?.message ?? t.message ?? "Unknown error",
1595
1617
  code: r?.data?.code,
1596
1618
  status: r?.status,
1597
- type: o,
1619
+ type: s,
1598
1620
  timestamp: Date.now(),
1599
1621
  url: t.config?.url
1600
1622
  };
1601
1623
  }
1602
- function Qt(t = {}) {
1603
- const r = t.name || rt, o = {
1604
- log: (...a) => q.log(`[API:${r}]`, ...a),
1605
- warn: (...a) => q.warn(`[API:${r}]`, ...a),
1606
- error: (...a) => q.error(`[API:${r}]`, ...a),
1607
- info: (...a) => q.info(`[API:${r}]`, ...a)
1608
- }, u = Vt.create({
1624
+ const er = 3, tr = 1e3;
1625
+ function rr(t) {
1626
+ return !t || t >= 500 || t === 429;
1627
+ }
1628
+ function nr(t) {
1629
+ return new Promise((r) => setTimeout(r, t));
1630
+ }
1631
+ function or(t = {}) {
1632
+ const r = t.name || ot, s = t.retries ?? er, i = t.retryDelay ?? tr, c = {
1633
+ log: (...n) => ne.log(`[API:${r}]`, ...n),
1634
+ warn: (...n) => ne.warn(`[API:${r}]`, ...n),
1635
+ error: (...n) => ne.error(`[API:${r}]`, ...n),
1636
+ info: (...n) => ne.info(`[API:${r}]`, ...n)
1637
+ }, p = Vt.create({
1609
1638
  timeout: t.timeout ?? 1e4,
1610
1639
  baseURL: t.baseURL ?? "",
1611
1640
  headers: {
1612
1641
  "Content-Type": "application/json"
1613
1642
  }
1614
1643
  });
1615
- return u.interceptors.request.use(
1616
- (a) => {
1617
- const d = Kt();
1618
- if (d?.isAuthenticated) {
1619
- const s = d.user?.profile?.access_token;
1620
- s && a.headers && (a.headers.Authorization = `Bearer ${s}`, o.info("Auth token attached"));
1644
+ return p.interceptors.request.use(
1645
+ (n) => {
1646
+ const m = Bt();
1647
+ if (m?.isAuthenticated) {
1648
+ const l = m.user?.profile?.access_token;
1649
+ l && n.headers && (n.headers.Authorization = `Bearer ${l}`, c.info("Auth token attached"));
1621
1650
  } else
1622
- o.info("User not authenticated - request without token");
1623
- return o.log(`${a.method?.toUpperCase()} ${a.url}`), a;
1651
+ c.info("User not authenticated - request without token");
1652
+ return c.log(`${n.method?.toUpperCase()} ${n.url}`), n;
1624
1653
  },
1625
- (a) => (o.error("Request interceptor error:", a.message), Promise.reject(a))
1626
- ), u.interceptors.response.use(
1627
- (a) => (o.log(`Response ${a.status}:`, a.config.url), a),
1628
- (a) => {
1629
- const d = a.response?.status, s = a.config?.url;
1630
- return d === 401 ? (o.warn("401 Unauthorized - triggering re-auth"), Xt()) : d === 403 ? o.warn("403 Forbidden - insufficient permissions") : d === 404 ? o.warn("404 Not found:", s) : d === 429 ? o.warn("429 Rate limited") : d === 500 ? o.error("500 Server error:", s) : a.response ? o.warn(`Error ${d}:`, a.message) : o.error("Network error - backend may be unavailable:", s), Promise.reject(Zt(a));
1654
+ (n) => (c.error("Request interceptor error:", n.message), Promise.reject(n))
1655
+ ), p.interceptors.response.use(
1656
+ (n) => (c.log(`Response ${n.status}:`, n.config.url), n),
1657
+ async (n) => {
1658
+ const m = n.response?.status, l = n.config?.url, y = n.config?._retryCount ?? 0;
1659
+ if (rr(m) && y < s) {
1660
+ const f = n.config;
1661
+ f._retryCount = y + 1;
1662
+ const h = i * Math.pow(2, y);
1663
+ return c.warn(`Retrying (${f._retryCount}/${s}) after ${h}ms:`, l), await nr(h), p.request(f);
1664
+ }
1665
+ return m === 401 ? (c.warn("401 Unauthorized - triggering re-auth"), Wt()) : m === 403 ? c.warn("403 Forbidden - insufficient permissions") : m === 404 ? c.warn("404 Not found:", l) : m === 429 ? c.warn("429 Rate limited") : m === 500 ? c.error("500 Server error:", l) : n.response ? c.warn(`Error ${m}:`, n.message) : c.error("Network error - backend may be unavailable:", l), Promise.reject(Qt(n));
1631
1666
  }
1632
- ), u;
1667
+ ), p;
1633
1668
  }
1634
- const oe = Qt();
1635
- async function _r(t, r, o = oe) {
1636
- const u = await o.get(t, { params: r });
1669
+ const ae = or();
1670
+ async function Sr(t, r, s = ae) {
1671
+ const i = await s.get(t, { params: r });
1637
1672
  return {
1638
- data: u.data,
1639
- status: u.status,
1640
- ok: u.status >= 200 && u.status < 300
1673
+ data: i.data,
1674
+ status: i.status,
1675
+ ok: i.status >= 200 && i.status < 300
1641
1676
  };
1642
1677
  }
1643
- async function vr(t, r, o = oe) {
1644
- const u = await o.post(t, r);
1678
+ async function Rr(t, r, s = ae) {
1679
+ const i = await s.post(t, r);
1645
1680
  return {
1646
- data: u.data,
1647
- status: u.status,
1648
- ok: u.status >= 200 && u.status < 300
1681
+ data: i.data,
1682
+ status: i.status,
1683
+ ok: i.status >= 200 && i.status < 300
1649
1684
  };
1650
1685
  }
1651
- async function Er(t, r, o = oe) {
1652
- const u = await o.put(t, r);
1686
+ async function Tr(t, r, s = ae) {
1687
+ const i = await s.put(t, r);
1653
1688
  return {
1654
- data: u.data,
1655
- status: u.status,
1656
- ok: u.status >= 200 && u.status < 300
1689
+ data: i.data,
1690
+ status: i.status,
1691
+ ok: i.status >= 200 && i.status < 300
1657
1692
  };
1658
1693
  }
1659
- async function yr(t, r = oe) {
1660
- const o = await r.delete(t);
1694
+ async function Cr(t, r = ae) {
1695
+ const s = await r.delete(t);
1661
1696
  return {
1662
- data: o.data,
1663
- status: o.status,
1664
- ok: o.status >= 200 && o.status < 300
1697
+ data: s.data,
1698
+ status: s.status,
1699
+ ok: s.status >= 200 && s.status < 300
1665
1700
  };
1666
1701
  }
1667
- function se(t, r) {
1668
- const o = r?.prefix ? `[${r.prefix}]` : `[${t}]`;
1702
+ function ie(t, r) {
1703
+ const s = r?.prefix ? `[${r.prefix}]` : `[${t}]`;
1669
1704
  return {
1670
- log: (...u) => {
1705
+ log: (...i) => {
1671
1706
  },
1672
- warn: (...u) => {
1707
+ warn: (...i) => {
1673
1708
  },
1674
- error: (...u) => {
1675
- console.error(o, ...u);
1709
+ error: (...i) => {
1710
+ console.error(s, ...i);
1676
1711
  },
1677
- info: (...u) => {
1712
+ info: (...i) => {
1678
1713
  }
1679
1714
  };
1680
1715
  }
1681
- const wr = se("platform-kit", { prefix: "AUTH" }), br = se("platform-kit", { prefix: "API" }), xr = se("platform-kit", { prefix: "ERROR" }), Sr = se("platform-kit", { prefix: "INFO" }), er = {}, tr = {
1716
+ const kr = ie("platform-kit", { prefix: "AUTH" }), Mr = ie("platform-kit", { prefix: "API" }), Ir = ie("platform-kit", { prefix: "ERROR" }), Nr = ie("platform-kit", { prefix: "INFO" }), sr = {}, ar = {
1682
1717
  log: (...t) => {
1683
1718
  },
1684
1719
  warn: (...t) => {
@@ -1690,12 +1725,12 @@ const wr = se("platform-kit", { prefix: "AUTH" }), br = se("platform-kit", { pre
1690
1725
  function Ee(t) {
1691
1726
  return t ? t.mfeName ? t.mfeName : t.name ? t.name.replace("@ib-dop/", "") : null : null;
1692
1727
  }
1693
- function nt() {
1728
+ function st() {
1694
1729
  if (typeof window > "u") return null;
1695
1730
  const t = window;
1696
1731
  return t.__MF_NAME__ ? t.__MF_NAME__ : null;
1697
1732
  }
1698
- function ot() {
1733
+ function at() {
1699
1734
  if (typeof window > "u") return null;
1700
1735
  try {
1701
1736
  const t = sessionStorage.getItem("mf-config");
@@ -1709,76 +1744,81 @@ function ot() {
1709
1744
  }
1710
1745
  return null;
1711
1746
  }
1712
- function ye() {
1713
- const t = er;
1747
+ function we() {
1748
+ const t = sr;
1714
1749
  return t.VITE_MFE_NAME ? String(t.VITE_MFE_NAME) : t.MFE_NAME ? String(t.MFE_NAME) : null;
1715
1750
  }
1716
- let re = null, ve = !1;
1717
- function rr(t, r) {
1718
- const o = Ee(t);
1719
- if (o)
1720
- return o;
1721
- if (ve && re)
1722
- return re;
1723
- const u = [
1724
- { source: "window.__MF_NAME__", value: nt() },
1725
- { source: "sessionStorage.mf-config", value: ot() },
1726
- { source: "import.meta.env.VITE_MFE_NAME", value: ye() }
1751
+ let oe = null, ye = !1;
1752
+ function ir(t, r) {
1753
+ const s = Ee(t);
1754
+ if (s)
1755
+ return s;
1756
+ if (ye && oe)
1757
+ return oe;
1758
+ const i = [
1759
+ { source: "window.__MF_NAME__", value: st() },
1760
+ { source: "sessionStorage.mf-config", value: at() },
1761
+ { source: "import.meta.env.VITE_MFE_NAME", value: we() }
1727
1762
  ];
1728
- for (const { source: d, value: s } of u)
1729
- if (s)
1730
- return re = s, ve = !0, s;
1763
+ for (const { source: p, value: n } of i)
1764
+ if (n)
1765
+ return oe = n, ye = !0, n;
1731
1766
  if (r)
1732
1767
  return r;
1733
- const a = "Cannot determine MFE name. Please pass mfeName in props, set window.__MF_NAME__, sessionStorage.mf-config, or VITE_MFE_NAME";
1734
- throw tr.error(a), new Error(a);
1768
+ const c = "Cannot determine MFE name. Please pass mfeName in props, set window.__MF_NAME__, sessionStorage.mf-config, or VITE_MFE_NAME";
1769
+ throw ar.error(c), new Error(c);
1735
1770
  }
1736
- function Ar(t) {
1737
- return rr(t);
1771
+ function jr(t) {
1772
+ return ir(t);
1738
1773
  }
1739
- function nr(t) {
1740
- return Ee(t) ? "props.mfeName" : nt() ? "window.__MF_NAME__" : ot() ? "sessionStorage.mf-config" : ye() ? "import.meta.env.VITE_MFE_NAME" : null;
1774
+ function ur(t) {
1775
+ return Ee(t) ? "props.mfeName" : st() ? "window.__MF_NAME__" : at() ? "sessionStorage.mf-config" : we() ? "import.meta.env.VITE_MFE_NAME" : null;
1741
1776
  }
1742
- function Tr(t) {
1743
- return nr(t) !== null;
1777
+ function Or(t) {
1778
+ return ur(t) !== null;
1744
1779
  }
1745
- function Rr() {
1746
- re = null, ve = !1;
1780
+ function Pr() {
1781
+ oe = null, ye = !1;
1747
1782
  }
1748
- function Cr(t) {
1783
+ function Fr(t) {
1749
1784
  const r = [];
1750
- return Ee(t) && r.push("props.mfeName"), typeof window < "u" && (window.__MF_NAME__ && r.push("window.__MF_NAME__"), sessionStorage.getItem("mf-config") && r.push("sessionStorage.mf-config")), ye() && r.push("import.meta.env.VITE_MFE_NAME"), r;
1785
+ return Ee(t) && r.push("props.mfeName"), typeof window < "u" && (window.__MF_NAME__ && r.push("window.__MF_NAME__"), sessionStorage.getItem("mf-config") && r.push("sessionStorage.mf-config")), we() && r.push("import.meta.env.VITE_MFE_NAME"), r;
1751
1786
  }
1752
1787
  export {
1753
- dr as ErrorBoundary,
1754
- hr as NotificationProvider,
1755
- pr as VersionInfo,
1756
- oe as api,
1757
- br as apiLogger,
1758
- wr as authLogger,
1759
- Qt as createApiClient,
1760
- se as createMfLogger,
1761
- yr as del,
1762
- mr as dispatchNotification,
1763
- xr as errorLogger,
1764
- _r as get,
1765
- Cr as getAllMfeNameSources,
1766
- he as getAuth,
1767
- rr as getMfeName,
1768
- nr as getMfeNameSource,
1769
- Tr as hasMfeName,
1770
- Sr as infoLogger,
1771
- vr as post,
1772
- Er as put,
1773
- Ar as requireMfeName,
1774
- Rr as resetMfeNameCache,
1775
- ir as useApi,
1776
- lr as useFeatureAdmin,
1777
- cr as useFeatures,
1778
- zt as useInfoData,
1779
- fr as useMicrofrontendsFeatures,
1780
- gr as useNotification,
1781
- ur as usePermissions,
1782
- ne as useShellAuth,
1783
- ar as useV1Config
1788
+ Er as ErrorBoundary,
1789
+ br as NotificationProvider,
1790
+ wr as VersionInfo,
1791
+ ae as api,
1792
+ Mr as apiLogger,
1793
+ kr as authLogger,
1794
+ or as createApiClient,
1795
+ ie as createMfLogger,
1796
+ Cr as del,
1797
+ Ar as dispatchNotification,
1798
+ Ir as errorLogger,
1799
+ Sr as get,
1800
+ fr as getAccessToken,
1801
+ Fr as getAllMfeNameSources,
1802
+ Bt as getAuthState,
1803
+ ir as getMfeName,
1804
+ ur as getMfeNameSource,
1805
+ V as getShellAuth,
1806
+ Or as hasMfeName,
1807
+ Nr as infoLogger,
1808
+ dr as isAuthenticated,
1809
+ pr as logout,
1810
+ Rr as post,
1811
+ Tr as put,
1812
+ Wt as redirectToLogin,
1813
+ jr as requireMfeName,
1814
+ Pr as resetMfeNameCache,
1815
+ gr as useApi,
1816
+ vr as useFeatureAdmin,
1817
+ _r as useFeatures,
1818
+ Gt as useInfoData,
1819
+ yr as useMicrofrontendsFeatures,
1820
+ xr as useNotification,
1821
+ mr as usePermissions,
1822
+ se as useShellAuth,
1823
+ hr as useV1Config
1784
1824
  };