@archbase/security-ui 4.0.41 → 4.0.43

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,14 +1,14 @@
1
- import { Modal as Fe, ScrollArea as ye, Stack as oe, Grid as P, Group as L, Button as U, Paper as X, Box as He, Text as q, List as De, Checkbox as Je, Tooltip as se, ActionIcon as W, Flex as te, Space as sr, Input as he, useTree as Ze, useMantineColorScheme as Oe, TextInput as Qe, Tree as Ye, Badge as Se, Tabs as ie, RingProgress as Zr } from "@mantine/core";
2
- import { getI18nextInstance as t, ARCHBASE_IOC_API_TYPE as K, emit as Ie, builder as Te, convertDateToISOString as Qr, processErrorMessage as Ae, getKeyByEnumValue as le, useArchbaseTheme as nr, useArchbaseValidator as Yr, useArchbaseTranslation as Xr, useValidationErrors as Kr, processDetailErrorMessage as ze } from "@archbase/core";
3
- import { ArchbaseEdit as re, ArchbaseNotifications as Y, ArchbasePasswordEdit as _r, ArchbaseSelect as ea, ArchbaseCheckbox as xe, ArchbaseAvatarEdit as ra, ArchbaseAsyncSelect as aa, Columns as fe, ArchbaseDataGridColumn as m, ArchbaseDataGrid as be, ArchbaseDialog as _ } from "@archbase/components";
4
- import { useArchbaseV1V2Compatibility as ke, useArchbaseDataSourceListener as Xe, useArchbaseRemoteServiceApi as ee, useArchbaseRemoteDataSource as Ue, ArchbaseDataSource as ta, useArchbaseStore as ir, useArchbaseRemoteDataSourceV2 as we, useArchbaseDataSource as oa } from "@archbase/data";
5
- import { useState as N, useCallback as ge, useEffect as Re, forwardRef as sa, useMemo as pe, useRef as je } from "react";
6
- import { IconArrowRight as lr, IconArrowLeft as cr, IconChevronDown as Ke, IconBorderCornerSquare as _e, IconEye as $e, IconEdit as me, IconTrashX as ve, IconShieldCheckered as Le, IconPlus as Pe } from "@tabler/icons-react";
7
- import { UserGroupDto as er, SecurityType as k, UserDto as na, GroupDto as ia, ProfileDto as la, ApiTokenDto as ca } from "@archbase/security";
8
- import { DateTimePicker as da } from "@mantine/dates";
9
- import { useFocusTrap as ua, useDebouncedValue as rr } from "@mantine/hooks";
10
- import { ArchbaseSpaceFixed as ha, ArchbaseSpaceFill as xa, ArchbaseSpaceBottom as pa } from "@archbase/layout";
11
- var Ve = { exports: {} }, Ce = {};
1
+ import { Modal as Fe, ScrollArea as we, Stack as oe, Grid as I, Group as V, Button as N, Paper as K, Box as He, Text as J, List as Pe, Checkbox as Je, Tooltip as se, ActionIcon as H, Flex as te, Space as sr, Input as he, useTree as Ze, useMantineColorScheme as Oe, TextInput as Qe, Tree as Ye, Badge as Se, Tabs as ie, RingProgress as Zr } from "@mantine/core";
2
+ import { getI18nextInstance as t, resolveArchbasePasswordPolicy as Qr, ARCHBASE_IOC_API_TYPE as _, emit as Ie, builder as Te, validateArchbasePassword as Yr, convertDateToISOString as Xr, processErrorMessage as Ae, getKeyByEnumValue as le, useArchbaseTheme as nr, useArchbaseValidator as Kr, useArchbaseTranslation as _r, useValidationErrors as ea, processDetailErrorMessage as De } from "@archbase/core";
3
+ import { ArchbaseEdit as ae, ArchbaseNotifications as X, ArchbasePasswordEdit as ra, ArchbaseSelect as aa, ArchbaseCheckbox as pe, ArchbaseAvatarEdit as ta, ArchbaseAsyncSelect as oa, Columns as fe, ArchbaseDataGridColumn as m, ArchbaseDataGrid as be, ArchbaseDialog as ee } from "@archbase/components";
4
+ import { useArchbaseV1V2Compatibility as ke, useArchbaseDataSourceListener as Xe, useArchbaseRemoteServiceApi as re, useArchbaseRemoteDataSource as Ue, ArchbaseDataSource as sa, useArchbaseStore as ir, useArchbaseRemoteDataSourceV2 as ye, useArchbaseDataSource as na } from "@archbase/data";
5
+ import { useState as O, useCallback as ge, useEffect as Re, forwardRef as ia, useMemo as xe, useRef as je } from "react";
6
+ import { IconArrowRight as lr, IconArrowLeft as cr, IconChevronDown as Ke, IconBorderCornerSquare as _e, IconEye as $e, IconEdit as me, IconTrashX as Ce, IconShieldCheckered as Le, IconPlus as ze } from "@tabler/icons-react";
7
+ import { UserGroupDto as er, SecurityType as P, UserDto as la, GroupDto as ca, ProfileDto as da, ApiTokenDto as ua } from "@archbase/security";
8
+ import { DateTimePicker as ha } from "@mantine/dates";
9
+ import { useFocusTrap as pa, useDebouncedValue as rr } from "@mantine/hooks";
10
+ import { ArchbaseSpaceFixed as xa, ArchbaseSpaceFill as ma, ArchbaseSpaceBottom as fa } from "@archbase/layout";
11
+ var Ve = { exports: {} }, ve = {};
12
12
  /**
13
13
  * @license React
14
14
  * react-jsx-runtime.production.js
@@ -19,55 +19,55 @@ var Ve = { exports: {} }, Ce = {};
19
19
  * LICENSE file in the root directory of this source tree.
20
20
  */
21
21
  var ar;
22
- function ma() {
22
+ function ba() {
23
23
  if (ar)
24
- return Ce;
24
+ return ve;
25
25
  ar = 1;
26
- var r = Symbol.for("react.transitional.element"), d = Symbol.for("react.fragment");
27
- function j(l, c, p) {
28
- var v = null;
29
- if (p !== void 0 && (v = "" + p), c.key !== void 0 && (v = "" + c.key), "key" in c) {
30
- p = {};
31
- for (var u in c)
32
- u !== "key" && (p[u] = c[u]);
26
+ var r = Symbol.for("react.transitional.element"), u = Symbol.for("react.fragment");
27
+ function g(i, l, x) {
28
+ var A = null;
29
+ if (x !== void 0 && (A = "" + x), l.key !== void 0 && (A = "" + l.key), "key" in l) {
30
+ x = {};
31
+ for (var c in l)
32
+ c !== "key" && (x[c] = l[c]);
33
33
  } else
34
- p = c;
35
- return c = p.ref, {
34
+ x = l;
35
+ return l = x.ref, {
36
36
  $$typeof: r,
37
- type: l,
38
- key: v,
39
- ref: c !== void 0 ? c : null,
40
- props: p
37
+ type: i,
38
+ key: A,
39
+ ref: l !== void 0 ? l : null,
40
+ props: x
41
41
  };
42
42
  }
43
- return Ce.Fragment = d, Ce.jsx = j, Ce.jsxs = j, Ce;
43
+ return ve.Fragment = u, ve.jsx = g, ve.jsxs = g, ve;
44
44
  }
45
45
  var tr;
46
- function fa() {
47
- return tr || (tr = 1, Ve.exports = ma()), Ve.exports;
46
+ function ga() {
47
+ return tr || (tr = 1, Ve.exports = ba()), Ve.exports;
48
48
  }
49
- var e = fa();
50
- const ba = (r) => {
51
- const d = { ...r.options ?? {} }, j = () => {
52
- r.onCustomSave ? r.onCustomSave(r.dataSource.getCurrentRecord(), (c) => {
53
- c && r.onAfterSave && r.onAfterSave(r.dataSource.getCurrentRecord()), r.onClickOk(r.dataSource.getCurrentRecord(), c);
49
+ var e = ga();
50
+ const ja = (r) => {
51
+ const u = { ...r.options ?? {} }, g = () => {
52
+ r.onCustomSave ? r.onCustomSave(r.dataSource.getCurrentRecord(), (l) => {
53
+ l && r.onAfterSave && r.onAfterSave(r.dataSource.getCurrentRecord()), r.onClickOk(r.dataSource.getCurrentRecord(), l);
54
54
  }) : r.onClickOk(r.dataSource.getCurrentRecord(), !0);
55
- }, l = () => {
55
+ }, i = () => {
56
56
  r.onClickCancel(r.dataSource.getCurrentRecord());
57
57
  };
58
58
  return /* @__PURE__ */ e.jsx(
59
59
  Fe,
60
60
  {
61
61
  opened: r.opened,
62
- onClose: l,
62
+ onClose: i,
63
63
  title: t().t("archbase:Perfil"),
64
64
  size: "60%",
65
65
  styles: { content: { maxWidth: 1e3 } },
66
- children: /* @__PURE__ */ e.jsx(ye, { style: { height: "460px" }, children: /* @__PURE__ */ e.jsxs(oe, { w: "98%", children: [
67
- d?.customContentBefore && d.customContentBefore(r.dataSource.getCurrentRecord()),
68
- /* @__PURE__ */ e.jsxs(P, { children: [
69
- /* @__PURE__ */ e.jsx(P.Col, { span: { base: 12, md: 12, lg: 12 }, children: /* @__PURE__ */ e.jsx(
70
- re,
66
+ children: /* @__PURE__ */ e.jsx(we, { style: { height: "460px" }, children: /* @__PURE__ */ e.jsxs(oe, { w: "98%", children: [
67
+ u?.customContentBefore && u.customContentBefore(r.dataSource.getCurrentRecord()),
68
+ /* @__PURE__ */ e.jsxs(I, { children: [
69
+ /* @__PURE__ */ e.jsx(I.Col, { span: { base: 12, md: 12, lg: 12 }, children: /* @__PURE__ */ e.jsx(
70
+ ae,
71
71
  {
72
72
  label: `${t().t("archbase:Nome do perfil")}`,
73
73
  placeholder: `${t().t("archbase:Informe o nome do perfil")}`,
@@ -75,8 +75,8 @@ const ba = (r) => {
75
75
  dataField: "name"
76
76
  }
77
77
  ) }),
78
- /* @__PURE__ */ e.jsx(P.Col, { span: { base: 12, md: 12, lg: 12 }, children: /* @__PURE__ */ e.jsx(
79
- re,
78
+ /* @__PURE__ */ e.jsx(I.Col, { span: { base: 12, md: 12, lg: 12 }, children: /* @__PURE__ */ e.jsx(
79
+ ae,
80
80
  {
81
81
  label: `${t().t("archbase:Descrição do perfil")}`,
82
82
  placeholder: `${t().t("archbase:Informe a descrição do perfil")}`,
@@ -85,27 +85,27 @@ const ba = (r) => {
85
85
  }
86
86
  ) })
87
87
  ] }),
88
- d?.customContentAfter && d.customContentAfter(r.dataSource.getCurrentRecord()),
89
- /* @__PURE__ */ e.jsxs(L, { justify: "flex-end", mt: "md", children: [
90
- /* @__PURE__ */ e.jsx(U, { variant: "default", onClick: l, children: t().t("archbase:Cancelar") }),
91
- /* @__PURE__ */ e.jsx(U, { onClick: j, children: t().t("archbase:Salvar") })
88
+ u?.customContentAfter && u.customContentAfter(r.dataSource.getCurrentRecord()),
89
+ /* @__PURE__ */ e.jsxs(V, { justify: "flex-end", mt: "md", children: [
90
+ /* @__PURE__ */ e.jsx(N, { variant: "default", onClick: i, children: t().t("archbase:Cancelar") }),
91
+ /* @__PURE__ */ e.jsx(N, { onClick: g, children: t().t("archbase:Salvar") })
92
92
  ] })
93
93
  ] }) })
94
94
  }
95
95
  );
96
96
  };
97
- function ga({
97
+ function wa({
98
98
  availableItemsDS: r,
99
- assignedItemsDS: d,
100
- idFieldAvailable: j,
101
- labelFieldAvailable: l,
102
- idFieldAssigned: c,
103
- labelFieldAssigned: p,
104
- handleCreateAssociationObject: v,
105
- width: u = "400px",
106
- height: G = "200px",
99
+ assignedItemsDS: u,
100
+ idFieldAvailable: g,
101
+ labelFieldAvailable: i,
102
+ idFieldAssigned: l,
103
+ labelFieldAssigned: x,
104
+ handleCreateAssociationObject: A,
105
+ width: c = "400px",
106
+ height: $ = "200px",
107
107
  titleAvailable: h = "Disponíveis",
108
- titleAssigned: C = "Selecionados"
108
+ titleAssigned: S = "Selecionados"
109
109
  }) {
110
110
  ke(
111
111
  "ArchbaseDualListSelector-Available",
@@ -115,45 +115,45 @@ function ga({
115
115
  );
116
116
  const z = ke(
117
117
  "ArchbaseDualListSelector-Assigned",
118
- d,
118
+ u,
119
119
  void 0,
120
120
  []
121
- ), [y, V] = N([]), [s, R] = N([]), [H, ae] = N([]), [Q, D] = N([]), O = ge(() => {
122
- r && V(r.browseRecords()), d && R(d.browseRecords());
123
- }, [r, d]);
121
+ ), [j, M] = O([]), [f, Y] = O([]), [B, d] = O([]), [v, T] = O([]), W = ge(() => {
122
+ r && M(r.browseRecords()), u && Y(u.browseRecords());
123
+ }, [r, u]);
124
124
  Xe({
125
125
  dataSource: r,
126
- listener: () => O()
126
+ listener: () => W()
127
127
  }), Xe({
128
- dataSource: d,
129
- listener: () => O()
128
+ dataSource: u,
129
+ listener: () => W()
130
130
  }), Re(() => {
131
- O();
132
- }, [O]);
133
- const I = (x, b) => typeof b == "function" ? b(x) : x[b], Z = (x, b) => typeof b == "function" ? b(x) : x[b], o = (x, b) => {
134
- x((f) => f.includes(b) ? f.filter((ce) => ce !== b) : [...f, b]);
135
- }, F = () => {
136
- H.forEach((x) => {
137
- const b = y.find((f) => I(f, j) === x);
138
- if (b) {
139
- const f = v(b);
140
- z.isDataSourceV2 ? (d.insert(f), d.save()) : (d.insert(f), d.save(), z.v1State.forceUpdate());
141
- }
142
- }), ae([]);
143
- }, J = () => {
144
- Q.forEach((x) => {
145
- const b = s.find((f) => I(f, c) === x);
146
- if (b) {
147
- const f = typeof c == "function" ? { customId: c(b) } : { [c]: x };
148
- z.isDataSourceV2 ? d.remove(() => d.locate(f)) : (d.remove(() => d.locate(f)), z.v1State.forceUpdate());
149
- }
150
- }), D([]);
131
+ W();
132
+ }, [W]);
133
+ const E = (p, w) => typeof w == "function" ? w(p) : p[w], Q = (p, w) => typeof w == "function" ? w(p) : p[w], o = (p, w) => {
134
+ p((b) => b.includes(w) ? b.filter((ce) => ce !== w) : [...b, w]);
135
+ }, D = () => {
136
+ B.forEach((p) => {
137
+ const w = j.find((b) => E(b, g) === p);
138
+ if (w) {
139
+ const b = A(w);
140
+ z.isDataSourceV2 ? (u.insert(b), u.save()) : (u.insert(b), u.save(), z.v1State.forceUpdate());
141
+ }
142
+ }), d([]);
143
+ }, Z = () => {
144
+ v.forEach((p) => {
145
+ const w = f.find((b) => E(b, l) === p);
146
+ if (w) {
147
+ const b = typeof l == "function" ? { customId: l(w) } : { [l]: p };
148
+ z.isDataSourceV2 ? u.remove(() => u.locate(b)) : (u.remove(() => u.locate(b)), z.v1State.forceUpdate());
149
+ }
150
+ }), T([]);
151
151
  };
152
- return /* @__PURE__ */ e.jsxs(X, { withBorder: !0, style: { display: "flex", width: u, height: G }, children: [
153
- /* @__PURE__ */ e.jsxs(He, { style: { minWidth: "44%", minHeight: G }, children: [
154
- /* @__PURE__ */ e.jsx(q, { children: h }),
152
+ return /* @__PURE__ */ e.jsxs(K, { withBorder: !0, style: { display: "flex", width: c, height: $ }, children: [
153
+ /* @__PURE__ */ e.jsxs(He, { style: { minWidth: "44%", minHeight: $ }, children: [
154
+ /* @__PURE__ */ e.jsx(J, { children: h }),
155
155
  /* @__PURE__ */ e.jsx(
156
- De,
156
+ Pe,
157
157
  {
158
158
  spacing: "xs",
159
159
  size: "sm",
@@ -165,28 +165,28 @@ function ga({
165
165
  overflowX: "hidden",
166
166
  height: "calc(100% - 32px)"
167
167
  },
168
- children: y.map((x) => /* @__PURE__ */ e.jsx(De.Item, { children: /* @__PURE__ */ e.jsx(
168
+ children: j.map((p) => /* @__PURE__ */ e.jsx(Pe.Item, { children: /* @__PURE__ */ e.jsx(
169
169
  Je,
170
170
  {
171
- label: Z(x, l),
172
- checked: H.includes(I(x, j)),
173
- onChange: () => o(ae, I(x, j)),
174
- disabled: s.some(
175
- (b) => I(b, c) === I(x, j)
171
+ label: Q(p, i),
172
+ checked: B.includes(E(p, g)),
173
+ onChange: () => o(d, E(p, g)),
174
+ disabled: f.some(
175
+ (w) => E(w, l) === E(p, g)
176
176
  )
177
177
  }
178
- ) }, I(x, j)))
178
+ ) }, E(p, g)))
179
179
  }
180
180
  )
181
181
  ] }),
182
182
  /* @__PURE__ */ e.jsxs(oe, { gap: 5, style: { minWidth: "10%" }, justify: "center", align: "center", children: [
183
- /* @__PURE__ */ e.jsx(se, { label: "Adicionar", children: /* @__PURE__ */ e.jsx(W, { onClick: F, disabled: !H.length, children: /* @__PURE__ */ e.jsx(lr, {}) }) }),
184
- /* @__PURE__ */ e.jsx(se, { label: "Remover", children: /* @__PURE__ */ e.jsx(W, { onClick: J, disabled: !Q.length, children: /* @__PURE__ */ e.jsx(cr, {}) }) })
183
+ /* @__PURE__ */ e.jsx(se, { label: "Adicionar", children: /* @__PURE__ */ e.jsx(H, { onClick: D, disabled: !B.length, children: /* @__PURE__ */ e.jsx(lr, {}) }) }),
184
+ /* @__PURE__ */ e.jsx(se, { label: "Remover", children: /* @__PURE__ */ e.jsx(H, { onClick: Z, disabled: !v.length, children: /* @__PURE__ */ e.jsx(cr, {}) }) })
185
185
  ] }),
186
- /* @__PURE__ */ e.jsxs(He, { style: { minWidth: "44%", minHeight: G }, children: [
187
- /* @__PURE__ */ e.jsx(q, { children: C }),
186
+ /* @__PURE__ */ e.jsxs(He, { style: { minWidth: "44%", minHeight: $ }, children: [
187
+ /* @__PURE__ */ e.jsx(J, { children: S }),
188
188
  /* @__PURE__ */ e.jsx(
189
- De,
189
+ Pe,
190
190
  {
191
191
  spacing: "xs",
192
192
  size: "sm",
@@ -198,25 +198,25 @@ function ga({
198
198
  overflowX: "hidden",
199
199
  height: "calc(100% - 32px)"
200
200
  },
201
- children: s.map((x) => /* @__PURE__ */ e.jsx(De.Item, { children: /* @__PURE__ */ e.jsx(
201
+ children: f.map((p) => /* @__PURE__ */ e.jsx(Pe.Item, { children: /* @__PURE__ */ e.jsx(
202
202
  Je,
203
203
  {
204
- label: Z(x, p),
205
- checked: Q.includes(I(x, c)),
206
- onChange: () => o(D, I(x, c))
204
+ label: Q(p, x),
205
+ checked: v.includes(E(p, l)),
206
+ onChange: () => o(T, E(p, l))
207
207
  }
208
- ) }, I(x, c)))
208
+ ) }, E(p, l)))
209
209
  }
210
210
  )
211
211
  ] })
212
212
  ] });
213
213
  }
214
- const ja = sa(
215
- ({ image: r, label: d, description: j, origin: l, ...c }, p) => /* @__PURE__ */ e.jsx("div", { ref: p, ...c, children: /* @__PURE__ */ e.jsxs(te, { children: [
216
- /* @__PURE__ */ e.jsx(q, { size: "sm", fw: 600, children: l ? l.name : "" }),
214
+ const ya = ia(
215
+ ({ image: r, label: u, description: g, origin: i, ...l }, x) => /* @__PURE__ */ e.jsx("div", { ref: x, ...l, children: /* @__PURE__ */ e.jsxs(te, { children: [
216
+ /* @__PURE__ */ e.jsx(J, { size: "sm", fw: 600, children: i ? i.name : "" }),
217
217
  /* @__PURE__ */ e.jsx(sr, { w: "lg" })
218
218
  ] }) })
219
- ), ya = {
219
+ ), va = {
220
220
  // Campos de identificação
221
221
  showNickname: !0,
222
222
  // Campos de perfil e grupos
@@ -227,6 +227,8 @@ const ja = sa(
227
227
  showAllowPasswordChange: !0,
228
228
  showPasswordNeverExpires: !0,
229
229
  showPasswordChangedAt: !0,
230
+ showPasswordRequirements: !0,
231
+ forbidPersonalDataInPassword: !0,
230
232
  // Campos de status da conta
231
233
  showAccountConfigLabel: !0,
232
234
  showAccountDeactivated: !0,
@@ -238,73 +240,86 @@ const ja = sa(
238
240
  avatarImageQuality: 1,
239
241
  avatarMaxOutputSizePx: 512,
240
242
  allowEditEmail: !0
241
- }, wa = (r) => {
242
- const [d, j] = N(""), l = { ...ya, ...r.options ?? {} }, c = r.dataSource.getFieldValue("passwordChangedAt"), p = c ? new Date(c) : void 0, v = p && !Number.isNaN(p.getTime()) ? p.toLocaleString() : void 0, u = ee(K.Group), { dataSource: G } = Ue({
243
+ }, Ca = (r) => {
244
+ const [u, g] = O(""), i = { ...va, ...r.options ?? {} }, l = r.dataSource.getFieldValue("passwordChangedAt"), x = l ? new Date(l) : void 0, A = x && !Number.isNaN(x.getTime()) ? x.toLocaleString() : void 0, c = Qr(i.passwordPolicy), $ = i.forbidPersonalDataInPassword ? ["name", "nickname", "email"].map((d) => {
245
+ const v = r.dataSource.getFieldValue(d);
246
+ return d === "email" && v ? v.split("@")[0] : v;
247
+ }).filter((d) => typeof d == "string" && d.trim().length >= 3) : [], h = c ? {
248
+ ...c,
249
+ blocklist: [...c.blocklist ?? [], ...$]
250
+ } : void 0, S = re(_.Group), { dataSource: z } = Ue({
243
251
  name: "dsGroups",
244
- service: u,
252
+ service: S,
245
253
  pageSize: 9999,
246
254
  loadOnStart: !0,
247
255
  sort: ["name:asc"],
248
- onError: (s, R) => {
249
- Y.showError(t().t("archbase:WARNING"), s, R);
256
+ onError: (d, v) => {
257
+ X.showError(t().t("archbase:WARNING"), d, v);
250
258
  }
251
259
  });
252
260
  console.log("versão 12/05/2026");
253
- const h = ee(K.Profile), { dataSource: C } = Ue({
261
+ const j = re(_.Profile), { dataSource: M } = Ue({
254
262
  name: "dsProfiles",
255
- service: h,
263
+ service: j,
256
264
  pageSize: 9999,
257
265
  loadOnStart: !0,
258
266
  sort: ["name:asc"],
259
- onError: (s, R) => {
260
- Y.showError(t().t("archbase:WARNING"), s, R);
267
+ onError: (d, v) => {
268
+ X.showError(t().t("archbase:WARNING"), d, v);
261
269
  }
262
270
  });
263
271
  Re(() => {
264
- j("");
272
+ g("");
265
273
  }, [r.dataSource.getFieldValue("password")]);
266
- const z = async () => {
274
+ const f = async () => {
267
275
  if (r.dataSource.isInserting()) {
268
- if (l.userDefaultProfile) {
269
- const s = Ie(Te.eq("name", l.userDefaultProfile)), R = await h.findAllWithFilter(s, 0, 1);
270
- R && R.content.length > 0 && r.dataSource.setFieldValue("profile", R.content[0]);
276
+ if (i.userDefaultProfile) {
277
+ const d = Ie(Te.eq("name", i.userDefaultProfile)), v = await j.findAllWithFilter(d, 0, 1);
278
+ v && v.content.length > 0 && r.dataSource.setFieldValue("profile", v.content[0]);
271
279
  }
272
- if (l.userDefaultGroups) {
273
- const s = Ie(Te.in("name", l.userDefaultGroups)), R = await u.findAllWithFilter(s, 0, 500);
274
- R && R.content.length > 0 && r.dataSource.setFieldValue("groups", R.content.map((H) => er.newInstance(H)));
280
+ if (i.userDefaultGroups) {
281
+ const d = Ie(Te.in("name", i.userDefaultGroups)), v = await S.findAllWithFilter(d, 0, 500);
282
+ v && v.content.length > 0 && r.dataSource.setFieldValue("groups", v.content.map((T) => er.newInstance(T)));
275
283
  }
276
284
  }
277
285
  };
278
286
  Re(() => {
279
- r.opened && z();
287
+ r.opened && f();
280
288
  }, [r.opened]);
281
- const y = () => {
282
- const s = r.dataSource.getCurrentRecord();
283
- if (!s.password && r.dataSource.isInserting()) {
284
- j(t().t("archbase:Informe a senha"));
289
+ const Y = () => {
290
+ const d = r.dataSource.getCurrentRecord();
291
+ if (!d.password && r.dataSource.isInserting()) {
292
+ g(t().t("archbase:Informe a senha"));
285
293
  return;
286
294
  }
287
- r.onCustomSave ? r.onCustomSave(s, (R) => {
288
- R && r.onAfterSave && r.onAfterSave(s), r.onClickOk(s, R);
289
- }) : r.onClickOk(s, !0);
290
- }, V = () => {
295
+ if (h && d.password) {
296
+ const v = Yr(d.password, h);
297
+ if (!v.valid) {
298
+ g(v.error);
299
+ return;
300
+ }
301
+ }
302
+ r.onCustomSave ? r.onCustomSave(d, (v) => {
303
+ v && r.onAfterSave && r.onAfterSave(d), r.onClickOk(d, v);
304
+ }) : r.onClickOk(d, !0);
305
+ }, B = () => {
291
306
  r.onClickCancel(r.dataSource.getCurrentRecord());
292
307
  };
293
308
  return /* @__PURE__ */ e.jsxs(
294
309
  Fe,
295
310
  {
296
311
  opened: r.opened,
297
- onClose: V,
312
+ onClose: B,
298
313
  title: t().t("archbase:Usuário"),
299
314
  size: "80%",
300
315
  styles: { content: { maxWidth: 1e3 } },
301
316
  children: [
302
- /* @__PURE__ */ e.jsx(ye, { style: { height: "500px" }, children: /* @__PURE__ */ e.jsxs(oe, { w: "98%", children: [
303
- l?.customContentBefore && /* @__PURE__ */ e.jsx(e.Fragment, { children: l.customContentBefore(r.dataSource.getCurrentRecord()) }),
304
- /* @__PURE__ */ e.jsxs(P, { children: [
305
- /* @__PURE__ */ e.jsx(P.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsxs(L, { children: [
317
+ /* @__PURE__ */ e.jsx(we, { style: { height: "500px" }, children: /* @__PURE__ */ e.jsxs(oe, { w: "98%", children: [
318
+ i?.customContentBefore && /* @__PURE__ */ e.jsx(e.Fragment, { children: i.customContentBefore(r.dataSource.getCurrentRecord()) }),
319
+ /* @__PURE__ */ e.jsxs(I, { children: [
320
+ /* @__PURE__ */ e.jsx(I.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsxs(V, { children: [
306
321
  /* @__PURE__ */ e.jsx(
307
- re,
322
+ ae,
308
323
  {
309
324
  label: `${t().t("archbase:Nome completo")}`,
310
325
  placeholder: `${t().t("archbase:Informe o nome completo do usuário")}`,
@@ -314,19 +329,19 @@ const ja = sa(
314
329
  width: "calc(100% - 208px)"
315
330
  }
316
331
  ),
317
- l.showNickname && /* @__PURE__ */ e.jsx(
318
- re,
332
+ i.showNickname && /* @__PURE__ */ e.jsx(
333
+ ae,
319
334
  {
320
335
  label: `${t().t("archbase:Apelido")}`,
321
336
  placeholder: `${t().t("archbase:Apelido")}`,
322
337
  dataSource: r.dataSource,
323
338
  dataField: "nickname",
324
- required: l.requiredNickname
339
+ required: i.requiredNickname
325
340
  }
326
341
  )
327
342
  ] }) }),
328
- /* @__PURE__ */ e.jsx(P.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsx(
329
- re,
343
+ /* @__PURE__ */ e.jsx(I.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsx(
344
+ ae,
330
345
  {
331
346
  label: `${t().t("archbase:Descrição do usuário")}`,
332
347
  placeholder: `${t().t("archbase:Informe a descrição do usuário")}`,
@@ -336,97 +351,99 @@ const ja = sa(
336
351
  }
337
352
  ) })
338
353
  ] }),
339
- /* @__PURE__ */ e.jsxs(P, { children: [
340
- /* @__PURE__ */ e.jsx(P.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsx(
341
- re,
354
+ /* @__PURE__ */ e.jsxs(I, { children: [
355
+ /* @__PURE__ */ e.jsx(I.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsx(
356
+ ae,
342
357
  {
343
358
  label: `${t().t("archbase:E-mail")}`,
344
359
  placeholder: `${t().t("archbase:Informe o e-mail do usuário")}`,
345
360
  dataSource: r.dataSource,
346
- onChangeValue: (s) => r.dataSource.setFieldValue("userName", s),
361
+ onChangeValue: (d) => r.dataSource.setFieldValue("userName", d),
347
362
  dataField: "email",
348
- readOnly: r.dataSource.isEditing() ? !l.allowEditEmail : !1,
363
+ readOnly: r.dataSource.isEditing() ? !i.allowEditEmail : !1,
349
364
  required: !0
350
365
  }
351
366
  ) }),
352
- /* @__PURE__ */ e.jsx(P.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsx(
353
- _r,
367
+ /* @__PURE__ */ e.jsx(I.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsx(
368
+ ra,
354
369
  {
355
370
  label: `${t().t("archbase:Senha usuário")}`,
356
371
  dataSource: r.dataSource,
357
372
  dataField: "password",
358
- error: d,
359
- required: r.dataSource.getFieldValue("isNewUser")
373
+ error: u,
374
+ required: r.dataSource.getFieldValue("isNewUser"),
375
+ passwordPolicy: h,
376
+ showPasswordRequirements: i.showPasswordRequirements
360
377
  }
361
378
  ) })
362
379
  ] }),
363
- /* @__PURE__ */ e.jsx(P, { children: l.showProfile && /* @__PURE__ */ e.jsx(P.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsx(
364
- ea,
380
+ /* @__PURE__ */ e.jsx(I, { children: i.showProfile && /* @__PURE__ */ e.jsx(I.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsx(
381
+ aa,
365
382
  {
366
383
  label: `${t().t("archbase:Perfil do usuário")}`,
367
384
  dataSource: r.dataSource,
368
385
  dataField: "profile",
369
- options: C,
386
+ options: M,
370
387
  allowDeselect: !0,
371
388
  optionsLabelField: "nome",
372
- itemComponent: ja,
373
- getOptionLabel: (s) => s.name,
374
- getOptionValue: (s) => s.id
389
+ itemComponent: ya,
390
+ getOptionLabel: (d) => d.name,
391
+ getOptionValue: (d) => d.id
375
392
  }
376
393
  ) }) }),
377
- /* @__PURE__ */ e.jsxs(P, { children: [
378
- /* @__PURE__ */ e.jsx(P.Col, { span: { base: 12 }, children: l.showAccountConfigLabel && /* @__PURE__ */ e.jsx(q, { fz: 14, fw: 500, children: "Informe" }) }),
379
- /* @__PURE__ */ e.jsx(P.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ e.jsxs(oe, { gap: "lg", children: [
380
- l.showChangePasswordOnNextLogin && /* @__PURE__ */ e.jsx(he.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
381
- xe,
394
+ /* @__PURE__ */ e.jsxs(I, { children: [
395
+ /* @__PURE__ */ e.jsx(I.Col, { span: { base: 12 }, children: i.showAccountConfigLabel && /* @__PURE__ */ e.jsx(J, { fz: 14, fw: 500, children: "Informe" }) }),
396
+ /* @__PURE__ */ e.jsx(I.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ e.jsxs(oe, { gap: "lg", children: [
397
+ i.showChangePasswordOnNextLogin && /* @__PURE__ */ e.jsx(he.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
398
+ pe,
382
399
  {
383
400
  dataSource: r.dataSource,
384
401
  dataField: "changePasswordOnNextLogin",
385
402
  label: `${t().t("archbase:Deve alterar senha próximo login ?")}`
386
403
  }
387
404
  ) }),
388
- l.showAllowPasswordChange && /* @__PURE__ */ e.jsx(he.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
389
- xe,
405
+ i.showAllowPasswordChange && /* @__PURE__ */ e.jsx(he.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
406
+ pe,
390
407
  {
391
408
  dataSource: r.dataSource,
392
409
  dataField: "allowPasswordChange",
393
410
  label: `${t().t("archbase:Pode alterar a senha ?")}`
394
411
  }
395
412
  ) }),
396
- l.showPasswordNeverExpires && /* @__PURE__ */ e.jsxs(he.Wrapper, { label: "", children: [
413
+ i.showPasswordNeverExpires && /* @__PURE__ */ e.jsxs(he.Wrapper, { label: "", children: [
397
414
  /* @__PURE__ */ e.jsx(
398
- xe,
415
+ pe,
399
416
  {
400
417
  dataSource: r.dataSource,
401
418
  dataField: "passwordNeverExpires",
402
419
  label: `${t().t("archbase:Senha nunca expira ?")}`
403
420
  }
404
421
  ),
405
- /* @__PURE__ */ e.jsx(q, { fz: 12, c: "dimmed", children: t().t(
422
+ /* @__PURE__ */ e.jsx(J, { fz: 12, c: "dimmed", children: t().t(
406
423
  '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".'
407
424
  ) })
408
425
  ] }),
409
- l.showPasswordChangedAt && v && /* @__PURE__ */ e.jsx(q, { fz: 12, c: "dimmed", children: `${t().t("archbase:Última troca de senha")}: ${v}` })
426
+ i.showPasswordChangedAt && A && /* @__PURE__ */ e.jsx(J, { fz: 12, c: "dimmed", children: `${t().t("archbase:Última troca de senha")}: ${A}` })
410
427
  ] }) }),
411
- /* @__PURE__ */ e.jsx(P.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ e.jsxs(oe, { gap: "lg", children: [
412
- l.showAccountDeactivated && /* @__PURE__ */ e.jsx(he.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
413
- xe,
428
+ /* @__PURE__ */ e.jsx(I.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ e.jsxs(oe, { gap: "lg", children: [
429
+ i.showAccountDeactivated && /* @__PURE__ */ e.jsx(he.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
430
+ pe,
414
431
  {
415
432
  dataSource: r.dataSource,
416
433
  dataField: "accountDeactivated",
417
434
  label: `${t().t("archbase:Conta desativada ?")}`
418
435
  }
419
436
  ) }),
420
- l.showAccountLocked && /* @__PURE__ */ e.jsx(he.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
421
- xe,
437
+ i.showAccountLocked && /* @__PURE__ */ e.jsx(he.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
438
+ pe,
422
439
  {
423
440
  dataSource: r.dataSource,
424
441
  dataField: "accountLocked",
425
442
  label: `${t().t("archbase:Conta bloqueada ?")}`
426
443
  }
427
444
  ) }),
428
- l.showIsAdministrator && /* @__PURE__ */ e.jsx(he.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
429
- xe,
445
+ i.showIsAdministrator && /* @__PURE__ */ e.jsx(he.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
446
+ pe,
430
447
  {
431
448
  dataSource: r.dataSource,
432
449
  dataField: "isAdministrator",
@@ -434,28 +451,28 @@ const ja = sa(
434
451
  }
435
452
  ) })
436
453
  ] }) }),
437
- /* @__PURE__ */ e.jsx(P.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ e.jsx(oe, { gap: "lg", children: /* @__PURE__ */ e.jsx(
438
- ra,
454
+ /* @__PURE__ */ e.jsx(I.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ e.jsx(oe, { gap: "lg", children: /* @__PURE__ */ e.jsx(
455
+ ta,
439
456
  {
440
457
  label: t().t("archbase:Foto do usuário"),
441
458
  dataSource: r.dataSource,
442
459
  dataField: "avatar",
443
460
  width: 120,
444
461
  height: 120,
445
- maxSizeKB: l.avatarMaxSizeKB,
446
- imageQuality: l.avatarImageQuality,
447
- maxOutputSizePx: l.avatarMaxOutputSizePx
462
+ maxSizeKB: i.avatarMaxSizeKB,
463
+ imageQuality: i.avatarImageQuality,
464
+ maxOutputSizePx: i.avatarMaxOutputSizePx
448
465
  }
449
466
  ) }) })
450
467
  ] }),
451
- l.showGroups && /* @__PURE__ */ e.jsxs(P, { children: [
452
- /* @__PURE__ */ e.jsx(P.Col, { span: { base: 12 }, children: /* @__PURE__ */ e.jsx(q, { fz: 14, fw: 500, children: "Grupos" }) }),
453
- /* @__PURE__ */ e.jsx(P.Col, { span: { base: 12 }, children: /* @__PURE__ */ e.jsx(
454
- ga,
468
+ i.showGroups && /* @__PURE__ */ e.jsxs(I, { children: [
469
+ /* @__PURE__ */ e.jsx(I.Col, { span: { base: 12 }, children: /* @__PURE__ */ e.jsx(J, { fz: 14, fw: 500, children: "Grupos" }) }),
470
+ /* @__PURE__ */ e.jsx(I.Col, { span: { base: 12 }, children: /* @__PURE__ */ e.jsx(
471
+ wa,
455
472
  {
456
473
  titleAvailable: t().t("archbase:Disponíveis"),
457
474
  titleAssigned: t().t("archbase:Selecionados"),
458
- assignedItemsDS: new ta("dsDualList", {
475
+ assignedItemsDS: new sa("dsDualList", {
459
476
  records: r.dataSource.getFieldValue("groups"),
460
477
  grandTotalRecords: r.dataSource.getFieldValue("groups").length,
461
478
  currentPage: 0,
@@ -464,46 +481,46 @@ const ja = sa(
464
481
  }),
465
482
  width: "100%",
466
483
  height: "200px",
467
- availableItemsDS: G,
468
- handleCreateAssociationObject: (s) => er.newInstance(s),
469
- idFieldAssigned: (s) => s && s.group ? s.group.id : "",
484
+ availableItemsDS: z,
485
+ handleCreateAssociationObject: (d) => er.newInstance(d),
486
+ idFieldAssigned: (d) => d && d.group ? d.group.id : "",
470
487
  idFieldAvailable: "id",
471
- labelFieldAssigned: (s) => s && s.group ? s.group.name : "",
488
+ labelFieldAssigned: (d) => d && d.group ? d.group.name : "",
472
489
  labelFieldAvailable: "name"
473
490
  }
474
491
  ) })
475
492
  ] }),
476
- l?.customContentAfter && /* @__PURE__ */ e.jsx(e.Fragment, { children: l.customContentAfter(r.dataSource.getCurrentRecord()) }),
493
+ i?.customContentAfter && /* @__PURE__ */ e.jsx(e.Fragment, { children: i.customContentAfter(r.dataSource.getCurrentRecord()) }),
477
494
  /* @__PURE__ */ e.jsx(sr, { h: "12px" })
478
495
  ] }) }),
479
- /* @__PURE__ */ e.jsxs(L, { justify: "flex-end", mt: "md", children: [
480
- /* @__PURE__ */ e.jsx(U, { variant: "default", onClick: V, children: t().t("archbase:Cancelar") }),
481
- /* @__PURE__ */ e.jsx(U, { onClick: y, children: t().t("archbase:Salvar") })
496
+ /* @__PURE__ */ e.jsxs(V, { justify: "flex-end", mt: "md", children: [
497
+ /* @__PURE__ */ e.jsx(N, { variant: "default", onClick: B, children: t().t("archbase:Cancelar") }),
498
+ /* @__PURE__ */ e.jsx(N, { onClick: Y, children: t().t("archbase:Salvar") })
482
499
  ] })
483
500
  ]
484
501
  }
485
502
  );
486
- }, Ca = (r) => {
487
- const d = { ...r.options ?? {} }, j = () => {
488
- r.onCustomSave ? r.onCustomSave(r.dataSource.getCurrentRecord(), (c) => {
489
- c && r.onAfterSave && r.onAfterSave(r.dataSource.getCurrentRecord()), r.onClickOk(r.dataSource.getCurrentRecord(), c);
503
+ }, Sa = (r) => {
504
+ const u = { ...r.options ?? {} }, g = () => {
505
+ r.onCustomSave ? r.onCustomSave(r.dataSource.getCurrentRecord(), (l) => {
506
+ l && r.onAfterSave && r.onAfterSave(r.dataSource.getCurrentRecord()), r.onClickOk(r.dataSource.getCurrentRecord(), l);
490
507
  }) : r.onClickOk(r.dataSource.getCurrentRecord(), !0);
491
- }, l = () => {
508
+ }, i = () => {
492
509
  r.onClickCancel(r.dataSource.getCurrentRecord());
493
510
  };
494
511
  return /* @__PURE__ */ e.jsx(
495
512
  Fe,
496
513
  {
497
514
  opened: r.opened,
498
- onClose: l,
515
+ onClose: i,
499
516
  title: t().t("archbase:Grupo"),
500
517
  size: "60%",
501
518
  styles: { content: { maxWidth: 1e3 } },
502
- children: /* @__PURE__ */ e.jsx(ye, { style: { height: "460px" }, children: /* @__PURE__ */ e.jsxs(oe, { w: "98%", children: [
503
- d?.customContentBefore && d.customContentBefore(r.dataSource.getCurrentRecord()),
504
- /* @__PURE__ */ e.jsxs(P, { children: [
505
- /* @__PURE__ */ e.jsx(P.Col, { span: { base: 12 }, children: /* @__PURE__ */ e.jsx(
506
- re,
519
+ children: /* @__PURE__ */ e.jsx(we, { style: { height: "460px" }, children: /* @__PURE__ */ e.jsxs(oe, { w: "98%", children: [
520
+ u?.customContentBefore && u.customContentBefore(r.dataSource.getCurrentRecord()),
521
+ /* @__PURE__ */ e.jsxs(I, { children: [
522
+ /* @__PURE__ */ e.jsx(I.Col, { span: { base: 12 }, children: /* @__PURE__ */ e.jsx(
523
+ ae,
507
524
  {
508
525
  label: `${t().t("archbase:Nome do grupo")}`,
509
526
  placeholder: `${t().t("archbase:Informe o nome do grupo")}`,
@@ -511,8 +528,8 @@ const ja = sa(
511
528
  dataField: "name"
512
529
  }
513
530
  ) }),
514
- /* @__PURE__ */ e.jsx(P.Col, { span: { base: 12 }, children: /* @__PURE__ */ e.jsx(
515
- re,
531
+ /* @__PURE__ */ e.jsx(I.Col, { span: { base: 12 }, children: /* @__PURE__ */ e.jsx(
532
+ ae,
516
533
  {
517
534
  label: `${t().t("archbase:Descrição do grupo")}`,
518
535
  placeholder: `${t().t("archbase:Informe a descrição do grupo")}`,
@@ -521,64 +538,64 @@ const ja = sa(
521
538
  }
522
539
  ) })
523
540
  ] }),
524
- d?.customContentAfter && d.customContentAfter(r.dataSource.getCurrentRecord()),
525
- /* @__PURE__ */ e.jsxs(L, { justify: "flex-end", mt: "md", children: [
526
- /* @__PURE__ */ e.jsx(U, { variant: "default", onClick: l, children: t().t("archbase:Cancelar") }),
527
- /* @__PURE__ */ e.jsx(U, { onClick: j, children: t().t("archbase:Salvar") })
541
+ u?.customContentAfter && u.customContentAfter(r.dataSource.getCurrentRecord()),
542
+ /* @__PURE__ */ e.jsxs(V, { justify: "flex-end", mt: "md", children: [
543
+ /* @__PURE__ */ e.jsx(N, { variant: "default", onClick: i, children: t().t("archbase:Cancelar") }),
544
+ /* @__PURE__ */ e.jsx(N, { onClick: g, children: t().t("archbase:Salvar") })
528
545
  ] })
529
546
  ] }) })
530
547
  }
531
548
  );
532
- }, va = ({ image: r, label: d, description: j, ...l }) => /* @__PURE__ */ e.jsx("div", { ...l, children: /* @__PURE__ */ e.jsxs(L, { grow: !0, children: [
549
+ }, Aa = ({ image: r, label: u, description: g, ...i }) => /* @__PURE__ */ e.jsx("div", { ...i, children: /* @__PURE__ */ e.jsxs(V, { grow: !0, children: [
533
550
  /* @__PURE__ */ e.jsx("img", { style: { maxWidth: "32px" }, src: r }),
534
551
  /* @__PURE__ */ e.jsxs("div", { children: [
535
- /* @__PURE__ */ e.jsx(q, { size: "sm", children: d }),
536
- /* @__PURE__ */ e.jsx(q, { size: "xs", opacity: 0.65, children: j })
552
+ /* @__PURE__ */ e.jsx(J, { size: "sm", children: u }),
553
+ /* @__PURE__ */ e.jsx(J, { size: "xs", opacity: 0.65, children: g })
537
554
  ] })
538
- ] }) }), Sa = (r) => {
539
- ua();
540
- const [d, j] = N(), l = ee(K.User), c = ke(
555
+ ] }) }), Ta = (r) => {
556
+ pa();
557
+ const [u, g] = O(), i = re(_.User), l = ke(
541
558
  "ApiTokenModal",
542
559
  r.dataSource,
543
560
  "expirationDate",
544
561
  ""
545
- ), p = (h) => {
562
+ ), x = (h) => {
546
563
  if (!h)
547
- c.handleValueChange(void 0);
564
+ l.handleValueChange(void 0);
548
565
  else {
549
- const C = typeof h == "string" ? new Date(h) : h, z = Qr(C);
550
- c.handleValueChange(z);
566
+ const S = typeof h == "string" ? new Date(h) : h, z = Xr(S);
567
+ l.handleValueChange(z);
551
568
  }
552
- j(h);
553
- }, v = async (h, C) => new Promise(async (z, y) => {
569
+ g(h);
570
+ }, A = async (h, S) => new Promise(async (z, j) => {
554
571
  try {
555
- const V = Ie(Te.or(Te.eq("name", `^*${C.trim()}*`))), s = await l.findAllWithFilter(V, h, 20);
572
+ const M = Ie(Te.or(Te.eq("name", `^*${S.trim()}*`))), f = await i.findAllWithFilter(M, h, 20);
556
573
  z({
557
- options: s.content,
558
- page: s.pageable.pageNumber,
559
- totalPages: s.totalPages
574
+ options: f.content,
575
+ page: f.pageable.pageNumber,
576
+ totalPages: f.totalPages
560
577
  });
561
- } catch (V) {
562
- y(Ae(V));
578
+ } catch (M) {
579
+ j(Ae(M));
563
580
  }
564
- }), u = () => {
581
+ }), c = () => {
565
582
  r.onCustomSave ? r.onCustomSave(r.dataSource.current, (h) => {
566
583
  h && r.onAfterSave && r.onAfterSave(r.dataSource.current), r.onClickOk(r.dataSource.current, h);
567
584
  }) : r.onClickOk(r.dataSource.current, !0);
568
- }, G = () => {
585
+ }, $ = () => {
569
586
  r.onClickCancel(r.dataSource.current);
570
587
  };
571
588
  return /* @__PURE__ */ e.jsxs(
572
589
  Fe,
573
590
  {
574
591
  opened: r.opened,
575
- onClose: G,
592
+ onClose: $,
576
593
  title: t().t("archbase:Token de API"),
577
594
  size: "50%",
578
595
  children: [
579
- /* @__PURE__ */ e.jsxs(ye, { style: { height: "300px" }, children: [
596
+ /* @__PURE__ */ e.jsxs(we, { style: { height: "300px" }, children: [
580
597
  /* @__PURE__ */ e.jsx(
581
- re,
598
+ ae,
582
599
  {
583
600
  label: `${t().t("archbase:Nome do token")}`,
584
601
  placeholder: `${t().t("archbase:Informe o nome do token")}`,
@@ -587,7 +604,7 @@ const ja = sa(
587
604
  }
588
605
  ),
589
606
  /* @__PURE__ */ e.jsx(
590
- re,
607
+ ae,
591
608
  {
592
609
  label: `${t().t("archbase:Descrição do token")}`,
593
610
  placeholder: `${t().t("archbase:Informe a descrição do token")}`,
@@ -596,17 +613,17 @@ const ja = sa(
596
613
  }
597
614
  ),
598
615
  /* @__PURE__ */ e.jsx(
599
- da,
616
+ ha,
600
617
  {
601
618
  withSeconds: !0,
602
- value: d,
603
- onChange: p,
619
+ value: u,
620
+ onChange: x,
604
621
  label: "Data/hora expiração",
605
622
  placeholder: "Selecione a data de expiração"
606
623
  }
607
624
  ),
608
625
  /* @__PURE__ */ e.jsx(
609
- aa,
626
+ oa,
610
627
  {
611
628
  label: `${t().t("archbase:Usuário")}`,
612
629
  dataSource: r.dataSource,
@@ -614,171 +631,171 @@ const ja = sa(
614
631
  placeholder: `${t().t("archbase:Digite aqui o nome do usuário")}`,
615
632
  getOptionLabel: (h) => h && h.email ? h.email : "",
616
633
  getOptionValue: (h) => h && h.id ? h.id.toString() : "",
617
- getOptions: v,
634
+ getOptions: A,
618
635
  debounceTime: 500,
619
636
  minCharsToSearch: 1,
620
- itemComponent: va
637
+ itemComponent: Aa
621
638
  }
622
639
  )
623
640
  ] }),
624
- /* @__PURE__ */ e.jsxs(L, { justify: "flex-end", mt: "md", children: [
625
- /* @__PURE__ */ e.jsx(U, { variant: "default", onClick: G, children: t().t("archbase:Cancelar") }),
626
- /* @__PURE__ */ e.jsx(U, { onClick: u, children: t().t("archbase:Salvar") })
641
+ /* @__PURE__ */ e.jsxs(V, { justify: "flex-end", mt: "md", children: [
642
+ /* @__PURE__ */ e.jsx(N, { variant: "default", onClick: $, children: t().t("archbase:Cancelar") }),
643
+ /* @__PURE__ */ e.jsx(N, { onClick: c, children: t().t("archbase:Salvar") })
627
644
  ] })
628
645
  ]
629
646
  }
630
647
  );
631
648
  }, or = (r) => {
632
- const d = "->";
633
- return r.includes(d) ? r.split(d).map((c) => c.trim()).map((c) => t().t(c)).join(` ${d} `) : t().t(r);
649
+ const u = "->";
650
+ return r.includes(u) ? r.split(u).map((l) => l.trim()).map((l) => t().t(l)).join(` ${u} `) : t().t(r);
634
651
  };
635
- function Me({ dataSource: r, opened: d, close: j }) {
636
- const l = pe(() => r?.getFieldValue("name") || "", [r]), c = pe(() => r?.getFieldValue("id") || "", [r]), p = pe(() => r?.getFieldValue("type") || "", [r]), v = Ze(), u = Ze(), [G, h] = N([]), [C, z] = N([]), [y, V] = N(), [s, R] = N(), [H, ae] = N(""), [Q] = rr(H, 200), [D, O] = N(""), [I] = rr(D, 200), Z = ee(K.Resource), { colorScheme: o } = Oe(), F = o === "dark" ? "var(--mantine-primary-color-7)" : "var(--mantine-primary-color-4)", J = pe(() => C.sort((n, i) => n.resourceDescription.localeCompare(i.resourceDescription)).map((n) => ({
637
- value: n.resourceId,
638
- label: n.resourceDescription,
639
- children: n.permissions.filter((i) => i.actionDescription.toLowerCase().includes(I.toLowerCase())).sort((i, $) => i.actionDescription.localeCompare($.actionDescription)).map((i) => ({
640
- value: i.actionId,
641
- label: i.actionDescription,
652
+ function Me({ dataSource: r, opened: u, close: g }) {
653
+ const i = xe(() => r?.getFieldValue("name") || "", [r]), l = xe(() => r?.getFieldValue("id") || "", [r]), x = xe(() => r?.getFieldValue("type") || "", [r]), A = Ze(), c = Ze(), [$, h] = O([]), [S, z] = O([]), [j, M] = O(), [f, Y] = O(), [B, d] = O(""), [v] = rr(B, 200), [T, W] = O(""), [E] = rr(T, 200), Q = re(_.Resource), { colorScheme: o } = Oe(), D = o === "dark" ? "var(--mantine-primary-color-7)" : "var(--mantine-primary-color-4)", Z = xe(() => S.sort((s, n) => s.resourceDescription.localeCompare(n.resourceDescription)).map((s) => ({
654
+ value: s.resourceId,
655
+ label: s.resourceDescription,
656
+ children: s.permissions.filter((n) => n.actionDescription.toLowerCase().includes(E.toLowerCase())).sort((n, L) => n.actionDescription.localeCompare(L.actionDescription)).map((n) => ({
657
+ value: n.actionId,
658
+ label: n.actionDescription,
642
659
  nodeProps: {
643
- permissionId: i.permissionId,
644
- types: i.types ?? [],
645
- owner: n
660
+ permissionId: n.permissionId,
661
+ types: n.types ?? [],
662
+ owner: s
646
663
  }
647
664
  }))
648
- })), [C, I]), x = pe(() => C.map((n) => n.permissions.map((i) => i.actionId)).flat(), [C]), b = pe(() => G.sort((n, i) => n.resourceDescription.localeCompare(i.resourceDescription)).map((n) => ({
649
- value: n.resourceId,
650
- label: n.resourceDescription,
651
- children: n.permissions.filter((i) => i.actionDescription.toLowerCase().includes(Q.toLowerCase())).sort((i, $) => i.actionDescription.localeCompare($.actionDescription)).map((i) => {
652
- const $ = C.find((w) => w.resourceId === n.resourceId)?.permissions.find((w) => w.actionId === i.actionId);
665
+ })), [S, E]), p = xe(() => S.map((s) => s.permissions.map((n) => n.actionId)).flat(), [S]), w = xe(() => $.sort((s, n) => s.resourceDescription.localeCompare(n.resourceDescription)).map((s) => ({
666
+ value: s.resourceId,
667
+ label: s.resourceDescription,
668
+ children: s.permissions.filter((n) => n.actionDescription.toLowerCase().includes(v.toLowerCase())).sort((n, L) => n.actionDescription.localeCompare(L.actionDescription)).map((n) => {
669
+ const L = S.find((C) => C.resourceId === s.resourceId)?.permissions.find((C) => C.actionId === n.actionId);
653
670
  return {
654
- value: i.actionId,
655
- label: i.actionDescription,
671
+ value: n.actionId,
672
+ label: n.actionDescription,
656
673
  nodeProps: {
657
- granted: x.includes(i.actionId) && $?.types?.includes(le(k, p)),
658
- owner: n
674
+ granted: p.includes(n.actionId) && L?.types?.includes(le(P, x)),
675
+ owner: s
659
676
  }
660
677
  };
661
678
  })
662
- })), [G, C, x, p, Q]), f = ge(async () => {
663
- if (c) {
664
- const n = await Z.getPermissionsBySecurityId(c, p), i = await Z.getAllPermissionsAvailable();
665
- h(i), z(n);
679
+ })), [$, S, p, x, v]), b = ge(async () => {
680
+ if (l) {
681
+ const s = await Q.getPermissionsBySecurityId(l, x), n = await Q.getAllPermissionsAvailable();
682
+ h(n), z(s);
666
683
  }
667
- }, [c, p]), ce = ge(() => {
668
- y?.value && c && Z.createPermission(c, y.value, p).then((n) => {
669
- if (n) {
670
- z((E) => {
671
- let S;
672
- return E.map((g) => g.resourceId).includes(n.resourceId) ? S = E.map((g) => g.resourceId === n.resourceId ? g.permissions.map((A) => A.actionId).includes(y.value) ? {
673
- ...g,
674
- permissions: g.permissions.map(
675
- (A) => A.actionId === y.value ? {
676
- ...A,
677
- permissionId: n.permissionId,
678
- types: [...A.types ?? [], le(k, p)]
679
- } : A
684
+ }, [l, x]), ce = ge(() => {
685
+ j?.value && l && Q.createPermission(l, j.value, x).then((s) => {
686
+ if (s) {
687
+ z((G) => {
688
+ let k;
689
+ return G.map((y) => y.resourceId).includes(s.resourceId) ? k = G.map((y) => y.resourceId === s.resourceId ? y.permissions.map((R) => R.actionId).includes(j.value) ? {
690
+ ...y,
691
+ permissions: y.permissions.map(
692
+ (R) => R.actionId === j.value ? {
693
+ ...R,
694
+ permissionId: s.permissionId,
695
+ types: [...R.types ?? [], le(P, x)]
696
+ } : R
680
697
  )
681
698
  } : {
682
- ...g,
699
+ ...y,
683
700
  permissions: [
684
- ...g.permissions ?? [],
701
+ ...y.permissions ?? [],
685
702
  {
686
- actionId: n.actionId,
687
- actionDescription: n.actionDescription,
688
- permissionId: n.permissionId,
689
- types: [le(k, p)]
703
+ actionId: s.actionId,
704
+ actionDescription: s.actionDescription,
705
+ permissionId: s.permissionId,
706
+ types: [le(P, x)]
690
707
  }
691
708
  ]
692
- } : g) : S = [
693
- ...E,
709
+ } : y) : k = [
710
+ ...G,
694
711
  {
695
- resourceId: n.resourceId,
696
- resourceDescription: n.resourceDescription,
712
+ resourceId: s.resourceId,
713
+ resourceDescription: s.resourceDescription,
697
714
  permissions: [
698
715
  {
699
- actionId: n.actionId,
700
- actionDescription: n.actionDescription,
701
- permissionId: n.permissionId,
702
- types: [le(k, p)]
716
+ actionId: s.actionId,
717
+ actionDescription: s.actionDescription,
718
+ permissionId: s.permissionId,
719
+ types: [le(P, x)]
703
720
  }
704
721
  ]
705
722
  }
706
- ], S;
723
+ ], k;
707
724
  });
708
- const i = b.filter((E) => E.value === y?.nodeProps?.owner?.resourceId).map((E) => E.children).flat(), $ = i.map((E) => E.value).indexOf(y.value), w = i.find((E, S) => !E?.nodeProps?.granted && E?.value !== y.value && (i.length > $ + 1 ? S > $ : !0));
709
- w?.value && v.select(w.value), u.expand(n.resourceId), V(w);
725
+ const n = w.filter((G) => G.value === j?.nodeProps?.owner?.resourceId).map((G) => G.children).flat(), L = n.map((G) => G.value).indexOf(j.value), C = n.find((G, k) => !G?.nodeProps?.granted && G?.value !== j.value && (n.length > L + 1 ? k > L : !0));
726
+ C?.value && A.select(C.value), c.expand(s.resourceId), M(C);
710
727
  }
711
728
  });
712
- }, [y, c, p, Z, b, G, C, v, u]), ne = ge(() => {
713
- s?.nodeProps?.permissionId && Z.deletePermission(s.nodeProps.permissionId).then(() => {
714
- z((w) => [...w].filter((S) => {
715
- let g = !0;
716
- return S.permissions?.forEach((A) => {
717
- A.permissionId !== void 0 && A.permissionId === s?.nodeProps?.permissionId && S.permissions.length === 1 && A?.types?.length === 1 && A.types[0] === le(k, p) && (g = !1);
718
- }), g;
719
- }).map((S) => {
720
- const g = s?.nodeProps?.owner;
721
- return S.resourceId === g.resourceId ? s?.nodeProps?.types?.length === 1 ? {
722
- ...S,
723
- permissions: [...(S.permissions ?? []).filter((A) => A.permissionId !== s?.nodeProps?.permissionId)]
729
+ }, [j, l, x, Q, w, $, S, A, c]), ne = ge(() => {
730
+ f?.nodeProps?.permissionId && Q.deletePermission(f.nodeProps.permissionId).then(() => {
731
+ z((C) => [...C].filter((k) => {
732
+ let y = !0;
733
+ return k.permissions?.forEach((R) => {
734
+ R.permissionId !== void 0 && R.permissionId === f?.nodeProps?.permissionId && k.permissions.length === 1 && R?.types?.length === 1 && R.types[0] === le(P, x) && (y = !1);
735
+ }), y;
736
+ }).map((k) => {
737
+ const y = f?.nodeProps?.owner;
738
+ return k.resourceId === y.resourceId ? f?.nodeProps?.types?.length === 1 ? {
739
+ ...k,
740
+ permissions: [...(k.permissions ?? []).filter((R) => R.permissionId !== f?.nodeProps?.permissionId)]
724
741
  } : {
725
- ...S,
726
- permissions: (S.permissions ?? []).map((A) => A.actionId === s.value ? {
727
- actionId: A.actionId,
728
- actionDescription: A.actionDescription,
729
- types: [...A.types?.filter((de) => de && de !== le(k, p)) ?? []]
730
- } : A)
731
- } : S;
742
+ ...k,
743
+ permissions: (k.permissions ?? []).map((R) => R.actionId === f.value ? {
744
+ actionId: R.actionId,
745
+ actionDescription: R.actionDescription,
746
+ types: [...R.types?.filter((de) => de && de !== le(P, x)) ?? []]
747
+ } : R)
748
+ } : k;
732
749
  }));
733
- const n = J.filter((w) => w.value === s?.nodeProps?.owner?.resourceId).map((w) => w.children).flat(), i = n.map((w) => w.value).indexOf(s.value), $ = n.find((w, E) => w?.nodeProps?.types.includes(le(k, p)) && w?.value !== s.value && (n.length > i + 1 ? E > i : !0));
734
- $?.value && u.select($.value), R($);
750
+ const s = Z.filter((C) => C.value === f?.nodeProps?.owner?.resourceId).map((C) => C.children).flat(), n = s.map((C) => C.value).indexOf(f.value), L = s.find((C, G) => C?.nodeProps?.types.includes(le(P, x)) && C?.value !== f.value && (s.length > n + 1 ? G > n : !0));
751
+ L?.value && c.select(L.value), Y(L);
735
752
  });
736
- }, [s, Z, p, J, C, u]);
753
+ }, [f, Q, x, Z, S, c]);
737
754
  return Re(() => {
738
- d && r && (V(void 0), R(void 0), ae(""), O(""), u.collapseAllNodes(), v.collapseAllNodes(), f());
739
- }, [d, p, c, f]), r ? /* @__PURE__ */ e.jsx(Fe, { opened: d, onClose: j, title: `${t().t(`archbase:${p}`)}: ${l}`, size: "80%", styles: { root: { overflow: "hidden" } }, children: /* @__PURE__ */ e.jsxs(ha, { height: "540px", children: [
740
- /* @__PURE__ */ e.jsx(xa, { children: /* @__PURE__ */ e.jsx(X, { withBorder: !0, my: 20, p: 20, style: { height: "calc(100% - 40px)", overflow: "hidden", display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ e.jsxs("div", { style: { flex: 1, display: "flex", flexDirection: "row", overflow: "hidden", minHeight: 0, gap: "8px" }, children: [
755
+ u && r && (M(void 0), Y(void 0), d(""), W(""), c.collapseAllNodes(), A.collapseAllNodes(), b());
756
+ }, [u, x, l, b]), r ? /* @__PURE__ */ e.jsx(Fe, { opened: u, onClose: g, title: `${t().t(`archbase:${x}`)}: ${i}`, size: "80%", styles: { root: { overflow: "hidden" } }, children: /* @__PURE__ */ e.jsxs(xa, { height: "540px", children: [
757
+ /* @__PURE__ */ e.jsx(ma, { children: /* @__PURE__ */ e.jsx(K, { withBorder: !0, my: 20, p: 20, style: { height: "calc(100% - 40px)", overflow: "hidden", display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ e.jsxs("div", { style: { flex: 1, display: "flex", flexDirection: "row", overflow: "hidden", minHeight: 0, gap: "8px" }, children: [
741
758
  /* @__PURE__ */ e.jsxs("div", { style: { flex: 9, display: "flex", flexDirection: "column", overflow: "hidden", minHeight: 0 }, children: [
742
- /* @__PURE__ */ e.jsxs(L, { mb: 20, children: [
743
- /* @__PURE__ */ e.jsx(q, { children: t().t("archbase:Available") }),
759
+ /* @__PURE__ */ e.jsxs(V, { mb: 20, children: [
760
+ /* @__PURE__ */ e.jsx(J, { children: t().t("archbase:Available") }),
744
761
  /* @__PURE__ */ e.jsx(
745
762
  Qe,
746
763
  {
747
764
  size: "xs",
748
- value: H,
749
- onChange: (n) => ae(n.target.value),
765
+ value: B,
766
+ onChange: (s) => d(s.target.value),
750
767
  placeholder: t().t("archbase:Filter available permissions")
751
768
  }
752
769
  )
753
770
  ] }),
754
- /* @__PURE__ */ e.jsx(ye, { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e.jsx(
771
+ /* @__PURE__ */ e.jsx(we, { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e.jsx(
755
772
  Ye,
756
773
  {
757
- data: b,
774
+ data: w,
758
775
  selectOnClick: !0,
759
776
  allowRangeSelection: !1,
760
- tree: v,
761
- renderNode: ({ level: n, node: i, expanded: $, hasChildren: w, selected: E, elementProps: S }) => {
762
- const g = i?.nodeProps?.granted, A = g ? "dimmed" : void 0, de = g ? "line-through" : void 0, M = ge((Ee) => {
763
- V(i), S.onClick(Ee);
764
- }, [i, S.onClick]);
777
+ tree: A,
778
+ renderNode: ({ level: s, node: n, expanded: L, hasChildren: C, selected: G, elementProps: k }) => {
779
+ const y = n?.nodeProps?.granted, R = y ? "dimmed" : void 0, de = y ? "line-through" : void 0, U = ge((Ee) => {
780
+ M(n), k.onClick(Ee);
781
+ }, [n, k.onClick]);
765
782
  return /* @__PURE__ */ e.jsxs(
766
- L,
783
+ V,
767
784
  {
768
- ml: w ? 0 : 5,
785
+ ml: C ? 0 : 5,
769
786
  gap: 5,
770
- ...S,
771
- bg: E && n === 2 ? F : "",
772
- onClick: M,
787
+ ...k,
788
+ bg: G && s === 2 ? D : "",
789
+ onClick: U,
773
790
  children: [
774
- w && /* @__PURE__ */ e.jsx(
791
+ C && /* @__PURE__ */ e.jsx(
775
792
  Ke,
776
793
  {
777
794
  size: 18,
778
- style: { transform: $ ? "rotate(0deg)" : "rotate(-90deg)" }
795
+ style: { transform: L ? "rotate(0deg)" : "rotate(-90deg)" }
779
796
  }
780
797
  ),
781
- !w && /* @__PURE__ */ e.jsx(
798
+ !C && /* @__PURE__ */ e.jsx(
782
799
  _e,
783
800
  {
784
801
  size: 12,
@@ -786,11 +803,11 @@ function Me({ dataSource: r, opened: d, close: j }) {
786
803
  }
787
804
  ),
788
805
  /* @__PURE__ */ e.jsx(
789
- q,
806
+ J,
790
807
  {
791
- c: A,
808
+ c: R,
792
809
  td: de,
793
- children: or(i.label)
810
+ children: or(n.label)
794
811
  }
795
812
  )
796
813
  ]
@@ -801,60 +818,60 @@ function Me({ dataSource: r, opened: d, close: j }) {
801
818
  ) })
802
819
  ] }),
803
820
  /* @__PURE__ */ e.jsx("div", { style: { flex: 2, display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ e.jsxs(oe, { gap: 5, align: "center", children: [
804
- /* @__PURE__ */ e.jsx(se, { label: t().t("archbase:Add"), children: /* @__PURE__ */ e.jsx(W, { onClick: ce, disabled: !y || y?.nodeProps?.granted || !y.nodeProps, children: /* @__PURE__ */ e.jsx(lr, {}) }) }),
805
- /* @__PURE__ */ e.jsx(se, { label: t().t("archbase:Remove"), children: /* @__PURE__ */ e.jsx(W, { onClick: ne, disabled: !s || !s?.nodeProps?.permissionId || !s.nodeProps, children: /* @__PURE__ */ e.jsx(cr, {}) }) })
821
+ /* @__PURE__ */ e.jsx(se, { label: t().t("archbase:Add"), children: /* @__PURE__ */ e.jsx(H, { onClick: ce, disabled: !j || j?.nodeProps?.granted || !j.nodeProps, children: /* @__PURE__ */ e.jsx(lr, {}) }) }),
822
+ /* @__PURE__ */ e.jsx(se, { label: t().t("archbase:Remove"), children: /* @__PURE__ */ e.jsx(H, { onClick: ne, disabled: !f || !f?.nodeProps?.permissionId || !f.nodeProps, children: /* @__PURE__ */ e.jsx(cr, {}) }) })
806
823
  ] }) }),
807
824
  /* @__PURE__ */ e.jsxs("div", { style: { flex: 9, display: "flex", flexDirection: "column", overflow: "hidden", minHeight: 0 }, children: [
808
- /* @__PURE__ */ e.jsxs(L, { mb: 20, children: [
809
- /* @__PURE__ */ e.jsx(q, { children: t().t("archbase:Granted") }),
825
+ /* @__PURE__ */ e.jsxs(V, { mb: 20, children: [
826
+ /* @__PURE__ */ e.jsx(J, { children: t().t("archbase:Granted") }),
810
827
  /* @__PURE__ */ e.jsx(
811
828
  Qe,
812
829
  {
813
830
  size: "xs",
814
- value: D,
815
- onChange: (n) => O(n.target.value),
831
+ value: T,
832
+ onChange: (s) => W(s.target.value),
816
833
  placeholder: t().t("archbase:Filter granted permissions")
817
834
  }
818
835
  )
819
836
  ] }),
820
- /* @__PURE__ */ e.jsx(ye, { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e.jsx(
837
+ /* @__PURE__ */ e.jsx(we, { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e.jsx(
821
838
  Ye,
822
839
  {
823
- data: J,
840
+ data: Z,
824
841
  selectOnClick: !0,
825
842
  allowRangeSelection: !1,
826
- tree: u,
827
- renderNode: ({ level: n, node: i, expanded: $, hasChildren: w, selected: E, elementProps: S }) => {
828
- const g = ge((A) => {
829
- R(i), S.onClick(A);
830
- }, [i, S.onClick]);
843
+ tree: c,
844
+ renderNode: ({ level: s, node: n, expanded: L, hasChildren: C, selected: G, elementProps: k }) => {
845
+ const y = ge((R) => {
846
+ Y(n), k.onClick(R);
847
+ }, [n, k.onClick]);
831
848
  return /* @__PURE__ */ e.jsxs(
832
- L,
849
+ V,
833
850
  {
834
- ml: w ? 0 : 5,
851
+ ml: C ? 0 : 5,
835
852
  gap: 5,
836
- ...S,
837
- bg: E && n === 2 ? F : "",
838
- onClick: g,
853
+ ...k,
854
+ bg: G && s === 2 ? D : "",
855
+ onClick: y,
839
856
  children: [
840
- w && /* @__PURE__ */ e.jsx(
857
+ C && /* @__PURE__ */ e.jsx(
841
858
  Ke,
842
859
  {
843
860
  size: 18,
844
- style: { transform: $ ? "rotate(0deg)" : "rotate(-90deg)" }
861
+ style: { transform: L ? "rotate(0deg)" : "rotate(-90deg)" }
845
862
  }
846
863
  ),
847
- !w && /* @__PURE__ */ e.jsx(
864
+ !C && /* @__PURE__ */ e.jsx(
848
865
  _e,
849
866
  {
850
867
  size: 12,
851
868
  style: { transform: "rotate(-90deg)", marginTop: "-5px" }
852
869
  }
853
870
  ),
854
- /* @__PURE__ */ e.jsx(q, { children: or(i.label) }),
855
- i?.nodeProps?.types?.includes("USER") && /* @__PURE__ */ e.jsx(Se, { color: "blue", children: t().t("archbase:user") }),
856
- i?.nodeProps?.types?.includes("GROUP") && /* @__PURE__ */ e.jsx(Se, { color: "orange", children: t().t("archbase:group") }),
857
- i?.nodeProps?.types?.includes("PROFILE") && /* @__PURE__ */ e.jsx(Se, { color: "pink", children: t().t("archbase:profile") })
871
+ /* @__PURE__ */ e.jsx(J, { children: or(n.label) }),
872
+ n?.nodeProps?.types?.includes("USER") && /* @__PURE__ */ e.jsx(Se, { color: "blue", children: t().t("archbase:user") }),
873
+ n?.nodeProps?.types?.includes("GROUP") && /* @__PURE__ */ e.jsx(Se, { color: "orange", children: t().t("archbase:group") }),
874
+ n?.nodeProps?.types?.includes("PROFILE") && /* @__PURE__ */ e.jsx(Se, { color: "pink", children: t().t("archbase:profile") })
858
875
  ]
859
876
  }
860
877
  );
@@ -863,85 +880,85 @@ function Me({ dataSource: r, opened: d, close: j }) {
863
880
  ) })
864
881
  ] })
865
882
  ] }) }) }),
866
- /* @__PURE__ */ e.jsx(pa, { size: "40px", children: /* @__PURE__ */ e.jsx(L, { justify: "flex-end", children: /* @__PURE__ */ e.jsx(U, { onClick: j, children: t().t("archbase:Close") }) }) })
883
+ /* @__PURE__ */ e.jsx(fa, { size: "40px", children: /* @__PURE__ */ e.jsx(V, { justify: "flex-end", children: /* @__PURE__ */ e.jsx(N, { onClick: g, children: t().t("archbase:Close") }) }) })
867
884
  ] }) }) : null;
868
885
  }
869
- const Ne = "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", Aa = (r) => r.groups ? /* @__PURE__ */ e.jsx("div", { style: { display: "flex" }, children: r.groups.slice().sort((d, j) => (d.group?.name ?? "").localeCompare(j.group?.name ?? "")).map((d, j) => /* @__PURE__ */ e.jsx("div", { style: { paddingRight: "2px" }, children: /* @__PURE__ */ e.jsx(Se, { color: "blue", children: d.group?.name }) }, j)) }) : null, Ta = (r) => r.profile ? /* @__PURE__ */ e.jsx(Se, { color: "green", children: r.profile?.name }) : null;
870
- function La({
886
+ const Ne = "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", ka = (r) => r.groups ? /* @__PURE__ */ e.jsx("div", { style: { display: "flex" }, children: r.groups.slice().sort((u, g) => (u.group?.name ?? "").localeCompare(g.group?.name ?? "")).map((u, g) => /* @__PURE__ */ e.jsx("div", { style: { paddingRight: "2px" }, children: /* @__PURE__ */ e.jsx(Se, { color: "blue", children: u.group?.name }) }, g)) }) : null, Ra = (r) => r.profile ? /* @__PURE__ */ e.jsx(Se, { color: "green", children: r.profile?.name }) : null;
887
+ function Ma({
871
888
  height: r = "400px",
872
- width: d = "100%",
873
- createEntitiesWithId: j = !0,
874
- userModalOptions: l,
875
- profileModalOptions: c,
876
- groupModalOptions: p,
877
- options: v
889
+ width: u = "100%",
890
+ createEntitiesWithId: g = !0,
891
+ userModalOptions: i,
892
+ profileModalOptions: l,
893
+ groupModalOptions: x,
894
+ options: A
878
895
  }) {
879
- const u = nr();
896
+ const c = nr();
880
897
  ir("securityStore");
881
- const G = Yr(), { colorScheme: h } = Oe(), [C, z] = N(void 0), [y, V] = N("users"), s = ee(K.User), R = ee(K.Group), H = ee(K.Resource), ae = ee(K.Profile), [Q, D] = N(""), [O, I] = N(""), Z = ee(K.AccessToken), { t: o } = Xr(), F = je(null), J = je(null), x = je(null), b = je(null), f = je(null), ce = (a) => a.id, ne = (a) => a.id, n = (a) => a.id, i = (a) => a.id, $ = (a) => a.id, {
882
- dataSource: w,
883
- isLoading: E,
884
- refreshData: S
885
- } = we({
898
+ const $ = Kr(), { colorScheme: h } = Oe(), [S, z] = O(void 0), [j, M] = O("users"), f = re(_.User), Y = re(_.Group), B = re(_.Resource), d = re(_.Profile), [v, T] = O(""), [W, E] = O(""), Q = re(_.AccessToken), { t: o } = _r(), D = je(null), Z = je(null), p = je(null), w = je(null), b = je(null), ce = (a) => a.id, ne = (a) => a.id, s = (a) => a.id, n = (a) => a.id, L = (a) => a.id, {
899
+ dataSource: C,
900
+ isLoading: G,
901
+ refreshData: k
902
+ } = ye({
886
903
  name: "accessTokenApi",
887
- service: Z,
888
- validator: G,
904
+ service: Q,
905
+ validator: $,
889
906
  pageSize: 25,
890
907
  defaultSortFields: ["user.email", "expirationTime:desc"],
891
- onError: (a, T) => {
892
- z(a), Y.showError(`${o("archbase:WARNING")}`, a, T);
908
+ onError: (a, F) => {
909
+ z(a), X.showError(`${o("archbase:WARNING")}`, a, F);
893
910
  }
894
911
  }), {
895
- dataSource: g,
896
- isLoading: A,
912
+ dataSource: y,
913
+ isLoading: R,
897
914
  refreshData: de
898
- } = we({
915
+ } = ye({
899
916
  name: "dsUsers",
900
- service: s,
901
- validator: G,
917
+ service: f,
918
+ validator: $,
902
919
  pageSize: 25,
903
- onError: (a, T) => {
904
- z(a), Y.showError(`${o("archbase:WARNING")}`, a, T);
920
+ onError: (a, F) => {
921
+ z(a), X.showError(`${o("archbase:WARNING")}`, a, F);
905
922
  }
906
923
  }), {
907
- dataSource: M,
924
+ dataSource: U,
908
925
  isLoading: Ee,
909
926
  refreshData: dr
910
- } = we({
927
+ } = ye({
911
928
  name: "dsGroups",
912
- service: R,
913
- validator: G,
929
+ service: Y,
930
+ validator: $,
914
931
  pageSize: 25,
915
- onError: (a, T) => {
916
- z(a), Y.showError(`${o("archbase:WARNING")}`, a, T);
932
+ onError: (a, F) => {
933
+ z(a), X.showError(`${o("archbase:WARNING")}`, a, F);
917
934
  }
918
935
  }), {
919
- dataSource: B,
936
+ dataSource: q,
920
937
  isLoading: ur,
921
938
  refreshData: hr
922
- } = we({
939
+ } = ye({
923
940
  name: "dsProfile",
924
- service: ae,
925
- validator: G,
941
+ service: d,
942
+ validator: $,
926
943
  pageSize: 25,
927
- onError: (a, T) => {
928
- z(a), Y.showError(`${o("archbase:WARNING")}`, a, T);
944
+ onError: (a, F) => {
945
+ z(a), X.showError(`${o("archbase:WARNING")}`, a, F);
929
946
  }
930
947
  }), {
931
- dataSource: xr,
932
- isLoading: pr,
948
+ dataSource: pr,
949
+ isLoading: xr,
933
950
  refreshData: mr
934
- } = we({
951
+ } = ye({
935
952
  name: "dsResources",
936
- service: H,
937
- validator: G,
953
+ service: B,
954
+ validator: $,
938
955
  pageSize: 25,
939
- onError: (a, T) => {
940
- z(a), Y.showError(`${o("archbase:WARNING")}`, a, T);
956
+ onError: (a, F) => {
957
+ z(a), X.showError(`${o("archbase:WARNING")}`, a, F);
941
958
  }
942
959
  });
943
960
  Re(() => {
944
- S({ filter: Ie(Te.eq("revoked", "false")) }), de(), dr(), hr(), mr();
961
+ k({ filter: Ie(Te.eq("revoked", "false")) }), de(), dr(), hr(), mr();
945
962
  }, []);
946
963
  const fr = /* @__PURE__ */ e.jsxs(fe, { children: [
947
964
  /* @__PURE__ */ e.jsx(
@@ -990,7 +1007,7 @@ function La({
990
1007
  dataType: "text",
991
1008
  size: 300,
992
1009
  header: `${o("archbase:Expira em")}`,
993
- render: (a) => /* @__PURE__ */ e.jsx(q, { size: "sm", children: a.row.expirationDate }),
1010
+ render: (a) => /* @__PURE__ */ e.jsx(J, { size: "sm", children: a.row.expirationDate }),
994
1011
  inputFilterType: "text"
995
1012
  }
996
1013
  ),
@@ -1094,7 +1111,7 @@ function La({
1094
1111
  dataType: "text",
1095
1112
  header: `${o("archbase:Perfil")}`,
1096
1113
  size: 200,
1097
- render: (a) => Ta(a.row),
1114
+ render: (a) => Ra(a.row),
1098
1115
  inputFilterType: "text"
1099
1116
  }
1100
1117
  ),
@@ -1105,8 +1122,8 @@ function La({
1105
1122
  dataType: "text",
1106
1123
  size: 300,
1107
1124
  header: `${o("archbase:Grupos")}`,
1108
- render: (a) => Aa(a.row),
1109
- exportValue: (a) => a.groups?.slice().sort((T, Jr) => (T.group?.name ?? "").localeCompare(Jr.group?.name ?? "")).map((T) => T.group?.name).filter(Boolean).join(", ") || "",
1125
+ render: (a) => ka(a.row),
1126
+ exportValue: (a) => a.groups?.slice().sort((F, Jr) => (F.group?.name ?? "").localeCompare(Jr.group?.name ?? "")).map((F) => F.group?.name).filter(Boolean).join(", ") || "",
1110
1127
  enableSorting: !1,
1111
1128
  enableColumnFilter: !1,
1112
1129
  enableGlobalFilter: !1
@@ -1233,7 +1250,7 @@ function La({
1233
1250
  inputFilterType: "text"
1234
1251
  }
1235
1252
  )
1236
- ] }), yr = /* @__PURE__ */ e.jsxs(fe, { children: [
1253
+ ] }), wr = /* @__PURE__ */ e.jsxs(fe, { children: [
1237
1254
  /* @__PURE__ */ e.jsx(
1238
1255
  m,
1239
1256
  {
@@ -1254,121 +1271,121 @@ function La({
1254
1271
  inputFilterType: "text"
1255
1272
  }
1256
1273
  )
1257
- ] }), wr = () => {
1258
- const a = na.newInstance();
1259
- j || (a.id = void 0), g.insert(a), D(k.USER);
1260
- }, Cr = (a) => {
1261
- g.isEmpty() || g.gotoRecordByData(a) && (g.edit(), D(k.USER));
1274
+ ] }), yr = () => {
1275
+ const a = la.newInstance();
1276
+ g || (a.id = void 0), y.insert(a), T(P.USER);
1262
1277
  }, vr = (a) => {
1263
- g.isEmpty() || g.gotoRecordByData(a) && _.showConfirmDialogYesNo(
1278
+ y.isEmpty() || y.gotoRecordByData(a) && (y.edit(), T(P.USER));
1279
+ }, Cr = (a) => {
1280
+ y.isEmpty() || y.gotoRecordByData(a) && ee.showConfirmDialogYesNo(
1264
1281
  `${o("archbase:Confirme")}`,
1265
1282
  `${o("archbase:Deseja remover o usuário ")}${a.name} ?`,
1266
1283
  () => {
1267
- g.remove();
1284
+ y.remove();
1268
1285
  },
1269
1286
  () => {
1270
1287
  }
1271
1288
  );
1272
1289
  }, Sr = (a) => {
1273
- g.isEmpty() || g.gotoRecordByData(a) && D(k.USER);
1274
- }, Ar = (a) => /* @__PURE__ */ e.jsxs(L, { gap: 1, wrap: "nowrap", children: [
1275
- v?.beforeDefaultUserActions?.(a),
1276
- /* @__PURE__ */ e.jsx(W, { variant: "transparent", onClick: () => Sr(a), children: /* @__PURE__ */ e.jsx($e, { size: 20, color: h === "dark" ? u.colors.blue[8] : u.colors.blue[4] }) }),
1277
- /* @__PURE__ */ e.jsx(W, { variant: "transparent", onClick: () => Cr(a), children: /* @__PURE__ */ e.jsx(me, { size: 20, color: h === "dark" ? u.colors.yellow[8] : u.colors.yellow[4] }) }),
1278
- /* @__PURE__ */ e.jsx(W, { variant: "transparent", onClick: () => vr(a), children: /* @__PURE__ */ e.jsx(ve, { size: 20, color: h === "dark" ? u.colors.red[8] : u.colors.red[4] }) }),
1279
- /* @__PURE__ */ e.jsx(se, { withinPortal: !0, withArrow: !0, position: "left", label: `${o("archbase:Edit permissions")}`, children: /* @__PURE__ */ e.jsx(W, { variant: "transparent", onClick: Be, children: /* @__PURE__ */ e.jsx(Le, { size: 20, color: h === "dark" ? u.colors.green[8] : u.colors.green[4] }) }) }),
1280
- v?.afterDefaultUserActions?.(a)
1290
+ y.isEmpty() || y.gotoRecordByData(a) && T(P.USER);
1291
+ }, Ar = (a) => /* @__PURE__ */ e.jsxs(V, { gap: 1, wrap: "nowrap", children: [
1292
+ A?.beforeDefaultUserActions?.(a),
1293
+ /* @__PURE__ */ e.jsx(H, { variant: "transparent", onClick: () => Sr(a), children: /* @__PURE__ */ e.jsx($e, { size: 20, color: h === "dark" ? c.colors.blue[8] : c.colors.blue[4] }) }),
1294
+ /* @__PURE__ */ e.jsx(H, { variant: "transparent", onClick: () => vr(a), children: /* @__PURE__ */ e.jsx(me, { size: 20, color: h === "dark" ? c.colors.yellow[8] : c.colors.yellow[4] }) }),
1295
+ /* @__PURE__ */ e.jsx(H, { variant: "transparent", onClick: () => Cr(a), children: /* @__PURE__ */ e.jsx(Ce, { size: 20, color: h === "dark" ? c.colors.red[8] : c.colors.red[4] }) }),
1296
+ /* @__PURE__ */ e.jsx(se, { withinPortal: !0, withArrow: !0, position: "left", label: `${o("archbase:Edit permissions")}`, children: /* @__PURE__ */ e.jsx(H, { variant: "transparent", onClick: Be, children: /* @__PURE__ */ e.jsx(Le, { size: 20, color: h === "dark" ? c.colors.green[8] : c.colors.green[4] }) }) }),
1297
+ A?.afterDefaultUserActions?.(a)
1281
1298
  ] }), Tr = () => {
1282
- const a = ia.newInstance();
1283
- j || (a.id = void 0), M.insert(a), D(k.GROUP);
1299
+ const a = ca.newInstance();
1300
+ g || (a.id = void 0), U.insert(a), T(P.GROUP);
1284
1301
  }, kr = (a) => {
1285
- M.isEmpty() || M.gotoRecordByData(a) && (M.isEditing() || M.edit(), D(k.GROUP));
1302
+ U.isEmpty() || U.gotoRecordByData(a) && (U.isEditing() || U.edit(), T(P.GROUP));
1286
1303
  }, Rr = (a) => {
1287
- M.isEmpty() || M.gotoRecordByData(a) && _.showConfirmDialogYesNo(
1304
+ U.isEmpty() || U.gotoRecordByData(a) && ee.showConfirmDialogYesNo(
1288
1305
  `${o("archbase:Confirme")}`,
1289
1306
  `${o("archbase:Deseja remover o grupo ")}${a.name} ?`,
1290
1307
  () => {
1291
- M.remove();
1308
+ U.remove();
1292
1309
  },
1293
1310
  () => {
1294
1311
  }
1295
1312
  );
1296
1313
  }, Fr = (a) => {
1297
- M.isEmpty() || M.gotoRecordByData(a) && D(k.GROUP);
1298
- }, Dr = (a) => /* @__PURE__ */ e.jsxs(L, { gap: 1, wrap: "nowrap", children: [
1299
- v?.beforeDefaultGroupActions?.(a),
1300
- /* @__PURE__ */ e.jsx(W, { variant: "transparent", onClick: () => Fr(a), children: /* @__PURE__ */ e.jsx($e, { size: 20, color: h === "dark" ? u.colors.blue[8] : u.colors.blue[4] }) }),
1301
- /* @__PURE__ */ e.jsx(W, { variant: "transparent", onClick: () => kr(a), children: /* @__PURE__ */ e.jsx(me, { size: 20, color: h === "dark" ? u.colors.yellow[8] : u.colors.yellow[4] }) }),
1302
- /* @__PURE__ */ e.jsx(W, { variant: "transparent", onClick: () => Rr(a), children: /* @__PURE__ */ e.jsx(ve, { size: 20, color: h === "dark" ? u.colors.red[8] : u.colors.red[4] }) }),
1303
- /* @__PURE__ */ e.jsx(se, { withinPortal: !0, withArrow: !0, position: "left", label: `${o("archbase:Edit permissions")}`, children: /* @__PURE__ */ e.jsx(W, { variant: "transparent", onClick: We, children: /* @__PURE__ */ e.jsx(Le, { size: 20, color: h === "dark" ? u.colors.green[8] : u.colors.green[4] }) }) }),
1304
- v?.afterDefaultGroupActions?.(a)
1305
- ] }), ue = Kr(), zr = async () => {
1314
+ U.isEmpty() || U.gotoRecordByData(a) && T(P.GROUP);
1315
+ }, Pr = (a) => /* @__PURE__ */ e.jsxs(V, { gap: 1, wrap: "nowrap", children: [
1316
+ A?.beforeDefaultGroupActions?.(a),
1317
+ /* @__PURE__ */ e.jsx(H, { variant: "transparent", onClick: () => Fr(a), children: /* @__PURE__ */ e.jsx($e, { size: 20, color: h === "dark" ? c.colors.blue[8] : c.colors.blue[4] }) }),
1318
+ /* @__PURE__ */ e.jsx(H, { variant: "transparent", onClick: () => kr(a), children: /* @__PURE__ */ e.jsx(me, { size: 20, color: h === "dark" ? c.colors.yellow[8] : c.colors.yellow[4] }) }),
1319
+ /* @__PURE__ */ e.jsx(H, { variant: "transparent", onClick: () => Rr(a), children: /* @__PURE__ */ e.jsx(Ce, { size: 20, color: h === "dark" ? c.colors.red[8] : c.colors.red[4] }) }),
1320
+ /* @__PURE__ */ e.jsx(se, { withinPortal: !0, withArrow: !0, position: "left", label: `${o("archbase:Edit permissions")}`, children: /* @__PURE__ */ e.jsx(H, { variant: "transparent", onClick: We, children: /* @__PURE__ */ e.jsx(Le, { size: 20, color: h === "dark" ? c.colors.green[8] : c.colors.green[4] }) }) }),
1321
+ A?.afterDefaultGroupActions?.(a)
1322
+ ] }), ue = ea(), Dr = async () => {
1306
1323
  try {
1307
- await g.save();
1324
+ await y.save();
1308
1325
  } catch {
1309
1326
  return;
1310
1327
  }
1311
- D(""), ue?.clearAll();
1312
- }, Pr = () => {
1313
- D(""), g.isBrowsing() || g.cancel(), ue?.clearAll();
1328
+ T(""), ue?.clearAll();
1329
+ }, zr = () => {
1330
+ T(""), y.isBrowsing() || y.cancel(), ue?.clearAll();
1314
1331
  }, Ir = async () => {
1315
1332
  try {
1316
- await M.save();
1333
+ await U.save();
1317
1334
  } catch {
1318
1335
  return;
1319
1336
  }
1320
- D(""), ue?.clearAll();
1337
+ T(""), ue?.clearAll();
1321
1338
  }, Er = () => {
1322
- D(""), M.isBrowsing() || M.cancel(), ue?.clearAll();
1339
+ T(""), U.isBrowsing() || U.cancel(), ue?.clearAll();
1323
1340
  }, Gr = async () => {
1324
1341
  try {
1325
- await B.save();
1342
+ await q.save();
1326
1343
  } catch {
1327
1344
  return;
1328
1345
  }
1329
- D(""), ue?.clearAll();
1346
+ T(""), ue?.clearAll();
1330
1347
  }, $r = () => {
1331
- D(""), B.isBrowsing() || B.cancel(), ue?.clearAll();
1348
+ T(""), q.isBrowsing() || q.cancel(), ue?.clearAll();
1332
1349
  }, Lr = () => {
1333
- const a = la.newInstance();
1334
- j || (a.id = void 0), B.insert(a), D(k.PROFILE);
1350
+ const a = da.newInstance();
1351
+ g || (a.id = void 0), q.insert(a), T(P.PROFILE);
1335
1352
  }, Vr = (a) => {
1336
- B.isEmpty() || B.gotoRecordByData(a) && (B.isEditing() || B.edit(), D(k.PROFILE));
1353
+ q.isEmpty() || q.gotoRecordByData(a) && (q.isEditing() || q.edit(), T(P.PROFILE));
1337
1354
  }, Mr = (a) => {
1338
- B.isEmpty() || B.gotoRecordByData(a) && _.showConfirmDialogYesNo(
1355
+ q.isEmpty() || q.gotoRecordByData(a) && ee.showConfirmDialogYesNo(
1339
1356
  `${o("archbase:Confirme")}`,
1340
1357
  `${o("archbase:Deseja remover o perfil ")}${a.name} ?`,
1341
1358
  () => {
1342
- B.remove();
1359
+ q.remove();
1343
1360
  },
1344
1361
  () => {
1345
1362
  }
1346
1363
  );
1347
1364
  }, Ur = (a) => {
1348
- B.isEmpty() || B.gotoRecordByData(a) && D(k.PROFILE);
1349
- }, Nr = (a) => /* @__PURE__ */ e.jsxs(L, { gap: 1, wrap: "nowrap", children: [
1350
- v?.beforeDefaultProfileActions?.(a),
1351
- /* @__PURE__ */ e.jsx(W, { variant: "transparent", onClick: () => Ur(a), children: /* @__PURE__ */ e.jsx($e, { size: 20, color: h === "dark" ? u.colors.blue[8] : u.colors.blue[4] }) }),
1352
- /* @__PURE__ */ e.jsx(W, { variant: "transparent", onClick: () => Vr(a), children: /* @__PURE__ */ e.jsx(me, { size: 20, color: h === "dark" ? u.colors.yellow[8] : u.colors.yellow[4] }) }),
1353
- /* @__PURE__ */ e.jsx(W, { variant: "transparent", onClick: () => Mr(a), children: /* @__PURE__ */ e.jsx(ve, { size: 20, color: h === "dark" ? u.colors.red[8] : u.colors.red[4] }) }),
1354
- /* @__PURE__ */ e.jsx(se, { withinPortal: !0, withArrow: !0, position: "left", label: `${o("archbase:Edit permissions")}`, children: /* @__PURE__ */ e.jsx(W, { variant: "transparent", onClick: qe, children: /* @__PURE__ */ e.jsx(Le, { size: 20, color: h === "dark" ? u.colors.green[8] : u.colors.green[4] }) }) }),
1355
- v?.afterDefaultProfileActions?.(a)
1365
+ q.isEmpty() || q.gotoRecordByData(a) && T(P.PROFILE);
1366
+ }, Nr = (a) => /* @__PURE__ */ e.jsxs(V, { gap: 1, wrap: "nowrap", children: [
1367
+ A?.beforeDefaultProfileActions?.(a),
1368
+ /* @__PURE__ */ e.jsx(H, { variant: "transparent", onClick: () => Ur(a), children: /* @__PURE__ */ e.jsx($e, { size: 20, color: h === "dark" ? c.colors.blue[8] : c.colors.blue[4] }) }),
1369
+ /* @__PURE__ */ e.jsx(H, { variant: "transparent", onClick: () => Vr(a), children: /* @__PURE__ */ e.jsx(me, { size: 20, color: h === "dark" ? c.colors.yellow[8] : c.colors.yellow[4] }) }),
1370
+ /* @__PURE__ */ e.jsx(H, { variant: "transparent", onClick: () => Mr(a), children: /* @__PURE__ */ e.jsx(Ce, { size: 20, color: h === "dark" ? c.colors.red[8] : c.colors.red[4] }) }),
1371
+ /* @__PURE__ */ e.jsx(se, { withinPortal: !0, withArrow: !0, position: "left", label: `${o("archbase:Edit permissions")}`, children: /* @__PURE__ */ e.jsx(H, { variant: "transparent", onClick: qe, children: /* @__PURE__ */ e.jsx(Le, { size: 20, color: h === "dark" ? c.colors.green[8] : c.colors.green[4] }) }) }),
1372
+ A?.afterDefaultProfileActions?.(a)
1356
1373
  ] }), Or = () => {
1357
- const a = w.getCurrentRecord();
1358
- a && _.showConfirmDialogYesNo(
1374
+ const a = C.getCurrentRecord();
1375
+ a && ee.showConfirmDialogYesNo(
1359
1376
  `${o("archbase:Confirme")}`,
1360
1377
  `${o("archbase:Deseja revogar o token de Acesso do usuário ")}${a.user.name} ?`,
1361
1378
  async () => {
1362
- await Z.revoke(a.token).then(async () => {
1363
- Y.showSuccess(
1379
+ await Q.revoke(a.token).then(async () => {
1380
+ X.showSuccess(
1364
1381
  `${o("mentors:Informação")}`,
1365
1382
  `${o("mentors:Token de Acesso revogado com sucesso!")}`
1366
- ), w.refreshData();
1367
- }).catch((T) => {
1368
- _.showErrorWithDetails(
1383
+ ), C.refreshData();
1384
+ }).catch((F) => {
1385
+ ee.showErrorWithDetails(
1369
1386
  `${o("mentors:Atenção")}`,
1370
- Ae(T),
1371
- ze(T)
1387
+ Ae(F),
1388
+ De(F)
1372
1389
  );
1373
1390
  });
1374
1391
  },
@@ -1376,43 +1393,43 @@ function La({
1376
1393
  }
1377
1394
  );
1378
1395
  }, Be = () => {
1379
- I(k.USER);
1396
+ E(P.USER);
1380
1397
  }, We = () => {
1381
- I(k.GROUP);
1398
+ E(P.GROUP);
1382
1399
  }, qe = () => {
1383
- I(k.PROFILE);
1400
+ E(P.PROFILE);
1384
1401
  }, Ge = () => {
1385
- I("");
1402
+ E("");
1386
1403
  }, Br = () => /* @__PURE__ */ e.jsxs(te, { justify: "space-between", style: { width: "50%" }, children: [
1387
- /* @__PURE__ */ e.jsxs(L, { align: "end", gap: "4px", wrap: "nowrap", children: [
1388
- /* @__PURE__ */ e.jsx(U, { color: "green", leftSection: /* @__PURE__ */ e.jsx(Pe, {}), onClick: wr, children: `${o("archbase:New")}` }),
1389
- /* @__PURE__ */ e.jsx(U, { color: "blue", leftSection: /* @__PURE__ */ e.jsx(me, {}), onClick: Be, children: `${o("archbase:Edit permissions")}` })
1404
+ /* @__PURE__ */ e.jsxs(V, { align: "end", gap: "4px", wrap: "nowrap", children: [
1405
+ /* @__PURE__ */ e.jsx(N, { color: "green", leftSection: /* @__PURE__ */ e.jsx(ze, {}), onClick: yr, children: `${o("archbase:New")}` }),
1406
+ /* @__PURE__ */ e.jsx(N, { color: "blue", leftSection: /* @__PURE__ */ e.jsx(me, {}), onClick: Be, children: `${o("archbase:Edit permissions")}` })
1390
1407
  ] }),
1391
1408
  /* @__PURE__ */ e.jsx(te, { align: "flex-start", justify: "flex-end", style: { width: "200px" } })
1392
1409
  ] }), Wr = () => /* @__PURE__ */ e.jsxs(te, { justify: "space-between", style: { width: "50%" }, children: [
1393
- /* @__PURE__ */ e.jsxs(L, { align: "end", gap: "4px", wrap: "nowrap", children: [
1394
- /* @__PURE__ */ e.jsx(U, { color: "green", leftSection: /* @__PURE__ */ e.jsx(Pe, {}), onClick: Tr, children: `${o("archbase:New")}` }),
1395
- /* @__PURE__ */ e.jsx(U, { color: "blue", leftSection: /* @__PURE__ */ e.jsx(me, {}), onClick: We, children: `${o("archbase:Edit permissions")}` })
1410
+ /* @__PURE__ */ e.jsxs(V, { align: "end", gap: "4px", wrap: "nowrap", children: [
1411
+ /* @__PURE__ */ e.jsx(N, { color: "green", leftSection: /* @__PURE__ */ e.jsx(ze, {}), onClick: Tr, children: `${o("archbase:New")}` }),
1412
+ /* @__PURE__ */ e.jsx(N, { color: "blue", leftSection: /* @__PURE__ */ e.jsx(me, {}), onClick: We, children: `${o("archbase:Edit permissions")}` })
1396
1413
  ] }),
1397
1414
  /* @__PURE__ */ e.jsx(te, { align: "flex-start", justify: "flex-end", style: { width: "200px" } })
1398
1415
  ] }), qr = () => /* @__PURE__ */ e.jsxs(te, { justify: "space-between", style: { width: "50%" }, children: [
1399
- /* @__PURE__ */ e.jsxs(L, { align: "end", gap: "4px", wrap: "nowrap", children: [
1400
- /* @__PURE__ */ e.jsx(U, { color: "green", leftSection: /* @__PURE__ */ e.jsx(Pe, {}), onClick: Lr, children: `${o("archbase:New")}` }),
1401
- /* @__PURE__ */ e.jsx(U, { color: "blue", leftSection: /* @__PURE__ */ e.jsx(me, {}), onClick: qe, children: `${o("archbase:Edit permissions")}` })
1416
+ /* @__PURE__ */ e.jsxs(V, { align: "end", gap: "4px", wrap: "nowrap", children: [
1417
+ /* @__PURE__ */ e.jsx(N, { color: "green", leftSection: /* @__PURE__ */ e.jsx(ze, {}), onClick: Lr, children: `${o("archbase:New")}` }),
1418
+ /* @__PURE__ */ e.jsx(N, { color: "blue", leftSection: /* @__PURE__ */ e.jsx(me, {}), onClick: qe, children: `${o("archbase:Edit permissions")}` })
1402
1419
  ] }),
1403
1420
  /* @__PURE__ */ e.jsx(te, { align: "flex-start", justify: "flex-end", style: { width: "200px" } })
1404
- ] }), Hr = () => /* @__PURE__ */ e.jsx(te, { justify: "space-between", style: { width: "50%" }, children: /* @__PURE__ */ e.jsx(L, { align: "start", gap: "4px", wrap: "nowrap", children: /* @__PURE__ */ e.jsx(
1405
- U,
1421
+ ] }), Hr = () => /* @__PURE__ */ e.jsx(te, { justify: "space-between", style: { width: "50%" }, children: /* @__PURE__ */ e.jsx(V, { align: "start", gap: "4px", wrap: "nowrap", children: /* @__PURE__ */ e.jsx(
1422
+ N,
1406
1423
  {
1407
- disabled: !w.getCurrentRecord(),
1424
+ disabled: !C.getCurrentRecord(),
1408
1425
  color: "red",
1409
- leftSection: /* @__PURE__ */ e.jsx(ve, {}),
1426
+ leftSection: /* @__PURE__ */ e.jsx(Ce, {}),
1410
1427
  onClick: Or,
1411
1428
  children: `${o("archbase:Revoke")}`
1412
1429
  }
1413
1430
  ) }) });
1414
- return /* @__PURE__ */ e.jsxs(X, { p: "md", style: { height: r, display: "flex", flexDirection: "column" }, children: [
1415
- /* @__PURE__ */ e.jsx(ie, { variant: "pills", value: y, onChange: V, children: /* @__PURE__ */ e.jsxs(ie.List, { children: [
1431
+ return /* @__PURE__ */ e.jsxs(K, { p: "md", style: { height: r, display: "flex", flexDirection: "column" }, children: [
1432
+ /* @__PURE__ */ e.jsx(ie, { variant: "pills", value: j, onChange: M, children: /* @__PURE__ */ e.jsxs(ie.List, { children: [
1416
1433
  /* @__PURE__ */ e.jsx(ie.Tab, { value: "users", children: `${o("Usuários")}` }),
1417
1434
  /* @__PURE__ */ e.jsx(ie.Tab, { value: "groups", children: `${o("Grupos")}` }),
1418
1435
  /* @__PURE__ */ e.jsx(ie.Tab, { value: "profiles", children: `${o("Perfis")}` }),
@@ -1420,12 +1437,12 @@ function La({
1420
1437
  /* @__PURE__ */ e.jsx(ie.Tab, { value: "accessTokens", children: `${o("Tokens Acesso")}` })
1421
1438
  ] }) }),
1422
1439
  /* @__PURE__ */ e.jsx(
1423
- X,
1440
+ K,
1424
1441
  {
1425
1442
  withBorder: !0,
1426
1443
  mt: "md",
1427
1444
  style: {
1428
- display: y === "users" ? "flex" : "none",
1445
+ display: j === "users" ? "flex" : "none",
1429
1446
  width: "100%",
1430
1447
  flex: 1,
1431
1448
  minHeight: 0,
@@ -1434,37 +1451,37 @@ function La({
1434
1451
  children: /* @__PURE__ */ e.jsx(
1435
1452
  be,
1436
1453
  {
1437
- gridRef: F,
1454
+ gridRef: D,
1438
1455
  printTitle: "Usuários",
1439
1456
  width: "100%",
1440
1457
  height: "100%",
1441
1458
  withBorder: !1,
1442
- dataSource: g,
1459
+ dataSource: y,
1443
1460
  withColumnBorders: !0,
1444
1461
  striped: !0,
1445
1462
  enableTopToolbar: !0,
1446
1463
  enableRowActions: !0,
1447
1464
  pageSize: 50,
1448
- isLoading: A,
1449
- isError: !!C,
1450
- error: C,
1465
+ isLoading: R,
1466
+ isError: !!S,
1467
+ error: S,
1451
1468
  enableGlobalFilter: !0,
1452
1469
  getRowId: ce,
1453
1470
  toolbarLeftContent: Br(),
1454
1471
  renderRowActions: Ar,
1455
- actionsColumnWidth: v?.userActionsColumnWidth,
1472
+ actionsColumnWidth: A?.userActionsColumnWidth,
1456
1473
  children: br
1457
1474
  }
1458
1475
  )
1459
1476
  }
1460
1477
  ),
1461
1478
  /* @__PURE__ */ e.jsx(
1462
- X,
1479
+ K,
1463
1480
  {
1464
1481
  withBorder: !0,
1465
1482
  mt: "md",
1466
1483
  style: {
1467
- display: y === "groups" ? "flex" : "none",
1484
+ display: j === "groups" ? "flex" : "none",
1468
1485
  flex: 1,
1469
1486
  minHeight: 0,
1470
1487
  overflow: "auto"
@@ -1472,24 +1489,24 @@ function La({
1472
1489
  children: /* @__PURE__ */ e.jsx(
1473
1490
  be,
1474
1491
  {
1475
- gridRef: J,
1492
+ gridRef: Z,
1476
1493
  printTitle: "Grupos",
1477
1494
  width: "100%",
1478
1495
  height: "100%",
1479
1496
  withBorder: !1,
1480
- dataSource: M,
1497
+ dataSource: U,
1481
1498
  withColumnBorders: !0,
1482
1499
  striped: !1,
1483
1500
  enableTopToolbar: !0,
1484
1501
  enableRowActions: !0,
1485
1502
  pageSize: 50,
1486
1503
  isLoading: Ee,
1487
- isError: !!C,
1488
- error: C,
1504
+ isError: !!S,
1505
+ error: S,
1489
1506
  enableGlobalFilter: !0,
1490
1507
  getRowId: ne,
1491
- renderRowActions: Dr,
1492
- actionsColumnWidth: v?.groupActionsColumnWidth,
1508
+ renderRowActions: Pr,
1509
+ actionsColumnWidth: A?.groupActionsColumnWidth,
1493
1510
  children: gr,
1494
1511
  toolbarLeftContent: Wr()
1495
1512
  }
@@ -1497,12 +1514,12 @@ function La({
1497
1514
  }
1498
1515
  ),
1499
1516
  /* @__PURE__ */ e.jsx(
1500
- X,
1517
+ K,
1501
1518
  {
1502
1519
  withBorder: !0,
1503
1520
  mt: "md",
1504
1521
  style: {
1505
- display: y === "profiles" ? "flex" : "none",
1522
+ display: j === "profiles" ? "flex" : "none",
1506
1523
  flex: 1,
1507
1524
  minHeight: 0,
1508
1525
  overflow: "auto"
@@ -1510,37 +1527,37 @@ function La({
1510
1527
  children: /* @__PURE__ */ e.jsx(
1511
1528
  be,
1512
1529
  {
1513
- gridRef: x,
1530
+ gridRef: p,
1514
1531
  printTitle: "Perfis",
1515
1532
  width: "100%",
1516
1533
  height: "100%",
1517
1534
  withBorder: !1,
1518
- dataSource: B,
1535
+ dataSource: q,
1519
1536
  withColumnBorders: !0,
1520
1537
  striped: !1,
1521
1538
  enableTopToolbar: !0,
1522
1539
  enableRowActions: !0,
1523
1540
  pageSize: 50,
1524
1541
  isLoading: ur,
1525
- isError: !!C,
1526
- error: C,
1542
+ isError: !!S,
1543
+ error: S,
1527
1544
  enableGlobalFilter: !0,
1528
- getRowId: n,
1545
+ getRowId: s,
1529
1546
  toolbarLeftContent: qr(),
1530
1547
  renderRowActions: Nr,
1531
- actionsColumnWidth: v?.profileActionsColumnWidth,
1548
+ actionsColumnWidth: A?.profileActionsColumnWidth,
1532
1549
  children: jr
1533
1550
  }
1534
1551
  )
1535
1552
  }
1536
1553
  ),
1537
1554
  /* @__PURE__ */ e.jsx(
1538
- X,
1555
+ K,
1539
1556
  {
1540
1557
  withBorder: !0,
1541
1558
  mt: "md",
1542
1559
  style: {
1543
- display: y === "resources" ? "flex" : "none",
1560
+ display: j === "resources" ? "flex" : "none",
1544
1561
  flex: 1,
1545
1562
  minHeight: 0,
1546
1563
  overflow: "auto"
@@ -1548,34 +1565,34 @@ function La({
1548
1565
  children: /* @__PURE__ */ e.jsx(
1549
1566
  be,
1550
1567
  {
1551
- gridRef: b,
1568
+ gridRef: w,
1552
1569
  printTitle: "Recursos",
1553
1570
  width: "100%",
1554
1571
  height: "100%",
1555
1572
  withBorder: !1,
1556
- dataSource: xr,
1573
+ dataSource: pr,
1557
1574
  withColumnBorders: !0,
1558
1575
  striped: !1,
1559
1576
  enableTopToolbar: !0,
1560
1577
  enableRowActions: !1,
1561
1578
  pageSize: 50,
1562
- isLoading: pr,
1563
- isError: !!C,
1564
- error: C,
1579
+ isLoading: xr,
1580
+ isError: !!S,
1581
+ error: S,
1565
1582
  enableGlobalFilter: !0,
1566
- getRowId: i,
1567
- children: yr
1583
+ getRowId: n,
1584
+ children: wr
1568
1585
  }
1569
1586
  )
1570
1587
  }
1571
1588
  ),
1572
1589
  /* @__PURE__ */ e.jsx(
1573
- X,
1590
+ K,
1574
1591
  {
1575
1592
  withBorder: !0,
1576
1593
  mt: "md",
1577
1594
  style: {
1578
- display: y === "accessTokens" ? "flex" : "none",
1595
+ display: j === "accessTokens" ? "flex" : "none",
1579
1596
  width: "100%",
1580
1597
  flex: 1,
1581
1598
  minHeight: 0,
@@ -1584,114 +1601,114 @@ function La({
1584
1601
  children: /* @__PURE__ */ e.jsx(
1585
1602
  be,
1586
1603
  {
1587
- gridRef: f,
1604
+ gridRef: b,
1588
1605
  printTitle: "Tokens de API",
1589
1606
  width: "100%",
1590
1607
  height: "100%",
1591
1608
  withBorder: !1,
1592
- dataSource: w,
1609
+ dataSource: C,
1593
1610
  withColumnBorders: !0,
1594
1611
  striped: !0,
1595
1612
  enableTopToolbar: !0,
1596
1613
  enableRowActions: !1,
1597
1614
  pageSize: 50,
1598
- isLoading: E,
1599
- isError: !!C,
1600
- error: C,
1615
+ isLoading: G,
1616
+ isError: !!S,
1617
+ error: S,
1601
1618
  enableGlobalFilter: !0,
1602
- getRowId: $,
1619
+ getRowId: L,
1603
1620
  toolbarLeftContent: Hr(),
1604
1621
  children: fr
1605
1622
  }
1606
1623
  )
1607
1624
  }
1608
1625
  ),
1609
- Q === k.USER ? /* @__PURE__ */ e.jsx(
1610
- wa,
1626
+ v === P.USER ? /* @__PURE__ */ e.jsx(
1627
+ Ca,
1611
1628
  {
1612
- onClickOk: zr,
1629
+ onClickOk: Dr,
1613
1630
  opened: !0,
1614
- dataSource: g,
1615
- onClickCancel: Pr,
1616
- options: l
1631
+ dataSource: y,
1632
+ onClickCancel: zr,
1633
+ options: i
1617
1634
  }
1618
1635
  ) : null,
1619
- Q === k.GROUP ? /* @__PURE__ */ e.jsx(
1620
- Ca,
1636
+ v === P.GROUP ? /* @__PURE__ */ e.jsx(
1637
+ Sa,
1621
1638
  {
1622
1639
  onClickOk: Ir,
1623
1640
  opened: !0,
1624
- dataSource: M,
1641
+ dataSource: U,
1625
1642
  onClickCancel: Er,
1626
- options: p
1643
+ options: x
1627
1644
  }
1628
1645
  ) : null,
1629
- Q === k.PROFILE ? /* @__PURE__ */ e.jsx(
1630
- ba,
1646
+ v === P.PROFILE ? /* @__PURE__ */ e.jsx(
1647
+ ja,
1631
1648
  {
1632
1649
  onClickOk: Gr,
1633
1650
  opened: !0,
1634
- dataSource: B,
1651
+ dataSource: q,
1635
1652
  onClickCancel: $r,
1636
- options: c
1653
+ options: l
1637
1654
  }
1638
1655
  ) : null,
1639
- O === k.USER ? /* @__PURE__ */ e.jsx(
1656
+ W === P.USER ? /* @__PURE__ */ e.jsx(
1640
1657
  Me,
1641
1658
  {
1642
- dataSource: g,
1643
- opened: !!O,
1659
+ dataSource: y,
1660
+ opened: !!W,
1644
1661
  close: Ge
1645
1662
  }
1646
1663
  ) : null,
1647
- O === k.GROUP ? /* @__PURE__ */ e.jsx(
1664
+ W === P.GROUP ? /* @__PURE__ */ e.jsx(
1648
1665
  Me,
1649
1666
  {
1650
- dataSource: M,
1651
- opened: !!O,
1667
+ dataSource: U,
1668
+ opened: !!W,
1652
1669
  close: Ge
1653
1670
  }
1654
1671
  ) : null,
1655
- O === k.PROFILE ? /* @__PURE__ */ e.jsx(
1672
+ W === P.PROFILE ? /* @__PURE__ */ e.jsx(
1656
1673
  Me,
1657
1674
  {
1658
- dataSource: B,
1659
- opened: !!O,
1675
+ dataSource: q,
1676
+ opened: !!W,
1660
1677
  close: Ge
1661
1678
  }
1662
1679
  ) : null
1663
1680
  ] });
1664
1681
  }
1665
- function Va({ height: r = "400px", width: d = "100%" }) {
1682
+ function Ua({ height: r = "400px", width: u = "100%" }) {
1666
1683
  nr();
1667
- const j = ir("apiTokenStore"), l = { validateEntity: () => [] }, { colorScheme: c } = Oe(), [p, v] = N(void 0), u = ee(K.ApiToken), [G, h] = N(""), C = je(null), z = (F) => F.id, { dataSource: y } = oa({
1684
+ const g = ir("apiTokenStore"), i = { validateEntity: () => [] }, { colorScheme: l } = Oe(), [x, A] = O(void 0), c = re(_.ApiToken), [$, h] = O(""), S = je(null), z = (D) => D.id, { dataSource: j } = na({
1668
1685
  initialData: [],
1669
1686
  name: "dataSource"
1670
- }), V = ke(
1687
+ }), M = ke(
1671
1688
  "ArchbaseApiTokenView-LocalDataSource",
1672
- y,
1689
+ j,
1673
1690
  void 0,
1674
1691
  void 0
1675
- ), { dataSource: s, isLoading: R } = Ue({
1692
+ ), { dataSource: f, isLoading: Y } = Ue({
1676
1693
  name: "dsApiToken",
1677
- service: u,
1678
- store: j,
1679
- validator: l,
1694
+ service: c,
1695
+ store: g,
1696
+ validator: i,
1680
1697
  pageSize: 25,
1681
1698
  loadOnStart: !0,
1682
- onLoadComplete: (F) => {
1699
+ onLoadComplete: (D) => {
1683
1700
  },
1684
- onDestroy: (F) => {
1701
+ onDestroy: (D) => {
1685
1702
  },
1686
- onError: (F, J) => {
1687
- v(F), Y.showError(t().t("archbase:WARNING"), F, J);
1703
+ onError: (D, Z) => {
1704
+ A(D), X.showError(t().t("archbase:WARNING"), D, Z);
1688
1705
  }
1689
- }), H = ke(
1706
+ }), B = ke(
1690
1707
  "ArchbaseApiTokenView-RemoteDataSource",
1691
- s,
1708
+ f,
1692
1709
  void 0,
1693
1710
  void 0
1694
- ), ae = `calc(${r} - 40px)`, Q = /* @__PURE__ */ e.jsxs(fe, { children: [
1711
+ ), d = `calc(${r} - 40px)`, v = /* @__PURE__ */ e.jsxs(fe, { children: [
1695
1712
  /* @__PURE__ */ e.jsx(
1696
1713
  m,
1697
1714
  {
@@ -1699,11 +1716,11 @@ function Va({ height: r = "400px", width: d = "100%" }) {
1699
1716
  dataType: "image",
1700
1717
  size: 80,
1701
1718
  header: "Foto",
1702
- render: (F) => /* @__PURE__ */ e.jsx(
1719
+ render: (D) => /* @__PURE__ */ e.jsx(
1703
1720
  "img",
1704
1721
  {
1705
1722
  style: { borderRadius: 50, height: "32px", maxHeight: "32px" },
1706
- src: F.row.user && F.row.user.avatar ? atob(F.row.user.avatar) : Ne
1723
+ src: D.row.user && D.row.user.avatar ? atob(D.row.user.avatar) : Ne
1707
1724
  }
1708
1725
  ),
1709
1726
  inputFilterType: "text",
@@ -1779,28 +1796,28 @@ function Va({ height: r = "400px", width: d = "100%" }) {
1779
1796
  dataType: "text",
1780
1797
  size: 240,
1781
1798
  header: "Validade",
1782
- render: (F) => {
1783
- if (!F.row.expirationDate)
1784
- return /* @__PURE__ */ e.jsx(q, { c: "dimmed", children: "Sem expiração" });
1785
- const J = /* @__PURE__ */ new Date();
1786
- J.setHours(0, 0, 0, 0);
1787
- const x = new Date(F.row.expirationDate);
1788
- x.setHours(0, 0, 0, 0);
1789
- const b = x.getTime() - J.getTime(), f = Math.ceil(b / (1e3 * 60 * 60 * 24));
1790
- let ne = Math.max(0, Math.min(100, f / 365 * 100)), n = "green", i = "";
1791
- f < 0 ? (n = "red", ne = 100, i = `Vencido há ${Math.abs(f)} dia${Math.abs(f) !== 1 ? "s" : ""}`) : f === 0 ? (n = "red", ne = 5, i = "Vence hoje") : f <= 7 ? (n = "red", i = `${f} dia${f !== 1 ? "s" : ""}`) : f <= 30 ? (n = "orange", i = `${f} dias`) : f <= 90 ? (n = "yellow", i = `${f} dias`) : (n = "green", i = `${f} dias`);
1792
- const $ = f < 0 ? `Vencido em ${x.toLocaleDateString()}` : `Expira em ${x.toLocaleDateString()}`;
1793
- return /* @__PURE__ */ e.jsx(se, { label: $, withArrow: !0, children: /* @__PURE__ */ e.jsxs(L, { gap: "xs", wrap: "nowrap", children: [
1799
+ render: (D) => {
1800
+ if (!D.row.expirationDate)
1801
+ return /* @__PURE__ */ e.jsx(J, { c: "dimmed", children: "Sem expiração" });
1802
+ const Z = /* @__PURE__ */ new Date();
1803
+ Z.setHours(0, 0, 0, 0);
1804
+ const p = new Date(D.row.expirationDate);
1805
+ p.setHours(0, 0, 0, 0);
1806
+ const w = p.getTime() - Z.getTime(), b = Math.ceil(w / (1e3 * 60 * 60 * 24));
1807
+ let ne = Math.max(0, Math.min(100, b / 365 * 100)), s = "green", n = "";
1808
+ b < 0 ? (s = "red", ne = 100, n = `Vencido há ${Math.abs(b)} dia${Math.abs(b) !== 1 ? "s" : ""}`) : b === 0 ? (s = "red", ne = 5, n = "Vence hoje") : b <= 7 ? (s = "red", n = `${b} dia${b !== 1 ? "s" : ""}`) : b <= 30 ? (s = "orange", n = `${b} dias`) : b <= 90 ? (s = "yellow", n = `${b} dias`) : (s = "green", n = `${b} dias`);
1809
+ const L = b < 0 ? `Vencido em ${p.toLocaleDateString()}` : `Expira em ${p.toLocaleDateString()}`;
1810
+ return /* @__PURE__ */ e.jsx(se, { label: L, withArrow: !0, children: /* @__PURE__ */ e.jsxs(V, { gap: "xs", wrap: "nowrap", children: [
1794
1811
  /* @__PURE__ */ e.jsx(
1795
1812
  Zr,
1796
1813
  {
1797
1814
  size: 36,
1798
1815
  thickness: 4,
1799
1816
  roundCaps: !0,
1800
- sections: [{ value: f < 0 ? 100 : ne, color: n }]
1817
+ sections: [{ value: b < 0 ? 100 : ne, color: s }]
1801
1818
  }
1802
1819
  ),
1803
- /* @__PURE__ */ e.jsx(q, { size: "sm", c: f < 0 ? "red" : void 0, fw: f <= 7 ? 600 : void 0, children: i })
1820
+ /* @__PURE__ */ e.jsx(J, { size: "sm", c: b < 0 ? "red" : void 0, fw: b <= 7 ? 600 : void 0, children: n })
1804
1821
  ] }) });
1805
1822
  },
1806
1823
  inputFilterType: "text"
@@ -1824,73 +1841,73 @@ function Va({ height: r = "400px", width: d = "100%" }) {
1824
1841
  inputFilterType: "checkbox"
1825
1842
  }
1826
1843
  )
1827
- ] }), D = () => {
1828
- y.insert(ca.newInstance()), y && !V.isDataSourceV2 && V.v1State.forceUpdate(), h("apiToken");
1829
- }, O = () => {
1830
- s.getCurrentRecord() && _.showConfirmDialogYesNo(
1844
+ ] }), T = () => {
1845
+ j.insert(ua.newInstance()), j && !M.isDataSourceV2 && M.v1State.forceUpdate(), h("apiToken");
1846
+ }, W = () => {
1847
+ f.getCurrentRecord() && ee.showConfirmDialogYesNo(
1831
1848
  `${t().t("archbase:Confirme")}`,
1832
- `${t().t("archbase:Deseja revogar o token de API do usuário ")}${s.getCurrentRecord().user.name} ?`,
1849
+ `${t().t("archbase:Deseja revogar o token de API do usuário ")}${f.getCurrentRecord().user.name} ?`,
1833
1850
  async () => {
1834
- await u.revoke(s.getCurrentRecord().token).then(async () => {
1835
- Y.showSuccess(
1851
+ await c.revoke(f.getCurrentRecord().token).then(async () => {
1852
+ X.showSuccess(
1836
1853
  `${t().t("mentors:Informação")}`,
1837
1854
  `${t().t("mentors:Token de API revogado com sucesso!")}`
1838
- ), s.refreshData(), s && !H.isDataSourceV2 && H.v1State.forceUpdate();
1839
- }).catch((F) => {
1840
- _.showErrorWithDetails(
1855
+ ), f.refreshData(), f && !B.isDataSourceV2 && B.v1State.forceUpdate();
1856
+ }).catch((D) => {
1857
+ ee.showErrorWithDetails(
1841
1858
  `${t().t("mentors:Atenção")}`,
1842
- Ae(F),
1843
- ze(F)
1859
+ Ae(D),
1860
+ De(D)
1844
1861
  );
1845
1862
  });
1846
1863
  },
1847
1864
  () => {
1848
1865
  }
1849
1866
  );
1850
- }, I = () => {
1867
+ }, E = () => {
1851
1868
  h("");
1852
- }, Z = async (F, J) => {
1853
- const x = y.getCurrentRecord();
1854
- if (x)
1869
+ }, Q = async (D, Z) => {
1870
+ const p = j.getCurrentRecord();
1871
+ if (p)
1855
1872
  try {
1856
- if (y.validate(), !x.user || !x.user.email) {
1857
- _.showErrorWithDetails(
1873
+ if (j.validate(), !p.user || !p.user.email) {
1874
+ ee.showErrorWithDetails(
1858
1875
  `${t().t("archbase:WARNING")}`,
1859
1876
  `${t().t("archbase:Selecione um usuário para o token de API")}`,
1860
1877
  ""
1861
1878
  );
1862
1879
  return;
1863
1880
  }
1864
- await u.create(x.user.email, x.expirationDate, x.name, x.description).then(async (b) => {
1865
- y.cancel(), y && !V.isDataSourceV2 && V.v1State.forceUpdate(), s.append(b), s && !H.isDataSourceV2 && H.v1State.forceUpdate(), Y.showSuccess(
1881
+ await c.create(p.user.email, p.expirationDate, p.name, p.description).then(async (w) => {
1882
+ j.cancel(), j && !M.isDataSourceV2 && M.v1State.forceUpdate(), f.append(w), f && !B.isDataSourceV2 && B.v1State.forceUpdate(), X.showSuccess(
1866
1883
  `${t().t("mentors:Informação")}`,
1867
1884
  `${t().t("mentors:Token de API gerado com sucesso!")}`
1868
- ), J && J(!0);
1869
- }).catch((b) => {
1870
- _.showErrorWithDetails(
1885
+ ), Z && Z(!0);
1886
+ }).catch((w) => {
1887
+ ee.showErrorWithDetails(
1871
1888
  `${t().t("mentors:Atenção")}`,
1872
- Ae(b),
1873
- ze(b)
1889
+ Ae(w),
1890
+ De(w)
1874
1891
  );
1875
1892
  });
1876
- } catch (b) {
1877
- _.showErrorWithDetails(
1893
+ } catch (w) {
1894
+ ee.showErrorWithDetails(
1878
1895
  `${t().t("mentors:Atenção")}`,
1879
- Ae(b),
1880
- ze(b)
1896
+ Ae(w),
1897
+ De(w)
1881
1898
  );
1882
1899
  }
1883
- }, o = () => /* @__PURE__ */ e.jsx(te, { justify: "space-between", style: { width: "50%" }, children: /* @__PURE__ */ e.jsxs(L, { align: "start", gap: "2px", wrap: "nowrap", children: [
1884
- /* @__PURE__ */ e.jsx(U, { color: "green", leftSection: /* @__PURE__ */ e.jsx(Pe, {}), onClick: D, children: t().t("archbase:New") }),
1885
- /* @__PURE__ */ e.jsx(U, { disabled: !s.getCurrentRecord(), color: "red", leftSection: /* @__PURE__ */ e.jsx(ve, {}), onClick: O, children: t().t("archbase:Revoke") })
1900
+ }, o = () => /* @__PURE__ */ e.jsx(te, { justify: "space-between", style: { width: "50%" }, children: /* @__PURE__ */ e.jsxs(V, { align: "start", gap: "2px", wrap: "nowrap", children: [
1901
+ /* @__PURE__ */ e.jsx(N, { color: "green", leftSection: /* @__PURE__ */ e.jsx(ze, {}), onClick: T, children: t().t("archbase:New") }),
1902
+ /* @__PURE__ */ e.jsx(N, { disabled: !f.getCurrentRecord(), color: "red", leftSection: /* @__PURE__ */ e.jsx(Ce, {}), onClick: W, children: t().t("archbase:Revoke") })
1886
1903
  ] }) });
1887
- return /* @__PURE__ */ e.jsxs(X, { p: "md", style: { height: r, display: "flex", flexDirection: "column" }, children: [
1904
+ return /* @__PURE__ */ e.jsxs(K, { p: "md", style: { height: r, display: "flex", flexDirection: "column" }, children: [
1888
1905
  /* @__PURE__ */ e.jsx(
1889
- X,
1906
+ K,
1890
1907
  {
1891
1908
  withBorder: !0,
1892
1909
  style: {
1893
- height: ae,
1910
+ height: d,
1894
1911
  display: "flex",
1895
1912
  width: "100%",
1896
1913
  flex: 1,
@@ -1900,49 +1917,49 @@ function Va({ height: r = "400px", width: d = "100%" }) {
1900
1917
  children: /* @__PURE__ */ e.jsx(
1901
1918
  be,
1902
1919
  {
1903
- gridRef: C,
1920
+ gridRef: S,
1904
1921
  printTitle: "Tokens de API",
1905
1922
  width: "100%",
1906
1923
  height: "100%",
1907
1924
  withBorder: !1,
1908
- dataSource: s,
1925
+ dataSource: f,
1909
1926
  withColumnBorders: !0,
1910
1927
  striped: !0,
1911
1928
  enableTopToolbar: !0,
1912
1929
  enableRowActions: !1,
1913
1930
  pageSize: 50,
1914
- isLoading: R,
1915
- isError: !!p,
1916
- error: p,
1931
+ isLoading: Y,
1932
+ isError: !!x,
1933
+ error: x,
1917
1934
  enableGlobalFilter: !0,
1918
1935
  getRowId: z,
1919
1936
  toolbarLeftContent: o(),
1920
- children: Q
1937
+ children: v
1921
1938
  }
1922
1939
  )
1923
1940
  }
1924
1941
  ),
1925
- G === "apiToken" ? /* @__PURE__ */ e.jsx(
1926
- Sa,
1942
+ $ === "apiToken" ? /* @__PURE__ */ e.jsx(
1943
+ Ta,
1927
1944
  {
1928
- onClickOk: I,
1945
+ onClickOk: E,
1929
1946
  opened: !0,
1930
- dataSource: y,
1931
- onCustomSave: Z,
1932
- onClickCancel: I
1947
+ dataSource: j,
1948
+ onCustomSave: Q,
1949
+ onClickCancel: E
1933
1950
  }
1934
1951
  ) : null
1935
1952
  ] });
1936
1953
  }
1937
1954
  export {
1938
- Sa as ApiTokenModal,
1939
- Va as ArchbaseApiTokenView,
1940
- ga as ArchbaseDualListSelector,
1941
- La as ArchbaseSecurityView,
1942
- Ca as GroupModal,
1955
+ Ta as ApiTokenModal,
1956
+ Ua as ArchbaseApiTokenView,
1957
+ wa as ArchbaseDualListSelector,
1958
+ Ma as ArchbaseSecurityView,
1959
+ Sa as GroupModal,
1943
1960
  Me as PermissionsSelectorModal,
1944
- ba as ProfileModal,
1945
- ja as RenderProfileUserItem,
1946
- wa as UserModal
1961
+ ja as ProfileModal,
1962
+ ya as RenderProfileUserItem,
1963
+ Ca as UserModal
1947
1964
  };
1948
1965
  //# sourceMappingURL=index.js.map