sera-components 1.1.10 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/basic/ExternalComponent.d.ts +16 -0
- package/dist/basic/Menu.d.ts +29 -28
- package/dist/basic/index.d.ts +1 -0
- package/dist/data/display/index.d.ts +3 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2504 -1234
- package/dist/index.umd.cjs +15 -4
- package/dist/types.d.ts +5 -0
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { isObjectProperty as
|
|
10
|
-
import { IMaskInput as
|
|
11
|
-
import { flexRender as
|
|
12
|
-
var
|
|
1
|
+
var sn = Object.defineProperty;
|
|
2
|
+
var un = (e, n, t) => n in e ? sn(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
|
|
3
|
+
var G = (e, n, t) => un(e, typeof n != "symbol" ? n + "" : n, t);
|
|
4
|
+
import * as h from "react";
|
|
5
|
+
import cn, { createContext as Ct, useContext as se, useMemo as E, useState as $, useEffect as Te } from "react";
|
|
6
|
+
import { Paper as te, Image as dn, Text as R, Menu as ie, Button as B, Container as fn, Alert as qe, Stack as pe, Flex as z, Loader as Ee, NavLink as lt, Checkbox as ge, Group as D, Input as U, useCombobox as Rt, Combobox as F, Grid as _, InputBase as hn, PasswordInput as mn, CloseButton as gn, Divider as pn, Tooltip as Et, Fieldset as xn, Table as kt, rem as de, Pagination as vn, MenuTarget as yn, MenuDropdown as bn, MenuItem as wn, Tabs as ye } from "@mantine/core";
|
|
7
|
+
import { IconCheck as jn, IconInfoCircle as Ke, IconChevronRight as Sn, IconSearch as Tt, IconHelpOctagonFilled as Nt, IconPlus as Cn, IconPencil as Rn, IconReload as En, IconDatabaseImport as kn, IconDownload as Tn, IconSelector as Nn } from "@tabler/icons-react";
|
|
8
|
+
import { observer as Z } from "mobx-react-lite";
|
|
9
|
+
import { isObjectProperty as ue, isDraftRecord as Pt } from "sera-db";
|
|
10
|
+
import { IMaskInput as Pn } from "react-imask";
|
|
11
|
+
import { flexRender as st, useReactTable as It, getCoreRowModel as Lt, getPaginationRowModel as In } from "@tanstack/react-table";
|
|
12
|
+
var be = { exports: {} }, fe = {};
|
|
13
13
|
/**
|
|
14
14
|
* @license React
|
|
15
15
|
* react-jsx-runtime.production.js
|
|
@@ -19,29 +19,29 @@ var oe = { exports: {} }, Z = {};
|
|
|
19
19
|
* This source code is licensed under the MIT license found in the
|
|
20
20
|
* LICENSE file in the root directory of this source tree.
|
|
21
21
|
*/
|
|
22
|
-
var
|
|
23
|
-
function
|
|
24
|
-
if (
|
|
25
|
-
|
|
26
|
-
var e = Symbol.for("react.transitional.element"),
|
|
27
|
-
function
|
|
28
|
-
var
|
|
29
|
-
if (
|
|
30
|
-
|
|
31
|
-
for (var
|
|
32
|
-
|
|
33
|
-
} else
|
|
34
|
-
return r =
|
|
22
|
+
var ut;
|
|
23
|
+
function Ln() {
|
|
24
|
+
if (ut) return fe;
|
|
25
|
+
ut = 1;
|
|
26
|
+
var e = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
|
|
27
|
+
function t(a, r, o) {
|
|
28
|
+
var l = null;
|
|
29
|
+
if (o !== void 0 && (l = "" + o), r.key !== void 0 && (l = "" + r.key), "key" in r) {
|
|
30
|
+
o = {};
|
|
31
|
+
for (var s in r)
|
|
32
|
+
s !== "key" && (o[s] = r[s]);
|
|
33
|
+
} else o = r;
|
|
34
|
+
return r = o.ref, {
|
|
35
35
|
$$typeof: e,
|
|
36
|
-
type:
|
|
37
|
-
key:
|
|
36
|
+
type: a,
|
|
37
|
+
key: l,
|
|
38
38
|
ref: r !== void 0 ? r : null,
|
|
39
|
-
props:
|
|
39
|
+
props: o
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
return
|
|
42
|
+
return fe.Fragment = n, fe.jsx = t, fe.jsxs = t, fe;
|
|
43
43
|
}
|
|
44
|
-
var
|
|
44
|
+
var he = {};
|
|
45
45
|
/**
|
|
46
46
|
* @license React
|
|
47
47
|
* react-jsx-runtime.development.js
|
|
@@ -51,245 +51,245 @@ var X = {};
|
|
|
51
51
|
* This source code is licensed under the MIT license found in the
|
|
52
52
|
* LICENSE file in the root directory of this source tree.
|
|
53
53
|
*/
|
|
54
|
-
var
|
|
55
|
-
function
|
|
56
|
-
return
|
|
57
|
-
function e(
|
|
58
|
-
if (
|
|
59
|
-
if (typeof
|
|
60
|
-
return
|
|
61
|
-
if (typeof
|
|
62
|
-
switch (
|
|
63
|
-
case
|
|
54
|
+
var ct;
|
|
55
|
+
function Fn() {
|
|
56
|
+
return ct || (ct = 1, process.env.NODE_ENV !== "production" && function() {
|
|
57
|
+
function e(m) {
|
|
58
|
+
if (m == null) return null;
|
|
59
|
+
if (typeof m == "function")
|
|
60
|
+
return m.$$typeof === H ? null : m.displayName || m.name || null;
|
|
61
|
+
if (typeof m == "string") return m;
|
|
62
|
+
switch (m) {
|
|
63
|
+
case b:
|
|
64
64
|
return "Fragment";
|
|
65
|
-
case
|
|
65
|
+
case w:
|
|
66
66
|
return "Profiler";
|
|
67
|
-
case
|
|
67
|
+
case j:
|
|
68
68
|
return "StrictMode";
|
|
69
|
-
case
|
|
69
|
+
case T:
|
|
70
70
|
return "Suspense";
|
|
71
|
-
case
|
|
71
|
+
case re:
|
|
72
72
|
return "SuspenseList";
|
|
73
|
-
case
|
|
73
|
+
case A:
|
|
74
74
|
return "Activity";
|
|
75
75
|
}
|
|
76
|
-
if (typeof
|
|
77
|
-
switch (typeof
|
|
76
|
+
if (typeof m == "object")
|
|
77
|
+
switch (typeof m.tag == "number" && console.error(
|
|
78
78
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
79
|
-
),
|
|
80
|
-
case
|
|
79
|
+
), m.$$typeof) {
|
|
80
|
+
case x:
|
|
81
81
|
return "Portal";
|
|
82
|
-
case
|
|
83
|
-
return (
|
|
84
|
-
case
|
|
85
|
-
return (
|
|
86
|
-
case
|
|
87
|
-
var
|
|
88
|
-
return
|
|
89
|
-
case
|
|
90
|
-
return
|
|
91
|
-
case
|
|
92
|
-
|
|
82
|
+
case v:
|
|
83
|
+
return (m.displayName || "Context") + ".Provider";
|
|
84
|
+
case y:
|
|
85
|
+
return (m._context.displayName || "Context") + ".Consumer";
|
|
86
|
+
case C:
|
|
87
|
+
var S = m.render;
|
|
88
|
+
return m = m.displayName, m || (m = S.displayName || S.name || "", m = m !== "" ? "ForwardRef(" + m + ")" : "ForwardRef"), m;
|
|
89
|
+
case Q:
|
|
90
|
+
return S = m.displayName || null, S !== null ? S : e(m.type) || "Memo";
|
|
91
|
+
case ee:
|
|
92
|
+
S = m._payload, m = m._init;
|
|
93
93
|
try {
|
|
94
|
-
return e(
|
|
94
|
+
return e(m(S));
|
|
95
95
|
} catch {
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
return null;
|
|
99
99
|
}
|
|
100
|
-
function
|
|
101
|
-
return "" +
|
|
100
|
+
function n(m) {
|
|
101
|
+
return "" + m;
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function t(m) {
|
|
104
104
|
try {
|
|
105
|
-
|
|
106
|
-
var
|
|
105
|
+
n(m);
|
|
106
|
+
var S = !1;
|
|
107
107
|
} catch {
|
|
108
|
-
|
|
108
|
+
S = !0;
|
|
109
109
|
}
|
|
110
|
-
if (
|
|
111
|
-
|
|
112
|
-
var
|
|
113
|
-
return
|
|
114
|
-
|
|
110
|
+
if (S) {
|
|
111
|
+
S = console;
|
|
112
|
+
var k = S.error, I = typeof Symbol == "function" && Symbol.toStringTag && m[Symbol.toStringTag] || m.constructor.name || "Object";
|
|
113
|
+
return k.call(
|
|
114
|
+
S,
|
|
115
115
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
116
|
-
|
|
117
|
-
),
|
|
116
|
+
I
|
|
117
|
+
), n(m);
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
function
|
|
121
|
-
if (
|
|
122
|
-
if (typeof
|
|
120
|
+
function a(m) {
|
|
121
|
+
if (m === b) return "<>";
|
|
122
|
+
if (typeof m == "object" && m !== null && m.$$typeof === ee)
|
|
123
123
|
return "<...>";
|
|
124
124
|
try {
|
|
125
|
-
var
|
|
126
|
-
return
|
|
125
|
+
var S = e(m);
|
|
126
|
+
return S ? "<" + S + ">" : "<...>";
|
|
127
127
|
} catch {
|
|
128
128
|
return "<...>";
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
function r() {
|
|
132
|
-
var
|
|
133
|
-
return
|
|
132
|
+
var m = ae.A;
|
|
133
|
+
return m === null ? null : m.getOwner();
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function o() {
|
|
136
136
|
return Error("react-stack-top-frame");
|
|
137
137
|
}
|
|
138
|
-
function
|
|
139
|
-
if (
|
|
140
|
-
var
|
|
141
|
-
if (
|
|
138
|
+
function l(m) {
|
|
139
|
+
if (tt.call(m, "key")) {
|
|
140
|
+
var S = Object.getOwnPropertyDescriptor(m, "key").get;
|
|
141
|
+
if (S && S.isReactWarning) return !1;
|
|
142
142
|
}
|
|
143
|
-
return
|
|
143
|
+
return m.key !== void 0;
|
|
144
144
|
}
|
|
145
|
-
function
|
|
146
|
-
function
|
|
147
|
-
|
|
145
|
+
function s(m, S) {
|
|
146
|
+
function k() {
|
|
147
|
+
nt || (nt = !0, console.error(
|
|
148
148
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
149
|
-
|
|
149
|
+
S
|
|
150
150
|
));
|
|
151
151
|
}
|
|
152
|
-
|
|
153
|
-
get:
|
|
152
|
+
k.isReactWarning = !0, Object.defineProperty(m, "key", {
|
|
153
|
+
get: k,
|
|
154
154
|
configurable: !0
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
|
-
function
|
|
158
|
-
var
|
|
159
|
-
return
|
|
157
|
+
function u() {
|
|
158
|
+
var m = e(this.type);
|
|
159
|
+
return rt[m] || (rt[m] = !0, console.error(
|
|
160
160
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
161
|
-
)),
|
|
161
|
+
)), m = this.props.ref, m !== void 0 ? m : null;
|
|
162
162
|
}
|
|
163
|
-
function
|
|
164
|
-
return
|
|
165
|
-
$$typeof:
|
|
166
|
-
type:
|
|
167
|
-
key:
|
|
168
|
-
props:
|
|
169
|
-
_owner:
|
|
170
|
-
}, (
|
|
163
|
+
function c(m, S, k, I, Y, M, $e, Ae) {
|
|
164
|
+
return k = M.ref, m = {
|
|
165
|
+
$$typeof: f,
|
|
166
|
+
type: m,
|
|
167
|
+
key: S,
|
|
168
|
+
props: M,
|
|
169
|
+
_owner: Y
|
|
170
|
+
}, (k !== void 0 ? k : null) !== null ? Object.defineProperty(m, "ref", {
|
|
171
171
|
enumerable: !1,
|
|
172
|
-
get:
|
|
173
|
-
}) : Object.defineProperty(
|
|
172
|
+
get: u
|
|
173
|
+
}) : Object.defineProperty(m, "ref", { enumerable: !1, value: null }), m._store = {}, Object.defineProperty(m._store, "validated", {
|
|
174
174
|
configurable: !1,
|
|
175
175
|
enumerable: !1,
|
|
176
176
|
writable: !0,
|
|
177
177
|
value: 0
|
|
178
|
-
}), Object.defineProperty(
|
|
178
|
+
}), Object.defineProperty(m, "_debugInfo", {
|
|
179
179
|
configurable: !1,
|
|
180
180
|
enumerable: !1,
|
|
181
181
|
writable: !0,
|
|
182
182
|
value: null
|
|
183
|
-
}), Object.defineProperty(
|
|
183
|
+
}), Object.defineProperty(m, "_debugStack", {
|
|
184
184
|
configurable: !1,
|
|
185
185
|
enumerable: !1,
|
|
186
186
|
writable: !0,
|
|
187
|
-
value:
|
|
188
|
-
}), Object.defineProperty(
|
|
187
|
+
value: $e
|
|
188
|
+
}), Object.defineProperty(m, "_debugTask", {
|
|
189
189
|
configurable: !1,
|
|
190
190
|
enumerable: !1,
|
|
191
191
|
writable: !0,
|
|
192
|
-
value:
|
|
193
|
-
}), Object.freeze && (Object.freeze(
|
|
192
|
+
value: Ae
|
|
193
|
+
}), Object.freeze && (Object.freeze(m.props), Object.freeze(m)), m;
|
|
194
194
|
}
|
|
195
|
-
function m
|
|
196
|
-
var
|
|
197
|
-
if (
|
|
198
|
-
if (
|
|
199
|
-
if (
|
|
200
|
-
for (
|
|
201
|
-
|
|
202
|
-
Object.freeze && Object.freeze(
|
|
195
|
+
function d(m, S, k, I, Y, M, $e, Ae) {
|
|
196
|
+
var L = S.children;
|
|
197
|
+
if (L !== void 0)
|
|
198
|
+
if (I)
|
|
199
|
+
if (on(L)) {
|
|
200
|
+
for (I = 0; I < L.length; I++)
|
|
201
|
+
g(L[I]);
|
|
202
|
+
Object.freeze && Object.freeze(L);
|
|
203
203
|
} else
|
|
204
204
|
console.error(
|
|
205
205
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
206
206
|
);
|
|
207
|
-
else
|
|
208
|
-
if (
|
|
209
|
-
|
|
210
|
-
var
|
|
211
|
-
return
|
|
207
|
+
else g(L);
|
|
208
|
+
if (tt.call(S, "key")) {
|
|
209
|
+
L = e(m);
|
|
210
|
+
var oe = Object.keys(S).filter(function(ln) {
|
|
211
|
+
return ln !== "key";
|
|
212
212
|
});
|
|
213
|
-
|
|
213
|
+
I = 0 < oe.length ? "{key: someKey, " + oe.join(": ..., ") + ": ...}" : "{key: someKey}", it[L + I] || (oe = 0 < oe.length ? "{" + oe.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
214
214
|
`A props object containing a "key" prop is being spread into JSX:
|
|
215
215
|
let props = %s;
|
|
216
216
|
<%s {...props} />
|
|
217
217
|
React keys must be passed directly to JSX without using spread:
|
|
218
218
|
let props = %s;
|
|
219
219
|
<%s key={someKey} {...props} />`,
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
),
|
|
220
|
+
I,
|
|
221
|
+
L,
|
|
222
|
+
oe,
|
|
223
|
+
L
|
|
224
|
+
), it[L + I] = !0);
|
|
225
225
|
}
|
|
226
|
-
if (
|
|
227
|
-
|
|
228
|
-
for (var
|
|
229
|
-
|
|
230
|
-
} else
|
|
231
|
-
return
|
|
232
|
-
|
|
233
|
-
typeof
|
|
234
|
-
),
|
|
235
|
-
|
|
236
|
-
N,
|
|
226
|
+
if (L = null, k !== void 0 && (t(k), L = "" + k), l(S) && (t(S.key), L = "" + S.key), "key" in S) {
|
|
227
|
+
k = {};
|
|
228
|
+
for (var Oe in S)
|
|
229
|
+
Oe !== "key" && (k[Oe] = S[Oe]);
|
|
230
|
+
} else k = S;
|
|
231
|
+
return L && s(
|
|
232
|
+
k,
|
|
233
|
+
typeof m == "function" ? m.displayName || m.name || "Unknown" : m
|
|
234
|
+
), c(
|
|
235
|
+
m,
|
|
237
236
|
L,
|
|
238
|
-
|
|
237
|
+
M,
|
|
238
|
+
Y,
|
|
239
239
|
r(),
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
240
|
+
k,
|
|
241
|
+
$e,
|
|
242
|
+
Ae
|
|
243
243
|
);
|
|
244
244
|
}
|
|
245
|
-
function
|
|
246
|
-
typeof
|
|
245
|
+
function g(m) {
|
|
246
|
+
typeof m == "object" && m !== null && m.$$typeof === f && m._store && (m._store.validated = 1);
|
|
247
247
|
}
|
|
248
|
-
var
|
|
248
|
+
var p = cn, f = Symbol.for("react.transitional.element"), x = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), j = Symbol.for("react.strict_mode"), w = Symbol.for("react.profiler"), y = Symbol.for("react.consumer"), v = Symbol.for("react.context"), C = Symbol.for("react.forward_ref"), T = Symbol.for("react.suspense"), re = Symbol.for("react.suspense_list"), Q = Symbol.for("react.memo"), ee = Symbol.for("react.lazy"), A = Symbol.for("react.activity"), H = Symbol.for("react.client.reference"), ae = p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, tt = Object.prototype.hasOwnProperty, on = Array.isArray, _e = console.createTask ? console.createTask : function() {
|
|
249
249
|
return null;
|
|
250
250
|
};
|
|
251
|
-
|
|
252
|
-
react_stack_bottom_frame: function(
|
|
253
|
-
return
|
|
251
|
+
p = {
|
|
252
|
+
react_stack_bottom_frame: function(m) {
|
|
253
|
+
return m();
|
|
254
254
|
}
|
|
255
255
|
};
|
|
256
|
-
var
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
)(),
|
|
260
|
-
|
|
261
|
-
var
|
|
262
|
-
return
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
w,
|
|
266
|
-
!1,
|
|
256
|
+
var nt, rt = {}, at = p.react_stack_bottom_frame.bind(
|
|
257
|
+
p,
|
|
258
|
+
o
|
|
259
|
+
)(), ot = _e(a(o)), it = {};
|
|
260
|
+
he.Fragment = b, he.jsx = function(m, S, k, I, Y) {
|
|
261
|
+
var M = 1e4 > ae.recentlyCreatedOwnerStacks++;
|
|
262
|
+
return d(
|
|
263
|
+
m,
|
|
264
|
+
S,
|
|
267
265
|
k,
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
266
|
+
!1,
|
|
267
|
+
I,
|
|
268
|
+
Y,
|
|
269
|
+
M ? Error("react-stack-top-frame") : at,
|
|
270
|
+
M ? _e(a(m)) : ot
|
|
271
271
|
);
|
|
272
|
-
},
|
|
273
|
-
var
|
|
274
|
-
return
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
w,
|
|
278
|
-
!0,
|
|
272
|
+
}, he.jsxs = function(m, S, k, I, Y) {
|
|
273
|
+
var M = 1e4 > ae.recentlyCreatedOwnerStacks++;
|
|
274
|
+
return d(
|
|
275
|
+
m,
|
|
276
|
+
S,
|
|
279
277
|
k,
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
278
|
+
!0,
|
|
279
|
+
I,
|
|
280
|
+
Y,
|
|
281
|
+
M ? Error("react-stack-top-frame") : at,
|
|
282
|
+
M ? _e(a(m)) : ot
|
|
283
283
|
);
|
|
284
284
|
};
|
|
285
|
-
}()),
|
|
285
|
+
}()), he;
|
|
286
286
|
}
|
|
287
|
-
var
|
|
288
|
-
function
|
|
289
|
-
return
|
|
287
|
+
var dt;
|
|
288
|
+
function _n() {
|
|
289
|
+
return dt || (dt = 1, process.env.NODE_ENV === "production" ? be.exports = Ln() : be.exports = Fn()), be.exports;
|
|
290
290
|
}
|
|
291
|
-
var
|
|
292
|
-
const
|
|
291
|
+
var i = _n();
|
|
292
|
+
const N = {
|
|
293
293
|
UK: {
|
|
294
294
|
svgFlag: "https://flagcdn.com/gb.svg",
|
|
295
295
|
emojiFlag: "🇬🇧"
|
|
@@ -350,72 +350,1351 @@ const T = {
|
|
|
350
350
|
svgFlag: "https://flagcdn.com/in.svg",
|
|
351
351
|
emojiFlag: "🇮🇳"
|
|
352
352
|
}
|
|
353
|
-
},
|
|
354
|
-
|
|
353
|
+
}, $n = ({ flag: e }) => /* @__PURE__ */ i.jsx(te, { shadow: "xs", w: 20, h: 14, children: /* @__PURE__ */ i.jsx(dn, { src: e.svgFlag, w: 20, h: 14, fit: "cover" }) }), An = ({ flag: e }) => /* @__PURE__ */ i.jsx(
|
|
354
|
+
R,
|
|
355
355
|
{
|
|
356
356
|
component: "span",
|
|
357
|
-
style: (
|
|
357
|
+
style: (n) => ({ textShadow: n.shadows.xs }),
|
|
358
358
|
children: e.emojiFlag
|
|
359
359
|
}
|
|
360
|
-
),
|
|
360
|
+
), Be = navigator.userAgent.includes("Windows") ? $n : An, xe = Ct(new Intl.Locale("en-US")), Ja = Z(
|
|
361
361
|
({
|
|
362
362
|
value: e,
|
|
363
|
-
children:
|
|
364
|
-
}) => /* @__PURE__ */
|
|
365
|
-
),
|
|
363
|
+
children: n
|
|
364
|
+
}) => /* @__PURE__ */ i.jsx(xe.Provider, { value: e.locale, children: n })
|
|
365
|
+
), On = {
|
|
366
366
|
lang2value: {
|
|
367
367
|
en: "Choose Language",
|
|
368
368
|
vi: "Chọn ngôn ngữ"
|
|
369
369
|
}
|
|
370
|
-
},
|
|
370
|
+
}, we = {
|
|
371
371
|
en: {
|
|
372
372
|
name: "English",
|
|
373
|
-
flag:
|
|
373
|
+
flag: N.US,
|
|
374
374
|
locale: new Intl.Locale("en-US")
|
|
375
375
|
},
|
|
376
376
|
vi: {
|
|
377
377
|
name: "Tiếng Việt",
|
|
378
|
-
flag:
|
|
378
|
+
flag: N.VN,
|
|
379
379
|
locale: new Intl.Locale("vi-VN")
|
|
380
380
|
}
|
|
381
|
-
},
|
|
381
|
+
}, Xa = ({
|
|
382
382
|
locale: e,
|
|
383
|
-
setLocale:
|
|
383
|
+
setLocale: n
|
|
384
384
|
}) => {
|
|
385
|
-
const
|
|
386
|
-
([
|
|
387
|
-
|
|
385
|
+
const t = E(() => Object.entries(we).map(
|
|
386
|
+
([a, { flag: r, name: o, locale: l }]) => /* @__PURE__ */ i.jsx(
|
|
387
|
+
ie.Item,
|
|
388
388
|
{
|
|
389
|
-
onClick: () =>
|
|
390
|
-
leftSection: /* @__PURE__ */
|
|
391
|
-
rightSection: e.language ===
|
|
392
|
-
children: /* @__PURE__ */
|
|
389
|
+
onClick: () => n(l),
|
|
390
|
+
leftSection: /* @__PURE__ */ i.jsx(Be, { flag: r }),
|
|
391
|
+
rightSection: e.language === a && /* @__PURE__ */ i.jsx(jn, { size: "15", color: "#2986cc", stroke: 2 }),
|
|
392
|
+
children: /* @__PURE__ */ i.jsx(R, { size: "sm", children: o })
|
|
393
393
|
},
|
|
394
|
-
|
|
394
|
+
a
|
|
395
395
|
)
|
|
396
|
-
), [
|
|
397
|
-
return /* @__PURE__ */
|
|
398
|
-
/* @__PURE__ */
|
|
399
|
-
|
|
396
|
+
), [we, e]);
|
|
397
|
+
return /* @__PURE__ */ i.jsxs(ie, { width: 170, children: [
|
|
398
|
+
/* @__PURE__ */ i.jsx(ie.Target, { children: /* @__PURE__ */ i.jsx(
|
|
399
|
+
B,
|
|
400
400
|
{
|
|
401
401
|
variant: "subtle",
|
|
402
402
|
size: "sm",
|
|
403
|
-
leftSection: /* @__PURE__ */
|
|
404
|
-
children: /* @__PURE__ */
|
|
403
|
+
leftSection: /* @__PURE__ */ i.jsx(Be, { flag: we[e.language].flag }),
|
|
404
|
+
children: /* @__PURE__ */ i.jsx(R, { size: "sm", children: we[e.language].name })
|
|
405
405
|
}
|
|
406
406
|
) }),
|
|
407
|
-
/* @__PURE__ */
|
|
408
|
-
/* @__PURE__ */
|
|
409
|
-
|
|
407
|
+
/* @__PURE__ */ i.jsxs(ie.Dropdown, { children: [
|
|
408
|
+
/* @__PURE__ */ i.jsx(ie.Label, { children: /* @__PURE__ */ i.jsx(R, { size: "sm", children: On.lang2value[e.language] }) }),
|
|
409
|
+
t
|
|
410
410
|
] })
|
|
411
411
|
] });
|
|
412
|
-
},
|
|
413
|
-
const
|
|
414
|
-
return e.lang2value[
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
412
|
+
}, O = ({ value: e }) => {
|
|
413
|
+
const n = se(xe);
|
|
414
|
+
return e.lang2value[n.language] || e.lang2value[e.lang];
|
|
415
|
+
};
|
|
416
|
+
/**
|
|
417
|
+
* react-router v7.8.2
|
|
418
|
+
*
|
|
419
|
+
* Copyright (c) Remix Software Inc.
|
|
420
|
+
*
|
|
421
|
+
* This source code is licensed under the MIT license found in the
|
|
422
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
423
|
+
*
|
|
424
|
+
* @license MIT
|
|
425
|
+
*/
|
|
426
|
+
function P(e, n) {
|
|
427
|
+
if (e === !1 || e === null || typeof e > "u")
|
|
428
|
+
throw new Error(n);
|
|
429
|
+
}
|
|
430
|
+
function q(e, n) {
|
|
431
|
+
if (!e) {
|
|
432
|
+
typeof console < "u" && console.warn(n);
|
|
433
|
+
try {
|
|
434
|
+
throw new Error(n);
|
|
435
|
+
} catch {
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
function Ue({
|
|
440
|
+
pathname: e = "/",
|
|
441
|
+
search: n = "",
|
|
442
|
+
hash: t = ""
|
|
443
|
+
}) {
|
|
444
|
+
return n && n !== "?" && (e += n.charAt(0) === "?" ? n : "?" + n), t && t !== "#" && (e += t.charAt(0) === "#" ? t : "#" + t), e;
|
|
445
|
+
}
|
|
446
|
+
function Ve(e) {
|
|
447
|
+
let n = {};
|
|
448
|
+
if (e) {
|
|
449
|
+
let t = e.indexOf("#");
|
|
450
|
+
t >= 0 && (n.hash = e.substring(t), e = e.substring(0, t));
|
|
451
|
+
let a = e.indexOf("?");
|
|
452
|
+
a >= 0 && (n.search = e.substring(a), e = e.substring(0, a)), e && (n.pathname = e);
|
|
453
|
+
}
|
|
454
|
+
return n;
|
|
455
|
+
}
|
|
456
|
+
function Ft(e, n, t = "/") {
|
|
457
|
+
return Dn(e, n, t, !1);
|
|
458
|
+
}
|
|
459
|
+
function Dn(e, n, t, a) {
|
|
460
|
+
let r = typeof n == "string" ? Ve(n) : n, o = J(r.pathname || "/", t);
|
|
461
|
+
if (o == null)
|
|
462
|
+
return null;
|
|
463
|
+
let l = _t(e);
|
|
464
|
+
Mn(l);
|
|
465
|
+
let s = null;
|
|
466
|
+
for (let u = 0; s == null && u < l.length; ++u) {
|
|
467
|
+
let c = Jn(o);
|
|
468
|
+
s = Yn(
|
|
469
|
+
l[u],
|
|
470
|
+
c,
|
|
471
|
+
a
|
|
472
|
+
);
|
|
473
|
+
}
|
|
474
|
+
return s;
|
|
475
|
+
}
|
|
476
|
+
function _t(e, n = [], t = [], a = "", r = !1) {
|
|
477
|
+
let o = (l, s, u = r, c) => {
|
|
478
|
+
let d = {
|
|
479
|
+
relativePath: c === void 0 ? l.path || "" : c,
|
|
480
|
+
caseSensitive: l.caseSensitive === !0,
|
|
481
|
+
childrenIndex: s,
|
|
482
|
+
route: l
|
|
483
|
+
};
|
|
484
|
+
if (d.relativePath.startsWith("/")) {
|
|
485
|
+
if (!d.relativePath.startsWith(a) && u)
|
|
486
|
+
return;
|
|
487
|
+
P(
|
|
488
|
+
d.relativePath.startsWith(a),
|
|
489
|
+
`Absolute route path "${d.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`
|
|
490
|
+
), d.relativePath = d.relativePath.slice(a.length);
|
|
491
|
+
}
|
|
492
|
+
let g = W([a, d.relativePath]), p = t.concat(d);
|
|
493
|
+
l.children && l.children.length > 0 && (P(
|
|
494
|
+
// Our types know better, but runtime JS may not!
|
|
495
|
+
// @ts-expect-error
|
|
496
|
+
l.index !== !0,
|
|
497
|
+
`Index routes must not have child routes. Please remove all child routes from route path "${g}".`
|
|
498
|
+
), _t(
|
|
499
|
+
l.children,
|
|
500
|
+
n,
|
|
501
|
+
p,
|
|
502
|
+
g,
|
|
503
|
+
u
|
|
504
|
+
)), !(l.path == null && !l.index) && n.push({
|
|
505
|
+
path: g,
|
|
506
|
+
score: Vn(g, l.index),
|
|
507
|
+
routesMeta: p
|
|
508
|
+
});
|
|
509
|
+
};
|
|
510
|
+
return e.forEach((l, s) => {
|
|
511
|
+
var u;
|
|
512
|
+
if (l.path === "" || !((u = l.path) != null && u.includes("?")))
|
|
513
|
+
o(l, s);
|
|
514
|
+
else
|
|
515
|
+
for (let c of $t(l.path))
|
|
516
|
+
o(l, s, !0, c);
|
|
517
|
+
}), n;
|
|
518
|
+
}
|
|
519
|
+
function $t(e) {
|
|
520
|
+
let n = e.split("/");
|
|
521
|
+
if (n.length === 0) return [];
|
|
522
|
+
let [t, ...a] = n, r = t.endsWith("?"), o = t.replace(/\?$/, "");
|
|
523
|
+
if (a.length === 0)
|
|
524
|
+
return r ? [o, ""] : [o];
|
|
525
|
+
let l = $t(a.join("/")), s = [];
|
|
526
|
+
return s.push(
|
|
527
|
+
...l.map(
|
|
528
|
+
(u) => u === "" ? o : [o, u].join("/")
|
|
529
|
+
)
|
|
530
|
+
), r && s.push(...l), s.map(
|
|
531
|
+
(u) => e.startsWith("/") && u === "" ? "/" : u
|
|
532
|
+
);
|
|
533
|
+
}
|
|
534
|
+
function Mn(e) {
|
|
535
|
+
e.sort(
|
|
536
|
+
(n, t) => n.score !== t.score ? t.score - n.score : Hn(
|
|
537
|
+
n.routesMeta.map((a) => a.childrenIndex),
|
|
538
|
+
t.routesMeta.map((a) => a.childrenIndex)
|
|
539
|
+
)
|
|
540
|
+
);
|
|
541
|
+
}
|
|
542
|
+
var zn = /^:[\w-]+$/, Bn = 3, Un = 2, Wn = 1, qn = 10, Kn = -2, ft = (e) => e === "*";
|
|
543
|
+
function Vn(e, n) {
|
|
544
|
+
let t = e.split("/"), a = t.length;
|
|
545
|
+
return t.some(ft) && (a += Kn), n && (a += Un), t.filter((r) => !ft(r)).reduce(
|
|
546
|
+
(r, o) => r + (zn.test(o) ? Bn : o === "" ? Wn : qn),
|
|
547
|
+
a
|
|
548
|
+
);
|
|
549
|
+
}
|
|
550
|
+
function Hn(e, n) {
|
|
551
|
+
return e.length === n.length && e.slice(0, -1).every((a, r) => a === n[r]) ? (
|
|
552
|
+
// If two routes are siblings, we should try to match the earlier sibling
|
|
553
|
+
// first. This allows people to have fine-grained control over the matching
|
|
554
|
+
// behavior by simply putting routes with identical paths in the order they
|
|
555
|
+
// want them tried.
|
|
556
|
+
e[e.length - 1] - n[n.length - 1]
|
|
557
|
+
) : (
|
|
558
|
+
// Otherwise, it doesn't really make sense to rank non-siblings by index,
|
|
559
|
+
// so they sort equally.
|
|
560
|
+
0
|
|
561
|
+
);
|
|
562
|
+
}
|
|
563
|
+
function Yn(e, n, t = !1) {
|
|
564
|
+
let { routesMeta: a } = e, r = {}, o = "/", l = [];
|
|
565
|
+
for (let s = 0; s < a.length; ++s) {
|
|
566
|
+
let u = a[s], c = s === a.length - 1, d = o === "/" ? n : n.slice(o.length) || "/", g = ke(
|
|
567
|
+
{ path: u.relativePath, caseSensitive: u.caseSensitive, end: c },
|
|
568
|
+
d
|
|
569
|
+
), p = u.route;
|
|
570
|
+
if (!g && c && t && !a[a.length - 1].route.index && (g = ke(
|
|
571
|
+
{
|
|
572
|
+
path: u.relativePath,
|
|
573
|
+
caseSensitive: u.caseSensitive,
|
|
574
|
+
end: !1
|
|
575
|
+
},
|
|
576
|
+
d
|
|
577
|
+
)), !g)
|
|
578
|
+
return null;
|
|
579
|
+
Object.assign(r, g.params), l.push({
|
|
580
|
+
// TODO: Can this as be avoided?
|
|
581
|
+
params: r,
|
|
582
|
+
pathname: W([o, g.pathname]),
|
|
583
|
+
pathnameBase: er(
|
|
584
|
+
W([o, g.pathnameBase])
|
|
585
|
+
),
|
|
586
|
+
route: p
|
|
587
|
+
}), g.pathnameBase !== "/" && (o = W([o, g.pathnameBase]));
|
|
588
|
+
}
|
|
589
|
+
return l;
|
|
590
|
+
}
|
|
591
|
+
function ke(e, n) {
|
|
592
|
+
typeof e == "string" && (e = { path: e, caseSensitive: !1, end: !0 });
|
|
593
|
+
let [t, a] = Gn(
|
|
594
|
+
e.path,
|
|
595
|
+
e.caseSensitive,
|
|
596
|
+
e.end
|
|
597
|
+
), r = n.match(t);
|
|
598
|
+
if (!r) return null;
|
|
599
|
+
let o = r[0], l = o.replace(/(.)\/+$/, "$1"), s = r.slice(1);
|
|
600
|
+
return {
|
|
601
|
+
params: a.reduce(
|
|
602
|
+
(c, { paramName: d, isOptional: g }, p) => {
|
|
603
|
+
if (d === "*") {
|
|
604
|
+
let x = s[p] || "";
|
|
605
|
+
l = o.slice(0, o.length - x.length).replace(/(.)\/+$/, "$1");
|
|
606
|
+
}
|
|
607
|
+
const f = s[p];
|
|
608
|
+
return g && !f ? c[d] = void 0 : c[d] = (f || "").replace(/%2F/g, "/"), c;
|
|
609
|
+
},
|
|
610
|
+
{}
|
|
611
|
+
),
|
|
612
|
+
pathname: o,
|
|
613
|
+
pathnameBase: l,
|
|
614
|
+
pattern: e
|
|
615
|
+
};
|
|
616
|
+
}
|
|
617
|
+
function Gn(e, n = !1, t = !0) {
|
|
618
|
+
q(
|
|
619
|
+
e === "*" || !e.endsWith("*") || e.endsWith("/*"),
|
|
620
|
+
`Route path "${e}" will be treated as if it were "${e.replace(/\*$/, "/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/, "/*")}".`
|
|
621
|
+
);
|
|
622
|
+
let a = [], r = "^" + e.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(
|
|
623
|
+
/\/:([\w-]+)(\?)?/g,
|
|
624
|
+
(l, s, u) => (a.push({ paramName: s, isOptional: u != null }), u ? "/?([^\\/]+)?" : "/([^\\/]+)")
|
|
625
|
+
).replace(/\/([\w-]+)\?(\/|$)/g, "(/$1)?$2");
|
|
626
|
+
return e.endsWith("*") ? (a.push({ paramName: "*" }), r += e === "*" || e === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$") : t ? r += "\\/*$" : e !== "" && e !== "/" && (r += "(?:(?=\\/|$))"), [new RegExp(r, n ? void 0 : "i"), a];
|
|
627
|
+
}
|
|
628
|
+
function Jn(e) {
|
|
629
|
+
try {
|
|
630
|
+
return e.split("/").map((n) => decodeURIComponent(n).replace(/\//g, "%2F")).join("/");
|
|
631
|
+
} catch (n) {
|
|
632
|
+
return q(
|
|
633
|
+
!1,
|
|
634
|
+
`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`
|
|
635
|
+
), e;
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
function J(e, n) {
|
|
639
|
+
if (n === "/") return e;
|
|
640
|
+
if (!e.toLowerCase().startsWith(n.toLowerCase()))
|
|
641
|
+
return null;
|
|
642
|
+
let t = n.endsWith("/") ? n.length - 1 : n.length, a = e.charAt(t);
|
|
643
|
+
return a && a !== "/" ? null : e.slice(t) || "/";
|
|
644
|
+
}
|
|
645
|
+
function Xn(e, n = "/") {
|
|
646
|
+
let {
|
|
647
|
+
pathname: t,
|
|
648
|
+
search: a = "",
|
|
649
|
+
hash: r = ""
|
|
650
|
+
} = typeof e == "string" ? Ve(e) : e;
|
|
651
|
+
return {
|
|
652
|
+
pathname: t ? t.startsWith("/") ? t : Zn(t, n) : n,
|
|
653
|
+
search: tr(a),
|
|
654
|
+
hash: nr(r)
|
|
655
|
+
};
|
|
656
|
+
}
|
|
657
|
+
function Zn(e, n) {
|
|
658
|
+
let t = n.replace(/\/+$/, "").split("/");
|
|
659
|
+
return e.split("/").forEach((r) => {
|
|
660
|
+
r === ".." ? t.length > 1 && t.pop() : r !== "." && t.push(r);
|
|
661
|
+
}), t.length > 1 ? t.join("/") : "/";
|
|
662
|
+
}
|
|
663
|
+
function De(e, n, t, a) {
|
|
664
|
+
return `Cannot include a '${e}' character in a manually specified \`to.${n}\` field [${JSON.stringify(
|
|
665
|
+
a
|
|
666
|
+
)}]. Please separate it out to the \`to.${t}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`;
|
|
667
|
+
}
|
|
668
|
+
function Qn(e) {
|
|
669
|
+
return e.filter(
|
|
670
|
+
(n, t) => t === 0 || n.route.path && n.route.path.length > 0
|
|
671
|
+
);
|
|
672
|
+
}
|
|
673
|
+
function At(e) {
|
|
674
|
+
let n = Qn(e);
|
|
675
|
+
return n.map(
|
|
676
|
+
(t, a) => a === n.length - 1 ? t.pathname : t.pathnameBase
|
|
677
|
+
);
|
|
678
|
+
}
|
|
679
|
+
function Ot(e, n, t, a = !1) {
|
|
680
|
+
let r;
|
|
681
|
+
typeof e == "string" ? r = Ve(e) : (r = { ...e }, P(
|
|
682
|
+
!r.pathname || !r.pathname.includes("?"),
|
|
683
|
+
De("?", "pathname", "search", r)
|
|
684
|
+
), P(
|
|
685
|
+
!r.pathname || !r.pathname.includes("#"),
|
|
686
|
+
De("#", "pathname", "hash", r)
|
|
687
|
+
), P(
|
|
688
|
+
!r.search || !r.search.includes("#"),
|
|
689
|
+
De("#", "search", "hash", r)
|
|
690
|
+
));
|
|
691
|
+
let o = e === "" || r.pathname === "", l = o ? "/" : r.pathname, s;
|
|
692
|
+
if (l == null)
|
|
693
|
+
s = t;
|
|
694
|
+
else {
|
|
695
|
+
let g = n.length - 1;
|
|
696
|
+
if (!a && l.startsWith("..")) {
|
|
697
|
+
let p = l.split("/");
|
|
698
|
+
for (; p[0] === ".."; )
|
|
699
|
+
p.shift(), g -= 1;
|
|
700
|
+
r.pathname = p.join("/");
|
|
701
|
+
}
|
|
702
|
+
s = g >= 0 ? n[g] : "/";
|
|
703
|
+
}
|
|
704
|
+
let u = Xn(r, s), c = l && l !== "/" && l.endsWith("/"), d = (o || l === ".") && t.endsWith("/");
|
|
705
|
+
return !u.pathname.endsWith("/") && (c || d) && (u.pathname += "/"), u;
|
|
706
|
+
}
|
|
707
|
+
var W = (e) => e.join("/").replace(/\/\/+/g, "/"), er = (e) => e.replace(/\/+$/, "").replace(/^\/*/, "/"), tr = (e) => !e || e === "?" ? "" : e.startsWith("?") ? e : "?" + e, nr = (e) => !e || e === "#" ? "" : e.startsWith("#") ? e : "#" + e;
|
|
708
|
+
function rr(e) {
|
|
709
|
+
return e != null && typeof e.status == "number" && typeof e.statusText == "string" && typeof e.internal == "boolean" && "data" in e;
|
|
710
|
+
}
|
|
711
|
+
var Dt = [
|
|
712
|
+
"POST",
|
|
713
|
+
"PUT",
|
|
714
|
+
"PATCH",
|
|
715
|
+
"DELETE"
|
|
716
|
+
];
|
|
717
|
+
new Set(
|
|
718
|
+
Dt
|
|
719
|
+
);
|
|
720
|
+
var ar = [
|
|
721
|
+
"GET",
|
|
722
|
+
...Dt
|
|
723
|
+
];
|
|
724
|
+
new Set(ar);
|
|
725
|
+
var ce = h.createContext(null);
|
|
726
|
+
ce.displayName = "DataRouter";
|
|
727
|
+
var Ne = h.createContext(null);
|
|
728
|
+
Ne.displayName = "DataRouterState";
|
|
729
|
+
h.createContext(!1);
|
|
730
|
+
var Mt = h.createContext({
|
|
731
|
+
isTransitioning: !1
|
|
732
|
+
});
|
|
733
|
+
Mt.displayName = "ViewTransition";
|
|
734
|
+
var or = h.createContext(
|
|
735
|
+
/* @__PURE__ */ new Map()
|
|
736
|
+
);
|
|
737
|
+
or.displayName = "Fetchers";
|
|
738
|
+
var ir = h.createContext(null);
|
|
739
|
+
ir.displayName = "Await";
|
|
740
|
+
var K = h.createContext(
|
|
741
|
+
null
|
|
742
|
+
);
|
|
743
|
+
K.displayName = "Navigation";
|
|
744
|
+
var He = h.createContext(
|
|
745
|
+
null
|
|
746
|
+
);
|
|
747
|
+
He.displayName = "Location";
|
|
748
|
+
var V = h.createContext({
|
|
749
|
+
outlet: null,
|
|
750
|
+
matches: [],
|
|
751
|
+
isDataRoute: !1
|
|
752
|
+
});
|
|
753
|
+
V.displayName = "Route";
|
|
754
|
+
var Ye = h.createContext(null);
|
|
755
|
+
Ye.displayName = "RouteError";
|
|
756
|
+
function lr(e, { relative: n } = {}) {
|
|
757
|
+
P(
|
|
758
|
+
Pe(),
|
|
759
|
+
// TODO: This error is probably because they somehow have 2 versions of the
|
|
760
|
+
// router loaded. We can help them understand how to avoid that.
|
|
761
|
+
"useHref() may be used only in the context of a <Router> component."
|
|
762
|
+
);
|
|
763
|
+
let { basename: t, navigator: a } = h.useContext(K), { hash: r, pathname: o, search: l } = ve(e, { relative: n }), s = o;
|
|
764
|
+
return t !== "/" && (s = o === "/" ? t : W([t, o])), a.createHref({ pathname: s, search: l, hash: r });
|
|
765
|
+
}
|
|
766
|
+
function Pe() {
|
|
767
|
+
return h.useContext(He) != null;
|
|
768
|
+
}
|
|
769
|
+
function ne() {
|
|
770
|
+
return P(
|
|
771
|
+
Pe(),
|
|
772
|
+
// TODO: This error is probably because they somehow have 2 versions of the
|
|
773
|
+
// router loaded. We can help them understand how to avoid that.
|
|
774
|
+
"useLocation() may be used only in the context of a <Router> component."
|
|
775
|
+
), h.useContext(He).location;
|
|
776
|
+
}
|
|
777
|
+
var zt = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
|
|
778
|
+
function Bt(e) {
|
|
779
|
+
h.useContext(K).static || h.useLayoutEffect(e);
|
|
780
|
+
}
|
|
781
|
+
function Ut() {
|
|
782
|
+
let { isDataRoute: e } = h.useContext(V);
|
|
783
|
+
return e ? br() : sr();
|
|
784
|
+
}
|
|
785
|
+
function sr() {
|
|
786
|
+
P(
|
|
787
|
+
Pe(),
|
|
788
|
+
// TODO: This error is probably because they somehow have 2 versions of the
|
|
789
|
+
// router loaded. We can help them understand how to avoid that.
|
|
790
|
+
"useNavigate() may be used only in the context of a <Router> component."
|
|
791
|
+
);
|
|
792
|
+
let e = h.useContext(ce), { basename: n, navigator: t } = h.useContext(K), { matches: a } = h.useContext(V), { pathname: r } = ne(), o = JSON.stringify(At(a)), l = h.useRef(!1);
|
|
793
|
+
return Bt(() => {
|
|
794
|
+
l.current = !0;
|
|
795
|
+
}), h.useCallback(
|
|
796
|
+
(u, c = {}) => {
|
|
797
|
+
if (q(l.current, zt), !l.current) return;
|
|
798
|
+
if (typeof u == "number") {
|
|
799
|
+
t.go(u);
|
|
800
|
+
return;
|
|
801
|
+
}
|
|
802
|
+
let d = Ot(
|
|
803
|
+
u,
|
|
804
|
+
JSON.parse(o),
|
|
805
|
+
r,
|
|
806
|
+
c.relative === "path"
|
|
807
|
+
);
|
|
808
|
+
e == null && n !== "/" && (d.pathname = d.pathname === "/" ? n : W([n, d.pathname])), (c.replace ? t.replace : t.push)(
|
|
809
|
+
d,
|
|
810
|
+
c.state,
|
|
811
|
+
c
|
|
812
|
+
);
|
|
813
|
+
},
|
|
814
|
+
[
|
|
815
|
+
n,
|
|
816
|
+
t,
|
|
817
|
+
o,
|
|
818
|
+
r,
|
|
819
|
+
e
|
|
820
|
+
]
|
|
821
|
+
);
|
|
822
|
+
}
|
|
823
|
+
h.createContext(null);
|
|
824
|
+
function ve(e, { relative: n } = {}) {
|
|
825
|
+
let { matches: t } = h.useContext(V), { pathname: a } = ne(), r = JSON.stringify(At(t));
|
|
826
|
+
return h.useMemo(
|
|
827
|
+
() => Ot(
|
|
828
|
+
e,
|
|
829
|
+
JSON.parse(r),
|
|
830
|
+
a,
|
|
831
|
+
n === "path"
|
|
832
|
+
),
|
|
833
|
+
[e, r, a, n]
|
|
834
|
+
);
|
|
835
|
+
}
|
|
836
|
+
function ur(e, n, t, a, r) {
|
|
837
|
+
P(
|
|
838
|
+
Pe(),
|
|
839
|
+
// TODO: This error is probably because they somehow have 2 versions of the
|
|
840
|
+
// router loaded. We can help them understand how to avoid that.
|
|
841
|
+
"useRoutes() may be used only in the context of a <Router> component."
|
|
842
|
+
);
|
|
843
|
+
let { navigator: o } = h.useContext(K), { matches: l } = h.useContext(V), s = l[l.length - 1], u = s ? s.params : {}, c = s ? s.pathname : "/", d = s ? s.pathnameBase : "/", g = s && s.route;
|
|
844
|
+
{
|
|
845
|
+
let y = g && g.path || "";
|
|
846
|
+
Wt(
|
|
847
|
+
c,
|
|
848
|
+
!g || y.endsWith("*") || y.endsWith("*?"),
|
|
849
|
+
`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${y}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
850
|
+
|
|
851
|
+
Please change the parent <Route path="${y}"> to <Route path="${y === "/" ? "*" : `${y}/*`}">.`
|
|
852
|
+
);
|
|
853
|
+
}
|
|
854
|
+
let p = ne(), f;
|
|
855
|
+
f = p;
|
|
856
|
+
let x = f.pathname || "/", b = x;
|
|
857
|
+
if (d !== "/") {
|
|
858
|
+
let y = d.replace(/^\//, "").split("/");
|
|
859
|
+
b = "/" + x.replace(/^\//, "").split("/").slice(y.length).join("/");
|
|
860
|
+
}
|
|
861
|
+
let j = Ft(e, { pathname: b });
|
|
862
|
+
return q(
|
|
863
|
+
g || j != null,
|
|
864
|
+
`No routes matched location "${f.pathname}${f.search}${f.hash}" `
|
|
865
|
+
), q(
|
|
866
|
+
j == null || j[j.length - 1].route.element !== void 0 || j[j.length - 1].route.Component !== void 0 || j[j.length - 1].route.lazy !== void 0,
|
|
867
|
+
`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`
|
|
868
|
+
), mr(
|
|
869
|
+
j && j.map(
|
|
870
|
+
(y) => Object.assign({}, y, {
|
|
871
|
+
params: Object.assign({}, u, y.params),
|
|
872
|
+
pathname: W([
|
|
873
|
+
d,
|
|
874
|
+
// Re-encode pathnames that were decoded inside matchRoutes
|
|
875
|
+
o.encodeLocation ? o.encodeLocation(y.pathname).pathname : y.pathname
|
|
876
|
+
]),
|
|
877
|
+
pathnameBase: y.pathnameBase === "/" ? d : W([
|
|
878
|
+
d,
|
|
879
|
+
// Re-encode pathnames that were decoded inside matchRoutes
|
|
880
|
+
o.encodeLocation ? o.encodeLocation(y.pathnameBase).pathname : y.pathnameBase
|
|
881
|
+
])
|
|
882
|
+
})
|
|
883
|
+
),
|
|
884
|
+
l,
|
|
885
|
+
t,
|
|
886
|
+
a,
|
|
887
|
+
r
|
|
888
|
+
);
|
|
889
|
+
}
|
|
890
|
+
function cr() {
|
|
891
|
+
let e = yr(), n = rr(e) ? `${e.status} ${e.statusText}` : e instanceof Error ? e.message : JSON.stringify(e), t = e instanceof Error ? e.stack : null, a = "rgba(200,200,200, 0.5)", r = { padding: "0.5rem", backgroundColor: a }, o = { padding: "2px 4px", backgroundColor: a }, l = null;
|
|
892
|
+
return console.error(
|
|
893
|
+
"Error handled by React Router default ErrorBoundary:",
|
|
894
|
+
e
|
|
895
|
+
), l = /* @__PURE__ */ h.createElement(h.Fragment, null, /* @__PURE__ */ h.createElement("p", null, "💿 Hey developer 👋"), /* @__PURE__ */ h.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ h.createElement("code", { style: o }, "ErrorBoundary"), " or", " ", /* @__PURE__ */ h.createElement("code", { style: o }, "errorElement"), " prop on your route.")), /* @__PURE__ */ h.createElement(h.Fragment, null, /* @__PURE__ */ h.createElement("h2", null, "Unexpected Application Error!"), /* @__PURE__ */ h.createElement("h3", { style: { fontStyle: "italic" } }, n), t ? /* @__PURE__ */ h.createElement("pre", { style: r }, t) : null, l);
|
|
896
|
+
}
|
|
897
|
+
var dr = /* @__PURE__ */ h.createElement(cr, null), fr = class extends h.Component {
|
|
898
|
+
constructor(e) {
|
|
899
|
+
super(e), this.state = {
|
|
900
|
+
location: e.location,
|
|
901
|
+
revalidation: e.revalidation,
|
|
902
|
+
error: e.error
|
|
903
|
+
};
|
|
904
|
+
}
|
|
905
|
+
static getDerivedStateFromError(e) {
|
|
906
|
+
return { error: e };
|
|
907
|
+
}
|
|
908
|
+
static getDerivedStateFromProps(e, n) {
|
|
909
|
+
return n.location !== e.location || n.revalidation !== "idle" && e.revalidation === "idle" ? {
|
|
910
|
+
error: e.error,
|
|
911
|
+
location: e.location,
|
|
912
|
+
revalidation: e.revalidation
|
|
913
|
+
} : {
|
|
914
|
+
error: e.error !== void 0 ? e.error : n.error,
|
|
915
|
+
location: n.location,
|
|
916
|
+
revalidation: e.revalidation || n.revalidation
|
|
917
|
+
};
|
|
918
|
+
}
|
|
919
|
+
componentDidCatch(e, n) {
|
|
920
|
+
this.props.unstable_onError ? this.props.unstable_onError(e, n) : console.error(
|
|
921
|
+
"React Router caught the following error during render",
|
|
922
|
+
e
|
|
923
|
+
);
|
|
924
|
+
}
|
|
925
|
+
render() {
|
|
926
|
+
return this.state.error !== void 0 ? /* @__PURE__ */ h.createElement(V.Provider, { value: this.props.routeContext }, /* @__PURE__ */ h.createElement(
|
|
927
|
+
Ye.Provider,
|
|
928
|
+
{
|
|
929
|
+
value: this.state.error,
|
|
930
|
+
children: this.props.component
|
|
931
|
+
}
|
|
932
|
+
)) : this.props.children;
|
|
933
|
+
}
|
|
934
|
+
};
|
|
935
|
+
function hr({ routeContext: e, match: n, children: t }) {
|
|
936
|
+
let a = h.useContext(ce);
|
|
937
|
+
return a && a.static && a.staticContext && (n.route.errorElement || n.route.ErrorBoundary) && (a.staticContext._deepestRenderedBoundaryId = n.route.id), /* @__PURE__ */ h.createElement(V.Provider, { value: e }, t);
|
|
938
|
+
}
|
|
939
|
+
function mr(e, n = [], t = null, a = null, r = null) {
|
|
940
|
+
if (e == null) {
|
|
941
|
+
if (!t)
|
|
942
|
+
return null;
|
|
943
|
+
if (t.errors)
|
|
944
|
+
e = t.matches;
|
|
945
|
+
else if (n.length === 0 && !t.initialized && t.matches.length > 0)
|
|
946
|
+
e = t.matches;
|
|
947
|
+
else
|
|
948
|
+
return null;
|
|
949
|
+
}
|
|
950
|
+
let o = e, l = t == null ? void 0 : t.errors;
|
|
951
|
+
if (l != null) {
|
|
952
|
+
let c = o.findIndex(
|
|
953
|
+
(d) => d.route.id && (l == null ? void 0 : l[d.route.id]) !== void 0
|
|
954
|
+
);
|
|
955
|
+
P(
|
|
956
|
+
c >= 0,
|
|
957
|
+
`Could not find a matching route for errors on route IDs: ${Object.keys(
|
|
958
|
+
l
|
|
959
|
+
).join(",")}`
|
|
960
|
+
), o = o.slice(
|
|
961
|
+
0,
|
|
962
|
+
Math.min(o.length, c + 1)
|
|
963
|
+
);
|
|
964
|
+
}
|
|
965
|
+
let s = !1, u = -1;
|
|
966
|
+
if (t)
|
|
967
|
+
for (let c = 0; c < o.length; c++) {
|
|
968
|
+
let d = o[c];
|
|
969
|
+
if ((d.route.HydrateFallback || d.route.hydrateFallbackElement) && (u = c), d.route.id) {
|
|
970
|
+
let { loaderData: g, errors: p } = t, f = d.route.loader && !g.hasOwnProperty(d.route.id) && (!p || p[d.route.id] === void 0);
|
|
971
|
+
if (d.route.lazy || f) {
|
|
972
|
+
s = !0, u >= 0 ? o = o.slice(0, u + 1) : o = [o[0]];
|
|
973
|
+
break;
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
return o.reduceRight(
|
|
978
|
+
(c, d, g) => {
|
|
979
|
+
let p, f = !1, x = null, b = null;
|
|
980
|
+
t && (p = l && d.route.id ? l[d.route.id] : void 0, x = d.route.errorElement || dr, s && (u < 0 && g === 0 ? (Wt(
|
|
981
|
+
"route-fallback",
|
|
982
|
+
!1,
|
|
983
|
+
"No `HydrateFallback` element provided to render during initial hydration"
|
|
984
|
+
), f = !0, b = null) : u === g && (f = !0, b = d.route.hydrateFallbackElement || null)));
|
|
985
|
+
let j = n.concat(o.slice(0, g + 1)), w = () => {
|
|
986
|
+
let y;
|
|
987
|
+
return p ? y = x : f ? y = b : d.route.Component ? y = /* @__PURE__ */ h.createElement(d.route.Component, null) : d.route.element ? y = d.route.element : y = c, /* @__PURE__ */ h.createElement(
|
|
988
|
+
hr,
|
|
989
|
+
{
|
|
990
|
+
match: d,
|
|
991
|
+
routeContext: {
|
|
992
|
+
outlet: c,
|
|
993
|
+
matches: j,
|
|
994
|
+
isDataRoute: t != null
|
|
995
|
+
},
|
|
996
|
+
children: y
|
|
997
|
+
}
|
|
998
|
+
);
|
|
999
|
+
};
|
|
1000
|
+
return t && (d.route.ErrorBoundary || d.route.errorElement || g === 0) ? /* @__PURE__ */ h.createElement(
|
|
1001
|
+
fr,
|
|
1002
|
+
{
|
|
1003
|
+
location: t.location,
|
|
1004
|
+
revalidation: t.revalidation,
|
|
1005
|
+
component: x,
|
|
1006
|
+
error: p,
|
|
1007
|
+
children: w(),
|
|
1008
|
+
routeContext: { outlet: null, matches: j, isDataRoute: !0 },
|
|
1009
|
+
unstable_onError: a
|
|
1010
|
+
}
|
|
1011
|
+
) : w();
|
|
1012
|
+
},
|
|
1013
|
+
null
|
|
1014
|
+
);
|
|
1015
|
+
}
|
|
1016
|
+
function Ge(e) {
|
|
1017
|
+
return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
1018
|
+
}
|
|
1019
|
+
function gr(e) {
|
|
1020
|
+
let n = h.useContext(ce);
|
|
1021
|
+
return P(n, Ge(e)), n;
|
|
1022
|
+
}
|
|
1023
|
+
function pr(e) {
|
|
1024
|
+
let n = h.useContext(Ne);
|
|
1025
|
+
return P(n, Ge(e)), n;
|
|
1026
|
+
}
|
|
1027
|
+
function xr(e) {
|
|
1028
|
+
let n = h.useContext(V);
|
|
1029
|
+
return P(n, Ge(e)), n;
|
|
1030
|
+
}
|
|
1031
|
+
function Je(e) {
|
|
1032
|
+
let n = xr(e), t = n.matches[n.matches.length - 1];
|
|
1033
|
+
return P(
|
|
1034
|
+
t.route.id,
|
|
1035
|
+
`${e} can only be used on routes that contain a unique "id"`
|
|
1036
|
+
), t.route.id;
|
|
1037
|
+
}
|
|
1038
|
+
function vr() {
|
|
1039
|
+
return Je(
|
|
1040
|
+
"useRouteId"
|
|
1041
|
+
/* UseRouteId */
|
|
1042
|
+
);
|
|
1043
|
+
}
|
|
1044
|
+
function yr() {
|
|
1045
|
+
var a;
|
|
1046
|
+
let e = h.useContext(Ye), n = pr(
|
|
1047
|
+
"useRouteError"
|
|
1048
|
+
/* UseRouteError */
|
|
1049
|
+
), t = Je(
|
|
1050
|
+
"useRouteError"
|
|
1051
|
+
/* UseRouteError */
|
|
1052
|
+
);
|
|
1053
|
+
return e !== void 0 ? e : (a = n.errors) == null ? void 0 : a[t];
|
|
1054
|
+
}
|
|
1055
|
+
function br() {
|
|
1056
|
+
let { router: e } = gr(
|
|
1057
|
+
"useNavigate"
|
|
1058
|
+
/* UseNavigateStable */
|
|
1059
|
+
), n = Je(
|
|
1060
|
+
"useNavigate"
|
|
1061
|
+
/* UseNavigateStable */
|
|
1062
|
+
), t = h.useRef(!1);
|
|
1063
|
+
return Bt(() => {
|
|
1064
|
+
t.current = !0;
|
|
1065
|
+
}), h.useCallback(
|
|
1066
|
+
async (r, o = {}) => {
|
|
1067
|
+
q(t.current, zt), t.current && (typeof r == "number" ? e.navigate(r) : await e.navigate(r, { fromRouteId: n, ...o }));
|
|
1068
|
+
},
|
|
1069
|
+
[e, n]
|
|
1070
|
+
);
|
|
1071
|
+
}
|
|
1072
|
+
var ht = {};
|
|
1073
|
+
function Wt(e, n, t) {
|
|
1074
|
+
!n && !ht[e] && (ht[e] = !0, q(!1, t));
|
|
1075
|
+
}
|
|
1076
|
+
h.memo(wr);
|
|
1077
|
+
function wr({
|
|
1078
|
+
routes: e,
|
|
1079
|
+
future: n,
|
|
1080
|
+
state: t,
|
|
1081
|
+
unstable_onError: a
|
|
1082
|
+
}) {
|
|
1083
|
+
return ur(e, void 0, t, a, n);
|
|
1084
|
+
}
|
|
1085
|
+
var Ce = "get", Re = "application/x-www-form-urlencoded";
|
|
1086
|
+
function Ie(e) {
|
|
1087
|
+
return e != null && typeof e.tagName == "string";
|
|
1088
|
+
}
|
|
1089
|
+
function jr(e) {
|
|
1090
|
+
return Ie(e) && e.tagName.toLowerCase() === "button";
|
|
1091
|
+
}
|
|
1092
|
+
function Sr(e) {
|
|
1093
|
+
return Ie(e) && e.tagName.toLowerCase() === "form";
|
|
1094
|
+
}
|
|
1095
|
+
function Cr(e) {
|
|
1096
|
+
return Ie(e) && e.tagName.toLowerCase() === "input";
|
|
1097
|
+
}
|
|
1098
|
+
function Rr(e) {
|
|
1099
|
+
return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
|
|
1100
|
+
}
|
|
1101
|
+
function Er(e, n) {
|
|
1102
|
+
return e.button === 0 && // Ignore everything but left clicks
|
|
1103
|
+
(!n || n === "_self") && // Let browser handle "target=_blank" etc.
|
|
1104
|
+
!Rr(e);
|
|
1105
|
+
}
|
|
1106
|
+
var je = null;
|
|
1107
|
+
function kr() {
|
|
1108
|
+
if (je === null)
|
|
1109
|
+
try {
|
|
1110
|
+
new FormData(
|
|
1111
|
+
document.createElement("form"),
|
|
1112
|
+
// @ts-expect-error if FormData supports the submitter parameter, this will throw
|
|
1113
|
+
0
|
|
1114
|
+
), je = !1;
|
|
1115
|
+
} catch {
|
|
1116
|
+
je = !0;
|
|
1117
|
+
}
|
|
1118
|
+
return je;
|
|
1119
|
+
}
|
|
1120
|
+
var Tr = /* @__PURE__ */ new Set([
|
|
1121
|
+
"application/x-www-form-urlencoded",
|
|
1122
|
+
"multipart/form-data",
|
|
1123
|
+
"text/plain"
|
|
1124
|
+
]);
|
|
1125
|
+
function Me(e) {
|
|
1126
|
+
return e != null && !Tr.has(e) ? (q(
|
|
1127
|
+
!1,
|
|
1128
|
+
`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Re}"`
|
|
1129
|
+
), null) : e;
|
|
1130
|
+
}
|
|
1131
|
+
function Nr(e, n) {
|
|
1132
|
+
let t, a, r, o, l;
|
|
1133
|
+
if (Sr(e)) {
|
|
1134
|
+
let s = e.getAttribute("action");
|
|
1135
|
+
a = s ? J(s, n) : null, t = e.getAttribute("method") || Ce, r = Me(e.getAttribute("enctype")) || Re, o = new FormData(e);
|
|
1136
|
+
} else if (jr(e) || Cr(e) && (e.type === "submit" || e.type === "image")) {
|
|
1137
|
+
let s = e.form;
|
|
1138
|
+
if (s == null)
|
|
1139
|
+
throw new Error(
|
|
1140
|
+
'Cannot submit a <button> or <input type="submit"> without a <form>'
|
|
1141
|
+
);
|
|
1142
|
+
let u = e.getAttribute("formaction") || s.getAttribute("action");
|
|
1143
|
+
if (a = u ? J(u, n) : null, t = e.getAttribute("formmethod") || s.getAttribute("method") || Ce, r = Me(e.getAttribute("formenctype")) || Me(s.getAttribute("enctype")) || Re, o = new FormData(s, e), !kr()) {
|
|
1144
|
+
let { name: c, type: d, value: g } = e;
|
|
1145
|
+
if (d === "image") {
|
|
1146
|
+
let p = c ? `${c}.` : "";
|
|
1147
|
+
o.append(`${p}x`, "0"), o.append(`${p}y`, "0");
|
|
1148
|
+
} else c && o.append(c, g);
|
|
1149
|
+
}
|
|
1150
|
+
} else {
|
|
1151
|
+
if (Ie(e))
|
|
1152
|
+
throw new Error(
|
|
1153
|
+
'Cannot submit element that is not <form>, <button>, or <input type="submit|image">'
|
|
1154
|
+
);
|
|
1155
|
+
t = Ce, a = null, r = Re, l = e;
|
|
1156
|
+
}
|
|
1157
|
+
return o && r === "text/plain" && (l = o, o = void 0), { action: a, method: t.toLowerCase(), encType: r, formData: o, body: l };
|
|
1158
|
+
}
|
|
1159
|
+
Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
|
|
1160
|
+
function Xe(e, n) {
|
|
1161
|
+
if (e === !1 || e === null || typeof e > "u")
|
|
1162
|
+
throw new Error(n);
|
|
1163
|
+
}
|
|
1164
|
+
function Pr(e, n, t) {
|
|
1165
|
+
let a = typeof e == "string" ? new URL(
|
|
1166
|
+
e,
|
|
1167
|
+
// This can be called during the SSR flow via PrefetchPageLinksImpl so
|
|
1168
|
+
// don't assume window is available
|
|
1169
|
+
typeof window > "u" ? "server://singlefetch/" : window.location.origin
|
|
1170
|
+
) : e;
|
|
1171
|
+
return a.pathname === "/" ? a.pathname = `_root.${t}` : n && J(a.pathname, n) === "/" ? a.pathname = `${n.replace(/\/$/, "")}/_root.${t}` : a.pathname = `${a.pathname.replace(/\/$/, "")}.${t}`, a;
|
|
1172
|
+
}
|
|
1173
|
+
async function Ir(e, n) {
|
|
1174
|
+
if (e.id in n)
|
|
1175
|
+
return n[e.id];
|
|
1176
|
+
try {
|
|
1177
|
+
let t = await import(
|
|
1178
|
+
/* @vite-ignore */
|
|
1179
|
+
/* webpackIgnore: true */
|
|
1180
|
+
e.module
|
|
1181
|
+
);
|
|
1182
|
+
return n[e.id] = t, t;
|
|
1183
|
+
} catch (t) {
|
|
1184
|
+
return console.error(
|
|
1185
|
+
`Error loading route module \`${e.module}\`, reloading page...`
|
|
1186
|
+
), console.error(t), window.__reactRouterContext && window.__reactRouterContext.isSpaMode, window.location.reload(), new Promise(() => {
|
|
1187
|
+
});
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
function Lr(e) {
|
|
1191
|
+
return e == null ? !1 : e.href == null ? e.rel === "preload" && typeof e.imageSrcSet == "string" && typeof e.imageSizes == "string" : typeof e.rel == "string" && typeof e.href == "string";
|
|
1192
|
+
}
|
|
1193
|
+
async function Fr(e, n, t) {
|
|
1194
|
+
let a = await Promise.all(
|
|
1195
|
+
e.map(async (r) => {
|
|
1196
|
+
let o = n.routes[r.route.id];
|
|
1197
|
+
if (o) {
|
|
1198
|
+
let l = await Ir(o, t);
|
|
1199
|
+
return l.links ? l.links() : [];
|
|
1200
|
+
}
|
|
1201
|
+
return [];
|
|
1202
|
+
})
|
|
1203
|
+
);
|
|
1204
|
+
return Or(
|
|
1205
|
+
a.flat(1).filter(Lr).filter((r) => r.rel === "stylesheet" || r.rel === "preload").map(
|
|
1206
|
+
(r) => r.rel === "stylesheet" ? { ...r, rel: "prefetch", as: "style" } : { ...r, rel: "prefetch" }
|
|
1207
|
+
)
|
|
1208
|
+
);
|
|
1209
|
+
}
|
|
1210
|
+
function mt(e, n, t, a, r, o) {
|
|
1211
|
+
let l = (u, c) => t[c] ? u.route.id !== t[c].route.id : !0, s = (u, c) => {
|
|
1212
|
+
var d;
|
|
1213
|
+
return (
|
|
1214
|
+
// param change, /users/123 -> /users/456
|
|
1215
|
+
t[c].pathname !== u.pathname || // splat param changed, which is not present in match.path
|
|
1216
|
+
// e.g. /files/images/avatar.jpg -> files/finances.xls
|
|
1217
|
+
((d = t[c].route.path) == null ? void 0 : d.endsWith("*")) && t[c].params["*"] !== u.params["*"]
|
|
1218
|
+
);
|
|
1219
|
+
};
|
|
1220
|
+
return o === "assets" ? n.filter(
|
|
1221
|
+
(u, c) => l(u, c) || s(u, c)
|
|
1222
|
+
) : o === "data" ? n.filter((u, c) => {
|
|
1223
|
+
var g;
|
|
1224
|
+
let d = a.routes[u.route.id];
|
|
1225
|
+
if (!d || !d.hasLoader)
|
|
1226
|
+
return !1;
|
|
1227
|
+
if (l(u, c) || s(u, c))
|
|
1228
|
+
return !0;
|
|
1229
|
+
if (u.route.shouldRevalidate) {
|
|
1230
|
+
let p = u.route.shouldRevalidate({
|
|
1231
|
+
currentUrl: new URL(
|
|
1232
|
+
r.pathname + r.search + r.hash,
|
|
1233
|
+
window.origin
|
|
1234
|
+
),
|
|
1235
|
+
currentParams: ((g = t[0]) == null ? void 0 : g.params) || {},
|
|
1236
|
+
nextUrl: new URL(e, window.origin),
|
|
1237
|
+
nextParams: u.params,
|
|
1238
|
+
defaultShouldRevalidate: !0
|
|
1239
|
+
});
|
|
1240
|
+
if (typeof p == "boolean")
|
|
1241
|
+
return p;
|
|
1242
|
+
}
|
|
1243
|
+
return !0;
|
|
1244
|
+
}) : [];
|
|
1245
|
+
}
|
|
1246
|
+
function _r(e, n, { includeHydrateFallback: t } = {}) {
|
|
1247
|
+
return $r(
|
|
1248
|
+
e.map((a) => {
|
|
1249
|
+
let r = n.routes[a.route.id];
|
|
1250
|
+
if (!r) return [];
|
|
1251
|
+
let o = [r.module];
|
|
1252
|
+
return r.clientActionModule && (o = o.concat(r.clientActionModule)), r.clientLoaderModule && (o = o.concat(r.clientLoaderModule)), t && r.hydrateFallbackModule && (o = o.concat(r.hydrateFallbackModule)), r.imports && (o = o.concat(r.imports)), o;
|
|
1253
|
+
}).flat(1)
|
|
1254
|
+
);
|
|
1255
|
+
}
|
|
1256
|
+
function $r(e) {
|
|
1257
|
+
return [...new Set(e)];
|
|
1258
|
+
}
|
|
1259
|
+
function Ar(e) {
|
|
1260
|
+
let n = {}, t = Object.keys(e).sort();
|
|
1261
|
+
for (let a of t)
|
|
1262
|
+
n[a] = e[a];
|
|
1263
|
+
return n;
|
|
1264
|
+
}
|
|
1265
|
+
function Or(e, n) {
|
|
1266
|
+
let t = /* @__PURE__ */ new Set();
|
|
1267
|
+
return new Set(n), e.reduce((a, r) => {
|
|
1268
|
+
let o = JSON.stringify(Ar(r));
|
|
1269
|
+
return t.has(o) || (t.add(o), a.push({ key: o, link: r })), a;
|
|
1270
|
+
}, []);
|
|
1271
|
+
}
|
|
1272
|
+
function qt() {
|
|
1273
|
+
let e = h.useContext(ce);
|
|
1274
|
+
return Xe(
|
|
1275
|
+
e,
|
|
1276
|
+
"You must render this element inside a <DataRouterContext.Provider> element"
|
|
1277
|
+
), e;
|
|
1278
|
+
}
|
|
1279
|
+
function Dr() {
|
|
1280
|
+
let e = h.useContext(Ne);
|
|
1281
|
+
return Xe(
|
|
1282
|
+
e,
|
|
1283
|
+
"You must render this element inside a <DataRouterStateContext.Provider> element"
|
|
1284
|
+
), e;
|
|
1285
|
+
}
|
|
1286
|
+
var Ze = h.createContext(void 0);
|
|
1287
|
+
Ze.displayName = "FrameworkContext";
|
|
1288
|
+
function Kt() {
|
|
1289
|
+
let e = h.useContext(Ze);
|
|
1290
|
+
return Xe(
|
|
1291
|
+
e,
|
|
1292
|
+
"You must render this element inside a <HydratedRouter> element"
|
|
1293
|
+
), e;
|
|
1294
|
+
}
|
|
1295
|
+
function Mr(e, n) {
|
|
1296
|
+
let t = h.useContext(Ze), [a, r] = h.useState(!1), [o, l] = h.useState(!1), { onFocus: s, onBlur: u, onMouseEnter: c, onMouseLeave: d, onTouchStart: g } = n, p = h.useRef(null);
|
|
1297
|
+
h.useEffect(() => {
|
|
1298
|
+
if (e === "render" && l(!0), e === "viewport") {
|
|
1299
|
+
let b = (w) => {
|
|
1300
|
+
w.forEach((y) => {
|
|
1301
|
+
l(y.isIntersecting);
|
|
1302
|
+
});
|
|
1303
|
+
}, j = new IntersectionObserver(b, { threshold: 0.5 });
|
|
1304
|
+
return p.current && j.observe(p.current), () => {
|
|
1305
|
+
j.disconnect();
|
|
1306
|
+
};
|
|
1307
|
+
}
|
|
1308
|
+
}, [e]), h.useEffect(() => {
|
|
1309
|
+
if (a) {
|
|
1310
|
+
let b = setTimeout(() => {
|
|
1311
|
+
l(!0);
|
|
1312
|
+
}, 100);
|
|
1313
|
+
return () => {
|
|
1314
|
+
clearTimeout(b);
|
|
1315
|
+
};
|
|
1316
|
+
}
|
|
1317
|
+
}, [a]);
|
|
1318
|
+
let f = () => {
|
|
1319
|
+
r(!0);
|
|
1320
|
+
}, x = () => {
|
|
1321
|
+
r(!1), l(!1);
|
|
1322
|
+
};
|
|
1323
|
+
return t ? e !== "intent" ? [o, p, {}] : [
|
|
1324
|
+
o,
|
|
1325
|
+
p,
|
|
1326
|
+
{
|
|
1327
|
+
onFocus: me(s, f),
|
|
1328
|
+
onBlur: me(u, x),
|
|
1329
|
+
onMouseEnter: me(c, f),
|
|
1330
|
+
onMouseLeave: me(d, x),
|
|
1331
|
+
onTouchStart: me(g, f)
|
|
1332
|
+
}
|
|
1333
|
+
] : [!1, p, {}];
|
|
1334
|
+
}
|
|
1335
|
+
function me(e, n) {
|
|
1336
|
+
return (t) => {
|
|
1337
|
+
e && e(t), t.defaultPrevented || n(t);
|
|
1338
|
+
};
|
|
1339
|
+
}
|
|
1340
|
+
function zr({ page: e, ...n }) {
|
|
1341
|
+
let { router: t } = qt(), a = h.useMemo(
|
|
1342
|
+
() => Ft(t.routes, e, t.basename),
|
|
1343
|
+
[t.routes, e, t.basename]
|
|
1344
|
+
);
|
|
1345
|
+
return a ? /* @__PURE__ */ h.createElement(Ur, { page: e, matches: a, ...n }) : null;
|
|
1346
|
+
}
|
|
1347
|
+
function Br(e) {
|
|
1348
|
+
let { manifest: n, routeModules: t } = Kt(), [a, r] = h.useState([]);
|
|
1349
|
+
return h.useEffect(() => {
|
|
1350
|
+
let o = !1;
|
|
1351
|
+
return Fr(e, n, t).then(
|
|
1352
|
+
(l) => {
|
|
1353
|
+
o || r(l);
|
|
1354
|
+
}
|
|
1355
|
+
), () => {
|
|
1356
|
+
o = !0;
|
|
1357
|
+
};
|
|
1358
|
+
}, [e, n, t]), a;
|
|
1359
|
+
}
|
|
1360
|
+
function Ur({
|
|
1361
|
+
page: e,
|
|
1362
|
+
matches: n,
|
|
1363
|
+
...t
|
|
1364
|
+
}) {
|
|
1365
|
+
let a = ne(), { manifest: r, routeModules: o } = Kt(), { basename: l } = qt(), { loaderData: s, matches: u } = Dr(), c = h.useMemo(
|
|
1366
|
+
() => mt(
|
|
1367
|
+
e,
|
|
1368
|
+
n,
|
|
1369
|
+
u,
|
|
1370
|
+
r,
|
|
1371
|
+
a,
|
|
1372
|
+
"data"
|
|
1373
|
+
),
|
|
1374
|
+
[e, n, u, r, a]
|
|
1375
|
+
), d = h.useMemo(
|
|
1376
|
+
() => mt(
|
|
1377
|
+
e,
|
|
1378
|
+
n,
|
|
1379
|
+
u,
|
|
1380
|
+
r,
|
|
1381
|
+
a,
|
|
1382
|
+
"assets"
|
|
1383
|
+
),
|
|
1384
|
+
[e, n, u, r, a]
|
|
1385
|
+
), g = h.useMemo(() => {
|
|
1386
|
+
if (e === a.pathname + a.search + a.hash)
|
|
1387
|
+
return [];
|
|
1388
|
+
let x = /* @__PURE__ */ new Set(), b = !1;
|
|
1389
|
+
if (n.forEach((w) => {
|
|
1390
|
+
var v;
|
|
1391
|
+
let y = r.routes[w.route.id];
|
|
1392
|
+
!y || !y.hasLoader || (!c.some((C) => C.route.id === w.route.id) && w.route.id in s && ((v = o[w.route.id]) != null && v.shouldRevalidate) || y.hasClientLoader ? b = !0 : x.add(w.route.id));
|
|
1393
|
+
}), x.size === 0)
|
|
1394
|
+
return [];
|
|
1395
|
+
let j = Pr(e, l, "data");
|
|
1396
|
+
return b && x.size > 0 && j.searchParams.set(
|
|
1397
|
+
"_routes",
|
|
1398
|
+
n.filter((w) => x.has(w.route.id)).map((w) => w.route.id).join(",")
|
|
1399
|
+
), [j.pathname + j.search];
|
|
1400
|
+
}, [
|
|
1401
|
+
l,
|
|
1402
|
+
s,
|
|
1403
|
+
a,
|
|
1404
|
+
r,
|
|
1405
|
+
c,
|
|
1406
|
+
n,
|
|
1407
|
+
e,
|
|
1408
|
+
o
|
|
1409
|
+
]), p = h.useMemo(
|
|
1410
|
+
() => _r(d, r),
|
|
1411
|
+
[d, r]
|
|
1412
|
+
), f = Br(d);
|
|
1413
|
+
return /* @__PURE__ */ h.createElement(h.Fragment, null, g.map((x) => /* @__PURE__ */ h.createElement("link", { key: x, rel: "prefetch", as: "fetch", href: x, ...t })), p.map((x) => /* @__PURE__ */ h.createElement("link", { key: x, rel: "modulepreload", href: x, ...t })), f.map(({ key: x, link: b }) => (
|
|
1414
|
+
// these don't spread `linkProps` because they are full link descriptors
|
|
1415
|
+
// already with their own props
|
|
1416
|
+
/* @__PURE__ */ h.createElement("link", { key: x, nonce: t.nonce, ...b })
|
|
1417
|
+
)));
|
|
1418
|
+
}
|
|
1419
|
+
function Wr(...e) {
|
|
1420
|
+
return (n) => {
|
|
1421
|
+
e.forEach((t) => {
|
|
1422
|
+
typeof t == "function" ? t(n) : t != null && (t.current = n);
|
|
1423
|
+
});
|
|
1424
|
+
};
|
|
1425
|
+
}
|
|
1426
|
+
var Vt = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
|
|
1427
|
+
try {
|
|
1428
|
+
Vt && (window.__reactRouterVersion = // @ts-expect-error
|
|
1429
|
+
"7.8.2");
|
|
1430
|
+
} catch {
|
|
1431
|
+
}
|
|
1432
|
+
var Ht = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, Yt = h.forwardRef(
|
|
1433
|
+
function({
|
|
1434
|
+
onClick: n,
|
|
1435
|
+
discover: t = "render",
|
|
1436
|
+
prefetch: a = "none",
|
|
1437
|
+
relative: r,
|
|
1438
|
+
reloadDocument: o,
|
|
1439
|
+
replace: l,
|
|
1440
|
+
state: s,
|
|
1441
|
+
target: u,
|
|
1442
|
+
to: c,
|
|
1443
|
+
preventScrollReset: d,
|
|
1444
|
+
viewTransition: g,
|
|
1445
|
+
...p
|
|
1446
|
+
}, f) {
|
|
1447
|
+
let { basename: x } = h.useContext(K), b = typeof c == "string" && Ht.test(c), j, w = !1;
|
|
1448
|
+
if (typeof c == "string" && b && (j = c, Vt))
|
|
1449
|
+
try {
|
|
1450
|
+
let A = new URL(window.location.href), H = c.startsWith("//") ? new URL(A.protocol + c) : new URL(c), ae = J(H.pathname, x);
|
|
1451
|
+
H.origin === A.origin && ae != null ? c = ae + H.search + H.hash : w = !0;
|
|
1452
|
+
} catch {
|
|
1453
|
+
q(
|
|
1454
|
+
!1,
|
|
1455
|
+
`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`
|
|
1456
|
+
);
|
|
1457
|
+
}
|
|
1458
|
+
let y = lr(c, { relative: r }), [v, C, T] = Mr(
|
|
1459
|
+
a,
|
|
1460
|
+
p
|
|
1461
|
+
), re = Hr(c, {
|
|
1462
|
+
replace: l,
|
|
1463
|
+
state: s,
|
|
1464
|
+
target: u,
|
|
1465
|
+
preventScrollReset: d,
|
|
1466
|
+
relative: r,
|
|
1467
|
+
viewTransition: g
|
|
1468
|
+
});
|
|
1469
|
+
function Q(A) {
|
|
1470
|
+
n && n(A), A.defaultPrevented || re(A);
|
|
1471
|
+
}
|
|
1472
|
+
let ee = (
|
|
1473
|
+
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
1474
|
+
/* @__PURE__ */ h.createElement(
|
|
1475
|
+
"a",
|
|
1476
|
+
{
|
|
1477
|
+
...p,
|
|
1478
|
+
...T,
|
|
1479
|
+
href: j || y,
|
|
1480
|
+
onClick: w || o ? n : Q,
|
|
1481
|
+
ref: Wr(f, C),
|
|
1482
|
+
target: u,
|
|
1483
|
+
"data-discover": !b && t === "render" ? "true" : void 0
|
|
1484
|
+
}
|
|
1485
|
+
)
|
|
1486
|
+
);
|
|
1487
|
+
return v && !b ? /* @__PURE__ */ h.createElement(h.Fragment, null, ee, /* @__PURE__ */ h.createElement(zr, { page: y })) : ee;
|
|
1488
|
+
}
|
|
1489
|
+
);
|
|
1490
|
+
Yt.displayName = "Link";
|
|
1491
|
+
var qr = h.forwardRef(
|
|
1492
|
+
function({
|
|
1493
|
+
"aria-current": n = "page",
|
|
1494
|
+
caseSensitive: t = !1,
|
|
1495
|
+
className: a = "",
|
|
1496
|
+
end: r = !1,
|
|
1497
|
+
style: o,
|
|
1498
|
+
to: l,
|
|
1499
|
+
viewTransition: s,
|
|
1500
|
+
children: u,
|
|
1501
|
+
...c
|
|
1502
|
+
}, d) {
|
|
1503
|
+
let g = ve(l, { relative: c.relative }), p = ne(), f = h.useContext(Ne), { navigator: x, basename: b } = h.useContext(K), j = f != null && // Conditional usage is OK here because the usage of a data router is static
|
|
1504
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
1505
|
+
Zr(g) && s === !0, w = x.encodeLocation ? x.encodeLocation(g).pathname : g.pathname, y = p.pathname, v = f && f.navigation && f.navigation.location ? f.navigation.location.pathname : null;
|
|
1506
|
+
t || (y = y.toLowerCase(), v = v ? v.toLowerCase() : null, w = w.toLowerCase()), v && b && (v = J(v, b) || v);
|
|
1507
|
+
const C = w !== "/" && w.endsWith("/") ? w.length - 1 : w.length;
|
|
1508
|
+
let T = y === w || !r && y.startsWith(w) && y.charAt(C) === "/", re = v != null && (v === w || !r && v.startsWith(w) && v.charAt(w.length) === "/"), Q = {
|
|
1509
|
+
isActive: T,
|
|
1510
|
+
isPending: re,
|
|
1511
|
+
isTransitioning: j
|
|
1512
|
+
}, ee = T ? n : void 0, A;
|
|
1513
|
+
typeof a == "function" ? A = a(Q) : A = [
|
|
1514
|
+
a,
|
|
1515
|
+
T ? "active" : null,
|
|
1516
|
+
re ? "pending" : null,
|
|
1517
|
+
j ? "transitioning" : null
|
|
1518
|
+
].filter(Boolean).join(" ");
|
|
1519
|
+
let H = typeof o == "function" ? o(Q) : o;
|
|
1520
|
+
return /* @__PURE__ */ h.createElement(
|
|
1521
|
+
Yt,
|
|
1522
|
+
{
|
|
1523
|
+
...c,
|
|
1524
|
+
"aria-current": ee,
|
|
1525
|
+
className: A,
|
|
1526
|
+
ref: d,
|
|
1527
|
+
style: H,
|
|
1528
|
+
to: l,
|
|
1529
|
+
viewTransition: s
|
|
1530
|
+
},
|
|
1531
|
+
typeof u == "function" ? u(Q) : u
|
|
1532
|
+
);
|
|
1533
|
+
}
|
|
1534
|
+
);
|
|
1535
|
+
qr.displayName = "NavLink";
|
|
1536
|
+
var Kr = h.forwardRef(
|
|
1537
|
+
({
|
|
1538
|
+
discover: e = "render",
|
|
1539
|
+
fetcherKey: n,
|
|
1540
|
+
navigate: t,
|
|
1541
|
+
reloadDocument: a,
|
|
1542
|
+
replace: r,
|
|
1543
|
+
state: o,
|
|
1544
|
+
method: l = Ce,
|
|
1545
|
+
action: s,
|
|
1546
|
+
onSubmit: u,
|
|
1547
|
+
relative: c,
|
|
1548
|
+
preventScrollReset: d,
|
|
1549
|
+
viewTransition: g,
|
|
1550
|
+
...p
|
|
1551
|
+
}, f) => {
|
|
1552
|
+
let x = Jr(), b = Xr(s, { relative: c }), j = l.toLowerCase() === "get" ? "get" : "post", w = typeof s == "string" && Ht.test(s), y = (v) => {
|
|
1553
|
+
if (u && u(v), v.defaultPrevented) return;
|
|
1554
|
+
v.preventDefault();
|
|
1555
|
+
let C = v.nativeEvent.submitter, T = (C == null ? void 0 : C.getAttribute("formmethod")) || l;
|
|
1556
|
+
x(C || v.currentTarget, {
|
|
1557
|
+
fetcherKey: n,
|
|
1558
|
+
method: T,
|
|
1559
|
+
navigate: t,
|
|
1560
|
+
replace: r,
|
|
1561
|
+
state: o,
|
|
1562
|
+
relative: c,
|
|
1563
|
+
preventScrollReset: d,
|
|
1564
|
+
viewTransition: g
|
|
1565
|
+
});
|
|
1566
|
+
};
|
|
1567
|
+
return /* @__PURE__ */ h.createElement(
|
|
1568
|
+
"form",
|
|
1569
|
+
{
|
|
1570
|
+
ref: f,
|
|
1571
|
+
method: j,
|
|
1572
|
+
action: b,
|
|
1573
|
+
onSubmit: a ? u : y,
|
|
1574
|
+
...p,
|
|
1575
|
+
"data-discover": !w && e === "render" ? "true" : void 0
|
|
1576
|
+
}
|
|
1577
|
+
);
|
|
1578
|
+
}
|
|
1579
|
+
);
|
|
1580
|
+
Kr.displayName = "Form";
|
|
1581
|
+
function Vr(e) {
|
|
1582
|
+
return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
1583
|
+
}
|
|
1584
|
+
function Gt(e) {
|
|
1585
|
+
let n = h.useContext(ce);
|
|
1586
|
+
return P(n, Vr(e)), n;
|
|
1587
|
+
}
|
|
1588
|
+
function Hr(e, {
|
|
1589
|
+
target: n,
|
|
1590
|
+
replace: t,
|
|
1591
|
+
state: a,
|
|
1592
|
+
preventScrollReset: r,
|
|
1593
|
+
relative: o,
|
|
1594
|
+
viewTransition: l
|
|
1595
|
+
} = {}) {
|
|
1596
|
+
let s = Ut(), u = ne(), c = ve(e, { relative: o });
|
|
1597
|
+
return h.useCallback(
|
|
1598
|
+
(d) => {
|
|
1599
|
+
if (Er(d, n)) {
|
|
1600
|
+
d.preventDefault();
|
|
1601
|
+
let g = t !== void 0 ? t : Ue(u) === Ue(c);
|
|
1602
|
+
s(e, {
|
|
1603
|
+
replace: g,
|
|
1604
|
+
state: a,
|
|
1605
|
+
preventScrollReset: r,
|
|
1606
|
+
relative: o,
|
|
1607
|
+
viewTransition: l
|
|
1608
|
+
});
|
|
1609
|
+
}
|
|
1610
|
+
},
|
|
1611
|
+
[
|
|
1612
|
+
u,
|
|
1613
|
+
s,
|
|
1614
|
+
c,
|
|
1615
|
+
t,
|
|
1616
|
+
a,
|
|
1617
|
+
n,
|
|
1618
|
+
e,
|
|
1619
|
+
r,
|
|
1620
|
+
o,
|
|
1621
|
+
l
|
|
1622
|
+
]
|
|
1623
|
+
);
|
|
1624
|
+
}
|
|
1625
|
+
var Yr = 0, Gr = () => `__${String(++Yr)}__`;
|
|
1626
|
+
function Jr() {
|
|
1627
|
+
let { router: e } = Gt(
|
|
1628
|
+
"useSubmit"
|
|
1629
|
+
/* UseSubmit */
|
|
1630
|
+
), { basename: n } = h.useContext(K), t = vr();
|
|
1631
|
+
return h.useCallback(
|
|
1632
|
+
async (a, r = {}) => {
|
|
1633
|
+
let { action: o, method: l, encType: s, formData: u, body: c } = Nr(
|
|
1634
|
+
a,
|
|
1635
|
+
n
|
|
1636
|
+
);
|
|
1637
|
+
if (r.navigate === !1) {
|
|
1638
|
+
let d = r.fetcherKey || Gr();
|
|
1639
|
+
await e.fetch(d, t, r.action || o, {
|
|
1640
|
+
preventScrollReset: r.preventScrollReset,
|
|
1641
|
+
formData: u,
|
|
1642
|
+
body: c,
|
|
1643
|
+
formMethod: r.method || l,
|
|
1644
|
+
formEncType: r.encType || s,
|
|
1645
|
+
flushSync: r.flushSync
|
|
1646
|
+
});
|
|
1647
|
+
} else
|
|
1648
|
+
await e.navigate(r.action || o, {
|
|
1649
|
+
preventScrollReset: r.preventScrollReset,
|
|
1650
|
+
formData: u,
|
|
1651
|
+
body: c,
|
|
1652
|
+
formMethod: r.method || l,
|
|
1653
|
+
formEncType: r.encType || s,
|
|
1654
|
+
replace: r.replace,
|
|
1655
|
+
state: r.state,
|
|
1656
|
+
fromRouteId: t,
|
|
1657
|
+
flushSync: r.flushSync,
|
|
1658
|
+
viewTransition: r.viewTransition
|
|
1659
|
+
});
|
|
1660
|
+
},
|
|
1661
|
+
[e, n, t]
|
|
1662
|
+
);
|
|
1663
|
+
}
|
|
1664
|
+
function Xr(e, { relative: n } = {}) {
|
|
1665
|
+
let { basename: t } = h.useContext(K), a = h.useContext(V);
|
|
1666
|
+
P(a, "useFormAction must be used inside a RouteContext");
|
|
1667
|
+
let [r] = a.matches.slice(-1), o = { ...ve(e || ".", { relative: n }) }, l = ne();
|
|
1668
|
+
if (e == null) {
|
|
1669
|
+
o.search = l.search;
|
|
1670
|
+
let s = new URLSearchParams(o.search), u = s.getAll("index");
|
|
1671
|
+
if (u.some((d) => d === "")) {
|
|
1672
|
+
s.delete("index"), u.filter((g) => g).forEach((g) => s.append("index", g));
|
|
1673
|
+
let d = s.toString();
|
|
1674
|
+
o.search = d ? `?${d}` : "";
|
|
1675
|
+
}
|
|
1676
|
+
}
|
|
1677
|
+
return (!e || e === ".") && r.route.index && (o.search = o.search ? o.search.replace(/^\?/, "?index&") : "?index"), t !== "/" && (o.pathname = o.pathname === "/" ? t : W([t, o.pathname])), Ue(o);
|
|
1678
|
+
}
|
|
1679
|
+
function Zr(e, { relative: n } = {}) {
|
|
1680
|
+
let t = h.useContext(Mt);
|
|
1681
|
+
P(
|
|
1682
|
+
t != null,
|
|
1683
|
+
"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"
|
|
1684
|
+
);
|
|
1685
|
+
let { basename: a } = Gt(
|
|
1686
|
+
"useViewTransitionState"
|
|
1687
|
+
/* useViewTransitionState */
|
|
1688
|
+
), r = ve(e, { relative: n });
|
|
1689
|
+
if (!t.isTransitioning)
|
|
1690
|
+
return !1;
|
|
1691
|
+
let o = J(t.currentLocation.pathname, a) || t.currentLocation.pathname, l = J(t.nextLocation.pathname, a) || t.nextLocation.pathname;
|
|
1692
|
+
return ke(r.pathname, l) != null || ke(r.pathname, o) != null;
|
|
1693
|
+
}
|
|
1694
|
+
const Za = ({ message: e }) => {
|
|
1695
|
+
const n = Ut();
|
|
1696
|
+
return /* @__PURE__ */ i.jsx(
|
|
1697
|
+
fn,
|
|
419
1698
|
{
|
|
420
1699
|
size: "xs",
|
|
421
1700
|
style: {
|
|
@@ -424,31 +1703,31 @@ const T = {
|
|
|
424
1703
|
alignItems: "center",
|
|
425
1704
|
justifyContent: "center"
|
|
426
1705
|
},
|
|
427
|
-
children: /* @__PURE__ */
|
|
428
|
-
|
|
1706
|
+
children: /* @__PURE__ */ i.jsx(
|
|
1707
|
+
qe,
|
|
429
1708
|
{
|
|
430
1709
|
color: "red",
|
|
431
1710
|
title: "Not Found",
|
|
432
1711
|
variant: "404 - Not Found",
|
|
433
|
-
icon: /* @__PURE__ */
|
|
434
|
-
children: /* @__PURE__ */
|
|
1712
|
+
icon: /* @__PURE__ */ i.jsx(Ke, { size: 12, stroke: 1.5 }),
|
|
1713
|
+
children: /* @__PURE__ */ i.jsxs(pe, { align: "flex-start", children: [
|
|
435
1714
|
e || "Sorry, the page you are looking for does not exist.",
|
|
436
|
-
/* @__PURE__ */
|
|
1715
|
+
/* @__PURE__ */ i.jsx(B, { variant: "filled", onClick: () => n("/"), size: "xs", children: "Back Home" })
|
|
437
1716
|
] })
|
|
438
1717
|
}
|
|
439
1718
|
)
|
|
440
1719
|
}
|
|
441
1720
|
);
|
|
442
|
-
},
|
|
443
|
-
|
|
1721
|
+
}, Qa = ({ message: e }) => /* @__PURE__ */ i.jsx(
|
|
1722
|
+
qe,
|
|
444
1723
|
{
|
|
445
1724
|
color: "red",
|
|
446
1725
|
title: "Not Found",
|
|
447
1726
|
variant: "404 - Not Found",
|
|
448
|
-
icon: /* @__PURE__ */
|
|
1727
|
+
icon: /* @__PURE__ */ i.jsx(Ke, { size: 12, stroke: 1.5 }),
|
|
449
1728
|
children: e || "Sorry, the page you are looking for does not exist."
|
|
450
1729
|
}
|
|
451
|
-
),
|
|
1730
|
+
), Jt = ({ message: e }) => /* @__PURE__ */ i.jsx(R, { c: "red", size: "sm", children: e || "Not Found" }), eo = ({ tip: e }) => e === void 0 ? /* @__PURE__ */ i.jsx(z, { justify: "center", align: "center", children: /* @__PURE__ */ i.jsx(Ee, { color: "blue", size: "md" }) }) : /* @__PURE__ */ i.jsxs(
|
|
452
1731
|
z,
|
|
453
1732
|
{
|
|
454
1733
|
gap: "md",
|
|
@@ -457,67 +1736,67 @@ const T = {
|
|
|
457
1736
|
align: "center",
|
|
458
1737
|
style: { height: "100%" },
|
|
459
1738
|
children: [
|
|
460
|
-
/* @__PURE__ */
|
|
1739
|
+
/* @__PURE__ */ i.jsx(Ee, { color: "blue", size: "md" }),
|
|
461
1740
|
e
|
|
462
1741
|
]
|
|
463
1742
|
}
|
|
464
|
-
),
|
|
465
|
-
/* @__PURE__ */
|
|
1743
|
+
), to = ({ tip: e }) => e === void 0 ? /* @__PURE__ */ i.jsx(Ee, { color: "blue", size: "xs" }) : /* @__PURE__ */ i.jsxs(z, { gap: "md", direction: "column", justify: "center", align: "center", children: [
|
|
1744
|
+
/* @__PURE__ */ i.jsx(Ee, { color: "blue", size: "xs" }),
|
|
466
1745
|
e
|
|
467
|
-
] }),
|
|
468
|
-
|
|
1746
|
+
] }), no = ({ message: e }) => /* @__PURE__ */ i.jsx(
|
|
1747
|
+
qe,
|
|
469
1748
|
{
|
|
470
1749
|
color: "red",
|
|
471
1750
|
title: "Not Found",
|
|
472
1751
|
variant: "403 - Not Authorized",
|
|
473
|
-
icon: /* @__PURE__ */
|
|
1752
|
+
icon: /* @__PURE__ */ i.jsx(Ke, { size: 12, stroke: 1.5 }),
|
|
474
1753
|
children: e || "Sorry, you are not authorized to access this page."
|
|
475
1754
|
}
|
|
476
1755
|
);
|
|
477
|
-
function
|
|
478
|
-
return e.reduce((
|
|
479
|
-
const r =
|
|
480
|
-
return
|
|
1756
|
+
function ro(e, n) {
|
|
1757
|
+
return e.reduce((t, a) => {
|
|
1758
|
+
const r = n(a);
|
|
1759
|
+
return t[r] || (t[r] = []), t[r].push(a), t;
|
|
481
1760
|
}, {});
|
|
482
1761
|
}
|
|
483
|
-
function
|
|
484
|
-
const
|
|
485
|
-
let
|
|
486
|
-
return e.reduce((r,
|
|
487
|
-
const
|
|
488
|
-
return
|
|
489
|
-
}, {}),
|
|
490
|
-
}
|
|
491
|
-
function
|
|
492
|
-
const
|
|
493
|
-
return e.filter((
|
|
494
|
-
const r =
|
|
495
|
-
return
|
|
1762
|
+
function ao(e, n) {
|
|
1763
|
+
const t = [];
|
|
1764
|
+
let a;
|
|
1765
|
+
return e.reduce((r, o) => {
|
|
1766
|
+
const l = n(o);
|
|
1767
|
+
return l === void 0 ? (a === void 0 && (a = t.length, t.push([])), t[a].push(o)) : (r[l] === void 0 && (r[l] = t.length, t.push([])), t[r[l]].push(o)), r;
|
|
1768
|
+
}, {}), t;
|
|
1769
|
+
}
|
|
1770
|
+
function oo(e, n) {
|
|
1771
|
+
const t = /* @__PURE__ */ new Set();
|
|
1772
|
+
return e.filter((a) => {
|
|
1773
|
+
const r = n(a);
|
|
1774
|
+
return t.has(r) ? !1 : (t.add(r), !0);
|
|
496
1775
|
});
|
|
497
1776
|
}
|
|
498
|
-
class
|
|
1777
|
+
class io {
|
|
499
1778
|
constructor() {
|
|
500
|
-
|
|
501
|
-
|
|
1779
|
+
G(this, "items", []);
|
|
1780
|
+
G(this, "seen", /* @__PURE__ */ new Set());
|
|
502
1781
|
}
|
|
503
|
-
add(
|
|
504
|
-
const
|
|
505
|
-
this.seen.has(
|
|
1782
|
+
add(n, t) {
|
|
1783
|
+
const a = t(n);
|
|
1784
|
+
this.seen.has(a) || (this.items.push(n), this.seen.add(a));
|
|
506
1785
|
}
|
|
507
1786
|
toArray() {
|
|
508
1787
|
return this.items;
|
|
509
1788
|
}
|
|
510
1789
|
}
|
|
511
|
-
class
|
|
1790
|
+
class gt {
|
|
512
1791
|
constructor() {
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
1792
|
+
G(this, "children", /* @__PURE__ */ new Map());
|
|
1793
|
+
G(this, "isEndOfWord", !1);
|
|
1794
|
+
G(this, "value", "");
|
|
516
1795
|
}
|
|
517
1796
|
}
|
|
518
|
-
class
|
|
1797
|
+
class Xt {
|
|
519
1798
|
constructor() {
|
|
520
|
-
|
|
1799
|
+
G(this, "root", new gt());
|
|
521
1800
|
}
|
|
522
1801
|
/**
|
|
523
1802
|
* Inserts a word into the trie structure.
|
|
@@ -525,13 +1804,13 @@ class et {
|
|
|
525
1804
|
*
|
|
526
1805
|
* @param word - The string to insert into the trie
|
|
527
1806
|
*/
|
|
528
|
-
insert(
|
|
529
|
-
let
|
|
530
|
-
for (const
|
|
531
|
-
let r =
|
|
532
|
-
r === void 0 && (r = new
|
|
1807
|
+
insert(n) {
|
|
1808
|
+
let t = this.root;
|
|
1809
|
+
for (const a of n) {
|
|
1810
|
+
let r = t.children.get(a);
|
|
1811
|
+
r === void 0 && (r = new gt(), t.children.set(a, r)), t = r;
|
|
533
1812
|
}
|
|
534
|
-
|
|
1813
|
+
t.isEndOfWord = !0, t.value = n;
|
|
535
1814
|
}
|
|
536
1815
|
/**
|
|
537
1816
|
* Finds the longest prefix match for the given text.
|
|
@@ -540,201 +1819,200 @@ class et {
|
|
|
540
1819
|
* @param text - The input string to find prefix matches for
|
|
541
1820
|
* @returns Object containing the longest matching prefix and remaining text
|
|
542
1821
|
*/
|
|
543
|
-
findLongestPrefix(
|
|
544
|
-
let
|
|
545
|
-
for (let r = 0; r <
|
|
546
|
-
const
|
|
547
|
-
if (!
|
|
1822
|
+
findLongestPrefix(n) {
|
|
1823
|
+
let t = this.root, a = { match: "", remaining: n };
|
|
1824
|
+
for (let r = 0; r < n.length; r++) {
|
|
1825
|
+
const o = n[r];
|
|
1826
|
+
if (!t.children.has(o))
|
|
548
1827
|
break;
|
|
549
|
-
|
|
550
|
-
match:
|
|
551
|
-
remaining:
|
|
1828
|
+
t = t.children.get(o), t.isEndOfWord && (a = {
|
|
1829
|
+
match: t.value,
|
|
1830
|
+
remaining: n.slice(r + 1)
|
|
552
1831
|
});
|
|
553
1832
|
}
|
|
554
|
-
return
|
|
1833
|
+
return a;
|
|
555
1834
|
}
|
|
556
1835
|
}
|
|
557
|
-
var
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
/**
|
|
564
|
-
* Normalizes a URL path by removing trailing slashes
|
|
565
|
-
*
|
|
566
|
-
* @param path - The path which is an URL string to normalize
|
|
567
|
-
* @returns The normalized path without trailing slash, except for root "/"
|
|
568
|
-
*/
|
|
569
|
-
normalizePath(n) {
|
|
570
|
-
return n === "/" ? "/" : n.replace(/\/$/, "");
|
|
571
|
-
}
|
|
572
|
-
/**
|
|
573
|
-
* Inserts an url path into the trie and associates it with a menu key.
|
|
574
|
-
*
|
|
575
|
-
* @param path - The URL path to store (e.g., "/admin/users")
|
|
576
|
-
* @param menuKey - The menu key to associate with this path
|
|
577
|
-
*/
|
|
578
|
-
insertRoute(n, o) {
|
|
579
|
-
const r = this.normalizePath(n);
|
|
580
|
-
this.insert(r), this.pathToKey.set(r, o);
|
|
581
|
-
}
|
|
582
|
-
/**
|
|
583
|
-
* Finds the menu key associated with the longest matching route prefix
|
|
584
|
-
*
|
|
585
|
-
* @param route - The URL to match against stored menu url paths
|
|
586
|
-
* @returns The menu key if a valid prefix match is found, undefined otherwise
|
|
587
|
-
*/
|
|
588
|
-
findMatchingKey(n) {
|
|
589
|
-
const o = this.normalizePath(n), r = this.findLongestPrefix(o);
|
|
590
|
-
if (r.match && this.pathToKey.has(r.match) && (o === r.match || r.remaining.startsWith("/") || r.remaining === ""))
|
|
591
|
-
return this.pathToKey.get(r.match);
|
|
592
|
-
}
|
|
593
|
-
}
|
|
594
|
-
function Gt(e) {
|
|
595
|
-
const s = {}, n = {}, o = {}, r = (i, a = []) => {
|
|
596
|
-
i.forEach((c) => {
|
|
597
|
-
const d = [...a, c.key];
|
|
598
|
-
s[c.key] = c, n[c.key] = d, c.route !== void 0 && (o[c.key] = c.route), c.children !== void 0 && c.children.length > 0 && r(c.children, d);
|
|
1836
|
+
var We = /* @__PURE__ */ ((e) => (e[e.Allow = 0] = "Allow", e[e.Denied = 1] = "Denied", e[e.Pending = 2] = "Pending", e))(We || {});
|
|
1837
|
+
function Qr(e) {
|
|
1838
|
+
const n = {}, t = {}, a = {}, r = (o, l = []) => {
|
|
1839
|
+
o.forEach((s) => {
|
|
1840
|
+
const u = [...l, s.key];
|
|
1841
|
+
n[s.key] = s, t[s.key] = u, s.route !== void 0 && (a[s.key] = s.route), s.children !== void 0 && s.children.length > 0 && r(s.children, u);
|
|
599
1842
|
});
|
|
600
1843
|
};
|
|
601
|
-
return r(e), { key2item:
|
|
602
|
-
}
|
|
603
|
-
function
|
|
604
|
-
const
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
const i = r.route.path.getURL();
|
|
608
|
-
s.insertRoute(i, r.key);
|
|
609
|
-
}
|
|
610
|
-
r.children !== void 0 && r.children.length > 0 && n(r.children);
|
|
1844
|
+
return r(e), { key2item: n, key2fullpath: t, key2route: a };
|
|
1845
|
+
}
|
|
1846
|
+
function ea(e) {
|
|
1847
|
+
const n = new na(), t = (a) => {
|
|
1848
|
+
a.forEach((r) => {
|
|
1849
|
+
r.route !== void 0 && n.insertRoute(r.route.route.fullPath, r.key), r.children !== void 0 && r.children.length > 0 && t(r.children);
|
|
611
1850
|
});
|
|
612
1851
|
};
|
|
613
|
-
return
|
|
614
|
-
}
|
|
615
|
-
function
|
|
616
|
-
return e.map((
|
|
617
|
-
if (
|
|
618
|
-
return
|
|
619
|
-
if (
|
|
620
|
-
const
|
|
621
|
-
return
|
|
1852
|
+
return t(e), n;
|
|
1853
|
+
}
|
|
1854
|
+
function ta(e, n) {
|
|
1855
|
+
return e.map((t) => {
|
|
1856
|
+
if (t.route !== void 0)
|
|
1857
|
+
return n(t.route.role) === We.Allow ? t : null;
|
|
1858
|
+
if (t.children !== void 0) {
|
|
1859
|
+
const a = t.children.filter((r) => r.route !== void 0 ? n(r.route.role) === We.Allow : !0);
|
|
1860
|
+
return a.length > 0 ? { ...t, children: a } : null;
|
|
622
1861
|
}
|
|
623
|
-
return
|
|
624
|
-
}).filter((
|
|
1862
|
+
return t;
|
|
1863
|
+
}).filter((t) => t !== null);
|
|
625
1864
|
}
|
|
626
|
-
const
|
|
627
|
-
const
|
|
628
|
-
() =>
|
|
629
|
-
[
|
|
1865
|
+
const lo = (e) => {
|
|
1866
|
+
const [n, t] = $(/* @__PURE__ */ new Set()), [a, r] = $(/* @__PURE__ */ new Set()), [o, l] = $(), s = E(() => ta(e.items, e.checkPermission), [e.items, e.checkPermission]), u = E(() => ea(e.items), [e.items]), { key2fullpath: c, key2route: d } = E(
|
|
1867
|
+
() => Qr(s),
|
|
1868
|
+
[s]
|
|
630
1869
|
);
|
|
631
|
-
|
|
632
|
-
const
|
|
633
|
-
|
|
634
|
-
}, [
|
|
635
|
-
const g =
|
|
636
|
-
function
|
|
637
|
-
var
|
|
638
|
-
const
|
|
639
|
-
return
|
|
1870
|
+
Te(() => {
|
|
1871
|
+
const p = window.location.pathname, f = u.findMatchingKey(p);
|
|
1872
|
+
f !== void 0 && (r(new Set(c[f])), l(f));
|
|
1873
|
+
}, [location, d]);
|
|
1874
|
+
const g = E(() => {
|
|
1875
|
+
function p(f, x) {
|
|
1876
|
+
var j;
|
|
1877
|
+
const b = f.children !== void 0 && f.children.length > 0;
|
|
1878
|
+
return b ? /* @__PURE__ */ i.jsxs(
|
|
640
1879
|
"div",
|
|
641
1880
|
{
|
|
642
1881
|
onMouseEnter: () => {
|
|
643
|
-
|
|
644
|
-
const
|
|
645
|
-
return
|
|
1882
|
+
a.has(f.key) || t((w) => {
|
|
1883
|
+
const y = new Set(w);
|
|
1884
|
+
return y.add(f.key), y;
|
|
646
1885
|
});
|
|
647
1886
|
},
|
|
648
1887
|
onMouseLeave: () => {
|
|
649
|
-
|
|
650
|
-
const
|
|
651
|
-
return
|
|
1888
|
+
a.has(f.key) || t((w) => {
|
|
1889
|
+
const y = new Set(w);
|
|
1890
|
+
return y.delete(f.key), y;
|
|
652
1891
|
});
|
|
653
1892
|
},
|
|
654
1893
|
children: [
|
|
655
|
-
/* @__PURE__ */
|
|
656
|
-
|
|
1894
|
+
/* @__PURE__ */ i.jsx(
|
|
1895
|
+
lt,
|
|
657
1896
|
{
|
|
658
|
-
active:
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
leftSection: u.icon,
|
|
1897
|
+
active: o === f.key,
|
|
1898
|
+
label: f.label,
|
|
1899
|
+
leftSection: f.icon,
|
|
662
1900
|
styles: {
|
|
663
1901
|
label: { fontSize: "md" },
|
|
664
1902
|
root: {
|
|
665
1903
|
borderRadius: "var(--mantine-radius-sm)"
|
|
666
1904
|
}
|
|
667
1905
|
},
|
|
668
|
-
ml:
|
|
1906
|
+
ml: x === 0 ? void 0 : x === 1 ? "md" : `calc(var(--mantine-spacing-md) * ${x})`,
|
|
669
1907
|
w: "unset",
|
|
670
|
-
rightSection:
|
|
671
|
-
|
|
1908
|
+
rightSection: b ? /* @__PURE__ */ i.jsx(
|
|
1909
|
+
Sn,
|
|
672
1910
|
{
|
|
673
1911
|
size: 12,
|
|
674
1912
|
stroke: 1.5,
|
|
675
1913
|
className: "mantine-rotate-rtl"
|
|
676
1914
|
}
|
|
677
1915
|
) : void 0,
|
|
678
|
-
opened:
|
|
679
|
-
onClick: (
|
|
680
|
-
|
|
681
|
-
const
|
|
682
|
-
return
|
|
683
|
-
})
|
|
1916
|
+
opened: n.has(f.key) || a.has(f.key),
|
|
1917
|
+
onClick: (w) => {
|
|
1918
|
+
w.preventDefault(), r((y) => {
|
|
1919
|
+
const v = new Set(y);
|
|
1920
|
+
return y.has(f.key) ? v.delete(f.key) : v.add(f.key), v;
|
|
1921
|
+
});
|
|
684
1922
|
}
|
|
685
1923
|
},
|
|
686
|
-
|
|
1924
|
+
f.key
|
|
687
1925
|
),
|
|
688
|
-
(
|
|
1926
|
+
(a.has(f.key) || n.has(f.key)) && f.children.map((w) => p(w, x + 1))
|
|
689
1927
|
]
|
|
690
1928
|
},
|
|
691
|
-
`container-${
|
|
692
|
-
) : /* @__PURE__ */
|
|
693
|
-
|
|
1929
|
+
`container-${f.key}`
|
|
1930
|
+
) : /* @__PURE__ */ i.jsx(
|
|
1931
|
+
lt,
|
|
694
1932
|
{
|
|
695
|
-
active:
|
|
696
|
-
href: (
|
|
697
|
-
label:
|
|
698
|
-
leftSection:
|
|
1933
|
+
active: o === f.key,
|
|
1934
|
+
href: (j = f.route) == null ? void 0 : j.route.fullPath,
|
|
1935
|
+
label: f.label,
|
|
1936
|
+
leftSection: f.icon,
|
|
699
1937
|
styles: {
|
|
700
1938
|
label: { fontSize: "md" },
|
|
701
1939
|
root: {
|
|
702
1940
|
borderRadius: "var(--mantine-radius-sm)"
|
|
703
1941
|
}
|
|
704
1942
|
},
|
|
705
|
-
ml:
|
|
1943
|
+
ml: x === 0 ? void 0 : x === 1 ? "md" : `calc(var(--mantine-spacing-md) * ${x})`,
|
|
706
1944
|
w: "unset",
|
|
707
|
-
onClick: (
|
|
708
|
-
|
|
1945
|
+
onClick: (w) => {
|
|
1946
|
+
w.ctrlKey || w.metaKey || (w.preventDefault(), f.route != null && e.navigate({ to: f.route.route.to }));
|
|
709
1947
|
}
|
|
710
1948
|
},
|
|
711
|
-
|
|
1949
|
+
f.key
|
|
712
1950
|
);
|
|
713
1951
|
}
|
|
714
|
-
return
|
|
715
|
-
}, [
|
|
716
|
-
return /* @__PURE__ */
|
|
717
|
-
}
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
1952
|
+
return s.map((f) => p(f, 0));
|
|
1953
|
+
}, [s, o, a, n]);
|
|
1954
|
+
return /* @__PURE__ */ i.jsx(i.Fragment, { children: g });
|
|
1955
|
+
};
|
|
1956
|
+
class na extends Xt {
|
|
1957
|
+
constructor() {
|
|
1958
|
+
super(...arguments);
|
|
1959
|
+
G(this, "pathToKey", /* @__PURE__ */ new Map());
|
|
1960
|
+
}
|
|
1961
|
+
/**
|
|
1962
|
+
* Normalizes a URL path by removing trailing slashes
|
|
1963
|
+
*
|
|
1964
|
+
* @param path - The path which is an URL string to normalize
|
|
1965
|
+
* @returns The normalized path without trailing slash, except for root "/"
|
|
1966
|
+
*/
|
|
1967
|
+
normalizePath(t) {
|
|
1968
|
+
return t === "/" ? "/" : t.replace(/\/$/, "");
|
|
1969
|
+
}
|
|
1970
|
+
/**
|
|
1971
|
+
* Inserts an url path into the trie and associates it with a menu key.
|
|
1972
|
+
*
|
|
1973
|
+
* @param path - The URL path to store (e.g., "/admin/users")
|
|
1974
|
+
* @param menuKey - The menu key to associate with this path
|
|
1975
|
+
*/
|
|
1976
|
+
insertRoute(t, a) {
|
|
1977
|
+
const r = this.normalizePath(t);
|
|
1978
|
+
this.insert(r), this.pathToKey.set(r, a);
|
|
1979
|
+
}
|
|
1980
|
+
/**
|
|
1981
|
+
* Finds the menu key associated with the longest matching route prefix
|
|
1982
|
+
*
|
|
1983
|
+
* @param route - The URL to match against stored menu url paths
|
|
1984
|
+
* @returns The menu key if a valid prefix match is found, undefined otherwise
|
|
1985
|
+
*/
|
|
1986
|
+
findMatchingKey(t) {
|
|
1987
|
+
const a = this.normalizePath(t), r = this.findLongestPrefix(a);
|
|
1988
|
+
if (r.match && this.pathToKey.has(r.match) && (a === r.match || r.remaining.startsWith("/") || r.remaining === ""))
|
|
1989
|
+
return this.pathToKey.get(r.match);
|
|
1990
|
+
}
|
|
1991
|
+
}
|
|
1992
|
+
const Qe = Ct({ link: () => null }), so = ({
|
|
1993
|
+
link: e,
|
|
1994
|
+
children: n
|
|
1995
|
+
}) => /* @__PURE__ */ i.jsx(Qe.Provider, { value: { link: e }, children: n }), Se = ({ value: e }) => /* @__PURE__ */ i.jsx(R, { size: "sm", children: e });
|
|
1996
|
+
function et(e, n) {
|
|
1997
|
+
const t = n.getDate().toString().padStart(2, "0"), a = (n.getMonth() + 1).toString().padStart(2, "0"), r = n.getFullYear();
|
|
1998
|
+
return e.baseName === "en-US" ? `${a}/${t}/${r}` : e.baseName === "vi-VN" ? `${t}/${a}/${r}` : `${a}/${t}/${r}`;
|
|
1999
|
+
}
|
|
2000
|
+
const ra = ({ value: e }) => {
|
|
2001
|
+
const n = se(xe), t = E(() => {
|
|
2002
|
+
const a = e.getHours().toString().padStart(2, "0"), r = e.getMinutes().toString().padStart(2, "0"), o = e.getSeconds().toString().padStart(2, "0");
|
|
2003
|
+
return et(n, e) + `${a}:${r}:${o}`;
|
|
2004
|
+
}, [n, e]);
|
|
2005
|
+
return /* @__PURE__ */ i.jsx(R, { size: "sm", children: t });
|
|
2006
|
+
}, aa = ({ value: e }) => {
|
|
2007
|
+
const n = se(xe), t = E(() => et(n, e), [n, e]);
|
|
2008
|
+
return /* @__PURE__ */ i.jsx(R, { size: "sm", children: t });
|
|
2009
|
+
}, uo = ({ value: e }) => {
|
|
2010
|
+
const n = se(xe), [t, a] = E(() => {
|
|
2011
|
+
const r = et(n, e), o = e.getHours().toString().padStart(2, "0"), l = e.getMinutes().toString().padStart(2, "0"), s = e.getSeconds().toString().padStart(2, "0");
|
|
2012
|
+
return [r, `${o}:${l}:${s}`];
|
|
2013
|
+
}, [n, e]);
|
|
2014
|
+
return /* @__PURE__ */ i.jsx(R, { size: "sm", title: a, children: t });
|
|
2015
|
+
}, oa = {
|
|
738
2016
|
yes: {
|
|
739
2017
|
lang2value: {
|
|
740
2018
|
en: "Yes",
|
|
@@ -749,482 +2027,472 @@ const Ht = ({ value: e }) => {
|
|
|
749
2027
|
},
|
|
750
2028
|
lang: "en"
|
|
751
2029
|
}
|
|
752
|
-
},
|
|
753
|
-
|
|
2030
|
+
}, ia = ({ value: e }) => /* @__PURE__ */ i.jsx(
|
|
2031
|
+
ge,
|
|
754
2032
|
{
|
|
755
2033
|
checked: e,
|
|
756
|
-
label: /* @__PURE__ */
|
|
2034
|
+
label: /* @__PURE__ */ i.jsx(O, { value: oa[e ? "yes" : "no"] }),
|
|
757
2035
|
readOnly: !0
|
|
758
2036
|
}
|
|
759
|
-
),
|
|
2037
|
+
), la = ({
|
|
760
2038
|
nestedProperty: e,
|
|
761
|
-
property:
|
|
762
|
-
value:
|
|
2039
|
+
property: n,
|
|
2040
|
+
value: t
|
|
763
2041
|
}) => {
|
|
764
|
-
const
|
|
765
|
-
if (
|
|
2042
|
+
const a = e || n;
|
|
2043
|
+
if (ue(a) || a.enumType === void 0)
|
|
766
2044
|
throw new Error(
|
|
767
2045
|
"Invalid usage of EnumDisplay. Expect a property of type enum"
|
|
768
2046
|
);
|
|
769
|
-
return /* @__PURE__ */
|
|
2047
|
+
return /* @__PURE__ */ i.jsx(R, { size: "sm", children: /* @__PURE__ */ i.jsx(O, { value: a.enumType.label[t] }) });
|
|
770
2048
|
};
|
|
771
|
-
function
|
|
772
|
-
const r = e.getByName(
|
|
773
|
-
|
|
774
|
-
r.fetchByIds(
|
|
775
|
-
}, [
|
|
776
|
-
const
|
|
777
|
-
for (const
|
|
778
|
-
|
|
779
|
-
return [
|
|
780
|
-
}
|
|
781
|
-
const
|
|
2049
|
+
function Zt(e, n, t, a) {
|
|
2050
|
+
const r = e.getByName(n.targetClass), o = a[n.targetClass];
|
|
2051
|
+
Te(() => {
|
|
2052
|
+
r.fetchByIds(t);
|
|
2053
|
+
}, [t]);
|
|
2054
|
+
const l = {};
|
|
2055
|
+
for (const s of t)
|
|
2056
|
+
l[s] = r.get(s);
|
|
2057
|
+
return [l, o];
|
|
2058
|
+
}
|
|
2059
|
+
const Le = Z(
|
|
782
2060
|
({
|
|
783
2061
|
db: e,
|
|
784
|
-
property:
|
|
785
|
-
value:
|
|
786
|
-
entityRoutes:
|
|
2062
|
+
property: n,
|
|
2063
|
+
value: t,
|
|
2064
|
+
entityRoutes: a
|
|
787
2065
|
}) => {
|
|
788
|
-
const r =
|
|
2066
|
+
const { link: r } = se(Qe), o = E(() => [t], [t]), [l, s] = Zt(
|
|
789
2067
|
e,
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
),
|
|
794
|
-
return
|
|
795
|
-
He,
|
|
796
|
-
{
|
|
797
|
-
path: a,
|
|
798
|
-
openInNewPage: !1,
|
|
799
|
-
urlArgs: { id: c.id },
|
|
800
|
-
queryArgs: {},
|
|
801
|
-
children: c.name
|
|
802
|
-
}
|
|
803
|
-
);
|
|
2068
|
+
n,
|
|
2069
|
+
o,
|
|
2070
|
+
a
|
|
2071
|
+
), u = l[t];
|
|
2072
|
+
return u === void 0 ? /* @__PURE__ */ i.jsx(R, { size: "sm", children: t }) : u === null ? /* @__PURE__ */ i.jsx(Jt, {}) : s === void 0 ? /* @__PURE__ */ i.jsx(R, { size: "sm", children: u.name }) : /* @__PURE__ */ i.jsx(r, { to: s.to, openInNewPage: !1, params: { id: u.id }, children: u.name });
|
|
804
2073
|
}
|
|
805
|
-
),
|
|
2074
|
+
), Fe = Z(
|
|
806
2075
|
({
|
|
807
2076
|
db: e,
|
|
808
|
-
property:
|
|
809
|
-
value:
|
|
810
|
-
entityRoutes:
|
|
2077
|
+
property: n,
|
|
2078
|
+
value: t,
|
|
2079
|
+
entityRoutes: a
|
|
811
2080
|
}) => {
|
|
812
|
-
const
|
|
2081
|
+
const { link: r } = se(Qe), [o, l] = Zt(
|
|
813
2082
|
e,
|
|
814
|
-
s,
|
|
815
2083
|
n,
|
|
816
|
-
|
|
2084
|
+
t,
|
|
2085
|
+
a
|
|
817
2086
|
);
|
|
818
|
-
return /* @__PURE__ */
|
|
819
|
-
const
|
|
820
|
-
return
|
|
821
|
-
|
|
2087
|
+
return /* @__PURE__ */ i.jsx(D, { gap: "xs", children: t.map((s, u) => {
|
|
2088
|
+
const c = o[s];
|
|
2089
|
+
return c === void 0 ? /* @__PURE__ */ i.jsx(R, { size: "sm", children: t }, s) : c === null ? /* @__PURE__ */ i.jsx(Jt, {}, s) : l === void 0 ? /* @__PURE__ */ i.jsx(R, { size: "sm", children: c.name }, u) : /* @__PURE__ */ i.jsx(
|
|
2090
|
+
r,
|
|
822
2091
|
{
|
|
823
|
-
|
|
2092
|
+
to: l.to,
|
|
824
2093
|
openInNewPage: !1,
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
children: d.name
|
|
2094
|
+
params: { id: c.id },
|
|
2095
|
+
children: c.name
|
|
828
2096
|
},
|
|
829
|
-
|
|
2097
|
+
u
|
|
830
2098
|
);
|
|
831
2099
|
}) });
|
|
832
2100
|
}
|
|
833
|
-
),
|
|
834
|
-
string:
|
|
835
|
-
integer:
|
|
836
|
-
float:
|
|
837
|
-
boolean:
|
|
838
|
-
"string[]":
|
|
839
|
-
enum:
|
|
840
|
-
datetime:
|
|
841
|
-
date:
|
|
842
|
-
},
|
|
843
|
-
|
|
2101
|
+
), X = {
|
|
2102
|
+
string: Se,
|
|
2103
|
+
integer: Se,
|
|
2104
|
+
float: Se,
|
|
2105
|
+
boolean: ia,
|
|
2106
|
+
"string[]": Se,
|
|
2107
|
+
enum: la,
|
|
2108
|
+
datetime: ra,
|
|
2109
|
+
date: aa
|
|
2110
|
+
}, sa = ({ property: e, value: n, onChange: t }) => /* @__PURE__ */ i.jsx(
|
|
2111
|
+
U,
|
|
844
2112
|
{
|
|
845
2113
|
id: e.name,
|
|
846
2114
|
type: "checkbox",
|
|
847
|
-
checked:
|
|
848
|
-
onChange: (
|
|
849
|
-
const r =
|
|
850
|
-
|
|
2115
|
+
checked: n,
|
|
2116
|
+
onChange: (a) => {
|
|
2117
|
+
const r = a.target.checked;
|
|
2118
|
+
t(r);
|
|
851
2119
|
}
|
|
852
2120
|
}
|
|
853
|
-
),
|
|
2121
|
+
), pt = ({
|
|
854
2122
|
property: e,
|
|
855
|
-
value:
|
|
856
|
-
onChange:
|
|
857
|
-
}) => /* @__PURE__ */
|
|
858
|
-
|
|
2123
|
+
value: n,
|
|
2124
|
+
onChange: t
|
|
2125
|
+
}) => /* @__PURE__ */ i.jsx(
|
|
2126
|
+
U,
|
|
859
2127
|
{
|
|
860
2128
|
id: e.name,
|
|
861
2129
|
type: "number",
|
|
862
|
-
value:
|
|
863
|
-
onChange: (
|
|
864
|
-
const r =
|
|
865
|
-
|
|
2130
|
+
value: n,
|
|
2131
|
+
onChange: (a) => {
|
|
2132
|
+
const r = a.target.value;
|
|
2133
|
+
t(r === "" ? void 0 : Number(r));
|
|
866
2134
|
}
|
|
867
2135
|
}
|
|
868
|
-
),
|
|
2136
|
+
), ua = {
|
|
869
2137
|
lang2value: {
|
|
870
2138
|
en: "The leading zero is not necessary in international phone number format. For example, if your phone number is 0123456789, you should enter it as 123-456-789.",
|
|
871
2139
|
vi: "Số 0 đầu tiên không cần thiết trong định dạng điện thoại quốc tế. Ví dụ, nếu số điện thoại của bạn là 0123456789, bạn nên nhập nó là 123-456-789."
|
|
872
2140
|
},
|
|
873
2141
|
lang: "en"
|
|
874
|
-
},
|
|
2142
|
+
}, ca = {
|
|
875
2143
|
lang2value: {
|
|
876
2144
|
en: "No valid country code found.",
|
|
877
2145
|
vi: "Không tìm thấy mã quốc gia hợp lệ. "
|
|
878
2146
|
},
|
|
879
2147
|
lang: "en"
|
|
880
|
-
},
|
|
2148
|
+
}, le = {
|
|
881
2149
|
84: {
|
|
882
2150
|
name: "Vietnam",
|
|
883
|
-
flags: [
|
|
2151
|
+
flags: [N.VN]
|
|
884
2152
|
},
|
|
885
2153
|
1: {
|
|
886
2154
|
name: "US, Canada",
|
|
887
|
-
flags: [
|
|
2155
|
+
flags: [N.US, N.CA]
|
|
888
2156
|
},
|
|
889
2157
|
61: {
|
|
890
2158
|
name: "Australia",
|
|
891
|
-
flags: [
|
|
2159
|
+
flags: [N.AU]
|
|
892
2160
|
},
|
|
893
2161
|
81: {
|
|
894
2162
|
name: "Japan",
|
|
895
|
-
flags: [
|
|
2163
|
+
flags: [N.JP]
|
|
896
2164
|
},
|
|
897
2165
|
44: {
|
|
898
2166
|
name: "UK",
|
|
899
|
-
flags: [
|
|
2167
|
+
flags: [N.UK]
|
|
900
2168
|
},
|
|
901
2169
|
33: {
|
|
902
2170
|
name: "France",
|
|
903
|
-
flags: [
|
|
2171
|
+
flags: [N.FR]
|
|
904
2172
|
},
|
|
905
2173
|
49: {
|
|
906
2174
|
name: "Germany",
|
|
907
|
-
flags: [
|
|
2175
|
+
flags: [N.DE]
|
|
908
2176
|
},
|
|
909
2177
|
91: {
|
|
910
2178
|
name: "India",
|
|
911
|
-
flags: [
|
|
2179
|
+
flags: [N.IN]
|
|
912
2180
|
},
|
|
913
2181
|
55: {
|
|
914
2182
|
name: "Brazil",
|
|
915
|
-
flags: [
|
|
2183
|
+
flags: [N.BR]
|
|
916
2184
|
},
|
|
917
2185
|
34: {
|
|
918
2186
|
name: "Spain",
|
|
919
|
-
flags: [
|
|
2187
|
+
flags: [N.ES]
|
|
920
2188
|
},
|
|
921
2189
|
39: {
|
|
922
2190
|
name: "Italy",
|
|
923
|
-
flags: [
|
|
2191
|
+
flags: [N.IT]
|
|
924
2192
|
},
|
|
925
2193
|
64: {
|
|
926
2194
|
name: "New Zealand",
|
|
927
|
-
flags: [
|
|
2195
|
+
flags: [N.NZ]
|
|
928
2196
|
},
|
|
929
2197
|
52: {
|
|
930
2198
|
name: "Mexico",
|
|
931
|
-
flags: [
|
|
2199
|
+
flags: [N.MX]
|
|
932
2200
|
},
|
|
933
2201
|
86: {
|
|
934
2202
|
name: "China",
|
|
935
|
-
flags: [
|
|
2203
|
+
flags: [N.CN]
|
|
936
2204
|
}
|
|
937
|
-
},
|
|
2205
|
+
}, da = (e, n) => {
|
|
938
2206
|
if (e === "")
|
|
939
2207
|
return { match: "84", remaining: "" };
|
|
940
|
-
const
|
|
941
|
-
if (
|
|
2208
|
+
const t = e.replace(/[^\d]/g, ""), a = n.findLongestPrefix(t);
|
|
2209
|
+
if (a.match === "")
|
|
942
2210
|
throw new Error(`No valid country code found for phone number: ${e}`);
|
|
943
|
-
return
|
|
944
|
-
},
|
|
945
|
-
const
|
|
946
|
-
if (
|
|
947
|
-
return /* @__PURE__ */
|
|
948
|
-
/* @__PURE__ */
|
|
2211
|
+
return a;
|
|
2212
|
+
}, xt = ({ value: e }) => {
|
|
2213
|
+
const n = le[e];
|
|
2214
|
+
if (n !== void 0)
|
|
2215
|
+
return /* @__PURE__ */ i.jsxs(D, { gap: "sm", wrap: "nowrap", align: "center", children: [
|
|
2216
|
+
/* @__PURE__ */ i.jsxs(R, { size: "sm", children: [
|
|
949
2217
|
"+",
|
|
950
2218
|
e
|
|
951
2219
|
] }),
|
|
952
|
-
/* @__PURE__ */
|
|
2220
|
+
/* @__PURE__ */ i.jsx(D, { gap: 4, wrap: "nowrap", children: n.flags.map((t, a) => /* @__PURE__ */ i.jsx(Be, { flag: t }, a)) })
|
|
953
2221
|
] });
|
|
954
|
-
},
|
|
2222
|
+
}, fa = ({
|
|
955
2223
|
value: e,
|
|
956
|
-
onChange:
|
|
957
|
-
error:
|
|
958
|
-
id:
|
|
2224
|
+
onChange: n,
|
|
2225
|
+
error: t,
|
|
2226
|
+
id: a
|
|
959
2227
|
}) => {
|
|
960
|
-
const [r,
|
|
961
|
-
const
|
|
962
|
-
return Object.keys(
|
|
963
|
-
|
|
964
|
-
}),
|
|
965
|
-
}, [
|
|
2228
|
+
const [r, o] = $(""), [l, s] = $(!1), [u, c] = $(""), [d, g] = $(!1), p = E(() => {
|
|
2229
|
+
const v = new Xt();
|
|
2230
|
+
return Object.keys(le).forEach((C) => {
|
|
2231
|
+
v.insert(C);
|
|
2232
|
+
}), v;
|
|
2233
|
+
}, [le]), { rawInput: f } = E(() => {
|
|
966
2234
|
try {
|
|
967
|
-
const { match:
|
|
2235
|
+
const { match: v, remaining: C } = da(
|
|
968
2236
|
e,
|
|
969
|
-
|
|
2237
|
+
p
|
|
970
2238
|
);
|
|
971
|
-
return
|
|
972
|
-
rawInput:
|
|
2239
|
+
return c(v), g(!1), {
|
|
2240
|
+
rawInput: C
|
|
973
2241
|
};
|
|
974
2242
|
} catch {
|
|
975
|
-
return
|
|
2243
|
+
return g(!0), c(""), {
|
|
976
2244
|
rawInput: e
|
|
977
2245
|
};
|
|
978
2246
|
}
|
|
979
|
-
}, [e]),
|
|
2247
|
+
}, [e]), x = Rt({
|
|
980
2248
|
onDropdownClose: () => {
|
|
981
|
-
|
|
2249
|
+
x.resetSelectedOption(), o("");
|
|
982
2250
|
},
|
|
983
2251
|
onDropdownOpen: () => {
|
|
984
|
-
|
|
2252
|
+
x.updateSelectedOptionIndex("active");
|
|
985
2253
|
}
|
|
986
|
-
}),
|
|
987
|
-
const
|
|
988
|
-
return
|
|
989
|
-
},
|
|
990
|
-
return /* @__PURE__ */
|
|
991
|
-
/* @__PURE__ */
|
|
992
|
-
/* @__PURE__ */
|
|
993
|
-
|
|
2254
|
+
}), b = E(() => Object.keys(le), [le]), j = (v, C) => {
|
|
2255
|
+
const T = v.replace(/[^\d]/g, "");
|
|
2256
|
+
return T.length === 0 ? `+${C}` : T.startsWith("0") ? (s(!0), `+${C}${T}`) : (s(!1), `+${C}${T}`);
|
|
2257
|
+
}, w = E(() => b.filter((v) => le[v].name.toLowerCase().includes(r.toLowerCase()) || v.includes(r)), [r, b]), y = E(() => w.map((v, C) => /* @__PURE__ */ i.jsx(F.Option, { value: v, children: /* @__PURE__ */ i.jsx(xt, { value: v }) }, C)), [w]);
|
|
2258
|
+
return /* @__PURE__ */ i.jsxs("div", { children: [
|
|
2259
|
+
/* @__PURE__ */ i.jsx(_, { gutter: "xs", children: /* @__PURE__ */ i.jsx(_.Col, { children: /* @__PURE__ */ i.jsxs(D, { gap: 5, children: [
|
|
2260
|
+
/* @__PURE__ */ i.jsxs(
|
|
2261
|
+
F,
|
|
994
2262
|
{
|
|
995
|
-
store:
|
|
2263
|
+
store: x,
|
|
996
2264
|
position: "top-start",
|
|
997
|
-
onOptionSubmit: (
|
|
998
|
-
|
|
999
|
-
target: { value:
|
|
2265
|
+
onOptionSubmit: (v) => {
|
|
2266
|
+
o(""), x.closeDropdown(), n({
|
|
2267
|
+
target: { value: j(f, v) }
|
|
1000
2268
|
});
|
|
1001
2269
|
},
|
|
1002
2270
|
children: [
|
|
1003
|
-
/* @__PURE__ */
|
|
1004
|
-
|
|
2271
|
+
/* @__PURE__ */ i.jsx(F.Target, { children: /* @__PURE__ */ i.jsx(
|
|
2272
|
+
hn,
|
|
1005
2273
|
{
|
|
1006
2274
|
component: "button",
|
|
1007
2275
|
type: "button",
|
|
1008
2276
|
pointer: !0,
|
|
1009
|
-
rightSection: /* @__PURE__ */
|
|
1010
|
-
onClick: () =>
|
|
2277
|
+
rightSection: /* @__PURE__ */ i.jsx(F.Chevron, {}),
|
|
2278
|
+
onClick: () => x.toggleDropdown(),
|
|
1011
2279
|
rightSectionPointerEvents: "none",
|
|
1012
2280
|
w: 110,
|
|
1013
|
-
children: /* @__PURE__ */
|
|
2281
|
+
children: /* @__PURE__ */ i.jsx(xt, { value: u })
|
|
1014
2282
|
}
|
|
1015
2283
|
) }),
|
|
1016
|
-
/* @__PURE__ */
|
|
1017
|
-
/* @__PURE__ */
|
|
1018
|
-
|
|
2284
|
+
/* @__PURE__ */ i.jsxs(F.Dropdown, { children: [
|
|
2285
|
+
/* @__PURE__ */ i.jsx(
|
|
2286
|
+
F.Search,
|
|
1019
2287
|
{
|
|
1020
|
-
leftSection: /* @__PURE__ */
|
|
2288
|
+
leftSection: /* @__PURE__ */ i.jsx(Tt, { size: 14, stroke: 1.5 }),
|
|
1021
2289
|
placeholder: ".....",
|
|
1022
2290
|
value: r,
|
|
1023
|
-
onChange: (
|
|
2291
|
+
onChange: (v) => o(v.currentTarget.value)
|
|
1024
2292
|
}
|
|
1025
2293
|
),
|
|
1026
|
-
/* @__PURE__ */
|
|
2294
|
+
/* @__PURE__ */ i.jsx(F.Options, { children: y.length > 0 ? y : /* @__PURE__ */ i.jsx(F.Empty, { children: /* @__PURE__ */ i.jsx(R, { size: "sm", children: "Nothing found" }) }) })
|
|
1027
2295
|
] })
|
|
1028
2296
|
]
|
|
1029
2297
|
}
|
|
1030
2298
|
),
|
|
1031
|
-
|
|
1032
|
-
|
|
2299
|
+
u === "" ? /* @__PURE__ */ i.jsx(
|
|
2300
|
+
U,
|
|
1033
2301
|
{
|
|
1034
|
-
id:
|
|
1035
|
-
value:
|
|
2302
|
+
id: a,
|
|
2303
|
+
value: f,
|
|
1036
2304
|
type: "phone_number",
|
|
1037
|
-
onChange: (
|
|
1038
|
-
|
|
2305
|
+
onChange: (v) => {
|
|
2306
|
+
n({ target: { value: v.target.value } });
|
|
1039
2307
|
},
|
|
1040
|
-
error:
|
|
2308
|
+
error: t,
|
|
1041
2309
|
flex: 1
|
|
1042
2310
|
}
|
|
1043
|
-
) : /* @__PURE__ */
|
|
1044
|
-
|
|
2311
|
+
) : /* @__PURE__ */ i.jsx(
|
|
2312
|
+
U,
|
|
1045
2313
|
{
|
|
1046
|
-
id:
|
|
1047
|
-
value:
|
|
2314
|
+
id: a,
|
|
2315
|
+
value: f,
|
|
1048
2316
|
type: "phone_number",
|
|
1049
|
-
onAccept: (
|
|
1050
|
-
const
|
|
1051
|
-
|
|
1052
|
-
target: { value: C
|
|
2317
|
+
onAccept: (v) => {
|
|
2318
|
+
const C = v.replace(/[^\d]/g, "");
|
|
2319
|
+
n({
|
|
2320
|
+
target: { value: j(C, u) }
|
|
1053
2321
|
});
|
|
1054
2322
|
},
|
|
1055
|
-
component:
|
|
2323
|
+
component: Pn,
|
|
1056
2324
|
mask: "000-000-0000",
|
|
1057
|
-
error:
|
|
2325
|
+
error: t,
|
|
1058
2326
|
flex: 1
|
|
1059
2327
|
}
|
|
1060
2328
|
)
|
|
1061
2329
|
] }) }) }),
|
|
1062
|
-
(
|
|
2330
|
+
(l || d || t && typeof t == "string") && /* @__PURE__ */ i.jsx(_, { gutter: "xs", children: /* @__PURE__ */ i.jsx(_.Col, { children: /* @__PURE__ */ i.jsx(U.Error, { children: l ? /* @__PURE__ */ i.jsx(O, { value: ua }) : d ? /* @__PURE__ */ i.jsx(O, { value: ca }) : t }) }) })
|
|
1063
2331
|
] });
|
|
1064
|
-
},
|
|
2332
|
+
}, ze = ({
|
|
1065
2333
|
property: e,
|
|
1066
|
-
error:
|
|
1067
|
-
value:
|
|
1068
|
-
onChange:
|
|
2334
|
+
error: n,
|
|
2335
|
+
value: t,
|
|
2336
|
+
onChange: a
|
|
1069
2337
|
}) => {
|
|
1070
|
-
const [r,
|
|
1071
|
-
return /* @__PURE__ */
|
|
1072
|
-
|
|
2338
|
+
const [r, o] = E(() => e.constraints.includes("password") ? ["password", mn] : e.constraints.includes("phone_number") ? ["phone_number", fa] : [e.constraints.includes("email") ? "email" : e.constraints.includes("url") ? "url" : "text", U], [e.constraints]);
|
|
2339
|
+
return /* @__PURE__ */ i.jsx(
|
|
2340
|
+
o,
|
|
1073
2341
|
{
|
|
1074
2342
|
id: e.name,
|
|
1075
|
-
value:
|
|
2343
|
+
value: t,
|
|
1076
2344
|
type: r,
|
|
1077
|
-
onChange: (
|
|
1078
|
-
error:
|
|
2345
|
+
onChange: (l) => a(l.target.value),
|
|
2346
|
+
error: n
|
|
1079
2347
|
}
|
|
1080
2348
|
);
|
|
1081
|
-
},
|
|
1082
|
-
integer:
|
|
1083
|
-
float:
|
|
1084
|
-
string:
|
|
1085
|
-
boolean:
|
|
1086
|
-
"string[]":
|
|
1087
|
-
enum:
|
|
2349
|
+
}, vt = {
|
|
2350
|
+
integer: pt,
|
|
2351
|
+
float: pt,
|
|
2352
|
+
string: ze,
|
|
2353
|
+
boolean: sa,
|
|
2354
|
+
"string[]": ze,
|
|
2355
|
+
enum: ze
|
|
1088
2356
|
};
|
|
1089
|
-
function
|
|
1090
|
-
const [
|
|
1091
|
-
return
|
|
1092
|
-
e.getByName(
|
|
1093
|
-
}, [
|
|
2357
|
+
function ha(e, n) {
|
|
2358
|
+
const [t, a] = $(""), [r, o] = $([]);
|
|
2359
|
+
return Te(() => {
|
|
2360
|
+
e.getByName(n.targetClass).fetch({ limit: 100, offset: 0 }).then((s) => o(s.records));
|
|
2361
|
+
}, [n.name]), {
|
|
1094
2362
|
data: r,
|
|
1095
|
-
query:
|
|
1096
|
-
setQuery: (
|
|
1097
|
-
|
|
1098
|
-
const
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
(
|
|
2363
|
+
query: t,
|
|
2364
|
+
setQuery: (s) => {
|
|
2365
|
+
a(s);
|
|
2366
|
+
const u = e.getByName(n.targetClass);
|
|
2367
|
+
o(
|
|
2368
|
+
u.filter(
|
|
2369
|
+
(c) => c.name.toLowerCase().includes(s.toLowerCase())
|
|
1102
2370
|
)
|
|
1103
2371
|
);
|
|
1104
2372
|
},
|
|
1105
|
-
table: e.getByName(
|
|
2373
|
+
table: e.getByName(n.targetClass)
|
|
1106
2374
|
};
|
|
1107
2375
|
}
|
|
1108
|
-
const
|
|
1109
|
-
(e) => /* @__PURE__ */
|
|
1110
|
-
),
|
|
2376
|
+
const ma = (e) => e.name, ga = (e) => /* @__PURE__ */ i.jsx(R, { size: "sm", children: e.name }), pa = Z(
|
|
2377
|
+
(e) => /* @__PURE__ */ i.jsx("h1", { children: "SingleForeignKey" })
|
|
2378
|
+
), xa = Z(
|
|
1111
2379
|
({
|
|
1112
2380
|
db: e,
|
|
1113
|
-
property:
|
|
1114
|
-
value:
|
|
1115
|
-
onChange:
|
|
2381
|
+
property: n,
|
|
2382
|
+
value: t,
|
|
2383
|
+
onChange: a
|
|
1116
2384
|
}) => {
|
|
1117
|
-
const { table: r, data:
|
|
2385
|
+
const { table: r, data: o, query: l, setQuery: s } = ha(
|
|
1118
2386
|
e,
|
|
1119
|
-
|
|
2387
|
+
n
|
|
1120
2388
|
);
|
|
1121
|
-
return /* @__PURE__ */
|
|
1122
|
-
/* @__PURE__ */
|
|
1123
|
-
|
|
2389
|
+
return /* @__PURE__ */ i.jsxs(pe, { gap: "sm", children: [
|
|
2390
|
+
/* @__PURE__ */ i.jsx(
|
|
2391
|
+
va,
|
|
1124
2392
|
{
|
|
1125
|
-
name:
|
|
1126
|
-
query:
|
|
1127
|
-
setQuery:
|
|
1128
|
-
data:
|
|
1129
|
-
onSelect: (
|
|
1130
|
-
|
|
2393
|
+
name: n.name,
|
|
2394
|
+
query: l,
|
|
2395
|
+
setQuery: s,
|
|
2396
|
+
data: o,
|
|
2397
|
+
onSelect: (u) => {
|
|
2398
|
+
t.includes(u) || a([...t, u]);
|
|
1131
2399
|
},
|
|
1132
|
-
renderOption:
|
|
1133
|
-
isIdInteger:
|
|
2400
|
+
renderOption: ma,
|
|
2401
|
+
isIdInteger: n.datatype === "integer"
|
|
1134
2402
|
}
|
|
1135
2403
|
),
|
|
1136
|
-
/* @__PURE__ */
|
|
1137
|
-
|
|
2404
|
+
/* @__PURE__ */ i.jsx(
|
|
2405
|
+
ya,
|
|
1138
2406
|
{
|
|
1139
|
-
items:
|
|
1140
|
-
onDelete: (
|
|
1141
|
-
|
|
2407
|
+
items: t.map((u) => r.get(u)),
|
|
2408
|
+
onDelete: (u) => {
|
|
2409
|
+
a(t.filter((c) => c !== u.id));
|
|
1142
2410
|
},
|
|
1143
|
-
render:
|
|
2411
|
+
render: ga
|
|
1144
2412
|
}
|
|
1145
2413
|
)
|
|
1146
2414
|
] });
|
|
1147
2415
|
}
|
|
1148
|
-
),
|
|
2416
|
+
), va = ({
|
|
1149
2417
|
name: e,
|
|
1150
|
-
data:
|
|
1151
|
-
onSelect:
|
|
1152
|
-
renderOption:
|
|
2418
|
+
data: n,
|
|
2419
|
+
onSelect: t,
|
|
2420
|
+
renderOption: a,
|
|
1153
2421
|
isIdInteger: r,
|
|
1154
|
-
query:
|
|
1155
|
-
setQuery:
|
|
2422
|
+
query: o,
|
|
2423
|
+
setQuery: l
|
|
1156
2424
|
}) => {
|
|
1157
|
-
const
|
|
1158
|
-
onDropdownClose: () =>
|
|
1159
|
-
}),
|
|
2425
|
+
const s = Rt({
|
|
2426
|
+
onDropdownClose: () => s.resetSelectedOption()
|
|
2427
|
+
}), u = E(() => n.map((c) => (
|
|
1160
2428
|
// value has to be a string
|
|
1161
|
-
/* @__PURE__ */
|
|
1162
|
-
)), [
|
|
1163
|
-
return /* @__PURE__ */
|
|
1164
|
-
|
|
2429
|
+
/* @__PURE__ */ i.jsx(F.Option, { value: c.id.toString(), children: a(c) }, c.id)
|
|
2430
|
+
)), [n]);
|
|
2431
|
+
return /* @__PURE__ */ i.jsxs(
|
|
2432
|
+
F,
|
|
1165
2433
|
{
|
|
1166
|
-
store:
|
|
1167
|
-
onOptionSubmit: (
|
|
1168
|
-
|
|
2434
|
+
store: s,
|
|
2435
|
+
onOptionSubmit: (c) => {
|
|
2436
|
+
t(r ? parseInt(c) : c), l(""), s.closeDropdown();
|
|
1169
2437
|
},
|
|
1170
2438
|
offset: 0,
|
|
1171
2439
|
shadow: "sm",
|
|
1172
2440
|
children: [
|
|
1173
|
-
/* @__PURE__ */
|
|
1174
|
-
|
|
2441
|
+
/* @__PURE__ */ i.jsx(F.Target, { children: /* @__PURE__ */ i.jsx(
|
|
2442
|
+
U,
|
|
1175
2443
|
{
|
|
1176
2444
|
id: e,
|
|
1177
2445
|
pointer: !0,
|
|
1178
|
-
rightSection: /* @__PURE__ */
|
|
2446
|
+
rightSection: /* @__PURE__ */ i.jsx(Tt, { size: 16, stroke: 1.5 }),
|
|
1179
2447
|
rightSectionPointerEvents: "none",
|
|
1180
|
-
onClick: () =>
|
|
2448
|
+
onClick: () => s.toggleDropdown(),
|
|
1181
2449
|
placeholder: "Type to search...",
|
|
1182
|
-
value:
|
|
1183
|
-
onChange: (
|
|
1184
|
-
|
|
2450
|
+
value: o,
|
|
2451
|
+
onChange: (c) => {
|
|
2452
|
+
l(c.currentTarget.value);
|
|
1185
2453
|
}
|
|
1186
2454
|
}
|
|
1187
2455
|
) }),
|
|
1188
|
-
/* @__PURE__ */
|
|
2456
|
+
/* @__PURE__ */ i.jsx(F.Dropdown, { children: /* @__PURE__ */ i.jsx(F.Options, { children: u.length === 0 ? /* @__PURE__ */ i.jsx(F.Empty, { children: "Nothing found" }) : u }) })
|
|
1189
2457
|
]
|
|
1190
2458
|
}
|
|
1191
2459
|
);
|
|
1192
|
-
},
|
|
2460
|
+
}, ya = ({
|
|
1193
2461
|
items: e,
|
|
1194
|
-
onDelete:
|
|
1195
|
-
render:
|
|
2462
|
+
onDelete: n,
|
|
2463
|
+
render: t
|
|
1196
2464
|
}) => {
|
|
1197
|
-
const
|
|
2465
|
+
const a = E(() => {
|
|
1198
2466
|
const r = [];
|
|
1199
|
-
for (let
|
|
1200
|
-
const
|
|
2467
|
+
for (let o = 0; o < e.length; o++) {
|
|
2468
|
+
const l = e[o];
|
|
1201
2469
|
r.push(
|
|
1202
|
-
/* @__PURE__ */
|
|
1203
|
-
|
|
1204
|
-
/* @__PURE__ */
|
|
1205
|
-
] },
|
|
1206
|
-
),
|
|
2470
|
+
/* @__PURE__ */ i.jsxs(D, { justify: "space-between", p: "sm", children: [
|
|
2471
|
+
t(l),
|
|
2472
|
+
/* @__PURE__ */ i.jsx(gn, { size: "sm", onClick: () => n(l) })
|
|
2473
|
+
] }, o)
|
|
2474
|
+
), o < e.length - 1 && r.push(/* @__PURE__ */ i.jsx(pn, {}, `divider-${o}`));
|
|
1207
2475
|
}
|
|
1208
2476
|
return r;
|
|
1209
2477
|
}, [e]);
|
|
1210
|
-
if (
|
|
1211
|
-
return /* @__PURE__ */
|
|
1212
|
-
},
|
|
1213
|
-
requiredLabelLeft:
|
|
1214
|
-
requiredLabelRight:
|
|
1215
|
-
},
|
|
2478
|
+
if (a.length !== 0)
|
|
2479
|
+
return /* @__PURE__ */ i.jsx(te, { bd: "1px solid #ddd", children: a });
|
|
2480
|
+
}, ba = "_requiredLabelLeft_l5p83_1", wa = "_requiredLabelRight_l5p83_11", yt = {
|
|
2481
|
+
requiredLabelLeft: ba,
|
|
2482
|
+
requiredLabelRight: wa
|
|
2483
|
+
}, ja = ({
|
|
1216
2484
|
label: e,
|
|
1217
|
-
name:
|
|
1218
|
-
required:
|
|
1219
|
-
tooltip:
|
|
2485
|
+
name: n,
|
|
2486
|
+
required: t = !1,
|
|
2487
|
+
tooltip: a,
|
|
1220
2488
|
style: r,
|
|
1221
|
-
align:
|
|
2489
|
+
align: o = "left"
|
|
1222
2490
|
}) => {
|
|
1223
|
-
const
|
|
1224
|
-
return /* @__PURE__ */
|
|
1225
|
-
/* @__PURE__ */
|
|
1226
|
-
|
|
1227
|
-
|
|
2491
|
+
const l = t ? o === "left" ? yt.requiredLabelRight : yt.requiredLabelLeft : "";
|
|
2492
|
+
return /* @__PURE__ */ i.jsx(z, { align: "center", h: 36, children: /* @__PURE__ */ i.jsx("label", { htmlFor: n, style: r, children: /* @__PURE__ */ i.jsxs(D, { gap: 4, children: [
|
|
2493
|
+
/* @__PURE__ */ i.jsx(R, { size: "sm", className: l, children: e }),
|
|
2494
|
+
a !== void 0 && /* @__PURE__ */ i.jsx(Et, { label: a, withArrow: !0, children: /* @__PURE__ */ i.jsx(
|
|
2495
|
+
Nt,
|
|
1228
2496
|
{
|
|
1229
2497
|
size: 16,
|
|
1230
2498
|
stroke: 1.5,
|
|
@@ -1232,80 +2500,80 @@ const an = (e) => e.name, ln = (e) => /* @__PURE__ */ t.jsx(p, { size: "sm", chi
|
|
|
1232
2500
|
}
|
|
1233
2501
|
) })
|
|
1234
2502
|
] }) }) });
|
|
1235
|
-
},
|
|
2503
|
+
}, Sa = {
|
|
1236
2504
|
type: "vertical",
|
|
1237
2505
|
helpAlwaysVisible: !1
|
|
1238
|
-
},
|
|
2506
|
+
}, Ca = Z(
|
|
1239
2507
|
({
|
|
1240
2508
|
store: e,
|
|
1241
|
-
record:
|
|
1242
|
-
property:
|
|
1243
|
-
layout:
|
|
2509
|
+
record: n,
|
|
2510
|
+
property: t,
|
|
2511
|
+
layout: a = Sa,
|
|
1244
2512
|
InputComponent: r,
|
|
1245
|
-
validator:
|
|
2513
|
+
validator: o
|
|
1246
2514
|
}) => {
|
|
1247
|
-
const [
|
|
1248
|
-
var
|
|
1249
|
-
if (
|
|
1250
|
-
|
|
2515
|
+
const [l, s] = $(void 0), u = n[t.tsName], c = (g) => {
|
|
2516
|
+
var f;
|
|
2517
|
+
if (Pt(n))
|
|
2518
|
+
n[t.updateFuncName](g);
|
|
1251
2519
|
else {
|
|
1252
|
-
const
|
|
1253
|
-
|
|
2520
|
+
const x = n.toDraft();
|
|
2521
|
+
x[t.updateFuncName](g), e.setDraft(x);
|
|
1254
2522
|
}
|
|
1255
|
-
const
|
|
1256
|
-
|
|
1257
|
-
(
|
|
2523
|
+
const p = o(g);
|
|
2524
|
+
p.isValid ? s(void 0) : s(
|
|
2525
|
+
(f = p.errorMessage) == null ? void 0 : f.t({ args: { name: t.label } })
|
|
1258
2526
|
);
|
|
1259
2527
|
};
|
|
1260
|
-
if (
|
|
1261
|
-
return /* @__PURE__ */
|
|
1262
|
-
/* @__PURE__ */
|
|
1263
|
-
/* @__PURE__ */
|
|
1264
|
-
|
|
2528
|
+
if (Ra(a))
|
|
2529
|
+
return /* @__PURE__ */ i.jsxs(pe, { gap: 5, children: [
|
|
2530
|
+
/* @__PURE__ */ i.jsxs(_, { gutter: "sm", children: [
|
|
2531
|
+
/* @__PURE__ */ i.jsx(
|
|
2532
|
+
_.Col,
|
|
1265
2533
|
{
|
|
1266
|
-
span:
|
|
2534
|
+
span: a.labelCol,
|
|
1267
2535
|
style: {
|
|
1268
2536
|
display: "flex",
|
|
1269
|
-
justifyContent:
|
|
2537
|
+
justifyContent: a.align || "left"
|
|
1270
2538
|
},
|
|
1271
|
-
children: /* @__PURE__ */
|
|
1272
|
-
|
|
2539
|
+
children: /* @__PURE__ */ i.jsx(
|
|
2540
|
+
ja,
|
|
1273
2541
|
{
|
|
1274
|
-
label: /* @__PURE__ */
|
|
1275
|
-
name:
|
|
1276
|
-
required:
|
|
1277
|
-
tooltip:
|
|
1278
|
-
align:
|
|
2542
|
+
label: /* @__PURE__ */ i.jsx(O, { value: t.label }),
|
|
2543
|
+
name: t.name,
|
|
2544
|
+
required: t.isRequired,
|
|
2545
|
+
tooltip: t.description !== void 0 ? /* @__PURE__ */ i.jsx(O, { value: t.description }) : void 0,
|
|
2546
|
+
align: a.align
|
|
1279
2547
|
}
|
|
1280
2548
|
)
|
|
1281
2549
|
}
|
|
1282
2550
|
),
|
|
1283
|
-
/* @__PURE__ */
|
|
2551
|
+
/* @__PURE__ */ i.jsx(_.Col, { span: a.itemCol, children: /* @__PURE__ */ i.jsx(
|
|
1284
2552
|
r,
|
|
1285
2553
|
{
|
|
1286
2554
|
db: e.db,
|
|
1287
|
-
property:
|
|
1288
|
-
value:
|
|
1289
|
-
error:
|
|
1290
|
-
onChange:
|
|
2555
|
+
property: t,
|
|
2556
|
+
value: u,
|
|
2557
|
+
error: l !== void 0,
|
|
2558
|
+
onChange: c
|
|
1291
2559
|
}
|
|
1292
2560
|
) })
|
|
1293
2561
|
] }),
|
|
1294
|
-
|
|
1295
|
-
/* @__PURE__ */
|
|
1296
|
-
/* @__PURE__ */
|
|
2562
|
+
l !== void 0 && /* @__PURE__ */ i.jsxs(_, { gutter: "sm", children: [
|
|
2563
|
+
/* @__PURE__ */ i.jsx(_.Col, { span: a.labelCol }),
|
|
2564
|
+
/* @__PURE__ */ i.jsx(_.Col, { span: a.itemCol, children: /* @__PURE__ */ i.jsx(U.Error, { children: l }) })
|
|
1297
2565
|
] })
|
|
1298
2566
|
] });
|
|
1299
|
-
let
|
|
1300
|
-
return !
|
|
1301
|
-
|
|
1302
|
-
/* @__PURE__ */
|
|
1303
|
-
|
|
2567
|
+
let d = /* @__PURE__ */ i.jsx(O, { value: t.label });
|
|
2568
|
+
return !a.helpAlwaysVisible && t.description !== void 0 && (d = /* @__PURE__ */ i.jsxs(D, { gap: 4, style: { display: "inline-flex" }, children: [
|
|
2569
|
+
d,
|
|
2570
|
+
/* @__PURE__ */ i.jsx(
|
|
2571
|
+
Et,
|
|
1304
2572
|
{
|
|
1305
|
-
label: /* @__PURE__ */
|
|
2573
|
+
label: /* @__PURE__ */ i.jsx(O, { value: t.description }),
|
|
1306
2574
|
withArrow: !0,
|
|
1307
|
-
children: /* @__PURE__ */
|
|
1308
|
-
|
|
2575
|
+
children: /* @__PURE__ */ i.jsx(
|
|
2576
|
+
Nt,
|
|
1309
2577
|
{
|
|
1310
2578
|
size: 16,
|
|
1311
2579
|
stroke: 1.5,
|
|
@@ -1314,61 +2582,61 @@ const an = (e) => e.name, ln = (e) => /* @__PURE__ */ t.jsx(p, { size: "sm", chi
|
|
|
1314
2582
|
)
|
|
1315
2583
|
}
|
|
1316
2584
|
)
|
|
1317
|
-
] })), /* @__PURE__ */
|
|
1318
|
-
|
|
2585
|
+
] })), /* @__PURE__ */ i.jsx(
|
|
2586
|
+
U.Wrapper,
|
|
1319
2587
|
{
|
|
1320
|
-
label:
|
|
1321
|
-
description:
|
|
1322
|
-
required:
|
|
1323
|
-
children: /* @__PURE__ */
|
|
2588
|
+
label: d,
|
|
2589
|
+
description: a.helpAlwaysVisible && t.description !== void 0 ? /* @__PURE__ */ i.jsx(O, { value: t.description }) : void 0,
|
|
2590
|
+
required: t.isRequired,
|
|
2591
|
+
children: /* @__PURE__ */ i.jsx(
|
|
1324
2592
|
r,
|
|
1325
2593
|
{
|
|
1326
2594
|
db: e.db,
|
|
1327
|
-
property:
|
|
1328
|
-
value:
|
|
1329
|
-
error:
|
|
1330
|
-
onChange:
|
|
2595
|
+
property: t,
|
|
2596
|
+
value: u,
|
|
2597
|
+
error: l,
|
|
2598
|
+
onChange: c
|
|
1331
2599
|
}
|
|
1332
2600
|
)
|
|
1333
2601
|
}
|
|
1334
2602
|
);
|
|
1335
2603
|
}
|
|
1336
2604
|
);
|
|
1337
|
-
function
|
|
2605
|
+
function Ra(e) {
|
|
1338
2606
|
return e.type === "horizontal";
|
|
1339
2607
|
}
|
|
1340
|
-
const
|
|
1341
|
-
const
|
|
1342
|
-
const
|
|
1343
|
-
...e.fieldGroups.map((r) => Math.max(...r.fields.map((
|
|
2608
|
+
const bt = 12, co = (e) => {
|
|
2609
|
+
const n = e.schema, t = E(() => {
|
|
2610
|
+
const a = Math.max(
|
|
2611
|
+
...e.fieldGroups.map((r) => Math.max(...r.fields.map((o) => o.length)))
|
|
1344
2612
|
);
|
|
1345
|
-
return e.fieldGroups.map((r,
|
|
1346
|
-
|
|
2613
|
+
return e.fieldGroups.map((r, o) => Ea(
|
|
2614
|
+
n,
|
|
1347
2615
|
e.store,
|
|
1348
2616
|
e.record,
|
|
1349
|
-
i,
|
|
1350
|
-
r,
|
|
1351
2617
|
o,
|
|
2618
|
+
r,
|
|
2619
|
+
a,
|
|
1352
2620
|
e.layout
|
|
1353
2621
|
));
|
|
1354
|
-
}, [
|
|
1355
|
-
return /* @__PURE__ */
|
|
2622
|
+
}, [n, e.store, e.record, e.fieldGroups, e.layout]);
|
|
2623
|
+
return /* @__PURE__ */ i.jsx(
|
|
1356
2624
|
"form",
|
|
1357
2625
|
{
|
|
1358
|
-
onSubmit: e.onSubmit === void 0 ? void 0 : (
|
|
1359
|
-
|
|
2626
|
+
onSubmit: e.onSubmit === void 0 ? void 0 : (a) => {
|
|
2627
|
+
a.preventDefault(), e.onSubmit !== void 0 && Pt(e.record) && e.onSubmit(e.record);
|
|
1360
2628
|
},
|
|
1361
|
-
children: /* @__PURE__ */
|
|
1362
|
-
|
|
1363
|
-
/* @__PURE__ */
|
|
1364
|
-
|
|
2629
|
+
children: /* @__PURE__ */ i.jsxs(pe, { gap: "sm", className: e.className, style: e.styles, children: [
|
|
2630
|
+
t,
|
|
2631
|
+
/* @__PURE__ */ i.jsx(D, { gap: "sm", children: e.actions.map((a, r) => /* @__PURE__ */ i.jsx(
|
|
2632
|
+
B,
|
|
1365
2633
|
{
|
|
1366
|
-
variant:
|
|
2634
|
+
variant: a.variant,
|
|
1367
2635
|
onClick: () => {
|
|
1368
|
-
|
|
2636
|
+
a.onClick !== void 0 && a.onClick();
|
|
1369
2637
|
},
|
|
1370
|
-
disabled:
|
|
1371
|
-
children:
|
|
2638
|
+
disabled: a.disabled,
|
|
2639
|
+
children: a.label
|
|
1372
2640
|
},
|
|
1373
2641
|
r
|
|
1374
2642
|
)) })
|
|
@@ -1376,203 +2644,203 @@ const Me = 12, rr = (e) => {
|
|
|
1376
2644
|
}
|
|
1377
2645
|
);
|
|
1378
2646
|
};
|
|
1379
|
-
function
|
|
1380
|
-
const
|
|
1381
|
-
for (let
|
|
1382
|
-
const
|
|
1383
|
-
if (!Number.isInteger(
|
|
1384
|
-
throw new Error(`Span must be an integer, but got ${
|
|
1385
|
-
let
|
|
1386
|
-
|
|
1387
|
-
...
|
|
2647
|
+
function Ea(e, n, t, a, r, o, l) {
|
|
2648
|
+
const s = r.fields, u = [];
|
|
2649
|
+
for (let d = 0; d < s.length; d++) {
|
|
2650
|
+
const g = bt / s[d].length;
|
|
2651
|
+
if (!Number.isInteger(g))
|
|
2652
|
+
throw new Error(`Span must be an integer, but got ${g} for row ${d}`);
|
|
2653
|
+
let p;
|
|
2654
|
+
l !== void 0 && typeof l == "object" && l.type === "horizontal" ? p = {
|
|
2655
|
+
...l,
|
|
1388
2656
|
// the size of labelCol must match the minimum size of labelCol across different groups
|
|
1389
2657
|
// and rows -- if the result isn't a whole number, we may see unaligned labels
|
|
1390
2658
|
// but this is okay as users will need to adjust the layout anyway.
|
|
1391
2659
|
labelCol: Math.floor(
|
|
1392
|
-
|
|
2660
|
+
l.labelCol * s[d].length / o
|
|
1393
2661
|
),
|
|
1394
|
-
itemCol:
|
|
1395
|
-
} :
|
|
1396
|
-
for (let
|
|
1397
|
-
const
|
|
1398
|
-
let
|
|
1399
|
-
if (
|
|
1400
|
-
|
|
2662
|
+
itemCol: bt - Math.floor(l.labelCol * s[d].length / o)
|
|
2663
|
+
} : p = l;
|
|
2664
|
+
for (let f = 0; f < s[d].length; f++) {
|
|
2665
|
+
const x = s[d][f], b = e.allProperties[x];
|
|
2666
|
+
let j;
|
|
2667
|
+
if (ue(b))
|
|
2668
|
+
j = b.cardinality === "N:N" || b.cardinality === "1:N" ? xa : pa;
|
|
1401
2669
|
else {
|
|
1402
|
-
if (
|
|
2670
|
+
if (vt[b.datatype] === void 0)
|
|
1403
2671
|
throw new Error(
|
|
1404
|
-
`No input component found for datatype ${
|
|
2672
|
+
`No input component found for datatype ${b.datatype}`
|
|
1405
2673
|
);
|
|
1406
|
-
|
|
2674
|
+
j = vt[b.datatype];
|
|
1407
2675
|
}
|
|
1408
|
-
|
|
1409
|
-
/* @__PURE__ */
|
|
1410
|
-
|
|
2676
|
+
u.push(
|
|
2677
|
+
/* @__PURE__ */ i.jsx(_.Col, { span: g, children: /* @__PURE__ */ i.jsx(
|
|
2678
|
+
Ca,
|
|
1411
2679
|
{
|
|
1412
|
-
store:
|
|
1413
|
-
record:
|
|
1414
|
-
property:
|
|
1415
|
-
layout:
|
|
1416
|
-
InputComponent:
|
|
1417
|
-
validator: e.validators[
|
|
2680
|
+
store: n,
|
|
2681
|
+
record: t,
|
|
2682
|
+
property: b,
|
|
2683
|
+
layout: p,
|
|
2684
|
+
InputComponent: j,
|
|
2685
|
+
validator: e.validators[x]
|
|
1418
2686
|
}
|
|
1419
|
-
) }, `${
|
|
2687
|
+
) }, `${d}-${f}`)
|
|
1420
2688
|
);
|
|
1421
2689
|
}
|
|
1422
2690
|
}
|
|
1423
|
-
const
|
|
1424
|
-
return r.name !== void 0 ? /* @__PURE__ */
|
|
2691
|
+
const c = /* @__PURE__ */ i.jsx(_, { gutter: "sm", children: u }, a);
|
|
2692
|
+
return r.name !== void 0 ? /* @__PURE__ */ i.jsx(xn, { legend: r.name, children: c }, a) : c;
|
|
1425
2693
|
}
|
|
1426
|
-
const
|
|
2694
|
+
const Qt = ({
|
|
1427
2695
|
actions: e,
|
|
1428
|
-
reloadData:
|
|
1429
|
-
selectedRowKeys:
|
|
1430
|
-
size:
|
|
1431
|
-
}) => /* @__PURE__ */
|
|
1432
|
-
(e == null ? void 0 : e.add) && /* @__PURE__ */
|
|
1433
|
-
|
|
2696
|
+
reloadData: n,
|
|
2697
|
+
selectedRowKeys: t,
|
|
2698
|
+
size: a = "xs"
|
|
2699
|
+
}) => /* @__PURE__ */ i.jsxs(D, { gap: a, children: [
|
|
2700
|
+
(e == null ? void 0 : e.add) && /* @__PURE__ */ i.jsx(
|
|
2701
|
+
B,
|
|
1434
2702
|
{
|
|
1435
2703
|
variant: "light",
|
|
1436
|
-
leftSection: /* @__PURE__ */
|
|
1437
|
-
size:
|
|
2704
|
+
leftSection: /* @__PURE__ */ i.jsx(Cn, { size: 16, stroke: 1.5 }),
|
|
2705
|
+
size: a,
|
|
1438
2706
|
onClick: e.add,
|
|
1439
2707
|
children: "Add"
|
|
1440
2708
|
}
|
|
1441
2709
|
),
|
|
1442
|
-
(e == null ? void 0 : e.edit) && /* @__PURE__ */
|
|
1443
|
-
|
|
2710
|
+
(e == null ? void 0 : e.edit) && /* @__PURE__ */ i.jsx(
|
|
2711
|
+
B,
|
|
1444
2712
|
{
|
|
1445
|
-
leftSection: /* @__PURE__ */
|
|
1446
|
-
size:
|
|
2713
|
+
leftSection: /* @__PURE__ */ i.jsx(Rn, { size: 16, stroke: 1.5 }),
|
|
2714
|
+
size: a,
|
|
1447
2715
|
variant: "light",
|
|
1448
|
-
onClick: () => e.edit !== void 0 && e.edit(
|
|
1449
|
-
disabled:
|
|
2716
|
+
onClick: () => e.edit !== void 0 && e.edit(t[0]),
|
|
2717
|
+
disabled: t.length !== 1,
|
|
1450
2718
|
children: "Edit"
|
|
1451
2719
|
}
|
|
1452
2720
|
),
|
|
1453
|
-
(e == null ? void 0 : e.reload) && /* @__PURE__ */
|
|
1454
|
-
|
|
2721
|
+
(e == null ? void 0 : e.reload) && /* @__PURE__ */ i.jsx(
|
|
2722
|
+
B,
|
|
1455
2723
|
{
|
|
1456
|
-
leftSection: /* @__PURE__ */
|
|
1457
|
-
size:
|
|
1458
|
-
onClick:
|
|
2724
|
+
leftSection: /* @__PURE__ */ i.jsx(En, { size: 16, stroke: 1.5 }),
|
|
2725
|
+
size: a,
|
|
2726
|
+
onClick: n,
|
|
1459
2727
|
variant: "light",
|
|
1460
2728
|
children: "Reload"
|
|
1461
2729
|
}
|
|
1462
2730
|
),
|
|
1463
|
-
(e == null ? void 0 : e.import) && /* @__PURE__ */
|
|
1464
|
-
|
|
2731
|
+
(e == null ? void 0 : e.import) && /* @__PURE__ */ i.jsx(
|
|
2732
|
+
B,
|
|
1465
2733
|
{
|
|
1466
|
-
leftSection: /* @__PURE__ */
|
|
1467
|
-
size:
|
|
2734
|
+
leftSection: /* @__PURE__ */ i.jsx(kn, { size: 16, stroke: 1.5 }),
|
|
2735
|
+
size: a,
|
|
1468
2736
|
variant: "light",
|
|
1469
2737
|
onClick: e.import,
|
|
1470
2738
|
children: "Import"
|
|
1471
2739
|
}
|
|
1472
2740
|
),
|
|
1473
|
-
(e == null ? void 0 : e.export) && /* @__PURE__ */
|
|
1474
|
-
|
|
2741
|
+
(e == null ? void 0 : e.export) && /* @__PURE__ */ i.jsx(
|
|
2742
|
+
B,
|
|
1475
2743
|
{
|
|
1476
|
-
leftSection: /* @__PURE__ */
|
|
1477
|
-
size:
|
|
2744
|
+
leftSection: /* @__PURE__ */ i.jsx(Tn, { size: 16, stroke: 1.5 }),
|
|
2745
|
+
size: a,
|
|
1478
2746
|
variant: "light",
|
|
1479
2747
|
onClick: e.export,
|
|
1480
2748
|
children: "Export"
|
|
1481
2749
|
}
|
|
1482
2750
|
)
|
|
1483
|
-
] }),
|
|
1484
|
-
const
|
|
1485
|
-
|
|
2751
|
+
] }), en = (e) => e !== void 0 && (e.add !== void 0 || e.edit !== void 0 || e.delete !== void 0 || e.export !== void 0 || e.reload === !0 || e.import !== void 0), ka = "__selectcol__", { Thead: Ta, Tr: wt, Th: Na, Tbody: Pa, Td: Ia } = kt, tn = (e) => {
|
|
2752
|
+
const n = /* @__PURE__ */ i.jsxs(
|
|
2753
|
+
kt,
|
|
1486
2754
|
{
|
|
1487
2755
|
striped: !0,
|
|
1488
2756
|
highlightOnHover: !0,
|
|
1489
2757
|
verticalSpacing: "xs",
|
|
1490
2758
|
tabularNums: !0,
|
|
1491
2759
|
children: [
|
|
1492
|
-
/* @__PURE__ */
|
|
1493
|
-
|
|
2760
|
+
/* @__PURE__ */ i.jsx(Ta, { children: e.table.getHeaderGroups().map((a) => /* @__PURE__ */ i.jsx(wt, { children: a.headers.map((r) => /* @__PURE__ */ i.jsx(
|
|
2761
|
+
Na,
|
|
1494
2762
|
{
|
|
1495
|
-
w: r.id ===
|
|
1496
|
-
children: r.isPlaceholder ? null :
|
|
2763
|
+
w: r.id === ka ? "1%" : void 0,
|
|
2764
|
+
children: r.isPlaceholder ? null : st(
|
|
1497
2765
|
r.column.columnDef.header,
|
|
1498
2766
|
r.getContext()
|
|
1499
2767
|
)
|
|
1500
2768
|
},
|
|
1501
2769
|
r.id
|
|
1502
|
-
)) },
|
|
1503
|
-
/* @__PURE__ */
|
|
1504
|
-
|
|
2770
|
+
)) }, a.id)) }),
|
|
2771
|
+
/* @__PURE__ */ i.jsx(Pa, { pos: "relative", children: e.table.getRowModel().rows.map((a) => /* @__PURE__ */ i.jsx(
|
|
2772
|
+
wt,
|
|
1505
2773
|
{
|
|
1506
|
-
bg: e.selectedRowKeys[
|
|
1507
|
-
children:
|
|
2774
|
+
bg: e.selectedRowKeys[a.id] ? "var(--mantine-color-blue-light)" : void 0,
|
|
2775
|
+
children: a.getVisibleCells().map((r) => /* @__PURE__ */ i.jsx(Ia, { children: st(r.column.columnDef.cell, r.getContext()) }, r.id))
|
|
1508
2776
|
},
|
|
1509
|
-
|
|
2777
|
+
a.id
|
|
1510
2778
|
)) })
|
|
1511
2779
|
]
|
|
1512
2780
|
}
|
|
1513
2781
|
);
|
|
1514
|
-
if (!e.bordered) return
|
|
1515
|
-
const
|
|
1516
|
-
return e.hasTopSection && (
|
|
1517
|
-
},
|
|
1518
|
-
pageSizeSelectorActive:
|
|
1519
|
-
},
|
|
2782
|
+
if (!e.bordered) return n;
|
|
2783
|
+
const t = {};
|
|
2784
|
+
return e.hasTopSection && (t.borderTopLeftRadius = 0, t.borderTopRightRadius = 0), e.hasBottomSection && (t.borderBottomLeftRadius = 0, t.borderBottomRightRadius = 0), /* @__PURE__ */ i.jsx(te, { withBorder: !0, p: 0, style: t, children: n });
|
|
2785
|
+
}, La = "_pageSizeSelectorActive_1wv6j_1", Fa = {
|
|
2786
|
+
pageSizeSelectorActive: La
|
|
2787
|
+
}, nn = ({
|
|
1520
2788
|
total: e,
|
|
1521
|
-
pageIndex:
|
|
1522
|
-
pageSize:
|
|
1523
|
-
allowPageSizeChange:
|
|
2789
|
+
pageIndex: n,
|
|
2790
|
+
pageSize: t,
|
|
2791
|
+
allowPageSizeChange: a = !0,
|
|
1524
2792
|
onUpdatePagination: r
|
|
1525
2793
|
}) => {
|
|
1526
|
-
const
|
|
1527
|
-
|
|
2794
|
+
const o = /* @__PURE__ */ i.jsx(
|
|
2795
|
+
vn,
|
|
1528
2796
|
{
|
|
1529
2797
|
size: "sm",
|
|
1530
2798
|
total: e,
|
|
1531
|
-
value:
|
|
1532
|
-
onChange: (
|
|
2799
|
+
value: n + 1,
|
|
2800
|
+
onChange: (l) => r(l - 1, t)
|
|
1533
2801
|
}
|
|
1534
2802
|
);
|
|
1535
|
-
return
|
|
1536
|
-
/* @__PURE__ */
|
|
1537
|
-
/* @__PURE__ */
|
|
1538
|
-
/* @__PURE__ */
|
|
1539
|
-
|
|
2803
|
+
return a ? /* @__PURE__ */ i.jsxs(D, { gap: "sm", children: [
|
|
2804
|
+
/* @__PURE__ */ i.jsxs("div", { children: [
|
|
2805
|
+
/* @__PURE__ */ i.jsx(R, { size: "sm", component: "span", pr: "xs", c: "dimmed", children: "Records per page" }),
|
|
2806
|
+
/* @__PURE__ */ i.jsx(
|
|
2807
|
+
_a,
|
|
1540
2808
|
{
|
|
1541
2809
|
size: "sm",
|
|
1542
2810
|
values: ["10", "20", "50", "100"],
|
|
1543
|
-
value:
|
|
1544
|
-
onChange: (
|
|
1545
|
-
r(0, parseInt(
|
|
2811
|
+
value: t.toString(),
|
|
2812
|
+
onChange: (l) => {
|
|
2813
|
+
r(0, parseInt(l, 10));
|
|
1546
2814
|
}
|
|
1547
2815
|
}
|
|
1548
2816
|
)
|
|
1549
2817
|
] }),
|
|
1550
|
-
|
|
1551
|
-
] }) :
|
|
1552
|
-
},
|
|
1553
|
-
xs:
|
|
1554
|
-
sm:
|
|
1555
|
-
md:
|
|
1556
|
-
lg:
|
|
1557
|
-
xl:
|
|
2818
|
+
o
|
|
2819
|
+
] }) : o;
|
|
2820
|
+
}, jt = {
|
|
2821
|
+
xs: de(22),
|
|
2822
|
+
sm: de(26),
|
|
2823
|
+
md: de(32),
|
|
2824
|
+
lg: de(38),
|
|
2825
|
+
xl: de(44)
|
|
1558
2826
|
};
|
|
1559
|
-
function
|
|
2827
|
+
function _a({
|
|
1560
2828
|
size: e,
|
|
1561
|
-
values:
|
|
1562
|
-
value:
|
|
1563
|
-
onChange:
|
|
2829
|
+
values: n,
|
|
2830
|
+
value: t,
|
|
2831
|
+
onChange: a
|
|
1564
2832
|
}) {
|
|
1565
|
-
return /* @__PURE__ */
|
|
1566
|
-
/* @__PURE__ */
|
|
1567
|
-
|
|
2833
|
+
return /* @__PURE__ */ i.jsxs(ie, { withinPortal: !0, withArrow: !0, offset: 2, children: [
|
|
2834
|
+
/* @__PURE__ */ i.jsx(yn, { children: /* @__PURE__ */ i.jsx(
|
|
2835
|
+
B,
|
|
1568
2836
|
{
|
|
1569
2837
|
size: e,
|
|
1570
2838
|
variant: "default",
|
|
1571
|
-
rightSection: /* @__PURE__ */
|
|
2839
|
+
rightSection: /* @__PURE__ */ i.jsx(Nn, { size: 16, stroke: 1.5 }),
|
|
1572
2840
|
style: [
|
|
1573
2841
|
{ fontWeight: "normal" },
|
|
1574
2842
|
(r) => ({
|
|
1575
|
-
height:
|
|
2843
|
+
height: jt[e],
|
|
1576
2844
|
paddingLeft: r.spacing[e],
|
|
1577
2845
|
paddingRight: r.spacing[e]
|
|
1578
2846
|
})
|
|
@@ -1582,17 +2850,17 @@ function kn({
|
|
|
1582
2850
|
marginInlineStart: 2
|
|
1583
2851
|
}
|
|
1584
2852
|
},
|
|
1585
|
-
children:
|
|
2853
|
+
children: t
|
|
1586
2854
|
}
|
|
1587
2855
|
) }),
|
|
1588
|
-
/* @__PURE__ */
|
|
1589
|
-
const
|
|
1590
|
-
return /* @__PURE__ */
|
|
1591
|
-
|
|
2856
|
+
/* @__PURE__ */ i.jsx(bn, { children: n.map((r) => {
|
|
2857
|
+
const o = r === t;
|
|
2858
|
+
return /* @__PURE__ */ i.jsx(
|
|
2859
|
+
wn,
|
|
1592
2860
|
{
|
|
1593
|
-
className:
|
|
2861
|
+
className: o ? Fa.pageSizeSelectorActive : void 0,
|
|
1594
2862
|
style: [
|
|
1595
|
-
{ height:
|
|
2863
|
+
{ height: jt[e] }
|
|
1596
2864
|
// isCurrent
|
|
1597
2865
|
// ? {
|
|
1598
2866
|
// color: "var(--mantine-color-text)",
|
|
@@ -1601,118 +2869,118 @@ function kn({
|
|
|
1601
2869
|
// }
|
|
1602
2870
|
// : undefined,
|
|
1603
2871
|
],
|
|
1604
|
-
disabled:
|
|
1605
|
-
onClick: () =>
|
|
1606
|
-
children: /* @__PURE__ */
|
|
2872
|
+
disabled: o,
|
|
2873
|
+
onClick: () => a(r),
|
|
2874
|
+
children: /* @__PURE__ */ i.jsx(R, { component: "div", size: e, children: r })
|
|
1607
2875
|
},
|
|
1608
2876
|
r
|
|
1609
2877
|
);
|
|
1610
2878
|
}) })
|
|
1611
2879
|
] });
|
|
1612
2880
|
}
|
|
1613
|
-
const
|
|
1614
|
-
var
|
|
1615
|
-
const [
|
|
2881
|
+
const $a = /* @__PURE__ */ new Set(["topRight", "bottomRight"]), fo = (e) => {
|
|
2882
|
+
var w, y;
|
|
2883
|
+
const [n, t] = $({
|
|
1616
2884
|
records: [],
|
|
1617
2885
|
total: 0
|
|
1618
|
-
}), [
|
|
2886
|
+
}), [a, r] = $(!1), [o, l] = $(
|
|
1619
2887
|
{}
|
|
1620
|
-
),
|
|
1621
|
-
r(!0), e.getData(
|
|
1622
|
-
|
|
2888
|
+
), s = (v) => {
|
|
2889
|
+
r(!0), e.getData(v).then((C) => {
|
|
2890
|
+
t(C), r(!1);
|
|
1623
2891
|
});
|
|
1624
|
-
},
|
|
1625
|
-
const
|
|
2892
|
+
}, u = (v, C) => {
|
|
2893
|
+
const T = {
|
|
1626
2894
|
...e.query.query,
|
|
1627
|
-
limit:
|
|
1628
|
-
offset:
|
|
2895
|
+
limit: C,
|
|
2896
|
+
offset: v * C
|
|
1629
2897
|
};
|
|
1630
|
-
e.query.update(
|
|
1631
|
-
}, [
|
|
1632
|
-
const
|
|
2898
|
+
e.query.update(T);
|
|
2899
|
+
}, [c, d, g] = E(() => {
|
|
2900
|
+
const v = e.query.query.limit, C = Math.floor(
|
|
1633
2901
|
(e.query.query.offset || 0) / e.query.query.limit
|
|
1634
|
-
),
|
|
1635
|
-
return [
|
|
1636
|
-
}, [e.query.query.limit, e.query.query.offset,
|
|
1637
|
-
|
|
1638
|
-
const
|
|
1639
|
-
let
|
|
1640
|
-
|
|
1641
|
-
|
|
2902
|
+
), T = Math.ceil(n.total / e.query.query.limit);
|
|
2903
|
+
return [v, C, T];
|
|
2904
|
+
}, [e.query.query.limit, e.query.query.offset, n.total]);
|
|
2905
|
+
Te(() => (n.total == 0 && s(e.query.query), e.query.subscribe(s)), [e.query]);
|
|
2906
|
+
const p = E(() => Object.keys(o).filter((v) => o[v]).map((v) => e.normalizeRowId(v)), [o]);
|
|
2907
|
+
let f, x;
|
|
2908
|
+
en(e.actions) && (f = /* @__PURE__ */ i.jsx(
|
|
2909
|
+
Qt,
|
|
1642
2910
|
{
|
|
1643
2911
|
actions: e.actions,
|
|
1644
|
-
reloadData: () =>
|
|
1645
|
-
selectedRowKeys:
|
|
2912
|
+
reloadData: () => s(e.query.query),
|
|
2913
|
+
selectedRowKeys: p
|
|
1646
2914
|
}
|
|
1647
2915
|
));
|
|
1648
|
-
const
|
|
1649
|
-
if (
|
|
1650
|
-
const
|
|
1651
|
-
|
|
2916
|
+
const b = ((w = e.pagination) == null ? void 0 : w.positions) || $a;
|
|
2917
|
+
if (b.size > 0) {
|
|
2918
|
+
const v = /* @__PURE__ */ i.jsx(
|
|
2919
|
+
nn,
|
|
1652
2920
|
{
|
|
1653
|
-
total:
|
|
1654
|
-
pageIndex:
|
|
1655
|
-
pageSize:
|
|
1656
|
-
onUpdatePagination:
|
|
1657
|
-
allowPageSizeChange: (
|
|
2921
|
+
total: g,
|
|
2922
|
+
pageIndex: d,
|
|
2923
|
+
pageSize: c,
|
|
2924
|
+
onUpdatePagination: u,
|
|
2925
|
+
allowPageSizeChange: (y = e.pagination) == null ? void 0 : y.showSizeChanger
|
|
1658
2926
|
}
|
|
1659
2927
|
);
|
|
1660
|
-
|
|
1661
|
-
g,
|
|
1662
|
-
f
|
|
1663
|
-
] }) : g = /* @__PURE__ */ t.jsx(z, { justify: "flex-end", children: f })), (u.has("bottomRight") || u.has("bottomLeft") || u.has("bottomCenter")) && (u.has("bottomLeft") ? v = /* @__PURE__ */ t.jsxs(z, { justify: "space-between", align: "center", children: [
|
|
2928
|
+
b.has("topRight") && (f !== void 0 ? f = /* @__PURE__ */ i.jsxs(D, { justify: "space-between", gap: "sm", children: [
|
|
1664
2929
|
f,
|
|
1665
|
-
|
|
2930
|
+
v
|
|
2931
|
+
] }) : f = /* @__PURE__ */ i.jsx(z, { justify: "flex-end", children: v })), (b.has("bottomRight") || b.has("bottomLeft") || b.has("bottomCenter")) && (b.has("bottomLeft") ? x = /* @__PURE__ */ i.jsxs(z, { justify: "space-between", align: "center", children: [
|
|
2932
|
+
v,
|
|
2933
|
+
/* @__PURE__ */ i.jsxs(R, { size: "sm", c: "dimmed", children: [
|
|
1666
2934
|
"Showing ",
|
|
1667
|
-
|
|
2935
|
+
d * c + 1,
|
|
1668
2936
|
" to",
|
|
1669
2937
|
" ",
|
|
1670
|
-
Math.min((
|
|
2938
|
+
Math.min((d + 1) * c, n.total),
|
|
1671
2939
|
" of ",
|
|
1672
|
-
|
|
2940
|
+
n.total,
|
|
1673
2941
|
" ",
|
|
1674
2942
|
"records"
|
|
1675
2943
|
] })
|
|
1676
|
-
] }) :
|
|
1677
|
-
/* @__PURE__ */
|
|
2944
|
+
] }) : x = /* @__PURE__ */ i.jsxs(z, { justify: "space-between", align: "center", children: [
|
|
2945
|
+
/* @__PURE__ */ i.jsxs(R, { size: "sm", c: "dimmed", children: [
|
|
1678
2946
|
"Showing ",
|
|
1679
|
-
|
|
2947
|
+
d * c + 1,
|
|
1680
2948
|
" to",
|
|
1681
2949
|
" ",
|
|
1682
|
-
Math.min((
|
|
2950
|
+
Math.min((d + 1) * c, n.total),
|
|
1683
2951
|
" of ",
|
|
1684
|
-
|
|
2952
|
+
n.total,
|
|
1685
2953
|
" ",
|
|
1686
2954
|
"records"
|
|
1687
2955
|
] }),
|
|
1688
|
-
|
|
2956
|
+
v
|
|
1689
2957
|
] }));
|
|
1690
2958
|
}
|
|
1691
|
-
const
|
|
1692
|
-
|
|
2959
|
+
const j = E(() => /* @__PURE__ */ i.jsx(
|
|
2960
|
+
Aa,
|
|
1693
2961
|
{
|
|
1694
|
-
data:
|
|
1695
|
-
loading:
|
|
2962
|
+
data: n,
|
|
2963
|
+
loading: a,
|
|
1696
2964
|
columns: e.columns,
|
|
1697
2965
|
getRowId: e.getRowId,
|
|
1698
|
-
selectedRowKeys:
|
|
1699
|
-
setSelectedRowKeys:
|
|
1700
|
-
hasTopSection:
|
|
1701
|
-
hasBottomSection:
|
|
2966
|
+
selectedRowKeys: o,
|
|
2967
|
+
setSelectedRowKeys: l,
|
|
2968
|
+
hasTopSection: f !== void 0,
|
|
2969
|
+
hasBottomSection: x !== void 0
|
|
1702
2970
|
}
|
|
1703
2971
|
), [
|
|
1704
|
-
|
|
1705
|
-
|
|
2972
|
+
n,
|
|
2973
|
+
a,
|
|
1706
2974
|
e.columns,
|
|
1707
2975
|
e.getRowId,
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
2976
|
+
o,
|
|
2977
|
+
l,
|
|
2978
|
+
f !== void 0,
|
|
2979
|
+
x !== void 0
|
|
1712
2980
|
]);
|
|
1713
|
-
return
|
|
1714
|
-
|
|
1715
|
-
|
|
2981
|
+
return f === void 0 || x === void 0 ? j : /* @__PURE__ */ i.jsxs("div", { children: [
|
|
2982
|
+
f !== void 0 && /* @__PURE__ */ i.jsx(
|
|
2983
|
+
te,
|
|
1716
2984
|
{
|
|
1717
2985
|
withBorder: !0,
|
|
1718
2986
|
p: "xs",
|
|
@@ -1721,12 +2989,12 @@ const Nn = /* @__PURE__ */ new Set(["topRight", "bottomRight"]), or = (e) => {
|
|
|
1721
2989
|
borderBottomRightRadius: 0,
|
|
1722
2990
|
borderBottom: "none"
|
|
1723
2991
|
},
|
|
1724
|
-
children:
|
|
2992
|
+
children: f
|
|
1725
2993
|
}
|
|
1726
2994
|
),
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
2995
|
+
j,
|
|
2996
|
+
x !== void 0 && /* @__PURE__ */ i.jsx(
|
|
2997
|
+
te,
|
|
1730
2998
|
{
|
|
1731
2999
|
withBorder: !0,
|
|
1732
3000
|
p: "xs",
|
|
@@ -1735,25 +3003,25 @@ const Nn = /* @__PURE__ */ new Set(["topRight", "bottomRight"]), or = (e) => {
|
|
|
1735
3003
|
borderTopRightRadius: 0,
|
|
1736
3004
|
borderTop: "none"
|
|
1737
3005
|
},
|
|
1738
|
-
children:
|
|
3006
|
+
children: x
|
|
1739
3007
|
}
|
|
1740
3008
|
)
|
|
1741
3009
|
] });
|
|
1742
|
-
},
|
|
1743
|
-
const
|
|
1744
|
-
const
|
|
3010
|
+
}, Aa = (e) => {
|
|
3011
|
+
const n = E(() => {
|
|
3012
|
+
const a = [
|
|
1745
3013
|
{
|
|
1746
3014
|
id: "selection",
|
|
1747
|
-
header: ({ table: r }) => /* @__PURE__ */
|
|
1748
|
-
|
|
3015
|
+
header: ({ table: r }) => /* @__PURE__ */ i.jsx(
|
|
3016
|
+
ge,
|
|
1749
3017
|
{
|
|
1750
3018
|
checked: r.getIsAllRowsSelected(),
|
|
1751
3019
|
indeterminate: r.getIsSomeRowsSelected(),
|
|
1752
3020
|
onChange: r.getToggleAllRowsSelectedHandler()
|
|
1753
3021
|
}
|
|
1754
3022
|
),
|
|
1755
|
-
cell: ({ row: r }) => /* @__PURE__ */
|
|
1756
|
-
|
|
3023
|
+
cell: ({ row: r }) => /* @__PURE__ */ i.jsx(
|
|
3024
|
+
ge,
|
|
1757
3025
|
{
|
|
1758
3026
|
checked: r.getIsSelected(),
|
|
1759
3027
|
disabled: !r.getCanSelect(),
|
|
@@ -1763,29 +3031,29 @@ const Nn = /* @__PURE__ */ new Set(["topRight", "bottomRight"]), or = (e) => {
|
|
|
1763
3031
|
}
|
|
1764
3032
|
];
|
|
1765
3033
|
return e.columns.forEach((r) => {
|
|
1766
|
-
|
|
3034
|
+
a.push({
|
|
1767
3035
|
id: r.key,
|
|
1768
3036
|
header: r.title,
|
|
1769
3037
|
accessorFn: r.render,
|
|
1770
|
-
cell: ({ row:
|
|
3038
|
+
cell: ({ row: o }) => r.render(o.original)
|
|
1771
3039
|
});
|
|
1772
|
-
}),
|
|
1773
|
-
}, [e.columns]),
|
|
3040
|
+
}), a;
|
|
3041
|
+
}, [e.columns]), t = It({
|
|
1774
3042
|
data: e.data.records,
|
|
1775
|
-
columns:
|
|
1776
|
-
getCoreRowModel:
|
|
3043
|
+
columns: n,
|
|
3044
|
+
getCoreRowModel: Lt(),
|
|
1777
3045
|
// convert to string, but we actually can get away with number
|
|
1778
|
-
getRowId: (
|
|
3046
|
+
getRowId: (a) => e.getRowId(a).toString(),
|
|
1779
3047
|
state: {
|
|
1780
3048
|
rowSelection: e.selectedRowKeys
|
|
1781
3049
|
},
|
|
1782
3050
|
onRowSelectionChange: e.setSelectedRowKeys,
|
|
1783
3051
|
manualPagination: !0
|
|
1784
3052
|
});
|
|
1785
|
-
return /* @__PURE__ */
|
|
1786
|
-
|
|
3053
|
+
return /* @__PURE__ */ i.jsx(
|
|
3054
|
+
tn,
|
|
1787
3055
|
{
|
|
1788
|
-
table:
|
|
3056
|
+
table: t,
|
|
1789
3057
|
selectedRowKeys: e.selectedRowKeys,
|
|
1790
3058
|
bordered: !0,
|
|
1791
3059
|
hasTopSection: e.hasTopSection,
|
|
@@ -1793,195 +3061,195 @@ const Nn = /* @__PURE__ */ new Set(["topRight", "bottomRight"]), or = (e) => {
|
|
|
1793
3061
|
}
|
|
1794
3062
|
);
|
|
1795
3063
|
};
|
|
1796
|
-
function
|
|
1797
|
-
title:
|
|
3064
|
+
function rn(e, n, t, {
|
|
3065
|
+
title: a,
|
|
1798
3066
|
nestedKey: r,
|
|
1799
|
-
component:
|
|
3067
|
+
component: o
|
|
1800
3068
|
} = {}) {
|
|
1801
|
-
let
|
|
1802
|
-
if (
|
|
1803
|
-
|
|
1804
|
-
else if (
|
|
1805
|
-
|
|
3069
|
+
let l;
|
|
3070
|
+
if (o !== void 0)
|
|
3071
|
+
l = o;
|
|
3072
|
+
else if (ue(t))
|
|
3073
|
+
t.cardinality === "1:N" || t.cardinality === "N:N" ? l = Fe : l = Le;
|
|
1806
3074
|
else {
|
|
1807
|
-
if (
|
|
3075
|
+
if (X[t.datatype] === void 0)
|
|
1808
3076
|
throw new Error(
|
|
1809
|
-
`No display component found for datatype ${
|
|
3077
|
+
`No display component found for datatype ${t.datatype}`
|
|
1810
3078
|
);
|
|
1811
|
-
|
|
3079
|
+
l = X[t.datatype];
|
|
1812
3080
|
}
|
|
1813
|
-
const
|
|
1814
|
-
key:
|
|
1815
|
-
title:
|
|
1816
|
-
accessorFn: (
|
|
1817
|
-
render: (
|
|
1818
|
-
const
|
|
1819
|
-
return /* @__PURE__ */
|
|
1820
|
-
|
|
3081
|
+
const s = {
|
|
3082
|
+
key: t.name,
|
|
3083
|
+
title: a || /* @__PURE__ */ i.jsx(O, { value: t.label }),
|
|
3084
|
+
accessorFn: (u) => u[t.tsName],
|
|
3085
|
+
render: (u) => {
|
|
3086
|
+
const c = u[t.tsName];
|
|
3087
|
+
return /* @__PURE__ */ i.jsx(
|
|
3088
|
+
l,
|
|
1821
3089
|
{
|
|
1822
3090
|
db: e,
|
|
1823
|
-
property:
|
|
1824
|
-
value:
|
|
1825
|
-
entityRoutes:
|
|
3091
|
+
property: t,
|
|
3092
|
+
value: c,
|
|
3093
|
+
entityRoutes: n
|
|
1826
3094
|
}
|
|
1827
3095
|
);
|
|
1828
3096
|
}
|
|
1829
3097
|
};
|
|
1830
|
-
return r !== void 0 && (
|
|
1831
|
-
const
|
|
1832
|
-
return /* @__PURE__ */
|
|
1833
|
-
|
|
3098
|
+
return r !== void 0 && (s.accessorFn = (u) => u[r][t.tsName], s.render = (u) => {
|
|
3099
|
+
const c = u[r][t.tsName];
|
|
3100
|
+
return /* @__PURE__ */ i.jsx(
|
|
3101
|
+
l,
|
|
1834
3102
|
{
|
|
1835
3103
|
db: e,
|
|
1836
|
-
property:
|
|
1837
|
-
value:
|
|
1838
|
-
entityRoutes:
|
|
3104
|
+
property: t,
|
|
3105
|
+
value: c,
|
|
3106
|
+
entityRoutes: n
|
|
1839
3107
|
}
|
|
1840
3108
|
);
|
|
1841
|
-
}),
|
|
3109
|
+
}), s;
|
|
1842
3110
|
}
|
|
1843
|
-
function
|
|
3111
|
+
function ho(e, n, t, a, {
|
|
1844
3112
|
title: r,
|
|
1845
|
-
nestedKey:
|
|
1846
|
-
component:
|
|
3113
|
+
nestedKey: o,
|
|
3114
|
+
component: l
|
|
1847
3115
|
} = {}) {
|
|
1848
|
-
let
|
|
1849
|
-
if (
|
|
1850
|
-
|
|
1851
|
-
else if (
|
|
1852
|
-
|
|
3116
|
+
let s;
|
|
3117
|
+
if (l !== void 0)
|
|
3118
|
+
s = l;
|
|
3119
|
+
else if (ue(a))
|
|
3120
|
+
a.cardinality === "1:N" || a.cardinality === "N:N" ? s = Fe : s = Le;
|
|
1853
3121
|
else {
|
|
1854
|
-
if (
|
|
3122
|
+
if (X[a.datatype] === void 0)
|
|
1855
3123
|
throw new Error(
|
|
1856
|
-
`No display component found for datatype ${
|
|
3124
|
+
`No display component found for datatype ${a.datatype}`
|
|
1857
3125
|
);
|
|
1858
|
-
|
|
3126
|
+
s = X[a.datatype];
|
|
1859
3127
|
}
|
|
1860
|
-
const
|
|
1861
|
-
key:
|
|
1862
|
-
title: r || /* @__PURE__ */
|
|
1863
|
-
accessorFn: (
|
|
1864
|
-
render: (
|
|
1865
|
-
const
|
|
1866
|
-
return /* @__PURE__ */
|
|
1867
|
-
|
|
3128
|
+
const u = {
|
|
3129
|
+
key: t + "." + a.name,
|
|
3130
|
+
title: r || /* @__PURE__ */ i.jsx(O, { value: a.label }),
|
|
3131
|
+
accessorFn: (c) => c[t.tsName][a.tsName],
|
|
3132
|
+
render: (c) => {
|
|
3133
|
+
const d = c[t.tsName][a.tsName];
|
|
3134
|
+
return /* @__PURE__ */ i.jsx(
|
|
3135
|
+
s,
|
|
1868
3136
|
{
|
|
1869
3137
|
db: e,
|
|
1870
|
-
property:
|
|
1871
|
-
value:
|
|
1872
|
-
entityRoutes:
|
|
3138
|
+
property: a,
|
|
3139
|
+
value: d,
|
|
3140
|
+
entityRoutes: n
|
|
1873
3141
|
}
|
|
1874
3142
|
);
|
|
1875
3143
|
}
|
|
1876
3144
|
};
|
|
1877
|
-
return
|
|
1878
|
-
const
|
|
1879
|
-
return /* @__PURE__ */
|
|
1880
|
-
|
|
3145
|
+
return o !== void 0 && (u.accessorFn = (c) => c[o][t.tsName][a.tsName], u.render = (c) => {
|
|
3146
|
+
const d = c[o][t.tsName][a.tsName];
|
|
3147
|
+
return /* @__PURE__ */ i.jsx(
|
|
3148
|
+
s,
|
|
1881
3149
|
{
|
|
1882
3150
|
db: e,
|
|
1883
|
-
property:
|
|
1884
|
-
value:
|
|
1885
|
-
entityRoutes:
|
|
3151
|
+
property: a,
|
|
3152
|
+
value: d,
|
|
3153
|
+
entityRoutes: n
|
|
1886
3154
|
}
|
|
1887
3155
|
);
|
|
1888
|
-
}),
|
|
3156
|
+
}), u;
|
|
1889
3157
|
}
|
|
1890
|
-
function
|
|
1891
|
-
return
|
|
3158
|
+
function mo(e, n, t, a, r = {}) {
|
|
3159
|
+
return a.map((o) => an(o) ? o : rn(
|
|
1892
3160
|
e,
|
|
1893
|
-
|
|
1894
|
-
|
|
3161
|
+
t,
|
|
3162
|
+
n.publicProperties[o],
|
|
1895
3163
|
r
|
|
1896
3164
|
));
|
|
1897
3165
|
}
|
|
1898
|
-
function
|
|
1899
|
-
return
|
|
3166
|
+
function go(e, n, t, a = [], r = {}) {
|
|
3167
|
+
return a.map((o) => an(o) ? o : rn(
|
|
1900
3168
|
e,
|
|
1901
|
-
|
|
1902
|
-
|
|
3169
|
+
t,
|
|
3170
|
+
n.publicProperties[o],
|
|
1903
3171
|
r
|
|
1904
3172
|
));
|
|
1905
3173
|
}
|
|
1906
|
-
function
|
|
3174
|
+
function an(e) {
|
|
1907
3175
|
return typeof e == "object" && "key" in e && "title" in e;
|
|
1908
3176
|
}
|
|
1909
|
-
const
|
|
1910
|
-
var
|
|
1911
|
-
const [
|
|
3177
|
+
const Oa = /* @__PURE__ */ new Set(["topRight", "bottomRight"]), po = (e) => {
|
|
3178
|
+
var d, g;
|
|
3179
|
+
const [n, t] = $(
|
|
1912
3180
|
{}
|
|
1913
|
-
),
|
|
1914
|
-
const
|
|
3181
|
+
), a = E(() => {
|
|
3182
|
+
const p = [
|
|
1915
3183
|
{
|
|
1916
3184
|
id: "selection",
|
|
1917
|
-
header: ({ table:
|
|
1918
|
-
|
|
3185
|
+
header: ({ table: f }) => /* @__PURE__ */ i.jsx(
|
|
3186
|
+
ge,
|
|
1919
3187
|
{
|
|
1920
|
-
checked:
|
|
1921
|
-
indeterminate:
|
|
1922
|
-
onChange:
|
|
3188
|
+
checked: f.getIsAllRowsSelected(),
|
|
3189
|
+
indeterminate: f.getIsSomeRowsSelected(),
|
|
3190
|
+
onChange: f.getToggleAllRowsSelectedHandler()
|
|
1923
3191
|
}
|
|
1924
3192
|
),
|
|
1925
|
-
cell: ({ row:
|
|
1926
|
-
|
|
3193
|
+
cell: ({ row: f }) => /* @__PURE__ */ i.jsx(
|
|
3194
|
+
ge,
|
|
1927
3195
|
{
|
|
1928
|
-
checked:
|
|
1929
|
-
disabled: !
|
|
1930
|
-
onChange:
|
|
3196
|
+
checked: f.getIsSelected(),
|
|
3197
|
+
disabled: !f.getCanSelect(),
|
|
3198
|
+
onChange: f.getToggleSelectedHandler()
|
|
1931
3199
|
}
|
|
1932
3200
|
)
|
|
1933
3201
|
}
|
|
1934
3202
|
];
|
|
1935
|
-
return e.columns.forEach((
|
|
1936
|
-
|
|
1937
|
-
id:
|
|
1938
|
-
header:
|
|
1939
|
-
accessorFn:
|
|
1940
|
-
cell: ({ row:
|
|
3203
|
+
return e.columns.forEach((f) => {
|
|
3204
|
+
p.push({
|
|
3205
|
+
id: f.key,
|
|
3206
|
+
header: f.title,
|
|
3207
|
+
accessorFn: f.render,
|
|
3208
|
+
cell: ({ row: x }) => f.render(x.original)
|
|
1941
3209
|
});
|
|
1942
|
-
}),
|
|
1943
|
-
}, [e.columns]), r =
|
|
3210
|
+
}), p;
|
|
3211
|
+
}, [e.columns]), r = It({
|
|
1944
3212
|
data: e.data,
|
|
1945
|
-
columns:
|
|
1946
|
-
getCoreRowModel:
|
|
1947
|
-
getPaginationRowModel:
|
|
3213
|
+
columns: a,
|
|
3214
|
+
getCoreRowModel: Lt(),
|
|
3215
|
+
getPaginationRowModel: In(),
|
|
1948
3216
|
state: {
|
|
1949
|
-
rowSelection:
|
|
3217
|
+
rowSelection: n
|
|
1950
3218
|
},
|
|
1951
|
-
onRowSelectionChange:
|
|
1952
|
-
}),
|
|
1953
|
-
let
|
|
1954
|
-
|
|
1955
|
-
|
|
3219
|
+
onRowSelectionChange: t
|
|
3220
|
+
}), o = E(() => Object.keys(n).filter((p) => n[p]).map(Number), [n]);
|
|
3221
|
+
let l, s;
|
|
3222
|
+
en(e.actions) && (l = /* @__PURE__ */ i.jsx(
|
|
3223
|
+
Qt,
|
|
1956
3224
|
{
|
|
1957
3225
|
actions: e.actions,
|
|
1958
|
-
selectedRowKeys:
|
|
3226
|
+
selectedRowKeys: o
|
|
1959
3227
|
}
|
|
1960
3228
|
));
|
|
1961
|
-
const
|
|
1962
|
-
if (
|
|
1963
|
-
const
|
|
1964
|
-
|
|
3229
|
+
const u = ((d = e.pagination) == null ? void 0 : d.positions) || Oa;
|
|
3230
|
+
if (u.size > 0) {
|
|
3231
|
+
const p = r.getState().pagination, f = /* @__PURE__ */ i.jsx(
|
|
3232
|
+
nn,
|
|
1965
3233
|
{
|
|
1966
3234
|
total: r.getPageCount(),
|
|
1967
|
-
pageIndex:
|
|
1968
|
-
pageSize:
|
|
1969
|
-
onUpdatePagination: (
|
|
1970
|
-
allowPageSizeChange: (
|
|
3235
|
+
pageIndex: p.pageIndex,
|
|
3236
|
+
pageSize: p.pageSize,
|
|
3237
|
+
onUpdatePagination: (x, b) => r.setPagination({ pageIndex: x, pageSize: b }),
|
|
3238
|
+
allowPageSizeChange: (g = e.pagination) == null ? void 0 : g.showSizeChanger
|
|
1971
3239
|
}
|
|
1972
3240
|
);
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
] }) :
|
|
1977
|
-
|
|
1978
|
-
/* @__PURE__ */
|
|
3241
|
+
u.has("topRight") && (l !== void 0 ? l = /* @__PURE__ */ i.jsxs(D, { justify: "space-between", gap: "sm", children: [
|
|
3242
|
+
l,
|
|
3243
|
+
f
|
|
3244
|
+
] }) : l = /* @__PURE__ */ i.jsx(z, { justify: "flex-end", children: f })), (u.has("bottomRight") || u.has("bottomLeft") || u.has("bottomCenter")) && (u.has("bottomLeft") ? s = /* @__PURE__ */ i.jsxs(z, { justify: "space-between", align: "center", children: [
|
|
3245
|
+
f,
|
|
3246
|
+
/* @__PURE__ */ i.jsxs(R, { size: "sm", c: "dimmed", children: [
|
|
1979
3247
|
"Showing ",
|
|
1980
|
-
|
|
3248
|
+
p.pageIndex * p.pageSize + 1,
|
|
1981
3249
|
" to",
|
|
1982
3250
|
" ",
|
|
1983
3251
|
Math.min(
|
|
1984
|
-
(
|
|
3252
|
+
(p.pageIndex + 1) * p.pageSize,
|
|
1985
3253
|
e.data.length
|
|
1986
3254
|
),
|
|
1987
3255
|
" ",
|
|
@@ -1989,14 +3257,14 @@ const In = /* @__PURE__ */ new Set(["topRight", "bottomRight"]), lr = (e) => {
|
|
|
1989
3257
|
e.data.length,
|
|
1990
3258
|
" records"
|
|
1991
3259
|
] })
|
|
1992
|
-
] }) :
|
|
1993
|
-
/* @__PURE__ */
|
|
3260
|
+
] }) : s = /* @__PURE__ */ i.jsxs(z, { justify: "space-between", align: "center", children: [
|
|
3261
|
+
/* @__PURE__ */ i.jsxs(R, { size: "sm", c: "dimmed", children: [
|
|
1994
3262
|
"Showing ",
|
|
1995
|
-
|
|
3263
|
+
p.pageIndex * p.pageSize + 1,
|
|
1996
3264
|
" to",
|
|
1997
3265
|
" ",
|
|
1998
3266
|
Math.min(
|
|
1999
|
-
(
|
|
3267
|
+
(p.pageIndex + 1) * p.pageSize,
|
|
2000
3268
|
e.data.length
|
|
2001
3269
|
),
|
|
2002
3270
|
" ",
|
|
@@ -2004,22 +3272,22 @@ const In = /* @__PURE__ */ new Set(["topRight", "bottomRight"]), lr = (e) => {
|
|
|
2004
3272
|
e.data.length,
|
|
2005
3273
|
" records"
|
|
2006
3274
|
] }),
|
|
2007
|
-
|
|
3275
|
+
f
|
|
2008
3276
|
] }));
|
|
2009
3277
|
}
|
|
2010
|
-
const
|
|
2011
|
-
|
|
3278
|
+
const c = /* @__PURE__ */ i.jsx(
|
|
3279
|
+
tn,
|
|
2012
3280
|
{
|
|
2013
|
-
selectedRowKeys:
|
|
3281
|
+
selectedRowKeys: n,
|
|
2014
3282
|
table: r,
|
|
2015
3283
|
bordered: !0,
|
|
2016
|
-
hasTopSection:
|
|
2017
|
-
hasBottomSection:
|
|
3284
|
+
hasTopSection: l !== void 0,
|
|
3285
|
+
hasBottomSection: s !== void 0
|
|
2018
3286
|
}
|
|
2019
3287
|
);
|
|
2020
|
-
return
|
|
2021
|
-
|
|
2022
|
-
|
|
3288
|
+
return l === void 0 && s === void 0 ? c : /* @__PURE__ */ i.jsxs("div", { children: [
|
|
3289
|
+
l !== void 0 && /* @__PURE__ */ i.jsx(
|
|
3290
|
+
te,
|
|
2023
3291
|
{
|
|
2024
3292
|
withBorder: !0,
|
|
2025
3293
|
p: "xs",
|
|
@@ -2028,12 +3296,12 @@ const In = /* @__PURE__ */ new Set(["topRight", "bottomRight"]), lr = (e) => {
|
|
|
2028
3296
|
borderBottomRightRadius: 0,
|
|
2029
3297
|
borderBottom: "none"
|
|
2030
3298
|
},
|
|
2031
|
-
children:
|
|
3299
|
+
children: l
|
|
2032
3300
|
}
|
|
2033
3301
|
),
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
3302
|
+
c,
|
|
3303
|
+
s !== void 0 && /* @__PURE__ */ i.jsx(
|
|
3304
|
+
te,
|
|
2037
3305
|
{
|
|
2038
3306
|
withBorder: !0,
|
|
2039
3307
|
p: "xs",
|
|
@@ -2042,206 +3310,208 @@ const In = /* @__PURE__ */ new Set(["topRight", "bottomRight"]), lr = (e) => {
|
|
|
2042
3310
|
borderTopRightRadius: 0,
|
|
2043
3311
|
borderTop: "none"
|
|
2044
3312
|
},
|
|
2045
|
-
children:
|
|
3313
|
+
children: s
|
|
2046
3314
|
}
|
|
2047
3315
|
)
|
|
2048
3316
|
] });
|
|
2049
|
-
},
|
|
3317
|
+
}, St = Z(
|
|
2050
3318
|
({
|
|
2051
3319
|
store: e,
|
|
2052
|
-
record:
|
|
2053
|
-
property:
|
|
2054
|
-
DisplayComponent:
|
|
3320
|
+
record: n,
|
|
3321
|
+
property: t,
|
|
3322
|
+
DisplayComponent: a,
|
|
2055
3323
|
entityRoutes: r
|
|
2056
3324
|
}) => {
|
|
2057
|
-
const
|
|
2058
|
-
return /* @__PURE__ */
|
|
2059
|
-
/* @__PURE__ */
|
|
2060
|
-
/* @__PURE__ */
|
|
2061
|
-
|
|
3325
|
+
const o = n[t.tsName];
|
|
3326
|
+
return /* @__PURE__ */ i.jsxs("div", { children: [
|
|
3327
|
+
/* @__PURE__ */ i.jsx(R, { size: "sm", fw: 550, children: /* @__PURE__ */ i.jsx(O, { value: t.label }) }),
|
|
3328
|
+
/* @__PURE__ */ i.jsx(
|
|
3329
|
+
a,
|
|
2062
3330
|
{
|
|
2063
3331
|
db: e.db,
|
|
2064
3332
|
entityRoutes: r,
|
|
2065
|
-
property:
|
|
2066
|
-
value:
|
|
3333
|
+
property: t,
|
|
3334
|
+
value: o
|
|
2067
3335
|
}
|
|
2068
3336
|
)
|
|
2069
3337
|
] });
|
|
2070
3338
|
}
|
|
2071
|
-
),
|
|
3339
|
+
), Da = Z(
|
|
2072
3340
|
({
|
|
2073
3341
|
store: e,
|
|
2074
|
-
record:
|
|
2075
|
-
properties:
|
|
2076
|
-
DisplayComponent:
|
|
3342
|
+
record: n,
|
|
3343
|
+
properties: t,
|
|
3344
|
+
DisplayComponent: a,
|
|
2077
3345
|
entityRoutes: r
|
|
2078
3346
|
}) => {
|
|
2079
|
-
const
|
|
2080
|
-
if (
|
|
2081
|
-
return
|
|
2082
|
-
},
|
|
2083
|
-
return /* @__PURE__ */
|
|
2084
|
-
/* @__PURE__ */
|
|
2085
|
-
|
|
2086
|
-
|
|
3347
|
+
const o = t[t.length - 1], l = t.reduce((s, u) => {
|
|
3348
|
+
if (s != null)
|
|
3349
|
+
return s[u.tsName];
|
|
3350
|
+
}, n);
|
|
3351
|
+
return /* @__PURE__ */ i.jsxs("div", { children: [
|
|
3352
|
+
/* @__PURE__ */ i.jsx(R, { size: "sm", fw: 550, children: /* @__PURE__ */ i.jsx(O, { value: o.label }) }),
|
|
3353
|
+
l !== void 0 && /* @__PURE__ */ i.jsx(
|
|
3354
|
+
a,
|
|
2087
3355
|
{
|
|
2088
3356
|
db: e.db,
|
|
2089
|
-
property:
|
|
2090
|
-
value:
|
|
3357
|
+
property: o,
|
|
3358
|
+
value: l,
|
|
2091
3359
|
entityRoutes: r
|
|
2092
3360
|
}
|
|
2093
3361
|
)
|
|
2094
3362
|
] });
|
|
2095
3363
|
}
|
|
2096
|
-
),
|
|
2097
|
-
const
|
|
2098
|
-
|
|
3364
|
+
), Ma = 12, za = (e) => {
|
|
3365
|
+
const n = e.schema, t = E(() => e.fieldGroups.map((a, r) => Ba(
|
|
3366
|
+
n,
|
|
2099
3367
|
e.store,
|
|
2100
3368
|
e.record,
|
|
2101
3369
|
r,
|
|
2102
|
-
|
|
3370
|
+
a,
|
|
2103
3371
|
e.entityRoutes
|
|
2104
|
-
)), [
|
|
2105
|
-
return /* @__PURE__ */
|
|
3372
|
+
)), [n, e.store, e.record, e.fieldGroups]);
|
|
3373
|
+
return /* @__PURE__ */ i.jsx(pe, { gap: "sm", className: e.className, style: e.styles, children: t });
|
|
2106
3374
|
};
|
|
2107
|
-
function
|
|
2108
|
-
const
|
|
2109
|
-
for (let
|
|
2110
|
-
const
|
|
2111
|
-
if (!Number.isInteger(
|
|
2112
|
-
throw new Error(`Span must be an integer, but got ${
|
|
2113
|
-
for (let
|
|
2114
|
-
const
|
|
2115
|
-
let
|
|
2116
|
-
if (typeof
|
|
2117
|
-
|
|
2118
|
-
else if (typeof
|
|
2119
|
-
const
|
|
2120
|
-
|
|
2121
|
-
|
|
3375
|
+
function Ba(e, n, t, a, r, o) {
|
|
3376
|
+
const l = r.fields, s = [];
|
|
3377
|
+
for (let u = 0; u < l.length; u++) {
|
|
3378
|
+
const c = Ma / l[u].length;
|
|
3379
|
+
if (!Number.isInteger(c))
|
|
3380
|
+
throw new Error(`Span must be an integer, but got ${c} for row ${u}`);
|
|
3381
|
+
for (let d = 0; d < l[u].length; d++) {
|
|
3382
|
+
const g = l[u][d];
|
|
3383
|
+
let p;
|
|
3384
|
+
if (typeof g == "function")
|
|
3385
|
+
p = g(n, t);
|
|
3386
|
+
else if (typeof g == "object" && "prop" in g) {
|
|
3387
|
+
const f = e.allProperties[g.prop], x = g.display;
|
|
3388
|
+
p = /* @__PURE__ */ i.jsx(
|
|
3389
|
+
St,
|
|
2122
3390
|
{
|
|
2123
|
-
store:
|
|
2124
|
-
record:
|
|
2125
|
-
property:
|
|
2126
|
-
DisplayComponent:
|
|
2127
|
-
entityRoutes:
|
|
3391
|
+
store: n,
|
|
3392
|
+
record: t,
|
|
3393
|
+
property: f,
|
|
3394
|
+
DisplayComponent: x,
|
|
3395
|
+
entityRoutes: o
|
|
2128
3396
|
}
|
|
2129
3397
|
);
|
|
2130
3398
|
} else {
|
|
2131
|
-
const
|
|
2132
|
-
let
|
|
2133
|
-
if (
|
|
2134
|
-
|
|
3399
|
+
const f = e.allProperties[g];
|
|
3400
|
+
let x;
|
|
3401
|
+
if (ue(f))
|
|
3402
|
+
x = f.cardinality === "N:N" || f.cardinality === "1:N" ? Fe : Le;
|
|
2135
3403
|
else {
|
|
2136
|
-
if (
|
|
3404
|
+
if (X[f.datatype] === void 0)
|
|
2137
3405
|
throw new Error(
|
|
2138
|
-
`No display component found for datatype ${
|
|
3406
|
+
`No display component found for datatype ${f.datatype}`
|
|
2139
3407
|
);
|
|
2140
|
-
|
|
3408
|
+
x = X[f.datatype];
|
|
2141
3409
|
}
|
|
2142
|
-
|
|
2143
|
-
|
|
3410
|
+
p = /* @__PURE__ */ i.jsx(
|
|
3411
|
+
St,
|
|
2144
3412
|
{
|
|
2145
|
-
store:
|
|
2146
|
-
record:
|
|
2147
|
-
property:
|
|
2148
|
-
DisplayComponent:
|
|
2149
|
-
entityRoutes:
|
|
3413
|
+
store: n,
|
|
3414
|
+
record: t,
|
|
3415
|
+
property: f,
|
|
3416
|
+
DisplayComponent: x,
|
|
3417
|
+
entityRoutes: o
|
|
2150
3418
|
}
|
|
2151
3419
|
);
|
|
2152
3420
|
}
|
|
2153
|
-
|
|
2154
|
-
/* @__PURE__ */
|
|
3421
|
+
s.push(
|
|
3422
|
+
/* @__PURE__ */ i.jsx(_.Col, { span: c, children: p }, `${u}-${d}`)
|
|
2155
3423
|
);
|
|
2156
3424
|
}
|
|
2157
3425
|
}
|
|
2158
|
-
return /* @__PURE__ */
|
|
3426
|
+
return /* @__PURE__ */ i.jsx(_, { gutter: "sm", children: s }, a);
|
|
2159
3427
|
}
|
|
2160
|
-
function
|
|
2161
|
-
const
|
|
3428
|
+
function xo(e, n, t) {
|
|
3429
|
+
const a = e[e.length - 1];
|
|
2162
3430
|
let r;
|
|
2163
|
-
if (
|
|
2164
|
-
r =
|
|
2165
|
-
else if (
|
|
2166
|
-
r =
|
|
3431
|
+
if (t !== void 0)
|
|
3432
|
+
r = t;
|
|
3433
|
+
else if (ue(a))
|
|
3434
|
+
r = a.cardinality === "N:N" || a.cardinality === "1:N" ? Fe : Le;
|
|
2167
3435
|
else {
|
|
2168
|
-
if (
|
|
3436
|
+
if (X[a.datatype] === void 0)
|
|
2169
3437
|
throw new Error(
|
|
2170
|
-
`No display component found for datatype ${
|
|
3438
|
+
`No display component found for datatype ${a.datatype}`
|
|
2171
3439
|
);
|
|
2172
|
-
r =
|
|
3440
|
+
r = X[a.datatype];
|
|
2173
3441
|
}
|
|
2174
|
-
return (
|
|
2175
|
-
|
|
3442
|
+
return (o, l) => /* @__PURE__ */ i.jsx(
|
|
3443
|
+
Da,
|
|
2176
3444
|
{
|
|
2177
|
-
store:
|
|
2178
|
-
record:
|
|
3445
|
+
store: o,
|
|
3446
|
+
record: l,
|
|
2179
3447
|
properties: e,
|
|
2180
3448
|
DisplayComponent: r,
|
|
2181
|
-
entityRoutes:
|
|
3449
|
+
entityRoutes: n
|
|
2182
3450
|
}
|
|
2183
3451
|
);
|
|
2184
3452
|
}
|
|
2185
|
-
const
|
|
2186
|
-
/* @__PURE__ */
|
|
2187
|
-
e.fieldTabs.map((
|
|
2188
|
-
|
|
3453
|
+
const vo = (e) => /* @__PURE__ */ i.jsxs(ye, { defaultValue: e.fieldTabs[0].tabName, children: [
|
|
3454
|
+
/* @__PURE__ */ i.jsx(ye.List, { children: e.fieldTabs.map((n, t) => /* @__PURE__ */ i.jsx(ye.Tab, { value: n.tabName, children: n.tabName }, t)) }),
|
|
3455
|
+
e.fieldTabs.map((n, t) => /* @__PURE__ */ i.jsx(ye.Panel, { value: n.tabName, pt: "sm", children: /* @__PURE__ */ i.jsx(
|
|
3456
|
+
za,
|
|
2189
3457
|
{
|
|
2190
3458
|
schema: e.schema,
|
|
2191
3459
|
store: e.store,
|
|
2192
3460
|
record: e.record,
|
|
2193
|
-
fieldGroups:
|
|
3461
|
+
fieldGroups: n.fieldGroups,
|
|
2194
3462
|
styles: e.tabStyles,
|
|
2195
3463
|
className: e.tabClassName,
|
|
2196
3464
|
entityRoutes: e.entityRoutes
|
|
2197
3465
|
}
|
|
2198
|
-
) },
|
|
3466
|
+
) }, t))
|
|
2199
3467
|
] });
|
|
2200
3468
|
export {
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
3469
|
+
Be as CountryFlagComponent,
|
|
3470
|
+
$a as DEFAULT_PAGINATION_POSITIONS,
|
|
3471
|
+
vt as DataType2Component,
|
|
3472
|
+
X as DataType2DisplayComponent,
|
|
3473
|
+
aa as DateDisplay,
|
|
3474
|
+
ra as DateTimeDisplay,
|
|
3475
|
+
uo as DateTimeHideTimeDisplay,
|
|
3476
|
+
An as EmojiCountryFlag,
|
|
3477
|
+
Qe as ExternalComponentContext,
|
|
3478
|
+
so as ExternalComponentProvider,
|
|
3479
|
+
Ca as FormItem,
|
|
3480
|
+
ja as FormItemLabel,
|
|
3481
|
+
Xa as LanguageSelector,
|
|
3482
|
+
eo as Loading,
|
|
3483
|
+
to as LoadingInline,
|
|
3484
|
+
xe as LocaleContext,
|
|
3485
|
+
Ja as LocaleProvider,
|
|
3486
|
+
na as MenuTrie,
|
|
3487
|
+
Fe as MultiForeignKeyDisplay,
|
|
3488
|
+
O as MultiLingualString,
|
|
3489
|
+
no as NotAuthorized,
|
|
3490
|
+
Za as NotFound,
|
|
3491
|
+
Jt as NotFoundInline,
|
|
3492
|
+
Qa as NotFoundSubPage,
|
|
3493
|
+
io as OrderedUniqueList,
|
|
3494
|
+
We as Permission,
|
|
3495
|
+
$n as SVGCountryFlag,
|
|
3496
|
+
po as SeraEmbeddedTable,
|
|
3497
|
+
co as SeraForm,
|
|
3498
|
+
fo as SeraTable,
|
|
3499
|
+
lo as SeraVerticalMenu,
|
|
3500
|
+
za as SeraView,
|
|
3501
|
+
vo as SeraViewTab,
|
|
3502
|
+
Le as SingleForeignKeyDisplay,
|
|
3503
|
+
Xt as Trie,
|
|
3504
|
+
gt as TrieNode,
|
|
3505
|
+
Qr as buildMenuItemIndex,
|
|
3506
|
+
N as countryFlags,
|
|
3507
|
+
ta as filterAllowedItems,
|
|
3508
|
+
ro as groupBy,
|
|
3509
|
+
ao as groupByAsList,
|
|
3510
|
+
an as isSeraColumn,
|
|
3511
|
+
go as makeEmbeddedTableColumns,
|
|
3512
|
+
xo as makeFieldDisplay,
|
|
3513
|
+
rn as makeTableColumn,
|
|
3514
|
+
ho as makeTableColumnFromNestedProperty,
|
|
3515
|
+
mo as makeTableColumns,
|
|
3516
|
+
oo as uniqueList
|
|
2247
3517
|
};
|