@archbase/security-ui 4.2.6 → 4.3.1

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.js CHANGED
@@ -1,47 +1,47 @@
1
1
  import { jsx as e, jsxs as r, Fragment as xe } from "react/jsx-runtime";
2
- import { Modal as $e, ScrollArea as de, Stack as V, Grid as H, Group as O, Button as X, Paper as re, Box as _, Text as h, List as Me, Checkbox as la, Tooltip as ke, ActionIcon as fe, Flex as Fe, Space as Ra, Input as Te, useTree as ca, useMantineColorScheme as qe, TextInput as ve, Tree as da, Badge as Q, Tabs as Ce, RingProgress as Ka, SimpleGrid as He, Table as S, Drawer as Ja, Loader as le, Alert as ye, Pagination as Xa, CloseButton as Ya, Chip as ua, Popover as Je, UnstyledButton as ze } from "@mantine/core";
3
- import { getI18nextInstance as g, resolveArchbasePasswordPolicy as _a, ARCHBASE_IOC_API_TYPE as K, emit as Ge, builder as De, validateArchbasePassword as er, convertDateToISOString as ar, processErrorMessage as be, getKeyByEnumValue as Se, useArchbaseTheme as oa, useArchbaseValidator as rr, useArchbaseTranslation as tr, useValidationErrors as ir, processDetailErrorMessage as Ve } from "@archbase/core";
4
- import { ArchbaseEdit as se, ArchbaseNotifications as ne, ArchbasePasswordEdit as or, ArchbaseSelect as nr, ArchbaseCheckbox as Ae, ArchbaseAvatarEdit as sr, ArchbaseAsyncSelect as lr, Columns as Ie, ArchbaseDataGridColumn as $, ArchbaseDataGrid as za, ArchbaseDialog as ge } from "@archbase/components";
5
- import { useArchbaseV1V2Compatibility as Ne, useArchbaseDataSourceListener as ha, useArchbaseRemoteServiceApi as J, useArchbaseRemoteDataSource as ta, ArchbaseDataSource as cr, useArchbaseStore as ka, useArchbaseRemoteDataSourceV2 as Ee, useArchbaseDataSource as dr } from "@archbase/data";
6
- import { useState as T, useCallback as ae, useEffect as ee, forwardRef as ur, useMemo as ie, useRef as Re } from "react";
7
- import { IconArrowRight as Ia, IconArrowLeft as Ea, IconChevronDown as pa, IconBorderCornerSquare as ma, IconEye as hr, IconEdit as Pa, IconTrashX as na, IconShieldCheckered as pr, IconPlus as Fa } from "@tabler/icons-react";
8
- import { UserGroupDto as ga, SecurityType as Y, UserDto as mr, GroupDto as gr, ProfileDto as fr, ApiTokenDto as br } from "@archbase/security";
9
- import { DateTimePicker as vr } from "@mantine/dates";
10
- import { useFocusTrap as yr, useDebouncedValue as ia } from "@mantine/hooks";
11
- import { ArchbaseSpaceFixed as wr, ArchbaseSpaceFill as Cr, ArchbaseSpaceBottom as Sr } from "@archbase/layout";
12
- const xr = (a) => {
13
- const t = { ...a.options ?? {} }, n = () => {
14
- a.onCustomSave ? a.onCustomSave(a.dataSource.getCurrentRecord(), (c) => {
15
- c && a.onAfterSave && a.onAfterSave(a.dataSource.getCurrentRecord()), a.onClickOk(a.dataSource.getCurrentRecord(), c);
2
+ import { Modal as $e, ScrollArea as ue, Stack as U, Grid as W, Group as O, Button as X, Paper as re, Box as Y, Text as c, List as Me, Checkbox as ca, Tooltip as Ie, ActionIcon as ye, Flex as Fe, Space as za, Input as Ce, useTree as da, useMantineColorScheme as qe, TextInput as he, Tree as ua, Badge as j, Tabs as we, RingProgress as Xa, SimpleGrid as We, Table as m, Drawer as _a, Loader as se, Alert as ce, Pagination as Ia, CloseButton as Ya, Chip as ha, Popover as Je, UnstyledButton as ze, Select as er } from "@mantine/core";
3
+ import { getI18nextInstance as f, resolveArchbasePasswordPolicy as ar, ARCHBASE_IOC_API_TYPE as K, emit as Ue, builder as Ne, validateArchbasePassword as rr, convertDateToISOString as tr, processErrorMessage as Te, getKeyByEnumValue as Se, useArchbaseTheme as na, useArchbaseValidator as ir, useArchbaseTranslation as or, useValidationErrors as nr, processDetailErrorMessage as Ve } from "@archbase/core";
4
+ import { ArchbaseEdit as le, ArchbaseNotifications as ne, ArchbasePasswordEdit as lr, ArchbaseSelect as sr, ArchbaseCheckbox as Ae, ArchbaseAvatarEdit as cr, ArchbaseAsyncSelect as dr, Columns as Ee, ArchbaseDataGridColumn as L, ArchbaseDataGrid as ka, ArchbaseDialog as ve } from "@archbase/components";
5
+ import { useArchbaseV1V2Compatibility as Oe, useArchbaseDataSourceListener as pa, useArchbaseRemoteServiceApi as J, useArchbaseRemoteDataSource as ia, ArchbaseDataSource as ur, useArchbaseStore as Ea, useArchbaseRemoteDataSourceV2 as Pe, useArchbaseDataSource as hr } from "@archbase/data";
6
+ import { useState as S, useCallback as ae, useEffect as ee, forwardRef as pr, useMemo as ie, useRef as Re } from "react";
7
+ import { IconArrowRight as Pa, IconArrowLeft as Da, IconChevronDown as ma, IconBorderCornerSquare as ga, IconEye as mr, IconEdit as Fa, IconTrashX as la, IconShieldCheckered as gr, IconPlus as Na } from "@tabler/icons-react";
8
+ import { UserGroupDto as fa, SecurityType as _, UserDto as fr, GroupDto as br, ProfileDto as vr, ApiTokenDto as yr } from "@archbase/security";
9
+ import { DateTimePicker as Tr } from "@mantine/dates";
10
+ import { useFocusTrap as wr, useDebouncedValue as oa } from "@mantine/hooks";
11
+ import { ArchbaseSpaceFixed as Sr, ArchbaseSpaceFill as xr, ArchbaseSpaceBottom as Cr } from "@archbase/layout";
12
+ const Ar = (a) => {
13
+ const t = { ...a.options ?? {} }, l = () => {
14
+ a.onCustomSave ? a.onCustomSave(a.dataSource.getCurrentRecord(), (u) => {
15
+ u && a.onAfterSave && a.onAfterSave(a.dataSource.getCurrentRecord()), a.onClickOk(a.dataSource.getCurrentRecord(), u);
16
16
  }) : a.onClickOk(a.dataSource.getCurrentRecord(), !0);
17
- }, s = () => {
17
+ }, n = () => {
18
18
  a.onClickCancel(a.dataSource.getCurrentRecord());
19
19
  };
20
20
  return /* @__PURE__ */ e(
21
21
  $e,
22
22
  {
23
23
  opened: a.opened,
24
- onClose: s,
25
- title: g().t("archbase:Perfil"),
24
+ onClose: n,
25
+ title: f().t("archbase:Perfil"),
26
26
  size: "60%",
27
27
  styles: { content: { maxWidth: 1e3 } },
28
- children: /* @__PURE__ */ e(de, { style: { height: "460px" }, children: /* @__PURE__ */ r(V, { w: "98%", children: [
28
+ children: /* @__PURE__ */ e(ue, { style: { height: "460px" }, children: /* @__PURE__ */ r(U, { w: "98%", children: [
29
29
  t?.customContentBefore && t.customContentBefore(a.dataSource.getCurrentRecord()),
30
- /* @__PURE__ */ r(H, { children: [
31
- /* @__PURE__ */ e(H.Col, { span: { base: 12, md: 12, lg: 12 }, children: /* @__PURE__ */ e(
32
- se,
30
+ /* @__PURE__ */ r(W, { children: [
31
+ /* @__PURE__ */ e(W.Col, { span: { base: 12, md: 12, lg: 12 }, children: /* @__PURE__ */ e(
32
+ le,
33
33
  {
34
- label: `${g().t("archbase:Nome do perfil")}`,
35
- placeholder: `${g().t("archbase:Informe o nome do perfil")}`,
34
+ label: `${f().t("archbase:Nome do perfil")}`,
35
+ placeholder: `${f().t("archbase:Informe o nome do perfil")}`,
36
36
  dataSource: a.dataSource,
37
37
  dataField: "name"
38
38
  }
39
39
  ) }),
40
- /* @__PURE__ */ e(H.Col, { span: { base: 12, md: 12, lg: 12 }, children: /* @__PURE__ */ e(
41
- se,
40
+ /* @__PURE__ */ e(W.Col, { span: { base: 12, md: 12, lg: 12 }, children: /* @__PURE__ */ e(
41
+ le,
42
42
  {
43
- label: `${g().t("archbase:Descrição do perfil")}`,
44
- placeholder: `${g().t("archbase:Informe a descrição do perfil")}`,
43
+ label: `${f().t("archbase:Descrição do perfil")}`,
44
+ placeholder: `${f().t("archbase:Informe a descrição do perfil")}`,
45
45
  dataSource: a.dataSource,
46
46
  dataField: "description"
47
47
  }
@@ -49,71 +49,71 @@ const xr = (a) => {
49
49
  ] }),
50
50
  t?.customContentAfter && t.customContentAfter(a.dataSource.getCurrentRecord()),
51
51
  /* @__PURE__ */ r(O, { justify: "flex-end", mt: "md", children: [
52
- /* @__PURE__ */ e(X, { variant: "default", onClick: s, children: g().t("archbase:Cancelar") }),
53
- /* @__PURE__ */ e(X, { onClick: n, children: g().t("archbase:Salvar") })
52
+ /* @__PURE__ */ e(X, { variant: "default", onClick: n, children: f().t("archbase:Cancelar") }),
53
+ /* @__PURE__ */ e(X, { onClick: l, children: f().t("archbase:Salvar") })
54
54
  ] })
55
55
  ] }) })
56
56
  }
57
57
  );
58
58
  };
59
- function Tr({
59
+ function Rr({
60
60
  availableItemsDS: a,
61
61
  assignedItemsDS: t,
62
- idFieldAvailable: n,
63
- labelFieldAvailable: s,
64
- idFieldAssigned: c,
62
+ idFieldAvailable: l,
63
+ labelFieldAvailable: n,
64
+ idFieldAssigned: u,
65
65
  labelFieldAssigned: d,
66
- handleCreateAssociationObject: u,
67
- width: x = "400px",
68
- height: R = "200px",
69
- titleAvailable: m = "Disponíveis",
70
- titleAssigned: v = "Selecionados"
66
+ handleCreateAssociationObject: h,
67
+ width: A = "400px",
68
+ height: z = "200px",
69
+ titleAvailable: g = "Disponíveis",
70
+ titleAssigned: T = "Selecionados"
71
71
  }) {
72
- Ne(
72
+ Oe(
73
73
  "ArchbaseDualListSelector-Available",
74
74
  a,
75
75
  void 0,
76
76
  []
77
77
  );
78
- const A = Ne(
78
+ const R = Oe(
79
79
  "ArchbaseDualListSelector-Assigned",
80
80
  t,
81
81
  void 0,
82
82
  []
83
- ), [y, P] = T([]), [f, w] = T([]), [o, l] = T([]), [p, b] = T([]), L = ae(() => {
84
- a && P(a.browseRecords()), t && w(t.browseRecords());
83
+ ), [x, D] = S([]), [b, w] = S([]), [o, s] = S([]), [p, v] = S([]), $ = ae(() => {
84
+ a && D(a.browseRecords()), t && w(t.browseRecords());
85
85
  }, [a, t]);
86
- ha({
86
+ pa({
87
87
  dataSource: a,
88
- listener: () => L()
89
- }), ha({
88
+ listener: () => $()
89
+ }), pa({
90
90
  dataSource: t,
91
- listener: () => L()
91
+ listener: () => $()
92
92
  }), ee(() => {
93
- L();
94
- }, [L]);
95
- const E = (D, C) => typeof C == "function" ? C(D) : D[C], i = (D, C) => typeof C == "function" ? C(D) : D[C], N = (D, C) => {
96
- D((z) => z.includes(C) ? z.filter((oe) => oe !== C) : [...z, C]);
97
- }, F = () => {
98
- o.forEach((D) => {
99
- const C = y.find((z) => E(z, n) === D);
93
+ $();
94
+ }, [$]);
95
+ const y = (F, C) => typeof C == "function" ? C(F) : F[C], i = (F, C) => typeof C == "function" ? C(F) : F[C], N = (F, C) => {
96
+ F((k) => k.includes(C) ? k.filter((oe) => oe !== C) : [...k, C]);
97
+ }, I = () => {
98
+ o.forEach((F) => {
99
+ const C = x.find((k) => y(k, l) === F);
100
100
  if (C) {
101
- const z = u(C);
102
- A.isDataSourceV2 ? (t.insert(z), t.save()) : (t.insert(z), t.save(), A.v1State.forceUpdate());
101
+ const k = h(C);
102
+ R.isDataSourceV2 ? (t.insert(k), t.save()) : (t.insert(k), t.save(), R.v1State.forceUpdate());
103
103
  }
104
- }), l([]);
105
- }, G = () => {
106
- p.forEach((D) => {
107
- const C = f.find((z) => E(z, c) === D);
104
+ }), s([]);
105
+ }, M = () => {
106
+ p.forEach((F) => {
107
+ const C = b.find((k) => y(k, u) === F);
108
108
  if (C) {
109
- const z = typeof c == "function" ? { customId: c(C) } : { [c]: D };
110
- A.isDataSourceV2 ? t.remove(() => t.locate(z)) : (t.remove(() => t.locate(z)), A.v1State.forceUpdate());
109
+ const k = typeof u == "function" ? { customId: u(C) } : { [u]: F };
110
+ R.isDataSourceV2 ? t.remove(() => t.locate(k)) : (t.remove(() => t.locate(k)), R.v1State.forceUpdate());
111
111
  }
112
- }), b([]);
112
+ }), v([]);
113
113
  };
114
- return /* @__PURE__ */ r(re, { withBorder: !0, style: { display: "flex", width: x, height: R }, children: [
115
- /* @__PURE__ */ r(_, { style: { minWidth: "44%", minHeight: R }, children: [
116
- /* @__PURE__ */ e(h, { children: m }),
114
+ return /* @__PURE__ */ r(re, { withBorder: !0, style: { display: "flex", width: A, height: z }, children: [
115
+ /* @__PURE__ */ r(Y, { style: { minWidth: "44%", minHeight: z }, children: [
116
+ /* @__PURE__ */ e(c, { children: g }),
117
117
  /* @__PURE__ */ e(
118
118
  Me,
119
119
  {
@@ -127,26 +127,26 @@ function Tr({
127
127
  overflowX: "hidden",
128
128
  height: "calc(100% - 32px)"
129
129
  },
130
- children: y.map((D) => /* @__PURE__ */ e(Me.Item, { children: /* @__PURE__ */ e(
131
- la,
130
+ children: x.map((F) => /* @__PURE__ */ e(Me.Item, { children: /* @__PURE__ */ e(
131
+ ca,
132
132
  {
133
- label: i(D, s),
134
- checked: o.includes(E(D, n)),
135
- onChange: () => N(l, E(D, n)),
136
- disabled: f.some(
137
- (C) => E(C, c) === E(D, n)
133
+ label: i(F, n),
134
+ checked: o.includes(y(F, l)),
135
+ onChange: () => N(s, y(F, l)),
136
+ disabled: b.some(
137
+ (C) => y(C, u) === y(F, l)
138
138
  )
139
139
  }
140
- ) }, E(D, n)))
140
+ ) }, y(F, l)))
141
141
  }
142
142
  )
143
143
  ] }),
144
- /* @__PURE__ */ r(V, { gap: 5, style: { minWidth: "10%" }, justify: "center", align: "center", children: [
145
- /* @__PURE__ */ e(ke, { label: "Adicionar", children: /* @__PURE__ */ e(fe, { onClick: F, disabled: !o.length, children: /* @__PURE__ */ e(Ia, {}) }) }),
146
- /* @__PURE__ */ e(ke, { label: "Remover", children: /* @__PURE__ */ e(fe, { onClick: G, disabled: !p.length, children: /* @__PURE__ */ e(Ea, {}) }) })
144
+ /* @__PURE__ */ r(U, { gap: 5, style: { minWidth: "10%" }, justify: "center", align: "center", children: [
145
+ /* @__PURE__ */ e(Ie, { label: "Adicionar", children: /* @__PURE__ */ e(ye, { onClick: I, disabled: !o.length, children: /* @__PURE__ */ e(Pa, {}) }) }),
146
+ /* @__PURE__ */ e(Ie, { label: "Remover", children: /* @__PURE__ */ e(ye, { onClick: M, disabled: !p.length, children: /* @__PURE__ */ e(Da, {}) }) })
147
147
  ] }),
148
- /* @__PURE__ */ r(_, { style: { minWidth: "44%", minHeight: R }, children: [
149
- /* @__PURE__ */ e(h, { children: v }),
148
+ /* @__PURE__ */ r(Y, { style: { minWidth: "44%", minHeight: z }, children: [
149
+ /* @__PURE__ */ e(c, { children: T }),
150
150
  /* @__PURE__ */ e(
151
151
  Me,
152
152
  {
@@ -160,27 +160,29 @@ function Tr({
160
160
  overflowX: "hidden",
161
161
  height: "calc(100% - 32px)"
162
162
  },
163
- children: f.map((D) => /* @__PURE__ */ e(Me.Item, { children: /* @__PURE__ */ e(
164
- la,
163
+ children: b.map((F) => /* @__PURE__ */ e(Me.Item, { children: /* @__PURE__ */ e(
164
+ ca,
165
165
  {
166
- label: i(D, d),
167
- checked: p.includes(E(D, c)),
168
- onChange: () => N(b, E(D, c))
166
+ label: i(F, d),
167
+ checked: p.includes(y(F, u)),
168
+ onChange: () => N(v, y(F, u))
169
169
  }
170
- ) }, E(D, c)))
170
+ ) }, y(F, u)))
171
171
  }
172
172
  )
173
173
  ] })
174
174
  ] });
175
175
  }
176
- const Ar = ur(
177
- ({ image: a, label: t, description: n, origin: s, ...c }, d) => /* @__PURE__ */ e("div", { ref: d, ...c, children: /* @__PURE__ */ r(Fe, { children: [
178
- /* @__PURE__ */ e(h, { size: "sm", fw: 600, children: s ? s.name : "" }),
179
- /* @__PURE__ */ e(Ra, { w: "lg" })
176
+ const zr = pr(
177
+ ({ image: a, label: t, description: l, origin: n, ...u }, d) => /* @__PURE__ */ e("div", { ref: d, ...u, children: /* @__PURE__ */ r(Fe, { children: [
178
+ /* @__PURE__ */ e(c, { size: "sm", fw: 600, children: n ? n.name : "" }),
179
+ /* @__PURE__ */ e(za, { w: "lg" })
180
180
  ] }) })
181
- ), Rr = {
181
+ ), Ir = {
182
182
  // Campos de identificação
183
183
  showNickname: !0,
184
+ // Desligada por padrão: ver a justificativa em UserModalOptions.showEmployeeId.
185
+ showEmployeeId: !1,
184
186
  // Campos de perfil e grupos
185
187
  showProfile: !0,
186
188
  showGroups: !0,
@@ -202,68 +204,68 @@ const Ar = ur(
202
204
  avatarImageQuality: 1,
203
205
  avatarMaxOutputSizePx: 512,
204
206
  allowEditEmail: !0
205
- }, zr = (a) => {
206
- const [t, n] = T(""), s = { ...Rr, ...a.options ?? {} }, c = a.dataSource.getFieldValue("passwordChangedAt"), d = c ? new Date(c) : void 0, u = d && !Number.isNaN(d.getTime()) ? d.toLocaleString() : void 0, x = _a(s.passwordPolicy), R = s.forbidPersonalDataInPassword ? ["name", "nickname", "email"].map((l) => {
207
- const p = a.dataSource.getFieldValue(l);
208
- return l === "email" && p ? p.split("@")[0] : p;
209
- }).filter((l) => typeof l == "string" && l.trim().length >= 3) : [], m = x ? {
210
- ...x,
211
- blocklist: [...x.blocklist ?? [], ...R]
212
- } : void 0, v = J(K.Group), { dataSource: A } = ta({
207
+ }, kr = (a) => {
208
+ const [t, l] = S(""), n = { ...Ir, ...a.options ?? {} }, u = a.dataSource.getFieldValue("passwordChangedAt"), d = u ? new Date(u) : void 0, h = d && !Number.isNaN(d.getTime()) ? d.toLocaleString() : void 0, A = ar(n.passwordPolicy), z = n.forbidPersonalDataInPassword ? ["name", "nickname", "email"].map((s) => {
209
+ const p = a.dataSource.getFieldValue(s);
210
+ return s === "email" && p ? p.split("@")[0] : p;
211
+ }).filter((s) => typeof s == "string" && s.trim().length >= 3) : [], g = A ? {
212
+ ...A,
213
+ blocklist: [...A.blocklist ?? [], ...z]
214
+ } : void 0, T = J(K.Group), { dataSource: R } = ia({
213
215
  name: "dsGroups",
214
- service: v,
216
+ service: T,
215
217
  pageSize: 9999,
216
218
  loadOnStart: !0,
217
219
  sort: ["name:asc"],
218
- onError: (l, p) => {
219
- ne.showError(g().t("archbase:WARNING"), l, p);
220
+ onError: (s, p) => {
221
+ ne.showError(f().t("archbase:WARNING"), s, p);
220
222
  }
221
223
  });
222
224
  console.log("versão 12/05/2026");
223
- const y = J(K.Profile), { dataSource: P } = ta({
225
+ const x = J(K.Profile), { dataSource: D } = ia({
224
226
  name: "dsProfiles",
225
- service: y,
227
+ service: x,
226
228
  pageSize: 9999,
227
229
  loadOnStart: !0,
228
230
  sort: ["name:asc"],
229
- onError: (l, p) => {
230
- ne.showError(g().t("archbase:WARNING"), l, p);
231
+ onError: (s, p) => {
232
+ ne.showError(f().t("archbase:WARNING"), s, p);
231
233
  }
232
234
  });
233
235
  ee(() => {
234
- n("");
236
+ l("");
235
237
  }, [a.dataSource.getFieldValue("password")]);
236
- const f = async () => {
238
+ const b = async () => {
237
239
  if (a.dataSource.isInserting()) {
238
- if (s.userDefaultProfile) {
239
- const l = Ge(De.eq("name", s.userDefaultProfile)), p = await y.findAllWithFilter(l, 0, 1);
240
+ if (n.userDefaultProfile) {
241
+ const s = Ue(Ne.eq("name", n.userDefaultProfile)), p = await x.findAllWithFilter(s, 0, 1);
240
242
  p && p.content.length > 0 && a.dataSource.setFieldValue("profile", p.content[0]);
241
243
  }
242
- if (s.userDefaultGroups) {
243
- const l = Ge(De.in("name", s.userDefaultGroups)), p = await v.findAllWithFilter(l, 0, 500);
244
- p && p.content.length > 0 && a.dataSource.setFieldValue("groups", p.content.map((b) => ga.newInstance(b)));
244
+ if (n.userDefaultGroups) {
245
+ const s = Ue(Ne.in("name", n.userDefaultGroups)), p = await T.findAllWithFilter(s, 0, 500);
246
+ p && p.content.length > 0 && a.dataSource.setFieldValue("groups", p.content.map((v) => fa.newInstance(v)));
245
247
  }
246
248
  }
247
249
  };
248
250
  ee(() => {
249
- a.opened && f();
251
+ a.opened && b();
250
252
  }, [a.opened]);
251
253
  const w = () => {
252
- const l = a.dataSource.getCurrentRecord();
253
- if (!l.password && a.dataSource.isInserting()) {
254
- n(g().t("archbase:Informe a senha"));
254
+ const s = a.dataSource.getCurrentRecord();
255
+ if (!s.password && a.dataSource.isInserting()) {
256
+ l(f().t("archbase:Informe a senha"));
255
257
  return;
256
258
  }
257
- if (m && l.password) {
258
- const p = er(l.password, m);
259
+ if (g && s.password) {
260
+ const p = rr(s.password, g);
259
261
  if (!p.valid) {
260
- n(p.error);
262
+ l(p.error);
261
263
  return;
262
264
  }
263
265
  }
264
- a.onCustomSave ? a.onCustomSave(l, (p) => {
265
- p && a.onAfterSave && a.onAfterSave(l), a.onClickOk(l, p);
266
- }) : a.onClickOk(l, !0);
266
+ a.onCustomSave ? a.onCustomSave(s, (p) => {
267
+ p && a.onAfterSave && a.onAfterSave(s), a.onClickOk(s, p);
268
+ }) : a.onClickOk(s, !0);
267
269
  }, o = () => {
268
270
  a.onClickCancel(a.dataSource.getCurrentRecord());
269
271
  };
@@ -272,169 +274,181 @@ const Ar = ur(
272
274
  {
273
275
  opened: a.opened,
274
276
  onClose: o,
275
- title: g().t("archbase:Usuário"),
277
+ title: f().t("archbase:Usuário"),
276
278
  size: "80%",
277
279
  styles: { content: { maxWidth: 1e3 } },
278
280
  children: [
279
- /* @__PURE__ */ e(de, { style: { height: "500px" }, children: /* @__PURE__ */ r(V, { w: "98%", children: [
280
- s?.customContentBefore && /* @__PURE__ */ e(xe, { children: s.customContentBefore(a.dataSource.getCurrentRecord()) }),
281
- /* @__PURE__ */ r(H, { children: [
282
- /* @__PURE__ */ e(H.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ r(O, { children: [
281
+ /* @__PURE__ */ e(ue, { style: { height: "500px" }, children: /* @__PURE__ */ r(U, { w: "98%", children: [
282
+ n?.customContentBefore && /* @__PURE__ */ e(xe, { children: n.customContentBefore(a.dataSource.getCurrentRecord()) }),
283
+ /* @__PURE__ */ r(W, { children: [
284
+ /* @__PURE__ */ e(W.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ r(O, { children: [
283
285
  /* @__PURE__ */ e(
284
- se,
286
+ le,
285
287
  {
286
- label: `${g().t("archbase:Nome completo")}`,
287
- placeholder: `${g().t("archbase:Informe o nome completo do usuário")}`,
288
+ label: `${f().t("archbase:Nome completo")}`,
289
+ placeholder: `${f().t("archbase:Informe o nome completo do usuário")}`,
288
290
  dataSource: a.dataSource,
289
291
  dataField: "name",
290
292
  required: !0,
291
293
  width: "calc(100% - 208px)"
292
294
  }
293
295
  ),
294
- s.showNickname && /* @__PURE__ */ e(
295
- se,
296
+ n.showNickname && /* @__PURE__ */ e(
297
+ le,
296
298
  {
297
- label: `${g().t("archbase:Apelido")}`,
298
- placeholder: `${g().t("archbase:Apelido")}`,
299
+ label: `${f().t("archbase:Apelido")}`,
300
+ placeholder: `${f().t("archbase:Apelido")}`,
299
301
  dataSource: a.dataSource,
300
302
  dataField: "nickname",
301
- required: s.requiredNickname
303
+ required: n.requiredNickname
302
304
  }
303
305
  )
304
306
  ] }) }),
305
- /* @__PURE__ */ e(H.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e(
306
- se,
307
- {
308
- label: `${g().t("archbase:Descrição do usuário")}`,
309
- placeholder: `${g().t("archbase:Informe a descrição do usuário")}`,
310
- dataSource: a.dataSource,
311
- dataField: "description",
312
- required: !0
313
- }
314
- ) })
307
+ /* @__PURE__ */ e(W.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ r(O, { children: [
308
+ /* @__PURE__ */ e(
309
+ le,
310
+ {
311
+ label: `${f().t("archbase:Descrição do usuário")}`,
312
+ placeholder: `${f().t("archbase:Informe a descrição do usuário")}`,
313
+ dataSource: a.dataSource,
314
+ dataField: "description",
315
+ required: !0,
316
+ width: n.showEmployeeId ? "calc(100% - 208px)" : void 0
317
+ }
318
+ ),
319
+ n.showEmployeeId && /* @__PURE__ */ e(
320
+ le,
321
+ {
322
+ label: `${f().t("archbase:Matrícula")}`,
323
+ placeholder: `${f().t("archbase:Matrícula do funcionário")}`,
324
+ dataSource: a.dataSource,
325
+ dataField: "employeeId"
326
+ }
327
+ )
328
+ ] }) })
315
329
  ] }),
316
- /* @__PURE__ */ r(H, { children: [
317
- /* @__PURE__ */ e(H.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e(
318
- se,
330
+ /* @__PURE__ */ r(W, { children: [
331
+ /* @__PURE__ */ e(W.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e(
332
+ le,
319
333
  {
320
- label: `${g().t("archbase:E-mail")}`,
321
- placeholder: `${g().t("archbase:Informe o e-mail do usuário")}`,
334
+ label: `${f().t("archbase:E-mail")}`,
335
+ placeholder: `${f().t("archbase:Informe o e-mail do usuário")}`,
322
336
  dataSource: a.dataSource,
323
- onChangeValue: (l) => a.dataSource.setFieldValue("userName", l),
337
+ onChangeValue: (s) => a.dataSource.setFieldValue("userName", s),
324
338
  dataField: "email",
325
- readOnly: a.dataSource.isEditing() ? !s.allowEditEmail : !1,
339
+ readOnly: a.dataSource.isEditing() ? !n.allowEditEmail : !1,
326
340
  required: !0
327
341
  }
328
342
  ) }),
329
- /* @__PURE__ */ e(H.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e(
330
- or,
343
+ /* @__PURE__ */ e(W.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e(
344
+ lr,
331
345
  {
332
- label: `${g().t("archbase:Senha usuário")}`,
346
+ label: `${f().t("archbase:Senha usuário")}`,
333
347
  dataSource: a.dataSource,
334
348
  dataField: "password",
335
349
  error: t,
336
350
  required: a.dataSource.getFieldValue("isNewUser"),
337
- passwordPolicy: m,
338
- showPasswordRequirements: s.showPasswordRequirements
351
+ passwordPolicy: g,
352
+ showPasswordRequirements: n.showPasswordRequirements
339
353
  }
340
354
  ) })
341
355
  ] }),
342
- /* @__PURE__ */ e(H, { children: s.showProfile && /* @__PURE__ */ e(H.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e(
343
- nr,
356
+ /* @__PURE__ */ e(W, { children: n.showProfile && /* @__PURE__ */ e(W.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e(
357
+ sr,
344
358
  {
345
- label: `${g().t("archbase:Perfil do usuário")}`,
359
+ label: `${f().t("archbase:Perfil do usuário")}`,
346
360
  dataSource: a.dataSource,
347
361
  dataField: "profile",
348
- options: P,
362
+ options: D,
349
363
  allowDeselect: !0,
350
364
  optionsLabelField: "nome",
351
- itemComponent: Ar,
352
- getOptionLabel: (l) => l.name,
353
- getOptionValue: (l) => l.id
365
+ itemComponent: zr,
366
+ getOptionLabel: (s) => s.name,
367
+ getOptionValue: (s) => s.id
354
368
  }
355
369
  ) }) }),
356
- /* @__PURE__ */ r(H, { children: [
357
- /* @__PURE__ */ e(H.Col, { span: { base: 12 }, children: s.showAccountConfigLabel && /* @__PURE__ */ e(h, { fz: 14, fw: 500, children: "Informe" }) }),
358
- /* @__PURE__ */ e(H.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ r(V, { gap: "lg", children: [
359
- s.showChangePasswordOnNextLogin && /* @__PURE__ */ e(Te.Wrapper, { label: "", children: /* @__PURE__ */ e(
370
+ /* @__PURE__ */ r(W, { children: [
371
+ /* @__PURE__ */ e(W.Col, { span: { base: 12 }, children: n.showAccountConfigLabel && /* @__PURE__ */ e(c, { fz: 14, fw: 500, children: "Informe" }) }),
372
+ /* @__PURE__ */ e(W.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ r(U, { gap: "lg", children: [
373
+ n.showChangePasswordOnNextLogin && /* @__PURE__ */ e(Ce.Wrapper, { label: "", children: /* @__PURE__ */ e(
360
374
  Ae,
361
375
  {
362
376
  dataSource: a.dataSource,
363
377
  dataField: "changePasswordOnNextLogin",
364
- label: `${g().t("archbase:Deve alterar senha próximo login ?")}`
378
+ label: `${f().t("archbase:Deve alterar senha próximo login ?")}`
365
379
  }
366
380
  ) }),
367
- s.showAllowPasswordChange && /* @__PURE__ */ e(Te.Wrapper, { label: "", children: /* @__PURE__ */ e(
381
+ n.showAllowPasswordChange && /* @__PURE__ */ e(Ce.Wrapper, { label: "", children: /* @__PURE__ */ e(
368
382
  Ae,
369
383
  {
370
384
  dataSource: a.dataSource,
371
385
  dataField: "allowPasswordChange",
372
- label: `${g().t("archbase:Pode alterar a senha ?")}`
386
+ label: `${f().t("archbase:Pode alterar a senha ?")}`
373
387
  }
374
388
  ) }),
375
- s.showPasswordNeverExpires && /* @__PURE__ */ r(Te.Wrapper, { label: "", children: [
389
+ n.showPasswordNeverExpires && /* @__PURE__ */ r(Ce.Wrapper, { label: "", children: [
376
390
  /* @__PURE__ */ e(
377
391
  Ae,
378
392
  {
379
393
  dataSource: a.dataSource,
380
394
  dataField: "passwordNeverExpires",
381
- label: `${g().t("archbase:Senha nunca expira ?")}`
395
+ label: `${f().t("archbase:Senha nunca expira ?")}`
382
396
  }
383
397
  ),
384
- /* @__PURE__ */ e(h, { fz: 12, c: "dimmed", children: g().t(
398
+ /* @__PURE__ */ e(c, { fz: 12, c: "dimmed", children: f().t(
385
399
  'archbase:Desmarcado, a senha expira conforme a política de validade do servidor. Para exigir a troca agora, use "Deve alterar senha próximo login".'
386
400
  ) })
387
401
  ] }),
388
- s.showPasswordChangedAt && u && /* @__PURE__ */ e(h, { fz: 12, c: "dimmed", children: `${g().t("archbase:Última troca de senha")}: ${u}` })
402
+ n.showPasswordChangedAt && h && /* @__PURE__ */ e(c, { fz: 12, c: "dimmed", children: `${f().t("archbase:Última troca de senha")}: ${h}` })
389
403
  ] }) }),
390
- /* @__PURE__ */ e(H.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ r(V, { gap: "lg", children: [
391
- s.showAccountDeactivated && /* @__PURE__ */ e(Te.Wrapper, { label: "", children: /* @__PURE__ */ e(
404
+ /* @__PURE__ */ e(W.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ r(U, { gap: "lg", children: [
405
+ n.showAccountDeactivated && /* @__PURE__ */ e(Ce.Wrapper, { label: "", children: /* @__PURE__ */ e(
392
406
  Ae,
393
407
  {
394
408
  dataSource: a.dataSource,
395
409
  dataField: "accountDeactivated",
396
- label: `${g().t("archbase:Conta desativada ?")}`
410
+ label: `${f().t("archbase:Conta desativada ?")}`
397
411
  }
398
412
  ) }),
399
- s.showAccountLocked && /* @__PURE__ */ e(Te.Wrapper, { label: "", children: /* @__PURE__ */ e(
413
+ n.showAccountLocked && /* @__PURE__ */ e(Ce.Wrapper, { label: "", children: /* @__PURE__ */ e(
400
414
  Ae,
401
415
  {
402
416
  dataSource: a.dataSource,
403
417
  dataField: "accountLocked",
404
- label: `${g().t("archbase:Conta bloqueada ?")}`
418
+ label: `${f().t("archbase:Conta bloqueada ?")}`
405
419
  }
406
420
  ) }),
407
- s.showIsAdministrator && /* @__PURE__ */ e(Te.Wrapper, { label: "", children: /* @__PURE__ */ e(
421
+ n.showIsAdministrator && /* @__PURE__ */ e(Ce.Wrapper, { label: "", children: /* @__PURE__ */ e(
408
422
  Ae,
409
423
  {
410
424
  dataSource: a.dataSource,
411
425
  dataField: "isAdministrator",
412
- label: `${g().t("archbase:Administrador ?")}`
426
+ label: `${f().t("archbase:Administrador ?")}`
413
427
  }
414
428
  ) })
415
429
  ] }) }),
416
- /* @__PURE__ */ e(H.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ e(V, { gap: "lg", children: /* @__PURE__ */ e(
417
- sr,
430
+ /* @__PURE__ */ e(W.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ e(U, { gap: "lg", children: /* @__PURE__ */ e(
431
+ cr,
418
432
  {
419
- label: g().t("archbase:Foto do usuário"),
433
+ label: f().t("archbase:Foto do usuário"),
420
434
  dataSource: a.dataSource,
421
435
  dataField: "avatar",
422
436
  width: 120,
423
437
  height: 120,
424
- maxSizeKB: s.avatarMaxSizeKB,
425
- imageQuality: s.avatarImageQuality,
426
- maxOutputSizePx: s.avatarMaxOutputSizePx
438
+ maxSizeKB: n.avatarMaxSizeKB,
439
+ imageQuality: n.avatarImageQuality,
440
+ maxOutputSizePx: n.avatarMaxOutputSizePx
427
441
  }
428
442
  ) }) })
429
443
  ] }),
430
- s.showGroups && /* @__PURE__ */ r(H, { children: [
431
- /* @__PURE__ */ e(H.Col, { span: { base: 12 }, children: /* @__PURE__ */ e(h, { fz: 14, fw: 500, children: "Grupos" }) }),
432
- /* @__PURE__ */ e(H.Col, { span: { base: 12 }, children: /* @__PURE__ */ e(
433
- Tr,
444
+ n.showGroups && /* @__PURE__ */ r(W, { children: [
445
+ /* @__PURE__ */ e(W.Col, { span: { base: 12 }, children: /* @__PURE__ */ e(c, { fz: 14, fw: 500, children: "Grupos" }) }),
446
+ /* @__PURE__ */ e(W.Col, { span: { base: 12 }, children: /* @__PURE__ */ e(
447
+ Rr,
434
448
  {
435
- titleAvailable: g().t("archbase:Disponíveis"),
436
- titleAssigned: g().t("archbase:Selecionados"),
437
- assignedItemsDS: new cr("dsDualList", {
449
+ titleAvailable: f().t("archbase:Disponíveis"),
450
+ titleAssigned: f().t("archbase:Selecionados"),
451
+ assignedItemsDS: new ur("dsDualList", {
438
452
  records: a.dataSource.getFieldValue("groups"),
439
453
  grandTotalRecords: a.dataSource.getFieldValue("groups").length,
440
454
  currentPage: 0,
@@ -443,58 +457,58 @@ const Ar = ur(
443
457
  }),
444
458
  width: "100%",
445
459
  height: "200px",
446
- availableItemsDS: A,
447
- handleCreateAssociationObject: (l) => ga.newInstance(l),
448
- idFieldAssigned: (l) => l && l.group ? l.group.id : "",
460
+ availableItemsDS: R,
461
+ handleCreateAssociationObject: (s) => fa.newInstance(s),
462
+ idFieldAssigned: (s) => s && s.group ? s.group.id : "",
449
463
  idFieldAvailable: "id",
450
- labelFieldAssigned: (l) => l && l.group ? l.group.name : "",
464
+ labelFieldAssigned: (s) => s && s.group ? s.group.name : "",
451
465
  labelFieldAvailable: "name"
452
466
  }
453
467
  ) })
454
468
  ] }),
455
- s?.customContentAfter && /* @__PURE__ */ e(xe, { children: s.customContentAfter(a.dataSource.getCurrentRecord()) }),
456
- /* @__PURE__ */ e(Ra, { h: "12px" })
469
+ n?.customContentAfter && /* @__PURE__ */ e(xe, { children: n.customContentAfter(a.dataSource.getCurrentRecord()) }),
470
+ /* @__PURE__ */ e(za, { h: "12px" })
457
471
  ] }) }),
458
472
  /* @__PURE__ */ r(O, { justify: "flex-end", mt: "md", children: [
459
- /* @__PURE__ */ e(X, { variant: "default", onClick: o, children: g().t("archbase:Cancelar") }),
460
- /* @__PURE__ */ e(X, { onClick: w, children: g().t("archbase:Salvar") })
473
+ /* @__PURE__ */ e(X, { variant: "default", onClick: o, children: f().t("archbase:Cancelar") }),
474
+ /* @__PURE__ */ e(X, { onClick: w, children: f().t("archbase:Salvar") })
461
475
  ] })
462
476
  ]
463
477
  }
464
478
  );
465
- }, kr = (a) => {
466
- const t = { ...a.options ?? {} }, n = () => {
467
- a.onCustomSave ? a.onCustomSave(a.dataSource.getCurrentRecord(), (c) => {
468
- c && a.onAfterSave && a.onAfterSave(a.dataSource.getCurrentRecord()), a.onClickOk(a.dataSource.getCurrentRecord(), c);
479
+ }, Er = (a) => {
480
+ const t = { ...a.options ?? {} }, l = () => {
481
+ a.onCustomSave ? a.onCustomSave(a.dataSource.getCurrentRecord(), (u) => {
482
+ u && a.onAfterSave && a.onAfterSave(a.dataSource.getCurrentRecord()), a.onClickOk(a.dataSource.getCurrentRecord(), u);
469
483
  }) : a.onClickOk(a.dataSource.getCurrentRecord(), !0);
470
- }, s = () => {
484
+ }, n = () => {
471
485
  a.onClickCancel(a.dataSource.getCurrentRecord());
472
486
  };
473
487
  return /* @__PURE__ */ e(
474
488
  $e,
475
489
  {
476
490
  opened: a.opened,
477
- onClose: s,
478
- title: g().t("archbase:Grupo"),
491
+ onClose: n,
492
+ title: f().t("archbase:Grupo"),
479
493
  size: "60%",
480
494
  styles: { content: { maxWidth: 1e3 } },
481
- children: /* @__PURE__ */ e(de, { style: { height: "460px" }, children: /* @__PURE__ */ r(V, { w: "98%", children: [
495
+ children: /* @__PURE__ */ e(ue, { style: { height: "460px" }, children: /* @__PURE__ */ r(U, { w: "98%", children: [
482
496
  t?.customContentBefore && t.customContentBefore(a.dataSource.getCurrentRecord()),
483
- /* @__PURE__ */ r(H, { children: [
484
- /* @__PURE__ */ e(H.Col, { span: { base: 12 }, children: /* @__PURE__ */ e(
485
- se,
497
+ /* @__PURE__ */ r(W, { children: [
498
+ /* @__PURE__ */ e(W.Col, { span: { base: 12 }, children: /* @__PURE__ */ e(
499
+ le,
486
500
  {
487
- label: `${g().t("archbase:Nome do grupo")}`,
488
- placeholder: `${g().t("archbase:Informe o nome do grupo")}`,
501
+ label: `${f().t("archbase:Nome do grupo")}`,
502
+ placeholder: `${f().t("archbase:Informe o nome do grupo")}`,
489
503
  dataSource: a.dataSource,
490
504
  dataField: "name"
491
505
  }
492
506
  ) }),
493
- /* @__PURE__ */ e(H.Col, { span: { base: 12 }, children: /* @__PURE__ */ e(
494
- se,
507
+ /* @__PURE__ */ e(W.Col, { span: { base: 12 }, children: /* @__PURE__ */ e(
508
+ le,
495
509
  {
496
- label: `${g().t("archbase:Descrição do grupo")}`,
497
- placeholder: `${g().t("archbase:Informe a descrição do grupo")}`,
510
+ label: `${f().t("archbase:Descrição do grupo")}`,
511
+ placeholder: `${f().t("archbase:Informe a descrição do grupo")}`,
498
512
  dataSource: a.dataSource,
499
513
  dataField: "description"
500
514
  }
@@ -502,82 +516,82 @@ const Ar = ur(
502
516
  ] }),
503
517
  t?.customContentAfter && t.customContentAfter(a.dataSource.getCurrentRecord()),
504
518
  /* @__PURE__ */ r(O, { justify: "flex-end", mt: "md", children: [
505
- /* @__PURE__ */ e(X, { variant: "default", onClick: s, children: g().t("archbase:Cancelar") }),
506
- /* @__PURE__ */ e(X, { onClick: n, children: g().t("archbase:Salvar") })
519
+ /* @__PURE__ */ e(X, { variant: "default", onClick: n, children: f().t("archbase:Cancelar") }),
520
+ /* @__PURE__ */ e(X, { onClick: l, children: f().t("archbase:Salvar") })
507
521
  ] })
508
522
  ] }) })
509
523
  }
510
524
  );
511
- }, Ir = ({ image: a, label: t, description: n, ...s }) => /* @__PURE__ */ e("div", { ...s, children: /* @__PURE__ */ r(O, { grow: !0, children: [
525
+ }, Pr = ({ image: a, label: t, description: l, ...n }) => /* @__PURE__ */ e("div", { ...n, children: /* @__PURE__ */ r(O, { grow: !0, children: [
512
526
  /* @__PURE__ */ e("img", { style: { maxWidth: "32px" }, src: a }),
513
527
  /* @__PURE__ */ r("div", { children: [
514
- /* @__PURE__ */ e(h, { size: "sm", children: t }),
515
- /* @__PURE__ */ e(h, { size: "xs", opacity: 0.65, children: n })
528
+ /* @__PURE__ */ e(c, { size: "sm", children: t }),
529
+ /* @__PURE__ */ e(c, { size: "xs", opacity: 0.65, children: l })
516
530
  ] })
517
- ] }) }), Er = (a) => {
518
- yr();
519
- const [t, n] = T(), s = J(K.User), c = Ne(
531
+ ] }) }), Dr = (a) => {
532
+ wr();
533
+ const [t, l] = S(), n = J(K.User), u = Oe(
520
534
  "ApiTokenModal",
521
535
  a.dataSource,
522
536
  "expirationDate",
523
537
  ""
524
538
  );
525
- process.env.NODE_ENV === "development" && a.dataSource && console.log(`[ApiTokenModal] DataSource version: ${c.dataSourceVersion}`);
526
- const d = (m) => {
527
- if (!m)
528
- c.handleValueChange(void 0);
539
+ process.env.NODE_ENV === "development" && a.dataSource && console.log(`[ApiTokenModal] DataSource version: ${u.dataSourceVersion}`);
540
+ const d = (g) => {
541
+ if (!g)
542
+ u.handleValueChange(void 0);
529
543
  else {
530
- const v = typeof m == "string" ? new Date(m) : m, A = ar(v);
531
- c.handleValueChange(A);
544
+ const T = typeof g == "string" ? new Date(g) : g, R = tr(T);
545
+ u.handleValueChange(R);
532
546
  }
533
- n(m);
534
- }, u = async (m, v) => new Promise(async (A, y) => {
547
+ l(g);
548
+ }, h = async (g, T) => new Promise(async (R, x) => {
535
549
  try {
536
- const P = Ge(De.or(De.eq("name", `^*${v.trim()}*`))), f = await s.findAllWithFilter(P, m, 20);
537
- A({
538
- options: f.content,
539
- page: f.pageable.pageNumber,
540
- totalPages: f.totalPages
550
+ const D = Ue(Ne.or(Ne.eq("name", `^*${T.trim()}*`))), b = await n.findAllWithFilter(D, g, 20);
551
+ R({
552
+ options: b.content,
553
+ page: b.pageable.pageNumber,
554
+ totalPages: b.totalPages
541
555
  });
542
- } catch (P) {
543
- y(be(P));
556
+ } catch (D) {
557
+ x(Te(D));
544
558
  }
545
- }), x = () => {
546
- a.onCustomSave ? a.onCustomSave(a.dataSource.current, (m) => {
547
- m && a.onAfterSave && a.onAfterSave(a.dataSource.current), a.onClickOk(a.dataSource.current, m);
559
+ }), A = () => {
560
+ a.onCustomSave ? a.onCustomSave(a.dataSource.current, (g) => {
561
+ g && a.onAfterSave && a.onAfterSave(a.dataSource.current), a.onClickOk(a.dataSource.current, g);
548
562
  }) : a.onClickOk(a.dataSource.current, !0);
549
- }, R = () => {
563
+ }, z = () => {
550
564
  a.onClickCancel(a.dataSource.current);
551
565
  };
552
566
  return /* @__PURE__ */ r(
553
567
  $e,
554
568
  {
555
569
  opened: a.opened,
556
- onClose: R,
557
- title: g().t("archbase:Token de API"),
570
+ onClose: z,
571
+ title: f().t("archbase:Token de API"),
558
572
  size: "50%",
559
573
  children: [
560
- /* @__PURE__ */ r(de, { style: { height: "300px" }, children: [
574
+ /* @__PURE__ */ r(ue, { style: { height: "300px" }, children: [
561
575
  /* @__PURE__ */ e(
562
- se,
576
+ le,
563
577
  {
564
- label: `${g().t("archbase:Nome do token")}`,
565
- placeholder: `${g().t("archbase:Informe o nome do token")}`,
578
+ label: `${f().t("archbase:Nome do token")}`,
579
+ placeholder: `${f().t("archbase:Informe o nome do token")}`,
566
580
  dataSource: a.dataSource,
567
581
  dataField: "name"
568
582
  }
569
583
  ),
570
584
  /* @__PURE__ */ e(
571
- se,
585
+ le,
572
586
  {
573
- label: `${g().t("archbase:Descrição do token")}`,
574
- placeholder: `${g().t("archbase:Informe a descrição do token")}`,
587
+ label: `${f().t("archbase:Descrição do token")}`,
588
+ placeholder: `${f().t("archbase:Informe a descrição do token")}`,
575
589
  dataSource: a.dataSource,
576
590
  dataField: "description"
577
591
  }
578
592
  ),
579
593
  /* @__PURE__ */ e(
580
- vr,
594
+ Tr,
581
595
  {
582
596
  withSeconds: !0,
583
597
  value: t,
@@ -587,191 +601,191 @@ const Ar = ur(
587
601
  }
588
602
  ),
589
603
  /* @__PURE__ */ e(
590
- lr,
604
+ dr,
591
605
  {
592
- label: `${g().t("archbase:Usuário")}`,
606
+ label: `${f().t("archbase:Usuário")}`,
593
607
  dataSource: a.dataSource,
594
608
  dataField: "user",
595
- placeholder: `${g().t("archbase:Digite aqui o nome do usuário")}`,
596
- getOptionLabel: (m) => m && m.email ? m.email : "",
597
- getOptionValue: (m) => m && m.id ? m.id.toString() : "",
598
- getOptions: u,
609
+ placeholder: `${f().t("archbase:Digite aqui o nome do usuário")}`,
610
+ getOptionLabel: (g) => g && g.email ? g.email : "",
611
+ getOptionValue: (g) => g && g.id ? g.id.toString() : "",
612
+ getOptions: h,
599
613
  debounceTime: 500,
600
614
  minCharsToSearch: 1,
601
- itemComponent: Ir
615
+ itemComponent: Pr
602
616
  }
603
617
  )
604
618
  ] }),
605
619
  /* @__PURE__ */ r(O, { justify: "flex-end", mt: "md", children: [
606
- /* @__PURE__ */ e(X, { variant: "default", onClick: R, children: g().t("archbase:Cancelar") }),
607
- /* @__PURE__ */ e(X, { onClick: x, children: g().t("archbase:Salvar") })
620
+ /* @__PURE__ */ e(X, { variant: "default", onClick: z, children: f().t("archbase:Cancelar") }),
621
+ /* @__PURE__ */ e(X, { onClick: A, children: f().t("archbase:Salvar") })
608
622
  ] })
609
623
  ]
610
624
  }
611
625
  );
612
- }, fa = (a) => {
626
+ }, ba = (a) => {
613
627
  const t = "->";
614
- return a.includes(t) ? a.split(t).map((c) => c.trim()).map((c) => g().t(c)).join(` ${t} `) : g().t(a);
628
+ return a.includes(t) ? a.split(t).map((u) => u.trim()).map((u) => f().t(u)).join(` ${t} `) : f().t(a);
615
629
  };
616
- function Xe({ dataSource: a, opened: t, close: n }) {
617
- const s = ie(() => a?.getFieldValue("name") || "", [a]), c = ie(() => a?.getFieldValue("id") || "", [a]), d = ie(() => a?.getFieldValue("type") || "", [a]), u = ca(), x = ca(), [R, m] = T([]), [v, A] = T([]), [y, P] = T(), [f, w] = T(), [o, l] = T(""), [p] = ia(o, 200), [b, L] = T(""), [E] = ia(b, 200), i = J(K.Resource), { colorScheme: N } = qe(), F = N === "dark" ? "var(--mantine-primary-color-7)" : "var(--mantine-primary-color-4)", G = ie(() => v.sort((k, I) => k.resourceDescription.localeCompare(I.resourceDescription)).map((k) => ({
618
- value: k.resourceId,
619
- label: k.resourceDescription,
620
- children: k.permissions.filter((I) => I.actionDescription.toLowerCase().includes(E.toLowerCase())).sort((I, q) => I.actionDescription.localeCompare(q.actionDescription)).map((I) => ({
621
- value: I.actionId,
622
- label: I.actionDescription,
630
+ function Xe({ dataSource: a, opened: t, close: l }) {
631
+ const n = ie(() => a?.getFieldValue("name") || "", [a]), u = ie(() => a?.getFieldValue("id") || "", [a]), d = ie(() => a?.getFieldValue("type") || "", [a]), h = da(), A = da(), [z, g] = S([]), [T, R] = S([]), [x, D] = S(), [b, w] = S(), [o, s] = S(""), [p] = oa(o, 200), [v, $] = S(""), [y] = oa(v, 200), i = J(K.Resource), { colorScheme: N } = qe(), I = N === "dark" ? "var(--mantine-primary-color-7)" : "var(--mantine-primary-color-4)", M = ie(() => T.sort((E, P) => E.resourceDescription.localeCompare(P.resourceDescription)).map((E) => ({
632
+ value: E.resourceId,
633
+ label: E.resourceDescription,
634
+ children: E.permissions.filter((P) => P.actionDescription.toLowerCase().includes(y.toLowerCase())).sort((P, q) => P.actionDescription.localeCompare(q.actionDescription)).map((P) => ({
635
+ value: P.actionId,
636
+ label: P.actionDescription,
623
637
  nodeProps: {
624
- permissionId: I.permissionId,
625
- types: I.types ?? [],
626
- owner: k
638
+ permissionId: P.permissionId,
639
+ types: P.types ?? [],
640
+ owner: E
627
641
  }
628
642
  }))
629
- })), [v, E]), D = ie(() => v.map((k) => k.permissions.map((I) => I.actionId)).flat(), [v]), C = ie(() => R.sort((k, I) => k.resourceDescription.localeCompare(I.resourceDescription)).map((k) => ({
630
- value: k.resourceId,
631
- label: k.resourceDescription,
632
- children: k.permissions.filter((I) => I.actionDescription.toLowerCase().includes(p.toLowerCase())).sort((I, q) => I.actionDescription.localeCompare(q.actionDescription)).map((I) => {
633
- const q = v.find((U) => U.resourceId === k.resourceId)?.permissions.find((U) => U.actionId === I.actionId);
643
+ })), [T, y]), F = ie(() => T.map((E) => E.permissions.map((P) => P.actionId)).flat(), [T]), C = ie(() => z.sort((E, P) => E.resourceDescription.localeCompare(P.resourceDescription)).map((E) => ({
644
+ value: E.resourceId,
645
+ label: E.resourceDescription,
646
+ children: E.permissions.filter((P) => P.actionDescription.toLowerCase().includes(p.toLowerCase())).sort((P, q) => P.actionDescription.localeCompare(q.actionDescription)).map((P) => {
647
+ const q = T.find((G) => G.resourceId === E.resourceId)?.permissions.find((G) => G.actionId === P.actionId);
634
648
  return {
635
- value: I.actionId,
636
- label: I.actionDescription,
649
+ value: P.actionId,
650
+ label: P.actionDescription,
637
651
  nodeProps: {
638
- granted: D.includes(I.actionId) && q?.types?.includes(Se(Y, d)),
639
- owner: k
652
+ granted: F.includes(P.actionId) && q?.types?.includes(Se(_, d)),
653
+ owner: E
640
654
  }
641
655
  };
642
656
  })
643
- })), [R, v, D, d, p]), z = ae(async () => {
644
- if (c) {
645
- const k = await i.getPermissionsBySecurityId(c, d), I = await i.getAllPermissionsAvailable();
646
- m(I), A(k);
657
+ })), [z, T, F, d, p]), k = ae(async () => {
658
+ if (u) {
659
+ const E = await i.getPermissionsBySecurityId(u, d), P = await i.getAllPermissionsAvailable();
660
+ g(P), R(E);
647
661
  }
648
- }, [c, d]), oe = ae(() => {
649
- y?.value && c && i.createPermission(c, y.value, d).then((k) => {
650
- if (k) {
651
- A((j) => {
662
+ }, [u, d]), oe = ae(() => {
663
+ x?.value && u && i.createPermission(u, x.value, d).then((E) => {
664
+ if (E) {
665
+ R((Z) => {
652
666
  let B;
653
- return j.map((Z) => Z.resourceId).includes(k.resourceId) ? B = j.map((Z) => Z.resourceId === k.resourceId ? Z.permissions.map((W) => W.actionId).includes(y.value) ? {
654
- ...Z,
655
- permissions: Z.permissions.map(
656
- (W) => W.actionId === y.value ? {
657
- ...W,
658
- permissionId: k.permissionId,
659
- types: [...W.types ?? [], Se(Y, d)]
660
- } : W
667
+ return Z.map((Q) => Q.resourceId).includes(E.resourceId) ? B = Z.map((Q) => Q.resourceId === E.resourceId ? Q.permissions.map((H) => H.actionId).includes(x.value) ? {
668
+ ...Q,
669
+ permissions: Q.permissions.map(
670
+ (H) => H.actionId === x.value ? {
671
+ ...H,
672
+ permissionId: E.permissionId,
673
+ types: [...H.types ?? [], Se(_, d)]
674
+ } : H
661
675
  )
662
676
  } : {
663
- ...Z,
677
+ ...Q,
664
678
  permissions: [
665
- ...Z.permissions ?? [],
679
+ ...Q.permissions ?? [],
666
680
  {
667
- actionId: k.actionId,
668
- actionDescription: k.actionDescription,
669
- permissionId: k.permissionId,
670
- types: [Se(Y, d)]
681
+ actionId: E.actionId,
682
+ actionDescription: E.actionDescription,
683
+ permissionId: E.permissionId,
684
+ types: [Se(_, d)]
671
685
  }
672
686
  ]
673
- } : Z) : B = [
674
- ...j,
687
+ } : Q) : B = [
688
+ ...Z,
675
689
  {
676
- resourceId: k.resourceId,
677
- resourceDescription: k.resourceDescription,
690
+ resourceId: E.resourceId,
691
+ resourceDescription: E.resourceDescription,
678
692
  permissions: [
679
693
  {
680
- actionId: k.actionId,
681
- actionDescription: k.actionDescription,
682
- permissionId: k.permissionId,
683
- types: [Se(Y, d)]
694
+ actionId: E.actionId,
695
+ actionDescription: E.actionDescription,
696
+ permissionId: E.permissionId,
697
+ types: [Se(_, d)]
684
698
  }
685
699
  ]
686
700
  }
687
701
  ], B;
688
702
  });
689
- const I = C.filter((j) => j.value === y?.nodeProps?.owner?.resourceId).map((j) => j.children).flat(), q = I.map((j) => j.value).indexOf(y.value), U = I.find((j, B) => !j?.nodeProps?.granted && j?.value !== y.value && (I.length > q + 1 ? B > q : !0));
690
- U?.value && u.select(U.value), x.expand(k.resourceId), P(U);
703
+ const P = C.filter((Z) => Z.value === x?.nodeProps?.owner?.resourceId).map((Z) => Z.children).flat(), q = P.map((Z) => Z.value).indexOf(x.value), G = P.find((Z, B) => !Z?.nodeProps?.granted && Z?.value !== x.value && (P.length > q + 1 ? B > q : !0));
704
+ G?.value && h.select(G.value), A.expand(E.resourceId), D(G);
691
705
  }
692
706
  });
693
- }, [y, c, d, i, C, R, v, u, x]), ue = ae(() => {
694
- f?.nodeProps?.permissionId && i.deletePermission(f.nodeProps.permissionId).then(() => {
695
- A((U) => [...U].filter((B) => {
696
- let Z = !0;
697
- return B.permissions?.forEach((W) => {
698
- W.permissionId !== void 0 && W.permissionId === f?.nodeProps?.permissionId && B.permissions.length === 1 && W?.types?.length === 1 && W.types[0] === Se(Y, d) && (Z = !1);
699
- }), Z;
707
+ }, [x, u, d, i, C, z, T, h, A]), me = ae(() => {
708
+ b?.nodeProps?.permissionId && i.deletePermission(b.nodeProps.permissionId).then(() => {
709
+ R((G) => [...G].filter((B) => {
710
+ let Q = !0;
711
+ return B.permissions?.forEach((H) => {
712
+ H.permissionId !== void 0 && H.permissionId === b?.nodeProps?.permissionId && B.permissions.length === 1 && H?.types?.length === 1 && H.types[0] === Se(_, d) && (Q = !1);
713
+ }), Q;
700
714
  }).map((B) => {
701
- const Z = f?.nodeProps?.owner;
702
- return B.resourceId === Z.resourceId ? f?.nodeProps?.types?.length === 1 ? {
715
+ const Q = b?.nodeProps?.owner;
716
+ return B.resourceId === Q.resourceId ? b?.nodeProps?.types?.length === 1 ? {
703
717
  ...B,
704
- permissions: [...(B.permissions ?? []).filter((W) => W.permissionId !== f?.nodeProps?.permissionId)]
718
+ permissions: [...(B.permissions ?? []).filter((H) => H.permissionId !== b?.nodeProps?.permissionId)]
705
719
  } : {
706
720
  ...B,
707
- permissions: (B.permissions ?? []).map((W) => W.actionId === f.value ? {
708
- actionId: W.actionId,
709
- actionDescription: W.actionDescription,
710
- types: [...W.types?.filter((ce) => ce && ce !== Se(Y, d)) ?? []]
711
- } : W)
721
+ permissions: (B.permissions ?? []).map((H) => H.actionId === b.value ? {
722
+ actionId: H.actionId,
723
+ actionDescription: H.actionDescription,
724
+ types: [...H.types?.filter((de) => de && de !== Se(_, d)) ?? []]
725
+ } : H)
712
726
  } : B;
713
727
  }));
714
- const k = G.filter((U) => U.value === f?.nodeProps?.owner?.resourceId).map((U) => U.children).flat(), I = k.map((U) => U.value).indexOf(f.value), q = k.find((U, j) => U?.nodeProps?.types.includes(Se(Y, d)) && U?.value !== f.value && (k.length > I + 1 ? j > I : !0));
715
- q?.value && x.select(q.value), w(q);
728
+ const E = M.filter((G) => G.value === b?.nodeProps?.owner?.resourceId).map((G) => G.children).flat(), P = E.map((G) => G.value).indexOf(b.value), q = E.find((G, Z) => G?.nodeProps?.types.includes(Se(_, d)) && G?.value !== b.value && (E.length > P + 1 ? Z > P : !0));
729
+ q?.value && A.select(q.value), w(q);
716
730
  });
717
- }, [f, i, d, G, v, x]);
731
+ }, [b, i, d, M, T, A]);
718
732
  return ee(() => {
719
- t && a && (P(void 0), w(void 0), l(""), L(""), x.collapseAllNodes(), u.collapseAllNodes(), z());
720
- }, [t, d, c, z]), a ? /* @__PURE__ */ e($e, { opened: t, onClose: n, title: `${g().t(`archbase:${d}`)}: ${s}`, size: "80%", styles: { root: { overflow: "hidden" } }, children: /* @__PURE__ */ r(wr, { height: "540px", children: [
721
- /* @__PURE__ */ e(Cr, { children: /* @__PURE__ */ e(re, { withBorder: !0, my: 20, p: 20, style: { height: "calc(100% - 40px)", overflow: "hidden", display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ r("div", { style: { flex: 1, display: "flex", flexDirection: "row", overflow: "hidden", minHeight: 0, gap: "8px" }, children: [
733
+ t && a && (D(void 0), w(void 0), s(""), $(""), A.collapseAllNodes(), h.collapseAllNodes(), k());
734
+ }, [t, d, u, k]), a ? /* @__PURE__ */ e($e, { opened: t, onClose: l, title: `${f().t(`archbase:${d}`)}: ${n}`, size: "80%", styles: { root: { overflow: "hidden" } }, children: /* @__PURE__ */ r(Sr, { height: "540px", children: [
735
+ /* @__PURE__ */ e(xr, { children: /* @__PURE__ */ e(re, { withBorder: !0, my: 20, p: 20, style: { height: "calc(100% - 40px)", overflow: "hidden", display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ r("div", { style: { flex: 1, display: "flex", flexDirection: "row", overflow: "hidden", minHeight: 0, gap: "8px" }, children: [
722
736
  /* @__PURE__ */ r("div", { style: { flex: 9, display: "flex", flexDirection: "column", overflow: "hidden", minHeight: 0 }, children: [
723
737
  /* @__PURE__ */ r(O, { mb: 20, children: [
724
- /* @__PURE__ */ e(h, { children: g().t("archbase:Available") }),
738
+ /* @__PURE__ */ e(c, { children: f().t("archbase:Available") }),
725
739
  /* @__PURE__ */ e(
726
- ve,
740
+ he,
727
741
  {
728
742
  size: "xs",
729
743
  value: o,
730
- onChange: (k) => l(k.target.value),
731
- placeholder: g().t("archbase:Filter available permissions")
744
+ onChange: (E) => s(E.target.value),
745
+ placeholder: f().t("archbase:Filter available permissions")
732
746
  }
733
747
  )
734
748
  ] }),
735
- /* @__PURE__ */ e(de, { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e(
736
- da,
749
+ /* @__PURE__ */ e(ue, { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e(
750
+ ua,
737
751
  {
738
752
  data: C,
739
753
  selectOnClick: !0,
740
754
  allowRangeSelection: !1,
741
- tree: u,
742
- renderNode: ({ level: k, node: I, expanded: q, hasChildren: U, selected: j, elementProps: B }) => {
743
- const Z = I?.nodeProps?.granted, W = Z ? "dimmed" : void 0, ce = Z ? "line-through" : void 0, je = ae((Ze) => {
744
- P(I), B.onClick(Ze);
745
- }, [I, B.onClick]);
755
+ tree: h,
756
+ renderNode: ({ level: E, node: P, expanded: q, hasChildren: G, selected: Z, elementProps: B }) => {
757
+ const Q = P?.nodeProps?.granted, H = Q ? "dimmed" : void 0, de = Q ? "line-through" : void 0, je = ae((Ze) => {
758
+ D(P), B.onClick(Ze);
759
+ }, [P, B.onClick]);
746
760
  return /* @__PURE__ */ r(
747
761
  O,
748
762
  {
749
- ml: U ? 0 : 5,
763
+ ml: G ? 0 : 5,
750
764
  gap: 5,
751
765
  ...B,
752
- bg: j && k === 2 ? F : "",
766
+ bg: Z && E === 2 ? I : "",
753
767
  onClick: je,
754
768
  children: [
755
- U && /* @__PURE__ */ e(
756
- pa,
769
+ G && /* @__PURE__ */ e(
770
+ ma,
757
771
  {
758
772
  size: 18,
759
773
  style: { transform: q ? "rotate(0deg)" : "rotate(-90deg)" }
760
774
  }
761
775
  ),
762
- !U && /* @__PURE__ */ e(
763
- ma,
776
+ !G && /* @__PURE__ */ e(
777
+ ga,
764
778
  {
765
779
  size: 12,
766
780
  style: { transform: "rotate(-90deg)", marginTop: "-5px" }
767
781
  }
768
782
  ),
769
783
  /* @__PURE__ */ e(
770
- h,
784
+ c,
771
785
  {
772
- c: W,
773
- td: ce,
774
- children: fa(I.label)
786
+ c: H,
787
+ td: de,
788
+ children: ba(P.label)
775
789
  }
776
790
  )
777
791
  ]
@@ -781,61 +795,61 @@ function Xe({ dataSource: a, opened: t, close: n }) {
781
795
  }
782
796
  ) })
783
797
  ] }),
784
- /* @__PURE__ */ e("div", { style: { flex: 2, display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ r(V, { gap: 5, align: "center", children: [
785
- /* @__PURE__ */ e(ke, { label: g().t("archbase:Add"), children: /* @__PURE__ */ e(fe, { onClick: oe, disabled: !y || y?.nodeProps?.granted || !y.nodeProps, children: /* @__PURE__ */ e(Ia, {}) }) }),
786
- /* @__PURE__ */ e(ke, { label: g().t("archbase:Remove"), children: /* @__PURE__ */ e(fe, { onClick: ue, disabled: !f || !f?.nodeProps?.permissionId || !f.nodeProps, children: /* @__PURE__ */ e(Ea, {}) }) })
798
+ /* @__PURE__ */ e("div", { style: { flex: 2, display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ r(U, { gap: 5, align: "center", children: [
799
+ /* @__PURE__ */ e(Ie, { label: f().t("archbase:Add"), children: /* @__PURE__ */ e(ye, { onClick: oe, disabled: !x || x?.nodeProps?.granted || !x.nodeProps, children: /* @__PURE__ */ e(Pa, {}) }) }),
800
+ /* @__PURE__ */ e(Ie, { label: f().t("archbase:Remove"), children: /* @__PURE__ */ e(ye, { onClick: me, disabled: !b || !b?.nodeProps?.permissionId || !b.nodeProps, children: /* @__PURE__ */ e(Da, {}) }) })
787
801
  ] }) }),
788
802
  /* @__PURE__ */ r("div", { style: { flex: 9, display: "flex", flexDirection: "column", overflow: "hidden", minHeight: 0 }, children: [
789
803
  /* @__PURE__ */ r(O, { mb: 20, children: [
790
- /* @__PURE__ */ e(h, { children: g().t("archbase:Granted") }),
804
+ /* @__PURE__ */ e(c, { children: f().t("archbase:Granted") }),
791
805
  /* @__PURE__ */ e(
792
- ve,
806
+ he,
793
807
  {
794
808
  size: "xs",
795
- value: b,
796
- onChange: (k) => L(k.target.value),
797
- placeholder: g().t("archbase:Filter granted permissions")
809
+ value: v,
810
+ onChange: (E) => $(E.target.value),
811
+ placeholder: f().t("archbase:Filter granted permissions")
798
812
  }
799
813
  )
800
814
  ] }),
801
- /* @__PURE__ */ e(de, { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e(
802
- da,
815
+ /* @__PURE__ */ e(ue, { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e(
816
+ ua,
803
817
  {
804
- data: G,
818
+ data: M,
805
819
  selectOnClick: !0,
806
820
  allowRangeSelection: !1,
807
- tree: x,
808
- renderNode: ({ level: k, node: I, expanded: q, hasChildren: U, selected: j, elementProps: B }) => {
809
- const Z = ae((W) => {
810
- w(I), B.onClick(W);
811
- }, [I, B.onClick]);
821
+ tree: A,
822
+ renderNode: ({ level: E, node: P, expanded: q, hasChildren: G, selected: Z, elementProps: B }) => {
823
+ const Q = ae((H) => {
824
+ w(P), B.onClick(H);
825
+ }, [P, B.onClick]);
812
826
  return /* @__PURE__ */ r(
813
827
  O,
814
828
  {
815
- ml: U ? 0 : 5,
829
+ ml: G ? 0 : 5,
816
830
  gap: 5,
817
831
  ...B,
818
- bg: j && k === 2 ? F : "",
819
- onClick: Z,
832
+ bg: Z && E === 2 ? I : "",
833
+ onClick: Q,
820
834
  children: [
821
- U && /* @__PURE__ */ e(
822
- pa,
835
+ G && /* @__PURE__ */ e(
836
+ ma,
823
837
  {
824
838
  size: 18,
825
839
  style: { transform: q ? "rotate(0deg)" : "rotate(-90deg)" }
826
840
  }
827
841
  ),
828
- !U && /* @__PURE__ */ e(
829
- ma,
842
+ !G && /* @__PURE__ */ e(
843
+ ga,
830
844
  {
831
845
  size: 12,
832
846
  style: { transform: "rotate(-90deg)", marginTop: "-5px" }
833
847
  }
834
848
  ),
835
- /* @__PURE__ */ e(h, { children: fa(I.label) }),
836
- I?.nodeProps?.types?.includes("USER") && /* @__PURE__ */ e(Q, { color: "blue", children: g().t("archbase:user") }),
837
- I?.nodeProps?.types?.includes("GROUP") && /* @__PURE__ */ e(Q, { color: "orange", children: g().t("archbase:group") }),
838
- I?.nodeProps?.types?.includes("PROFILE") && /* @__PURE__ */ e(Q, { color: "pink", children: g().t("archbase:profile") })
849
+ /* @__PURE__ */ e(c, { children: ba(P.label) }),
850
+ P?.nodeProps?.types?.includes("USER") && /* @__PURE__ */ e(j, { color: "blue", children: f().t("archbase:user") }),
851
+ P?.nodeProps?.types?.includes("GROUP") && /* @__PURE__ */ e(j, { color: "orange", children: f().t("archbase:group") }),
852
+ P?.nodeProps?.types?.includes("PROFILE") && /* @__PURE__ */ e(j, { color: "pink", children: f().t("archbase:profile") })
839
853
  ]
840
854
  }
841
855
  );
@@ -844,12 +858,12 @@ function Xe({ dataSource: a, opened: t, close: n }) {
844
858
  ) })
845
859
  ] })
846
860
  ] }) }) }),
847
- /* @__PURE__ */ e(Sr, { size: "40px", children: /* @__PURE__ */ e(O, { justify: "flex-end", children: /* @__PURE__ */ e(X, { onClick: n, children: g().t("archbase:Close") }) }) })
861
+ /* @__PURE__ */ e(Cr, { size: "40px", children: /* @__PURE__ */ e(O, { justify: "flex-end", children: /* @__PURE__ */ e(X, { onClick: l, children: f().t("archbase:Close") }) }) })
848
862
  ] }) }) : null;
849
863
  }
850
- const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAAABj1BMVEUAAADMzMzLy8vAwMDLy8vLy8vLy8vMzMzKysrR0dHPz8/MzMzNzc3KysrMzMzKysrLy8vLy8vLy8vJycnR0dHMzMzPz8/Ozs7MzMxPT0/Nzc1UVFTJyclTU1PMzMzKysrMzMzJycldXV1iYmLMzMzIyMhNTU1NTU3MzMzLy8vNzc3MzMxVVVXLy8vMzMzLy8vLy8tNTU3MzMzOzs5QUFDLy8vKyspRUVFRUVHMzMxZWVlycnLLy8tUVFTJycnKyspZWVlXV1dhYWHGxsZMTExQUFBPT0/Ozs7Ly8vPz89SUlJSUlLMzMxVVVVWVlZVVVXKysptbW1bW1t6enpmZmbLy8tKSkrQ0NDOzs5FRUXNzc1NTU3S0tLU1NRHR0dSUlKzs7ORkZF4eHhPT0/Jycm9vb26urp8fHxYWFisrKylpaWdnZ11dXVubm5fX1+8vLy3t7ehoaFkZGRVVVXBwcG/v7+vr6+ZmZmUlJSNjY2GhoZzc3NcXFzGxsbDw8Ofn5+WlpaBgYGwsLCpqalqampaWRCJAAAAVXRSTlMA+YUG1M7Df1AQ8urbdWdiXjo2HQkE+/vu4qqIcV1bRDEpIRwXFO/q2ZiObWJZSiv+9uTe3cq8s6qkgX55b1pWR0YVDfvJyLCcmZWTi2lZVz82LRcUQGGNCgAAA9pJREFUWMPll2db2zAQgJ0AgUIYDSl7tZRZ6N57793akizZCSSEEJKw9yi0/eHtEwgid5IxfOX9mnvenM93J8s4tZw5391Q3/Hu0mj3lTMnllys+hi6HqBCCCIEDVwPDVddPEEqXW9qiEOoeQAlDqlpGz1eYo2VYSFsE2ELcSPY6FvTV1njUFMDdVqCff48DWGgAdhOuMtPie8JrUaWq+3I5zs76Jg+cG50e3seVxPTF6S63svT0URNn1BSqffUEhvHE/ofgn8x9aZLKJpcja/sZnO57Pp0yqbIVKv2VDUBD93amedsn0QuA1U2eazynG8BceRPnrnWAczdmAERtLoHe6IhAaJWLWaVwNLLBPxXxQskCjogZse1ICz2G+TkDKNGbAb5THELwzaXQB2bzpZ6zt0GD5acZ5bKNA4LGSorET2BDz/NLDVT0FQywGW34GT81YhYForKo4dbCHjsVMLSEJuxgWnUkMAKkTmmE7E52ExhuX2vBGDzj+lFa7AKzRHUQ1K0qheNQZETPHj3FQSKfulF0zCYlpcVpyyAlseypcOdojC6uThxdQLt94mYTpRI2WjvduyL3kqRbGxXk1A+iYJFmywRhEyCIuEZwUXqq7Hxb+M60QYOtlsaZa3BT7PazuZxisP3VkA3/MX79a8QHH5574iWtfbZ2RDRUBDVA5HPzsbvvw6LaMZraLGodu9YdEzPhsRrBCIq985FLDKpto8mKY4WD+VWQymlXWVjpydshaiuILpcEKGxjSkfLE4VwaSqIOq5aioQ40w1IMRUEUEjgrctXkaqEZFDi1lccL1fGd5s94RKRLMMJZSTHrBGcEfiMxJ3Ne5HeYhg7CX03vgsVUZGiuesLBJqSrzUcNxgFBxHMGA2gVeRAjFkFOkJmCqSebekqzeTyrDmQ182IV8NEJtQNtytc+irBn5rwUHLqMJEvSGJlitCCCr2BsVRNFzyGdklcEQcHwAZop58SRmqEt2aZ3iJpChMuyJqlPC1CQRs51RDm08RdIAAhpzD6dCpvPpjNJ2hh5NyhvCFb5DIq0F83NKd/VY2LlWkXHFXjlTTfU1qlzNLC+OTs8Tev0JElHfZQkpkaT0GNEiVWJ8oqIjm8vdQ2GR7bAFrsGphbZHYQnthC5orm8y1fOCy9Fhy2NDyANVYr3IfGB6MXOM+Rdc+GZ48venLxG8+M46g9y734bl7wTiazlZ+hKZ1xPBFb/sA99D0t/cafrnQ3sq50sJb2+FTefOz804/50DC+++MPDeOTe+XD68GeJGXA6/ff4bJ+OfHt2edj+7ff9T59Ptz47TyD0dpv5fjoIC3AAAAAElFTkSuQmCC", Pr = (a) => a.groups ? /* @__PURE__ */ e("div", { style: { display: "flex" }, children: a.groups.slice().sort((t, n) => (t.group?.name ?? "").localeCompare(n.group?.name ?? "")).map((t, n) => /* @__PURE__ */ e("div", { style: { paddingRight: "2px" }, children: /* @__PURE__ */ e(Q, { color: "blue", children: t.group?.name }) }, n)) }) : null, Fr = (a) => a.profile ? /* @__PURE__ */ e(Q, { color: "green", children: a.profile?.name }) : null, Dr = (a) => /* @__PURE__ */ r(Ie, { children: [
864
+ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAAABj1BMVEUAAADMzMzLy8vAwMDLy8vLy8vLy8vMzMzKysrR0dHPz8/MzMzNzc3KysrMzMzKysrLy8vLy8vLy8vJycnR0dHMzMzPz8/Ozs7MzMxPT0/Nzc1UVFTJyclTU1PMzMzKysrMzMzJycldXV1iYmLMzMzIyMhNTU1NTU3MzMzLy8vNzc3MzMxVVVXLy8vMzMzLy8vLy8tNTU3MzMzOzs5QUFDLy8vKyspRUVFRUVHMzMxZWVlycnLLy8tUVFTJycnKyspZWVlXV1dhYWHGxsZMTExQUFBPT0/Ozs7Ly8vPz89SUlJSUlLMzMxVVVVWVlZVVVXKysptbW1bW1t6enpmZmbLy8tKSkrQ0NDOzs5FRUXNzc1NTU3S0tLU1NRHR0dSUlKzs7ORkZF4eHhPT0/Jycm9vb26urp8fHxYWFisrKylpaWdnZ11dXVubm5fX1+8vLy3t7ehoaFkZGRVVVXBwcG/v7+vr6+ZmZmUlJSNjY2GhoZzc3NcXFzGxsbDw8Ofn5+WlpaBgYGwsLCpqalqampaWRCJAAAAVXRSTlMA+YUG1M7Df1AQ8urbdWdiXjo2HQkE+/vu4qqIcV1bRDEpIRwXFO/q2ZiObWJZSiv+9uTe3cq8s6qkgX55b1pWR0YVDfvJyLCcmZWTi2lZVz82LRcUQGGNCgAAA9pJREFUWMPll2db2zAQgJ0AgUIYDSl7tZRZ6N57793akizZCSSEEJKw9yi0/eHtEwgid5IxfOX9mnvenM93J8s4tZw5391Q3/Hu0mj3lTMnllys+hi6HqBCCCIEDVwPDVddPEEqXW9qiEOoeQAlDqlpGz1eYo2VYSFsE2ELcSPY6FvTV1njUFMDdVqCff48DWGgAdhOuMtPie8JrUaWq+3I5zs76Jg+cG50e3seVxPTF6S63svT0URNn1BSqffUEhvHE/ofgn8x9aZLKJpcja/sZnO57Pp0yqbIVKv2VDUBD93amedsn0QuA1U2eazynG8BceRPnrnWAczdmAERtLoHe6IhAaJWLWaVwNLLBPxXxQskCjogZse1ICz2G+TkDKNGbAb5THELwzaXQB2bzpZ6zt0GD5acZ5bKNA4LGSorET2BDz/NLDVT0FQywGW34GT81YhYForKo4dbCHjsVMLSEJuxgWnUkMAKkTmmE7E52ExhuX2vBGDzj+lFa7AKzRHUQ1K0qheNQZETPHj3FQSKfulF0zCYlpcVpyyAlseypcOdojC6uThxdQLt94mYTpRI2WjvduyL3kqRbGxXk1A+iYJFmywRhEyCIuEZwUXqq7Hxb+M60QYOtlsaZa3BT7PazuZxisP3VkA3/MX79a8QHH5574iWtfbZ2RDRUBDVA5HPzsbvvw6LaMZraLGodu9YdEzPhsRrBCIq985FLDKpto8mKY4WD+VWQymlXWVjpydshaiuILpcEKGxjSkfLE4VwaSqIOq5aioQ40w1IMRUEUEjgrctXkaqEZFDi1lccL1fGd5s94RKRLMMJZSTHrBGcEfiMxJ3Ne5HeYhg7CX03vgsVUZGiuesLBJqSrzUcNxgFBxHMGA2gVeRAjFkFOkJmCqSebekqzeTyrDmQ182IV8NEJtQNtytc+irBn5rwUHLqMJEvSGJlitCCCr2BsVRNFzyGdklcEQcHwAZop58SRmqEt2aZ3iJpChMuyJqlPC1CQRs51RDm08RdIAAhpzD6dCpvPpjNJ2hh5NyhvCFb5DIq0F83NKd/VY2LlWkXHFXjlTTfU1qlzNLC+OTs8Tev0JElHfZQkpkaT0GNEiVWJ8oqIjm8vdQ2GR7bAFrsGphbZHYQnthC5orm8y1fOCy9Fhy2NDyANVYr3IfGB6MXOM+Rdc+GZ48venLxG8+M46g9y734bl7wTiazlZ+hKZ1xPBFb/sA99D0t/cafrnQ3sq50sJb2+FTefOz804/50DC+++MPDeOTe+XD68GeJGXA6/ff4bJ+OfHt2edj+7ff9T59Ptz47TyD0dpv5fjoIC3AAAAAElFTkSuQmCC", Fr = (a) => a.groups ? /* @__PURE__ */ e("div", { style: { display: "flex" }, children: a.groups.slice().sort((t, l) => (t.group?.name ?? "").localeCompare(l.group?.name ?? "")).map((t, l) => /* @__PURE__ */ e("div", { style: { paddingRight: "2px" }, children: /* @__PURE__ */ e(j, { color: "blue", children: t.group?.name }) }, l)) }) : null, Nr = (a) => a.profile ? /* @__PURE__ */ e(j, { color: "green", children: a.profile?.name }) : null, Or = (a) => /* @__PURE__ */ r(Ee, { children: [
851
865
  /* @__PURE__ */ e(
852
- $,
866
+ L,
853
867
  {
854
868
  dataField: "user.avatar",
855
869
  dataType: "image",
@@ -868,7 +882,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
868
882
  }
869
883
  ),
870
884
  /* @__PURE__ */ e(
871
- $,
885
+ L,
872
886
  {
873
887
  dataField: "user.userName",
874
888
  dataType: "text",
@@ -878,7 +892,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
878
892
  }
879
893
  ),
880
894
  /* @__PURE__ */ e(
881
- $,
895
+ L,
882
896
  {
883
897
  dataField: "user.email",
884
898
  dataType: "text",
@@ -888,18 +902,18 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
888
902
  }
889
903
  ),
890
904
  /* @__PURE__ */ e(
891
- $,
905
+ L,
892
906
  {
893
907
  dataField: "expirationDate",
894
908
  dataType: "text",
895
909
  size: 300,
896
910
  header: `${a("archbase:Expira em")}`,
897
- render: (t) => /* @__PURE__ */ e(h, { size: "sm", children: t.row.expirationDate }),
911
+ render: (t) => /* @__PURE__ */ e(c, { size: "sm", children: t.row.expirationDate }),
898
912
  inputFilterType: "text"
899
913
  }
900
914
  ),
901
915
  /* @__PURE__ */ e(
902
- $,
916
+ L,
903
917
  {
904
918
  dataField: "revoked",
905
919
  dataType: "boolean",
@@ -908,7 +922,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
908
922
  }
909
923
  ),
910
924
  /* @__PURE__ */ e(
911
- $,
925
+ L,
912
926
  {
913
927
  dataField: "expired",
914
928
  dataType: "boolean",
@@ -917,7 +931,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
917
931
  }
918
932
  ),
919
933
  /* @__PURE__ */ e(
920
- $,
934
+ L,
921
935
  {
922
936
  dataField: "token",
923
937
  dataType: "text",
@@ -926,9 +940,9 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
926
940
  inputFilterType: "text"
927
941
  }
928
942
  )
929
- ] }), Nr = (a) => /* @__PURE__ */ r(Ie, { children: [
943
+ ] }), $r = (a) => /* @__PURE__ */ r(Ee, { children: [
930
944
  /* @__PURE__ */ e(
931
- $,
945
+ L,
932
946
  {
933
947
  dataField: "avatar",
934
948
  dataType: "image",
@@ -949,7 +963,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
949
963
  }
950
964
  ),
951
965
  /* @__PURE__ */ e(
952
- $,
966
+ L,
953
967
  {
954
968
  dataField: "name",
955
969
  dataType: "text",
@@ -960,7 +974,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
960
974
  }
961
975
  ),
962
976
  /* @__PURE__ */ e(
963
- $,
977
+ L,
964
978
  {
965
979
  dataField: "nickname",
966
980
  dataType: "text",
@@ -971,7 +985,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
971
985
  }
972
986
  ),
973
987
  /* @__PURE__ */ e(
974
- $,
988
+ L,
975
989
  {
976
990
  dataField: "email",
977
991
  dataType: "text",
@@ -982,7 +996,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
982
996
  }
983
997
  ),
984
998
  /* @__PURE__ */ e(
985
- $,
999
+ L,
986
1000
  {
987
1001
  dataField: "accountDeactivated",
988
1002
  dataType: "boolean",
@@ -992,32 +1006,32 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
992
1006
  }
993
1007
  ),
994
1008
  /* @__PURE__ */ e(
995
- $,
1009
+ L,
996
1010
  {
997
1011
  dataField: "profile.name",
998
1012
  dataType: "text",
999
1013
  header: `${a("archbase:Perfil")}`,
1000
1014
  size: 200,
1001
- render: (t) => Fr(t.row),
1015
+ render: (t) => Nr(t.row),
1002
1016
  inputFilterType: "text"
1003
1017
  }
1004
1018
  ),
1005
1019
  /* @__PURE__ */ e(
1006
- $,
1020
+ L,
1007
1021
  {
1008
1022
  dataField: "groups",
1009
1023
  dataType: "text",
1010
1024
  size: 300,
1011
1025
  header: `${a("archbase:Grupos")}`,
1012
- render: (t) => Pr(t.row),
1013
- exportValue: (t) => t.groups?.slice().sort((n, s) => (n.group?.name ?? "").localeCompare(s.group?.name ?? "")).map((n) => n.group?.name).filter(Boolean).join(", ") || "",
1026
+ render: (t) => Fr(t.row),
1027
+ exportValue: (t) => t.groups?.slice().sort((l, n) => (l.group?.name ?? "").localeCompare(n.group?.name ?? "")).map((l) => l.group?.name).filter(Boolean).join(", ") || "",
1014
1028
  enableSorting: !1,
1015
1029
  enableColumnFilter: !1,
1016
1030
  enableGlobalFilter: !1
1017
1031
  }
1018
1032
  ),
1019
1033
  /* @__PURE__ */ e(
1020
- $,
1034
+ L,
1021
1035
  {
1022
1036
  dataField: "isAdministrator",
1023
1037
  dataType: "boolean",
@@ -1026,7 +1040,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
1026
1040
  }
1027
1041
  ),
1028
1042
  /* @__PURE__ */ e(
1029
- $,
1043
+ L,
1030
1044
  {
1031
1045
  dataField: "changePasswordOnNextLogin",
1032
1046
  dataType: "boolean",
@@ -1036,7 +1050,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
1036
1050
  }
1037
1051
  ),
1038
1052
  /* @__PURE__ */ e(
1039
- $,
1053
+ L,
1040
1054
  {
1041
1055
  dataField: "allowPasswordChange",
1042
1056
  dataType: "boolean",
@@ -1046,7 +1060,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
1046
1060
  }
1047
1061
  ),
1048
1062
  /* @__PURE__ */ e(
1049
- $,
1063
+ L,
1050
1064
  {
1051
1065
  dataField: "allowMultipleLogins",
1052
1066
  dataType: "boolean",
@@ -1056,7 +1070,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
1056
1070
  }
1057
1071
  ),
1058
1072
  /* @__PURE__ */ e(
1059
- $,
1073
+ L,
1060
1074
  {
1061
1075
  dataField: "passwordNeverExpires",
1062
1076
  dataType: "boolean",
@@ -1066,7 +1080,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
1066
1080
  }
1067
1081
  ),
1068
1082
  /* @__PURE__ */ e(
1069
- $,
1083
+ L,
1070
1084
  {
1071
1085
  dataField: "passwordChangedAt",
1072
1086
  dataType: "datetime",
@@ -1076,7 +1090,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
1076
1090
  }
1077
1091
  ),
1078
1092
  /* @__PURE__ */ e(
1079
- $,
1093
+ L,
1080
1094
  {
1081
1095
  dataField: "accountLocked",
1082
1096
  dataType: "boolean",
@@ -1086,7 +1100,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
1086
1100
  }
1087
1101
  ),
1088
1102
  /* @__PURE__ */ e(
1089
- $,
1103
+ L,
1090
1104
  {
1091
1105
  dataField: "unlimitedAccessHours",
1092
1106
  dataType: "boolean",
@@ -1095,9 +1109,9 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
1095
1109
  size: 140
1096
1110
  }
1097
1111
  )
1098
- ] }), Or = (a) => /* @__PURE__ */ r(Ie, { children: [
1112
+ ] }), Lr = (a) => /* @__PURE__ */ r(Ee, { children: [
1099
1113
  /* @__PURE__ */ e(
1100
- $,
1114
+ L,
1101
1115
  {
1102
1116
  dataField: "name",
1103
1117
  dataType: "text",
@@ -1107,7 +1121,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
1107
1121
  }
1108
1122
  ),
1109
1123
  /* @__PURE__ */ e(
1110
- $,
1124
+ L,
1111
1125
  {
1112
1126
  dataField: "description",
1113
1127
  dataType: "text",
@@ -1116,9 +1130,9 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
1116
1130
  inputFilterType: "text"
1117
1131
  }
1118
1132
  )
1119
- ] }), $r = (a) => /* @__PURE__ */ r(Ie, { children: [
1133
+ ] }), Mr = (a) => /* @__PURE__ */ r(Ee, { children: [
1120
1134
  /* @__PURE__ */ e(
1121
- $,
1135
+ L,
1122
1136
  {
1123
1137
  dataField: "name",
1124
1138
  dataType: "text",
@@ -1128,7 +1142,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
1128
1142
  }
1129
1143
  ),
1130
1144
  /* @__PURE__ */ e(
1131
- $,
1145
+ L,
1132
1146
  {
1133
1147
  dataField: "description",
1134
1148
  dataType: "text",
@@ -1137,9 +1151,9 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
1137
1151
  inputFilterType: "text"
1138
1152
  }
1139
1153
  )
1140
- ] }), Lr = (a) => /* @__PURE__ */ r(Ie, { children: [
1154
+ ] }), Vr = (a) => /* @__PURE__ */ r(Ee, { children: [
1141
1155
  /* @__PURE__ */ e(
1142
- $,
1156
+ L,
1143
1157
  {
1144
1158
  dataField: "name",
1145
1159
  dataType: "text",
@@ -1149,7 +1163,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
1149
1163
  }
1150
1164
  ),
1151
1165
  /* @__PURE__ */ e(
1152
- $,
1166
+ L,
1153
1167
  {
1154
1168
  dataField: "description",
1155
1169
  dataType: "text",
@@ -1159,20 +1173,20 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
1159
1173
  }
1160
1174
  )
1161
1175
  ] });
1162
- function Pe({
1176
+ function De({
1163
1177
  active: a,
1164
1178
  printTitle: t,
1165
- gridRef: n,
1166
- dataSource: s,
1167
- isLoading: c,
1179
+ gridRef: l,
1180
+ dataSource: n,
1181
+ isLoading: u,
1168
1182
  error: d,
1169
- getRowId: u,
1170
- striped: x = !1,
1171
- enableRowActions: R = !0,
1172
- toolbarLeftContent: m,
1173
- renderRowActions: v,
1174
- actionsColumnWidth: A,
1175
- children: y
1183
+ getRowId: h,
1184
+ striped: A = !1,
1185
+ enableRowActions: z = !0,
1186
+ toolbarLeftContent: g,
1187
+ renderRowActions: T,
1188
+ actionsColumnWidth: R,
1189
+ children: x
1176
1190
  }) {
1177
1191
  return /* @__PURE__ */ e(
1178
1192
  re,
@@ -1187,62 +1201,62 @@ function Pe({
1187
1201
  overflow: "auto"
1188
1202
  },
1189
1203
  children: /* @__PURE__ */ e(
1190
- za,
1204
+ ka,
1191
1205
  {
1192
- gridRef: n,
1206
+ gridRef: l,
1193
1207
  printTitle: t,
1194
1208
  width: "100%",
1195
1209
  height: "100%",
1196
1210
  withBorder: !1,
1197
- dataSource: s,
1211
+ dataSource: n,
1198
1212
  withColumnBorders: !0,
1199
- striped: x,
1213
+ striped: A,
1200
1214
  enableTopToolbar: !0,
1201
- enableRowActions: R,
1215
+ enableRowActions: z,
1202
1216
  pageSize: 50,
1203
- isLoading: c,
1217
+ isLoading: u,
1204
1218
  isError: !!d,
1205
1219
  error: d,
1206
1220
  enableGlobalFilter: !0,
1207
- getRowId: u,
1208
- toolbarLeftContent: m,
1209
- renderRowActions: v,
1210
- actionsColumnWidth: A,
1211
- children: y
1221
+ getRowId: h,
1222
+ toolbarLeftContent: g,
1223
+ renderRowActions: T,
1224
+ actionsColumnWidth: R,
1225
+ children: x
1212
1226
  }
1213
1227
  )
1214
1228
  }
1215
1229
  );
1216
1230
  }
1217
- function Ye({
1231
+ function _e({
1218
1232
  dataSource: a,
1219
1233
  securityType: t,
1220
- newInstance: n,
1221
- createEntitiesWithId: s,
1222
- removeMessageKey: c,
1234
+ newInstance: l,
1235
+ createEntitiesWithId: n,
1236
+ removeMessageKey: u,
1223
1237
  setOpenedModal: d,
1224
- setOpenedPermissionsModal: u,
1225
- validationContext: x,
1226
- t: R
1238
+ setOpenedPermissionsModal: h,
1239
+ validationContext: A,
1240
+ t: z
1227
1241
  }) {
1228
- const m = a, v = (p) => m.isEmpty() ? null : m.gotoRecordByData(p) ?? null;
1242
+ const g = a, T = (p) => g.isEmpty() ? null : g.gotoRecordByData(p) ?? null;
1229
1243
  return {
1230
1244
  handleAdd: () => {
1231
- const p = n();
1232
- s || (p.id = void 0), m.insert(p), d(t);
1245
+ const p = l();
1246
+ n || (p.id = void 0), g.insert(p), d(t);
1233
1247
  },
1234
1248
  handleViewRow: (p) => {
1235
- v(p) && d(t);
1249
+ T(p) && d(t);
1236
1250
  },
1237
1251
  handleEditRow: (p) => {
1238
- v(p) && (m.isEditing() || m.edit(), d(t));
1252
+ T(p) && (g.isEditing() || g.edit(), d(t));
1239
1253
  },
1240
1254
  handleRemoveRow: (p) => {
1241
- v(p) && ge.showConfirmDialogYesNo(
1242
- `${R("archbase:Confirme")}`,
1243
- `${R(c)}${p.name} ?`,
1255
+ T(p) && ve.showConfirmDialogYesNo(
1256
+ `${z("archbase:Confirme")}`,
1257
+ `${z(u)}${p.name} ?`,
1244
1258
  () => {
1245
- m.remove();
1259
+ g.remove();
1246
1260
  },
1247
1261
  () => {
1248
1262
  }
@@ -1250,203 +1264,203 @@ function Ye({
1250
1264
  },
1251
1265
  handleSaveModal: async () => {
1252
1266
  try {
1253
- await m.save();
1267
+ await g.save();
1254
1268
  } catch {
1255
1269
  return;
1256
1270
  }
1257
- d(""), x?.clearAll();
1271
+ d(""), A?.clearAll();
1258
1272
  },
1259
1273
  handleCancelModal: () => {
1260
- d(""), m.isBrowsing() || m.cancel(), x?.clearAll();
1274
+ d(""), g.isBrowsing() || g.cancel(), A?.clearAll();
1261
1275
  },
1262
1276
  handleOpenPermissionsModal: () => {
1263
- u(t);
1277
+ h(t);
1264
1278
  }
1265
1279
  };
1266
1280
  }
1267
- function _e({
1281
+ function Ye({
1268
1282
  row: a,
1269
1283
  onView: t,
1270
- onEdit: n,
1271
- onRemove: s,
1272
- onEditPermissions: c,
1284
+ onEdit: l,
1285
+ onRemove: n,
1286
+ onEditPermissions: u,
1273
1287
  before: d,
1274
- after: u,
1275
- t: x
1288
+ after: h,
1289
+ t: A
1276
1290
  }) {
1277
- const R = oa(), { colorScheme: m } = qe(), v = m === "dark", A = (y) => v ? R.colors[y][8] : R.colors[y][4];
1291
+ const z = na(), { colorScheme: g } = qe(), T = g === "dark", R = (x) => T ? z.colors[x][8] : z.colors[x][4];
1278
1292
  return /* @__PURE__ */ r(O, { gap: 1, wrap: "nowrap", children: [
1279
1293
  d?.(a),
1280
- /* @__PURE__ */ e(fe, { variant: "transparent", onClick: () => t(a), children: /* @__PURE__ */ e(hr, { size: 20, color: A("blue") }) }),
1281
- /* @__PURE__ */ e(fe, { variant: "transparent", onClick: () => n(a), children: /* @__PURE__ */ e(Pa, { size: 20, color: A("yellow") }) }),
1282
- /* @__PURE__ */ e(fe, { variant: "transparent", onClick: () => s(a), children: /* @__PURE__ */ e(na, { size: 20, color: A("red") }) }),
1283
- /* @__PURE__ */ e(ke, { withinPortal: !0, withArrow: !0, position: "left", label: `${x("archbase:Edit permissions")}`, children: /* @__PURE__ */ e(fe, { variant: "transparent", onClick: c, children: /* @__PURE__ */ e(pr, { size: 20, color: A("green") }) }) }),
1284
- u?.(a)
1294
+ /* @__PURE__ */ e(ye, { variant: "transparent", onClick: () => t(a), children: /* @__PURE__ */ e(mr, { size: 20, color: R("blue") }) }),
1295
+ /* @__PURE__ */ e(ye, { variant: "transparent", onClick: () => l(a), children: /* @__PURE__ */ e(Fa, { size: 20, color: R("yellow") }) }),
1296
+ /* @__PURE__ */ e(ye, { variant: "transparent", onClick: () => n(a), children: /* @__PURE__ */ e(la, { size: 20, color: R("red") }) }),
1297
+ /* @__PURE__ */ e(Ie, { withinPortal: !0, withArrow: !0, position: "left", label: `${A("archbase:Edit permissions")}`, children: /* @__PURE__ */ e(ye, { variant: "transparent", onClick: u, children: /* @__PURE__ */ e(gr, { size: 20, color: R("green") }) }) }),
1298
+ h?.(a)
1285
1299
  ] });
1286
1300
  }
1287
- const ea = ({ onAdd: a, onEditPermissions: t, t: n }) => /* @__PURE__ */ r(Fe, { justify: "space-between", style: { width: "50%" }, children: [
1301
+ const ea = ({ onAdd: a, onEditPermissions: t, t: l }) => /* @__PURE__ */ r(Fe, { justify: "space-between", style: { width: "50%" }, children: [
1288
1302
  /* @__PURE__ */ r(O, { align: "end", gap: "4px", wrap: "nowrap", children: [
1289
- /* @__PURE__ */ e(X, { color: "green", leftSection: /* @__PURE__ */ e(Fa, {}), onClick: a, children: `${n("archbase:New")}` }),
1290
- /* @__PURE__ */ e(X, { color: "blue", leftSection: /* @__PURE__ */ e(Pa, {}), onClick: t, children: `${n("archbase:Edit permissions")}` })
1303
+ /* @__PURE__ */ e(X, { color: "green", leftSection: /* @__PURE__ */ e(Na, {}), onClick: a, children: `${l("archbase:New")}` }),
1304
+ /* @__PURE__ */ e(X, { color: "blue", leftSection: /* @__PURE__ */ e(Fa, {}), onClick: t, children: `${l("archbase:Edit permissions")}` })
1291
1305
  ] }),
1292
1306
  /* @__PURE__ */ e(Fe, { align: "flex-start", justify: "flex-end", style: { width: "200px" } })
1293
1307
  ] });
1294
- function mt({
1308
+ function Tt({
1295
1309
  height: a = "400px",
1296
1310
  width: t = "100%",
1297
- createEntitiesWithId: n = !0,
1298
- userModalOptions: s,
1299
- profileModalOptions: c,
1311
+ createEntitiesWithId: l = !0,
1312
+ userModalOptions: n,
1313
+ profileModalOptions: u,
1300
1314
  groupModalOptions: d,
1301
- options: u
1315
+ options: h
1302
1316
  }) {
1303
- oa(), ka("securityStore");
1304
- const x = rr(), { colorScheme: R } = qe(), [m, v] = T(void 0), [A, y] = T("users"), P = J(K.User), f = J(K.Group), w = J(K.Resource), o = J(K.Profile), [l, p] = T(""), [b, L] = T(""), E = J(K.AccessToken), { t: i } = tr(), N = Re(null), F = Re(null), G = Re(null), D = Re(null), C = Re(null), z = (M) => M.id, oe = (M) => M.id, ue = (M) => M.id, k = (M) => M.id, I = (M) => M.id, {
1317
+ na(), Ea("securityStore");
1318
+ const A = ir(), { colorScheme: z } = qe(), [g, T] = S(void 0), [R, x] = S("users"), D = J(K.User), b = J(K.Group), w = J(K.Resource), o = J(K.Profile), [s, p] = S(""), [v, $] = S(""), y = J(K.AccessToken), { t: i } = or(), N = Re(null), I = Re(null), M = Re(null), F = Re(null), C = Re(null), k = (V) => V.id, oe = (V) => V.id, me = (V) => V.id, E = (V) => V.id, P = (V) => V.id, {
1305
1319
  dataSource: q,
1306
- isLoading: U,
1307
- refreshData: j
1308
- } = Ee({
1320
+ isLoading: G,
1321
+ refreshData: Z
1322
+ } = Pe({
1309
1323
  name: "accessTokenApi",
1310
- service: E,
1311
- validator: x,
1324
+ service: y,
1325
+ validator: A,
1312
1326
  pageSize: 25,
1313
1327
  defaultSortFields: ["user.email", "expirationTime:desc"],
1314
- onError: (M, te) => {
1315
- v(M), ne.showError(`${i("archbase:WARNING")}`, M, te);
1328
+ onError: (V, te) => {
1329
+ T(V), ne.showError(`${i("archbase:WARNING")}`, V, te);
1316
1330
  }
1317
1331
  }), {
1318
1332
  dataSource: B,
1319
- isLoading: Z,
1320
- refreshData: W
1321
- } = Ee({
1333
+ isLoading: Q,
1334
+ refreshData: H
1335
+ } = Pe({
1322
1336
  name: "dsUsers",
1323
- service: P,
1324
- validator: x,
1337
+ service: D,
1338
+ validator: A,
1325
1339
  pageSize: 25,
1326
- onError: (M, te) => {
1327
- v(M), ne.showError(`${i("archbase:WARNING")}`, M, te);
1340
+ onError: (V, te) => {
1341
+ T(V), ne.showError(`${i("archbase:WARNING")}`, V, te);
1328
1342
  }
1329
1343
  }), {
1330
- dataSource: ce,
1344
+ dataSource: de,
1331
1345
  isLoading: je,
1332
1346
  refreshData: Ze
1333
- } = Ee({
1347
+ } = Pe({
1334
1348
  name: "dsGroups",
1335
- service: f,
1336
- validator: x,
1349
+ service: b,
1350
+ validator: A,
1337
1351
  pageSize: 25,
1338
- onError: (M, te) => {
1339
- v(M), ne.showError(`${i("archbase:WARNING")}`, M, te);
1352
+ onError: (V, te) => {
1353
+ T(V), ne.showError(`${i("archbase:WARNING")}`, V, te);
1340
1354
  }
1341
1355
  }), {
1342
1356
  dataSource: Le,
1343
- isLoading: Na,
1344
- refreshData: Oa
1345
- } = Ee({
1357
+ isLoading: $a,
1358
+ refreshData: La
1359
+ } = Pe({
1346
1360
  name: "dsProfile",
1347
1361
  service: o,
1348
- validator: x,
1362
+ validator: A,
1349
1363
  pageSize: 25,
1350
- onError: (M, te) => {
1351
- v(M), ne.showError(`${i("archbase:WARNING")}`, M, te);
1364
+ onError: (V, te) => {
1365
+ T(V), ne.showError(`${i("archbase:WARNING")}`, V, te);
1352
1366
  }
1353
1367
  }), {
1354
- dataSource: $a,
1355
- isLoading: La,
1356
- refreshData: Ma
1357
- } = Ee({
1368
+ dataSource: Ma,
1369
+ isLoading: Va,
1370
+ refreshData: Ua
1371
+ } = Pe({
1358
1372
  name: "dsResources",
1359
1373
  service: w,
1360
- validator: x,
1374
+ validator: A,
1361
1375
  pageSize: 25,
1362
- onError: (M, te) => {
1363
- v(M), ne.showError(`${i("archbase:WARNING")}`, M, te);
1376
+ onError: (V, te) => {
1377
+ T(V), ne.showError(`${i("archbase:WARNING")}`, V, te);
1364
1378
  }
1365
1379
  });
1366
1380
  ee(() => {
1367
- j({ filter: Ge(De.eq("revoked", "false")) }), W(), Ze(), Oa(), Ma();
1381
+ Z({ filter: Ue(Ne.eq("revoked", "false")) }), H(), Ze(), La(), Ua();
1368
1382
  }, []);
1369
- const Va = Dr(i), Ga = Nr(i), Ua = Or(i), Ba = $r(i), Wa = Lr(i), Qe = ir(), he = Ye({
1383
+ const Ga = Or(i), Ba = $r(i), Ha = Lr(i), qa = Mr(i), Wa = Vr(i), Qe = nr(), ge = _e({
1370
1384
  dataSource: B,
1371
- securityType: Y.USER,
1372
- newInstance: () => mr.newInstance(),
1373
- createEntitiesWithId: n,
1385
+ securityType: _.USER,
1386
+ newInstance: () => fr.newInstance(),
1387
+ createEntitiesWithId: l,
1374
1388
  removeMessageKey: "archbase:Deseja remover o usuário ",
1375
1389
  setOpenedModal: p,
1376
- setOpenedPermissionsModal: L,
1390
+ setOpenedPermissionsModal: $,
1377
1391
  validationContext: Qe,
1378
1392
  t: i
1379
- }), pe = Ye({
1380
- dataSource: ce,
1381
- securityType: Y.GROUP,
1382
- newInstance: () => gr.newInstance(),
1383
- createEntitiesWithId: n,
1393
+ }), fe = _e({
1394
+ dataSource: de,
1395
+ securityType: _.GROUP,
1396
+ newInstance: () => br.newInstance(),
1397
+ createEntitiesWithId: l,
1384
1398
  removeMessageKey: "archbase:Deseja remover o grupo ",
1385
1399
  setOpenedModal: p,
1386
- setOpenedPermissionsModal: L,
1400
+ setOpenedPermissionsModal: $,
1387
1401
  validationContext: Qe,
1388
1402
  t: i
1389
- }), me = Ye({
1403
+ }), be = _e({
1390
1404
  dataSource: Le,
1391
- securityType: Y.PROFILE,
1392
- newInstance: () => fr.newInstance(),
1393
- createEntitiesWithId: n,
1405
+ securityType: _.PROFILE,
1406
+ newInstance: () => vr.newInstance(),
1407
+ createEntitiesWithId: l,
1394
1408
  removeMessageKey: "archbase:Deseja remover o perfil ",
1395
1409
  setOpenedModal: p,
1396
- setOpenedPermissionsModal: L,
1410
+ setOpenedPermissionsModal: $,
1397
1411
  validationContext: Qe,
1398
1412
  t: i
1399
- }), qa = (M) => /* @__PURE__ */ e(
1400
- _e,
1413
+ }), ja = (V) => /* @__PURE__ */ e(
1414
+ Ye,
1401
1415
  {
1402
- row: M,
1403
- onView: he.handleViewRow,
1404
- onEdit: he.handleEditRow,
1405
- onRemove: he.handleRemoveRow,
1406
- onEditPermissions: he.handleOpenPermissionsModal,
1407
- before: u?.beforeDefaultUserActions,
1408
- after: u?.afterDefaultUserActions,
1416
+ row: V,
1417
+ onView: ge.handleViewRow,
1418
+ onEdit: ge.handleEditRow,
1419
+ onRemove: ge.handleRemoveRow,
1420
+ onEditPermissions: ge.handleOpenPermissionsModal,
1421
+ before: h?.beforeDefaultUserActions,
1422
+ after: h?.afterDefaultUserActions,
1409
1423
  t: i
1410
1424
  }
1411
- ), Ha = (M) => /* @__PURE__ */ e(
1412
- _e,
1425
+ ), Za = (V) => /* @__PURE__ */ e(
1426
+ Ye,
1413
1427
  {
1414
- row: M,
1415
- onView: pe.handleViewRow,
1416
- onEdit: pe.handleEditRow,
1417
- onRemove: pe.handleRemoveRow,
1418
- onEditPermissions: pe.handleOpenPermissionsModal,
1419
- before: u?.beforeDefaultGroupActions,
1420
- after: u?.afterDefaultGroupActions,
1428
+ row: V,
1429
+ onView: fe.handleViewRow,
1430
+ onEdit: fe.handleEditRow,
1431
+ onRemove: fe.handleRemoveRow,
1432
+ onEditPermissions: fe.handleOpenPermissionsModal,
1433
+ before: h?.beforeDefaultGroupActions,
1434
+ after: h?.afterDefaultGroupActions,
1421
1435
  t: i
1422
1436
  }
1423
- ), ja = (M) => /* @__PURE__ */ e(
1424
- _e,
1437
+ ), Qa = (V) => /* @__PURE__ */ e(
1438
+ Ye,
1425
1439
  {
1426
- row: M,
1427
- onView: me.handleViewRow,
1428
- onEdit: me.handleEditRow,
1429
- onRemove: me.handleRemoveRow,
1430
- onEditPermissions: me.handleOpenPermissionsModal,
1431
- before: u?.beforeDefaultProfileActions,
1432
- after: u?.afterDefaultProfileActions,
1440
+ row: V,
1441
+ onView: be.handleViewRow,
1442
+ onEdit: be.handleEditRow,
1443
+ onRemove: be.handleRemoveRow,
1444
+ onEditPermissions: be.handleOpenPermissionsModal,
1445
+ before: h?.beforeDefaultProfileActions,
1446
+ after: h?.afterDefaultProfileActions,
1433
1447
  t: i
1434
1448
  }
1435
- ), Za = () => {
1436
- const M = q.getCurrentRecord();
1437
- M && ge.showConfirmDialogYesNo(
1449
+ ), Ka = () => {
1450
+ const V = q.getCurrentRecord();
1451
+ V && ve.showConfirmDialogYesNo(
1438
1452
  `${i("archbase:Confirme")}`,
1439
- `${i("archbase:Deseja revogar o token de Acesso do usuário ")}${M.user.name} ?`,
1453
+ `${i("archbase:Deseja revogar o token de Acesso do usuário ")}${V.user.name} ?`,
1440
1454
  async () => {
1441
- await E.revoke(M.token).then(async () => {
1455
+ await y.revoke(V.token).then(async () => {
1442
1456
  ne.showSuccess(
1443
1457
  `${i("mentors:Informação")}`,
1444
1458
  `${i("mentors:Token de Acesso revogado com sucesso!")}`
1445
1459
  ), q.refreshData();
1446
1460
  }).catch((te) => {
1447
- ge.showErrorWithDetails(
1461
+ ve.showErrorWithDetails(
1448
1462
  `${i("mentors:Atenção")}`,
1449
- be(te),
1463
+ Te(te),
1450
1464
  Ve(te)
1451
1465
  );
1452
1466
  });
@@ -1455,223 +1469,223 @@ function mt({
1455
1469
  }
1456
1470
  );
1457
1471
  }, Ke = () => {
1458
- L("");
1459
- }, Qa = () => /* @__PURE__ */ e(Fe, { justify: "space-between", style: { width: "50%" }, children: /* @__PURE__ */ e(O, { align: "start", gap: "4px", wrap: "nowrap", children: /* @__PURE__ */ e(
1472
+ $("");
1473
+ }, Ja = () => /* @__PURE__ */ e(Fe, { justify: "space-between", style: { width: "50%" }, children: /* @__PURE__ */ e(O, { align: "start", gap: "4px", wrap: "nowrap", children: /* @__PURE__ */ e(
1460
1474
  X,
1461
1475
  {
1462
1476
  disabled: !q.getCurrentRecord(),
1463
1477
  color: "red",
1464
- leftSection: /* @__PURE__ */ e(na, {}),
1465
- onClick: Za,
1478
+ leftSection: /* @__PURE__ */ e(la, {}),
1479
+ onClick: Ka,
1466
1480
  children: `${i("archbase:Revoke")}`
1467
1481
  }
1468
1482
  ) }) });
1469
1483
  return /* @__PURE__ */ r(re, { p: "md", style: { height: a, display: "flex", flexDirection: "column" }, children: [
1470
- /* @__PURE__ */ e(Ce, { variant: "pills", value: A, onChange: y, children: /* @__PURE__ */ r(Ce.List, { children: [
1471
- /* @__PURE__ */ e(Ce.Tab, { value: "users", children: `${i("Usuários")}` }),
1472
- /* @__PURE__ */ e(Ce.Tab, { value: "groups", children: `${i("Grupos")}` }),
1473
- /* @__PURE__ */ e(Ce.Tab, { value: "profiles", children: `${i("Perfis")}` }),
1474
- /* @__PURE__ */ e(Ce.Tab, { value: "resources", children: `${i("Recursos")}` }),
1475
- /* @__PURE__ */ e(Ce.Tab, { value: "accessTokens", children: `${i("Tokens Acesso")}` })
1484
+ /* @__PURE__ */ e(we, { variant: "pills", value: R, onChange: x, children: /* @__PURE__ */ r(we.List, { children: [
1485
+ /* @__PURE__ */ e(we.Tab, { value: "users", children: `${i("Usuários")}` }),
1486
+ /* @__PURE__ */ e(we.Tab, { value: "groups", children: `${i("Grupos")}` }),
1487
+ /* @__PURE__ */ e(we.Tab, { value: "profiles", children: `${i("Perfis")}` }),
1488
+ /* @__PURE__ */ e(we.Tab, { value: "resources", children: `${i("Recursos")}` }),
1489
+ /* @__PURE__ */ e(we.Tab, { value: "accessTokens", children: `${i("Tokens Acesso")}` })
1476
1490
  ] }) }),
1477
1491
  /* @__PURE__ */ e(
1478
- Pe,
1492
+ De,
1479
1493
  {
1480
- active: A === "users",
1494
+ active: R === "users",
1481
1495
  printTitle: "Usuários",
1482
1496
  gridRef: N,
1483
1497
  dataSource: B,
1484
- isLoading: Z,
1485
- error: m,
1486
- getRowId: z,
1498
+ isLoading: Q,
1499
+ error: g,
1500
+ getRowId: k,
1487
1501
  striped: !0,
1488
1502
  toolbarLeftContent: /* @__PURE__ */ e(
1489
1503
  ea,
1490
1504
  {
1491
- onAdd: he.handleAdd,
1492
- onEditPermissions: he.handleOpenPermissionsModal,
1505
+ onAdd: ge.handleAdd,
1506
+ onEditPermissions: ge.handleOpenPermissionsModal,
1493
1507
  t: i
1494
1508
  }
1495
1509
  ),
1496
- renderRowActions: qa,
1497
- actionsColumnWidth: u?.userActionsColumnWidth,
1498
- children: Ga
1510
+ renderRowActions: ja,
1511
+ actionsColumnWidth: h?.userActionsColumnWidth,
1512
+ children: Ba
1499
1513
  }
1500
1514
  ),
1501
1515
  /* @__PURE__ */ e(
1502
- Pe,
1516
+ De,
1503
1517
  {
1504
- active: A === "groups",
1518
+ active: R === "groups",
1505
1519
  printTitle: "Grupos",
1506
- gridRef: F,
1507
- dataSource: ce,
1520
+ gridRef: I,
1521
+ dataSource: de,
1508
1522
  isLoading: je,
1509
- error: m,
1523
+ error: g,
1510
1524
  getRowId: oe,
1511
1525
  toolbarLeftContent: /* @__PURE__ */ e(
1512
1526
  ea,
1513
1527
  {
1514
- onAdd: pe.handleAdd,
1515
- onEditPermissions: pe.handleOpenPermissionsModal,
1528
+ onAdd: fe.handleAdd,
1529
+ onEditPermissions: fe.handleOpenPermissionsModal,
1516
1530
  t: i
1517
1531
  }
1518
1532
  ),
1519
- renderRowActions: Ha,
1520
- actionsColumnWidth: u?.groupActionsColumnWidth,
1521
- children: Ua
1533
+ renderRowActions: Za,
1534
+ actionsColumnWidth: h?.groupActionsColumnWidth,
1535
+ children: Ha
1522
1536
  }
1523
1537
  ),
1524
1538
  /* @__PURE__ */ e(
1525
- Pe,
1539
+ De,
1526
1540
  {
1527
- active: A === "profiles",
1541
+ active: R === "profiles",
1528
1542
  printTitle: "Perfis",
1529
- gridRef: G,
1543
+ gridRef: M,
1530
1544
  dataSource: Le,
1531
- isLoading: Na,
1532
- error: m,
1533
- getRowId: ue,
1545
+ isLoading: $a,
1546
+ error: g,
1547
+ getRowId: me,
1534
1548
  toolbarLeftContent: /* @__PURE__ */ e(
1535
1549
  ea,
1536
1550
  {
1537
- onAdd: me.handleAdd,
1538
- onEditPermissions: me.handleOpenPermissionsModal,
1551
+ onAdd: be.handleAdd,
1552
+ onEditPermissions: be.handleOpenPermissionsModal,
1539
1553
  t: i
1540
1554
  }
1541
1555
  ),
1542
- renderRowActions: ja,
1543
- actionsColumnWidth: u?.profileActionsColumnWidth,
1544
- children: Ba
1556
+ renderRowActions: Qa,
1557
+ actionsColumnWidth: h?.profileActionsColumnWidth,
1558
+ children: qa
1545
1559
  }
1546
1560
  ),
1547
1561
  /* @__PURE__ */ e(
1548
- Pe,
1562
+ De,
1549
1563
  {
1550
- active: A === "resources",
1564
+ active: R === "resources",
1551
1565
  printTitle: "Recursos",
1552
- gridRef: D,
1553
- dataSource: $a,
1554
- isLoading: La,
1555
- error: m,
1556
- getRowId: k,
1566
+ gridRef: F,
1567
+ dataSource: Ma,
1568
+ isLoading: Va,
1569
+ error: g,
1570
+ getRowId: E,
1557
1571
  enableRowActions: !1,
1558
1572
  children: Wa
1559
1573
  }
1560
1574
  ),
1561
1575
  /* @__PURE__ */ e(
1562
- Pe,
1576
+ De,
1563
1577
  {
1564
- active: A === "accessTokens",
1578
+ active: R === "accessTokens",
1565
1579
  printTitle: "Tokens de API",
1566
1580
  gridRef: C,
1567
1581
  dataSource: q,
1568
- isLoading: U,
1569
- error: m,
1570
- getRowId: I,
1582
+ isLoading: G,
1583
+ error: g,
1584
+ getRowId: P,
1571
1585
  striped: !0,
1572
1586
  enableRowActions: !1,
1573
- toolbarLeftContent: Qa(),
1574
- children: Va
1587
+ toolbarLeftContent: Ja(),
1588
+ children: Ga
1575
1589
  }
1576
1590
  ),
1577
- l === Y.USER ? /* @__PURE__ */ e(
1578
- zr,
1591
+ s === _.USER ? /* @__PURE__ */ e(
1592
+ kr,
1579
1593
  {
1580
- onClickOk: he.handleSaveModal,
1594
+ onClickOk: ge.handleSaveModal,
1581
1595
  opened: !0,
1582
1596
  dataSource: B,
1583
- onClickCancel: he.handleCancelModal,
1584
- options: s
1597
+ onClickCancel: ge.handleCancelModal,
1598
+ options: n
1585
1599
  }
1586
1600
  ) : null,
1587
- l === Y.GROUP ? /* @__PURE__ */ e(
1588
- kr,
1601
+ s === _.GROUP ? /* @__PURE__ */ e(
1602
+ Er,
1589
1603
  {
1590
- onClickOk: pe.handleSaveModal,
1604
+ onClickOk: fe.handleSaveModal,
1591
1605
  opened: !0,
1592
- dataSource: ce,
1593
- onClickCancel: pe.handleCancelModal,
1606
+ dataSource: de,
1607
+ onClickCancel: fe.handleCancelModal,
1594
1608
  options: d
1595
1609
  }
1596
1610
  ) : null,
1597
- l === Y.PROFILE ? /* @__PURE__ */ e(
1598
- xr,
1611
+ s === _.PROFILE ? /* @__PURE__ */ e(
1612
+ Ar,
1599
1613
  {
1600
- onClickOk: me.handleSaveModal,
1614
+ onClickOk: be.handleSaveModal,
1601
1615
  opened: !0,
1602
1616
  dataSource: Le,
1603
- onClickCancel: me.handleCancelModal,
1604
- options: c
1617
+ onClickCancel: be.handleCancelModal,
1618
+ options: u
1605
1619
  }
1606
1620
  ) : null,
1607
- b === Y.USER ? /* @__PURE__ */ e(
1621
+ v === _.USER ? /* @__PURE__ */ e(
1608
1622
  Xe,
1609
1623
  {
1610
1624
  dataSource: B,
1611
- opened: !!b,
1625
+ opened: !!v,
1612
1626
  close: Ke
1613
1627
  }
1614
1628
  ) : null,
1615
- b === Y.GROUP ? /* @__PURE__ */ e(
1629
+ v === _.GROUP ? /* @__PURE__ */ e(
1616
1630
  Xe,
1617
1631
  {
1618
- dataSource: ce,
1619
- opened: !!b,
1632
+ dataSource: de,
1633
+ opened: !!v,
1620
1634
  close: Ke
1621
1635
  }
1622
1636
  ) : null,
1623
- b === Y.PROFILE ? /* @__PURE__ */ e(
1637
+ v === _.PROFILE ? /* @__PURE__ */ e(
1624
1638
  Xe,
1625
1639
  {
1626
1640
  dataSource: Le,
1627
- opened: !!b,
1641
+ opened: !!v,
1628
1642
  close: Ke
1629
1643
  }
1630
1644
  ) : null
1631
1645
  ] });
1632
1646
  }
1633
- function gt({ height: a = "400px", width: t = "100%" }) {
1634
- oa();
1635
- const n = ka("apiTokenStore"), s = { validateEntity: () => [] }, { colorScheme: c } = qe(), [d, u] = T(void 0), x = J(K.ApiToken), [R, m] = T(""), v = Re(null), A = (F) => F.id, { dataSource: y } = dr({
1647
+ function wt({ height: a = "400px", width: t = "100%" }) {
1648
+ na();
1649
+ const l = Ea("apiTokenStore"), n = { validateEntity: () => [] }, { colorScheme: u } = qe(), [d, h] = S(void 0), A = J(K.ApiToken), [z, g] = S(""), T = Re(null), R = (I) => I.id, { dataSource: x } = hr({
1636
1650
  initialData: [],
1637
1651
  name: "dataSource"
1638
- }), P = Ne(
1652
+ }), D = Oe(
1639
1653
  "ArchbaseApiTokenView-LocalDataSource",
1640
- y,
1654
+ x,
1641
1655
  void 0,
1642
1656
  void 0
1643
- ), { dataSource: f, isLoading: w } = ta({
1657
+ ), { dataSource: b, isLoading: w } = ia({
1644
1658
  name: "dsApiToken",
1645
- service: x,
1646
- store: n,
1647
- validator: s,
1659
+ service: A,
1660
+ store: l,
1661
+ validator: n,
1648
1662
  pageSize: 25,
1649
1663
  loadOnStart: !0,
1650
- onLoadComplete: (F) => {
1664
+ onLoadComplete: (I) => {
1651
1665
  },
1652
- onDestroy: (F) => {
1666
+ onDestroy: (I) => {
1653
1667
  },
1654
- onError: (F, G) => {
1655
- u(F), ne.showError(g().t("archbase:WARNING"), F, G);
1668
+ onError: (I, M) => {
1669
+ h(I), ne.showError(f().t("archbase:WARNING"), I, M);
1656
1670
  }
1657
- }), o = Ne(
1671
+ }), o = Oe(
1658
1672
  "ArchbaseApiTokenView-RemoteDataSource",
1659
- f,
1673
+ b,
1660
1674
  void 0,
1661
1675
  void 0
1662
- ), l = `calc(${a} - 40px)`, p = /* @__PURE__ */ r(Ie, { children: [
1676
+ ), s = `calc(${a} - 40px)`, p = /* @__PURE__ */ r(Ee, { children: [
1663
1677
  /* @__PURE__ */ e(
1664
- $,
1678
+ L,
1665
1679
  {
1666
1680
  dataField: "user.avatar",
1667
1681
  dataType: "image",
1668
1682
  size: 80,
1669
1683
  header: "Foto",
1670
- render: (F) => /* @__PURE__ */ e(
1684
+ render: (I) => /* @__PURE__ */ e(
1671
1685
  "img",
1672
1686
  {
1673
1687
  style: { borderRadius: 50, height: "32px", maxHeight: "32px" },
1674
- src: F.row.user && F.row.user.avatar ? atob(F.row.user.avatar) : sa
1688
+ src: I.row.user && I.row.user.avatar ? atob(I.row.user.avatar) : sa
1675
1689
  }
1676
1690
  ),
1677
1691
  inputFilterType: "text",
@@ -1679,7 +1693,7 @@ function gt({ height: a = "400px", width: t = "100%" }) {
1679
1693
  }
1680
1694
  ),
1681
1695
  /* @__PURE__ */ e(
1682
- $,
1696
+ L,
1683
1697
  {
1684
1698
  dataField: "user.userName",
1685
1699
  dataType: "text",
@@ -1689,7 +1703,7 @@ function gt({ height: a = "400px", width: t = "100%" }) {
1689
1703
  }
1690
1704
  ),
1691
1705
  /* @__PURE__ */ e(
1692
- $,
1706
+ L,
1693
1707
  {
1694
1708
  dataField: "user.email",
1695
1709
  dataType: "text",
@@ -1699,7 +1713,7 @@ function gt({ height: a = "400px", width: t = "100%" }) {
1699
1713
  }
1700
1714
  ),
1701
1715
  /* @__PURE__ */ e(
1702
- $,
1716
+ L,
1703
1717
  {
1704
1718
  dataField: "name",
1705
1719
  dataType: "text",
@@ -1709,7 +1723,7 @@ function gt({ height: a = "400px", width: t = "100%" }) {
1709
1723
  }
1710
1724
  ),
1711
1725
  /* @__PURE__ */ e(
1712
- $,
1726
+ L,
1713
1727
  {
1714
1728
  dataField: "description",
1715
1729
  dataType: "text",
@@ -1719,7 +1733,7 @@ function gt({ height: a = "400px", width: t = "100%" }) {
1719
1733
  }
1720
1734
  ),
1721
1735
  /* @__PURE__ */ e(
1722
- $,
1736
+ L,
1723
1737
  {
1724
1738
  dataField: "token",
1725
1739
  dataType: "text",
@@ -1730,7 +1744,7 @@ function gt({ height: a = "400px", width: t = "100%" }) {
1730
1744
  }
1731
1745
  ),
1732
1746
  /* @__PURE__ */ e(
1733
- $,
1747
+ L,
1734
1748
  {
1735
1749
  dataField: "tenantId",
1736
1750
  dataType: "text",
@@ -1741,41 +1755,41 @@ function gt({ height: a = "400px", width: t = "100%" }) {
1741
1755
  }
1742
1756
  ),
1743
1757
  /* @__PURE__ */ e(
1744
- $,
1758
+ L,
1745
1759
  {
1746
1760
  dataField: "expirationDate",
1747
1761
  dataType: "text",
1748
1762
  size: 240,
1749
1763
  header: "Validade",
1750
- render: (F) => {
1751
- if (!F.row.expirationDate)
1752
- return /* @__PURE__ */ e(h, { c: "dimmed", children: "Sem expiração" });
1753
- const G = /* @__PURE__ */ new Date();
1754
- G.setHours(0, 0, 0, 0);
1755
- const D = new Date(F.row.expirationDate);
1756
- D.setHours(0, 0, 0, 0);
1757
- const C = D.getTime() - G.getTime(), z = Math.ceil(C / (1e3 * 60 * 60 * 24));
1758
- let ue = Math.max(0, Math.min(100, z / 365 * 100)), k = "green", I = "";
1759
- z < 0 ? (k = "red", ue = 100, I = `Vencido há ${Math.abs(z)} dia${Math.abs(z) !== 1 ? "s" : ""}`) : z === 0 ? (k = "red", ue = 5, I = "Vence hoje") : z <= 7 ? (k = "red", I = `${z} dia${z !== 1 ? "s" : ""}`) : z <= 30 ? (k = "orange", I = `${z} dias`) : z <= 90 ? (k = "yellow", I = `${z} dias`) : (k = "green", I = `${z} dias`);
1760
- const q = z < 0 ? `Vencido em ${D.toLocaleDateString()}` : `Expira em ${D.toLocaleDateString()}`;
1761
- return /* @__PURE__ */ e(ke, { label: q, withArrow: !0, children: /* @__PURE__ */ r(O, { gap: "xs", wrap: "nowrap", children: [
1764
+ render: (I) => {
1765
+ if (!I.row.expirationDate)
1766
+ return /* @__PURE__ */ e(c, { c: "dimmed", children: "Sem expiração" });
1767
+ const M = /* @__PURE__ */ new Date();
1768
+ M.setHours(0, 0, 0, 0);
1769
+ const F = new Date(I.row.expirationDate);
1770
+ F.setHours(0, 0, 0, 0);
1771
+ const C = F.getTime() - M.getTime(), k = Math.ceil(C / (1e3 * 60 * 60 * 24));
1772
+ let me = Math.max(0, Math.min(100, k / 365 * 100)), E = "green", P = "";
1773
+ k < 0 ? (E = "red", me = 100, P = `Vencido há ${Math.abs(k)} dia${Math.abs(k) !== 1 ? "s" : ""}`) : k === 0 ? (E = "red", me = 5, P = "Vence hoje") : k <= 7 ? (E = "red", P = `${k} dia${k !== 1 ? "s" : ""}`) : k <= 30 ? (E = "orange", P = `${k} dias`) : k <= 90 ? (E = "yellow", P = `${k} dias`) : (E = "green", P = `${k} dias`);
1774
+ const q = k < 0 ? `Vencido em ${F.toLocaleDateString()}` : `Expira em ${F.toLocaleDateString()}`;
1775
+ return /* @__PURE__ */ e(Ie, { label: q, withArrow: !0, children: /* @__PURE__ */ r(O, { gap: "xs", wrap: "nowrap", children: [
1762
1776
  /* @__PURE__ */ e(
1763
- Ka,
1777
+ Xa,
1764
1778
  {
1765
1779
  size: 36,
1766
1780
  thickness: 4,
1767
1781
  roundCaps: !0,
1768
- sections: [{ value: z < 0 ? 100 : ue, color: k }]
1782
+ sections: [{ value: k < 0 ? 100 : me, color: E }]
1769
1783
  }
1770
1784
  ),
1771
- /* @__PURE__ */ e(h, { size: "sm", c: z < 0 ? "red" : void 0, fw: z <= 7 ? 600 : void 0, children: I })
1785
+ /* @__PURE__ */ e(c, { size: "sm", c: k < 0 ? "red" : void 0, fw: k <= 7 ? 600 : void 0, children: P })
1772
1786
  ] }) });
1773
1787
  },
1774
1788
  inputFilterType: "text"
1775
1789
  }
1776
1790
  ),
1777
1791
  /* @__PURE__ */ e(
1778
- $,
1792
+ L,
1779
1793
  {
1780
1794
  dataField: "activated",
1781
1795
  dataType: "boolean",
@@ -1784,7 +1798,7 @@ function gt({ height: a = "400px", width: t = "100%" }) {
1784
1798
  }
1785
1799
  ),
1786
1800
  /* @__PURE__ */ e(
1787
- $,
1801
+ L,
1788
1802
  {
1789
1803
  dataField: "revoked",
1790
1804
  dataType: "boolean",
@@ -1792,59 +1806,59 @@ function gt({ height: a = "400px", width: t = "100%" }) {
1792
1806
  inputFilterType: "checkbox"
1793
1807
  }
1794
1808
  )
1795
- ] }), b = () => {
1796
- y.insert(br.newInstance()), y && !P.isDataSourceV2 && P.v1State.forceUpdate(), m("apiToken");
1797
- }, L = () => {
1798
- f.getCurrentRecord() && ge.showConfirmDialogYesNo(
1799
- `${g().t("archbase:Confirme")}`,
1800
- `${g().t("archbase:Deseja revogar o token de API do usuário ")}${f.getCurrentRecord().user.name} ?`,
1809
+ ] }), v = () => {
1810
+ x.insert(yr.newInstance()), x && !D.isDataSourceV2 && D.v1State.forceUpdate(), g("apiToken");
1811
+ }, $ = () => {
1812
+ b.getCurrentRecord() && ve.showConfirmDialogYesNo(
1813
+ `${f().t("archbase:Confirme")}`,
1814
+ `${f().t("archbase:Deseja revogar o token de API do usuário ")}${b.getCurrentRecord().user.name} ?`,
1801
1815
  async () => {
1802
- await x.revoke(f.getCurrentRecord().token).then(async () => {
1816
+ await A.revoke(b.getCurrentRecord().token).then(async () => {
1803
1817
  ne.showSuccess(
1804
- `${g().t("mentors:Informação")}`,
1805
- `${g().t("mentors:Token de API revogado com sucesso!")}`
1806
- ), f.refreshData(), f && !o.isDataSourceV2 && o.v1State.forceUpdate();
1807
- }).catch((F) => {
1808
- ge.showErrorWithDetails(
1809
- `${g().t("mentors:Atenção")}`,
1810
- be(F),
1811
- Ve(F)
1818
+ `${f().t("mentors:Informação")}`,
1819
+ `${f().t("mentors:Token de API revogado com sucesso!")}`
1820
+ ), b.refreshData(), b && !o.isDataSourceV2 && o.v1State.forceUpdate();
1821
+ }).catch((I) => {
1822
+ ve.showErrorWithDetails(
1823
+ `${f().t("mentors:Atenção")}`,
1824
+ Te(I),
1825
+ Ve(I)
1812
1826
  );
1813
1827
  });
1814
1828
  },
1815
1829
  () => {
1816
1830
  }
1817
1831
  );
1818
- }, E = () => {
1819
- m("");
1820
- }, i = async (F, G) => {
1821
- const D = y.getCurrentRecord();
1822
- if (D)
1832
+ }, y = () => {
1833
+ g("");
1834
+ }, i = async (I, M) => {
1835
+ const F = x.getCurrentRecord();
1836
+ if (F)
1823
1837
  try {
1824
- if (y.validate(), !D.user || !D.user.email) {
1825
- ge.showErrorWithDetails(
1826
- `${g().t("archbase:WARNING")}`,
1827
- `${g().t("archbase:Selecione um usuário para o token de API")}`,
1838
+ if (x.validate(), !F.user || !F.user.email) {
1839
+ ve.showErrorWithDetails(
1840
+ `${f().t("archbase:WARNING")}`,
1841
+ `${f().t("archbase:Selecione um usuário para o token de API")}`,
1828
1842
  ""
1829
1843
  );
1830
1844
  return;
1831
1845
  }
1832
- await x.create(D.user.email, D.expirationDate, D.name, D.description).then(async (C) => {
1833
- y.cancel(), y && !P.isDataSourceV2 && P.v1State.forceUpdate(), f.append(C), f && !o.isDataSourceV2 && o.v1State.forceUpdate(), ne.showSuccess(
1834
- `${g().t("mentors:Informação")}`,
1835
- `${g().t("mentors:Token de API gerado com sucesso!")}`
1836
- ), G && G(!0);
1846
+ await A.create(F.user.email, F.expirationDate, F.name, F.description).then(async (C) => {
1847
+ x.cancel(), x && !D.isDataSourceV2 && D.v1State.forceUpdate(), b.append(C), b && !o.isDataSourceV2 && o.v1State.forceUpdate(), ne.showSuccess(
1848
+ `${f().t("mentors:Informação")}`,
1849
+ `${f().t("mentors:Token de API gerado com sucesso!")}`
1850
+ ), M && M(!0);
1837
1851
  }).catch((C) => {
1838
- ge.showErrorWithDetails(
1839
- `${g().t("mentors:Atenção")}`,
1840
- be(C),
1852
+ ve.showErrorWithDetails(
1853
+ `${f().t("mentors:Atenção")}`,
1854
+ Te(C),
1841
1855
  Ve(C)
1842
1856
  );
1843
1857
  });
1844
1858
  } catch (C) {
1845
- ge.showErrorWithDetails(
1846
- `${g().t("mentors:Atenção")}`,
1847
- be(C),
1859
+ ve.showErrorWithDetails(
1860
+ `${f().t("mentors:Atenção")}`,
1861
+ Te(C),
1848
1862
  Ve(C)
1849
1863
  );
1850
1864
  }
@@ -1855,7 +1869,7 @@ function gt({ height: a = "400px", width: t = "100%" }) {
1855
1869
  {
1856
1870
  withBorder: !0,
1857
1871
  style: {
1858
- height: l,
1872
+ height: s,
1859
1873
  display: "flex",
1860
1874
  width: "100%",
1861
1875
  flex: 1,
@@ -1863,14 +1877,14 @@ function gt({ height: a = "400px", width: t = "100%" }) {
1863
1877
  overflow: "auto"
1864
1878
  },
1865
1879
  children: /* @__PURE__ */ e(
1866
- za,
1880
+ ka,
1867
1881
  {
1868
- gridRef: v,
1882
+ gridRef: T,
1869
1883
  printTitle: "Tokens de API",
1870
1884
  width: "100%",
1871
1885
  height: "100%",
1872
1886
  withBorder: !1,
1873
- dataSource: f,
1887
+ dataSource: b,
1874
1888
  withColumnBorders: !0,
1875
1889
  striped: !0,
1876
1890
  enableTopToolbar: !0,
@@ -1880,29 +1894,29 @@ function gt({ height: a = "400px", width: t = "100%" }) {
1880
1894
  isError: !!d,
1881
1895
  error: d,
1882
1896
  enableGlobalFilter: !0,
1883
- getRowId: A,
1897
+ getRowId: R,
1884
1898
  toolbarLeftContent: /* @__PURE__ */ e(Fe, { justify: "space-between", style: { width: "50%" }, children: /* @__PURE__ */ r(O, { align: "start", gap: "2px", wrap: "nowrap", children: [
1885
- /* @__PURE__ */ e(X, { color: "green", leftSection: /* @__PURE__ */ e(Fa, {}), onClick: b, children: g().t("archbase:New") }),
1886
- /* @__PURE__ */ e(X, { disabled: !f.getCurrentRecord(), color: "red", leftSection: /* @__PURE__ */ e(na, {}), onClick: L, children: g().t("archbase:Revoke") })
1899
+ /* @__PURE__ */ e(X, { color: "green", leftSection: /* @__PURE__ */ e(Na, {}), onClick: v, children: f().t("archbase:New") }),
1900
+ /* @__PURE__ */ e(X, { disabled: !b.getCurrentRecord(), color: "red", leftSection: /* @__PURE__ */ e(la, {}), onClick: $, children: f().t("archbase:Revoke") })
1887
1901
  ] }) }),
1888
1902
  children: p
1889
1903
  }
1890
1904
  )
1891
1905
  }
1892
1906
  ),
1893
- R === "apiToken" ? /* @__PURE__ */ e(
1894
- Er,
1907
+ z === "apiToken" ? /* @__PURE__ */ e(
1908
+ Dr,
1895
1909
  {
1896
- onClickOk: E,
1910
+ onClickOk: y,
1897
1911
  opened: !0,
1898
- dataSource: y,
1912
+ dataSource: x,
1899
1913
  onCustomSave: i,
1900
- onClickCancel: E
1914
+ onClickCancel: y
1901
1915
  }
1902
1916
  ) : null
1903
1917
  ] });
1904
1918
  }
1905
- const Ue = (a) => {
1919
+ const Ge = (a) => {
1906
1920
  switch (a) {
1907
1921
  case "critical":
1908
1922
  return "red";
@@ -1913,114 +1927,114 @@ const Ue = (a) => {
1913
1927
  default:
1914
1928
  return "gray";
1915
1929
  }
1916
- }, Mr = ({ card: a, onOpen: t }) => {
1917
- const n = !!(t && a.metric);
1930
+ }, Ur = ({ card: a, onOpen: t }) => {
1931
+ const l = !!(t && a.metric);
1918
1932
  return /* @__PURE__ */ e(
1919
1933
  re,
1920
1934
  {
1921
1935
  withBorder: !0,
1922
1936
  radius: "md",
1923
1937
  p: "sm",
1924
- role: n ? "button" : void 0,
1925
- tabIndex: n ? 0 : void 0,
1926
- "aria-label": n ? `Ver os itens de ${a.label}` : void 0,
1927
- onClick: n ? () => t?.(a) : void 0,
1928
- onKeyDown: n ? (s) => {
1929
- (s.key === "Enter" || s.key === " ") && (s.preventDefault(), t?.(a));
1938
+ role: l ? "button" : void 0,
1939
+ tabIndex: l ? 0 : void 0,
1940
+ "aria-label": l ? `Ver os itens de ${a.label}` : void 0,
1941
+ onClick: l ? () => t?.(a) : void 0,
1942
+ onKeyDown: l ? (n) => {
1943
+ (n.key === "Enter" || n.key === " ") && (n.preventDefault(), t?.(a));
1930
1944
  } : void 0,
1931
1945
  style: {
1932
- borderLeft: `3px solid var(--mantine-color-${Ue(a.severity)}-6)`,
1933
- cursor: n ? "pointer" : void 0
1946
+ borderLeft: `3px solid var(--mantine-color-${Ge(a.severity)}-6)`,
1947
+ cursor: l ? "pointer" : void 0
1934
1948
  },
1935
- children: /* @__PURE__ */ r(V, { gap: 4, children: [
1949
+ children: /* @__PURE__ */ r(U, { gap: 4, children: [
1936
1950
  /* @__PURE__ */ r(O, { gap: 8, align: "baseline", wrap: "wrap", children: [
1937
- /* @__PURE__ */ e(h, { fw: 600, size: "1.7rem", lh: 1.05, c: Ue(a.severity), children: a.value }),
1938
- a.of ? /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: a.of }) : null
1951
+ /* @__PURE__ */ e(c, { fw: 600, size: "1.7rem", lh: 1.05, c: Ge(a.severity), children: a.value }),
1952
+ a.of ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: a.of }) : null
1939
1953
  ] }),
1940
- /* @__PURE__ */ e(h, { size: "sm", fw: 550, children: a.label }),
1941
- a.description ? /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", lh: 1.45, children: a.description }) : null
1954
+ /* @__PURE__ */ e(c, { size: "sm", fw: 550, children: a.label }),
1955
+ a.description ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", lh: 1.45, children: a.description }) : null
1942
1956
  ] })
1943
1957
  }
1944
1958
  );
1945
- }, Vr = ({ cards: a, onOpenCard: t }) => /* @__PURE__ */ e(He, { cols: { base: 1, sm: 2, lg: 3, xl: 4 }, spacing: "xs", children: a.map((n, s) => /* @__PURE__ */ e(Mr, { card: n, onOpen: t }, `${n.label}-${s}`)) }), Gr = ({ flags: a }) => /* @__PURE__ */ e(He, { cols: { base: 1, sm: 2, lg: 4 }, spacing: "xs", children: a.map((t) => /* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "sm", children: /* @__PURE__ */ r(V, { gap: 3, children: [
1946
- /* @__PURE__ */ e(h, { size: "10px", c: "dimmed", ff: "monospace", style: { wordBreak: "break-all" }, children: t.key }),
1959
+ }, Gr = ({ cards: a, onOpenCard: t }) => /* @__PURE__ */ e(We, { cols: { base: 1, sm: 2, lg: 3, xl: 4 }, spacing: "xs", children: a.map((l, n) => /* @__PURE__ */ e(Ur, { card: l, onOpen: t }, `${l.label}-${n}`)) }), Br = ({ flags: a }) => /* @__PURE__ */ e(We, { cols: { base: 1, sm: 2, lg: 4 }, spacing: "xs", children: a.map((t) => /* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "sm", children: /* @__PURE__ */ r(U, { gap: 3, children: [
1960
+ /* @__PURE__ */ e(c, { size: "10px", c: "dimmed", ff: "monospace", style: { wordBreak: "break-all" }, children: t.key }),
1947
1961
  /* @__PURE__ */ r(O, { gap: 7, wrap: "nowrap", children: [
1948
- /* @__PURE__ */ e(Q, { size: "xs", circle: !0, color: Ue(t.severity) }),
1949
- /* @__PURE__ */ e(h, { size: "sm", fw: 550, children: t.value })
1962
+ /* @__PURE__ */ e(j, { size: "xs", circle: !0, color: Ge(t.severity) }),
1963
+ /* @__PURE__ */ e(c, { size: "sm", fw: 550, children: t.value })
1950
1964
  ] }),
1951
- t.description ? /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", lh: 1.4, children: t.description }) : null
1952
- ] }) }, t.key)) }), Ur = ({ attributes: a }) => /* @__PURE__ */ e(V, { gap: 7, children: a.map((t, n) => /* @__PURE__ */ r(O, { gap: 12, wrap: "nowrap", justify: "space-between", children: [
1953
- /* @__PURE__ */ e(h, { size: "sm", c: "dimmed", children: t.label }),
1954
- /* @__PURE__ */ e(h, { size: "sm", fw: 600, ta: "right", children: t.value })
1955
- ] }, `${t.label}-${n}`)) }), we = ({ title: a, hint: t, children: n }) => /* @__PURE__ */ r(V, { gap: "xs", children: [
1965
+ t.description ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", lh: 1.4, children: t.description }) : null
1966
+ ] }) }, t.key)) }), Hr = ({ attributes: a }) => /* @__PURE__ */ e(U, { gap: 7, children: a.map((t, l) => /* @__PURE__ */ r(O, { gap: 12, wrap: "nowrap", justify: "space-between", children: [
1967
+ /* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: t.label }),
1968
+ /* @__PURE__ */ e(c, { size: "sm", fw: 600, ta: "right", children: t.value })
1969
+ ] }, `${t.label}-${l}`)) }), pe = ({ title: a, hint: t, children: l }) => /* @__PURE__ */ r(U, { gap: "xs", children: [
1956
1970
  /* @__PURE__ */ r(O, { gap: 10, align: "baseline", wrap: "wrap", children: [
1957
- /* @__PURE__ */ e(h, { size: "xs", fw: 650, tt: "uppercase", style: { letterSpacing: ".05em" }, children: a }),
1958
- t ? /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: t }) : null
1971
+ /* @__PURE__ */ e(c, { size: "xs", fw: 650, tt: "uppercase", style: { letterSpacing: ".05em" }, children: a }),
1972
+ t ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: t }) : null
1959
1973
  ] }),
1960
- n
1961
- ] }), Oe = ({ children: a, maxHeight: t = 420 }) => /* @__PURE__ */ e(de.Autosize, { mah: t, type: "hover", offsetScrollbars: !0, children: /* @__PURE__ */ e(S.ScrollContainer, { minWidth: 480, type: "native", children: a }) }), Br = 25, Wr = ({ card: a, onClose: t }) => {
1962
- const n = J(
1974
+ l
1975
+ ] }), ke = ({ children: a, maxHeight: t = 420 }) => /* @__PURE__ */ e(ue.Autosize, { mah: t, type: "hover", offsetScrollbars: !0, children: /* @__PURE__ */ e(m.ScrollContainer, { minWidth: 480, type: "native", children: a }) }), qr = 25, Wr = ({ card: a, onClose: t }) => {
1976
+ const l = J(
1963
1977
  K.SecurityDiagnostics
1964
- ), [s, c] = T([]), [d, u] = T(1), [x, R] = T(1), [m, v] = T(0), [A, y] = T(!1), [P, f] = T(null), w = a?.metric;
1978
+ ), [n, u] = S([]), [d, h] = S(1), [A, z] = S(1), [g, T] = S(0), [R, x] = S(!1), [D, b] = S(null), w = a?.metric;
1965
1979
  return ee(() => {
1966
- u(1);
1980
+ h(1);
1967
1981
  }, [w]), ee(() => {
1968
1982
  if (!w)
1969
1983
  return;
1970
1984
  let o = !1;
1971
- return y(!0), f(null), n.getOverviewItems(w, d - 1, Br).then((l) => {
1972
- o || (c(l.content ?? []), v(l.totalElements ?? 0), R(Math.max(l.totalPages ?? 1, 1)));
1973
- }).catch((l) => {
1974
- o || f(l instanceof Error ? l.message : "Não foi possível carregar os itens.");
1985
+ return x(!0), b(null), l.getOverviewItems(w, d - 1, qr).then((s) => {
1986
+ o || (u(s.content ?? []), T(s.totalElements ?? 0), z(Math.max(s.totalPages ?? 1, 1)));
1987
+ }).catch((s) => {
1988
+ o || b(s instanceof Error ? s.message : "Não foi possível carregar os itens.");
1975
1989
  }).finally(() => {
1976
- o || y(!1);
1990
+ o || x(!1);
1977
1991
  }), () => {
1978
1992
  o = !0;
1979
1993
  };
1980
- }, [n, w, d]), /* @__PURE__ */ e(
1981
- Ja,
1994
+ }, [l, w, d]), /* @__PURE__ */ e(
1995
+ _a,
1982
1996
  {
1983
1997
  opened: !!a,
1984
1998
  onClose: t,
1985
1999
  position: "right",
1986
2000
  size: "xl",
1987
- title: /* @__PURE__ */ r(V, { gap: 2, children: [
1988
- /* @__PURE__ */ e(h, { fw: 600, children: a?.label }),
1989
- a?.description ? /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", lh: 1.4, children: a.description }) : null
2001
+ title: /* @__PURE__ */ r(U, { gap: 2, children: [
2002
+ /* @__PURE__ */ e(c, { fw: 600, children: a?.label }),
2003
+ a?.description ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", lh: 1.4, children: a.description }) : null
1990
2004
  ] }),
1991
- children: /* @__PURE__ */ r(V, { gap: "sm", children: [
2005
+ children: /* @__PURE__ */ r(U, { gap: "sm", children: [
1992
2006
  /* @__PURE__ */ r(O, { gap: 8, children: [
1993
- /* @__PURE__ */ r(Q, { variant: "light", children: [
1994
- m,
2007
+ /* @__PURE__ */ r(j, { variant: "light", children: [
2008
+ g,
1995
2009
  " ",
1996
- m === 1 ? "item" : "itens"
2010
+ g === 1 ? "item" : "itens"
1997
2011
  ] }),
1998
- A ? /* @__PURE__ */ e(le, { size: "xs" }) : null
2012
+ R ? /* @__PURE__ */ e(se, { size: "xs" }) : null
1999
2013
  ] }),
2000
- P ? /* @__PURE__ */ e(ye, { color: "red", title: "Erro ao carregar", children: P }) : null,
2001
- !A && !P && s.length === 0 ? /* @__PURE__ */ e(h, { size: "sm", c: "dimmed", children: "Nada aqui — o número é zero." }) : null,
2002
- s.length > 0 ? (
2014
+ D ? /* @__PURE__ */ e(ce, { color: "red", title: "Erro ao carregar", children: D }) : null,
2015
+ !R && !D && n.length === 0 ? /* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: "Nada aqui — o número é zero." }) : null,
2016
+ n.length > 0 ? (
2003
2017
  // O scroll fica NA TABELA, não no drawer: rolando o drawer, o cabeçalho some e
2004
2018
  // uma coluna de valores sem cabeçalho deixa de dizer o que é. Aqui o cabeçalho
2005
2019
  // gruda e o título, a contagem e a paginação ficam onde estavam.
2006
- /* @__PURE__ */ e(Oe, { maxHeight: "calc(100vh - 260px)", children: /* @__PURE__ */ r(S, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
2007
- /* @__PURE__ */ e(S.Thead, { children: /* @__PURE__ */ r(S.Tr, { children: [
2008
- /* @__PURE__ */ e(S.Th, { children: "Item" }),
2009
- /* @__PURE__ */ e(S.Th, { children: "Onde" }),
2010
- /* @__PURE__ */ e(S.Th, { children: "Por que está aqui" })
2020
+ /* @__PURE__ */ e(ke, { maxHeight: "calc(100vh - 260px)", children: /* @__PURE__ */ r(m, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
2021
+ /* @__PURE__ */ e(m.Thead, { children: /* @__PURE__ */ r(m.Tr, { children: [
2022
+ /* @__PURE__ */ e(m.Th, { children: "Item" }),
2023
+ /* @__PURE__ */ e(m.Th, { children: "Onde" }),
2024
+ /* @__PURE__ */ e(m.Th, { children: "Por que está aqui" })
2011
2025
  ] }) }),
2012
- /* @__PURE__ */ e(S.Tbody, { children: s.map((o) => /* @__PURE__ */ r(S.Tr, { children: [
2013
- /* @__PURE__ */ e(S.Td, { children: /* @__PURE__ */ e(h, { size: "sm", fw: 550, children: o.label }) }),
2014
- /* @__PURE__ */ e(S.Td, { children: /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: o.detail }) }),
2015
- /* @__PURE__ */ e(S.Td, { children: /* @__PURE__ */ e(h, { size: "xs", children: o.reason }) })
2026
+ /* @__PURE__ */ e(m.Tbody, { children: n.map((o) => /* @__PURE__ */ r(m.Tr, { children: [
2027
+ /* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ e(c, { size: "sm", fw: 550, children: o.label }) }),
2028
+ /* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: o.detail }) }),
2029
+ /* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ e(c, { size: "xs", children: o.reason }) })
2016
2030
  ] }, o.id)) })
2017
2031
  ] }) })
2018
2032
  ) : null,
2019
- x > 1 ? /* @__PURE__ */ e(O, { justify: "center", children: /* @__PURE__ */ e(Xa, { value: d, onChange: u, total: x, size: "sm" }) }) : null
2033
+ A > 1 ? /* @__PURE__ */ e(O, { justify: "center", children: /* @__PURE__ */ e(Ia, { value: d, onChange: h, total: A, size: "sm" }) }) : null
2020
2034
  ] })
2021
2035
  }
2022
2036
  );
2023
- }, qr = (a, t) => t > 0 ? ` · ${Math.round(a / t * 100)}%` : "", Hr = (a) => {
2037
+ }, jr = (a, t) => t > 0 ? ` · ${Math.round(a / t * 100)}%` : "", Zr = (a) => {
2024
2038
  const t = a.flags;
2025
2039
  return [
2026
2040
  {
@@ -2052,12 +2066,12 @@ const Ue = (a) => {
2052
2066
  description: t.scanConfigured ? "O catálogo se alimenta do código." : "O catálogo não se alimenta do código."
2053
2067
  }
2054
2068
  ];
2055
- }, jr = (a) => [
2069
+ }, Qr = (a) => [
2056
2070
  {
2057
2071
  severity: "critical",
2058
2072
  value: a.permissionsPointingToInactive,
2059
2073
  metric: "PERMISSIONS_POINTING_TO_INACTIVE",
2060
- of: `de ${a.permissions}${qr(a.permissionsPointingToInactive, a.permissions)}`,
2074
+ of: `de ${a.permissions}${jr(a.permissionsPointingToInactive, a.permissions)}`,
2061
2075
  label: "Permissões inertes",
2062
2076
  description: "Apontam para ação ou recurso inativo. É o acesso que o operador acredita ter concedido."
2063
2077
  },
@@ -2101,575 +2115,575 @@ const Ue = (a) => {
2101
2115
  label: "Ninguém tem",
2102
2116
  description: "Capacidade existe no catálogo e não foi concedida a ninguém."
2103
2117
  }
2104
- ], ba = ({ slots: a, onError: t }) => {
2105
- const n = J(
2118
+ ], va = ({ slots: a, onError: t }) => {
2119
+ const l = J(
2106
2120
  K.SecurityDiagnostics
2107
- ), [s, c] = T(void 0), [d, u] = T(!0), [x, R] = T(void 0), [m, v] = T(null);
2121
+ ), [n, u] = S(void 0), [d, h] = S(!0), [A, z] = S(void 0), [g, T] = S(null);
2108
2122
  ee(() => {
2109
- let P = !0;
2110
- return u(!0), n.getOverview().then((f) => {
2111
- P && (c(f), R(void 0));
2112
- }).catch((f) => {
2113
- if (P) {
2114
- const w = be(f);
2115
- R(w), t?.(w);
2123
+ let D = !0;
2124
+ return h(!0), l.getOverview().then((b) => {
2125
+ D && (u(b), z(void 0));
2126
+ }).catch((b) => {
2127
+ if (D) {
2128
+ const w = Te(b);
2129
+ z(w), t?.(w);
2116
2130
  }
2117
2131
  }).finally(() => {
2118
- P && u(!1);
2132
+ D && h(!1);
2119
2133
  }), () => {
2120
- P = !1;
2134
+ D = !1;
2121
2135
  };
2122
- }, [n]);
2123
- const A = ie(
2124
- () => s ? [...Hr(s), ...a?.additionalFlags?.(s) ?? []] : [],
2125
- [s, a]
2126
- ), y = ie(
2127
- () => s ? [...jr(s), ...a?.additionalOverviewCards?.(s) ?? []] : [],
2128
- [s, a]
2136
+ }, [l]);
2137
+ const R = ie(
2138
+ () => n ? [...Zr(n), ...a?.additionalFlags?.(n) ?? []] : [],
2139
+ [n, a]
2140
+ ), x = ie(
2141
+ () => n ? [...Qr(n), ...a?.additionalOverviewCards?.(n) ?? []] : [],
2142
+ [n, a]
2129
2143
  );
2130
- return d ? /* @__PURE__ */ e(le, { size: "sm" }) : x ? /* @__PURE__ */ e(ye, { color: "red", title: "Não foi possível ler o diagnóstico", children: x }) : s ? /* @__PURE__ */ r(V, { gap: "lg", children: [
2131
- /* @__PURE__ */ r(we, { title: "Proteções", hint: "de AccessOverview.flags", children: [
2132
- /* @__PURE__ */ e(Gr, { flags: A }),
2133
- /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", lh: 1.45, children: "Todas nascem com o padrão compatível — ligadas só quando alguém decide." })
2144
+ return d ? /* @__PURE__ */ e(se, { size: "sm" }) : A ? /* @__PURE__ */ e(ce, { color: "red", title: "Não foi possível ler o diagnóstico", children: A }) : n ? /* @__PURE__ */ r(U, { gap: "lg", children: [
2145
+ /* @__PURE__ */ r(pe, { title: "Proteções", hint: "de AccessOverview.flags", children: [
2146
+ /* @__PURE__ */ e(Br, { flags: R }),
2147
+ /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", lh: 1.45, children: "Todas nascem com o padrão compatível — ligadas só quando alguém decide." })
2134
2148
  ] }),
2135
- /* @__PURE__ */ e(we, { title: "Catálogo e concessões", hint: "contagens vivas", children: /* @__PURE__ */ e(Vr, { cards: y, onOpenCard: v }) }),
2136
- a?.afterOverview?.(s),
2137
- /* @__PURE__ */ e(Wr, { card: m, onClose: () => v(null) })
2149
+ /* @__PURE__ */ e(pe, { title: "Catálogo e concessões", hint: "contagens vivas", children: /* @__PURE__ */ e(Gr, { cards: x, onOpenCard: T }) }),
2150
+ a?.afterOverview?.(n),
2151
+ /* @__PURE__ */ e(Wr, { card: g, onClose: () => T(null) })
2138
2152
  ] }) : null;
2139
- }, Be = ({ value: a, onChange: t, assunto: n, visiveis: s, total: c }) => {
2140
- const d = typeof s == "number" && typeof c == "number" && s < c;
2153
+ }, Be = ({ value: a, onChange: t, assunto: l, visiveis: n, total: u }) => {
2154
+ const d = typeof n == "number" && typeof u == "number" && n < u;
2141
2155
  return /* @__PURE__ */ e(
2142
- ve,
2156
+ he,
2143
2157
  {
2144
2158
  size: "xs",
2145
2159
  value: a,
2146
- onChange: (u) => t(u.currentTarget.value),
2147
- placeholder: n ? `Filtrar ${n}…` : "Filtrar…",
2148
- "aria-label": n ? `Filtrar ${n}` : "Filtrar",
2149
- description: d ? `${s} de ${c}` : void 0,
2160
+ onChange: (h) => t(h.currentTarget.value),
2161
+ placeholder: l ? `Filtrar ${l}…` : "Filtrar…",
2162
+ "aria-label": l ? `Filtrar ${l}` : "Filtrar",
2163
+ description: d ? `${n} de ${u}` : void 0,
2150
2164
  rightSection: a ? /* @__PURE__ */ e(Ya, { size: "sm", onClick: () => t(""), "aria-label": "Limpar filtro" }) : null
2151
2165
  }
2152
2166
  );
2153
- }, Zr = /[̀-ͯ]/g, va = (a) => a.toLocaleLowerCase().normalize("NFD").replace(Zr, ""), We = (a, t) => {
2154
- const [n, s] = T(""), c = ie(() => {
2155
- const d = va(n.trim());
2167
+ }, Kr = /[̀-ͯ]/g, ya = (a) => a.toLocaleLowerCase().normalize("NFD").replace(Kr, ""), He = (a, t) => {
2168
+ const [l, n] = S(""), u = ie(() => {
2169
+ const d = ya(l.trim());
2156
2170
  return d ? a.filter(
2157
- (u) => t(u).some((x) => x ? va(x).includes(d) : !1)
2171
+ (h) => t(h).some((A) => A ? ya(A).includes(d) : !1)
2158
2172
  ) : a;
2159
- }, [a, n]);
2160
- return { filtro: n, setFiltro: s, filtrados: c };
2161
- }, ya = {
2173
+ }, [a, l]);
2174
+ return { filtro: l, setFiltro: n, filtrados: u };
2175
+ }, Ta = {
2162
2176
  EFFECTIVE: { label: "Efetiva", color: "green" },
2163
2177
  INERT: { label: "Inerte", color: "orange" },
2164
2178
  DENIED: { label: "Negada", color: "red" }
2165
- }, Qr = { GROUP: "grupo", PROFILE: "perfil", USER: "direto" }, Kr = [
2179
+ }, Jr = { GROUP: "grupo", PROFILE: "perfil", USER: "direto" }, Xr = [
2166
2180
  { value: "all", label: "Todas" },
2167
2181
  { value: "EFFECTIVE", label: "Só efetivas" },
2168
2182
  { value: "INERT", label: "Só inertes" },
2169
2183
  { value: "DENIED", label: "Negadas" },
2170
2184
  { value: "inherited", label: "Só herdadas" }
2171
- ], Jr = ({ slots: a, onError: t, userId: n }) => {
2172
- const s = J(
2185
+ ], _r = ({ slots: a, onError: t, userId: l }) => {
2186
+ const n = J(
2173
2187
  K.SecurityDiagnostics
2174
- ), [c, d] = T(""), [u, x] = T(void 0), [R, m] = T(!1), [v, A] = T(void 0), [y, P] = T("all"), f = !!n, w = ae(
2188
+ ), [u, d] = S(""), [h, A] = S(void 0), [z, g] = S(!1), [T, R] = S(void 0), [x, D] = S("all"), b = !!l, w = ae(
2175
2189
  async (i) => {
2176
2190
  const N = i.trim();
2177
2191
  if (N) {
2178
- m(!0), A(void 0);
2192
+ g(!0), R(void 0);
2179
2193
  try {
2180
- const F = N.includes("@") ? await s.getEffectiveAccessByEmail(N) : await s.getEffectiveAccessByUserId(N);
2181
- x(F);
2182
- } catch (F) {
2183
- const G = be(F);
2184
- A(G), t?.(G), x(void 0);
2194
+ const I = N.includes("@") ? await n.getEffectiveAccessByEmail(N) : await n.getEffectiveAccessByUserId(N);
2195
+ A(I);
2196
+ } catch (I) {
2197
+ const M = Te(I);
2198
+ R(M), t?.(M), A(void 0);
2185
2199
  } finally {
2186
- m(!1);
2200
+ g(!1);
2187
2201
  }
2188
2202
  }
2189
2203
  },
2190
- [s, t]
2191
- ), o = ie(() => u ? [
2192
- { label: "Perfil", value: u.profileName || "—" },
2193
- { label: "Grupos", value: u.groupNames.length ? u.groupNames.join(", ") : "—" },
2194
- ...a?.userAttributes?.(u) ?? []
2195
- ] : [], [u, a]), l = ie(() => u ? y === "all" ? u.capabilities : y === "inherited" ? u.capabilities.filter((i) => i.grantedByType !== "USER") : u.capabilities.filter((i) => i.situation === y) : [], [u, y]), {
2204
+ [n, t]
2205
+ ), o = ie(() => h ? [
2206
+ { label: "Perfil", value: h.profileName || "—" },
2207
+ { label: "Grupos", value: h.groupNames.length ? h.groupNames.join(", ") : "—" },
2208
+ ...a?.userAttributes?.(h) ?? []
2209
+ ] : [], [h, a]), s = ie(() => h ? x === "all" ? h.capabilities : x === "inherited" ? h.capabilities.filter((i) => i.grantedByType !== "USER") : h.capabilities.filter((i) => i.situation === x) : [], [h, x]), {
2196
2210
  filtro: p,
2197
- setFiltro: b,
2198
- filtrados: L
2199
- } = We(l, (i) => [i.resource, i.action, i.grantedByName]);
2211
+ setFiltro: v,
2212
+ filtrados: $
2213
+ } = He(s, (i) => [i.resource, i.action, i.grantedByName]);
2200
2214
  ee(() => {
2201
- n && (P("all"), w(n));
2202
- }, [n, w]);
2203
- const E = a?.additionalCapabilityColumns ?? [];
2204
- return /* @__PURE__ */ r(V, { gap: "lg", children: [
2205
- f ? null : /* @__PURE__ */ e(we, { title: "Consultar", hint: "por e-mail ou id do usuário", children: a?.renderUserSearch ? a.renderUserSearch((i) => {
2215
+ l && (D("all"), w(l));
2216
+ }, [l, w]);
2217
+ const y = a?.additionalCapabilityColumns ?? [];
2218
+ return /* @__PURE__ */ r(U, { gap: "lg", children: [
2219
+ b ? null : /* @__PURE__ */ e(pe, { title: "Consultar", hint: "por e-mail ou id do usuário", children: a?.renderUserSearch ? a.renderUserSearch((i) => {
2206
2220
  d(i), w(i);
2207
2221
  }) : /* @__PURE__ */ r(O, { gap: "xs", align: "flex-end", children: [
2208
2222
  /* @__PURE__ */ e(
2209
- ve,
2223
+ he,
2210
2224
  {
2211
2225
  style: { flex: 1, minWidth: 240 },
2212
2226
  label: "Usuário",
2213
2227
  placeholder: "pessoa@empresa.com.br",
2214
- value: c,
2228
+ value: u,
2215
2229
  onChange: (i) => d(i.currentTarget.value),
2216
2230
  onKeyDown: (i) => {
2217
- i.key === "Enter" && w(c);
2231
+ i.key === "Enter" && w(u);
2218
2232
  }
2219
2233
  }
2220
2234
  ),
2221
- /* @__PURE__ */ e(X, { onClick: () => void w(c), loading: R, children: "Consultar" })
2235
+ /* @__PURE__ */ e(X, { onClick: () => void w(u), loading: z, children: "Consultar" })
2222
2236
  ] }) }),
2223
- v ? /* @__PURE__ */ e(ye, { color: "red", title: "Não foi possível ler o efetivo", children: v }) : null,
2224
- R && !u ? /* @__PURE__ */ e(le, { size: "sm" }) : null,
2225
- u ? /* @__PURE__ */ r(xe, { children: [
2226
- /* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "md", children: /* @__PURE__ */ r(V, { gap: "sm", children: [
2237
+ T ? /* @__PURE__ */ e(ce, { color: "red", title: "Não foi possível ler o efetivo", children: T }) : null,
2238
+ z && !h ? /* @__PURE__ */ e(se, { size: "sm" }) : null,
2239
+ h ? /* @__PURE__ */ r(xe, { children: [
2240
+ /* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "md", children: /* @__PURE__ */ r(U, { gap: "sm", children: [
2227
2241
  /* @__PURE__ */ r(O, { gap: 8, wrap: "wrap", align: "center", children: [
2228
- /* @__PURE__ */ e(h, { fw: 620, children: u.userLabel }),
2229
- u.administrator ? /* @__PURE__ */ e(Q, { color: "red", children: "administrador" }) : null,
2230
- u.enabled ? null : /* @__PURE__ */ e(Q, { color: "red", children: "conta desativada" }),
2231
- a?.afterUserBadges?.(u)
2242
+ /* @__PURE__ */ e(c, { fw: 620, children: h.userLabel }),
2243
+ h.administrator ? /* @__PURE__ */ e(j, { color: "red", children: "administrador" }) : null,
2244
+ h.enabled ? null : /* @__PURE__ */ e(j, { color: "red", children: "conta desativada" }),
2245
+ a?.afterUserBadges?.(h)
2232
2246
  ] }),
2233
- /* @__PURE__ */ e(Ur, { attributes: o })
2247
+ /* @__PURE__ */ e(Hr, { attributes: o })
2234
2248
  ] }) }),
2235
- u.administrator ? /* @__PURE__ */ r(ye, { color: "orange", title: "Administrador passa direto", children: [
2249
+ h.administrator ? /* @__PURE__ */ r(ce, { color: "orange", title: "Administrador passa direto", children: [
2236
2250
  "O portão GRANT concede sem consultar o catálogo. A lista abaixo vir vazia não é falta de dado — é o atalho que a flag ",
2237
2251
  /* @__PURE__ */ e("code", { children: "isAdministrator" }),
2238
2252
  " representa."
2239
2253
  ] }) : null,
2240
- /* @__PURE__ */ e(He, { cols: { base: 2, sm: 4 }, spacing: "xs", children: [
2241
- ["concedidas", u.granted, "neutral"],
2242
- ["efetivas", u.effective, "ok"],
2243
- ["inertes", u.inert, "warning"],
2244
- ["negadas", u.denied, "critical"]
2245
- ].map(([i, N, F]) => /* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "sm", children: /* @__PURE__ */ r(V, { gap: 2, children: [
2246
- /* @__PURE__ */ e(h, { size: "1.3rem", fw: 620, c: Ue(F), children: N }),
2247
- /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: i })
2254
+ /* @__PURE__ */ e(We, { cols: { base: 2, sm: 4 }, spacing: "xs", children: [
2255
+ ["concedidas", h.granted, "neutral"],
2256
+ ["efetivas", h.effective, "ok"],
2257
+ ["inertes", h.inert, "warning"],
2258
+ ["negadas", h.denied, "critical"]
2259
+ ].map(([i, N, I]) => /* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "sm", children: /* @__PURE__ */ r(U, { gap: 2, children: [
2260
+ /* @__PURE__ */ e(c, { size: "1.3rem", fw: 620, c: Ge(I), children: N }),
2261
+ /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: i })
2248
2262
  ] }) }, i)) }),
2249
- a?.afterEffectiveTally?.(u),
2250
- /* @__PURE__ */ r(we, { title: "Capacidades", hint: `${u.capabilities.length} no total`, children: [
2251
- /* @__PURE__ */ e(ua.Group, { multiple: !1, value: y, onChange: (i) => P(i), children: /* @__PURE__ */ e(O, { gap: 6, children: Kr.map((i) => /* @__PURE__ */ e(ua, { value: i.value, size: "xs", variant: "outline", children: i.label }, i.value)) }) }),
2263
+ a?.afterEffectiveTally?.(h),
2264
+ /* @__PURE__ */ r(pe, { title: "Capacidades", hint: `${h.capabilities.length} no total`, children: [
2265
+ /* @__PURE__ */ e(ha.Group, { multiple: !1, value: x, onChange: (i) => D(i), children: /* @__PURE__ */ e(O, { gap: 6, children: Xr.map((i) => /* @__PURE__ */ e(ha, { value: i.value, size: "xs", variant: "outline", children: i.label }, i.value)) }) }),
2252
2266
  /* @__PURE__ */ e(
2253
2267
  Be,
2254
2268
  {
2255
2269
  value: p,
2256
- onChange: b,
2270
+ onChange: v,
2257
2271
  assunto: "capacidades",
2258
- visiveis: L.length,
2259
- total: l.length
2272
+ visiveis: $.length,
2273
+ total: s.length
2260
2274
  }
2261
2275
  ),
2262
- /* @__PURE__ */ e(Oe, { maxHeight: "calc(100vh - 460px)", children: /* @__PURE__ */ r(S, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
2263
- /* @__PURE__ */ e(S.Thead, { children: /* @__PURE__ */ r(S.Tr, { children: [
2264
- /* @__PURE__ */ e(S.Th, { children: "Capacidade" }),
2265
- /* @__PURE__ */ e(S.Th, { children: "Origem" }),
2266
- /* @__PURE__ */ e(S.Th, { children: "Situação" }),
2267
- E.map((i) => /* @__PURE__ */ e(S.Th, { children: i.header }, i.header))
2276
+ /* @__PURE__ */ e(ke, { maxHeight: "calc(100vh - 460px)", children: /* @__PURE__ */ r(m, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
2277
+ /* @__PURE__ */ e(m.Thead, { children: /* @__PURE__ */ r(m.Tr, { children: [
2278
+ /* @__PURE__ */ e(m.Th, { children: "Capacidade" }),
2279
+ /* @__PURE__ */ e(m.Th, { children: "Origem" }),
2280
+ /* @__PURE__ */ e(m.Th, { children: "Situação" }),
2281
+ y.map((i) => /* @__PURE__ */ e(m.Th, { children: i.header }, i.header))
2268
2282
  ] }) }),
2269
- /* @__PURE__ */ r(S.Tbody, { children: [
2270
- L.map((i, N) => /* @__PURE__ */ r(S.Tr, { children: [
2271
- /* @__PURE__ */ e(S.Td, { children: /* @__PURE__ */ r(h, { size: "sm", ff: "monospace", children: [
2283
+ /* @__PURE__ */ r(m.Tbody, { children: [
2284
+ $.map((i, N) => /* @__PURE__ */ r(m.Tr, { children: [
2285
+ /* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ r(c, { size: "sm", ff: "monospace", children: [
2272
2286
  i.resource,
2273
2287
  ":",
2274
2288
  i.action
2275
2289
  ] }) }),
2276
- /* @__PURE__ */ e(S.Td, { children: /* @__PURE__ */ r(h, { size: "sm", children: [
2277
- /* @__PURE__ */ r(h, { span: !0, c: "dimmed", children: [
2278
- Qr[i.grantedByType] ?? i.grantedByType,
2290
+ /* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ r(c, { size: "sm", children: [
2291
+ /* @__PURE__ */ r(c, { span: !0, c: "dimmed", children: [
2292
+ Jr[i.grantedByType] ?? i.grantedByType,
2279
2293
  " "
2280
2294
  ] }),
2281
2295
  i.grantedByName
2282
2296
  ] }) }),
2283
- /* @__PURE__ */ e(S.Td, { children: /* @__PURE__ */ e(Q, { color: ya[i.situation].color, variant: "light", children: ya[i.situation].label }) }),
2284
- E.map((F) => /* @__PURE__ */ e(S.Td, { children: F.render(i, u) }, F.header))
2297
+ /* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ e(j, { color: Ta[i.situation].color, variant: "light", children: Ta[i.situation].label }) }),
2298
+ y.map((I) => /* @__PURE__ */ e(m.Td, { children: I.render(i, h) }, I.header))
2285
2299
  ] }, `${i.resource}:${i.action}:${N}`)),
2286
- l.length === 0 ? /* @__PURE__ */ e(S.Tr, { children: /* @__PURE__ */ e(S.Td, { colSpan: 3 + E.length, children: /* @__PURE__ */ e(h, { size: "sm", c: "dimmed", ta: "center", py: "md", children: "Nenhuma capacidade neste filtro." }) }) }) : null
2300
+ s.length === 0 ? /* @__PURE__ */ e(m.Tr, { children: /* @__PURE__ */ e(m.Td, { colSpan: 3 + y.length, children: /* @__PURE__ */ e(c, { size: "sm", c: "dimmed", ta: "center", py: "md", children: "Nenhuma capacidade neste filtro." }) }) }) : null
2287
2301
  ] })
2288
2302
  ] }) })
2289
2303
  ] })
2290
2304
  ] }) : null
2291
2305
  ] });
2292
- }, wa = 40, Ca = ({
2306
+ }, wa = 40, Sa = ({
2293
2307
  label: a,
2294
2308
  valor: t,
2295
- placeholder: n,
2296
- branch: s,
2297
- somenteFolhas: c,
2309
+ placeholder: l,
2310
+ branch: n,
2311
+ somenteFolhas: u,
2298
2312
  branchDosFilhos: d,
2299
- onSelecionar: u
2313
+ onSelecionar: h
2300
2314
  }) => {
2301
- const x = J(
2315
+ const A = J(
2302
2316
  K.SecurityDiagnostics
2303
- ), [R, m] = T(!1), [v, A] = T(""), [y, P] = T([]), [f, w] = T({}), [o, l] = T(), [p, b] = T(!1), [L, E] = T(), i = ae(
2317
+ ), [z, g] = S(!1), [T, R] = S(""), [x, D] = S([]), [b, w] = S({}), [o, s] = S(), [p, v] = S(!1), [$, y] = S(), i = ae(
2304
2318
  async (C) => {
2305
- b(!0), E(void 0);
2319
+ v(!0), y(void 0);
2306
2320
  try {
2307
- const z = await x.browse(s, { q: C || void 0, page: 0, size: wa });
2308
- P(z.content ?? []);
2309
- } catch (z) {
2310
- E(z instanceof Error ? z.message : "Não foi possível carregar.");
2321
+ const k = await A.browse(n, { q: C || void 0, page: 0, size: wa });
2322
+ D(k.content ?? []);
2323
+ } catch (k) {
2324
+ y(k instanceof Error ? k.message : "Não foi possível carregar.");
2311
2325
  } finally {
2312
- b(!1);
2326
+ v(!1);
2313
2327
  }
2314
2328
  },
2315
- [x, s]
2329
+ [A, n]
2316
2330
  );
2317
2331
  ee(() => {
2318
- if (!R)
2332
+ if (!z)
2319
2333
  return;
2320
- const C = setTimeout(() => void i(v), v ? 300 : 0);
2334
+ const C = setTimeout(() => void i(T), T ? 300 : 0);
2321
2335
  return () => clearTimeout(C);
2322
- }, [R, v, i]);
2336
+ }, [z, T, i]);
2323
2337
  const N = ae(
2324
2338
  async (C) => {
2325
2339
  if (o === C.id) {
2326
- l(void 0);
2340
+ s(void 0);
2327
2341
  return;
2328
2342
  }
2329
- if (l(C.id), !f[C.id])
2343
+ if (s(C.id), !b[C.id])
2330
2344
  try {
2331
- const z = await x.browse(d ?? s, {
2345
+ const k = await A.browse(d ?? n, {
2332
2346
  parentId: C.id,
2333
2347
  page: 0,
2334
2348
  size: wa
2335
2349
  });
2336
- w((oe) => ({ ...oe, [C.id]: z.content ?? [] }));
2337
- } catch (z) {
2338
- E(z instanceof Error ? z.message : "Não foi possível abrir.");
2350
+ w((oe) => ({ ...oe, [C.id]: k.content ?? [] }));
2351
+ } catch (k) {
2352
+ y(k instanceof Error ? k.message : "Não foi possível abrir.");
2339
2353
  }
2340
2354
  },
2341
- [x, s, d, o, f]
2342
- ), F = (C, z) => {
2343
- u(C, z), m(!1);
2344
- }, G = (C, z) => {
2355
+ [A, n, d, o, b]
2356
+ ), I = (C, k) => {
2357
+ h(C, k), g(!1);
2358
+ }, M = (C, k) => {
2345
2359
  const oe = C.hasChildren;
2346
2360
  return /* @__PURE__ */ e(
2347
2361
  ze,
2348
2362
  {
2349
- onClick: () => oe && c ? void N(C) : F(C, z),
2363
+ onClick: () => oe && u ? void N(C) : I(C, k),
2350
2364
  style: {
2351
2365
  display: "block",
2352
2366
  width: "100%",
2353
2367
  padding: "5px 8px",
2354
- paddingLeft: z ? 24 : 8,
2368
+ paddingLeft: k ? 24 : 8,
2355
2369
  borderRadius: 4
2356
2370
  },
2357
2371
  children: /* @__PURE__ */ r(O, { gap: 6, wrap: "nowrap", children: [
2358
- /* @__PURE__ */ e(h, { size: "sm", fw: !c || !oe ? 500 : 600, truncate: !0, children: C.label }),
2359
- C.badge ? /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: C.badge }) : null
2372
+ /* @__PURE__ */ e(c, { size: "sm", fw: !u || !oe ? 500 : 600, truncate: !0, children: C.label }),
2373
+ C.badge ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: C.badge }) : null
2360
2374
  ] })
2361
2375
  },
2362
- `${z?.id ?? "raiz"}:${C.id}`
2376
+ `${k?.id ?? "raiz"}:${C.id}`
2363
2377
  );
2364
- }, D = (C) => /* @__PURE__ */ r(_, { children: [
2365
- G(C),
2366
- o === C.id ? (f[C.id] ?? []).map((z) => G(z, C)) : null
2378
+ }, F = (C) => /* @__PURE__ */ r(Y, { children: [
2379
+ M(C),
2380
+ o === C.id ? (b[C.id] ?? []).map((k) => M(k, C)) : null
2367
2381
  ] }, `ramo:${C.id}`);
2368
- return /* @__PURE__ */ r(Je, { opened: R, onChange: m, width: 340, position: "bottom-start", withinPortal: !0, shadow: "md", children: [
2382
+ return /* @__PURE__ */ r(Je, { opened: z, onChange: g, width: 340, position: "bottom-start", withinPortal: !0, shadow: "md", children: [
2369
2383
  /* @__PURE__ */ e(Je.Target, { children: /* @__PURE__ */ e(
2370
- ve,
2384
+ he,
2371
2385
  {
2372
2386
  label: a,
2373
- placeholder: n,
2387
+ placeholder: l,
2374
2388
  value: t ?? "",
2375
2389
  readOnly: !0,
2376
- onClick: () => m((C) => !C),
2390
+ onClick: () => g((C) => !C),
2377
2391
  styles: { input: { cursor: "pointer" } }
2378
2392
  }
2379
2393
  ) }),
2380
2394
  /* @__PURE__ */ r(Je.Dropdown, { p: 6, children: [
2381
2395
  /* @__PURE__ */ e(
2382
- ve,
2396
+ he,
2383
2397
  {
2384
2398
  size: "xs",
2385
2399
  placeholder: "Buscar…",
2386
- value: v,
2387
- onChange: (C) => A(C.currentTarget.value),
2400
+ value: T,
2401
+ onChange: (C) => R(C.currentTarget.value),
2388
2402
  mb: 6,
2389
2403
  autoFocus: !0
2390
2404
  }
2391
2405
  ),
2392
2406
  p ? /* @__PURE__ */ r(O, { gap: 6, p: 6, children: [
2393
- /* @__PURE__ */ e(le, { size: "xs" }),
2394
- /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: "Carregando…" })
2407
+ /* @__PURE__ */ e(se, { size: "xs" }),
2408
+ /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: "Carregando…" })
2395
2409
  ] }) : null,
2396
- L ? /* @__PURE__ */ e(h, { size: "xs", c: "red", p: 6, children: L }) : null,
2397
- !p && !L && y.length === 0 ? /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", p: 6, children: "Nada encontrado." }) : null,
2398
- /* @__PURE__ */ e(de.Autosize, { mah: 280, type: "hover", children: y.map((C) => D(C)) })
2410
+ $ ? /* @__PURE__ */ e(c, { size: "xs", c: "red", p: 6, children: $ }) : null,
2411
+ !p && !$ && x.length === 0 ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", p: 6, children: "Nada encontrado." }) : null,
2412
+ /* @__PURE__ */ e(ue.Autosize, { mah: 280, type: "hover", children: x.map((C) => F(C)) })
2399
2413
  ] })
2400
2414
  ] });
2401
- }, Xr = [
2415
+ }, Yr = [
2402
2416
  { gate: "IDENTITY", titulo: "Identidade", papel: "só nega", pergunta: "O principal é resolvível e a conta está ativa?" },
2403
2417
  { gate: "SCOPE", titulo: "Escopo", papel: "só nega", pergunta: "A concessão vale para o tenant, empresa e projeto pedidos?" },
2404
2418
  { gate: "RESTRICTION", titulo: "Restrições", papel: "só nega", pergunta: "Perfil, papel e persona exigidos pela anotação." },
2405
2419
  { gate: "LEVEL", titulo: "Nível", papel: "só nega", pergunta: "O nível da pessoa alcança o piso da capacidade?" },
2406
2420
  { gate: "GRANT", titulo: "Concessão", papel: "concede", pergunta: "Existe permissão, sem negação explícita?" }
2407
- ], Yr = ({ slots: a, onError: t, initial: n }) => {
2408
- const s = J(
2421
+ ], et = ({ slots: a, onError: t, initial: l }) => {
2422
+ const n = J(
2409
2423
  K.SecurityDiagnostics
2410
- ), [c, d] = T(""), [u, x] = T(""), [R, m] = T(""), [v, A] = T(""), [y, P] = T({}), [f, w] = T(void 0), [o, l] = T(!1), [p, b] = T(void 0);
2424
+ ), [u, d] = S(""), [h, A] = S(""), [z, g] = S(""), [T, R] = S(""), [x, D] = S({}), [b, w] = S(void 0), [o, s] = S(!1), [p, v] = S(void 0);
2411
2425
  ee(() => {
2412
- n && (n.userId && d(n.userId), n.userLabel && x(n.userLabel), n.resource && m(n.resource), n.action && A(n.action), w(void 0));
2413
- }, [n?.userId, n?.userLabel, n?.resource, n?.action]);
2414
- const L = ae(async () => {
2415
- if (!(!c.trim() || !R.trim() || !v.trim())) {
2416
- l(!0), b(void 0);
2426
+ l && (l.userId && d(l.userId), l.userLabel && A(l.userLabel), l.resource && g(l.resource), l.action && R(l.action), w(void 0));
2427
+ }, [l?.userId, l?.userLabel, l?.resource, l?.action]);
2428
+ const $ = ae(async () => {
2429
+ if (!(!u.trim() || !z.trim() || !T.trim())) {
2430
+ s(!0), v(void 0);
2417
2431
  try {
2418
- const i = c.trim(), N = await s.simulate({
2432
+ const i = u.trim(), N = await n.simulate({
2419
2433
  ...i.includes("@") ? { email: i } : { userId: i },
2420
- resource: R.trim(),
2421
- action: v.trim(),
2422
- companyId: y.companyId,
2423
- projectId: y.projectId
2434
+ resource: z.trim(),
2435
+ action: T.trim(),
2436
+ companyId: x.companyId,
2437
+ projectId: x.projectId
2424
2438
  });
2425
2439
  w(N);
2426
2440
  } catch (i) {
2427
- const N = be(i);
2428
- b(N), t?.(N), w(void 0);
2441
+ const N = Te(i);
2442
+ v(N), t?.(N), w(void 0);
2429
2443
  } finally {
2430
- l(!1);
2444
+ s(!1);
2431
2445
  }
2432
2446
  }
2433
- }, [s, c, R, v, y, t]), E = (i, N) => {
2434
- const F = N.chain?.find((G) => G.gate === i);
2435
- return F ? F.passed ? "passou" : "negou" : "nao-avaliado";
2447
+ }, [n, u, z, T, x, t]), y = (i, N) => {
2448
+ const I = N.chain?.find((M) => M.gate === i);
2449
+ return I ? I.passed ? "passou" : "negou" : "nao-avaliado";
2436
2450
  };
2437
- return /* @__PURE__ */ r(V, { gap: "lg", children: [
2438
- /* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "md", children: /* @__PURE__ */ r(V, { gap: "sm", children: [
2439
- /* @__PURE__ */ r(He, { cols: { base: 1, sm: 2, lg: 4 }, spacing: "xs", children: [
2451
+ return /* @__PURE__ */ r(U, { gap: "lg", children: [
2452
+ /* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "md", children: /* @__PURE__ */ r(U, { gap: "sm", children: [
2453
+ /* @__PURE__ */ r(We, { cols: { base: 1, sm: 2, lg: 4 }, spacing: "xs", children: [
2440
2454
  /* @__PURE__ */ e(
2441
- Ca,
2455
+ Sa,
2442
2456
  {
2443
2457
  label: "Usuário",
2444
2458
  placeholder: "escolher pessoa",
2445
2459
  branch: "USERS",
2446
- valor: u || c,
2460
+ valor: h || u,
2447
2461
  onSelecionar: (i) => {
2448
- d(i.id), x(i.label);
2462
+ d(i.id), A(i.label);
2449
2463
  }
2450
2464
  }
2451
2465
  ),
2452
2466
  /* @__PURE__ */ e(
2453
- Ca,
2467
+ Sa,
2454
2468
  {
2455
2469
  label: "Recurso e ação",
2456
2470
  placeholder: "escolher capacidade",
2457
2471
  branch: "RESOURCES",
2458
2472
  branchDosFilhos: "ACTIONS_OF_RESOURCE",
2459
2473
  somenteFolhas: !0,
2460
- valor: R && v ? `${R} · ${v}` : "",
2474
+ valor: z && T ? `${z} · ${T}` : "",
2461
2475
  onSelecionar: (i, N) => {
2462
- A(i.label), N && m(N.label);
2476
+ R(i.label), N && g(N.label);
2463
2477
  }
2464
2478
  }
2465
2479
  ),
2466
2480
  /* @__PURE__ */ e(
2467
- ve,
2481
+ he,
2468
2482
  {
2469
2483
  label: "Empresa (opcional)",
2470
2484
  placeholder: "companyId",
2471
- value: y.companyId ?? "",
2472
- onChange: (i) => P((N) => ({ ...N, companyId: i.currentTarget.value || void 0 }))
2485
+ value: x.companyId ?? "",
2486
+ onChange: (i) => D((N) => ({ ...N, companyId: i.currentTarget.value || void 0 }))
2473
2487
  }
2474
2488
  )
2475
2489
  ] }),
2476
- a?.afterSimulationFields?.((i) => P((N) => ({ ...N, ...i }))),
2490
+ a?.afterSimulationFields?.((i) => D((N) => ({ ...N, ...i }))),
2477
2491
  /* @__PURE__ */ r(O, { gap: "xs", align: "center", children: [
2478
- /* @__PURE__ */ e(X, { onClick: () => void L(), loading: o, children: "Simular" }),
2479
- /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: "Somente leitura — não altera permissão nenhuma." })
2492
+ /* @__PURE__ */ e(X, { onClick: () => void $(), loading: o, children: "Simular" }),
2493
+ /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: "Somente leitura — não altera permissão nenhuma." })
2480
2494
  ] })
2481
2495
  ] }) }),
2482
- p ? /* @__PURE__ */ e(ye, { color: "red", title: "Não foi possível simular", children: p }) : null,
2483
- o && !f ? /* @__PURE__ */ e(le, { size: "sm" }) : null,
2484
- f ? /* @__PURE__ */ r(xe, { children: [
2485
- /* @__PURE__ */ e(we, { title: "Cadeia de decisão", hint: "os quatro primeiros só negam; só o quinto concede", children: /* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "md", children: /* @__PURE__ */ e(V, { gap: "sm", children: Xr.map((i, N) => {
2486
- const F = E(i.gate, f), G = f.chain?.find((D) => D.gate === i.gate)?.detail;
2496
+ p ? /* @__PURE__ */ e(ce, { color: "red", title: "Não foi possível simular", children: p }) : null,
2497
+ o && !b ? /* @__PURE__ */ e(se, { size: "sm" }) : null,
2498
+ b ? /* @__PURE__ */ r(xe, { children: [
2499
+ /* @__PURE__ */ e(pe, { title: "Cadeia de decisão", hint: "os quatro primeiros só negam; só o quinto concede", children: /* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "md", children: /* @__PURE__ */ e(U, { gap: "sm", children: Yr.map((i, N) => {
2500
+ const I = y(i.gate, b), M = b.chain?.find((F) => F.gate === i.gate)?.detail;
2487
2501
  return /* @__PURE__ */ r(O, { align: "flex-start", wrap: "nowrap", gap: "sm", children: [
2488
- /* @__PURE__ */ e(h, { size: "xs", ff: "monospace", c: "dimmed", w: 16, children: N + 1 }),
2489
- /* @__PURE__ */ r(V, { gap: 2, style: { flex: 1, minWidth: 0 }, children: [
2502
+ /* @__PURE__ */ e(c, { size: "xs", ff: "monospace", c: "dimmed", w: 16, children: N + 1 }),
2503
+ /* @__PURE__ */ r(U, { gap: 2, style: { flex: 1, minWidth: 0 }, children: [
2490
2504
  /* @__PURE__ */ r(O, { gap: 8, align: "baseline", wrap: "wrap", children: [
2491
2505
  /* @__PURE__ */ e(
2492
- h,
2506
+ c,
2493
2507
  {
2494
2508
  size: "sm",
2495
2509
  fw: 600,
2496
- c: F === "negou" ? "red" : void 0,
2497
- opacity: F === "nao-avaliado" ? 0.5 : 1,
2510
+ c: I === "negou" ? "red" : void 0,
2511
+ opacity: I === "nao-avaliado" ? 0.5 : 1,
2498
2512
  children: i.titulo
2499
2513
  }
2500
2514
  ),
2501
- /* @__PURE__ */ r(h, { size: "xs", c: "dimmed", children: [
2515
+ /* @__PURE__ */ r(c, { size: "xs", c: "dimmed", children: [
2502
2516
  "· ",
2503
2517
  i.papel
2504
2518
  ] })
2505
2519
  ] }),
2506
- /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", opacity: F === "nao-avaliado" ? 0.5 : 1, children: i.pergunta }),
2507
- G ? /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: G }) : null
2520
+ /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", opacity: I === "nao-avaliado" ? 0.5 : 1, children: i.pergunta }),
2521
+ M ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: M }) : null
2508
2522
  ] }),
2509
2523
  /* @__PURE__ */ e(
2510
- Q,
2524
+ j,
2511
2525
  {
2512
2526
  variant: "light",
2513
- color: F === "negou" ? "red" : F === "passou" ? "green" : "gray",
2514
- children: F === "nao-avaliado" ? "não avaliado" : F
2527
+ color: I === "negou" ? "red" : I === "passou" ? "green" : "gray",
2528
+ children: I === "nao-avaliado" ? "não avaliado" : I
2515
2529
  }
2516
2530
  )
2517
2531
  ] }, i.gate);
2518
2532
  }) }) }) }),
2519
- /* @__PURE__ */ e(ye, { color: f.allowed ? "green" : "red", title: f.allowed ? "Pode" : "Não pode", children: /* @__PURE__ */ r(V, { gap: 6, children: [
2520
- /* @__PURE__ */ e(h, { size: "sm", children: f.message }),
2521
- /* @__PURE__ */ r(h, { size: "xs", ff: "monospace", c: "dimmed", children: [
2533
+ /* @__PURE__ */ e(ce, { color: b.allowed ? "green" : "red", title: b.allowed ? "Pode" : "Não pode", children: /* @__PURE__ */ r(U, { gap: 6, children: [
2534
+ /* @__PURE__ */ e(c, { size: "sm", children: b.message }),
2535
+ /* @__PURE__ */ r(c, { size: "xs", ff: "monospace", c: "dimmed", children: [
2522
2536
  "reasonCode: ",
2523
- f.reasonCode,
2524
- f.deniedAt ? ` · deniedAt: ${f.deniedAt}` : "",
2525
- f.grantedByName ? ` · grantedBy: ${f.grantedByName}` : ""
2537
+ b.reasonCode,
2538
+ b.deniedAt ? ` · deniedAt: ${b.deniedAt}` : "",
2539
+ b.grantedByName ? ` · grantedBy: ${b.grantedByName}` : ""
2526
2540
  ] })
2527
2541
  ] }) }),
2528
- a?.afterDecision?.(f)
2542
+ a?.afterDecision?.(b)
2529
2543
  ] }) : null
2530
2544
  ] });
2531
- }, Da = (a) => {
2545
+ }, Oa = (a) => {
2532
2546
  switch (a) {
2533
2547
  case "EFFECTIVE":
2534
- return /* @__PURE__ */ e(Q, { size: "sm", color: "green", variant: "light", children: "vale" });
2548
+ return /* @__PURE__ */ e(j, { size: "sm", color: "green", variant: "light", children: "vale" });
2535
2549
  case "INERT":
2536
- return /* @__PURE__ */ e(Q, { size: "sm", color: "yellow", variant: "light", children: "não vale" });
2550
+ return /* @__PURE__ */ e(j, { size: "sm", color: "yellow", variant: "light", children: "não vale" });
2537
2551
  case "DENIED":
2538
- return /* @__PURE__ */ e(Q, { size: "sm", color: "red", variant: "light", children: "bloqueada" });
2552
+ return /* @__PURE__ */ e(j, { size: "sm", color: "red", variant: "light", children: "bloqueada" });
2539
2553
  default:
2540
- return /* @__PURE__ */ e(Q, { size: "sm", color: "gray", variant: "light", children: "—" });
2554
+ return /* @__PURE__ */ e(j, { size: "sm", color: "gray", variant: "light", children: "—" });
2541
2555
  }
2542
- }, _r = ({ id: a, label: t, slots: n, onSelectUser: s, onSimulate: c }) => {
2556
+ }, at = ({ id: a, label: t, slots: l, onSelectUser: n, onSimulate: u }) => {
2543
2557
  const d = J(
2544
2558
  K.SecurityDiagnostics
2545
- ), [u, x] = T([]), {
2546
- filtro: R,
2547
- setFiltro: m,
2548
- filtrados: v
2549
- } = We(u, (o) => [o.userName, o.email, o.via]), [A, y] = T(!0), [P, f] = T();
2559
+ ), [h, A] = S([]), {
2560
+ filtro: z,
2561
+ setFiltro: g,
2562
+ filtrados: T
2563
+ } = He(h, (o) => [o.userName, o.email, o.via]), [R, x] = S(!0), [D, b] = S();
2550
2564
  ee(() => {
2551
2565
  let o = !1;
2552
- return y(!0), f(void 0), d.getReach(a).then((l) => {
2553
- o || x(l ?? []);
2554
- }).catch((l) => {
2555
- o || f(l instanceof Error ? l.message : "Não foi possível carregar.");
2566
+ return x(!0), b(void 0), d.getReach(a).then((s) => {
2567
+ o || A(s ?? []);
2568
+ }).catch((s) => {
2569
+ o || b(s instanceof Error ? s.message : "Não foi possível carregar.");
2556
2570
  }).finally(() => {
2557
- o || y(!1);
2571
+ o || x(!1);
2558
2572
  }), () => {
2559
2573
  o = !0;
2560
2574
  };
2561
2575
  }, [d, a]);
2562
- const w = u.filter((o) => o.kind === "ADMINISTRADOR").length;
2563
- return /* @__PURE__ */ r(V, { gap: "lg", children: [
2564
- /* @__PURE__ */ r(V, { gap: 4, children: [
2565
- /* @__PURE__ */ e(h, { fw: 620, size: "xl", ff: "monospace", children: t }),
2566
- /* @__PURE__ */ e(h, { size: "sm", c: "dimmed", children: "Quem alcança esta capacidade, e por qual via." })
2576
+ const w = h.filter((o) => o.kind === "ADMINISTRADOR").length;
2577
+ return /* @__PURE__ */ r(U, { gap: "lg", children: [
2578
+ /* @__PURE__ */ r(U, { gap: 4, children: [
2579
+ /* @__PURE__ */ e(c, { fw: 620, size: "xl", ff: "monospace", children: t }),
2580
+ /* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: "Quem alcança esta capacidade, e por qual via." })
2567
2581
  ] }),
2568
- P ? /* @__PURE__ */ e(ye, { color: "red", title: "Erro ao carregar", children: P }) : null,
2582
+ D ? /* @__PURE__ */ e(ce, { color: "red", title: "Erro ao carregar", children: D }) : null,
2569
2583
  /* @__PURE__ */ e(
2570
- we,
2584
+ pe,
2571
2585
  {
2572
2586
  title: "Quem alcança",
2573
- hint: A ? "carregando…" : `${u.length} ${u.length === 1 ? "pessoa" : "pessoas"}`,
2574
- children: A ? /* @__PURE__ */ e(le, { size: "sm" }) : u.length === 0 ? /* @__PURE__ */ e(h, { size: "sm", c: "dimmed", children: "Ninguém. A capacidade existe no catálogo e nunca foi concedida." }) : /* @__PURE__ */ r(xe, { children: [
2587
+ hint: R ? "carregando…" : `${h.length} ${h.length === 1 ? "pessoa" : "pessoas"}`,
2588
+ children: R ? /* @__PURE__ */ e(se, { size: "sm" }) : h.length === 0 ? /* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: "Ninguém. A capacidade existe no catálogo e nunca foi concedida." }) : /* @__PURE__ */ r(xe, { children: [
2575
2589
  /* @__PURE__ */ e(
2576
2590
  Be,
2577
2591
  {
2578
- value: R,
2579
- onChange: m,
2592
+ value: z,
2593
+ onChange: g,
2580
2594
  assunto: "pessoas",
2581
- visiveis: v.length,
2582
- total: u.length
2595
+ visiveis: T.length,
2596
+ total: h.length
2583
2597
  }
2584
2598
  ),
2585
- /* @__PURE__ */ e(Oe, { children: /* @__PURE__ */ r(S, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
2586
- /* @__PURE__ */ e(S.Thead, { children: /* @__PURE__ */ r(S.Tr, { children: [
2587
- /* @__PURE__ */ e(S.Th, { children: "Pessoa" }),
2588
- /* @__PURE__ */ e(S.Th, { children: "Por qual via" }),
2589
- /* @__PURE__ */ e(S.Th, { children: "Situação" })
2599
+ /* @__PURE__ */ e(ke, { children: /* @__PURE__ */ r(m, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
2600
+ /* @__PURE__ */ e(m.Thead, { children: /* @__PURE__ */ r(m.Tr, { children: [
2601
+ /* @__PURE__ */ e(m.Th, { children: "Pessoa" }),
2602
+ /* @__PURE__ */ e(m.Th, { children: "Por qual via" }),
2603
+ /* @__PURE__ */ e(m.Th, { children: "Situação" })
2590
2604
  ] }) }),
2591
- /* @__PURE__ */ e(S.Tbody, { children: v.map((o) => /* @__PURE__ */ r(
2592
- S.Tr,
2605
+ /* @__PURE__ */ e(m.Tbody, { children: T.map((o) => /* @__PURE__ */ r(
2606
+ m.Tr,
2593
2607
  {
2594
- style: { cursor: s ? "pointer" : void 0 },
2595
- onClick: () => s?.(o.userId, o.userName),
2608
+ style: { cursor: n ? "pointer" : void 0 },
2609
+ onClick: () => n?.(o.userId, o.userName),
2596
2610
  children: [
2597
- /* @__PURE__ */ e(S.Td, { children: /* @__PURE__ */ r(V, { gap: 0, children: [
2598
- /* @__PURE__ */ e(h, { size: "sm", fw: 550, children: o.userName }),
2599
- /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: o.email })
2611
+ /* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ r(U, { gap: 0, children: [
2612
+ /* @__PURE__ */ e(c, { size: "sm", fw: 550, children: o.userName }),
2613
+ /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: o.email })
2600
2614
  ] }) }),
2601
- /* @__PURE__ */ e(S.Td, { children: /* @__PURE__ */ r(O, { gap: 6, children: [
2602
- /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: o.via }),
2603
- o.kind === "ADMINISTRADOR" ? /* @__PURE__ */ e(Q, { size: "xs", color: "yellow", variant: "light", children: "atalho" }) : null
2615
+ /* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ r(O, { gap: 6, children: [
2616
+ /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: o.via }),
2617
+ o.kind === "ADMINISTRADOR" ? /* @__PURE__ */ e(j, { size: "xs", color: "yellow", variant: "light", children: "atalho" }) : null
2604
2618
  ] }) }),
2605
- /* @__PURE__ */ e(S.Td, { children: Da(o.situation) })
2619
+ /* @__PURE__ */ e(m.Td, { children: Oa(o.situation) })
2606
2620
  ]
2607
2621
  },
2608
2622
  o.userId
2609
2623
  )) })
2610
2624
  ] }) }),
2611
- w > 0 ? /* @__PURE__ */ r(h, { size: "xs", c: "dimmed", lh: 1.5, children: [
2625
+ w > 0 ? /* @__PURE__ */ r(c, { size: "xs", c: "dimmed", lh: 1.5, children: [
2612
2626
  w === 1 ? "Uma conta alcança" : `${w} contas alcançam`,
2613
2627
  " pelo atalho de administrador — sem concessão nenhuma. Revisar permissões não muda o que elas podem."
2614
2628
  ] }) : null
2615
2629
  ] })
2616
2630
  }
2617
2631
  ),
2618
- n?.afterReachList?.(a, u),
2619
- c ? /* @__PURE__ */ r(h, { size: "xs", c: "dimmed", children: [
2632
+ l?.afterReachList?.(a, h),
2633
+ u ? /* @__PURE__ */ r(c, { size: "xs", c: "dimmed", children: [
2620
2634
  "Para testar uma pessoa específica contra esta capacidade, use ",
2621
2635
  /* @__PURE__ */ e("strong", { children: "Simular" }),
2622
2636
  " na árvore — ela já vem escolhida."
2623
2637
  ] }) : null
2624
2638
  ] });
2625
- }, Sa = ({ id: a, kind: t, slots: n, onSelectUser: s }) => {
2626
- const c = J(
2639
+ }, xa = ({ id: a, kind: t, slots: l, onSelectUser: n }) => {
2640
+ const u = J(
2627
2641
  K.SecurityDiagnostics
2628
- ), [d, u] = T(), [x, R] = T(!0), [m, v] = T(), {
2629
- filtro: A,
2630
- setFiltro: y,
2631
- filtrados: P
2632
- } = We(d?.members ?? [], (b) => [b.name, b.email, b.profileName ?? void 0]), {
2633
- filtro: f,
2642
+ ), [d, h] = S(), [A, z] = S(!0), [g, T] = S(), {
2643
+ filtro: R,
2644
+ setFiltro: x,
2645
+ filtrados: D
2646
+ } = He(d?.members ?? [], (v) => [v.name, v.email, v.profileName ?? void 0]), {
2647
+ filtro: b,
2634
2648
  setFiltro: w,
2635
2649
  filtrados: o
2636
- } = We(d?.grants ?? [], (b) => [b.resource, b.action]);
2650
+ } = He(d?.grants ?? [], (v) => [v.resource, v.action]);
2637
2651
  if (ee(() => {
2638
- let b = !1;
2639
- return R(!0), v(void 0), (t === "GROUP" ? c.getGroup(a) : c.getProfile(a)).then((E) => {
2640
- b || u(E);
2641
- }).catch((E) => {
2642
- b || v(E instanceof Error ? E.message : "Não foi possível carregar.");
2652
+ let v = !1;
2653
+ return z(!0), T(void 0), (t === "GROUP" ? u.getGroup(a) : u.getProfile(a)).then((y) => {
2654
+ v || h(y);
2655
+ }).catch((y) => {
2656
+ v || T(y instanceof Error ? y.message : "Não foi possível carregar.");
2643
2657
  }).finally(() => {
2644
- b || R(!1);
2658
+ v || z(!1);
2645
2659
  }), () => {
2646
- b = !0;
2660
+ v = !0;
2647
2661
  };
2648
- }, [c, a, t]), x)
2662
+ }, [u, a, t]), A)
2649
2663
  return /* @__PURE__ */ r(O, { gap: 8, children: [
2650
- /* @__PURE__ */ e(le, { size: "sm" }),
2651
- /* @__PURE__ */ e(h, { size: "sm", c: "dimmed", children: "Carregando…" })
2664
+ /* @__PURE__ */ e(se, { size: "sm" }),
2665
+ /* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: "Carregando…" })
2652
2666
  ] });
2653
- if (m)
2654
- return /* @__PURE__ */ e(ye, { color: "red", title: "Erro ao carregar", children: m });
2667
+ if (g)
2668
+ return /* @__PURE__ */ e(ce, { color: "red", title: "Erro ao carregar", children: g });
2655
2669
  if (!d)
2656
2670
  return null;
2657
- const l = t === "GROUP" ? "grupo" : "perfil", p = n?.additionalMemberColumns ?? [];
2658
- return /* @__PURE__ */ r(V, { gap: "lg", children: [
2659
- /* @__PURE__ */ r(V, { gap: 4, children: [
2671
+ const s = t === "GROUP" ? "grupo" : "perfil", p = l?.additionalMemberColumns ?? [];
2672
+ return /* @__PURE__ */ r(U, { gap: "lg", children: [
2673
+ /* @__PURE__ */ r(U, { gap: 4, children: [
2660
2674
  /* @__PURE__ */ r(O, { gap: 8, children: [
2661
- /* @__PURE__ */ e(h, { fw: 620, size: "xl", children: d.groupName }),
2662
- /* @__PURE__ */ e(Q, { variant: "light", children: l })
2675
+ /* @__PURE__ */ e(c, { fw: 620, size: "xl", children: d.groupName }),
2676
+ /* @__PURE__ */ e(j, { variant: "light", children: s })
2663
2677
  ] }),
2664
- d.description ? /* @__PURE__ */ e(h, { size: "sm", c: "dimmed", children: d.description }) : null
2678
+ d.description ? /* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: d.description }) : null
2665
2679
  ] }),
2666
2680
  /* @__PURE__ */ r(
2667
- we,
2681
+ pe,
2668
2682
  {
2669
2683
  title: "Membros",
2670
2684
  hint: `${d.members.length} — o total de cada um soma todas as origens`,
2671
2685
  children: [
2672
- d.members.length === 0 ? /* @__PURE__ */ r(h, { size: "sm", c: "dimmed", children: [
2686
+ d.members.length === 0 ? /* @__PURE__ */ r(c, { size: "sm", c: "dimmed", children: [
2673
2687
  "Ninguém está ",
2674
2688
  t === "GROUP" ? "neste grupo" : "com este perfil",
2675
2689
  "."
@@ -2677,50 +2691,50 @@ const Ue = (a) => {
2677
2691
  /* @__PURE__ */ e(
2678
2692
  Be,
2679
2693
  {
2680
- value: A,
2681
- onChange: y,
2694
+ value: R,
2695
+ onChange: x,
2682
2696
  assunto: "pessoas",
2683
- visiveis: P.length,
2697
+ visiveis: D.length,
2684
2698
  total: d.members.length
2685
2699
  }
2686
2700
  ),
2687
- /* @__PURE__ */ e(Oe, { children: /* @__PURE__ */ r(S, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
2688
- /* @__PURE__ */ e(S.Thead, { children: /* @__PURE__ */ r(S.Tr, { children: [
2689
- /* @__PURE__ */ e(S.Th, { children: "Pessoa" }),
2690
- /* @__PURE__ */ e(S.Th, { children: "Perfil" }),
2691
- /* @__PURE__ */ e(S.Th, { ta: "right", children: "Concedidas" }),
2692
- /* @__PURE__ */ e(S.Th, { ta: "right", children: "Valem" }),
2693
- /* @__PURE__ */ e(S.Th, { ta: "right", children: "Não valem" }),
2694
- /* @__PURE__ */ e(S.Th, { ta: "right", children: "Bloqueadas" }),
2695
- p.map((b) => /* @__PURE__ */ e(S.Th, { children: b.header }, b.header))
2701
+ /* @__PURE__ */ e(ke, { children: /* @__PURE__ */ r(m, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
2702
+ /* @__PURE__ */ e(m.Thead, { children: /* @__PURE__ */ r(m.Tr, { children: [
2703
+ /* @__PURE__ */ e(m.Th, { children: "Pessoa" }),
2704
+ /* @__PURE__ */ e(m.Th, { children: "Perfil" }),
2705
+ /* @__PURE__ */ e(m.Th, { ta: "right", children: "Concedidas" }),
2706
+ /* @__PURE__ */ e(m.Th, { ta: "right", children: "Valem" }),
2707
+ /* @__PURE__ */ e(m.Th, { ta: "right", children: "Não valem" }),
2708
+ /* @__PURE__ */ e(m.Th, { ta: "right", children: "Bloqueadas" }),
2709
+ p.map((v) => /* @__PURE__ */ e(m.Th, { children: v.header }, v.header))
2696
2710
  ] }) }),
2697
- /* @__PURE__ */ e(S.Tbody, { children: P.map((b) => /* @__PURE__ */ r(
2698
- S.Tr,
2711
+ /* @__PURE__ */ e(m.Tbody, { children: D.map((v) => /* @__PURE__ */ r(
2712
+ m.Tr,
2699
2713
  {
2700
- style: { cursor: s ? "pointer" : void 0 },
2701
- onClick: () => s?.(b.userId, b.name),
2714
+ style: { cursor: n ? "pointer" : void 0 },
2715
+ onClick: () => n?.(v.userId, v.name),
2702
2716
  children: [
2703
- /* @__PURE__ */ e(S.Td, { children: /* @__PURE__ */ r(V, { gap: 0, children: [
2717
+ /* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ r(U, { gap: 0, children: [
2704
2718
  /* @__PURE__ */ r(O, { gap: 6, children: [
2705
- /* @__PURE__ */ e(h, { size: "sm", fw: 550, children: b.name }),
2706
- b.administrator ? /* @__PURE__ */ e(Q, { size: "xs", color: "yellow", variant: "light", children: "administrador" }) : null,
2707
- b.enabled ? null : /* @__PURE__ */ e(Q, { size: "xs", color: "red", variant: "light", children: "desativada" })
2719
+ /* @__PURE__ */ e(c, { size: "sm", fw: 550, children: v.name }),
2720
+ v.administrator ? /* @__PURE__ */ e(j, { size: "xs", color: "yellow", variant: "light", children: "administrador" }) : null,
2721
+ v.enabled ? null : /* @__PURE__ */ e(j, { size: "xs", color: "red", variant: "light", children: "desativada" })
2708
2722
  ] }),
2709
- /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: b.email })
2723
+ /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: v.email })
2710
2724
  ] }) }),
2711
- /* @__PURE__ */ e(S.Td, { children: /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: b.profileName ?? "—" }) }),
2712
- /* @__PURE__ */ e(S.Td, { ta: "right", children: b.total }),
2713
- /* @__PURE__ */ e(S.Td, { ta: "right", c: "green", children: b.effective }),
2714
- /* @__PURE__ */ e(S.Td, { ta: "right", c: "yellow.7", children: b.inert }),
2715
- /* @__PURE__ */ e(S.Td, { ta: "right", c: "red", children: b.denied }),
2716
- p.map((L) => /* @__PURE__ */ e(S.Td, { children: L.render(b, d) }, L.header))
2725
+ /* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: v.profileName ?? "—" }) }),
2726
+ /* @__PURE__ */ e(m.Td, { ta: "right", children: v.total }),
2727
+ /* @__PURE__ */ e(m.Td, { ta: "right", c: "green", children: v.effective }),
2728
+ /* @__PURE__ */ e(m.Td, { ta: "right", c: "yellow.7", children: v.inert }),
2729
+ /* @__PURE__ */ e(m.Td, { ta: "right", c: "red", children: v.denied }),
2730
+ p.map(($) => /* @__PURE__ */ e(m.Td, { children: $.render(v, d) }, $.header))
2717
2731
  ]
2718
2732
  },
2719
- b.userId
2733
+ v.userId
2720
2734
  )) })
2721
2735
  ] }) })
2722
2736
  ] }),
2723
- /* @__PURE__ */ r(h, { size: "xs", c: "dimmed", lh: 1.5, children: [
2737
+ /* @__PURE__ */ r(c, { size: "xs", c: "dimmed", lh: 1.5, children: [
2724
2738
  "O total do membro não é o total ",
2725
2739
  t === "GROUP" ? "do grupo" : "do perfil",
2726
2740
  ": ele soma o que vem de outras vias. Clique numa pessoa para ver a lista dela."
@@ -2728,41 +2742,41 @@ const Ue = (a) => {
2728
2742
  ]
2729
2743
  }
2730
2744
  ),
2731
- /* @__PURE__ */ e(we, { title: `O que este ${l} concede`, hint: "a parte que é responsabilidade dele", children: d.grants.length === 0 ? /* @__PURE__ */ e(h, { size: "sm", c: "dimmed", children: "Nada concedido por esta via." }) : /* @__PURE__ */ r(xe, { children: [
2745
+ /* @__PURE__ */ e(pe, { title: `O que este ${s} concede`, hint: "a parte que é responsabilidade dele", children: d.grants.length === 0 ? /* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: "Nada concedido por esta via." }) : /* @__PURE__ */ r(xe, { children: [
2732
2746
  /* @__PURE__ */ e(
2733
2747
  Be,
2734
2748
  {
2735
- value: f,
2749
+ value: b,
2736
2750
  onChange: w,
2737
2751
  assunto: "capacidades",
2738
2752
  visiveis: o.length,
2739
2753
  total: d.grants.length
2740
2754
  }
2741
2755
  ),
2742
- /* @__PURE__ */ e(Oe, { children: /* @__PURE__ */ r(S, { striped: !0, withTableBorder: !0, stickyHeader: !0, children: [
2743
- /* @__PURE__ */ e(S.Thead, { children: /* @__PURE__ */ r(S.Tr, { children: [
2744
- /* @__PURE__ */ e(S.Th, { children: "Capacidade" }),
2745
- /* @__PURE__ */ e(S.Th, { children: "Situação" })
2756
+ /* @__PURE__ */ e(ke, { children: /* @__PURE__ */ r(m, { striped: !0, withTableBorder: !0, stickyHeader: !0, children: [
2757
+ /* @__PURE__ */ e(m.Thead, { children: /* @__PURE__ */ r(m.Tr, { children: [
2758
+ /* @__PURE__ */ e(m.Th, { children: "Capacidade" }),
2759
+ /* @__PURE__ */ e(m.Th, { children: "Situação" })
2746
2760
  ] }) }),
2747
- /* @__PURE__ */ e(S.Tbody, { children: o.map((b, L) => /* @__PURE__ */ r(S.Tr, { children: [
2748
- /* @__PURE__ */ e(S.Td, { children: /* @__PURE__ */ r(h, { size: "sm", ff: "monospace", children: [
2749
- b.resource,
2761
+ /* @__PURE__ */ e(m.Tbody, { children: o.map((v, $) => /* @__PURE__ */ r(m.Tr, { children: [
2762
+ /* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ r(c, { size: "sm", ff: "monospace", children: [
2763
+ v.resource,
2750
2764
  " · ",
2751
- b.action
2765
+ v.action
2752
2766
  ] }) }),
2753
- /* @__PURE__ */ e(S.Td, { children: Da(b.situation) })
2754
- ] }, `${b.resource}-${b.action}-${L}`)) })
2767
+ /* @__PURE__ */ e(m.Td, { children: Oa(v.situation) })
2768
+ ] }, `${v.resource}-${v.action}-${$}`)) })
2755
2769
  ] }) })
2756
2770
  ] }) }),
2757
- n?.afterGroupMembers?.(d)
2771
+ l?.afterGroupMembers?.(d)
2758
2772
  ] });
2759
- }, xa = 50, aa = [
2773
+ }, Ca = 50, aa = [
2760
2774
  { branch: "USERS", label: "Pessoas" },
2761
2775
  { branch: "GROUPS", label: "Grupos" },
2762
2776
  { branch: "PROFILES", label: "Perfis" },
2763
2777
  { branch: "RESOURCES", label: "Recursos" }
2764
- ], ra = { nodes: [], total: 0, carregando: !1, carregouTudo: !1 }, et = ({ aberta: a }) => /* @__PURE__ */ e(
2765
- _,
2778
+ ], ra = { nodes: [], total: 0, carregando: !1, carregouTudo: !1 }, rt = ({ aberta: a }) => /* @__PURE__ */ e(
2779
+ Y,
2766
2780
  {
2767
2781
  "aria-hidden": !0,
2768
2782
  style: {
@@ -2774,7 +2788,7 @@ const Ue = (a) => {
2774
2788
  justifyContent: "center"
2775
2789
  },
2776
2790
  children: /* @__PURE__ */ e(
2777
- _,
2791
+ Y,
2778
2792
  {
2779
2793
  style: {
2780
2794
  width: 0,
@@ -2790,100 +2804,100 @@ const Ue = (a) => {
2790
2804
  }
2791
2805
  )
2792
2806
  }
2793
- ), at = ({ selected: a, onSelect: t }) => {
2794
- const n = J(
2807
+ ), tt = ({ selected: a, onSelect: t }) => {
2808
+ const l = J(
2795
2809
  K.SecurityDiagnostics
2796
- ), [s, c] = T(""), [d] = ia(s, 300), [u, x] = T({}), [R, m] = T({}), v = (o, l) => l ? `${o}:${l}` : o, A = ae(
2797
- async (o, l, p) => {
2798
- const b = v(o, l), L = R[b] ?? ra;
2799
- if (L.carregando || p && L.carregouTudo)
2810
+ ), [n, u] = S(""), [d] = oa(n, 300), [h, A] = S({}), [z, g] = S({}), T = (o, s) => s ? `${o}:${s}` : o, R = ae(
2811
+ async (o, s, p) => {
2812
+ const v = T(o, s), $ = z[v] ?? ra;
2813
+ if ($.carregando || p && $.carregouTudo)
2800
2814
  return;
2801
- const E = p ? Math.floor(L.nodes.length / xa) : 0;
2802
- m((i) => ({ ...i, [b]: { ...i[b] ?? ra, carregando: !0, erro: void 0 } }));
2815
+ const y = p ? Math.floor($.nodes.length / Ca) : 0;
2816
+ g((i) => ({ ...i, [v]: { ...i[v] ?? ra, carregando: !0, erro: void 0 } }));
2803
2817
  try {
2804
- const i = await n.browse(o, {
2805
- parentId: l,
2818
+ const i = await l.browse(o, {
2819
+ parentId: s,
2806
2820
  q: d || void 0,
2807
- page: E,
2808
- size: xa
2821
+ page: y,
2822
+ size: Ca
2809
2823
  });
2810
- m((N) => {
2811
- const G = [...p ? N[b]?.nodes ?? [] : [], ...i.content ?? []];
2824
+ g((N) => {
2825
+ const M = [...p ? N[v]?.nodes ?? [] : [], ...i.content ?? []];
2812
2826
  return {
2813
2827
  ...N,
2814
- [b]: {
2815
- nodes: G,
2816
- total: i.totalElements ?? G.length,
2828
+ [v]: {
2829
+ nodes: M,
2830
+ total: i.totalElements ?? M.length,
2817
2831
  carregando: !1,
2818
- carregouTudo: G.length >= (i.totalElements ?? 0)
2832
+ carregouTudo: M.length >= (i.totalElements ?? 0)
2819
2833
  }
2820
2834
  };
2821
2835
  });
2822
2836
  } catch (i) {
2823
- m((N) => ({
2837
+ g((N) => ({
2824
2838
  ...N,
2825
- [b]: {
2826
- ...N[b] ?? ra,
2839
+ [v]: {
2840
+ ...N[v] ?? ra,
2827
2841
  carregando: !1,
2828
2842
  erro: i instanceof Error ? i.message : "Não foi possível carregar."
2829
2843
  }
2830
2844
  }));
2831
2845
  }
2832
2846
  },
2833
- [n, d, R]
2847
+ [l, d, z]
2834
2848
  );
2835
2849
  ee(() => {
2836
- if (m({}), d) {
2850
+ if (g({}), d) {
2837
2851
  const o = {};
2838
- aa.forEach((l) => {
2839
- o[l.branch] = !0;
2840
- }), x((l) => ({ ...l, ...o }));
2852
+ aa.forEach((s) => {
2853
+ o[s.branch] = !0;
2854
+ }), A((s) => ({ ...s, ...o }));
2841
2855
  }
2842
2856
  }, [d]), ee(() => {
2843
2857
  aa.forEach((o) => {
2844
- u[o.branch] && !R[o.branch] && A(o.branch, void 0, !1);
2858
+ h[o.branch] && !z[o.branch] && R(o.branch, void 0, !1);
2845
2859
  });
2846
- }, [u, R, d]);
2847
- const y = (o) => x((l) => ({ ...l, [o]: !l[o] })), P = (o) => o === "critical" ? "red" : o === "warning" ? "yellow" : void 0, f = (o, l, p) => {
2848
- const b = v("ACTIONS_OF_RESOURCE", o.id), L = !!u[b], E = R[b], i = a?.kind === o.kind && a?.id === o.id;
2849
- return /* @__PURE__ */ r(_, { children: [
2860
+ }, [h, z, d]);
2861
+ const x = (o) => A((s) => ({ ...s, [o]: !s[o] })), D = (o) => o === "critical" ? "red" : o === "warning" ? "yellow" : void 0, b = (o, s, p) => {
2862
+ const v = T("ACTIONS_OF_RESOURCE", o.id), $ = !!h[v], y = z[v], i = a?.kind === o.kind && a?.id === o.id;
2863
+ return /* @__PURE__ */ r(Y, { children: [
2850
2864
  /* @__PURE__ */ e(
2851
2865
  ze,
2852
2866
  {
2853
2867
  onClick: () => {
2854
- t({ kind: o.kind, id: o.id, label: o.label, parentLabel: p }), o.hasChildren && (y(b), E || A("ACTIONS_OF_RESOURCE", o.id, !1));
2868
+ t({ kind: o.kind, id: o.id, label: o.label, parentLabel: p }), o.hasChildren && (x(v), y || R("ACTIONS_OF_RESOURCE", o.id, !1));
2855
2869
  },
2856
2870
  "aria-current": i ? "true" : void 0,
2857
- "aria-expanded": o.hasChildren ? L : void 0,
2871
+ "aria-expanded": o.hasChildren ? $ : void 0,
2858
2872
  style: {
2859
2873
  display: "block",
2860
2874
  width: "100%",
2861
2875
  padding: "5px 8px",
2862
- paddingLeft: 8 + l * 14,
2876
+ paddingLeft: 8 + s * 14,
2863
2877
  borderRadius: 5,
2864
2878
  background: i ? "var(--mantine-color-blue-light)" : void 0
2865
2879
  },
2866
2880
  children: /* @__PURE__ */ r(O, { gap: 7, wrap: "nowrap", children: [
2867
- o.severity ? /* @__PURE__ */ e(Q, { size: "xs", circle: !0, color: P(o.severity) }) : /* @__PURE__ */ e(_, { w: 8 }),
2868
- /* @__PURE__ */ e(h, { size: "sm", fw: i ? 600 : 400, truncate: !0, style: { flex: 1 }, children: o.label }),
2869
- o.badge ? /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", ff: "monospace", children: o.badge }) : null
2881
+ o.severity ? /* @__PURE__ */ e(j, { size: "xs", circle: !0, color: D(o.severity) }) : /* @__PURE__ */ e(Y, { w: 8 }),
2882
+ /* @__PURE__ */ e(c, { size: "sm", fw: i ? 600 : 400, truncate: !0, style: { flex: 1 }, children: o.label }),
2883
+ o.badge ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", ff: "monospace", children: o.badge }) : null
2870
2884
  ] })
2871
2885
  }
2872
2886
  ),
2873
- o.hasChildren && L ? /* @__PURE__ */ r(_, { children: [
2874
- E?.nodes.map((N) => f(N, l + 1, o.label)),
2875
- E?.carregando ? /* @__PURE__ */ r(O, { gap: 6, pl: 8 + (l + 1) * 14, py: 4, children: [
2876
- /* @__PURE__ */ e(le, { size: "xs" }),
2877
- /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: "carregando…" })
2887
+ o.hasChildren && $ ? /* @__PURE__ */ r(Y, { children: [
2888
+ y?.nodes.map((N) => b(N, s + 1, o.label)),
2889
+ y?.carregando ? /* @__PURE__ */ r(O, { gap: 6, pl: 8 + (s + 1) * 14, py: 4, children: [
2890
+ /* @__PURE__ */ e(se, { size: "xs" }),
2891
+ /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: "carregando…" })
2878
2892
  ] }) : null,
2879
- E && !E.erro && !E.carregouTudo && !E.carregando && E.total > E.nodes.length ? /* @__PURE__ */ e(
2893
+ y && !y.erro && !y.carregouTudo && !y.carregando && y.total > y.nodes.length ? /* @__PURE__ */ e(
2880
2894
  ze,
2881
2895
  {
2882
- onClick: () => void A("ACTIONS_OF_RESOURCE", o.id, !0),
2883
- style: { paddingLeft: 8 + (l + 1) * 14, paddingTop: 3, paddingBottom: 3 },
2884
- children: /* @__PURE__ */ r(h, { size: "xs", c: "blue", children: [
2896
+ onClick: () => void R("ACTIONS_OF_RESOURCE", o.id, !0),
2897
+ style: { paddingLeft: 8 + (s + 1) * 14, paddingTop: 3, paddingBottom: 3 },
2898
+ children: /* @__PURE__ */ r(c, { size: "xs", c: "blue", children: [
2885
2899
  "mais ",
2886
- E.total - E.nodes.length,
2900
+ y.total - y.nodes.length,
2887
2901
  " →"
2888
2902
  ] })
2889
2903
  }
@@ -2891,63 +2905,174 @@ const Ue = (a) => {
2891
2905
  ] }) : null
2892
2906
  ] }, `${o.kind}-${o.id}`);
2893
2907
  }, w = ie(() => aa, []);
2894
- return /* @__PURE__ */ r(_, { children: [
2908
+ return /* @__PURE__ */ r(Y, { children: [
2895
2909
  /* @__PURE__ */ e(
2896
- ve,
2910
+ he,
2897
2911
  {
2898
2912
  size: "xs",
2899
2913
  placeholder: "Buscar pessoa, grupo, capacidade…",
2900
- value: s,
2901
- onChange: (o) => c(o.currentTarget.value),
2914
+ value: n,
2915
+ onChange: (o) => u(o.currentTarget.value),
2902
2916
  "aria-label": "Buscar na árvore",
2903
2917
  mb: "xs",
2904
- rightSection: s && s !== d ? /* @__PURE__ */ e(le, { size: "xs" }) : null
2918
+ rightSection: n && n !== d ? /* @__PURE__ */ e(se, { size: "xs" }) : null
2905
2919
  }
2906
2920
  ),
2907
2921
  w.map((o) => {
2908
- const l = !!u[o.branch], p = R[o.branch];
2909
- return /* @__PURE__ */ r(_, { mb: 2, children: [
2922
+ const s = !!h[o.branch], p = z[o.branch];
2923
+ return /* @__PURE__ */ r(Y, { mb: 2, children: [
2910
2924
  /* @__PURE__ */ e(
2911
2925
  ze,
2912
2926
  {
2913
2927
  onClick: () => {
2914
- y(o.branch), p || A(o.branch, void 0, !1);
2928
+ x(o.branch), p || R(o.branch, void 0, !1);
2915
2929
  },
2916
- "aria-expanded": l,
2930
+ "aria-expanded": s,
2917
2931
  style: { display: "block", width: "100%", padding: "5px 8px", borderRadius: 5 },
2918
2932
  children: /* @__PURE__ */ r(O, { gap: 7, wrap: "nowrap", children: [
2919
- /* @__PURE__ */ e(et, { aberta: l }),
2920
- /* @__PURE__ */ e(h, { size: "sm", fw: 600, style: { flex: 1 }, children: o.label }),
2921
- p ? /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", ff: "monospace", children: p.total }) : null
2933
+ /* @__PURE__ */ e(rt, { aberta: s }),
2934
+ /* @__PURE__ */ e(c, { size: "sm", fw: 600, style: { flex: 1 }, children: o.label }),
2935
+ p ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", ff: "monospace", children: p.total }) : null
2922
2936
  ] })
2923
2937
  }
2924
2938
  ),
2925
- l ? /* @__PURE__ */ r(_, { children: [
2926
- p?.erro ? /* @__PURE__ */ e(h, { size: "xs", c: "red", pl: 22, py: 4, children: p.erro }) : null,
2927
- p?.nodes.map((b) => f(b, 1)),
2939
+ s ? /* @__PURE__ */ r(Y, { children: [
2940
+ p?.erro ? /* @__PURE__ */ e(c, { size: "xs", c: "red", pl: 22, py: 4, children: p.erro }) : null,
2941
+ p?.nodes.map((v) => b(v, 1)),
2928
2942
  p?.carregando ? /* @__PURE__ */ r(O, { gap: 6, pl: 22, py: 4, children: [
2929
- /* @__PURE__ */ e(le, { size: "xs" }),
2930
- /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: "carregando…" })
2943
+ /* @__PURE__ */ e(se, { size: "xs" }),
2944
+ /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: "carregando…" })
2931
2945
  ] }) : null,
2932
2946
  p && !p.erro && !p.carregouTudo && !p.carregando && p.total > p.nodes.length ? /* @__PURE__ */ e(
2933
2947
  ze,
2934
2948
  {
2935
- onClick: () => void A(o.branch, void 0, !0),
2949
+ onClick: () => void R(o.branch, void 0, !0),
2936
2950
  style: { paddingLeft: 22, paddingTop: 3, paddingBottom: 3 },
2937
- children: /* @__PURE__ */ r(h, { size: "xs", c: "blue", children: [
2951
+ children: /* @__PURE__ */ r(c, { size: "xs", c: "blue", children: [
2938
2952
  "mais ",
2939
2953
  p.total - p.nodes.length,
2940
2954
  " →"
2941
2955
  ] })
2942
2956
  }
2943
2957
  ) : null,
2944
- p && !p.erro && p.nodes.length === 0 && !p.carregando ? /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", pl: 22, py: 4, children: d ? "Nada encontrado." : "Vazio." }) : null
2958
+ p && !p.erro && p.nodes.length === 0 && !p.carregando ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", pl: 22, py: 4, children: d ? "Nada encontrado." : "Vazio." }) : null
2945
2959
  ] }) : null
2946
2960
  ] }, o.branch);
2947
2961
  })
2948
2962
  ] });
2949
- }, rt = () => /* @__PURE__ */ e(
2950
- _,
2963
+ }, it = 50, ta = {
2964
+ LOGIN: { label: "Entrou" },
2965
+ LOGIN_FALHOU: { label: "Falha ao entrar", cor: "red" },
2966
+ LOGOUT: { label: "Saiu" },
2967
+ ACESSO_NEGADO: { label: "Acesso negado", cor: "red" },
2968
+ SIMULACAO: { label: "Simulação", cor: "blue" }
2969
+ }, ot = ({ slots: a, onError: t }) => {
2970
+ const l = J(
2971
+ K.SecurityDiagnostics
2972
+ ), [n, u] = S([]), [d, h] = S(1), [A, z] = S(1), [g, T] = S(0), [R, x] = S(""), [D, b] = S(null), [w, o] = S(!1), [s, p] = S(null), [v, $] = S(!1);
2973
+ return ee(() => {
2974
+ let y = !1;
2975
+ o(!0), p(null);
2976
+ const N = setTimeout(() => {
2977
+ l.getAuditEvents({
2978
+ usuario: R || void 0,
2979
+ tipo: D ?? void 0,
2980
+ page: d - 1,
2981
+ size: it
2982
+ }).then((I) => {
2983
+ y || (u(I.content ?? []), T(I.totalElements ?? 0), z(Math.max(I.totalPages ?? 1, 1)), $(!1));
2984
+ }).catch((I) => {
2985
+ if (y)
2986
+ return;
2987
+ const M = I instanceof Error ? I.message : "Não foi possível ler a trilha.";
2988
+ /404/.test(M) ? ($(!0), u([])) : (p(M), t?.(M));
2989
+ }).finally(() => {
2990
+ y || o(!1);
2991
+ });
2992
+ }, R ? 400 : 0);
2993
+ return () => {
2994
+ y = !0, clearTimeout(N);
2995
+ };
2996
+ }, [l, R, D, d, t]), v ? /* @__PURE__ */ r(ce, { color: "yellow", title: "Trilha desligada", children: [
2997
+ "O servidor está com ",
2998
+ /* @__PURE__ */ e("code", { children: "archbase.security.audit.enabled=false" }),
2999
+ '. Nada é registrado enquanto estiver assim — a lista vazia aqui significaria "nada aconteceu", e não é o caso.'
3000
+ ] }) : /* @__PURE__ */ r(U, { gap: "md", style: { flex: 1, minHeight: 0 }, children: [
3001
+ /* @__PURE__ */ r(U, { gap: 4, children: [
3002
+ /* @__PURE__ */ e(c, { fw: 620, size: "xl", children: "Trilha de auditoria" }),
3003
+ /* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: "O que aconteceu — entradas, falhas, acessos negados e simulações. As outras telas mostram como a segurança está agora; esta mostra o que passou." })
3004
+ ] }),
3005
+ /* @__PURE__ */ r(O, { gap: "xs", align: "flex-end", children: [
3006
+ /* @__PURE__ */ e(
3007
+ he,
3008
+ {
3009
+ size: "xs",
3010
+ label: "Pessoa",
3011
+ placeholder: "e-mail ou parte dele",
3012
+ value: R,
3013
+ onChange: (y) => {
3014
+ x(y.currentTarget.value), h(1);
3015
+ },
3016
+ style: { minWidth: 220 }
3017
+ }
3018
+ ),
3019
+ /* @__PURE__ */ e(
3020
+ er,
3021
+ {
3022
+ size: "xs",
3023
+ label: "Tipo",
3024
+ placeholder: "todos",
3025
+ clearable: !0,
3026
+ value: D,
3027
+ onChange: (y) => {
3028
+ b(y ?? null), h(1);
3029
+ },
3030
+ data: Object.entries(ta).map(([y, { label: i }]) => ({ value: y, label: i })),
3031
+ style: { minWidth: 180 }
3032
+ }
3033
+ ),
3034
+ /* @__PURE__ */ r(j, { variant: "light", children: [
3035
+ g,
3036
+ " ",
3037
+ g === 1 ? "evento" : "eventos"
3038
+ ] }),
3039
+ w ? /* @__PURE__ */ e(se, { size: "xs" }) : null
3040
+ ] }),
3041
+ s ? /* @__PURE__ */ e(ce, { color: "red", title: "Erro ao ler a trilha", children: s }) : null,
3042
+ !w && !s && n.length === 0 ? /* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: "Nenhum evento no período." }) : null,
3043
+ n.length > 0 ? /* @__PURE__ */ e(pe, { title: "Eventos", hint: "do mais recente para o mais antigo", children: /* @__PURE__ */ e(ke, { maxHeight: "calc(100vh - 420px)", children: /* @__PURE__ */ r(m, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
3044
+ /* @__PURE__ */ e(m.Thead, { children: /* @__PURE__ */ r(m.Tr, { children: [
3045
+ /* @__PURE__ */ e(m.Th, { children: "Quando" }),
3046
+ /* @__PURE__ */ e(m.Th, { children: "O quê" }),
3047
+ /* @__PURE__ */ e(m.Th, { children: "Quem" }),
3048
+ /* @__PURE__ */ e(m.Th, { children: "Sobre" }),
3049
+ /* @__PURE__ */ e(m.Th, { children: "Por quê" }),
3050
+ /* @__PURE__ */ e(m.Th, { children: "Origem" })
3051
+ ] }) }),
3052
+ /* @__PURE__ */ e(m.Tbody, { children: n.map((y) => /* @__PURE__ */ r(m.Tr, { children: [
3053
+ /* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ e(c, { size: "xs", children: nt(y.dataHora) }) }),
3054
+ /* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ e(j, { size: "sm", variant: "light", color: ta[y.tipo]?.cor, children: ta[y.tipo]?.label ?? y.tipo }) }),
3055
+ /* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ e(c, { size: "sm", children: y.usuario ?? "—" }) }),
3056
+ /* @__PURE__ */ e(m.Td, { children: y.recurso || y.acao ? /* @__PURE__ */ r(c, { size: "xs", ff: "monospace", children: [
3057
+ y.recurso,
3058
+ " · ",
3059
+ y.acao
3060
+ ] }) : /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: "—" }) }),
3061
+ /* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: y.detalhe ?? "—" }) }),
3062
+ /* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: y.origem ?? "—" }) })
3063
+ ] }, y.id)) })
3064
+ ] }) }) }) : null,
3065
+ A > 1 ? /* @__PURE__ */ e(O, { justify: "center", children: /* @__PURE__ */ e(Ia, { value: d, onChange: h, total: A, size: "sm" }) }) : null,
3066
+ a?.afterAuditTrail?.(n)
3067
+ ] });
3068
+ }, nt = (a) => {
3069
+ try {
3070
+ return new Date(a).toLocaleString();
3071
+ } catch {
3072
+ return a;
3073
+ }
3074
+ }, lt = () => /* @__PURE__ */ e(
3075
+ Y,
2951
3076
  {
2952
3077
  "aria-hidden": !0,
2953
3078
  style: {
@@ -2958,67 +3083,69 @@ const Ue = (a) => {
2958
3083
  borderBottom: "4px solid transparent"
2959
3084
  }
2960
3085
  }
2961
- ), Ta = { kind: "OVERVIEW", id: "overview", label: "Panorama" }, Aa = { kind: "SIMULATE", id: "simulate", label: "Simular acesso" }, ft = ({
3086
+ ), Aa = { kind: "OVERVIEW", id: "overview", label: "Panorama" }, Ra = { kind: "SIMULATE", id: "simulate", label: "Simular acesso" }, st = { kind: "AUDIT", id: "audit", label: "Trilha de auditoria" }, St = ({
2962
3087
  height: a = "100%",
2963
3088
  width: t = "100%",
2964
- slots: n,
2965
- onError: s
3089
+ slots: l,
3090
+ onError: n
2966
3091
  }) => {
2967
- const [c, d] = T(Ta), [u, x] = T([]), [R, m] = T({}), v = ae((w) => {
2968
- d((o) => o.kind === w.kind && o.id === w.id ? o : (x((l) => [...l, o]), w)), w.kind === "USER" && m((o) => ({ ...o, userId: w.id, userLabel: w.label })), w.kind === "ACTION" && m((o) => ({ ...o, action: w.label, resource: w.parentLabel }));
2969
- }, []), A = ae(() => {
2970
- x((w) => {
3092
+ const [u, d] = S(Aa), [h, A] = S([]), [z, g] = S({}), T = ae((w) => {
3093
+ d((o) => o.kind === w.kind && o.id === w.id ? o : (A((s) => [...s, o]), w)), w.kind === "USER" && g((o) => ({ ...o, userId: w.id, userLabel: w.label })), w.kind === "ACTION" && g((o) => ({ ...o, action: w.label, resource: w.parentLabel }));
3094
+ }, []), R = ae(() => {
3095
+ A((w) => {
2971
3096
  const o = w[w.length - 1];
2972
3097
  return o ? (d(o), w.slice(0, -1)) : w;
2973
3098
  });
2974
- }, []), y = ae(
2975
- (w, o) => v({ kind: "USER", id: w, label: o }),
2976
- [v]
2977
- ), P = (w) => /* @__PURE__ */ e(
3099
+ }, []), x = ae(
3100
+ (w, o) => T({ kind: "USER", id: w, label: o }),
3101
+ [T]
3102
+ ), D = (w) => /* @__PURE__ */ e(
2978
3103
  ze,
2979
3104
  {
2980
- onClick: () => v(w),
2981
- "aria-current": c.kind === w.kind ? "true" : void 0,
3105
+ onClick: () => T(w),
3106
+ "aria-current": u.kind === w.kind ? "true" : void 0,
2982
3107
  style: {
2983
3108
  display: "block",
2984
3109
  width: "100%",
2985
3110
  padding: "6px 8px",
2986
3111
  borderRadius: 5,
2987
- background: c.kind === w.kind ? "var(--mantine-color-blue-light)" : void 0
3112
+ background: u.kind === w.kind ? "var(--mantine-color-blue-light)" : void 0
2988
3113
  },
2989
- children: /* @__PURE__ */ e(h, { size: "sm", fw: c.kind === w.kind ? 600 : 500, children: w.label })
3114
+ children: /* @__PURE__ */ e(c, { size: "sm", fw: u.kind === w.kind ? 600 : 500, children: w.label })
2990
3115
  },
2991
3116
  w.id
2992
- ), f = () => {
2993
- switch (c.kind) {
3117
+ ), b = () => {
3118
+ switch (u.kind) {
2994
3119
  case "OVERVIEW":
2995
- return /* @__PURE__ */ e(ba, { slots: n, onError: s });
3120
+ return /* @__PURE__ */ e(va, { slots: l, onError: n });
2996
3121
  case "SIMULATE":
2997
- return /* @__PURE__ */ e(Yr, { slots: n, onError: s, initial: R });
3122
+ return /* @__PURE__ */ e(et, { slots: l, onError: n, initial: z });
3123
+ case "AUDIT":
3124
+ return /* @__PURE__ */ e(ot, { slots: l, onError: n });
2998
3125
  case "USER":
2999
- return /* @__PURE__ */ e(Jr, { slots: n, onError: s, userId: c.id });
3126
+ return /* @__PURE__ */ e(_r, { slots: l, onError: n, userId: u.id });
3000
3127
  case "GROUP":
3001
- return /* @__PURE__ */ e(Sa, { id: c.id, kind: "GROUP", slots: n, onSelectUser: y });
3128
+ return /* @__PURE__ */ e(xa, { id: u.id, kind: "GROUP", slots: l, onSelectUser: x });
3002
3129
  case "PROFILE":
3003
- return /* @__PURE__ */ e(Sa, { id: c.id, kind: "PROFILE", slots: n, onSelectUser: y });
3130
+ return /* @__PURE__ */ e(xa, { id: u.id, kind: "PROFILE", slots: l, onSelectUser: x });
3004
3131
  case "ACTION":
3005
3132
  return /* @__PURE__ */ e(
3006
- _r,
3133
+ at,
3007
3134
  {
3008
- id: c.id,
3009
- label: c.parentLabel ? `${c.parentLabel} · ${c.label}` : c.label,
3010
- slots: n,
3011
- onSelectUser: y,
3012
- onSimulate: () => v(Aa)
3135
+ id: u.id,
3136
+ label: u.parentLabel ? `${u.parentLabel} · ${u.label}` : u.label,
3137
+ slots: l,
3138
+ onSelectUser: x,
3139
+ onSimulate: () => T(Ra)
3013
3140
  }
3014
3141
  );
3015
3142
  case "RESOURCE":
3016
- return /* @__PURE__ */ r(V, { gap: "xs", children: [
3017
- /* @__PURE__ */ e(h, { fw: 620, size: "xl", ff: "monospace", children: c.label }),
3018
- /* @__PURE__ */ e(h, { size: "sm", c: "dimmed", children: "Abra o recurso na árvore para ver as ações. Cada ação responde quem alcança." })
3143
+ return /* @__PURE__ */ r(U, { gap: "xs", children: [
3144
+ /* @__PURE__ */ e(c, { fw: 620, size: "xl", ff: "monospace", children: u.label }),
3145
+ /* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: "Abra o recurso na árvore para ver as ações. Cada ação responde quem alcança." })
3019
3146
  ] });
3020
3147
  default:
3021
- return /* @__PURE__ */ e(ba, { slots: n, onError: s });
3148
+ return /* @__PURE__ */ e(va, { slots: l, onError: n });
3022
3149
  }
3023
3150
  };
3024
3151
  return (
@@ -3026,7 +3153,7 @@ const Ue = (a) => {
3026
3153
  // não uma fração de doze, e o `minmax(0, 1fr)` é o que impede uma tabela larga no painel de
3027
3154
  // empurrar a árvore para fora da tela.
3028
3155
  /* @__PURE__ */ r(
3029
- _,
3156
+ Y,
3030
3157
  {
3031
3158
  style: {
3032
3159
  width: t,
@@ -3049,14 +3176,15 @@ const Ue = (a) => {
3049
3176
  radius: "md",
3050
3177
  p: "xs",
3051
3178
  style: { display: "flex", flexDirection: "column", minHeight: 0, overflow: "hidden" },
3052
- children: /* @__PURE__ */ r(V, { gap: 2, style: { flex: 1, minHeight: 0 }, children: [
3053
- n?.renderUserSearch ? /* @__PURE__ */ e(_, { mb: 4, children: n.renderUserSearch(
3054
- (w) => v({ kind: "USER", id: w, label: w })
3179
+ children: /* @__PURE__ */ r(U, { gap: 2, style: { flex: 1, minHeight: 0 }, children: [
3180
+ l?.renderUserSearch ? /* @__PURE__ */ e(Y, { mb: 4, children: l.renderUserSearch(
3181
+ (w) => T({ kind: "USER", id: w, label: w })
3055
3182
  ) }) : null,
3056
- P(Ta),
3057
- P(Aa),
3058
- /* @__PURE__ */ e(_, { my: 6, style: { borderTop: "1px solid var(--mantine-color-default-border)" } }),
3059
- /* @__PURE__ */ e(de, { type: "hover", style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e(at, { selected: c, onSelect: v }) })
3183
+ D(Aa),
3184
+ D(Ra),
3185
+ D(st),
3186
+ /* @__PURE__ */ e(Y, { my: 6, style: { borderTop: "1px solid var(--mantine-color-default-border)" } }),
3187
+ /* @__PURE__ */ e(ue, { type: "hover", style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e(tt, { selected: u, onSelect: T }) })
3060
3188
  ] })
3061
3189
  }
3062
3190
  ),
@@ -3068,24 +3196,24 @@ const Ue = (a) => {
3068
3196
  p: "md",
3069
3197
  style: { minWidth: 0, minHeight: 0, display: "flex", flexDirection: "column", overflow: "hidden" },
3070
3198
  children: [
3071
- u.length > 0 ? /* @__PURE__ */ r(O, { gap: 6, mb: "xs", style: { flexShrink: 0 }, children: [
3199
+ h.length > 0 ? /* @__PURE__ */ r(O, { gap: 6, mb: "xs", style: { flexShrink: 0 }, children: [
3072
3200
  /* @__PURE__ */ e(
3073
3201
  X,
3074
3202
  {
3075
3203
  size: "compact-sm",
3076
3204
  variant: "subtle",
3077
- onClick: A,
3078
- leftSection: /* @__PURE__ */ e(rt, {}),
3205
+ onClick: R,
3206
+ leftSection: /* @__PURE__ */ e(lt, {}),
3079
3207
  "aria-label": "Voltar para o item anterior",
3080
3208
  children: "Voltar"
3081
3209
  }
3082
3210
  ),
3083
- /* @__PURE__ */ r(h, { size: "xs", c: "dimmed", truncate: !0, children: [
3211
+ /* @__PURE__ */ r(c, { size: "xs", c: "dimmed", truncate: !0, children: [
3084
3212
  "para ",
3085
- u[u.length - 1]?.label
3213
+ h[h.length - 1]?.label
3086
3214
  ] })
3087
3215
  ] }) : null,
3088
- /* @__PURE__ */ e(_, { style: { flex: 1, minHeight: 0, display: "flex", flexDirection: "column" }, children: f() })
3216
+ /* @__PURE__ */ e(Y, { style: { flex: 1, minHeight: 0, display: "flex", flexDirection: "column" }, children: b() })
3089
3217
  ]
3090
3218
  }
3091
3219
  )
@@ -3095,29 +3223,29 @@ const Ue = (a) => {
3095
3223
  );
3096
3224
  };
3097
3225
  export {
3098
- _r as ActionNodePanel,
3099
- Er as ApiTokenModal,
3100
- gt as ArchbaseApiTokenView,
3101
- Tr as ArchbaseDualListSelector,
3102
- ft as ArchbaseSecurityDiagnosticsView,
3103
- mt as ArchbaseSecurityView,
3104
- Ur as AttributeList,
3105
- Jr as EffectiveAccessPanel,
3106
- Gr as FlagStrip,
3107
- kr as GroupModal,
3108
- Sa as GroupNodePanel,
3109
- Mr as MetricCard,
3110
- Vr as MetricCards,
3226
+ at as ActionNodePanel,
3227
+ Dr as ApiTokenModal,
3228
+ wt as ArchbaseApiTokenView,
3229
+ Rr as ArchbaseDualListSelector,
3230
+ St as ArchbaseSecurityDiagnosticsView,
3231
+ Tt as ArchbaseSecurityView,
3232
+ Hr as AttributeList,
3233
+ _r as EffectiveAccessPanel,
3234
+ Br as FlagStrip,
3235
+ Er as GroupModal,
3236
+ xa as GroupNodePanel,
3237
+ Ur as MetricCard,
3238
+ Gr as MetricCards,
3111
3239
  Wr as OverviewItemsDrawer,
3112
- ba as OverviewPanel,
3240
+ va as OverviewPanel,
3113
3241
  Xe as PermissionsSelectorModal,
3114
- xr as ProfileModal,
3115
- Ar as RenderProfileUserItem,
3116
- we as Section,
3117
- at as SecurityTree,
3118
- Yr as SimulationPanel,
3119
- Oe as TabelaRolavel,
3120
- zr as UserModal,
3121
- Ue as severityColor,
3122
- Da as situacaoBadge
3242
+ Ar as ProfileModal,
3243
+ zr as RenderProfileUserItem,
3244
+ pe as Section,
3245
+ tt as SecurityTree,
3246
+ et as SimulationPanel,
3247
+ ke as TabelaRolavel,
3248
+ kr as UserModal,
3249
+ Ge as severityColor,
3250
+ Oa as situacaoBadge
3123
3251
  };