@archbase/security-ui 4.2.2 → 4.2.3

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