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