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