@sito/dashboard-app 0.0.50 → 0.0.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/dashboard-app.cjs +1 -1
- package/dist/dashboard-app.js +1250 -1108
- package/dist/hooks/dialogs/index.d.ts +2 -0
- package/dist/hooks/dialogs/types.d.ts +57 -3
- package/dist/hooks/dialogs/useFormDialog.d.ts +10 -2
- package/dist/hooks/dialogs/usePostDialog.d.ts +3 -0
- package/dist/hooks/dialogs/usePutDialog.d.ts +3 -0
- package/dist/main.css +1 -1
- package/package.json +4 -4
package/dist/dashboard-app.js
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var et = Object.defineProperty;
|
|
2
|
+
var tt = (n, e, t) => e in n ? et(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var L = (n, e, t) => tt(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import "./main.css";
|
|
5
|
-
import { State as
|
|
5
|
+
import { State as st, inputStateClassName as nt, labelStateClassName as rt, helperTextStateClassName as it, useTranslation as N, Button as U, Loading as ne, TextInput as ot, FileInput as at, IconButton as ct, Actions as lt, ActionsDropdown as ut, useTableOptions as dt, Badge as mt, Action as ht } from "@sito/dashboard";
|
|
6
6
|
export * from "@sito/dashboard";
|
|
7
|
-
import { Action as
|
|
8
|
-
import { jsxs as k, jsx as
|
|
9
|
-
import { FontAwesomeIcon as
|
|
10
|
-
import { forwardRef as
|
|
11
|
-
import { faEyeSlash as
|
|
12
|
-
import { createPortal as
|
|
13
|
-
import { QueryClient as
|
|
14
|
-
import { faSadTear as
|
|
15
|
-
import { useForm as
|
|
16
|
-
const
|
|
7
|
+
import { Action as ln, Actions as un, ActionsDropdown as dn, Button as mn } from "@sito/dashboard";
|
|
8
|
+
import { jsxs as k, jsx as f, Fragment as ae } from "react/jsx-runtime";
|
|
9
|
+
import { FontAwesomeIcon as K } from "@fortawesome/react-fontawesome";
|
|
10
|
+
import { forwardRef as Ae, useState as _, useCallback as w, useEffect as O, useReducer as Le, useRef as M, useMemo as Q, createContext as re, useContext as ie, useLayoutEffect as ft } from "react";
|
|
11
|
+
import { faEyeSlash as pt, faEye as gt, faClose as _e, faTrash as yt, faRotateLeft as Re, faPencil as bt, faCircleNotch as Ie, faCloudArrowDown as wt, faCloudUpload as St, faArrowUp as kt, faArrowLeft as vt, faAdd as Ne, faFilter as Ct, faBars as Tt, faSearch as Nt, faCircleCheck as Et, faWarning as $t } from "@fortawesome/free-solid-svg-icons";
|
|
12
|
+
import { createPortal as Fe } from "react-dom";
|
|
13
|
+
import { QueryClient as xt, QueryClientProvider as At, useMutation as Z, useQueryClient as J, useQuery as Oe } from "@tanstack/react-query";
|
|
14
|
+
import { faSadTear as Lt } from "@fortawesome/free-regular-svg-icons";
|
|
15
|
+
import { useForm as Me } from "react-hook-form";
|
|
16
|
+
const Ee = (n) => n == null ? !1 : `${n}`.length > 0, bs = Ae(function(n, e) {
|
|
17
17
|
const {
|
|
18
18
|
value: t,
|
|
19
19
|
defaultValue: s,
|
|
20
20
|
onChange: r,
|
|
21
|
-
state:
|
|
22
|
-
name:
|
|
21
|
+
state: i = st.default,
|
|
22
|
+
name: o = "",
|
|
23
23
|
id: c = "",
|
|
24
24
|
label: a = "",
|
|
25
|
-
disabled:
|
|
26
|
-
required:
|
|
27
|
-
containerClassName:
|
|
25
|
+
disabled: u = !1,
|
|
26
|
+
required: l = !1,
|
|
27
|
+
containerClassName: d = "",
|
|
28
28
|
inputClassName: m = "",
|
|
29
|
-
labelClassName:
|
|
29
|
+
labelClassName: h = "",
|
|
30
30
|
helperText: p = "",
|
|
31
31
|
helperTextClassName: y = "",
|
|
32
32
|
...g
|
|
33
|
-
} = n, b = t !== void 0, [
|
|
34
|
-
() =>
|
|
35
|
-
),
|
|
36
|
-
b ||
|
|
33
|
+
} = n, b = t !== void 0, [S, E] = _(
|
|
34
|
+
() => Ee(s)
|
|
35
|
+
), v = b ? Ee(t) : S, $ = (j) => {
|
|
36
|
+
b || E(j.currentTarget.value.length > 0), r == null || r(j);
|
|
37
37
|
};
|
|
38
|
-
return /* @__PURE__ */ k("div", { className: `form-paragraph-container group ${
|
|
39
|
-
/* @__PURE__ */
|
|
38
|
+
return /* @__PURE__ */ k("div", { className: `form-paragraph-container group ${d}`, children: [
|
|
39
|
+
/* @__PURE__ */ f(
|
|
40
40
|
"textarea",
|
|
41
41
|
{
|
|
42
42
|
ref: e,
|
|
43
|
-
name:
|
|
43
|
+
name: o,
|
|
44
44
|
id: c,
|
|
45
|
-
className: `text-input text-area form-paragraph-textarea peer ${
|
|
46
|
-
required:
|
|
45
|
+
className: `text-input text-area form-paragraph-textarea peer ${nt(i)} ${v ? "has-value" : ""} ${g.placeholder ? "has-placeholder" : ""} ${m}`,
|
|
46
|
+
required: l,
|
|
47
47
|
defaultValue: s,
|
|
48
48
|
...b ? { value: t } : {},
|
|
49
|
-
onChange:
|
|
50
|
-
disabled:
|
|
49
|
+
onChange: $,
|
|
50
|
+
disabled: u,
|
|
51
51
|
...g
|
|
52
52
|
}
|
|
53
53
|
),
|
|
@@ -55,45 +55,45 @@ const Ne = (n) => n == null ? !1 : `${n}`.length > 0, hs = xe(function(n, e) {
|
|
|
55
55
|
"label",
|
|
56
56
|
{
|
|
57
57
|
htmlFor: c,
|
|
58
|
-
className: `text-input-label ${
|
|
58
|
+
className: `text-input-label ${rt(i)} ${h}`,
|
|
59
59
|
children: [
|
|
60
60
|
a,
|
|
61
|
-
|
|
61
|
+
l ? " *" : ""
|
|
62
62
|
]
|
|
63
63
|
}
|
|
64
64
|
),
|
|
65
|
-
!!p && /* @__PURE__ */
|
|
65
|
+
!!p && /* @__PURE__ */ f(
|
|
66
66
|
"p",
|
|
67
67
|
{
|
|
68
|
-
className: `text-input-helper-text ${
|
|
68
|
+
className: `text-input-helper-text ${it(i)} ${y}`,
|
|
69
69
|
children: p
|
|
70
70
|
}
|
|
71
71
|
)
|
|
72
72
|
] });
|
|
73
|
-
}),
|
|
74
|
-
const { t: e } =
|
|
73
|
+
}), ws = (n) => {
|
|
74
|
+
const { t: e } = N(), {
|
|
75
75
|
children: t,
|
|
76
76
|
handleSubmit: s,
|
|
77
77
|
onSubmit: r,
|
|
78
|
-
isLoading:
|
|
79
|
-
buttonEnd:
|
|
78
|
+
isLoading: i = !1,
|
|
79
|
+
buttonEnd: o = !0,
|
|
80
80
|
reset: c
|
|
81
81
|
} = n;
|
|
82
82
|
return /* @__PURE__ */ k("form", { className: "form-container", onSubmit: s(r), children: [
|
|
83
83
|
t,
|
|
84
|
-
/* @__PURE__ */ k("div", { className: `form-actions ${
|
|
84
|
+
/* @__PURE__ */ k("div", { className: `form-actions ${o ? "end" : ""}`, children: [
|
|
85
85
|
/* @__PURE__ */ k(
|
|
86
|
-
|
|
86
|
+
U,
|
|
87
87
|
{
|
|
88
88
|
type: "submit",
|
|
89
89
|
color: "primary",
|
|
90
90
|
variant: "submit",
|
|
91
|
-
disabled:
|
|
91
|
+
disabled: i,
|
|
92
92
|
name: e("_accessibility:buttons.submit"),
|
|
93
93
|
"aria-label": e("_accessibility:ariaLabels.submit"),
|
|
94
94
|
children: [
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
i ? /* @__PURE__ */ f(
|
|
96
|
+
ne,
|
|
97
97
|
{
|
|
98
98
|
color: "stroke-base",
|
|
99
99
|
loaderClass: "!w-6 mt-1",
|
|
@@ -104,8 +104,8 @@ const Ne = (n) => n == null ? !1 : `${n}`.length > 0, hs = xe(function(n, e) {
|
|
|
104
104
|
]
|
|
105
105
|
}
|
|
106
106
|
),
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
-
|
|
107
|
+
/* @__PURE__ */ f(
|
|
108
|
+
U,
|
|
109
109
|
{
|
|
110
110
|
type: "button",
|
|
111
111
|
variant: "outlined",
|
|
@@ -117,10 +117,10 @@ const Ne = (n) => n == null ? !1 : `${n}`.length > 0, hs = xe(function(n, e) {
|
|
|
117
117
|
)
|
|
118
118
|
] })
|
|
119
119
|
] });
|
|
120
|
-
},
|
|
121
|
-
const { t } =
|
|
122
|
-
return /* @__PURE__ */
|
|
123
|
-
|
|
120
|
+
}, Ss = Ae(function(n, e) {
|
|
121
|
+
const { t } = N(), [s, r] = _(!1);
|
|
122
|
+
return /* @__PURE__ */ f(ot, { ...n, type: s ? "text" : "password", ref: e, children: /* @__PURE__ */ f(
|
|
123
|
+
G,
|
|
124
124
|
{
|
|
125
125
|
type: "button",
|
|
126
126
|
tabIndex: -1,
|
|
@@ -129,61 +129,61 @@ const Ne = (n) => n == null ? !1 : `${n}`.length > 0, hs = xe(function(n, e) {
|
|
|
129
129
|
),
|
|
130
130
|
className: "password-icon",
|
|
131
131
|
onClick: () => r(!s),
|
|
132
|
-
icon: s ?
|
|
132
|
+
icon: s ? pt : gt
|
|
133
133
|
}
|
|
134
134
|
) });
|
|
135
|
-
}),
|
|
136
|
-
const { t: e } =
|
|
135
|
+
}), ke = (n) => {
|
|
136
|
+
const { t: e } = N(), {
|
|
137
137
|
title: t,
|
|
138
138
|
children: s,
|
|
139
139
|
handleClose: r,
|
|
140
|
-
open:
|
|
141
|
-
containerClassName:
|
|
140
|
+
open: i = !1,
|
|
141
|
+
containerClassName: o = "",
|
|
142
142
|
className: c = "",
|
|
143
143
|
animationClass: a = "appear"
|
|
144
|
-
} = n,
|
|
145
|
-
(
|
|
146
|
-
|
|
144
|
+
} = n, u = w(
|
|
145
|
+
(d) => {
|
|
146
|
+
d.key === "Escape" && i && r();
|
|
147
147
|
},
|
|
148
|
-
[
|
|
148
|
+
[i, r]
|
|
149
149
|
);
|
|
150
|
-
O(() => (window.addEventListener("keydown",
|
|
151
|
-
window.removeEventListener("keydown",
|
|
152
|
-
}), [
|
|
153
|
-
const
|
|
154
|
-
(
|
|
155
|
-
|
|
150
|
+
O(() => (window.addEventListener("keydown", u), () => {
|
|
151
|
+
window.removeEventListener("keydown", u);
|
|
152
|
+
}), [u]);
|
|
153
|
+
const l = w(
|
|
154
|
+
(d) => {
|
|
155
|
+
d.target === d.currentTarget && r();
|
|
156
156
|
},
|
|
157
157
|
[r]
|
|
158
158
|
);
|
|
159
159
|
return O(() => {
|
|
160
|
-
const
|
|
160
|
+
const d = (m) => {
|
|
161
161
|
m ? document.body.style.overflow = "hidden" : document.body.style.overflow = "auto";
|
|
162
162
|
};
|
|
163
|
-
return
|
|
164
|
-
|
|
163
|
+
return d(i), () => {
|
|
164
|
+
d(!1);
|
|
165
165
|
};
|
|
166
|
-
}, [
|
|
167
|
-
/* @__PURE__ */
|
|
166
|
+
}, [i]), Fe(
|
|
167
|
+
/* @__PURE__ */ f(
|
|
168
168
|
"div",
|
|
169
169
|
{
|
|
170
170
|
"aria-label": e("_accessibility:ariaLabels.closeDialog"),
|
|
171
|
-
"aria-hidden": !
|
|
172
|
-
onClick:
|
|
173
|
-
className: `dialog-backdrop animated ${
|
|
171
|
+
"aria-hidden": !i,
|
|
172
|
+
onClick: l,
|
|
173
|
+
className: `dialog-backdrop animated ${i ? `opened ${a}` : "closed"} ${o}`,
|
|
174
174
|
children: /* @__PURE__ */ k(
|
|
175
175
|
"div",
|
|
176
176
|
{
|
|
177
|
-
className: `dialog elevated animated ${
|
|
177
|
+
className: `dialog elevated animated ${i ? `opened ${a}` : "closed"} ${c}`,
|
|
178
178
|
children: [
|
|
179
179
|
/* @__PURE__ */ k("div", { className: "dialog-header", children: [
|
|
180
|
-
/* @__PURE__ */
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
-
|
|
180
|
+
/* @__PURE__ */ f("h3", { className: "dialog-title", children: t }),
|
|
181
|
+
/* @__PURE__ */ f(
|
|
182
|
+
G,
|
|
183
183
|
{
|
|
184
|
-
icon:
|
|
185
|
-
disabled: !
|
|
186
|
-
"aria-disabled": !
|
|
184
|
+
icon: _e,
|
|
185
|
+
disabled: !i,
|
|
186
|
+
"aria-disabled": !i,
|
|
187
187
|
onClick: r,
|
|
188
188
|
variant: "text",
|
|
189
189
|
color: "error",
|
|
@@ -201,42 +201,42 @@ const Ne = (n) => n == null ? !1 : `${n}`.length > 0, hs = xe(function(n, e) {
|
|
|
201
201
|
),
|
|
202
202
|
document.body
|
|
203
203
|
);
|
|
204
|
-
},
|
|
204
|
+
}, ve = (n) => {
|
|
205
205
|
const {
|
|
206
206
|
primaryText: e,
|
|
207
207
|
cancelText: t,
|
|
208
208
|
onPrimaryClick: s,
|
|
209
209
|
onCancel: r,
|
|
210
|
-
isLoading:
|
|
211
|
-
disabled:
|
|
210
|
+
isLoading: i = !1,
|
|
211
|
+
disabled: o = !1,
|
|
212
212
|
primaryType: c = "submit",
|
|
213
213
|
containerClassName: a = "",
|
|
214
|
-
primaryClassName:
|
|
215
|
-
alignEnd:
|
|
216
|
-
primaryName:
|
|
214
|
+
primaryClassName: u = "",
|
|
215
|
+
alignEnd: l = !1,
|
|
216
|
+
primaryName: d,
|
|
217
217
|
primaryAriaLabel: m,
|
|
218
|
-
cancelName:
|
|
218
|
+
cancelName: h,
|
|
219
219
|
cancelAriaLabel: p
|
|
220
220
|
} = n;
|
|
221
221
|
return /* @__PURE__ */ k(
|
|
222
222
|
"div",
|
|
223
223
|
{
|
|
224
|
-
className: `dialog-actions ${
|
|
224
|
+
className: `dialog-actions ${l ? "end" : ""} ${a}`,
|
|
225
225
|
children: [
|
|
226
226
|
/* @__PURE__ */ k(
|
|
227
|
-
|
|
227
|
+
U,
|
|
228
228
|
{
|
|
229
229
|
type: c,
|
|
230
230
|
color: "primary",
|
|
231
231
|
variant: "submit",
|
|
232
|
-
className:
|
|
233
|
-
disabled:
|
|
232
|
+
className: u,
|
|
233
|
+
disabled: o,
|
|
234
234
|
onClick: s,
|
|
235
|
-
name:
|
|
235
|
+
name: d,
|
|
236
236
|
"aria-label": m,
|
|
237
237
|
children: [
|
|
238
|
-
|
|
239
|
-
|
|
238
|
+
i ? /* @__PURE__ */ f(
|
|
239
|
+
ne,
|
|
240
240
|
{
|
|
241
241
|
color: "stroke-base",
|
|
242
242
|
loaderClass: "!w-6 mt-1",
|
|
@@ -247,14 +247,14 @@ const Ne = (n) => n == null ? !1 : `${n}`.length > 0, hs = xe(function(n, e) {
|
|
|
247
247
|
]
|
|
248
248
|
}
|
|
249
249
|
),
|
|
250
|
-
/* @__PURE__ */
|
|
251
|
-
|
|
250
|
+
/* @__PURE__ */ f(
|
|
251
|
+
U,
|
|
252
252
|
{
|
|
253
253
|
type: "button",
|
|
254
254
|
variant: "outlined",
|
|
255
|
-
disabled:
|
|
255
|
+
disabled: o,
|
|
256
256
|
onClick: r,
|
|
257
|
-
name:
|
|
257
|
+
name: h,
|
|
258
258
|
"aria-label": p,
|
|
259
259
|
children: t
|
|
260
260
|
}
|
|
@@ -262,27 +262,27 @@ const Ne = (n) => n == null ? !1 : `${n}`.length > 0, hs = xe(function(n, e) {
|
|
|
262
262
|
]
|
|
263
263
|
}
|
|
264
264
|
);
|
|
265
|
-
},
|
|
266
|
-
const { t: e } =
|
|
265
|
+
}, ks = (n) => {
|
|
266
|
+
const { t: e } = N(), {
|
|
267
267
|
children: t,
|
|
268
268
|
handleSubmit: s,
|
|
269
269
|
onSubmit: r,
|
|
270
|
-
handleClose:
|
|
271
|
-
isLoading:
|
|
270
|
+
handleClose: i,
|
|
271
|
+
isLoading: o = !1,
|
|
272
272
|
buttonEnd: c = !0,
|
|
273
273
|
...a
|
|
274
274
|
} = n;
|
|
275
|
-
return /* @__PURE__ */
|
|
276
|
-
/* @__PURE__ */
|
|
277
|
-
/* @__PURE__ */
|
|
278
|
-
|
|
275
|
+
return /* @__PURE__ */ f(ke, { ...a, handleClose: i, children: /* @__PURE__ */ k("form", { onSubmit: s(r), children: [
|
|
276
|
+
/* @__PURE__ */ f("div", { className: "form-container", children: t }),
|
|
277
|
+
/* @__PURE__ */ f(
|
|
278
|
+
ve,
|
|
279
279
|
{
|
|
280
280
|
primaryType: "submit",
|
|
281
281
|
primaryText: e("_accessibility:buttons.submit"),
|
|
282
282
|
cancelText: e("_accessibility:buttons.cancel"),
|
|
283
|
-
onCancel:
|
|
284
|
-
isLoading:
|
|
285
|
-
disabled:
|
|
283
|
+
onCancel: i,
|
|
284
|
+
isLoading: o,
|
|
285
|
+
disabled: o,
|
|
286
286
|
primaryClassName: "dialog-form-primary",
|
|
287
287
|
alignEnd: c,
|
|
288
288
|
primaryName: e("_accessibility:buttons.submit"),
|
|
@@ -292,25 +292,25 @@ const Ne = (n) => n == null ? !1 : `${n}`.length > 0, hs = xe(function(n, e) {
|
|
|
292
292
|
}
|
|
293
293
|
)
|
|
294
294
|
] }) });
|
|
295
|
-
},
|
|
296
|
-
const { t: e } =
|
|
295
|
+
}, vs = (n) => {
|
|
296
|
+
const { t: e } = N(), {
|
|
297
297
|
children: t,
|
|
298
298
|
handleSubmit: s,
|
|
299
299
|
handleClose: r,
|
|
300
|
-
isLoading:
|
|
301
|
-
...
|
|
300
|
+
isLoading: i = !1,
|
|
301
|
+
...o
|
|
302
302
|
} = n;
|
|
303
|
-
return /* @__PURE__ */ k(
|
|
303
|
+
return /* @__PURE__ */ k(ke, { ...o, handleClose: r, children: [
|
|
304
304
|
t,
|
|
305
|
-
/* @__PURE__ */
|
|
306
|
-
|
|
305
|
+
/* @__PURE__ */ f(
|
|
306
|
+
ve,
|
|
307
307
|
{
|
|
308
308
|
primaryText: e("_accessibility:buttons.ok"),
|
|
309
309
|
cancelText: e("_accessibility:buttons.cancel"),
|
|
310
310
|
onPrimaryClick: s,
|
|
311
311
|
onCancel: r,
|
|
312
|
-
isLoading:
|
|
313
|
-
disabled:
|
|
312
|
+
isLoading: i,
|
|
313
|
+
disabled: i,
|
|
314
314
|
primaryType: "button",
|
|
315
315
|
containerClassName: "mt-5",
|
|
316
316
|
primaryName: e("_accessibility:buttons.ok"),
|
|
@@ -321,34 +321,34 @@ const Ne = (n) => n == null ? !1 : `${n}`.length > 0, hs = xe(function(n, e) {
|
|
|
321
321
|
)
|
|
322
322
|
] });
|
|
323
323
|
};
|
|
324
|
-
function
|
|
325
|
-
const { message: e, className: t = "" } = n, { t: s } =
|
|
326
|
-
return /* @__PURE__ */
|
|
324
|
+
function _t(n) {
|
|
325
|
+
const { message: e, className: t = "" } = n, { t: s } = N();
|
|
326
|
+
return /* @__PURE__ */ f("p", { className: `import-error-message ${t}`, children: e ?? s("_messages:errors.parseFile", {
|
|
327
327
|
defaultValue: "Failed to process file"
|
|
328
328
|
}) });
|
|
329
329
|
}
|
|
330
|
-
function
|
|
331
|
-
const { message: e, className: t = "" } = n, { t: s } =
|
|
330
|
+
function Rt(n) {
|
|
331
|
+
const { message: e, className: t = "" } = n, { t: s } = N();
|
|
332
332
|
return /* @__PURE__ */ k("div", { className: `import-loading ${t}`, children: [
|
|
333
|
-
/* @__PURE__ */
|
|
334
|
-
/* @__PURE__ */
|
|
333
|
+
/* @__PURE__ */ f(ne, { loaderClass: "w-5 h-5", className: "!w-auto" }),
|
|
334
|
+
/* @__PURE__ */ f("span", { children: e ?? s("_messages:loading.processingFile", {
|
|
335
335
|
defaultValue: "Processing file..."
|
|
336
336
|
}) })
|
|
337
337
|
] });
|
|
338
338
|
}
|
|
339
|
-
function
|
|
340
|
-
const { items: e, max: t = 5, className: s = "" } = n, { t: r } =
|
|
339
|
+
function It(n) {
|
|
340
|
+
const { items: e, max: t = 5, className: s = "" } = n, { t: r } = N();
|
|
341
341
|
if (!e || e.length === 0) return null;
|
|
342
|
-
const
|
|
342
|
+
const i = e.slice(0, t);
|
|
343
343
|
return /* @__PURE__ */ k("div", { className: `import-preview ${s}`, children: [
|
|
344
|
-
/* @__PURE__ */
|
|
344
|
+
/* @__PURE__ */ f("p", { className: "import-preview-count", children: r("_pages:common.actions.import.previewCount", {
|
|
345
345
|
count: e.length,
|
|
346
346
|
defaultValue: `Preview: ${e.length} items`
|
|
347
347
|
}) }),
|
|
348
|
-
/* @__PURE__ */
|
|
348
|
+
/* @__PURE__ */ f("pre", { className: "import-preview-content", children: JSON.stringify(i, null, 2) })
|
|
349
349
|
] });
|
|
350
350
|
}
|
|
351
|
-
const
|
|
351
|
+
const De = () => ({
|
|
352
352
|
file: null,
|
|
353
353
|
previewItems: null,
|
|
354
354
|
parseError: null,
|
|
@@ -356,7 +356,7 @@ const Me = () => ({
|
|
|
356
356
|
overrideExisting: !1,
|
|
357
357
|
inputKey: 0
|
|
358
358
|
});
|
|
359
|
-
function
|
|
359
|
+
function Ft(n, e) {
|
|
360
360
|
switch (e.type) {
|
|
361
361
|
case "SET_FILE":
|
|
362
362
|
return {
|
|
@@ -385,107 +385,107 @@ function Lt(n, e) {
|
|
|
385
385
|
case "SET_OVERRIDE":
|
|
386
386
|
return { ...n, overrideExisting: e.value };
|
|
387
387
|
case "RESET":
|
|
388
|
-
return { ...
|
|
388
|
+
return { ...De(), inputKey: n.inputKey + 1 };
|
|
389
389
|
}
|
|
390
390
|
}
|
|
391
|
-
const
|
|
392
|
-
const { t: e } =
|
|
391
|
+
const Cs = (n) => {
|
|
392
|
+
const { t: e } = N(), {
|
|
393
393
|
children: t,
|
|
394
394
|
handleSubmit: s,
|
|
395
395
|
handleClose: r,
|
|
396
|
-
isLoading:
|
|
397
|
-
fileProcessor:
|
|
396
|
+
isLoading: i = !1,
|
|
397
|
+
fileProcessor: o,
|
|
398
398
|
onFileProcessed: c,
|
|
399
399
|
renderCustomPreview: a,
|
|
400
|
-
onOverrideChange:
|
|
401
|
-
open:
|
|
402
|
-
...
|
|
403
|
-
} = n, [m,
|
|
404
|
-
|
|
405
|
-
|
|
400
|
+
onOverrideChange: u,
|
|
401
|
+
open: l,
|
|
402
|
+
...d
|
|
403
|
+
} = n, [m, h] = Le(
|
|
404
|
+
Ft,
|
|
405
|
+
De()
|
|
406
406
|
), {
|
|
407
407
|
file: p,
|
|
408
408
|
previewItems: y,
|
|
409
409
|
parseError: g,
|
|
410
410
|
processing: b,
|
|
411
|
-
overrideExisting:
|
|
412
|
-
inputKey:
|
|
413
|
-
} = m,
|
|
411
|
+
overrideExisting: S,
|
|
412
|
+
inputKey: E
|
|
413
|
+
} = m, v = M(c), $ = M(o);
|
|
414
414
|
O(() => {
|
|
415
|
-
|
|
415
|
+
v.current = c;
|
|
416
416
|
}, [c]), O(() => {
|
|
417
|
-
|
|
418
|
-
}, [
|
|
419
|
-
|
|
420
|
-
}, [
|
|
421
|
-
const
|
|
422
|
-
async (
|
|
423
|
-
var
|
|
424
|
-
if (
|
|
425
|
-
|
|
417
|
+
$.current = o;
|
|
418
|
+
}, [o]), O(() => {
|
|
419
|
+
l || h({ type: "RESET" });
|
|
420
|
+
}, [l]);
|
|
421
|
+
const j = w(
|
|
422
|
+
async (I, C) => {
|
|
423
|
+
var A;
|
|
424
|
+
if ($.current) {
|
|
425
|
+
h({ type: "START_PROCESSING" });
|
|
426
426
|
try {
|
|
427
|
-
const
|
|
428
|
-
|
|
429
|
-
} catch (
|
|
430
|
-
console.error(
|
|
431
|
-
const
|
|
432
|
-
|
|
427
|
+
const x = await $.current(I, { override: C });
|
|
428
|
+
h({ type: "SET_PREVIEW", items: x ?? [] }), (A = v.current) == null || A.call(v, x ?? []);
|
|
429
|
+
} catch (x) {
|
|
430
|
+
console.error(x);
|
|
431
|
+
const q = x instanceof Error ? x.message : "Failed to parse file";
|
|
432
|
+
h({ type: "SET_ERROR", message: q });
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
},
|
|
436
436
|
[]
|
|
437
437
|
);
|
|
438
|
-
return /* @__PURE__ */ k(
|
|
439
|
-
/* @__PURE__ */
|
|
440
|
-
|
|
438
|
+
return /* @__PURE__ */ k(ke, { ...d, open: l, handleClose: r, children: [
|
|
439
|
+
/* @__PURE__ */ f(
|
|
440
|
+
at,
|
|
441
441
|
{
|
|
442
442
|
onClear: () => {
|
|
443
|
-
var
|
|
444
|
-
|
|
443
|
+
var I;
|
|
444
|
+
h({ type: "SET_FILE", file: null }), (I = v.current) == null || I.call(v, []);
|
|
445
445
|
},
|
|
446
|
-
onChange: (
|
|
447
|
-
var
|
|
448
|
-
const
|
|
449
|
-
if (!
|
|
450
|
-
|
|
446
|
+
onChange: (I) => {
|
|
447
|
+
var A, x;
|
|
448
|
+
const C = (A = I.target.files) == null ? void 0 : A[0];
|
|
449
|
+
if (!C) {
|
|
450
|
+
h({ type: "SET_FILE", file: null }), (x = v.current) == null || x.call(v, []);
|
|
451
451
|
return;
|
|
452
452
|
}
|
|
453
|
-
|
|
453
|
+
h({ type: "SET_FILE", file: C }), j(C, S);
|
|
454
454
|
},
|
|
455
455
|
label: e("_accessibility:labels.file")
|
|
456
456
|
},
|
|
457
|
-
|
|
457
|
+
E
|
|
458
458
|
),
|
|
459
459
|
/* @__PURE__ */ k("label", { className: "import-override-label", children: [
|
|
460
|
-
/* @__PURE__ */
|
|
460
|
+
/* @__PURE__ */ f(
|
|
461
461
|
"input",
|
|
462
462
|
{
|
|
463
463
|
type: "checkbox",
|
|
464
|
-
checked:
|
|
465
|
-
onChange: (
|
|
466
|
-
const
|
|
467
|
-
|
|
464
|
+
checked: S,
|
|
465
|
+
onChange: (I) => {
|
|
466
|
+
const C = I.target.checked;
|
|
467
|
+
h({ type: "SET_OVERRIDE", value: C }), u == null || u(C), p && j(p, C);
|
|
468
468
|
}
|
|
469
469
|
}
|
|
470
470
|
),
|
|
471
|
-
/* @__PURE__ */
|
|
471
|
+
/* @__PURE__ */ f("span", { children: e("_pages:common.actions.import.override", {
|
|
472
472
|
defaultValue: "Override existing items"
|
|
473
473
|
}) })
|
|
474
474
|
] }),
|
|
475
|
-
/* @__PURE__ */
|
|
476
|
-
b && /* @__PURE__ */
|
|
477
|
-
a ? a(y) : !!y && y.length > 0 && /* @__PURE__ */
|
|
475
|
+
/* @__PURE__ */ f(_t, { message: g }),
|
|
476
|
+
b && /* @__PURE__ */ f(Rt, {}),
|
|
477
|
+
a ? a(y) : !!y && y.length > 0 && /* @__PURE__ */ f(It, { items: y }),
|
|
478
478
|
t,
|
|
479
|
-
/* @__PURE__ */
|
|
480
|
-
|
|
479
|
+
/* @__PURE__ */ f(
|
|
480
|
+
ve,
|
|
481
481
|
{
|
|
482
482
|
primaryText: e("_accessibility:buttons.ok"),
|
|
483
483
|
cancelText: e("_accessibility:buttons.cancel"),
|
|
484
484
|
onPrimaryClick: () => {
|
|
485
|
-
(!
|
|
485
|
+
(!o || !!y && y.length > 0) && s();
|
|
486
486
|
},
|
|
487
487
|
onCancel: r,
|
|
488
|
-
isLoading:
|
|
488
|
+
isLoading: i,
|
|
489
489
|
primaryType: "button",
|
|
490
490
|
containerClassName: "import-dialog-actions",
|
|
491
491
|
primaryName: e("_accessibility:buttons.ok"),
|
|
@@ -496,49 +496,49 @@ const bs = (n) => {
|
|
|
496
496
|
)
|
|
497
497
|
] });
|
|
498
498
|
};
|
|
499
|
-
var R = /* @__PURE__ */ ((n) => (n[n.success = 0] = "success", n[n.error = 1] = "error", n[n.warning = 2] = "warning", n[n.info = 3] = "info", n))(R || {}),
|
|
500
|
-
const
|
|
501
|
-
async function
|
|
502
|
-
const r =
|
|
499
|
+
var R = /* @__PURE__ */ ((n) => (n[n.success = 0] = "success", n[n.error = 1] = "error", n[n.warning = 2] = "warning", n[n.info = 3] = "info", n))(R || {}), F = /* @__PURE__ */ ((n) => (n.GET = "GET", n.POST = "POST", n.PUT = "PUT", n.PATCH = "PATCH", n.DELETE = "DELETE", n))(F || {});
|
|
500
|
+
const Ot = (n) => Array.isArray(n) || n instanceof Headers ? !1 : typeof n == "object" && n !== null && ("headers" in n || "credentials" in n), Mt = (n) => n ? Ot(n) ? n : { headers: n } : {}, Dt = (n) => n ? n instanceof Headers ? Object.fromEntries(n.entries()) : Array.isArray(n) ? Object.fromEntries(n) : n : {};
|
|
501
|
+
async function be(n, e = "GET", t, s) {
|
|
502
|
+
const r = Mt(s), i = {
|
|
503
503
|
...t !== void 0 ? { "Content-Type": "application/json" } : {},
|
|
504
|
-
...
|
|
504
|
+
...Dt(r.headers)
|
|
505
505
|
};
|
|
506
506
|
try {
|
|
507
|
-
const
|
|
507
|
+
const o = await fetch(n, {
|
|
508
508
|
method: e,
|
|
509
|
-
headers:
|
|
509
|
+
headers: i,
|
|
510
510
|
...r.credentials ? { credentials: r.credentials } : {},
|
|
511
511
|
...t !== void 0 ? { body: JSON.stringify(t) } : {}
|
|
512
|
-
}), c = await
|
|
512
|
+
}), c = await o.text();
|
|
513
513
|
let a = null;
|
|
514
514
|
try {
|
|
515
515
|
a = c ? JSON.parse(c) : null;
|
|
516
516
|
} catch {
|
|
517
517
|
a = null;
|
|
518
518
|
}
|
|
519
|
-
if (!
|
|
520
|
-
const
|
|
519
|
+
if (!o.ok) {
|
|
520
|
+
const u = typeof a == "object" && a !== null ? a.message ?? a.error ?? c : c || o.statusText;
|
|
521
521
|
return {
|
|
522
522
|
data: null,
|
|
523
|
-
status:
|
|
523
|
+
status: o.status,
|
|
524
524
|
error: {
|
|
525
|
-
status:
|
|
526
|
-
message:
|
|
525
|
+
status: o.status,
|
|
526
|
+
message: u || "Unknown error occurred"
|
|
527
527
|
}
|
|
528
528
|
};
|
|
529
529
|
}
|
|
530
530
|
return {
|
|
531
|
-
data:
|
|
532
|
-
status:
|
|
531
|
+
data: o.status !== 204 && a !== null ? a : null,
|
|
532
|
+
status: o.status,
|
|
533
533
|
error: null
|
|
534
534
|
};
|
|
535
|
-
} catch (
|
|
535
|
+
} catch (o) {
|
|
536
536
|
return {
|
|
537
537
|
data: null,
|
|
538
538
|
status: 500,
|
|
539
539
|
error: {
|
|
540
540
|
status: 500,
|
|
541
|
-
message:
|
|
541
|
+
message: o instanceof Error ? o.message : "Unknown error occurred"
|
|
542
542
|
}
|
|
543
543
|
};
|
|
544
544
|
}
|
|
@@ -552,49 +552,49 @@ function Pt(n, e) {
|
|
|
552
552
|
}
|
|
553
553
|
return n;
|
|
554
554
|
}
|
|
555
|
-
const
|
|
555
|
+
const Pe = (n, e, t) => {
|
|
556
556
|
const s = [];
|
|
557
557
|
if (e) {
|
|
558
|
-
const { sortingBy: r, sortingOrder:
|
|
559
|
-
r !== void 0 && s.push(`sort=${String(r)}`),
|
|
558
|
+
const { sortingBy: r, sortingOrder: i, currentPage: o, pageSize: c } = e;
|
|
559
|
+
r !== void 0 && s.push(`sort=${String(r)}`), i !== void 0 && s.push(`order=${i}`), o !== void 0 && s.push(`page=${o}`), c !== void 0 && s.push(`pageSize=${c}`);
|
|
560
560
|
}
|
|
561
561
|
if (t) {
|
|
562
562
|
const r = Object.entries(t).filter(
|
|
563
|
-
([,
|
|
564
|
-
).flatMap(([
|
|
565
|
-
if (Array.isArray(
|
|
566
|
-
return
|
|
567
|
-
if (typeof
|
|
563
|
+
([, i]) => i != null && i !== ""
|
|
564
|
+
).flatMap(([i, o]) => {
|
|
565
|
+
if (Array.isArray(o))
|
|
566
|
+
return o.map((c) => `${i}==${encodeURIComponent((c == null ? void 0 : c.id) ?? c)}`);
|
|
567
|
+
if (typeof o == "object" && o !== null && "start" in o && "end" in o) {
|
|
568
568
|
const c = [];
|
|
569
|
-
return
|
|
569
|
+
return o.start != null && o.start !== "" && c.push(`${i}>=${encodeURIComponent(o.start)}`), o.end != null && o.end !== "" && c.push(`${i}<=${encodeURIComponent(o.end)}`), c;
|
|
570
570
|
}
|
|
571
|
-
return typeof
|
|
571
|
+
return typeof o == "object" && o !== null ? `${i}==${encodeURIComponent(o.id ?? "")}` : `${i}==${encodeURIComponent(o)}`;
|
|
572
572
|
});
|
|
573
573
|
r.length > 0 && s.push(`filters=${r.join(",")}`);
|
|
574
574
|
}
|
|
575
575
|
return s.length ? `${n}?${s.join("&")}` : n;
|
|
576
|
-
},
|
|
576
|
+
}, se = class se {
|
|
577
577
|
/**
|
|
578
578
|
* @param baseUrl the base url of the server
|
|
579
579
|
* @param userKey the local storage user key
|
|
580
580
|
* @param secured if the api client requires token
|
|
581
581
|
* @param tokenAcquirer custom token acquirer
|
|
582
582
|
*/
|
|
583
|
-
constructor(e, t = "user", s = !0, r,
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
this.baseUrl = e, this.secured = s, this.userKey = t, this.rememberKey =
|
|
583
|
+
constructor(e, t = "user", s = !0, r, i = {}) {
|
|
584
|
+
L(this, "baseUrl");
|
|
585
|
+
L(this, "userKey");
|
|
586
|
+
L(this, "rememberKey");
|
|
587
|
+
L(this, "refreshTokenKey");
|
|
588
|
+
L(this, "accessTokenExpiresAtKey");
|
|
589
|
+
L(this, "refreshEndpoint");
|
|
590
|
+
L(this, "refreshExpirySkewMs");
|
|
591
|
+
L(this, "secured");
|
|
592
|
+
L(this, "tokenAcquirer");
|
|
593
|
+
this.baseUrl = e, this.secured = s, this.userKey = t, this.rememberKey = i.rememberKey ?? "remember", this.refreshTokenKey = i.refreshTokenKey ?? "refreshToken", this.accessTokenExpiresAtKey = i.accessTokenExpiresAtKey ?? "accessTokenExpiresAt", this.refreshEndpoint = i.refreshEndpoint ?? "auth/refresh", this.refreshExpirySkewMs = i.refreshExpirySkewMs ?? 5e3, this.tokenAcquirer = r ?? this.defaultTokenAcquirer;
|
|
594
594
|
}
|
|
595
595
|
defaultTokenAcquirer(e) {
|
|
596
596
|
if (e) return { credentials: "include" };
|
|
597
|
-
const t =
|
|
597
|
+
const t = X(this.userKey);
|
|
598
598
|
if (t && t.length) return { Authorization: `Bearer ${t}` };
|
|
599
599
|
}
|
|
600
600
|
getRefreshLockKey() {
|
|
@@ -605,12 +605,12 @@ const De = (n, e, t) => {
|
|
|
605
605
|
return `${t}${s}`;
|
|
606
606
|
}
|
|
607
607
|
getRefreshToken() {
|
|
608
|
-
const e =
|
|
608
|
+
const e = X(this.refreshTokenKey);
|
|
609
609
|
if (typeof e == "string" && e.length)
|
|
610
610
|
return e;
|
|
611
611
|
}
|
|
612
612
|
getAccessTokenExpiresAt() {
|
|
613
|
-
const e =
|
|
613
|
+
const e = X(this.accessTokenExpiresAtKey);
|
|
614
614
|
if (typeof e == "string" && e.length)
|
|
615
615
|
return e;
|
|
616
616
|
}
|
|
@@ -624,12 +624,12 @@ const De = (n, e, t) => {
|
|
|
624
624
|
return Number.isNaN(s) ? !1 : Date.now() >= s - this.refreshExpirySkewMs;
|
|
625
625
|
}
|
|
626
626
|
clearStoredSession() {
|
|
627
|
-
|
|
627
|
+
P(this.userKey), P(this.rememberKey), P(this.refreshTokenKey), P(this.accessTokenExpiresAtKey);
|
|
628
628
|
}
|
|
629
629
|
storeSession(e, t) {
|
|
630
|
-
|
|
630
|
+
W(this.userKey, e.token);
|
|
631
631
|
const s = e.refreshToken === void 0 ? t : e.refreshToken;
|
|
632
|
-
typeof s == "string" && s.length ?
|
|
632
|
+
typeof s == "string" && s.length ? W(this.refreshTokenKey, s) : P(this.refreshTokenKey), typeof e.accessTokenExpiresAt == "string" && e.accessTokenExpiresAt.length ? W(this.accessTokenExpiresAtKey, e.accessTokenExpiresAt) : P(this.accessTokenExpiresAtKey);
|
|
633
633
|
}
|
|
634
634
|
async refreshAccessTokenWithMutex() {
|
|
635
635
|
const e = this.getRefreshToken();
|
|
@@ -638,29 +638,29 @@ const De = (n, e, t) => {
|
|
|
638
638
|
status: 401,
|
|
639
639
|
message: "Missing refresh token"
|
|
640
640
|
};
|
|
641
|
-
const t = this.getRefreshLockKey(), s =
|
|
641
|
+
const t = this.getRefreshLockKey(), s = se.refreshInFlight.get(t);
|
|
642
642
|
if (s) {
|
|
643
643
|
await s;
|
|
644
644
|
return;
|
|
645
645
|
}
|
|
646
646
|
const r = (async () => {
|
|
647
|
-
const { data:
|
|
647
|
+
const { data: i, status: o, error: c } = await be(
|
|
648
648
|
this.buildUrl(this.refreshEndpoint),
|
|
649
|
-
|
|
649
|
+
F.POST,
|
|
650
650
|
{ refreshToken: e }
|
|
651
651
|
);
|
|
652
|
-
if (c || !(
|
|
652
|
+
if (c || !(i != null && i.token))
|
|
653
653
|
throw this.clearStoredSession(), c ?? {
|
|
654
|
-
status:
|
|
654
|
+
status: o,
|
|
655
655
|
message: "Unable to refresh session"
|
|
656
656
|
};
|
|
657
|
-
this.storeSession(
|
|
657
|
+
this.storeSession(i, e);
|
|
658
658
|
})();
|
|
659
|
-
|
|
659
|
+
se.refreshInFlight.set(t, r);
|
|
660
660
|
try {
|
|
661
661
|
await r;
|
|
662
662
|
} finally {
|
|
663
|
-
|
|
663
|
+
se.refreshInFlight.delete(t);
|
|
664
664
|
}
|
|
665
665
|
}
|
|
666
666
|
isRequestOptions(e) {
|
|
@@ -673,33 +673,33 @@ const De = (n, e, t) => {
|
|
|
673
673
|
return e ? e instanceof Headers ? Object.fromEntries(e.entries()) : Array.isArray(e) ? Object.fromEntries(e) : e : {};
|
|
674
674
|
}
|
|
675
675
|
mergeRequestConfig(e) {
|
|
676
|
-
const t = this.secured ? this.tokenAcquirer() : void 0, s = this.toRequestOptions(t), r = this.toRequestOptions(e),
|
|
676
|
+
const t = this.secured ? this.tokenAcquirer() : void 0, s = this.toRequestOptions(t), r = this.toRequestOptions(e), i = {
|
|
677
677
|
...this.toHeaderRecord(s.headers),
|
|
678
678
|
...this.toHeaderRecord(r.headers)
|
|
679
|
-
},
|
|
680
|
-
if (
|
|
681
|
-
return c ? { headers:
|
|
682
|
-
if (c) return
|
|
679
|
+
}, o = r.credentials ?? s.credentials, c = Object.keys(i).length > 0;
|
|
680
|
+
if (o)
|
|
681
|
+
return c ? { headers: i, credentials: o } : { credentials: o };
|
|
682
|
+
if (c) return i;
|
|
683
683
|
}
|
|
684
684
|
async makeRequestWithRefresh(e, t, s, r) {
|
|
685
685
|
this.secured && this.shouldRefreshBeforeRequest() && await this.refreshAccessTokenWithMutex();
|
|
686
|
-
let
|
|
686
|
+
let i = await be(
|
|
687
687
|
this.buildUrl(e),
|
|
688
688
|
t,
|
|
689
689
|
s,
|
|
690
690
|
this.mergeRequestConfig(r)
|
|
691
691
|
);
|
|
692
|
-
return this.secured &&
|
|
692
|
+
return this.secured && i.status === 401 && this.canRefresh() && (await this.refreshAccessTokenWithMutex(), i = await be(
|
|
693
693
|
this.buildUrl(e),
|
|
694
694
|
t,
|
|
695
695
|
s,
|
|
696
696
|
this.mergeRequestConfig(r)
|
|
697
|
-
)),
|
|
697
|
+
)), i;
|
|
698
698
|
}
|
|
699
|
-
async doQuery(e, t =
|
|
699
|
+
async doQuery(e, t = F.GET, s, r) {
|
|
700
700
|
const {
|
|
701
|
-
data:
|
|
702
|
-
status:
|
|
701
|
+
data: i,
|
|
702
|
+
status: o,
|
|
703
703
|
error: c
|
|
704
704
|
} = await this.makeRequestWithRefresh(
|
|
705
705
|
e,
|
|
@@ -707,12 +707,12 @@ const De = (n, e, t) => {
|
|
|
707
707
|
s,
|
|
708
708
|
r
|
|
709
709
|
);
|
|
710
|
-
if (c ||
|
|
710
|
+
if (c || o < 200 || o >= 300)
|
|
711
711
|
throw c ?? {
|
|
712
|
-
status:
|
|
713
|
-
message: String(
|
|
712
|
+
status: o,
|
|
713
|
+
message: String(o)
|
|
714
714
|
};
|
|
715
|
-
return
|
|
715
|
+
return i;
|
|
716
716
|
}
|
|
717
717
|
/**
|
|
718
718
|
* @description Get all objects
|
|
@@ -721,20 +721,20 @@ const De = (n, e, t) => {
|
|
|
721
721
|
* @returns Result list
|
|
722
722
|
*/
|
|
723
723
|
async get(e, t, s) {
|
|
724
|
-
const r =
|
|
725
|
-
data:
|
|
726
|
-
error:
|
|
724
|
+
const r = Pe(e, t, s), {
|
|
725
|
+
data: i,
|
|
726
|
+
error: o,
|
|
727
727
|
status: c
|
|
728
728
|
} = await this.makeRequestWithRefresh(
|
|
729
729
|
r,
|
|
730
|
-
|
|
730
|
+
F.GET
|
|
731
731
|
);
|
|
732
|
-
if (
|
|
733
|
-
throw
|
|
732
|
+
if (o || c < 200 || c >= 300 || !i)
|
|
733
|
+
throw o ?? {
|
|
734
734
|
status: c,
|
|
735
735
|
message: String(c)
|
|
736
736
|
};
|
|
737
|
-
return
|
|
737
|
+
return i;
|
|
738
738
|
}
|
|
739
739
|
/**
|
|
740
740
|
* @description Get entity by id
|
|
@@ -746,15 +746,15 @@ const De = (n, e, t) => {
|
|
|
746
746
|
const {
|
|
747
747
|
error: s,
|
|
748
748
|
data: r,
|
|
749
|
-
status:
|
|
749
|
+
status: i
|
|
750
750
|
} = await this.makeRequestWithRefresh(
|
|
751
751
|
e,
|
|
752
|
-
|
|
752
|
+
F.PATCH,
|
|
753
753
|
t
|
|
754
754
|
);
|
|
755
755
|
if (s || r === null || r === void 0)
|
|
756
756
|
throw s ?? {
|
|
757
|
-
status:
|
|
757
|
+
status: i,
|
|
758
758
|
message: "Unknown error"
|
|
759
759
|
};
|
|
760
760
|
return r;
|
|
@@ -768,15 +768,15 @@ const De = (n, e, t) => {
|
|
|
768
768
|
const {
|
|
769
769
|
error: s,
|
|
770
770
|
data: r,
|
|
771
|
-
status:
|
|
771
|
+
status: i
|
|
772
772
|
} = await this.makeRequestWithRefresh(
|
|
773
773
|
e,
|
|
774
|
-
|
|
774
|
+
F.DELETE,
|
|
775
775
|
t
|
|
776
776
|
);
|
|
777
777
|
if (s || r === null || r === void 0)
|
|
778
778
|
throw s ?? {
|
|
779
|
-
status:
|
|
779
|
+
status: i,
|
|
780
780
|
message: "Unknown error"
|
|
781
781
|
};
|
|
782
782
|
return r;
|
|
@@ -791,39 +791,39 @@ const De = (n, e, t) => {
|
|
|
791
791
|
const {
|
|
792
792
|
error: s,
|
|
793
793
|
data: r,
|
|
794
|
-
status:
|
|
794
|
+
status: i
|
|
795
795
|
} = await this.makeRequestWithRefresh(
|
|
796
796
|
e,
|
|
797
|
-
|
|
797
|
+
F.POST,
|
|
798
798
|
t
|
|
799
799
|
);
|
|
800
800
|
if (s || r === null || r === void 0)
|
|
801
801
|
throw s ?? {
|
|
802
|
-
status:
|
|
802
|
+
status: i,
|
|
803
803
|
message: "Unknown error"
|
|
804
804
|
};
|
|
805
805
|
return r;
|
|
806
806
|
}
|
|
807
807
|
};
|
|
808
|
-
|
|
809
|
-
let
|
|
810
|
-
class
|
|
808
|
+
L(se, "refreshInFlight", /* @__PURE__ */ new Map());
|
|
809
|
+
let me = se;
|
|
810
|
+
class Kt {
|
|
811
811
|
constructor(e, t = "user", s = {}) {
|
|
812
|
-
|
|
813
|
-
this.api = new
|
|
812
|
+
L(this, "api");
|
|
813
|
+
this.api = new me(e, t, !1, void 0, s);
|
|
814
814
|
}
|
|
815
815
|
async login(e) {
|
|
816
816
|
const t = "auth/sign-in", s = e;
|
|
817
817
|
return await this.api.doQuery(
|
|
818
818
|
t,
|
|
819
|
-
|
|
819
|
+
F.POST,
|
|
820
820
|
s
|
|
821
821
|
);
|
|
822
822
|
}
|
|
823
823
|
async refresh(e) {
|
|
824
824
|
return await this.api.doQuery(
|
|
825
825
|
"auth/refresh",
|
|
826
|
-
|
|
826
|
+
F.POST,
|
|
827
827
|
e
|
|
828
828
|
);
|
|
829
829
|
}
|
|
@@ -833,7 +833,7 @@ class Mt {
|
|
|
833
833
|
} : void 0, r = e != null && e.refreshToken ? { refreshToken: e.refreshToken } : void 0;
|
|
834
834
|
return await this.api.doQuery(
|
|
835
835
|
t,
|
|
836
|
-
|
|
836
|
+
F.POST,
|
|
837
837
|
r,
|
|
838
838
|
s
|
|
839
839
|
);
|
|
@@ -841,23 +841,23 @@ class Mt {
|
|
|
841
841
|
async register(e) {
|
|
842
842
|
return await this.api.doQuery(
|
|
843
843
|
"auth/sign-up",
|
|
844
|
-
|
|
844
|
+
F.POST,
|
|
845
845
|
e
|
|
846
846
|
);
|
|
847
847
|
}
|
|
848
848
|
async getSession() {
|
|
849
849
|
return await this.api.doQuery(
|
|
850
850
|
"auth/session",
|
|
851
|
-
|
|
851
|
+
F.GET,
|
|
852
852
|
void 0,
|
|
853
853
|
this.api.defaultTokenAcquirer()
|
|
854
854
|
);
|
|
855
855
|
}
|
|
856
856
|
}
|
|
857
|
-
class
|
|
857
|
+
class Ts {
|
|
858
858
|
constructor(e, t, s = {}) {
|
|
859
|
-
|
|
860
|
-
this.auth = new
|
|
859
|
+
L(this, "auth");
|
|
860
|
+
this.auth = new Kt(e, t, s);
|
|
861
861
|
}
|
|
862
862
|
/**
|
|
863
863
|
* @returns auth
|
|
@@ -866,17 +866,17 @@ class ws {
|
|
|
866
866
|
return this.auth;
|
|
867
867
|
}
|
|
868
868
|
}
|
|
869
|
-
class
|
|
869
|
+
class Ns {
|
|
870
870
|
/**
|
|
871
871
|
*
|
|
872
872
|
* @param table
|
|
873
873
|
* @param secured to see if the api client requires jwt protection
|
|
874
874
|
*/
|
|
875
|
-
constructor(e, t, s = "user", r = !0,
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
this.table = e, this.secured = r, this.api = new
|
|
875
|
+
constructor(e, t, s = "user", r = !0, i = {}) {
|
|
876
|
+
L(this, "table");
|
|
877
|
+
L(this, "secured");
|
|
878
|
+
L(this, "api");
|
|
879
|
+
this.table = e, this.secured = r, this.api = new me(t, s, r, void 0, i);
|
|
880
880
|
}
|
|
881
881
|
/**
|
|
882
882
|
*
|
|
@@ -894,7 +894,7 @@ class ks {
|
|
|
894
894
|
async insertMany(e) {
|
|
895
895
|
return await this.api.doQuery(
|
|
896
896
|
`${this.table}/batch`,
|
|
897
|
-
|
|
897
|
+
F.POST,
|
|
898
898
|
e
|
|
899
899
|
);
|
|
900
900
|
}
|
|
@@ -924,12 +924,12 @@ class ks {
|
|
|
924
924
|
* @returns - List of elements
|
|
925
925
|
*/
|
|
926
926
|
async export(e) {
|
|
927
|
-
const t =
|
|
927
|
+
const t = Pe(
|
|
928
928
|
`${this.table}/export`,
|
|
929
929
|
void 0,
|
|
930
930
|
e
|
|
931
931
|
);
|
|
932
|
-
return await this.api.doQuery(t,
|
|
932
|
+
return await this.api.doQuery(t, F.GET, void 0);
|
|
933
933
|
}
|
|
934
934
|
/**
|
|
935
935
|
*
|
|
@@ -939,7 +939,7 @@ class ks {
|
|
|
939
939
|
async import(e) {
|
|
940
940
|
return await this.api.doQuery(
|
|
941
941
|
`${this.table}/import`,
|
|
942
|
-
|
|
942
|
+
F.POST,
|
|
943
943
|
e
|
|
944
944
|
);
|
|
945
945
|
}
|
|
@@ -951,7 +951,7 @@ class ks {
|
|
|
951
951
|
async commonGet(e) {
|
|
952
952
|
return await this.api.doQuery(
|
|
953
953
|
Pt(`${this.table}/common`, e),
|
|
954
|
-
|
|
954
|
+
F.GET
|
|
955
955
|
);
|
|
956
956
|
}
|
|
957
957
|
/**
|
|
@@ -969,12 +969,12 @@ class ks {
|
|
|
969
969
|
return await this.api.patch(`${this.table}/restore`, e);
|
|
970
970
|
}
|
|
971
971
|
}
|
|
972
|
-
class
|
|
972
|
+
class Es {
|
|
973
973
|
constructor(e, t, s = 1) {
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
974
|
+
L(this, "table");
|
|
975
|
+
L(this, "dbName");
|
|
976
|
+
L(this, "version");
|
|
977
|
+
L(this, "db", null);
|
|
978
978
|
this.table = e, this.dbName = t, this.version = s;
|
|
979
979
|
}
|
|
980
980
|
close() {
|
|
@@ -984,8 +984,8 @@ class Ss {
|
|
|
984
984
|
return this.db ? Promise.resolve(this.db) : new Promise((e, t) => {
|
|
985
985
|
const s = indexedDB.open(this.dbName, this.version);
|
|
986
986
|
s.onupgradeneeded = (r) => {
|
|
987
|
-
const
|
|
988
|
-
|
|
987
|
+
const i = r.target.result;
|
|
988
|
+
i.objectStoreNames.contains(this.table) || i.createObjectStore(this.table, {
|
|
989
989
|
keyPath: "id",
|
|
990
990
|
autoIncrement: !0
|
|
991
991
|
});
|
|
@@ -1021,27 +1021,27 @@ class Ss {
|
|
|
1021
1021
|
const s = typeof e == "number" ? t : e;
|
|
1022
1022
|
if (!s)
|
|
1023
1023
|
throw new Error("IndexedDBClient.update requires a value payload");
|
|
1024
|
-
const r = typeof e == "number" ? { ...s, id: s.id ?? e } : s,
|
|
1025
|
-
return await this.request(
|
|
1024
|
+
const r = typeof e == "number" ? { ...s, id: s.id ?? e } : s, i = await this.transaction("readwrite");
|
|
1025
|
+
return await this.request(i.put(r)), r;
|
|
1026
1026
|
}
|
|
1027
1027
|
async get(e, t) {
|
|
1028
|
-
var
|
|
1029
|
-
const s = await this.transaction("readonly"), r = await this.request(s.getAll()),
|
|
1030
|
-
|
|
1031
|
-
const g = p[
|
|
1028
|
+
var h;
|
|
1029
|
+
const s = await this.transaction("readonly"), r = await this.request(s.getAll()), i = this.applyFilter(r, t), o = (e == null ? void 0 : e.sortingBy) ?? "id", c = ((h = e == null ? void 0 : e.sortingOrder) == null ? void 0 : h.toLowerCase()) ?? "asc";
|
|
1030
|
+
i.sort((p, y) => {
|
|
1031
|
+
const g = p[o], b = y[o];
|
|
1032
1032
|
return g < b ? c === "asc" ? -1 : 1 : g > b ? c === "asc" ? 1 : -1 : 0;
|
|
1033
1033
|
});
|
|
1034
|
-
const a = (e == null ? void 0 : e.pageSize) ?? 10,
|
|
1035
|
-
|
|
1036
|
-
|
|
1034
|
+
const a = (e == null ? void 0 : e.pageSize) ?? 10, u = (e == null ? void 0 : e.currentPage) ?? 0, l = i.length, d = Math.ceil(l / a), m = i.slice(
|
|
1035
|
+
u * a,
|
|
1036
|
+
u * a + a
|
|
1037
1037
|
);
|
|
1038
1038
|
return {
|
|
1039
|
-
sort:
|
|
1039
|
+
sort: o,
|
|
1040
1040
|
order: c,
|
|
1041
|
-
currentPage:
|
|
1041
|
+
currentPage: u,
|
|
1042
1042
|
pageSize: a,
|
|
1043
|
-
totalElements:
|
|
1044
|
-
totalPages:
|
|
1043
|
+
totalElements: l,
|
|
1044
|
+
totalPages: d,
|
|
1045
1045
|
items: m
|
|
1046
1046
|
};
|
|
1047
1047
|
}
|
|
@@ -1069,8 +1069,8 @@ class Ss {
|
|
|
1069
1069
|
const t = await this.transaction("readwrite");
|
|
1070
1070
|
let s = 0;
|
|
1071
1071
|
for (const r of e) {
|
|
1072
|
-
const
|
|
1073
|
-
|
|
1072
|
+
const i = await this.request(t.get(r));
|
|
1073
|
+
i && (await this.request(t.put({ ...i, deletedAt: /* @__PURE__ */ new Date() })), s++);
|
|
1074
1074
|
}
|
|
1075
1075
|
return s;
|
|
1076
1076
|
}
|
|
@@ -1078,17 +1078,17 @@ class Ss {
|
|
|
1078
1078
|
const t = await this.transaction("readwrite");
|
|
1079
1079
|
let s = 0;
|
|
1080
1080
|
for (const r of e) {
|
|
1081
|
-
const
|
|
1082
|
-
|
|
1081
|
+
const i = await this.request(t.get(r));
|
|
1082
|
+
i && (await this.request(t.put({ ...i, deletedAt: null })), s++);
|
|
1083
1083
|
}
|
|
1084
1084
|
return s;
|
|
1085
1085
|
}
|
|
1086
1086
|
applyFilter(e, t) {
|
|
1087
1087
|
return t ? e.filter(
|
|
1088
1088
|
(s) => Object.entries(t).every(
|
|
1089
|
-
([r,
|
|
1089
|
+
([r, i]) => this.matchesFilterValue(
|
|
1090
1090
|
r,
|
|
1091
|
-
|
|
1091
|
+
i,
|
|
1092
1092
|
s[r]
|
|
1093
1093
|
)
|
|
1094
1094
|
)
|
|
@@ -1103,13 +1103,13 @@ class Ss {
|
|
|
1103
1103
|
return s === t;
|
|
1104
1104
|
}
|
|
1105
1105
|
}
|
|
1106
|
-
function
|
|
1106
|
+
function $s(n) {
|
|
1107
1107
|
return Object.keys(n).filter((e) => isNaN(Number(e))).map((e) => ({
|
|
1108
1108
|
key: e,
|
|
1109
1109
|
value: n[e]
|
|
1110
1110
|
}));
|
|
1111
1111
|
}
|
|
1112
|
-
const
|
|
1112
|
+
const X = (n, e = "") => {
|
|
1113
1113
|
const t = localStorage.getItem(n) ?? void 0;
|
|
1114
1114
|
if (t && e.length)
|
|
1115
1115
|
switch (e) {
|
|
@@ -1123,11 +1123,11 @@ const z = (n, e = "") => {
|
|
|
1123
1123
|
return t;
|
|
1124
1124
|
}
|
|
1125
1125
|
return t;
|
|
1126
|
-
},
|
|
1126
|
+
}, W = (n, e) => localStorage.setItem(
|
|
1127
1127
|
n,
|
|
1128
1128
|
typeof e == "object" ? JSON.stringify(e) : e
|
|
1129
|
-
),
|
|
1130
|
-
function
|
|
1129
|
+
), P = (n) => localStorage.removeItem(n);
|
|
1130
|
+
function xs(n) {
|
|
1131
1131
|
const e = n ? new Date(n) : /* @__PURE__ */ new Date(), t = {
|
|
1132
1132
|
weekday: "long",
|
|
1133
1133
|
// martes
|
|
@@ -1149,41 +1149,41 @@ function Cs(n) {
|
|
|
1149
1149
|
t
|
|
1150
1150
|
);
|
|
1151
1151
|
}
|
|
1152
|
-
function
|
|
1153
|
-
const e = n ? new Date(n) : /* @__PURE__ */ new Date(), t = String(e.getDate()).padStart(2, "0"), s = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getFullYear()).slice(-2),
|
|
1154
|
-
return `${t}/${s}/${r} ${
|
|
1152
|
+
function As(n) {
|
|
1153
|
+
const e = n ? new Date(n) : /* @__PURE__ */ new Date(), t = String(e.getDate()).padStart(2, "0"), s = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getFullYear()).slice(-2), i = String(e.getHours()).padStart(2, "0"), o = String(e.getMinutes()).padStart(2, "0");
|
|
1154
|
+
return `${t}/${s}/${r} ${i}:${o}`;
|
|
1155
1155
|
}
|
|
1156
|
-
function
|
|
1157
|
-
const e = n ? new Date(n) : /* @__PURE__ */ new Date(), t = e.getFullYear(), s = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0"),
|
|
1158
|
-
return `${t}-${s}-${r}T${
|
|
1156
|
+
function Ls(n) {
|
|
1157
|
+
const e = n ? new Date(n) : /* @__PURE__ */ new Date(), t = e.getFullYear(), s = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0"), i = String(e.getHours()).padStart(2, "0"), o = String(e.getMinutes()).padStart(2, "0");
|
|
1158
|
+
return `${t}-${s}-${r}T${i}:${o}`;
|
|
1159
1159
|
}
|
|
1160
|
-
const
|
|
1160
|
+
const qt = () => {
|
|
1161
1161
|
var t;
|
|
1162
1162
|
const n = navigator, e = ((t = n == null ? void 0 : n.userAgentData) == null ? void 0 : t.platform) || (n == null ? void 0 : n.platform) || "";
|
|
1163
1163
|
return /Mac|iPhone|iPod|iPad/i.test(e);
|
|
1164
1164
|
};
|
|
1165
|
-
function
|
|
1165
|
+
function he(n) {
|
|
1166
1166
|
if (!n || typeof n != "object") return !1;
|
|
1167
1167
|
const e = n;
|
|
1168
1168
|
return Array.isArray(e.errors) && e.errors.every(
|
|
1169
1169
|
(t) => Array.isArray(t) && t.length === 2 && typeof t[0] == "string"
|
|
1170
1170
|
);
|
|
1171
1171
|
}
|
|
1172
|
-
function
|
|
1172
|
+
function fe(n) {
|
|
1173
1173
|
if (!n || typeof n != "object") return !1;
|
|
1174
1174
|
const e = n;
|
|
1175
1175
|
return typeof (e == null ? void 0 : e.status) == "number" && typeof (e == null ? void 0 : e.message) == "string";
|
|
1176
1176
|
}
|
|
1177
|
-
function
|
|
1177
|
+
function _s(n, e) {
|
|
1178
1178
|
return n != null && n.errors ? n.errors.map(([t, s]) => e(t, s)) : [];
|
|
1179
1179
|
}
|
|
1180
|
-
const
|
|
1180
|
+
const Ke = re(
|
|
1181
1181
|
void 0
|
|
1182
1182
|
);
|
|
1183
|
-
function
|
|
1184
|
-
const { children: e } = n, t =
|
|
1185
|
-
(m,
|
|
1186
|
-
const { type: p, items: y, id: g } =
|
|
1183
|
+
function Rs(n) {
|
|
1184
|
+
const { children: e } = n, t = M(0), [s, r] = Le(
|
|
1185
|
+
(m, h) => {
|
|
1186
|
+
const { type: p, items: y, id: g } = h;
|
|
1187
1187
|
switch (p) {
|
|
1188
1188
|
case "set":
|
|
1189
1189
|
return y ?? [];
|
|
@@ -1194,46 +1194,46 @@ function $s(n) {
|
|
|
1194
1194
|
},
|
|
1195
1195
|
[],
|
|
1196
1196
|
() => []
|
|
1197
|
-
),
|
|
1197
|
+
), i = (m) => m.map((h) => ({ ...h, id: t.current++ })), o = w(
|
|
1198
1198
|
(m) => r({
|
|
1199
1199
|
type: "set",
|
|
1200
|
-
items:
|
|
1200
|
+
items: i([{ ...m, type: R.error }])
|
|
1201
1201
|
}),
|
|
1202
1202
|
[]
|
|
1203
1203
|
), c = w(
|
|
1204
|
-
(m) => r({ type: "set", items:
|
|
1204
|
+
(m) => r({ type: "set", items: i([{ ...m }]) }),
|
|
1205
1205
|
[]
|
|
1206
1206
|
), a = w(
|
|
1207
|
-
(m) => r({ type: "set", items:
|
|
1207
|
+
(m) => r({ type: "set", items: i(m) }),
|
|
1208
1208
|
[]
|
|
1209
|
-
),
|
|
1209
|
+
), u = w(
|
|
1210
1210
|
(m) => r({
|
|
1211
1211
|
type: "set",
|
|
1212
|
-
items:
|
|
1212
|
+
items: i([{ ...m, type: R.success }])
|
|
1213
1213
|
}),
|
|
1214
1214
|
[]
|
|
1215
|
-
),
|
|
1215
|
+
), l = (m) => r({ type: "remove", id: m }), d = Q(() => ({
|
|
1216
1216
|
notification: s,
|
|
1217
|
-
removeNotification:
|
|
1218
|
-
showErrorNotification:
|
|
1217
|
+
removeNotification: l,
|
|
1218
|
+
showErrorNotification: o,
|
|
1219
1219
|
showNotification: c,
|
|
1220
|
-
showSuccessNotification:
|
|
1220
|
+
showSuccessNotification: u,
|
|
1221
1221
|
showStackNotifications: a
|
|
1222
1222
|
}), [
|
|
1223
1223
|
s,
|
|
1224
|
-
|
|
1224
|
+
o,
|
|
1225
1225
|
c,
|
|
1226
1226
|
a,
|
|
1227
|
-
|
|
1227
|
+
u
|
|
1228
1228
|
]);
|
|
1229
|
-
return /* @__PURE__ */
|
|
1229
|
+
return /* @__PURE__ */ f(Ke.Provider, { value: d, children: e });
|
|
1230
1230
|
}
|
|
1231
|
-
const
|
|
1232
|
-
const n =
|
|
1231
|
+
const ee = () => {
|
|
1232
|
+
const n = ie(Ke);
|
|
1233
1233
|
if (!n)
|
|
1234
1234
|
throw new Error("NotificationContext must be used within a Provider");
|
|
1235
1235
|
return n;
|
|
1236
|
-
},
|
|
1236
|
+
}, qe = () => new xt({
|
|
1237
1237
|
defaultOptions: {
|
|
1238
1238
|
queries: {
|
|
1239
1239
|
refetchInterval: !1,
|
|
@@ -1245,102 +1245,102 @@ const J = () => {
|
|
|
1245
1245
|
// default: true
|
|
1246
1246
|
}
|
|
1247
1247
|
}
|
|
1248
|
-
}),
|
|
1248
|
+
}), Is = qe(), Ue = re(
|
|
1249
1249
|
void 0
|
|
1250
|
-
),
|
|
1251
|
-
const { children: e, manager: t, queryClient: s } = n, [r] =
|
|
1252
|
-
return /* @__PURE__ */
|
|
1253
|
-
},
|
|
1254
|
-
const n =
|
|
1250
|
+
), Fs = (n) => {
|
|
1251
|
+
const { children: e, manager: t, queryClient: s } = n, [r] = _(qe), i = s ?? r;
|
|
1252
|
+
return /* @__PURE__ */ f(Ue.Provider, { value: { client: t }, children: /* @__PURE__ */ f(At, { client: i, children: e }) });
|
|
1253
|
+
}, Ut = () => {
|
|
1254
|
+
const n = ie(Ue);
|
|
1255
1255
|
if (!n)
|
|
1256
1256
|
throw new Error("managerContext must be used within a Provider");
|
|
1257
1257
|
return n.client;
|
|
1258
|
-
},
|
|
1258
|
+
}, je = re(
|
|
1259
1259
|
void 0
|
|
1260
|
-
),
|
|
1260
|
+
), Os = (n) => {
|
|
1261
1261
|
const {
|
|
1262
1262
|
children: e,
|
|
1263
1263
|
guestMode: t = "guest_mode",
|
|
1264
1264
|
user: s = "user",
|
|
1265
1265
|
remember: r = "remember",
|
|
1266
|
-
refreshTokenKey:
|
|
1267
|
-
accessTokenExpiresAtKey:
|
|
1268
|
-
} = n, c =
|
|
1269
|
-
|
|
1270
|
-
}, [
|
|
1266
|
+
refreshTokenKey: i = "refreshToken",
|
|
1267
|
+
accessTokenExpiresAtKey: o = "accessTokenExpiresAt"
|
|
1268
|
+
} = n, c = Ut(), [a, u] = _({}), l = w(() => {
|
|
1269
|
+
P(s), P(r), P(i), P(o);
|
|
1270
|
+
}, [o, i, r, s]), d = w(() => !!X(t, "boolean") && a.token === void 0, [a.token, t]), m = w(
|
|
1271
1271
|
(b) => {
|
|
1272
|
-
|
|
1272
|
+
W(t, b);
|
|
1273
1273
|
},
|
|
1274
1274
|
[t]
|
|
1275
|
-
),
|
|
1276
|
-
(b,
|
|
1275
|
+
), h = w(
|
|
1276
|
+
(b, S) => {
|
|
1277
1277
|
if (!b) return;
|
|
1278
|
-
const
|
|
1279
|
-
|
|
1278
|
+
const E = X(r, "boolean"), v = S ?? (typeof E == "boolean" ? E : !1);
|
|
1279
|
+
u(b), P(t), W(s, b.token), W(r, v), typeof b.refreshToken == "string" && b.refreshToken.length ? W(i, b.refreshToken) : P(i), typeof b.accessTokenExpiresAt == "string" && b.accessTokenExpiresAt.length ? W(o, b.accessTokenExpiresAt) : P(o);
|
|
1280
1280
|
},
|
|
1281
|
-
[
|
|
1281
|
+
[o, t, i, r, s]
|
|
1282
1282
|
), p = w(async () => {
|
|
1283
|
-
const b =
|
|
1283
|
+
const b = X(s) ?? a.token, S = X(i) ?? (typeof a.refreshToken == "string" ? a.refreshToken : void 0);
|
|
1284
1284
|
try {
|
|
1285
1285
|
await c.Auth.logout({
|
|
1286
1286
|
accessToken: b,
|
|
1287
|
-
refreshToken:
|
|
1287
|
+
refreshToken: S
|
|
1288
1288
|
});
|
|
1289
|
-
} catch (
|
|
1290
|
-
console.error(
|
|
1289
|
+
} catch (E) {
|
|
1290
|
+
console.error(E);
|
|
1291
1291
|
}
|
|
1292
|
-
|
|
1292
|
+
u({}), l();
|
|
1293
1293
|
}, [
|
|
1294
1294
|
a.refreshToken,
|
|
1295
1295
|
a.token,
|
|
1296
|
-
|
|
1296
|
+
l,
|
|
1297
1297
|
c.Auth,
|
|
1298
|
-
|
|
1298
|
+
i,
|
|
1299
1299
|
s
|
|
1300
1300
|
]), y = w(async () => {
|
|
1301
1301
|
try {
|
|
1302
1302
|
const b = await c.Auth.getSession();
|
|
1303
|
-
|
|
1303
|
+
h(b);
|
|
1304
1304
|
} catch (b) {
|
|
1305
1305
|
console.error(b), p();
|
|
1306
1306
|
}
|
|
1307
|
-
}, [
|
|
1307
|
+
}, [h, p, c.Auth]), g = Q(() => ({
|
|
1308
1308
|
account: a,
|
|
1309
|
-
logUser:
|
|
1309
|
+
logUser: h,
|
|
1310
1310
|
logoutUser: p,
|
|
1311
1311
|
logUserFromLocal: y,
|
|
1312
|
-
isInGuestMode:
|
|
1312
|
+
isInGuestMode: d,
|
|
1313
1313
|
setGuestMode: m
|
|
1314
1314
|
}), [
|
|
1315
1315
|
a,
|
|
1316
|
-
|
|
1316
|
+
h,
|
|
1317
1317
|
p,
|
|
1318
1318
|
y,
|
|
1319
|
-
|
|
1319
|
+
d,
|
|
1320
1320
|
m
|
|
1321
1321
|
]);
|
|
1322
|
-
return /* @__PURE__ */
|
|
1323
|
-
},
|
|
1324
|
-
const n =
|
|
1322
|
+
return /* @__PURE__ */ f(je.Provider, { value: g, children: e });
|
|
1323
|
+
}, He = () => {
|
|
1324
|
+
const n = ie(je);
|
|
1325
1325
|
if (!n) throw new Error("authContext must be used within a Provider");
|
|
1326
1326
|
return n;
|
|
1327
|
-
},
|
|
1328
|
-
const { children: e, location: t, navigate: s, linkComponent: r, searchComponent:
|
|
1329
|
-
return /* @__PURE__ */
|
|
1330
|
-
|
|
1327
|
+
}, Qe = re({}), Ms = (n) => {
|
|
1328
|
+
const { children: e, location: t, navigate: s, linkComponent: r, searchComponent: i } = n;
|
|
1329
|
+
return /* @__PURE__ */ f(
|
|
1330
|
+
Qe.Provider,
|
|
1331
1331
|
{
|
|
1332
|
-
value: { location: t, navigate: s, linkComponent: r, searchComponent:
|
|
1332
|
+
value: { location: t, navigate: s, linkComponent: r, searchComponent: i },
|
|
1333
1333
|
children: e
|
|
1334
1334
|
}
|
|
1335
1335
|
);
|
|
1336
|
-
},
|
|
1337
|
-
const n =
|
|
1336
|
+
}, ce = () => {
|
|
1337
|
+
const n = ie(Qe);
|
|
1338
1338
|
if (n === void 0 || Object.keys(n).length === 0)
|
|
1339
1339
|
throw new Error(
|
|
1340
1340
|
"Config provider has not been set. This step is required and cannot be skipped."
|
|
1341
1341
|
);
|
|
1342
1342
|
return n;
|
|
1343
|
-
},
|
|
1343
|
+
}, jt = {
|
|
1344
1344
|
addChildItem: () => {
|
|
1345
1345
|
},
|
|
1346
1346
|
removeChildItem: () => {
|
|
@@ -1348,48 +1348,48 @@ const J = () => {
|
|
|
1348
1348
|
clearDynamicItems: () => {
|
|
1349
1349
|
},
|
|
1350
1350
|
dynamicItems: {}
|
|
1351
|
-
},
|
|
1352
|
-
|
|
1353
|
-
),
|
|
1354
|
-
const { children: e } = n, [t, s] =
|
|
1355
|
-
(a,
|
|
1356
|
-
...
|
|
1357
|
-
[a]: [...
|
|
1351
|
+
}, Ve = re(
|
|
1352
|
+
jt
|
|
1353
|
+
), Ds = (n) => {
|
|
1354
|
+
const { children: e } = n, [t, s] = _({}), r = w(
|
|
1355
|
+
(a, u) => s((l) => ({
|
|
1356
|
+
...l,
|
|
1357
|
+
[a]: [...l[a] ?? [], u]
|
|
1358
1358
|
})),
|
|
1359
1359
|
[]
|
|
1360
|
-
),
|
|
1361
|
-
(a,
|
|
1362
|
-
...
|
|
1363
|
-
[a]: (
|
|
1360
|
+
), i = w(
|
|
1361
|
+
(a, u) => s((l) => ({
|
|
1362
|
+
...l,
|
|
1363
|
+
[a]: (l[a] ?? []).filter((d, m) => m !== u)
|
|
1364
1364
|
})),
|
|
1365
1365
|
[]
|
|
1366
|
-
),
|
|
1367
|
-
s(a ? (
|
|
1368
|
-
...
|
|
1366
|
+
), o = w((a) => {
|
|
1367
|
+
s(a ? (u) => ({
|
|
1368
|
+
...u,
|
|
1369
1369
|
[a]: []
|
|
1370
1370
|
}) : {});
|
|
1371
1371
|
}, []), c = Q(
|
|
1372
1372
|
() => ({
|
|
1373
1373
|
dynamicItems: t,
|
|
1374
1374
|
addChildItem: r,
|
|
1375
|
-
removeChildItem:
|
|
1376
|
-
clearDynamicItems:
|
|
1375
|
+
removeChildItem: i,
|
|
1376
|
+
clearDynamicItems: o
|
|
1377
1377
|
}),
|
|
1378
|
-
[t,
|
|
1378
|
+
[t, o, i, r]
|
|
1379
1379
|
);
|
|
1380
|
-
return /* @__PURE__ */
|
|
1381
|
-
|
|
1380
|
+
return /* @__PURE__ */ f(
|
|
1381
|
+
Ve.Provider,
|
|
1382
1382
|
{
|
|
1383
1383
|
value: c,
|
|
1384
1384
|
children: e
|
|
1385
1385
|
}
|
|
1386
1386
|
);
|
|
1387
|
-
},
|
|
1388
|
-
function
|
|
1389
|
-
const { t: e } =
|
|
1390
|
-
const b = g.auth,
|
|
1391
|
-
return b == null || b &&
|
|
1392
|
-
}), [
|
|
1387
|
+
}, Ht = () => ie(Ve);
|
|
1388
|
+
function Ps(n) {
|
|
1389
|
+
const { t: e } = N(), { open: t, onClose: s, menuMap: r, logo: i } = n, { account: o } = He(), { dynamicItems: c } = Ht(), { linkComponent: a, location: u } = ce(), l = a, d = Q(() => r.filter((g) => {
|
|
1390
|
+
const b = g.auth, S = !!(o != null && o.email);
|
|
1391
|
+
return b == null || b && S || !b && !S;
|
|
1392
|
+
}), [o == null ? void 0 : o.email, r]), m = w(
|
|
1393
1393
|
(g) => {
|
|
1394
1394
|
g.key === "Escape" && t && s();
|
|
1395
1395
|
},
|
|
@@ -1398,16 +1398,16 @@ function Is(n) {
|
|
|
1398
1398
|
O(() => (document.addEventListener("keydown", m), () => {
|
|
1399
1399
|
document.removeEventListener("keydown", m);
|
|
1400
1400
|
}), [m]);
|
|
1401
|
-
const
|
|
1402
|
-
(g, b) => b ? g === `${
|
|
1403
|
-
[
|
|
1401
|
+
const h = w(
|
|
1402
|
+
(g, b) => b ? g === `${u.pathname}${u.search}` : g === u.pathname,
|
|
1403
|
+
[u.pathname, u.search]
|
|
1404
1404
|
), p = w(
|
|
1405
|
-
(g) => /* @__PURE__ */
|
|
1405
|
+
(g) => /* @__PURE__ */ f(
|
|
1406
1406
|
"li",
|
|
1407
1407
|
{
|
|
1408
|
-
className: `drawer-list-item-child ${
|
|
1409
|
-
children: g.path ? /* @__PURE__ */
|
|
1410
|
-
|
|
1408
|
+
className: `drawer-list-item-child ${h(g.path, !0) ? "active" : ""} animated`,
|
|
1409
|
+
children: g.path ? /* @__PURE__ */ f(
|
|
1410
|
+
l,
|
|
1411
1411
|
{
|
|
1412
1412
|
tabIndex: t ? 0 : -1,
|
|
1413
1413
|
to: g.path ?? "/",
|
|
@@ -1421,15 +1421,15 @@ function Is(n) {
|
|
|
1421
1421
|
},
|
|
1422
1422
|
g.id
|
|
1423
1423
|
),
|
|
1424
|
-
[
|
|
1425
|
-
), y = Q(() =>
|
|
1426
|
-
const
|
|
1424
|
+
[l, t, e, h]
|
|
1425
|
+
), y = Q(() => d.map((g, b) => {
|
|
1426
|
+
const S = g.page ?? String(b), E = `drawer-list-item ${h(g.path) ? "active" : ""} animated`;
|
|
1427
1427
|
if (g.type === "divider")
|
|
1428
|
-
return /* @__PURE__ */
|
|
1429
|
-
const
|
|
1430
|
-
return /* @__PURE__ */ k("li", { className:
|
|
1428
|
+
return /* @__PURE__ */ f("li", { className: E, children: /* @__PURE__ */ f("hr", { className: "drawer-divider" }) }, S);
|
|
1429
|
+
const v = g.children ?? (g.page && c ? c[g.page] : null);
|
|
1430
|
+
return /* @__PURE__ */ k("li", { className: E, children: [
|
|
1431
1431
|
/* @__PURE__ */ k(
|
|
1432
|
-
|
|
1432
|
+
l,
|
|
1433
1433
|
{
|
|
1434
1434
|
tabIndex: t ? 0 : -1,
|
|
1435
1435
|
to: g.path ?? "/",
|
|
@@ -1443,10 +1443,10 @@ function Is(n) {
|
|
|
1443
1443
|
]
|
|
1444
1444
|
}
|
|
1445
1445
|
),
|
|
1446
|
-
|
|
1447
|
-
] },
|
|
1448
|
-
}), [
|
|
1449
|
-
return /* @__PURE__ */
|
|
1446
|
+
v && /* @__PURE__ */ f("ul", { className: "drawer-children-list", children: v.map(p) })
|
|
1447
|
+
] }, S);
|
|
1448
|
+
}), [l, c, h, t, d, p, e]);
|
|
1449
|
+
return /* @__PURE__ */ f(
|
|
1450
1450
|
"div",
|
|
1451
1451
|
{
|
|
1452
1452
|
"aria-label": e("_accessibility:ariaLabels.closeMenu"),
|
|
@@ -1455,53 +1455,53 @@ function Is(n) {
|
|
|
1455
1455
|
onClick: () => s(),
|
|
1456
1456
|
children: /* @__PURE__ */ k("aside", { className: `${t ? "opened" : "closed"} drawer animated`, children: [
|
|
1457
1457
|
/* @__PURE__ */ k("div", { className: "drawer-header-container", children: [
|
|
1458
|
-
|
|
1459
|
-
/* @__PURE__ */
|
|
1458
|
+
i,
|
|
1459
|
+
/* @__PURE__ */ f("h2", { className: "drawer-header poppins", children: e("_pages:home.appName") })
|
|
1460
1460
|
] }),
|
|
1461
|
-
/* @__PURE__ */
|
|
1461
|
+
/* @__PURE__ */ f("ul", { className: "drawer-menu-list", children: y })
|
|
1462
1462
|
] })
|
|
1463
1463
|
}
|
|
1464
1464
|
);
|
|
1465
1465
|
}
|
|
1466
|
-
const
|
|
1467
|
-
var
|
|
1468
|
-
function
|
|
1469
|
-
if (
|
|
1470
|
-
|
|
1471
|
-
const n = (c, a = "local",
|
|
1466
|
+
const G = ({ icon: n, ...e }) => /* @__PURE__ */ f(ct, { icon: /* @__PURE__ */ f(K, { icon: n }), ...e });
|
|
1467
|
+
var we, $e;
|
|
1468
|
+
function Qt() {
|
|
1469
|
+
if ($e) return we;
|
|
1470
|
+
$e = 1;
|
|
1471
|
+
const n = (c, a = "local", u = void 0) => {
|
|
1472
1472
|
if (a === "local") {
|
|
1473
1473
|
if (localStorage.getItem(c) !== void 0 && localStorage.getItem(c) !== "undefined" && localStorage.getItem(c) !== null)
|
|
1474
|
-
return
|
|
1474
|
+
return u === void 0 || u !== void 0 && localStorage.getItem(c) === u;
|
|
1475
1475
|
} else if (a === "session" && sessionStorage.getItem(c) !== void 0 && sessionStorage.getItem(c) !== "undefined" && sessionStorage.getItem(c) !== null)
|
|
1476
|
-
return
|
|
1476
|
+
return u === void 0 || u !== void 0 && sessionStorage.getItem(c) === u;
|
|
1477
1477
|
return !1;
|
|
1478
1478
|
}, e = (c) => {
|
|
1479
1479
|
const a = {};
|
|
1480
|
-
return c.substring(1).split("&").forEach((
|
|
1481
|
-
const [
|
|
1482
|
-
a[
|
|
1480
|
+
return c.substring(1).split("&").forEach((l) => {
|
|
1481
|
+
const [d, m] = l.split("=");
|
|
1482
|
+
a[d] = m;
|
|
1483
1483
|
}), a;
|
|
1484
1484
|
}, t = (c = "") => {
|
|
1485
|
-
if (
|
|
1485
|
+
if (i(c) && c.length) return i(c);
|
|
1486
1486
|
{
|
|
1487
1487
|
let a = navigator.language || navigator.userLanguage;
|
|
1488
1488
|
if (a.indexOf("en") < 0 && a.indexOf("es") < 0 && (a = "en-US"), a = a.split("-")[0], a)
|
|
1489
1489
|
return c.length && r(c, 730, a), a;
|
|
1490
1490
|
}
|
|
1491
1491
|
return "en";
|
|
1492
|
-
}, s = (c = 0, a = 0,
|
|
1492
|
+
}, s = (c = 0, a = 0, u = window, l = "smooth") => u.scroll({
|
|
1493
1493
|
top: c,
|
|
1494
1494
|
left: a,
|
|
1495
|
-
behavior:
|
|
1496
|
-
}), r = (c, a,
|
|
1495
|
+
behavior: l
|
|
1496
|
+
}), r = (c, a, u, l = "/", d = "Lax") => {
|
|
1497
1497
|
var m = /* @__PURE__ */ new Date();
|
|
1498
1498
|
m.setTime(m.getTime() + a * 24 * 60 * 60 * 1e3);
|
|
1499
|
-
const
|
|
1500
|
-
document.cookie = `${c}=${
|
|
1501
|
-
},
|
|
1502
|
-
const a = `${c}=`,
|
|
1503
|
-
for (let
|
|
1504
|
-
let m = d
|
|
1499
|
+
const h = "; expires=" + m.toUTCString();
|
|
1500
|
+
document.cookie = `${c}=${u || ""}${h};path=${l};SameSite=${d}`;
|
|
1501
|
+
}, i = (c) => {
|
|
1502
|
+
const a = `${c}=`, l = decodeURIComponent(document.cookie).split(";");
|
|
1503
|
+
for (let d = 0; d < l.length; d += 1) {
|
|
1504
|
+
let m = l[d];
|
|
1505
1505
|
for (; m.charAt(0) === " "; )
|
|
1506
1506
|
m = m.substring(1);
|
|
1507
1507
|
if (m.indexOf(a) === 0)
|
|
@@ -1509,23 +1509,23 @@ function qt() {
|
|
|
1509
1509
|
}
|
|
1510
1510
|
return "";
|
|
1511
1511
|
};
|
|
1512
|
-
return
|
|
1513
|
-
getCookie:
|
|
1512
|
+
return we = {
|
|
1513
|
+
getCookie: i,
|
|
1514
1514
|
createCookie: r,
|
|
1515
1515
|
deleteCookie: (c) => document.cookie = `${c}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`,
|
|
1516
1516
|
getUserLanguage: t,
|
|
1517
1517
|
scrollTo: s,
|
|
1518
1518
|
parseQueries: e,
|
|
1519
1519
|
validation: n
|
|
1520
|
-
},
|
|
1520
|
+
}, we;
|
|
1521
1521
|
}
|
|
1522
|
-
var
|
|
1523
|
-
function
|
|
1524
|
-
const { t: n, language: e } =
|
|
1522
|
+
var Vt = Qt();
|
|
1523
|
+
function Ks() {
|
|
1524
|
+
const { t: n, language: e } = N();
|
|
1525
1525
|
return { timeAge: w(
|
|
1526
1526
|
(s) => {
|
|
1527
|
-
const
|
|
1528
|
-
return
|
|
1527
|
+
const i = /* @__PURE__ */ new Date() - s, o = Math.floor(i / (1e3 * 60)), c = Math.floor(o / 60), a = e === "es", u = n("_accessibility:labels.ago"), l = n("_accessibility:labels.minute"), d = n("_accessibility:labels.minutes"), m = n("_accessibility:labels.hour"), h = n("_accessibility:labels.hours"), p = n("_accessibility:labels.yesterday"), y = n("_accessibility:labels.justNow");
|
|
1528
|
+
return i < 1e3 * 60 ? y : o < 60 ? `${a ? u : ""} ${o} ${o === 1 ? l : d} ${a ? "" : u}` : c < 24 ? `${a ? u : ""} ${c} ${c === 1 ? m : h} ${a ? "" : u}` : c < 48 ? p : s.toLocaleDateString(navigator.language || "es-ES", {
|
|
1529
1529
|
day: "2-digit",
|
|
1530
1530
|
month: "2-digit",
|
|
1531
1531
|
year: "numeric"
|
|
@@ -1534,257 +1534,257 @@ function Ps() {
|
|
|
1534
1534
|
[n, e]
|
|
1535
1535
|
) };
|
|
1536
1536
|
}
|
|
1537
|
-
const
|
|
1538
|
-
const { showSuccessNotification: e } =
|
|
1539
|
-
|
|
1537
|
+
const Be = (n) => {
|
|
1538
|
+
const { showSuccessNotification: e } = ee(), { mutationFn: t, onError: s, onSuccess: r, onSuccessMessage: i } = n, [o, c] = _([]), { open: a, handleClose: u, handleOpen: l } = We(), d = () => {
|
|
1539
|
+
u(), c([]);
|
|
1540
1540
|
}, m = async (p) => {
|
|
1541
|
-
c(p),
|
|
1542
|
-
},
|
|
1541
|
+
c(p), l();
|
|
1542
|
+
}, h = Z({
|
|
1543
1543
|
mutationFn: () => t(
|
|
1544
|
-
Array.isArray(
|
|
1544
|
+
Array.isArray(o) ? o : [o]
|
|
1545
1545
|
),
|
|
1546
1546
|
onError: (p) => {
|
|
1547
|
-
console.error(p), s && s(p),
|
|
1547
|
+
console.error(p), s && s(p), d();
|
|
1548
1548
|
},
|
|
1549
1549
|
onSuccess: async (p) => {
|
|
1550
1550
|
r && r(p), e({
|
|
1551
|
-
message:
|
|
1552
|
-
}),
|
|
1551
|
+
message: i
|
|
1552
|
+
}), d();
|
|
1553
1553
|
}
|
|
1554
1554
|
});
|
|
1555
|
-
return { open: a, onClick: m, close:
|
|
1556
|
-
},
|
|
1557
|
-
const { t: e } =
|
|
1555
|
+
return { open: a, onClick: m, close: d, dialogFn: h, isLoading: h.isPending };
|
|
1556
|
+
}, qs = (n) => {
|
|
1557
|
+
const { t: e } = N(), {
|
|
1558
1558
|
showStackNotifications: t,
|
|
1559
1559
|
showSuccessNotification: s,
|
|
1560
1560
|
showErrorNotification: r
|
|
1561
|
-
} =
|
|
1562
|
-
defaultValues:
|
|
1561
|
+
} = ee(), i = J(), {
|
|
1562
|
+
defaultValues: o,
|
|
1563
1563
|
mutationFn: c,
|
|
1564
1564
|
formToDto: a,
|
|
1565
|
-
onError:
|
|
1566
|
-
onSuccess:
|
|
1567
|
-
queryKey:
|
|
1565
|
+
onError: u,
|
|
1566
|
+
onSuccess: l,
|
|
1567
|
+
queryKey: d,
|
|
1568
1568
|
onSuccessMessage: m
|
|
1569
|
-
} = n, { control:
|
|
1570
|
-
defaultValues:
|
|
1571
|
-
}),
|
|
1572
|
-
const
|
|
1573
|
-
if (!(
|
|
1574
|
-
|
|
1569
|
+
} = n, { control: h, handleSubmit: p, reset: y, setError: g, getValues: b, setValue: S } = Me({
|
|
1570
|
+
defaultValues: o
|
|
1571
|
+
}), E = M(null), v = w(() => {
|
|
1572
|
+
const C = document.activeElement;
|
|
1573
|
+
if (!(C instanceof HTMLElement)) {
|
|
1574
|
+
E.current = null;
|
|
1575
1575
|
return;
|
|
1576
1576
|
}
|
|
1577
|
-
|
|
1578
|
-
}, []),
|
|
1579
|
-
(
|
|
1580
|
-
const
|
|
1581
|
-
if (!
|
|
1582
|
-
let
|
|
1583
|
-
return
|
|
1584
|
-
const
|
|
1585
|
-
(
|
|
1586
|
-
}),
|
|
1577
|
+
E.current = C.closest("form");
|
|
1578
|
+
}, []), $ = w(
|
|
1579
|
+
(C) => {
|
|
1580
|
+
const A = C == null ? void 0 : C.errors, x = [], q = E.current;
|
|
1581
|
+
if (!q) return x;
|
|
1582
|
+
let V = !1;
|
|
1583
|
+
return A && A.forEach(([le, ge]) => {
|
|
1584
|
+
const B = q.querySelector(`[name="${le}"]`);
|
|
1585
|
+
(B instanceof HTMLInputElement || B instanceof HTMLTextAreaElement || B instanceof HTMLSelectElement) && (V || (B.focus(), V = !0), B.classList.add("error"), x.push(e(`_entities:${d}.${le}.${ge}`)));
|
|
1586
|
+
}), x;
|
|
1587
1587
|
},
|
|
1588
|
-
[e,
|
|
1589
|
-
),
|
|
1590
|
-
const
|
|
1591
|
-
if (!
|
|
1592
|
-
|
|
1593
|
-
|
|
1588
|
+
[e, d]
|
|
1589
|
+
), j = w(() => {
|
|
1590
|
+
const C = E.current;
|
|
1591
|
+
if (!C) return;
|
|
1592
|
+
C.querySelectorAll("input, textarea, select").forEach((x) => {
|
|
1593
|
+
x.classList.remove("error");
|
|
1594
1594
|
});
|
|
1595
|
-
}, []),
|
|
1595
|
+
}, []), I = Z(
|
|
1596
1596
|
{
|
|
1597
1597
|
mutationFn: c,
|
|
1598
|
-
onError: (
|
|
1599
|
-
console.error(
|
|
1600
|
-
const
|
|
1601
|
-
if (
|
|
1602
|
-
else if (
|
|
1603
|
-
const
|
|
1598
|
+
onError: (C) => {
|
|
1599
|
+
console.error(C);
|
|
1600
|
+
const A = C;
|
|
1601
|
+
if (u) u(C);
|
|
1602
|
+
else if (he(A)) {
|
|
1603
|
+
const x = $(A);
|
|
1604
1604
|
t(
|
|
1605
|
-
|
|
1606
|
-
(
|
|
1607
|
-
message:
|
|
1605
|
+
x.map(
|
|
1606
|
+
(q) => ({
|
|
1607
|
+
message: q,
|
|
1608
1608
|
type: R.error
|
|
1609
1609
|
})
|
|
1610
1610
|
)
|
|
1611
1611
|
);
|
|
1612
|
-
} else if (
|
|
1613
|
-
const
|
|
1614
|
-
r({ message:
|
|
1612
|
+
} else if (fe(A)) {
|
|
1613
|
+
const x = A.message || e("_accessibility:errors.500"), q = e(`_accessibility:errors.${A.status}`);
|
|
1614
|
+
r({ message: q || x });
|
|
1615
1615
|
} else
|
|
1616
1616
|
r({ message: e("_accessibility:errors.500") });
|
|
1617
1617
|
},
|
|
1618
|
-
onSuccess: async (
|
|
1619
|
-
await
|
|
1618
|
+
onSuccess: async (C) => {
|
|
1619
|
+
await i.invalidateQueries({ queryKey: d }), l && l(C), m && s({
|
|
1620
1620
|
message: m
|
|
1621
1621
|
});
|
|
1622
1622
|
}
|
|
1623
1623
|
}
|
|
1624
1624
|
);
|
|
1625
1625
|
return {
|
|
1626
|
-
control:
|
|
1626
|
+
control: h,
|
|
1627
1627
|
getValues: b,
|
|
1628
|
-
setValue:
|
|
1628
|
+
setValue: S,
|
|
1629
1629
|
handleSubmit: p,
|
|
1630
|
-
onSubmit: (
|
|
1631
|
-
|
|
1632
|
-
a ? a(
|
|
1630
|
+
onSubmit: (C) => {
|
|
1631
|
+
v(), j(), I.mutate(
|
|
1632
|
+
a ? a(C) : C
|
|
1633
1633
|
);
|
|
1634
1634
|
},
|
|
1635
1635
|
reset: y,
|
|
1636
1636
|
setError: g,
|
|
1637
|
-
isLoading:
|
|
1637
|
+
isLoading: I.isPending
|
|
1638
1638
|
};
|
|
1639
|
-
},
|
|
1640
|
-
const { t: e } =
|
|
1639
|
+
}, Bt = (n) => {
|
|
1640
|
+
const { t: e } = N(), {
|
|
1641
1641
|
onClick: t,
|
|
1642
|
-
icon: s =
|
|
1642
|
+
icon: s = yt,
|
|
1643
1643
|
sticky: r = !0,
|
|
1644
|
-
hidden:
|
|
1645
|
-
multiple:
|
|
1644
|
+
hidden: i = !1,
|
|
1645
|
+
multiple: o = !0,
|
|
1646
1646
|
disabled: c = !1,
|
|
1647
|
-
id: a =
|
|
1648
|
-
tooltip:
|
|
1647
|
+
id: a = z.Delete,
|
|
1648
|
+
tooltip: u = e("_pages:common.actions.delete.text")
|
|
1649
1649
|
} = n;
|
|
1650
1650
|
return {
|
|
1651
1651
|
action: w(
|
|
1652
|
-
(
|
|
1652
|
+
(d) => ({
|
|
1653
1653
|
id: a,
|
|
1654
1654
|
sticky: r,
|
|
1655
|
-
tooltip:
|
|
1656
|
-
multiple:
|
|
1657
|
-
onClick: () => t([
|
|
1658
|
-
hidden: !!
|
|
1659
|
-
disabled: !!
|
|
1660
|
-
icon: /* @__PURE__ */
|
|
1661
|
-
onMultipleClick: (m) => t(m.map((
|
|
1655
|
+
tooltip: u,
|
|
1656
|
+
multiple: o,
|
|
1657
|
+
onClick: () => t([d == null ? void 0 : d.id]),
|
|
1658
|
+
hidden: !!d.deletedAt || i,
|
|
1659
|
+
disabled: !!d.deletedAt || c,
|
|
1660
|
+
icon: /* @__PURE__ */ f(K, { className: "text-bg-error", icon: s }),
|
|
1661
|
+
onMultipleClick: (m) => t(m.map((h) => h.id))
|
|
1662
1662
|
}),
|
|
1663
|
-
[c,
|
|
1663
|
+
[c, i, s, a, o, t, r, u]
|
|
1664
1664
|
)
|
|
1665
1665
|
};
|
|
1666
|
-
},
|
|
1667
|
-
const { t: e } =
|
|
1666
|
+
}, Wt = (n) => {
|
|
1667
|
+
const { t: e } = N(), {
|
|
1668
1668
|
onClick: t,
|
|
1669
1669
|
sticky: s = !0,
|
|
1670
1670
|
hidden: r = !1,
|
|
1671
|
-
disabled:
|
|
1672
|
-
multiple:
|
|
1673
|
-
icon: c =
|
|
1674
|
-
id: a =
|
|
1675
|
-
tooltip:
|
|
1671
|
+
disabled: i = !1,
|
|
1672
|
+
multiple: o = !1,
|
|
1673
|
+
icon: c = Re,
|
|
1674
|
+
id: a = z.Restore,
|
|
1675
|
+
tooltip: u = e("_pages:common.actions.restore.text")
|
|
1676
1676
|
} = n;
|
|
1677
1677
|
return {
|
|
1678
1678
|
action: w(
|
|
1679
|
-
(
|
|
1679
|
+
(d) => ({
|
|
1680
1680
|
id: a,
|
|
1681
1681
|
sticky: s,
|
|
1682
|
-
tooltip:
|
|
1683
|
-
multiple:
|
|
1684
|
-
onClick: () => t([
|
|
1685
|
-
hidden: !
|
|
1686
|
-
disabled: !
|
|
1687
|
-
icon: /* @__PURE__ */
|
|
1688
|
-
onMultipleClick: (m) => t(m.map((
|
|
1682
|
+
tooltip: u,
|
|
1683
|
+
multiple: o,
|
|
1684
|
+
onClick: () => t([d == null ? void 0 : d.id]),
|
|
1685
|
+
hidden: !d.deletedAt || r,
|
|
1686
|
+
disabled: !d.deletedAt || i,
|
|
1687
|
+
icon: /* @__PURE__ */ f(K, { className: "text-bg-error", icon: c }),
|
|
1688
|
+
onMultipleClick: (m) => t(m.map((h) => h.id))
|
|
1689
1689
|
}),
|
|
1690
|
-
[
|
|
1690
|
+
[i, r, c, a, o, t, s, u]
|
|
1691
1691
|
)
|
|
1692
1692
|
};
|
|
1693
|
-
},
|
|
1694
|
-
const { t: e } =
|
|
1693
|
+
}, Us = (n) => {
|
|
1694
|
+
const { t: e } = N(), {
|
|
1695
1695
|
onClick: t,
|
|
1696
1696
|
hidden: s = !1,
|
|
1697
1697
|
sticky: r = !0,
|
|
1698
|
-
disabled:
|
|
1699
|
-
id:
|
|
1700
|
-
icon: c =
|
|
1698
|
+
disabled: i = !1,
|
|
1699
|
+
id: o = z.Edit,
|
|
1700
|
+
icon: c = bt,
|
|
1701
1701
|
tooltip: a = e("_pages:common.actions.edit.text")
|
|
1702
1702
|
} = n;
|
|
1703
1703
|
return {
|
|
1704
1704
|
action: w(
|
|
1705
|
-
(
|
|
1706
|
-
id:
|
|
1705
|
+
(l) => ({
|
|
1706
|
+
id: o,
|
|
1707
1707
|
sticky: r,
|
|
1708
1708
|
tooltip: a,
|
|
1709
|
-
onClick: () => t(
|
|
1710
|
-
hidden: !!
|
|
1711
|
-
disabled: !!
|
|
1712
|
-
icon: /* @__PURE__ */
|
|
1709
|
+
onClick: () => t(l == null ? void 0 : l.id),
|
|
1710
|
+
hidden: !!l.deletedAt || s,
|
|
1711
|
+
disabled: !!l.deletedAt || i,
|
|
1712
|
+
icon: /* @__PURE__ */ f(K, { className: "primary", icon: c })
|
|
1713
1713
|
}),
|
|
1714
|
-
[
|
|
1714
|
+
[i, s, c, o, t, r, a]
|
|
1715
1715
|
)
|
|
1716
1716
|
};
|
|
1717
1717
|
};
|
|
1718
|
-
var
|
|
1719
|
-
const
|
|
1720
|
-
const { t: e } =
|
|
1718
|
+
var z = /* @__PURE__ */ ((n) => (n.Add = "add", n.Edit = "edit", n.Delete = "delete", n.Restore = "restore", n.Refresh = "refresh", n.Export = "export", n.Import = "import", n))(z || {});
|
|
1719
|
+
const Gt = (n) => {
|
|
1720
|
+
const { t: e } = N(), {
|
|
1721
1721
|
onClick: t,
|
|
1722
1722
|
hidden: s = !1,
|
|
1723
1723
|
disabled: r = !1,
|
|
1724
|
-
isLoading:
|
|
1724
|
+
isLoading: i = !1
|
|
1725
1725
|
} = n;
|
|
1726
1726
|
return {
|
|
1727
1727
|
action: w(
|
|
1728
1728
|
() => ({
|
|
1729
|
-
id:
|
|
1729
|
+
id: z.Export,
|
|
1730
1730
|
hidden: s,
|
|
1731
1731
|
disabled: r,
|
|
1732
|
-
icon: /* @__PURE__ */
|
|
1733
|
-
|
|
1732
|
+
icon: /* @__PURE__ */ f(
|
|
1733
|
+
K,
|
|
1734
1734
|
{
|
|
1735
|
-
className: `${
|
|
1736
|
-
icon:
|
|
1735
|
+
className: `${i ? "rotate" : ""}`,
|
|
1736
|
+
icon: i ? Ie : wt
|
|
1737
1737
|
}
|
|
1738
1738
|
),
|
|
1739
1739
|
tooltip: e("_pages:common.actions.export.text"),
|
|
1740
1740
|
onClick: t
|
|
1741
1741
|
}),
|
|
1742
|
-
[r, s,
|
|
1742
|
+
[r, s, i, t, e]
|
|
1743
1743
|
)
|
|
1744
1744
|
};
|
|
1745
|
-
},
|
|
1746
|
-
const { t: e } =
|
|
1745
|
+
}, zt = (n) => {
|
|
1746
|
+
const { t: e } = N(), {
|
|
1747
1747
|
onClick: t,
|
|
1748
1748
|
hidden: s = !1,
|
|
1749
1749
|
disabled: r = !1,
|
|
1750
|
-
isLoading:
|
|
1750
|
+
isLoading: i = !1
|
|
1751
1751
|
} = n;
|
|
1752
1752
|
return {
|
|
1753
1753
|
action: w(
|
|
1754
1754
|
() => ({
|
|
1755
|
-
id:
|
|
1755
|
+
id: z.Import,
|
|
1756
1756
|
hidden: s,
|
|
1757
1757
|
disabled: r,
|
|
1758
|
-
icon: /* @__PURE__ */
|
|
1759
|
-
|
|
1758
|
+
icon: /* @__PURE__ */ f(
|
|
1759
|
+
K,
|
|
1760
1760
|
{
|
|
1761
|
-
className: `${
|
|
1762
|
-
icon:
|
|
1761
|
+
className: `${i ? "rotate" : ""}`,
|
|
1762
|
+
icon: i ? Ie : St
|
|
1763
1763
|
}
|
|
1764
1764
|
),
|
|
1765
1765
|
tooltip: e("_pages:common.actions.import.text"),
|
|
1766
1766
|
onClick: t
|
|
1767
1767
|
}),
|
|
1768
|
-
[r, s,
|
|
1768
|
+
[r, s, i, t, e]
|
|
1769
1769
|
)
|
|
1770
1770
|
};
|
|
1771
|
-
},
|
|
1772
|
-
const { queryKey: e, onSuccess: t, ...s } = n, r =
|
|
1773
|
-
onSuccessMessage:
|
|
1774
|
-
onError: (
|
|
1775
|
-
const p =
|
|
1776
|
-
if (
|
|
1777
|
-
|
|
1771
|
+
}, js = (n) => {
|
|
1772
|
+
const { queryKey: e, onSuccess: t, ...s } = n, r = J(), { showStackNotifications: i } = ee(), { t: o } = N(), { open: c, onClick: a, close: u, dialogFn: l, isLoading: d } = Be({
|
|
1773
|
+
onSuccessMessage: o("_pages:common.actions.delete.successMessage"),
|
|
1774
|
+
onError: (h) => {
|
|
1775
|
+
const p = h;
|
|
1776
|
+
if (he(p))
|
|
1777
|
+
i(
|
|
1778
1778
|
p.errors.map(
|
|
1779
1779
|
([y, g]) => ({
|
|
1780
|
-
message:
|
|
1780
|
+
message: o(`_pages:${y}.errors.${g}`),
|
|
1781
1781
|
type: R.error
|
|
1782
1782
|
})
|
|
1783
1783
|
)
|
|
1784
1784
|
);
|
|
1785
|
-
else if (
|
|
1786
|
-
const y = p.message ||
|
|
1787
|
-
|
|
1785
|
+
else if (fe(p)) {
|
|
1786
|
+
const y = p.message || o("_accessibility:errors.500"), g = o(`_accessibility:errors.${p.status}`);
|
|
1787
|
+
i([
|
|
1788
1788
|
{
|
|
1789
1789
|
message: g || y,
|
|
1790
1790
|
type: R.error
|
|
@@ -1792,144 +1792,282 @@ const Qt = (n) => {
|
|
|
1792
1792
|
]);
|
|
1793
1793
|
}
|
|
1794
1794
|
},
|
|
1795
|
-
onSuccess: async (
|
|
1796
|
-
await r.invalidateQueries({ queryKey: e }), t && t(
|
|
1795
|
+
onSuccess: async (h) => {
|
|
1796
|
+
await r.invalidateQueries({ queryKey: e }), t && t(h);
|
|
1797
1797
|
},
|
|
1798
1798
|
...s
|
|
1799
|
-
}), { action: m } =
|
|
1799
|
+
}), { action: m } = Bt({ onClick: a });
|
|
1800
1800
|
return {
|
|
1801
1801
|
onClick: a,
|
|
1802
|
-
title:
|
|
1802
|
+
title: o("_pages:common.actions.delete.dialog.title"),
|
|
1803
1803
|
open: c,
|
|
1804
|
-
isLoading:
|
|
1805
|
-
handleSubmit: () =>
|
|
1806
|
-
handleClose:
|
|
1804
|
+
isLoading: d,
|
|
1805
|
+
handleSubmit: () => l.mutate(),
|
|
1806
|
+
handleClose: u,
|
|
1807
1807
|
action: m
|
|
1808
1808
|
};
|
|
1809
|
-
},
|
|
1810
|
-
const [n, e] =
|
|
1809
|
+
}, We = () => {
|
|
1810
|
+
const [n, e] = _(!1);
|
|
1811
1811
|
return { open: n, setOpen: e, handleClose: () => e(!1), handleOpen: () => e(!0) };
|
|
1812
|
-
},
|
|
1813
|
-
const
|
|
1814
|
-
showErrorNotification:
|
|
1815
|
-
showStackNotifications:
|
|
1816
|
-
showSuccessNotification:
|
|
1817
|
-
} =
|
|
1818
|
-
defaultValues:
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
onError: u,
|
|
1824
|
-
onSuccess: m,
|
|
1825
|
-
queryKey: f,
|
|
1826
|
-
onSuccessMessage: p,
|
|
1827
|
-
title: y
|
|
1828
|
-
} = n, [g, b] = A(0), { open: T, handleClose: N, handleOpen: C } = Be(), { control: D, handleSubmit: q, reset: L, setError: S, getValues: _, setValue: E } = Pe({
|
|
1829
|
-
defaultValues: i
|
|
1830
|
-
}), P = H(null), ce = w(() => {
|
|
1831
|
-
const $ = document.activeElement;
|
|
1832
|
-
if (!($ instanceof HTMLElement)) {
|
|
1833
|
-
P.current = null;
|
|
1812
|
+
}, Jt = (n) => "mutationFn" in n && "queryKey" in n, pe = (n) => {
|
|
1813
|
+
const e = Jt(n), t = e ? n : void 0, s = e ? void 0 : n, r = e ? "entity" : (s == null ? void 0 : s.mode) ?? "state", { t: i } = N(), o = J(), {
|
|
1814
|
+
showErrorNotification: c,
|
|
1815
|
+
showStackNotifications: a,
|
|
1816
|
+
showSuccessNotification: u
|
|
1817
|
+
} = ee(), [l, d] = _(), [m, h] = _(!1), p = M(!1), y = M(), { open: g, handleClose: b, handleOpen: S } = We(), { control: E, handleSubmit: v, reset: $, setError: j, getValues: I, setValue: C } = Me({
|
|
1818
|
+
defaultValues: (t == null ? void 0 : t.defaultValues) || (s == null ? void 0 : s.defaultValues) || {}
|
|
1819
|
+
}), A = M(null), x = w(() => {
|
|
1820
|
+
const T = document.activeElement;
|
|
1821
|
+
if (!(T instanceof HTMLElement)) {
|
|
1822
|
+
A.current = null;
|
|
1834
1823
|
return;
|
|
1835
1824
|
}
|
|
1836
|
-
|
|
1837
|
-
}, []), { data:
|
|
1838
|
-
queryFn: () =>
|
|
1839
|
-
|
|
1840
|
-
|
|
1825
|
+
A.current = T.closest("form");
|
|
1826
|
+
}, []), q = t ? [...t.queryKey, l ?? 0] : ["__legacy-form-dialog-disabled__", l ?? 0], { data: V, isLoading: le } = Oe({
|
|
1827
|
+
queryFn: async () => {
|
|
1828
|
+
if (!(!(t != null && t.getFunction) || !l))
|
|
1829
|
+
return t.getFunction(l);
|
|
1830
|
+
},
|
|
1831
|
+
queryKey: q,
|
|
1832
|
+
enabled: !!(t != null && t.getFunction) && !!l
|
|
1841
1833
|
});
|
|
1842
1834
|
O(() => {
|
|
1843
|
-
|
|
1844
|
-
}, [
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1835
|
+
!t || !V || !t.dtoToForm || y.current !== V && ($({ ...t.dtoToForm(V) }), y.current = V);
|
|
1836
|
+
}, [V, t, $]), O(() => {
|
|
1837
|
+
if (s) {
|
|
1838
|
+
if (!g) {
|
|
1839
|
+
p.current = !1;
|
|
1840
|
+
return;
|
|
1841
|
+
}
|
|
1842
|
+
if (!p.current) {
|
|
1843
|
+
if (p.current = !0, s.reinitializeOnOpen && s.mapIn) {
|
|
1844
|
+
$(s.mapIn());
|
|
1845
|
+
return;
|
|
1846
|
+
}
|
|
1847
|
+
if (s.reinitializeOnOpen && s.defaultValues) {
|
|
1848
|
+
$(s.defaultValues);
|
|
1849
|
+
return;
|
|
1850
|
+
}
|
|
1851
|
+
s.resetOnOpen && $(s.defaultValues || {});
|
|
1852
|
+
}
|
|
1853
|
+
}
|
|
1854
|
+
}, [s, g, $]);
|
|
1855
|
+
const ge = w(
|
|
1856
|
+
(T) => {
|
|
1857
|
+
const D = T == null ? void 0 : T.errors, H = [], te = A.current;
|
|
1858
|
+
if (!te || !t) return H;
|
|
1859
|
+
let Ce = !1;
|
|
1860
|
+
return D && D.forEach(([Te, Ze]) => {
|
|
1861
|
+
const oe = te.querySelector(`[name="${Te}"]`);
|
|
1862
|
+
(oe instanceof HTMLInputElement || oe instanceof HTMLTextAreaElement || oe instanceof HTMLSelectElement) && (Ce || (oe.focus(), Ce = !0), oe.classList.add("error"), H.push(
|
|
1863
|
+
i(`_entities:${t.queryKey}.${Te}.${Ze}`)
|
|
1864
|
+
));
|
|
1865
|
+
}), H;
|
|
1854
1866
|
},
|
|
1855
|
-
[
|
|
1856
|
-
),
|
|
1857
|
-
const
|
|
1858
|
-
if (
|
|
1859
|
-
|
|
1860
|
-
|
|
1867
|
+
[t, i]
|
|
1868
|
+
), B = w(() => {
|
|
1869
|
+
const T = A.current;
|
|
1870
|
+
if (!T) return;
|
|
1871
|
+
T.querySelectorAll("input, textarea, select").forEach((H) => {
|
|
1872
|
+
H.classList.remove("error");
|
|
1861
1873
|
});
|
|
1862
|
-
}, []),
|
|
1863
|
-
(
|
|
1864
|
-
|
|
1874
|
+
}, []), Y = w(() => {
|
|
1875
|
+
B(), A.current = null, b(), $();
|
|
1876
|
+
}, [b, B, $]), ze = w(
|
|
1877
|
+
(T) => {
|
|
1878
|
+
d(T), S();
|
|
1865
1879
|
},
|
|
1866
|
-
[
|
|
1867
|
-
),
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
const
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1880
|
+
[S]
|
|
1881
|
+
), ye = Z({
|
|
1882
|
+
mutationFn: async (T) => {
|
|
1883
|
+
if (t)
|
|
1884
|
+
return t.mutationFn(T);
|
|
1885
|
+
},
|
|
1886
|
+
onError: (T) => {
|
|
1887
|
+
if (t)
|
|
1888
|
+
if (t.onError) t.onError(T);
|
|
1889
|
+
else {
|
|
1890
|
+
const D = T;
|
|
1891
|
+
if (he(D)) {
|
|
1892
|
+
const H = ge(D);
|
|
1893
|
+
a(
|
|
1894
|
+
H.map(
|
|
1895
|
+
(te) => ({
|
|
1896
|
+
message: te,
|
|
1897
|
+
type: R.error
|
|
1898
|
+
})
|
|
1899
|
+
)
|
|
1900
|
+
);
|
|
1901
|
+
} else if (fe(D)) {
|
|
1902
|
+
const H = D.message || i("_accessibility:errors.500"), te = i(`_accessibility:errors.${D.status}`);
|
|
1903
|
+
c({ message: te || H });
|
|
1904
|
+
} else
|
|
1905
|
+
c({ message: i("_accessibility:errors.500") });
|
|
1906
|
+
}
|
|
1907
|
+
},
|
|
1908
|
+
onSuccess: async (T) => {
|
|
1909
|
+
t && (await o.invalidateQueries({ queryKey: t.queryKey }), t.onSuccess && await t.onSuccess(T), u({
|
|
1910
|
+
message: t.onSuccessMessage
|
|
1911
|
+
}), Y());
|
|
1912
|
+
}
|
|
1913
|
+
}), ue = w(
|
|
1914
|
+
(T) => t ? T : s != null && s.mapOut ? s.mapOut(T, { id: l }) : T,
|
|
1915
|
+
[s, l, t]
|
|
1916
|
+
), Je = w(async () => {
|
|
1917
|
+
if (!(s != null && s.onApply)) return;
|
|
1918
|
+
const T = I(), D = ue(T);
|
|
1919
|
+
h(!0);
|
|
1920
|
+
try {
|
|
1921
|
+
await s.onApply(D, {
|
|
1922
|
+
close: Y,
|
|
1923
|
+
id: l,
|
|
1924
|
+
values: T
|
|
1925
|
+
});
|
|
1926
|
+
} finally {
|
|
1927
|
+
h(!1);
|
|
1928
|
+
}
|
|
1929
|
+
}, [Y, s, I, l, ue]), Ye = w(async () => {
|
|
1930
|
+
if (s) {
|
|
1931
|
+
if (s.onClear) {
|
|
1932
|
+
h(!0);
|
|
1933
|
+
try {
|
|
1934
|
+
await s.onClear();
|
|
1935
|
+
} finally {
|
|
1936
|
+
h(!1);
|
|
1937
|
+
}
|
|
1938
|
+
}
|
|
1939
|
+
$(s.defaultValues || {});
|
|
1940
|
+
}
|
|
1941
|
+
}, [s, $]), Xe = w(
|
|
1942
|
+
async (T) => {
|
|
1943
|
+
if (t) {
|
|
1944
|
+
x(), ye.mutate(
|
|
1945
|
+
t.formToDto ? t.formToDto(T) : T
|
|
1946
|
+
);
|
|
1947
|
+
return;
|
|
1948
|
+
}
|
|
1949
|
+
const D = ue(T);
|
|
1950
|
+
h(!0);
|
|
1951
|
+
try {
|
|
1952
|
+
s != null && s.onSubmit && await s.onSubmit(D, {
|
|
1953
|
+
close: Y,
|
|
1954
|
+
id: l,
|
|
1955
|
+
values: T
|
|
1956
|
+
}), ((s == null ? void 0 : s.closeOnSubmit) ?? !0) && Y();
|
|
1957
|
+
} finally {
|
|
1958
|
+
h(!1);
|
|
1890
1959
|
}
|
|
1891
1960
|
},
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1961
|
+
[
|
|
1962
|
+
x,
|
|
1963
|
+
Y,
|
|
1964
|
+
s,
|
|
1965
|
+
l,
|
|
1966
|
+
ye,
|
|
1967
|
+
t,
|
|
1968
|
+
ue
|
|
1969
|
+
]
|
|
1970
|
+
);
|
|
1971
|
+
return {
|
|
1972
|
+
open: g,
|
|
1973
|
+
mode: r,
|
|
1974
|
+
id: l,
|
|
1975
|
+
openDialog: ze,
|
|
1976
|
+
handleClose: Y,
|
|
1977
|
+
control: E,
|
|
1978
|
+
getValues: I,
|
|
1979
|
+
setValue: C,
|
|
1980
|
+
handleSubmit: v,
|
|
1981
|
+
onSubmit: Xe,
|
|
1982
|
+
reset: $,
|
|
1983
|
+
setError: j,
|
|
1984
|
+
title: n.title,
|
|
1985
|
+
isSubmitting: m,
|
|
1986
|
+
onApply: Je,
|
|
1987
|
+
onClear: Ye,
|
|
1988
|
+
isLoading: le || ye.isPending || m
|
|
1989
|
+
};
|
|
1990
|
+
}, Hs = pe, Qs = (n) => pe(n), Vs = (n) => {
|
|
1991
|
+
const e = J(), { mutationFn: t, queryKey: s, onSuccess: r, onError: i, mapOut: o, ...c } = n, a = Z({
|
|
1992
|
+
mutationFn: t
|
|
1993
|
+
});
|
|
1994
|
+
return pe({
|
|
1995
|
+
...c,
|
|
1996
|
+
mode: "entity",
|
|
1997
|
+
mapOut: o,
|
|
1998
|
+
onSubmit: async (u) => {
|
|
1999
|
+
try {
|
|
2000
|
+
const l = await a.mutateAsync(u);
|
|
2001
|
+
s && await e.invalidateQueries({ queryKey: s }), r && await r(l);
|
|
2002
|
+
} catch (l) {
|
|
2003
|
+
throw i && i(l), l;
|
|
2004
|
+
}
|
|
1896
2005
|
}
|
|
1897
2006
|
});
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
2007
|
+
}, Bs = (n) => {
|
|
2008
|
+
const e = J(), t = M(), s = M(), {
|
|
2009
|
+
mutationFn: r,
|
|
2010
|
+
queryKey: i,
|
|
2011
|
+
onSuccess: o,
|
|
2012
|
+
onError: c,
|
|
2013
|
+
mapOut: a,
|
|
2014
|
+
getFunction: u,
|
|
2015
|
+
dtoToForm: l,
|
|
2016
|
+
title: d,
|
|
2017
|
+
...m
|
|
2018
|
+
} = n, h = M(l);
|
|
2019
|
+
O(() => {
|
|
2020
|
+
h.current = l;
|
|
2021
|
+
}, [l]);
|
|
2022
|
+
const p = Z({
|
|
2023
|
+
mutationFn: r
|
|
2024
|
+
}), y = pe({
|
|
2025
|
+
...m,
|
|
2026
|
+
mode: "entity",
|
|
2027
|
+
title: d,
|
|
2028
|
+
onSubmit: async (E) => {
|
|
2029
|
+
try {
|
|
2030
|
+
const v = await p.mutateAsync(E);
|
|
2031
|
+
i && await e.invalidateQueries({ queryKey: i }), o && await o(v);
|
|
2032
|
+
} catch (v) {
|
|
2033
|
+
throw c && c(v), v;
|
|
2034
|
+
}
|
|
1910
2035
|
},
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
2036
|
+
mapOut: (E) => a ? a(E, t.current) : E
|
|
2037
|
+
}), { reset: g } = y, S = Oe({
|
|
2038
|
+
queryFn: () => u(y.id),
|
|
2039
|
+
queryKey: [...i || ["put-dialog", d], y.id],
|
|
2040
|
+
enabled: y.open && !!y.id
|
|
2041
|
+
});
|
|
2042
|
+
return O(() => {
|
|
2043
|
+
if (S.data && s.current !== S.data) {
|
|
2044
|
+
if (t.current = S.data, s.current = S.data, h.current && g) {
|
|
2045
|
+
g(h.current(S.data));
|
|
2046
|
+
return;
|
|
2047
|
+
}
|
|
2048
|
+
g == null || g(S.data);
|
|
2049
|
+
}
|
|
2050
|
+
}, [S.data, g]), {
|
|
2051
|
+
...y,
|
|
2052
|
+
isLoading: y.isLoading || p.isPending || S.isFetching || S.isLoading
|
|
1915
2053
|
};
|
|
1916
|
-
},
|
|
1917
|
-
const { queryKey: e, onSuccess: t, ...s } = n, r =
|
|
1918
|
-
onSuccessMessage:
|
|
1919
|
-
onError: (
|
|
1920
|
-
const p =
|
|
1921
|
-
if (
|
|
1922
|
-
|
|
2054
|
+
}, Ws = (n) => {
|
|
2055
|
+
const { queryKey: e, onSuccess: t, ...s } = n, r = J(), { showStackNotifications: i } = ee(), { t: o } = N(), { open: c, onClick: a, close: u, dialogFn: l, isLoading: d } = Be({
|
|
2056
|
+
onSuccessMessage: o("_pages:common.actions.restore.successMessage"),
|
|
2057
|
+
onError: (h) => {
|
|
2058
|
+
const p = h;
|
|
2059
|
+
if (he(p))
|
|
2060
|
+
i(
|
|
1923
2061
|
p.errors.map(
|
|
1924
2062
|
([y, g]) => ({
|
|
1925
|
-
message:
|
|
2063
|
+
message: o(`_pages:${y}.errors.${g}`),
|
|
1926
2064
|
type: R.error
|
|
1927
2065
|
})
|
|
1928
2066
|
)
|
|
1929
2067
|
);
|
|
1930
|
-
else if (
|
|
1931
|
-
const y = p.message ||
|
|
1932
|
-
|
|
2068
|
+
else if (fe(p)) {
|
|
2069
|
+
const y = p.message || o("_accessibility:errors.500"), g = o(`_accessibility:errors.${p.status}`);
|
|
2070
|
+
i([
|
|
1933
2071
|
{
|
|
1934
2072
|
message: g || y,
|
|
1935
2073
|
type: R.error
|
|
@@ -1937,30 +2075,30 @@ const Qt = (n) => {
|
|
|
1937
2075
|
]);
|
|
1938
2076
|
}
|
|
1939
2077
|
},
|
|
1940
|
-
onSuccess: async (
|
|
1941
|
-
await r.invalidateQueries({ queryKey: e }), t && t(
|
|
2078
|
+
onSuccess: async (h) => {
|
|
2079
|
+
await r.invalidateQueries({ queryKey: e }), t && t(h);
|
|
1942
2080
|
},
|
|
1943
2081
|
...s
|
|
1944
|
-
}), { action: m } =
|
|
2082
|
+
}), { action: m } = Wt({ onClick: a });
|
|
1945
2083
|
return {
|
|
1946
2084
|
onClick: a,
|
|
1947
|
-
title:
|
|
2085
|
+
title: o("_pages:common.actions.restore.dialog.title"),
|
|
1948
2086
|
open: c,
|
|
1949
|
-
isLoading:
|
|
1950
|
-
handleSubmit: () =>
|
|
1951
|
-
handleClose:
|
|
2087
|
+
isLoading: d,
|
|
2088
|
+
handleSubmit: () => l.mutate(),
|
|
2089
|
+
handleClose: u,
|
|
1952
2090
|
action: m
|
|
1953
2091
|
};
|
|
1954
2092
|
};
|
|
1955
|
-
function
|
|
1956
|
-
const { t: e } =
|
|
2093
|
+
function Gs(n) {
|
|
2094
|
+
const { t: e } = N(), t = J(), {
|
|
1957
2095
|
queryKey: s,
|
|
1958
2096
|
mutationFn: r,
|
|
1959
|
-
entity:
|
|
1960
|
-
fileProcessor:
|
|
2097
|
+
entity: i,
|
|
2098
|
+
fileProcessor: o,
|
|
1961
2099
|
renderCustomPreview: c,
|
|
1962
2100
|
onError: a
|
|
1963
|
-
} = n, [
|
|
2101
|
+
} = n, [u, l] = _(!1), [d, m] = _(null), [h, p] = _(!1), y = Z({
|
|
1964
2102
|
mutationFn: r,
|
|
1965
2103
|
onError: (b) => {
|
|
1966
2104
|
console.error(b), a == null || a(b);
|
|
@@ -1968,184 +2106,184 @@ function qs(n) {
|
|
|
1968
2106
|
onSuccess: async () => {
|
|
1969
2107
|
await t.invalidateQueries({ queryKey: s });
|
|
1970
2108
|
}
|
|
1971
|
-
}), { action: g } =
|
|
1972
|
-
onClick: () =>
|
|
2109
|
+
}), { action: g } = zt({
|
|
2110
|
+
onClick: () => l(!0)
|
|
1973
2111
|
});
|
|
1974
2112
|
return {
|
|
1975
2113
|
handleSubmit: async () => {
|
|
1976
|
-
if (!(!
|
|
2114
|
+
if (!(!d || d.length === 0))
|
|
1977
2115
|
try {
|
|
1978
2116
|
await y.mutateAsync({
|
|
1979
|
-
items:
|
|
1980
|
-
override:
|
|
1981
|
-
}),
|
|
2117
|
+
items: d,
|
|
2118
|
+
override: h
|
|
2119
|
+
}), l(!1), m(null), p(!1);
|
|
1982
2120
|
} catch (b) {
|
|
1983
2121
|
console.error(b);
|
|
1984
2122
|
}
|
|
1985
2123
|
},
|
|
1986
2124
|
isLoading: y.isPending,
|
|
1987
|
-
fileProcessor:
|
|
2125
|
+
fileProcessor: o,
|
|
1988
2126
|
onFileProcessed: (b) => m(b),
|
|
1989
2127
|
renderCustomPreview: c,
|
|
1990
2128
|
onOverrideChange: (b) => p(b),
|
|
1991
|
-
open:
|
|
2129
|
+
open: u,
|
|
1992
2130
|
title: e("_pages:common.actions.import.dialog.title", {
|
|
1993
|
-
entity: e(`_pages:${
|
|
2131
|
+
entity: e(`_pages:${i}.title`)
|
|
1994
2132
|
}),
|
|
1995
2133
|
handleClose: () => {
|
|
1996
|
-
|
|
2134
|
+
l(!1), m(null), p(!1);
|
|
1997
2135
|
},
|
|
1998
2136
|
action: g
|
|
1999
2137
|
};
|
|
2000
2138
|
}
|
|
2001
|
-
const
|
|
2002
|
-
const { showSuccessNotification: e } =
|
|
2139
|
+
const zs = (n) => {
|
|
2140
|
+
const { showSuccessNotification: e } = ee(), { t } = N(), {
|
|
2003
2141
|
entity: s,
|
|
2004
2142
|
mutationFn: r,
|
|
2005
|
-
onError:
|
|
2006
|
-
onSuccess:
|
|
2143
|
+
onError: i,
|
|
2144
|
+
onSuccess: o,
|
|
2007
2145
|
onSuccessMessage: c = t("_pages:common.actions.export.successMessage")
|
|
2008
|
-
} = n, a =
|
|
2146
|
+
} = n, a = Z({
|
|
2009
2147
|
mutationFn: () => r(),
|
|
2010
|
-
onError: (
|
|
2011
|
-
console.error(
|
|
2148
|
+
onError: (d) => {
|
|
2149
|
+
console.error(d), i && i(d);
|
|
2012
2150
|
},
|
|
2013
|
-
onSuccess: async (
|
|
2014
|
-
const m = JSON.stringify(
|
|
2015
|
-
y.href = p, y.download = `${s}.json`, y.click(), URL.revokeObjectURL(p),
|
|
2151
|
+
onSuccess: async (d) => {
|
|
2152
|
+
const m = JSON.stringify(d, null, 2), h = new Blob([m], { type: "application/json" }), p = URL.createObjectURL(h), y = document.createElement("a");
|
|
2153
|
+
y.href = p, y.download = `${s}.json`, y.click(), URL.revokeObjectURL(p), o && o(d), e({
|
|
2016
2154
|
message: c
|
|
2017
2155
|
});
|
|
2018
2156
|
}
|
|
2019
|
-
}),
|
|
2157
|
+
}), u = w(() => {
|
|
2020
2158
|
a.mutate();
|
|
2021
|
-
}, [a]), { action:
|
|
2022
|
-
onClick:
|
|
2159
|
+
}, [a]), { action: l } = Gt({
|
|
2160
|
+
onClick: u,
|
|
2023
2161
|
isLoading: a.isPending
|
|
2024
2162
|
});
|
|
2025
2163
|
return {
|
|
2026
|
-
action:
|
|
2164
|
+
action: l
|
|
2027
2165
|
};
|
|
2028
|
-
},
|
|
2029
|
-
function
|
|
2030
|
-
const [e, t] =
|
|
2031
|
-
t(
|
|
2166
|
+
}, xe = () => typeof window < "u" ? window.scrollY : 0;
|
|
2167
|
+
function Yt(n) {
|
|
2168
|
+
const [e, t] = _(xe), s = w(() => {
|
|
2169
|
+
t(xe());
|
|
2032
2170
|
}, []);
|
|
2033
2171
|
return O(() => (window.addEventListener("scroll", s), () => {
|
|
2034
2172
|
window.removeEventListener("scroll", s);
|
|
2035
2173
|
}), [s]), e > n;
|
|
2036
2174
|
}
|
|
2037
|
-
const
|
|
2038
|
-
const { t: e } =
|
|
2039
|
-
icon: t =
|
|
2175
|
+
const Js = (n) => {
|
|
2176
|
+
const { t: e } = N(), {
|
|
2177
|
+
icon: t = kt,
|
|
2040
2178
|
threshold: s = 200,
|
|
2041
2179
|
scrollTop: r = 0,
|
|
2042
|
-
scrollLeft:
|
|
2043
|
-
tooltip:
|
|
2180
|
+
scrollLeft: i = 0,
|
|
2181
|
+
tooltip: o = e("_accessibility:buttons.toTop"),
|
|
2044
2182
|
scrollOnClick: c = !0,
|
|
2045
2183
|
onClick: a,
|
|
2046
|
-
className:
|
|
2047
|
-
variant:
|
|
2048
|
-
color:
|
|
2184
|
+
className: u = "",
|
|
2185
|
+
variant: l = "submit",
|
|
2186
|
+
color: d = "primary",
|
|
2049
2187
|
...m
|
|
2050
|
-
} = n,
|
|
2051
|
-
return /* @__PURE__ */
|
|
2052
|
-
|
|
2188
|
+
} = n, h = Yt(s);
|
|
2189
|
+
return /* @__PURE__ */ f(
|
|
2190
|
+
G,
|
|
2053
2191
|
{
|
|
2054
|
-
variant:
|
|
2055
|
-
color:
|
|
2192
|
+
variant: l,
|
|
2193
|
+
color: d,
|
|
2056
2194
|
icon: t,
|
|
2057
2195
|
"data-tooltip-id": "tooltip",
|
|
2058
2196
|
onClick: () => {
|
|
2059
|
-
a == null || a(), c &&
|
|
2197
|
+
a == null || a(), c && Vt.scrollTo(i, r);
|
|
2060
2198
|
},
|
|
2061
|
-
className: `to-top ${
|
|
2062
|
-
"data-tooltip-content":
|
|
2199
|
+
className: `to-top ${h ? "show" : "hide"} ${u}`.trim(),
|
|
2200
|
+
"data-tooltip-content": o,
|
|
2063
2201
|
...m
|
|
2064
2202
|
}
|
|
2065
2203
|
);
|
|
2066
2204
|
};
|
|
2067
|
-
function
|
|
2068
|
-
const { t: e } =
|
|
2205
|
+
function Ys(n) {
|
|
2206
|
+
const { t: e } = N();
|
|
2069
2207
|
if ("children" in n) {
|
|
2070
|
-
const { children:
|
|
2071
|
-
return /* @__PURE__ */
|
|
2208
|
+
const { children: v, className: $ } = n;
|
|
2209
|
+
return /* @__PURE__ */ f("div", { className: `error-container${$ ? ` ${$}` : ""}`, children: v });
|
|
2072
2210
|
}
|
|
2073
2211
|
const {
|
|
2074
2212
|
error: s,
|
|
2075
2213
|
message: r,
|
|
2076
|
-
iconProps:
|
|
2077
|
-
onRetry:
|
|
2214
|
+
iconProps: i,
|
|
2215
|
+
onRetry: o,
|
|
2078
2216
|
retryLabel: c,
|
|
2079
2217
|
retryButtonProps: a,
|
|
2080
|
-
messageProps:
|
|
2081
|
-
className:
|
|
2082
|
-
resetErrorBoundary:
|
|
2083
|
-
} = n, m =
|
|
2084
|
-
className:
|
|
2218
|
+
messageProps: u,
|
|
2219
|
+
className: l,
|
|
2220
|
+
resetErrorBoundary: d
|
|
2221
|
+
} = n, m = o ?? d, {
|
|
2222
|
+
className: h,
|
|
2085
2223
|
children: p,
|
|
2086
2224
|
onClick: y,
|
|
2087
2225
|
...g
|
|
2088
|
-
} = a ?? {}, { className: b, ...
|
|
2089
|
-
return /* @__PURE__ */ k("div", { className: `error-container${
|
|
2090
|
-
|
|
2091
|
-
|
|
2226
|
+
} = a ?? {}, { className: b, ...S } = u ?? {}, E = i !== null;
|
|
2227
|
+
return /* @__PURE__ */ k("div", { className: `error-container${l ? ` ${l}` : ""}`, children: [
|
|
2228
|
+
E && /* @__PURE__ */ f(
|
|
2229
|
+
K,
|
|
2092
2230
|
{
|
|
2093
|
-
...
|
|
2094
|
-
icon: (
|
|
2095
|
-
className: `error-icon${
|
|
2231
|
+
...i,
|
|
2232
|
+
icon: (i == null ? void 0 : i.icon) ?? Lt,
|
|
2233
|
+
className: `error-icon${i != null && i.className ? ` ${i.className}` : ""}`
|
|
2096
2234
|
}
|
|
2097
2235
|
),
|
|
2098
|
-
/* @__PURE__ */
|
|
2236
|
+
/* @__PURE__ */ f(
|
|
2099
2237
|
"p",
|
|
2100
2238
|
{
|
|
2101
|
-
...
|
|
2239
|
+
...S,
|
|
2102
2240
|
className: `error-message${b ? ` ${b}` : ""}`,
|
|
2103
2241
|
children: r ?? (s == null ? void 0 : s.message) ?? e("_accessibility:errors.unknownError")
|
|
2104
2242
|
}
|
|
2105
2243
|
),
|
|
2106
|
-
m && /* @__PURE__ */
|
|
2107
|
-
|
|
2244
|
+
m && /* @__PURE__ */ f(
|
|
2245
|
+
U,
|
|
2108
2246
|
{
|
|
2109
2247
|
type: "button",
|
|
2110
2248
|
variant: "submit",
|
|
2111
2249
|
color: "primary",
|
|
2112
2250
|
...g,
|
|
2113
|
-
className: `error-retry ${
|
|
2114
|
-
onClick: (
|
|
2115
|
-
y == null || y(
|
|
2251
|
+
className: `error-retry ${h ? ` ${h}` : ""}`,
|
|
2252
|
+
onClick: (v) => {
|
|
2253
|
+
y == null || y(v), v.defaultPrevented || m();
|
|
2116
2254
|
},
|
|
2117
2255
|
children: p ?? c ?? e("_accessibility:actions.retry", { defaultValue: "Retry" })
|
|
2118
2256
|
}
|
|
2119
2257
|
)
|
|
2120
2258
|
] });
|
|
2121
2259
|
}
|
|
2122
|
-
const
|
|
2123
|
-
const { showBackButton: e, title: t, actions: s } = n, { t: r } =
|
|
2260
|
+
const Xt = (n) => {
|
|
2261
|
+
const { showBackButton: e, title: t, actions: s } = n, { t: r } = N(), { navigate: i } = ce();
|
|
2124
2262
|
return /* @__PURE__ */ k("div", { className: "page-header", children: [
|
|
2125
2263
|
/* @__PURE__ */ k("div", { className: "page-header-left", children: [
|
|
2126
|
-
e && /* @__PURE__ */
|
|
2127
|
-
|
|
2264
|
+
e && /* @__PURE__ */ f(
|
|
2265
|
+
G,
|
|
2128
2266
|
{
|
|
2129
|
-
icon:
|
|
2130
|
-
onClick: () =>
|
|
2267
|
+
icon: vt,
|
|
2268
|
+
onClick: () => i(-1),
|
|
2131
2269
|
className: "page-header-back",
|
|
2132
2270
|
name: r("_accessibility:buttons.back"),
|
|
2133
2271
|
"data-tooltip-id": "tooltip",
|
|
2134
2272
|
"data-tooltip-content": r("_accessibility:buttons.back")
|
|
2135
2273
|
}
|
|
2136
2274
|
),
|
|
2137
|
-
/* @__PURE__ */
|
|
2275
|
+
/* @__PURE__ */ f("h2", { className: "page-header-title", children: t })
|
|
2138
2276
|
] }),
|
|
2139
2277
|
/* @__PURE__ */ k("div", { children: [
|
|
2140
|
-
/* @__PURE__ */
|
|
2141
|
-
|
|
2278
|
+
/* @__PURE__ */ f(
|
|
2279
|
+
lt,
|
|
2142
2280
|
{
|
|
2143
2281
|
className: "page-header-actions-desktop",
|
|
2144
2282
|
actions: s ?? []
|
|
2145
2283
|
}
|
|
2146
2284
|
),
|
|
2147
|
-
/* @__PURE__ */
|
|
2148
|
-
|
|
2285
|
+
/* @__PURE__ */ f(
|
|
2286
|
+
ut,
|
|
2149
2287
|
{
|
|
2150
2288
|
className: "page-header-actions-mobile",
|
|
2151
2289
|
actions: s ?? []
|
|
@@ -2153,33 +2291,33 @@ const Wt = (n) => {
|
|
|
2153
2291
|
)
|
|
2154
2292
|
] })
|
|
2155
2293
|
] });
|
|
2156
|
-
},
|
|
2294
|
+
}, Xs = (n) => {
|
|
2157
2295
|
const {
|
|
2158
2296
|
title: e,
|
|
2159
2297
|
children: t,
|
|
2160
2298
|
addOptions: s,
|
|
2161
2299
|
filterOptions: r,
|
|
2162
|
-
actions:
|
|
2163
|
-
queryKey:
|
|
2300
|
+
actions: i,
|
|
2301
|
+
queryKey: o,
|
|
2164
2302
|
isLoading: c = !1,
|
|
2165
2303
|
isAnimated: a = !0,
|
|
2166
|
-
showBackButton:
|
|
2167
|
-
} = n, { t:
|
|
2168
|
-
const p = Array.isArray(
|
|
2169
|
-
if (
|
|
2304
|
+
showBackButton: u = !1
|
|
2305
|
+
} = n, { t: l } = N(), d = J(), { countOfFilters: m } = dt(), h = Q(() => {
|
|
2306
|
+
const p = Array.isArray(i) ? [...i] : [];
|
|
2307
|
+
if (o) {
|
|
2170
2308
|
const y = {
|
|
2171
|
-
id:
|
|
2172
|
-
onClick: () =>
|
|
2173
|
-
icon: /* @__PURE__ */
|
|
2174
|
-
tooltip:
|
|
2309
|
+
id: z.Refresh,
|
|
2310
|
+
onClick: () => d.invalidateQueries({ queryKey: o }),
|
|
2311
|
+
icon: /* @__PURE__ */ f(K, { icon: Re }),
|
|
2312
|
+
tooltip: l("_pages:common.actions.refresh.text")
|
|
2175
2313
|
};
|
|
2176
2314
|
p.unshift(y);
|
|
2177
2315
|
}
|
|
2178
2316
|
if (s) {
|
|
2179
2317
|
const y = {
|
|
2180
2318
|
...s,
|
|
2181
|
-
id:
|
|
2182
|
-
icon: /* @__PURE__ */
|
|
2319
|
+
id: z.Add,
|
|
2320
|
+
icon: /* @__PURE__ */ f(K, { icon: Ne })
|
|
2183
2321
|
};
|
|
2184
2322
|
p.unshift(y);
|
|
2185
2323
|
}
|
|
@@ -2187,9 +2325,9 @@ const Wt = (n) => {
|
|
|
2187
2325
|
const y = {
|
|
2188
2326
|
...r,
|
|
2189
2327
|
id: "filter",
|
|
2190
|
-
icon: /* @__PURE__ */
|
|
2191
|
-
children: /* @__PURE__ */
|
|
2192
|
-
|
|
2328
|
+
icon: /* @__PURE__ */ f(K, { icon: Ct }),
|
|
2329
|
+
children: /* @__PURE__ */ f(
|
|
2330
|
+
mt,
|
|
2193
2331
|
{
|
|
2194
2332
|
className: `${m > 0 ? "show" : "hide"} `,
|
|
2195
2333
|
count: m
|
|
@@ -2200,126 +2338,126 @@ const Wt = (n) => {
|
|
|
2200
2338
|
}
|
|
2201
2339
|
return p;
|
|
2202
2340
|
}, [
|
|
2203
|
-
|
|
2341
|
+
i,
|
|
2204
2342
|
s,
|
|
2205
2343
|
m,
|
|
2206
2344
|
r,
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2345
|
+
d,
|
|
2346
|
+
o,
|
|
2347
|
+
l
|
|
2210
2348
|
]);
|
|
2211
2349
|
return /* @__PURE__ */ k("main", { className: "page-main", children: [
|
|
2212
|
-
/* @__PURE__ */
|
|
2213
|
-
|
|
2350
|
+
/* @__PURE__ */ f(
|
|
2351
|
+
Xt,
|
|
2214
2352
|
{
|
|
2215
|
-
showBackButton:
|
|
2216
|
-
actions:
|
|
2353
|
+
showBackButton: u,
|
|
2354
|
+
actions: h,
|
|
2217
2355
|
title: e
|
|
2218
2356
|
}
|
|
2219
2357
|
),
|
|
2220
|
-
/* @__PURE__ */
|
|
2221
|
-
s && /* @__PURE__ */
|
|
2222
|
-
|
|
2358
|
+
/* @__PURE__ */ f("div", { className: `page-main-content ${a ? "appear" : ""}`, children: c ? /* @__PURE__ */ f(ne, { className: "page-loading" }) : t }),
|
|
2359
|
+
s && /* @__PURE__ */ f(
|
|
2360
|
+
G,
|
|
2223
2361
|
{
|
|
2224
|
-
icon: s.icon ??
|
|
2362
|
+
icon: s.icon ?? Ne,
|
|
2225
2363
|
color: s.color ?? "primary",
|
|
2226
2364
|
variant: s.variant ?? "submit",
|
|
2227
2365
|
onClick: () => {
|
|
2228
2366
|
var p;
|
|
2229
2367
|
return (p = s.onClick) == null ? void 0 : p.call(s);
|
|
2230
2368
|
},
|
|
2231
|
-
className: `button fab ${s.className ?? ""}`
|
|
2369
|
+
className: `button page-fab ${s.className ?? ""}`
|
|
2232
2370
|
}
|
|
2233
2371
|
)
|
|
2234
2372
|
] });
|
|
2235
|
-
},
|
|
2236
|
-
const { t: e } =
|
|
2373
|
+
}, Zs = (n) => {
|
|
2374
|
+
const { t: e } = N(), {
|
|
2237
2375
|
className: t = "",
|
|
2238
2376
|
itemClassName: s = "",
|
|
2239
2377
|
loading: r = !1,
|
|
2240
|
-
emptyComponent:
|
|
2241
|
-
emptyMessage:
|
|
2378
|
+
emptyComponent: i = null,
|
|
2379
|
+
emptyMessage: o = e("_accessibility:messages.empty"),
|
|
2242
2380
|
renderComponent: c,
|
|
2243
2381
|
data: a = [],
|
|
2244
|
-
hasMore:
|
|
2245
|
-
loadingMore:
|
|
2246
|
-
onLoadMore:
|
|
2382
|
+
hasMore: u = !1,
|
|
2383
|
+
loadingMore: l = !1,
|
|
2384
|
+
onLoadMore: d,
|
|
2247
2385
|
loadMoreComponent: m = null,
|
|
2248
|
-
observerRootMargin:
|
|
2386
|
+
observerRootMargin: h = "0px 0px 200px 0px",
|
|
2249
2387
|
observerThreshold: p = 0
|
|
2250
|
-
} = n, y =
|
|
2251
|
-
if (!(!
|
|
2388
|
+
} = n, y = M(!1), g = M(null), b = w(async () => {
|
|
2389
|
+
if (!(!u || !d) && !(l || y.current)) {
|
|
2252
2390
|
y.current = !0;
|
|
2253
2391
|
try {
|
|
2254
|
-
await
|
|
2392
|
+
await d();
|
|
2255
2393
|
} finally {
|
|
2256
2394
|
y.current = !1;
|
|
2257
2395
|
}
|
|
2258
2396
|
}
|
|
2259
|
-
}, [l, d
|
|
2397
|
+
}, [u, l, d]);
|
|
2260
2398
|
return O(() => {
|
|
2261
|
-
if (!
|
|
2262
|
-
const
|
|
2263
|
-
(
|
|
2264
|
-
|
|
2399
|
+
if (!u || !d || !g.current || typeof IntersectionObserver > "u") return;
|
|
2400
|
+
const S = new IntersectionObserver(
|
|
2401
|
+
(E) => {
|
|
2402
|
+
E.some((v) => v.isIntersecting) && b();
|
|
2265
2403
|
},
|
|
2266
2404
|
{
|
|
2267
|
-
rootMargin:
|
|
2405
|
+
rootMargin: h,
|
|
2268
2406
|
threshold: p
|
|
2269
2407
|
}
|
|
2270
2408
|
);
|
|
2271
|
-
return
|
|
2409
|
+
return S.observe(g.current), () => S.disconnect();
|
|
2272
2410
|
}, [
|
|
2273
|
-
l,
|
|
2274
2411
|
u,
|
|
2275
|
-
|
|
2412
|
+
d,
|
|
2413
|
+
h,
|
|
2276
2414
|
p,
|
|
2277
2415
|
b
|
|
2278
|
-
]), r ? /* @__PURE__ */
|
|
2279
|
-
a == null ? void 0 : a.map((
|
|
2280
|
-
|
|
2281
|
-
] }) : /* @__PURE__ */
|
|
2282
|
-
},
|
|
2416
|
+
]), r ? /* @__PURE__ */ f(ne, {}) : /* @__PURE__ */ f(ae, { children: a != null && a.length ? /* @__PURE__ */ k("ul", { className: `pretty-grid-main ${t}`, children: [
|
|
2417
|
+
a == null ? void 0 : a.map((S) => /* @__PURE__ */ f("li", { className: `pretty-grid-item ${s}`, children: c(S) }, S.id)),
|
|
2418
|
+
u && d && /* @__PURE__ */ f("li", { className: "pretty-grid-load-more", ref: g, children: m })
|
|
2419
|
+
] }) : /* @__PURE__ */ f(ae, { children: i || /* @__PURE__ */ f(os, { message: o }) }) });
|
|
2420
|
+
}, Ge = re({
|
|
2283
2421
|
title: "",
|
|
2284
2422
|
setTitle: () => {
|
|
2285
2423
|
},
|
|
2286
2424
|
rightContent: null,
|
|
2287
2425
|
setRightContent: () => {
|
|
2288
2426
|
}
|
|
2289
|
-
}),
|
|
2290
|
-
const { children: e } = n, [t, s] =
|
|
2291
|
-
s(
|
|
2292
|
-
}, []), c = w((
|
|
2293
|
-
|
|
2427
|
+
}), en = (n) => {
|
|
2428
|
+
const { children: e } = n, [t, s] = _(""), [r, i] = _(null), o = w((u) => {
|
|
2429
|
+
s(u);
|
|
2430
|
+
}, []), c = w((u) => {
|
|
2431
|
+
i(u);
|
|
2294
2432
|
}, []), a = Q(
|
|
2295
2433
|
() => ({
|
|
2296
2434
|
title: t,
|
|
2297
|
-
setTitle:
|
|
2435
|
+
setTitle: o,
|
|
2298
2436
|
rightContent: r,
|
|
2299
2437
|
setRightContent: c
|
|
2300
2438
|
}),
|
|
2301
|
-
[t,
|
|
2439
|
+
[t, o, r, c]
|
|
2302
2440
|
);
|
|
2303
|
-
return /* @__PURE__ */
|
|
2304
|
-
},
|
|
2305
|
-
function
|
|
2306
|
-
const { t: e } =
|
|
2307
|
-
(
|
|
2441
|
+
return /* @__PURE__ */ f(Ge.Provider, { value: a, children: e });
|
|
2442
|
+
}, Zt = () => ie(Ge);
|
|
2443
|
+
function tn(n) {
|
|
2444
|
+
const { t: e } = N(), { openDrawer: t, showSearch: s = !0, menuButtonProps: r } = n, { searchComponent: i, location: o } = ce(), { title: c, rightContent: a } = Zt(), [u, l] = _(!1), d = w((p) => {
|
|
2445
|
+
(qt() ? p.metaKey : p.ctrlKey) && p.shiftKey && p.key.toLowerCase() === "f" && (l(!0), p.preventDefault());
|
|
2308
2446
|
}, []);
|
|
2309
|
-
O(() => (window.addEventListener("keydown",
|
|
2310
|
-
window.removeEventListener("keydown",
|
|
2311
|
-
}), [
|
|
2312
|
-
const m =
|
|
2313
|
-
return /* @__PURE__ */ k(
|
|
2314
|
-
|
|
2447
|
+
O(() => (window.addEventListener("keydown", d), () => {
|
|
2448
|
+
window.removeEventListener("keydown", d);
|
|
2449
|
+
}), [d]);
|
|
2450
|
+
const m = i, h = s && !!m;
|
|
2451
|
+
return /* @__PURE__ */ k(ae, { children: [
|
|
2452
|
+
o.pathname !== "/" && !!m && /* @__PURE__ */ f(m, { open: u, onClose: () => l(!1) }),
|
|
2315
2453
|
/* @__PURE__ */ k("header", { id: "header", className: "header", children: [
|
|
2316
2454
|
/* @__PURE__ */ k("div", { className: "navbar-left", children: [
|
|
2317
|
-
/* @__PURE__ */
|
|
2318
|
-
|
|
2455
|
+
/* @__PURE__ */ f(
|
|
2456
|
+
G,
|
|
2319
2457
|
{
|
|
2320
2458
|
...r,
|
|
2321
2459
|
type: (r == null ? void 0 : r.type) ?? "button",
|
|
2322
|
-
icon: (r == null ? void 0 : r.icon) ??
|
|
2460
|
+
icon: (r == null ? void 0 : r.icon) ?? Tt,
|
|
2323
2461
|
onClick: (p) => {
|
|
2324
2462
|
var y;
|
|
2325
2463
|
(y = r == null ? void 0 : r.onClick) == null || y.call(r, p), t();
|
|
@@ -2329,30 +2467,30 @@ function Ws(n) {
|
|
|
2329
2467
|
className: `navbar-menu animated ${(r == null ? void 0 : r.className) ?? ""}`
|
|
2330
2468
|
}
|
|
2331
2469
|
),
|
|
2332
|
-
/* @__PURE__ */
|
|
2470
|
+
/* @__PURE__ */ f("h1", { className: "poppins navbar-title", children: c || e("_pages:home.appName") })
|
|
2333
2471
|
] }),
|
|
2334
2472
|
/* @__PURE__ */ k("div", { className: "navbar-right", children: [
|
|
2335
2473
|
a,
|
|
2336
|
-
|
|
2337
|
-
|
|
2474
|
+
h && /* @__PURE__ */ f(
|
|
2475
|
+
G,
|
|
2338
2476
|
{
|
|
2339
|
-
icon:
|
|
2477
|
+
icon: Nt,
|
|
2340
2478
|
className: "navbar-search-btn",
|
|
2341
|
-
onClick: () =>
|
|
2479
|
+
onClick: () => l(!0)
|
|
2342
2480
|
}
|
|
2343
2481
|
)
|
|
2344
2482
|
] })
|
|
2345
2483
|
] })
|
|
2346
2484
|
] });
|
|
2347
2485
|
}
|
|
2348
|
-
const
|
|
2486
|
+
const de = 300, es = (n) => n ?? R.error, ts = (n) => {
|
|
2349
2487
|
switch (n) {
|
|
2350
2488
|
case R.error:
|
|
2351
|
-
return
|
|
2489
|
+
return $t;
|
|
2352
2490
|
default:
|
|
2353
|
-
return
|
|
2491
|
+
return Et;
|
|
2354
2492
|
}
|
|
2355
|
-
},
|
|
2493
|
+
}, Se = (n) => {
|
|
2356
2494
|
switch (n) {
|
|
2357
2495
|
case R.success:
|
|
2358
2496
|
return "!text-success";
|
|
@@ -2363,7 +2501,7 @@ const le = 300, zt = (n) => n ?? R.error, Jt = (n) => {
|
|
|
2363
2501
|
default:
|
|
2364
2502
|
return "!text-info";
|
|
2365
2503
|
}
|
|
2366
|
-
},
|
|
2504
|
+
}, ss = (n) => {
|
|
2367
2505
|
switch (n) {
|
|
2368
2506
|
case R.success:
|
|
2369
2507
|
return "bg-bg-success";
|
|
@@ -2375,96 +2513,96 @@ const le = 300, zt = (n) => n ?? R.error, Jt = (n) => {
|
|
|
2375
2513
|
return "bg-bg-info";
|
|
2376
2514
|
}
|
|
2377
2515
|
};
|
|
2378
|
-
function
|
|
2379
|
-
const { t: n } =
|
|
2380
|
-
|
|
2381
|
-
|
|
2516
|
+
function sn() {
|
|
2517
|
+
const { t: n } = N(), { notification: e, removeNotification: t } = ee(), [s, r] = _([]), i = M(s);
|
|
2518
|
+
ft(() => {
|
|
2519
|
+
i.current = s;
|
|
2382
2520
|
});
|
|
2383
|
-
const
|
|
2521
|
+
const o = M(null), c = w(
|
|
2384
2522
|
(a) => {
|
|
2385
2523
|
r(
|
|
2386
|
-
(
|
|
2524
|
+
(u) => a !== void 0 ? u.map((l) => l.id === a ? { ...l, closing: !0 } : l) : u.map((l) => ({ ...l, closing: !0 }))
|
|
2387
2525
|
), a !== void 0 ? setTimeout(() => {
|
|
2388
|
-
t(a), r((
|
|
2389
|
-
},
|
|
2390
|
-
t(), r([]),
|
|
2391
|
-
},
|
|
2526
|
+
t(a), r((u) => u.filter((l) => l.id !== a));
|
|
2527
|
+
}, de) : (o.current && clearTimeout(o.current), o.current = setTimeout(() => {
|
|
2528
|
+
t(), r([]), o.current = null;
|
|
2529
|
+
}, de));
|
|
2392
2530
|
},
|
|
2393
2531
|
[t]
|
|
2394
2532
|
);
|
|
2395
2533
|
return O(() => {
|
|
2396
2534
|
let a = null;
|
|
2397
|
-
const
|
|
2398
|
-
a && clearTimeout(a),
|
|
2535
|
+
const u = () => {
|
|
2536
|
+
a && clearTimeout(a), o.current && (clearTimeout(o.current), o.current = null);
|
|
2399
2537
|
};
|
|
2400
2538
|
if (e.length === 0)
|
|
2401
|
-
return
|
|
2402
|
-
r((
|
|
2403
|
-
}, 0),
|
|
2404
|
-
r([]),
|
|
2405
|
-
},
|
|
2406
|
-
const
|
|
2539
|
+
return i.current.length === 0 ? void 0 : (o.current && clearTimeout(o.current), a = setTimeout(() => {
|
|
2540
|
+
r((h) => h.map((p) => ({ ...p, closing: !0 }))), a = null;
|
|
2541
|
+
}, 0), o.current = setTimeout(() => {
|
|
2542
|
+
r([]), o.current = null;
|
|
2543
|
+
}, de), u);
|
|
2544
|
+
const l = new Set(i.current.map((h) => h.id));
|
|
2407
2545
|
if (!e.some(
|
|
2408
|
-
(
|
|
2546
|
+
(h) => h.id !== void 0 && !l.has(h.id)
|
|
2409
2547
|
)) return;
|
|
2410
|
-
if (
|
|
2411
|
-
const
|
|
2548
|
+
if (i.current.length === 0) {
|
|
2549
|
+
const h = [...e];
|
|
2412
2550
|
return a = setTimeout(() => {
|
|
2413
|
-
r(
|
|
2551
|
+
r(h.map((p) => ({ ...p, closing: !1 }))), a = null;
|
|
2414
2552
|
}, 0), () => {
|
|
2415
2553
|
a && clearTimeout(a);
|
|
2416
2554
|
};
|
|
2417
2555
|
}
|
|
2418
|
-
|
|
2556
|
+
o.current && clearTimeout(o.current), a = setTimeout(() => {
|
|
2419
2557
|
r(
|
|
2420
|
-
(
|
|
2558
|
+
(h) => h.every((p) => p.closing) ? h : h.map((p) => ({ ...p, closing: !0 }))
|
|
2421
2559
|
), a = null;
|
|
2422
2560
|
}, 0);
|
|
2423
2561
|
const m = [...e];
|
|
2424
|
-
return
|
|
2425
|
-
r(m.map((
|
|
2426
|
-
},
|
|
2562
|
+
return o.current = setTimeout(() => {
|
|
2563
|
+
r(m.map((h) => ({ ...h, closing: !1 }))), o.current = null;
|
|
2564
|
+
}, de), u;
|
|
2427
2565
|
}, [e]), O(() => {
|
|
2428
2566
|
if (!s.length) return;
|
|
2429
2567
|
let a;
|
|
2430
|
-
const
|
|
2568
|
+
const u = window.setTimeout(() => {
|
|
2431
2569
|
a = () => c(), window.addEventListener("click", a);
|
|
2432
|
-
}, 0),
|
|
2433
|
-
|
|
2570
|
+
}, 0), l = (d) => {
|
|
2571
|
+
d.key === "Escape" && c();
|
|
2434
2572
|
};
|
|
2435
|
-
return window.addEventListener("keydown",
|
|
2436
|
-
window.clearTimeout(
|
|
2573
|
+
return window.addEventListener("keydown", l), () => {
|
|
2574
|
+
window.clearTimeout(u), a && window.removeEventListener("click", a), window.removeEventListener("keydown", l);
|
|
2437
2575
|
};
|
|
2438
|
-
}, [s.length, c]),
|
|
2439
|
-
/* @__PURE__ */
|
|
2440
|
-
const m =
|
|
2576
|
+
}, [s.length, c]), Fe(
|
|
2577
|
+
/* @__PURE__ */ f("div", { className: `notification-portal ${s.length ? "active" : ""}`, children: s.map(({ id: a, type: u, message: l, closing: d }) => {
|
|
2578
|
+
const m = es(u);
|
|
2441
2579
|
return /* @__PURE__ */ k(
|
|
2442
2580
|
"div",
|
|
2443
2581
|
{
|
|
2444
|
-
className: `notification ${
|
|
2445
|
-
onClick: (
|
|
2582
|
+
className: `notification ${d ? "closing" : ""} ${ss(m)}`,
|
|
2583
|
+
onClick: (h) => h.stopPropagation(),
|
|
2446
2584
|
children: [
|
|
2447
2585
|
/* @__PURE__ */ k("div", { className: "notification-body", children: [
|
|
2448
|
-
/* @__PURE__ */
|
|
2449
|
-
|
|
2586
|
+
/* @__PURE__ */ f(
|
|
2587
|
+
K,
|
|
2450
2588
|
{
|
|
2451
|
-
icon:
|
|
2452
|
-
className: `notification-icon ${
|
|
2589
|
+
icon: ts(m),
|
|
2590
|
+
className: `notification-icon ${Se(m)}`
|
|
2453
2591
|
}
|
|
2454
2592
|
),
|
|
2455
|
-
/* @__PURE__ */
|
|
2593
|
+
/* @__PURE__ */ f("p", { className: `notification-text ${Se(m)}`, children: l })
|
|
2456
2594
|
] }),
|
|
2457
|
-
/* @__PURE__ */
|
|
2458
|
-
|
|
2595
|
+
/* @__PURE__ */ f(
|
|
2596
|
+
G,
|
|
2459
2597
|
{
|
|
2460
2598
|
type: "button",
|
|
2461
|
-
icon:
|
|
2599
|
+
icon: _e,
|
|
2462
2600
|
color: "error",
|
|
2463
2601
|
className: "notification-close group",
|
|
2464
|
-
onClick: (
|
|
2465
|
-
|
|
2602
|
+
onClick: (h) => {
|
|
2603
|
+
h.stopPropagation(), a !== void 0 && c(a);
|
|
2466
2604
|
},
|
|
2467
|
-
iconClassName: `${
|
|
2605
|
+
iconClassName: `${Se(m)} notification-close-icon`,
|
|
2468
2606
|
name: n("_accessibility:buttons.closeNotification"),
|
|
2469
2607
|
"aria-label": n("_accessibility:ariaLabels.closeNotification")
|
|
2470
2608
|
}
|
|
@@ -2477,83 +2615,83 @@ function Gs() {
|
|
|
2477
2615
|
document.body
|
|
2478
2616
|
);
|
|
2479
2617
|
}
|
|
2480
|
-
function
|
|
2618
|
+
function nn(n) {
|
|
2481
2619
|
const { className: e, ...t } = n;
|
|
2482
|
-
return /* @__PURE__ */
|
|
2483
|
-
|
|
2620
|
+
return /* @__PURE__ */ f("div", { className: "splash-screen", children: /* @__PURE__ */ f(
|
|
2621
|
+
ne,
|
|
2484
2622
|
{
|
|
2485
2623
|
className: `blur-appear ${e ? ` ${e}` : ""}`,
|
|
2486
2624
|
...t
|
|
2487
2625
|
}
|
|
2488
2626
|
) });
|
|
2489
2627
|
}
|
|
2490
|
-
const
|
|
2628
|
+
const ns = (n) => {
|
|
2491
2629
|
const {
|
|
2492
2630
|
id: e,
|
|
2493
2631
|
active: t,
|
|
2494
2632
|
onClick: s,
|
|
2495
2633
|
children: r,
|
|
2496
|
-
to:
|
|
2497
|
-
useLinks:
|
|
2634
|
+
to: i,
|
|
2635
|
+
useLinks: o = !0,
|
|
2498
2636
|
tabButtonProps: c
|
|
2499
|
-
} = n, { linkComponent: a } =
|
|
2500
|
-
if (!
|
|
2637
|
+
} = n, { linkComponent: a } = ce(), u = a;
|
|
2638
|
+
if (!o) {
|
|
2501
2639
|
const {
|
|
2502
|
-
className:
|
|
2640
|
+
className: d = "",
|
|
2503
2641
|
variant: m = t ? "submit" : "outlined",
|
|
2504
|
-
color:
|
|
2642
|
+
color: h = t ? "primary" : "default",
|
|
2505
2643
|
...p
|
|
2506
2644
|
} = c ?? {};
|
|
2507
|
-
return /* @__PURE__ */
|
|
2508
|
-
|
|
2645
|
+
return /* @__PURE__ */ f(
|
|
2646
|
+
U,
|
|
2509
2647
|
{
|
|
2510
2648
|
type: "button",
|
|
2511
2649
|
variant: m,
|
|
2512
|
-
color:
|
|
2513
|
-
className: `tab ${
|
|
2650
|
+
color: h,
|
|
2651
|
+
className: `tab ${d}`,
|
|
2514
2652
|
onClick: s,
|
|
2515
2653
|
...p,
|
|
2516
2654
|
children: r
|
|
2517
2655
|
}
|
|
2518
2656
|
);
|
|
2519
2657
|
}
|
|
2520
|
-
const
|
|
2521
|
-
return /* @__PURE__ */
|
|
2522
|
-
|
|
2658
|
+
const l = `button submit tab ${t ? "primary" : "outlined"} ${(c == null ? void 0 : c.className) ?? ""}`.trim();
|
|
2659
|
+
return /* @__PURE__ */ f(
|
|
2660
|
+
u,
|
|
2523
2661
|
{
|
|
2524
|
-
to:
|
|
2662
|
+
to: i ?? `#${e}`,
|
|
2525
2663
|
onClick: () => s(),
|
|
2526
|
-
className:
|
|
2664
|
+
className: l,
|
|
2527
2665
|
children: r
|
|
2528
2666
|
}
|
|
2529
2667
|
);
|
|
2530
|
-
},
|
|
2531
|
-
var
|
|
2668
|
+
}, rs = (n) => {
|
|
2669
|
+
var h;
|
|
2532
2670
|
const {
|
|
2533
2671
|
tabs: e = [],
|
|
2534
2672
|
defaultTab: t,
|
|
2535
2673
|
currentTab: s,
|
|
2536
2674
|
onTabChange: r,
|
|
2537
|
-
className:
|
|
2538
|
-
tabsContainerClassName:
|
|
2675
|
+
className: i = "",
|
|
2676
|
+
tabsContainerClassName: o = "",
|
|
2539
2677
|
useLinks: c = !0,
|
|
2540
2678
|
tabButtonProps: a
|
|
2541
|
-
} = n, [
|
|
2542
|
-
return /* @__PURE__ */ k("div", { className: `tabs-layout-main ${
|
|
2543
|
-
/* @__PURE__ */
|
|
2679
|
+
} = n, [u, l] = _(t ?? ((h = e[0]) == null ? void 0 : h.id)), d = s ?? u, m = Q(() => e.find((p) => p.id === d), [e, d]);
|
|
2680
|
+
return /* @__PURE__ */ k("div", { className: `tabs-layout-main ${i}`, children: [
|
|
2681
|
+
/* @__PURE__ */ f(
|
|
2544
2682
|
"ul",
|
|
2545
2683
|
{
|
|
2546
|
-
className: `horizontal tabs tabs-container ${
|
|
2547
|
-
children: e.map(({ id: p, to: y, label: g }) => /* @__PURE__ */
|
|
2548
|
-
|
|
2684
|
+
className: `horizontal tabs tabs-container ${o}`,
|
|
2685
|
+
children: e.map(({ id: p, to: y, label: g }) => /* @__PURE__ */ f("li", { children: /* @__PURE__ */ f(
|
|
2686
|
+
ns,
|
|
2549
2687
|
{
|
|
2550
2688
|
onClick: () => {
|
|
2551
|
-
s === void 0 &&
|
|
2689
|
+
s === void 0 && l(p), r == null || r(p);
|
|
2552
2690
|
},
|
|
2553
2691
|
id: p,
|
|
2554
2692
|
to: y,
|
|
2555
2693
|
siblings: e.length > 1,
|
|
2556
|
-
active:
|
|
2694
|
+
active: d === p,
|
|
2557
2695
|
useLinks: c,
|
|
2558
2696
|
tabButtonProps: a,
|
|
2559
2697
|
children: g
|
|
@@ -2563,123 +2701,123 @@ const Xt = (n) => {
|
|
|
2563
2701
|
),
|
|
2564
2702
|
m == null ? void 0 : m.content
|
|
2565
2703
|
] });
|
|
2566
|
-
},
|
|
2704
|
+
}, is = (n) => {
|
|
2567
2705
|
const {
|
|
2568
2706
|
title: e,
|
|
2569
2707
|
body: t,
|
|
2570
2708
|
content: s,
|
|
2571
2709
|
onClickNext: r,
|
|
2572
|
-
onSkip:
|
|
2573
|
-
onStartAsGuest:
|
|
2710
|
+
onSkip: i,
|
|
2711
|
+
onStartAsGuest: o,
|
|
2574
2712
|
onSignIn: c,
|
|
2575
2713
|
image: a = "",
|
|
2576
|
-
alt:
|
|
2577
|
-
final:
|
|
2578
|
-
} = n, { t:
|
|
2714
|
+
alt: u = "",
|
|
2715
|
+
final: l = !1
|
|
2716
|
+
} = n, { t: d } = N();
|
|
2579
2717
|
return /* @__PURE__ */ k("div", { className: "big-appear step-container", children: [
|
|
2580
|
-
a && /* @__PURE__ */
|
|
2581
|
-
e != null && /* @__PURE__ */
|
|
2582
|
-
t != null && /* @__PURE__ */
|
|
2583
|
-
s != null && /* @__PURE__ */
|
|
2584
|
-
/* @__PURE__ */
|
|
2585
|
-
/* @__PURE__ */
|
|
2586
|
-
|
|
2718
|
+
a && /* @__PURE__ */ f("img", { src: a, alt: u }),
|
|
2719
|
+
e != null && /* @__PURE__ */ f("h2", { className: "step-title", children: e }),
|
|
2720
|
+
t != null && /* @__PURE__ */ f("div", { className: "step-body", children: t }),
|
|
2721
|
+
s != null && /* @__PURE__ */ f("div", { className: "step-content", children: s }),
|
|
2722
|
+
/* @__PURE__ */ f("div", { className: "step-actions", children: l ? /* @__PURE__ */ k(ae, { children: [
|
|
2723
|
+
/* @__PURE__ */ f(
|
|
2724
|
+
U,
|
|
2587
2725
|
{
|
|
2588
2726
|
color: "primary",
|
|
2589
2727
|
className: "step-button",
|
|
2590
2728
|
variant: "outlined",
|
|
2591
|
-
onClick:
|
|
2592
|
-
"aria-label":
|
|
2593
|
-
children:
|
|
2729
|
+
onClick: o,
|
|
2730
|
+
"aria-label": d("_accessibility:ariaLabels.start"),
|
|
2731
|
+
children: d("_accessibility:buttons.startAsGuest")
|
|
2594
2732
|
}
|
|
2595
2733
|
),
|
|
2596
|
-
/* @__PURE__ */
|
|
2597
|
-
|
|
2734
|
+
/* @__PURE__ */ f(
|
|
2735
|
+
U,
|
|
2598
2736
|
{
|
|
2599
2737
|
color: "primary",
|
|
2600
2738
|
variant: "submit",
|
|
2601
2739
|
className: "step-button",
|
|
2602
|
-
"aria-label":
|
|
2740
|
+
"aria-label": d("_accessibility:ariaLabels.start"),
|
|
2603
2741
|
onClick: c,
|
|
2604
|
-
children:
|
|
2742
|
+
children: d("_accessibility:buttons.signIn")
|
|
2605
2743
|
}
|
|
2606
2744
|
)
|
|
2607
|
-
] }) : /* @__PURE__ */ k(
|
|
2608
|
-
/* @__PURE__ */
|
|
2609
|
-
|
|
2745
|
+
] }) : /* @__PURE__ */ k(ae, { children: [
|
|
2746
|
+
/* @__PURE__ */ f(
|
|
2747
|
+
U,
|
|
2610
2748
|
{
|
|
2611
2749
|
color: "primary",
|
|
2612
2750
|
className: "step-button",
|
|
2613
2751
|
variant: "outlined",
|
|
2614
|
-
onClick:
|
|
2615
|
-
"aria-label":
|
|
2616
|
-
children:
|
|
2752
|
+
onClick: i,
|
|
2753
|
+
"aria-label": d("_accessibility:ariaLabels.skip"),
|
|
2754
|
+
children: d("_accessibility:buttons.skip")
|
|
2617
2755
|
}
|
|
2618
2756
|
),
|
|
2619
|
-
/* @__PURE__ */
|
|
2620
|
-
|
|
2757
|
+
/* @__PURE__ */ f(
|
|
2758
|
+
U,
|
|
2621
2759
|
{
|
|
2622
2760
|
color: "primary",
|
|
2623
2761
|
className: "step-button",
|
|
2624
2762
|
variant: "outlined",
|
|
2625
2763
|
onClick: () => r(),
|
|
2626
|
-
"aria-label":
|
|
2627
|
-
children:
|
|
2764
|
+
"aria-label": d("_accessibility:ariaLabels.next"),
|
|
2765
|
+
children: d("_accessibility:buttons.next")
|
|
2628
2766
|
}
|
|
2629
2767
|
)
|
|
2630
2768
|
] }) })
|
|
2631
2769
|
] });
|
|
2632
|
-
},
|
|
2770
|
+
}, rn = (n) => {
|
|
2633
2771
|
const {
|
|
2634
2772
|
steps: e,
|
|
2635
2773
|
signInPath: t = "/auth/sign-in",
|
|
2636
2774
|
guestPath: s = "/",
|
|
2637
2775
|
onSkip: r,
|
|
2638
|
-
onSignIn:
|
|
2639
|
-
onStartAsGuest:
|
|
2640
|
-
} = n, { setGuestMode: c } =
|
|
2776
|
+
onSignIn: i,
|
|
2777
|
+
onStartAsGuest: o
|
|
2778
|
+
} = n, { setGuestMode: c } = He(), { navigate: a } = ce(), [u, l] = _(1), d = w(() => {
|
|
2641
2779
|
if (r) {
|
|
2642
2780
|
r();
|
|
2643
2781
|
return;
|
|
2644
2782
|
}
|
|
2645
2783
|
a(t);
|
|
2646
2784
|
}, [a, r, t]), m = w(() => {
|
|
2647
|
-
if (
|
|
2648
|
-
|
|
2785
|
+
if (i) {
|
|
2786
|
+
i();
|
|
2649
2787
|
return;
|
|
2650
2788
|
}
|
|
2651
2789
|
a(t);
|
|
2652
|
-
}, [a,
|
|
2653
|
-
if (
|
|
2654
|
-
|
|
2790
|
+
}, [a, i, t]), h = w(() => {
|
|
2791
|
+
if (o) {
|
|
2792
|
+
o();
|
|
2655
2793
|
return;
|
|
2656
2794
|
}
|
|
2657
2795
|
c(!0), a(s);
|
|
2658
|
-
}, [s, a,
|
|
2796
|
+
}, [s, a, o, c]), p = Q(() => e.map((y, g) => ({
|
|
2659
2797
|
id: g + 1,
|
|
2660
2798
|
label: "",
|
|
2661
|
-
content: /* @__PURE__ */
|
|
2662
|
-
|
|
2799
|
+
content: /* @__PURE__ */ f(
|
|
2800
|
+
is,
|
|
2663
2801
|
{
|
|
2664
2802
|
...y,
|
|
2665
2803
|
final: g === e.length - 1,
|
|
2666
|
-
onClickNext: () =>
|
|
2667
|
-
onSkip:
|
|
2668
|
-
onStartAsGuest:
|
|
2804
|
+
onClickNext: () => l((b) => b + 1),
|
|
2805
|
+
onSkip: d,
|
|
2806
|
+
onStartAsGuest: h,
|
|
2669
2807
|
onSignIn: m
|
|
2670
2808
|
}
|
|
2671
2809
|
)
|
|
2672
|
-
})), [m,
|
|
2673
|
-
return /* @__PURE__ */
|
|
2674
|
-
|
|
2810
|
+
})), [m, d, h, e]);
|
|
2811
|
+
return /* @__PURE__ */ f("div", { className: "onboarding-main", children: /* @__PURE__ */ f(
|
|
2812
|
+
rs,
|
|
2675
2813
|
{
|
|
2676
|
-
currentTab:
|
|
2677
|
-
onTabChange: (y) =>
|
|
2814
|
+
currentTab: u,
|
|
2815
|
+
onTabChange: (y) => l(Number(y)),
|
|
2678
2816
|
tabs: p,
|
|
2679
2817
|
useLinks: !1
|
|
2680
2818
|
}
|
|
2681
2819
|
) });
|
|
2682
|
-
},
|
|
2820
|
+
}, os = (n) => {
|
|
2683
2821
|
const {
|
|
2684
2822
|
message: e,
|
|
2685
2823
|
messageProps: t = { className: "empty-message" },
|
|
@@ -2687,90 +2825,94 @@ const Xt = (n) => {
|
|
|
2687
2825
|
iconProps: r
|
|
2688
2826
|
} = n;
|
|
2689
2827
|
return /* @__PURE__ */ k("div", { className: "empty-container", children: [
|
|
2690
|
-
r && /* @__PURE__ */
|
|
2691
|
-
/* @__PURE__ */
|
|
2692
|
-
s && /* @__PURE__ */
|
|
2828
|
+
r && /* @__PURE__ */ f(K, { ...r }),
|
|
2829
|
+
/* @__PURE__ */ f("p", { ...t, children: e }),
|
|
2830
|
+
s && /* @__PURE__ */ f(ht, { showTooltips: !1, showText: !0, ...s })
|
|
2693
2831
|
] });
|
|
2694
2832
|
};
|
|
2695
2833
|
export {
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2834
|
+
me as APIClient,
|
|
2835
|
+
ln as Action,
|
|
2836
|
+
un as Actions,
|
|
2837
|
+
dn as ActionsDropdown,
|
|
2838
|
+
G as AppIconButton,
|
|
2839
|
+
Kt as AuthClient,
|
|
2840
|
+
Os as AuthProvider,
|
|
2841
|
+
Ns as BaseClient,
|
|
2842
|
+
mn as Button,
|
|
2843
|
+
Ms as ConfigProvider,
|
|
2844
|
+
vs as ConfirmationDialog,
|
|
2845
|
+
ke as Dialog,
|
|
2846
|
+
ve as DialogActions,
|
|
2847
|
+
Ps as Drawer,
|
|
2848
|
+
Ve as DrawerMenuContext,
|
|
2849
|
+
Ds as DrawerMenuProvider,
|
|
2850
|
+
os as Empty,
|
|
2851
|
+
Ys as Error,
|
|
2852
|
+
ws as FormContainer,
|
|
2853
|
+
ks as FormDialog,
|
|
2854
|
+
z as GlobalActions,
|
|
2855
|
+
Ts as IManager,
|
|
2856
|
+
G as IconButton,
|
|
2857
|
+
Cs as ImportDialog,
|
|
2858
|
+
Es as IndexedDBClient,
|
|
2859
|
+
Fs as ManagerProvider,
|
|
2860
|
+
F as Methods,
|
|
2861
|
+
tn as Navbar,
|
|
2862
|
+
Ge as NavbarContext,
|
|
2863
|
+
en as NavbarProvider,
|
|
2864
|
+
sn as Notification,
|
|
2727
2865
|
R as NotificationEnumType,
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2866
|
+
Rs as NotificationProvider,
|
|
2867
|
+
rn as Onboarding,
|
|
2868
|
+
Xs as Page,
|
|
2869
|
+
bs as ParagraphInput,
|
|
2870
|
+
Ss as PasswordInput,
|
|
2871
|
+
Zs as PrettyGrid,
|
|
2872
|
+
nn as SplashScreen,
|
|
2873
|
+
is as Step,
|
|
2874
|
+
ns as Tab,
|
|
2875
|
+
rs as TabsLayout,
|
|
2876
|
+
Js as ToTop,
|
|
2739
2877
|
Pt as buildQueryUrl,
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2878
|
+
qe as createQueryClient,
|
|
2879
|
+
$s as enumToKeyValueArray,
|
|
2880
|
+
Ls as formatForDatetimeLocal,
|
|
2881
|
+
X as fromLocal,
|
|
2882
|
+
xs as getFormattedDateTime,
|
|
2883
|
+
As as getShortFormattedDateTime,
|
|
2884
|
+
fe as isHttpError,
|
|
2885
|
+
qt as isMac,
|
|
2886
|
+
he as isValidationError,
|
|
2887
|
+
be as makeRequest,
|
|
2888
|
+
_s as mapValidationErrors,
|
|
2889
|
+
Pe as parseQueries,
|
|
2890
|
+
Is as queryClient,
|
|
2891
|
+
P as removeFromLocal,
|
|
2892
|
+
W as toLocal,
|
|
2893
|
+
He as useAuth,
|
|
2894
|
+
ce as useConfig,
|
|
2895
|
+
Be as useConfirmationForm,
|
|
2896
|
+
Bt as useDeleteAction,
|
|
2897
|
+
js as useDeleteDialog,
|
|
2898
|
+
We as useDialog,
|
|
2899
|
+
Ht as useDrawerMenu,
|
|
2900
|
+
Us as useEditAction,
|
|
2901
|
+
Qs as useEntityFormDialog,
|
|
2902
|
+
Gt as useExportAction,
|
|
2903
|
+
zs as useExportActionMutate,
|
|
2904
|
+
pe as useFormDialog,
|
|
2905
|
+
Hs as useFormDialogLegacy,
|
|
2906
|
+
zt as useImportAction,
|
|
2907
|
+
Gs as useImportDialog,
|
|
2908
|
+
Ut as useManager,
|
|
2909
|
+
Zt as useNavbar,
|
|
2910
|
+
ee as useNotification,
|
|
2911
|
+
Vs as usePostDialog,
|
|
2912
|
+
qs as usePostForm,
|
|
2913
|
+
Bs as usePutDialog,
|
|
2914
|
+
Wt as useRestoreAction,
|
|
2915
|
+
Ws as useRestoreDialog,
|
|
2916
|
+
Yt as useScrollTrigger,
|
|
2917
|
+
Ks as useTimeAge
|
|
2776
2918
|
};
|