@luminix/mui-cms 0.2.4 → 0.2.5
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/mui-cms.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
var gr = Object.defineProperty;
|
|
2
2
|
var br = (e, t, n) => t in e ? gr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var $e = (e, t, n) => br(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
-
import { Str as
|
|
5
|
-
import { config as oe, collect as W, app as
|
|
4
|
+
import { Str as k, Obj as J, DateTime as Oe, Query as mn, Func as yr, MakeFacade as St, Reducible as gn, ServiceProvider as bn } from "@luminix/support";
|
|
5
|
+
import { config as oe, collect as W, app as T, model as we, App as xt, Model as Re, Route as wr, Config as re } from "@luminix/core";
|
|
6
6
|
import { jsx as i, jsxs as w, Fragment as B } from "react/jsx-runtime";
|
|
7
7
|
import { Outlet as Sr, useParams as xr, useNavigate as At, useSearchParams as G, Link as Pe, Form as Ar } from "react-router-dom";
|
|
8
|
-
import { useCollection as yn, PaginationProvider as Cr, usePagination as xe, ModelForm as Er, useApplyReducers as Ct, Forms as
|
|
9
|
-
import { useMediaQuery as Me, Dialog as Et, DialogTitle as
|
|
10
|
-
import
|
|
8
|
+
import { useCollection as yn, PaginationProvider as Cr, usePagination as xe, ModelForm as Er, useApplyReducers as Ct, Forms as kr, LuminixProvider as Tr } from "@luminix/react";
|
|
9
|
+
import { useMediaQuery as Me, Dialog as Et, DialogTitle as kt, DialogContent as Tt, DialogContentText as Dr, TextField as fe, DialogActions as Dt, Button as M, Snackbar as Or, Alert as Rr, IconButton as q, AlertTitle as Pr, Box as H, Unstable_Grid2 as Q, Fab as vr, SpeedDial as Fr, SpeedDialIcon as Lr, SpeedDialAction as Br, ButtonGroup as Ir, Popper as Mr, Grow as Nr, Paper as Ot, ClickAwayListener as jr, MenuList as Ur, MenuItem as se, AppBar as wn, Toolbar as qr, Typography as $, Drawer as Sn, Divider as ve, Autocomplete as _r, CircularProgress as Hr, Switch as zr, Stack as N, FormControl as at, InputLabel as it, Select as Fe, Badge as Rt, Popover as Vr, Link as lt, Collapse as xn, TableCell as ee, RadioGroup as $t, FormControlLabel as Ke, Radio as Ye, TableContainer as Wr, Table as $r, TableHead as Kr, TableRow as he, Checkbox as Pt, TableSortLabel as Yr, Skeleton as Kt, TableBody as Jr, TableFooter as Gr, Tabs as Zr, Tab as Yt, Breadcrumbs as Xr, List as Qr, ListItem as eo, ListItemButton as to, ListItemIcon as An, ListItemText as Cn, Menu as En, Avatar as no, CssBaseline as ro } from "@mui/material";
|
|
10
|
+
import m, { useContext as kn, useMemo as oo } from "react";
|
|
11
11
|
import { useTranslation as L, initReactI18next as so } from "react-i18next";
|
|
12
|
-
import { Close as Ne, ArrowDropDown as
|
|
12
|
+
import { Close as Ne, ArrowDropDown as Tn, ChevronLeft as je, ChevronRight as Ue, HighlightOffOutlined as ct, AddCircleOutline as Dn, FilterList as On, Menu as Rn, LastPage as Pn, FirstPage as vn, Search as ut, SwapVert as Fn, ArrowUpward as Ln, ArrowDownward as Bn, MoreVert as vt, ExpandLess as In, ExpandMore as Mn, Add as ao, CategoryOutlined as io, DashboardOutlined as lo, PeopleOutlined as co } from "@mui/icons-material";
|
|
13
13
|
import { useTheme as Ft, styled as Z, createTheme as uo, ThemeProvider as fo } from "@mui/material/styles";
|
|
14
14
|
import Jt from "react-dom";
|
|
15
15
|
import Y from "i18next";
|
|
@@ -28,8 +28,8 @@ const ho = {
|
|
|
28
28
|
showBackButton: !1,
|
|
29
29
|
setShowBackButton: () => {
|
|
30
30
|
}
|
|
31
|
-
}, X =
|
|
32
|
-
const [t, n] =
|
|
31
|
+
}, X = m.createContext(ho), Je = document.title, po = ({ children: e }) => {
|
|
32
|
+
const [t, n] = m.useState(!1), [r, o] = m.useState(""), [s, a] = m.useState(!1), [l, d] = m.useState(!1), c = oe("luminix.cms.layout", {}), u = Me((y) => y.breakpoints.up((c == null ? void 0 : c.breakpoint) || "md")), h = {
|
|
33
33
|
open: t,
|
|
34
34
|
setOpen: n,
|
|
35
35
|
layout: c,
|
|
@@ -41,12 +41,12 @@ const ho = {
|
|
|
41
41
|
showBackButton: l,
|
|
42
42
|
setShowBackButton: d
|
|
43
43
|
};
|
|
44
|
-
return
|
|
44
|
+
return m.useEffect(() => (document.title = r ? `${r} | ${oe("app.name", Je)}` : oe("app.name", Je), () => {
|
|
45
45
|
document.title = Je;
|
|
46
|
-
}), [r]), /* @__PURE__ */ i(X.Provider, { value:
|
|
47
|
-
}, Nn =
|
|
46
|
+
}), [r]), /* @__PURE__ */ i(X.Provider, { value: h, children: e });
|
|
47
|
+
}, Nn = m.createContext({
|
|
48
48
|
Model: null
|
|
49
|
-
}), Ge = ({ Model: e, children: t }) => /* @__PURE__ */ i(Nn.Provider, { value: { Model: e }, children: t }), jn =
|
|
49
|
+
}), Ge = ({ Model: e, children: t }) => /* @__PURE__ */ i(Nn.Provider, { value: { Model: e }, children: t }), jn = m.createContext({
|
|
50
50
|
isOpen: !1,
|
|
51
51
|
dialog: () => Promise.reject(new Error("Trying to access DialogContext outside of DialogProvider")),
|
|
52
52
|
dismissDialog: () => {
|
|
@@ -54,20 +54,24 @@ const ho = {
|
|
|
54
54
|
current: void 0
|
|
55
55
|
});
|
|
56
56
|
function mo(e) {
|
|
57
|
-
const [t, n] =
|
|
58
|
-
return
|
|
57
|
+
const [t, n] = m.useState(e);
|
|
58
|
+
return m.useEffect(() => {
|
|
59
59
|
e && n(e);
|
|
60
60
|
}, [e]), e || t;
|
|
61
61
|
}
|
|
62
62
|
function go({ children: e, ...t }) {
|
|
63
|
-
const [{ current: n, resolve: r }, o] =
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
const [{ current: n, resolve: r }, o] = m.useState({}), [s, a] = m.useState(""), l = mo(n), {
|
|
64
|
+
type: d = "alert",
|
|
65
|
+
dialogProps: c = {},
|
|
66
|
+
textFieldProps: u = {}
|
|
67
|
+
} = l ?? {}, h = m.useCallback((p) => new Promise((g) => {
|
|
68
|
+
typeof p != "string" && p.type === "prompt" && a(p.defaultValue ?? ""), o({
|
|
69
|
+
current: typeof p == "string" ? { message: p } : p,
|
|
70
|
+
resolve: g
|
|
67
71
|
});
|
|
68
|
-
}), []), { t:
|
|
72
|
+
}), []), { t: y } = L(), S = () => {
|
|
69
73
|
r && r(!1), o({});
|
|
70
|
-
},
|
|
74
|
+
}, b = () => {
|
|
71
75
|
r && r(
|
|
72
76
|
d === "prompt" ? s : !0
|
|
73
77
|
), o({});
|
|
@@ -75,8 +79,8 @@ function go({ children: e, ...t }) {
|
|
|
75
79
|
return /* @__PURE__ */ w(jn.Provider, { value: {
|
|
76
80
|
isOpen: !!n,
|
|
77
81
|
current: n,
|
|
78
|
-
dialog:
|
|
79
|
-
dismissDialog:
|
|
82
|
+
dialog: h,
|
|
83
|
+
dismissDialog: S
|
|
80
84
|
}, children: [
|
|
81
85
|
e,
|
|
82
86
|
/* @__PURE__ */ w(
|
|
@@ -85,11 +89,12 @@ function go({ children: e, ...t }) {
|
|
|
85
89
|
open: !!n,
|
|
86
90
|
"aria-labelledby": "alert-dialog-title",
|
|
87
91
|
"aria-describedby": "alert-dialog-description",
|
|
88
|
-
...(n == null ? void 0 : n.dismissable) ?? !0 ? { onClose:
|
|
92
|
+
...(n == null ? void 0 : n.dismissable) ?? !0 ? { onClose: S } : {},
|
|
89
93
|
...t,
|
|
94
|
+
...c,
|
|
90
95
|
children: [
|
|
91
|
-
(l == null ? void 0 : l.title) && /* @__PURE__ */ i(
|
|
92
|
-
/* @__PURE__ */ w(
|
|
96
|
+
(l == null ? void 0 : l.title) && /* @__PURE__ */ i(kt, { id: "alert-dialog-title", children: l.title }),
|
|
97
|
+
/* @__PURE__ */ w(Tt, { children: [
|
|
93
98
|
/* @__PURE__ */ i(Dr, { id: "alert-dialog-description", children: l == null ? void 0 : l.message }),
|
|
94
99
|
d === "prompt" && /* @__PURE__ */ i(
|
|
95
100
|
fe,
|
|
@@ -97,20 +102,20 @@ function go({ children: e, ...t }) {
|
|
|
97
102
|
autoFocus: !0,
|
|
98
103
|
margin: "dense",
|
|
99
104
|
id: "name",
|
|
100
|
-
label: l == null ? void 0 : l.message,
|
|
101
105
|
type: "text",
|
|
102
106
|
fullWidth: !0,
|
|
107
|
+
...u,
|
|
103
108
|
value: s,
|
|
104
|
-
onChange: (
|
|
109
|
+
onChange: (p) => a(p.target.value)
|
|
105
110
|
}
|
|
106
111
|
)
|
|
107
112
|
] }),
|
|
108
113
|
/* @__PURE__ */ w(Dt, { children: [
|
|
109
|
-
d
|
|
110
|
-
/* @__PURE__ */ i(M, { onClick:
|
|
111
|
-
/* @__PURE__ */ i(M, { onClick:
|
|
114
|
+
d !== "alert" && /* @__PURE__ */ w(B, { children: [
|
|
115
|
+
/* @__PURE__ */ i(M, { onClick: S, children: (l == null ? void 0 : l.cancelText) ?? y(d === "confirm" ? "No" : "Cancel") }),
|
|
116
|
+
/* @__PURE__ */ i(M, { onClick: b, autoFocus: d !== "prompt", children: (l == null ? void 0 : l.confirmText) ?? y(d === "confirm" ? "Yes" : "Ok") })
|
|
112
117
|
] }),
|
|
113
|
-
|
|
118
|
+
d === "alert" && /* @__PURE__ */ i(M, { onClick: S, autoFocus: !0, children: (l == null ? void 0 : l.confirmText) ?? y("Ok") })
|
|
114
119
|
] })
|
|
115
120
|
]
|
|
116
121
|
}
|
|
@@ -118,10 +123,10 @@ function go({ children: e, ...t }) {
|
|
|
118
123
|
] });
|
|
119
124
|
}
|
|
120
125
|
function v() {
|
|
121
|
-
const { isBreakpointUp: e } =
|
|
126
|
+
const { isBreakpointUp: e } = kn(X);
|
|
122
127
|
return e;
|
|
123
128
|
}
|
|
124
|
-
const Lt =
|
|
129
|
+
const Lt = m.createContext({
|
|
125
130
|
isOpen: !1,
|
|
126
131
|
notify: () => {
|
|
127
132
|
},
|
|
@@ -144,20 +149,20 @@ const Lt = p.createContext({
|
|
|
144
149
|
sx: o,
|
|
145
150
|
...s
|
|
146
151
|
}) => {
|
|
147
|
-
const a = yn(dt), l = v(), c = Ft().spacing(l ? 3 : 1), [u,
|
|
148
|
-
A !== "clickaway" &&
|
|
152
|
+
const a = yn(dt), l = v(), c = Ft().spacing(l ? 3 : 1), [u, h] = m.useState(), [y, S] = m.useState(c), { vertical: b = "bottom" } = r || {}, p = (g, A) => {
|
|
153
|
+
A !== "clickaway" && h(void 0);
|
|
149
154
|
};
|
|
150
|
-
return
|
|
155
|
+
return m.useEffect(() => {
|
|
151
156
|
if (!u && a.isNotEmpty()) {
|
|
152
157
|
const g = setTimeout(() => {
|
|
153
|
-
|
|
158
|
+
h(dt.pull(0) ?? void 0);
|
|
154
159
|
}, 100);
|
|
155
160
|
return () => clearTimeout(g);
|
|
156
161
|
}
|
|
157
162
|
}, [u, a]), /* @__PURE__ */ w(Lt.Provider, { value: {
|
|
158
163
|
isOpen: !!u,
|
|
159
164
|
notify: bo,
|
|
160
|
-
dismissNotification:
|
|
165
|
+
dismissNotification: p,
|
|
161
166
|
notifications: a.all(),
|
|
162
167
|
current: u,
|
|
163
168
|
displacement: y,
|
|
@@ -170,7 +175,7 @@ const Lt = p.createContext({
|
|
|
170
175
|
open: !!u,
|
|
171
176
|
autoHideDuration: t,
|
|
172
177
|
anchorOrigin: r,
|
|
173
|
-
onClose:
|
|
178
|
+
onClose: p,
|
|
174
179
|
sx: {
|
|
175
180
|
...o,
|
|
176
181
|
[b]: `${y} !important`
|
|
@@ -179,7 +184,7 @@ const Lt = p.createContext({
|
|
|
179
184
|
children: u && /* @__PURE__ */ w(
|
|
180
185
|
Rr,
|
|
181
186
|
{
|
|
182
|
-
onClose:
|
|
187
|
+
onClose: p,
|
|
183
188
|
severity: u.severity,
|
|
184
189
|
variant: n,
|
|
185
190
|
sx: { width: "100%" },
|
|
@@ -194,7 +199,7 @@ const Lt = p.createContext({
|
|
|
194
199
|
},
|
|
195
200
|
x
|
|
196
201
|
)),
|
|
197
|
-
/* @__PURE__ */ i(q, { "aria-label": "close", color: "inherit", size: "small", onClick:
|
|
202
|
+
/* @__PURE__ */ i(q, { "aria-label": "close", color: "inherit", size: "small", onClick: p, children: /* @__PURE__ */ i(Ne, {}) }, "close")
|
|
198
203
|
],
|
|
199
204
|
children: [
|
|
200
205
|
u.title && /* @__PURE__ */ i(Pr, { children: u.title }),
|
|
@@ -235,17 +240,17 @@ const Lt = p.createContext({
|
|
|
235
240
|
},
|
|
236
241
|
...Object.entries(s).flatMap(([a, l]) => [
|
|
237
242
|
{
|
|
238
|
-
path: "/" +
|
|
243
|
+
path: "/" + k.kebab(l.plural()),
|
|
239
244
|
name: `luminix.cms.${a}.index`,
|
|
240
245
|
element: /* @__PURE__ */ i(Ge, { Model: l, children: /* @__PURE__ */ i(Cr, { factory: l.query, children: /* @__PURE__ */ i(r, {}) }) })
|
|
241
246
|
},
|
|
242
247
|
{
|
|
243
|
-
path: "/" +
|
|
248
|
+
path: "/" + k.kebab(l.plural()) + "/create",
|
|
244
249
|
name: `luminix.cms.${a}.create`,
|
|
245
250
|
element: /* @__PURE__ */ i(Ge, { Model: l, children: /* @__PURE__ */ i(o, { create: !0 }) })
|
|
246
251
|
},
|
|
247
252
|
{
|
|
248
|
-
path: "/" +
|
|
253
|
+
path: "/" + k.kebab(l.plural()) + "/:id",
|
|
249
254
|
name: `luminix.cms.${a}.show`,
|
|
250
255
|
element: /* @__PURE__ */ i(Ge, { Model: l, children: /* @__PURE__ */ i(o, {}) })
|
|
251
256
|
}
|
|
@@ -254,8 +259,8 @@ const Lt = p.createContext({
|
|
|
254
259
|
}
|
|
255
260
|
];
|
|
256
261
|
function Bt(e) {
|
|
257
|
-
const { setCurrentPage: t } =
|
|
258
|
-
|
|
262
|
+
const { setCurrentPage: t } = m.useContext(X);
|
|
263
|
+
m.useEffect(() => (t(e), () => {
|
|
259
264
|
t("");
|
|
260
265
|
}), [e, t]);
|
|
261
266
|
}
|
|
@@ -265,14 +270,14 @@ const xo = () => {
|
|
|
265
270
|
}, Ao = ({ error: e }) => /* @__PURE__ */ w("div", { children: [
|
|
266
271
|
/* @__PURE__ */ i("h1", { children: "Ops..." }),
|
|
267
272
|
/* @__PURE__ */ i("p", { children: "Something went wrong" }),
|
|
268
|
-
|
|
273
|
+
T().hasDebugModeEnabled() && e && /* @__PURE__ */ i(B, { children: /* @__PURE__ */ w("pre", { style: { whiteSpace: "pre-wrap" }, children: [
|
|
269
274
|
e.message,
|
|
270
275
|
/* @__PURE__ */ i("br", {}),
|
|
271
276
|
e.stack
|
|
272
277
|
] }) })
|
|
273
278
|
] });
|
|
274
279
|
function z(e, t) {
|
|
275
|
-
const { layout: n } =
|
|
280
|
+
const { layout: n } = kn(X);
|
|
276
281
|
return oo(() => J.get(n, e, t), [n, e, t]);
|
|
277
282
|
}
|
|
278
283
|
const Co = Z("div")(({ theme: e }) => ({
|
|
@@ -284,7 +289,7 @@ const Co = Z("div")(({ theme: e }) => ({
|
|
|
284
289
|
DesktopPageTitle: r,
|
|
285
290
|
["Layout.AppBar"]: o,
|
|
286
291
|
["Layout.Drawer"]: s
|
|
287
|
-
} =
|
|
292
|
+
} = T("cms").getComponents(), a = z("appBar.height"), {
|
|
288
293
|
AppBar: l,
|
|
289
294
|
Drawer: d,
|
|
290
295
|
main: c
|
|
@@ -316,23 +321,23 @@ const Co = Z("div")(({ theme: e }) => ({
|
|
|
316
321
|
)
|
|
317
322
|
] });
|
|
318
323
|
};
|
|
319
|
-
function
|
|
320
|
-
const { setShowSearch: e } =
|
|
321
|
-
|
|
324
|
+
function ko() {
|
|
325
|
+
const { setShowSearch: e } = m.useContext(X);
|
|
326
|
+
m.useEffect(() => (e(!0), () => {
|
|
322
327
|
e(!1);
|
|
323
328
|
}), [e]);
|
|
324
329
|
}
|
|
325
330
|
function te() {
|
|
326
|
-
const { Model: e } =
|
|
331
|
+
const { Model: e } = m.useContext(Nn);
|
|
327
332
|
return e;
|
|
328
333
|
}
|
|
329
|
-
const
|
|
334
|
+
const To = () => {
|
|
330
335
|
const e = te(), {
|
|
331
336
|
data: t,
|
|
332
337
|
error: n,
|
|
333
338
|
loading: r
|
|
334
339
|
} = xe();
|
|
335
|
-
Bt(e.plural()),
|
|
340
|
+
Bt(e.plural()), ko();
|
|
336
341
|
const o = v(), {
|
|
337
342
|
Breadcrumbs: s,
|
|
338
343
|
["ModelIndex.Pagination"]: a,
|
|
@@ -340,11 +345,11 @@ const ko = () => {
|
|
|
340
345
|
["ModelIndex.Table"]: d,
|
|
341
346
|
["ModelIndex.Table.TableBody"]: c,
|
|
342
347
|
["ModelIndex.Table.TableHead"]: u,
|
|
343
|
-
["ModelIndex.Table.TableFooter"]:
|
|
348
|
+
["ModelIndex.Table.TableFooter"]: h,
|
|
344
349
|
["ModelIndex.Table.TableToolbar"]: y,
|
|
345
350
|
["ModelIndex.Table.TableBody.TableRow"]: S,
|
|
346
351
|
["ModelIndex.Tabs"]: b
|
|
347
|
-
} =
|
|
352
|
+
} = T("cms").getComponents();
|
|
348
353
|
return /* @__PURE__ */ i(H, { sx: { p: { xs: 1, sm: 2, md: 3 } }, children: /* @__PURE__ */ w(Q, { container: !0, spacing: 2, children: [
|
|
349
354
|
/* @__PURE__ */ w(
|
|
350
355
|
Q,
|
|
@@ -376,16 +381,16 @@ const ko = () => {
|
|
|
376
381
|
error: n,
|
|
377
382
|
children: [
|
|
378
383
|
/* @__PURE__ */ i(u, { children: /* @__PURE__ */ i(y, {}) }),
|
|
379
|
-
/* @__PURE__ */ i(c, { children: (
|
|
380
|
-
/* @__PURE__ */ i(
|
|
384
|
+
/* @__PURE__ */ i(c, { children: (p) => /* @__PURE__ */ i(S, { item: p }, p.getKey()) }),
|
|
385
|
+
/* @__PURE__ */ i(h, {})
|
|
381
386
|
]
|
|
382
387
|
}
|
|
383
388
|
) })
|
|
384
389
|
] }) });
|
|
385
390
|
};
|
|
386
391
|
function Do() {
|
|
387
|
-
const { setShowBackButton: e } =
|
|
388
|
-
|
|
392
|
+
const { setShowBackButton: e } = m.useContext(X);
|
|
393
|
+
m.useEffect(() => (e(!0), () => {
|
|
389
394
|
e(!1);
|
|
390
395
|
}), [e]);
|
|
391
396
|
}
|
|
@@ -406,7 +411,7 @@ function Po(e) {
|
|
|
406
411
|
let t;
|
|
407
412
|
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && qn(e.buffer), t;
|
|
408
413
|
}
|
|
409
|
-
const vo = _e("string"), _ = _e("function"), _n = _e("number"), He = (e) => e !== null && typeof e == "object", Fo = (e) => e === !0 || e === !1,
|
|
414
|
+
const vo = _e("string"), _ = _e("function"), _n = _e("number"), He = (e) => e !== null && typeof e == "object", Fo = (e) => e === !0 || e === !1, Te = (e) => {
|
|
410
415
|
if (qe(e) !== "object")
|
|
411
416
|
return !1;
|
|
412
417
|
const t = It(e);
|
|
@@ -443,7 +448,7 @@ const ie = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typ
|
|
|
443
448
|
function ft() {
|
|
444
449
|
const { caseless: e } = zn(this) && this || {}, t = {}, n = (r, o) => {
|
|
445
450
|
const s = e && Hn(t, o) || o;
|
|
446
|
-
|
|
451
|
+
Te(t[s]) && Te(r) ? t[s] = ft(t[s], r) : Te(r) ? t[s] = ft({}, r) : pe(r) ? t[s] = r.slice() : t[s] = r;
|
|
447
452
|
};
|
|
448
453
|
for (let r = 0, o = arguments.length; r < o; r++)
|
|
449
454
|
arguments[r] && Ae(arguments[r], n);
|
|
@@ -563,7 +568,7 @@ const cs = (e) => {
|
|
|
563
568
|
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
|
|
564
569
|
typeof setImmediate == "function",
|
|
565
570
|
_(ie.postMessage)
|
|
566
|
-
), fs = typeof queueMicrotask < "u" ? queueMicrotask.bind(ie) : typeof process < "u" && process.nextTick || $n,
|
|
571
|
+
), fs = typeof queueMicrotask < "u" ? queueMicrotask.bind(ie) : typeof process < "u" && process.nextTick || $n, f = {
|
|
567
572
|
isArray: pe,
|
|
568
573
|
isArrayBuffer: qn,
|
|
569
574
|
isBuffer: Ro,
|
|
@@ -573,7 +578,7 @@ const cs = (e) => {
|
|
|
573
578
|
isNumber: _n,
|
|
574
579
|
isBoolean: Fo,
|
|
575
580
|
isObject: He,
|
|
576
|
-
isPlainObject:
|
|
581
|
+
isPlainObject: Te,
|
|
577
582
|
isReadableStream: qo,
|
|
578
583
|
isRequest: _o,
|
|
579
584
|
isResponse: Ho,
|
|
@@ -626,7 +631,7 @@ const cs = (e) => {
|
|
|
626
631
|
function C(e, t, n, r, o) {
|
|
627
632
|
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), n && (this.config = n), r && (this.request = r), o && (this.response = o, this.status = o.status ? o.status : null);
|
|
628
633
|
}
|
|
629
|
-
|
|
634
|
+
f.inherits(C, Error, {
|
|
630
635
|
toJSON: function() {
|
|
631
636
|
return {
|
|
632
637
|
// Standard
|
|
@@ -641,7 +646,7 @@ h.inherits(C, Error, {
|
|
|
641
646
|
columnNumber: this.columnNumber,
|
|
642
647
|
stack: this.stack,
|
|
643
648
|
// Axios
|
|
644
|
-
config:
|
|
649
|
+
config: f.toJSONObject(this.config),
|
|
645
650
|
code: this.code,
|
|
646
651
|
status: this.status
|
|
647
652
|
};
|
|
@@ -669,16 +674,16 @@ Object.defineProperties(C, Yn);
|
|
|
669
674
|
Object.defineProperty(Kn, "isAxiosError", { value: !0 });
|
|
670
675
|
C.from = (e, t, n, r, o, s) => {
|
|
671
676
|
const a = Object.create(Kn);
|
|
672
|
-
return
|
|
677
|
+
return f.toFlatObject(e, a, function(d) {
|
|
673
678
|
return d !== Error.prototype;
|
|
674
679
|
}, (l) => l !== "isAxiosError"), C.call(a, e.message, t, n, r, o), a.cause = e, a.name = e.name, s && Object.assign(a, s), a;
|
|
675
680
|
};
|
|
676
681
|
const hs = null;
|
|
677
682
|
function ht(e) {
|
|
678
|
-
return
|
|
683
|
+
return f.isPlainObject(e) || f.isArray(e);
|
|
679
684
|
}
|
|
680
685
|
function Jn(e) {
|
|
681
|
-
return
|
|
686
|
+
return f.endsWith(e, "[]") ? e.slice(0, -2) : e;
|
|
682
687
|
}
|
|
683
688
|
function Xt(e, t, n) {
|
|
684
689
|
return e ? e.concat(t).map(function(o, s) {
|
|
@@ -686,69 +691,69 @@ function Xt(e, t, n) {
|
|
|
686
691
|
}).join(n ? "." : "") : t;
|
|
687
692
|
}
|
|
688
693
|
function ps(e) {
|
|
689
|
-
return
|
|
694
|
+
return f.isArray(e) && !e.some(ht);
|
|
690
695
|
}
|
|
691
|
-
const ms =
|
|
696
|
+
const ms = f.toFlatObject(f, {}, null, function(t) {
|
|
692
697
|
return /^is[A-Z]/.test(t);
|
|
693
698
|
});
|
|
694
699
|
function ze(e, t, n) {
|
|
695
|
-
if (!
|
|
700
|
+
if (!f.isObject(e))
|
|
696
701
|
throw new TypeError("target must be an object");
|
|
697
|
-
t = t || new FormData(), n =
|
|
702
|
+
t = t || new FormData(), n = f.toFlatObject(n, {
|
|
698
703
|
metaTokens: !0,
|
|
699
704
|
dots: !1,
|
|
700
705
|
indexes: !1
|
|
701
|
-
}, !1, function(
|
|
702
|
-
return !
|
|
706
|
+
}, !1, function(p, g) {
|
|
707
|
+
return !f.isUndefined(g[p]);
|
|
703
708
|
});
|
|
704
|
-
const r = n.metaTokens, o = n.visitor || u, s = n.dots, a = n.indexes, d = (n.Blob || typeof Blob < "u" && Blob) &&
|
|
705
|
-
if (!
|
|
709
|
+
const r = n.metaTokens, o = n.visitor || u, s = n.dots, a = n.indexes, d = (n.Blob || typeof Blob < "u" && Blob) && f.isSpecCompliantForm(t);
|
|
710
|
+
if (!f.isFunction(o))
|
|
706
711
|
throw new TypeError("visitor must be a function");
|
|
707
712
|
function c(b) {
|
|
708
713
|
if (b === null) return "";
|
|
709
|
-
if (
|
|
714
|
+
if (f.isDate(b))
|
|
710
715
|
return b.toISOString();
|
|
711
|
-
if (!d &&
|
|
716
|
+
if (!d && f.isBlob(b))
|
|
712
717
|
throw new C("Blob is not supported. Use a Buffer instead.");
|
|
713
|
-
return
|
|
718
|
+
return f.isArrayBuffer(b) || f.isTypedArray(b) ? d && typeof Blob == "function" ? new Blob([b]) : Buffer.from(b) : b;
|
|
714
719
|
}
|
|
715
|
-
function u(b,
|
|
720
|
+
function u(b, p, g) {
|
|
716
721
|
let A = b;
|
|
717
722
|
if (b && !g && typeof b == "object") {
|
|
718
|
-
if (
|
|
719
|
-
|
|
720
|
-
else if (
|
|
721
|
-
return
|
|
722
|
-
!(
|
|
723
|
+
if (f.endsWith(p, "{}"))
|
|
724
|
+
p = r ? p : p.slice(0, -2), b = JSON.stringify(b);
|
|
725
|
+
else if (f.isArray(b) && ps(b) || (f.isFileList(b) || f.endsWith(p, "[]")) && (A = f.toArray(b)))
|
|
726
|
+
return p = Jn(p), A.forEach(function(E, P) {
|
|
727
|
+
!(f.isUndefined(E) || E === null) && t.append(
|
|
723
728
|
// eslint-disable-next-line no-nested-ternary
|
|
724
|
-
a === !0 ? Xt([
|
|
729
|
+
a === !0 ? Xt([p], P, s) : a === null ? p : p + "[]",
|
|
725
730
|
c(E)
|
|
726
731
|
);
|
|
727
732
|
}), !1;
|
|
728
733
|
}
|
|
729
|
-
return ht(b) ? !0 : (t.append(Xt(g,
|
|
734
|
+
return ht(b) ? !0 : (t.append(Xt(g, p, s), c(b)), !1);
|
|
730
735
|
}
|
|
731
|
-
const
|
|
736
|
+
const h = [], y = Object.assign(ms, {
|
|
732
737
|
defaultVisitor: u,
|
|
733
738
|
convertValue: c,
|
|
734
739
|
isVisitable: ht
|
|
735
740
|
});
|
|
736
|
-
function S(b,
|
|
737
|
-
if (!
|
|
738
|
-
if (
|
|
739
|
-
throw Error("Circular reference detected in " +
|
|
740
|
-
|
|
741
|
-
(!(
|
|
741
|
+
function S(b, p) {
|
|
742
|
+
if (!f.isUndefined(b)) {
|
|
743
|
+
if (h.indexOf(b) !== -1)
|
|
744
|
+
throw Error("Circular reference detected in " + p.join("."));
|
|
745
|
+
h.push(b), f.forEach(b, function(A, x) {
|
|
746
|
+
(!(f.isUndefined(A) || A === null) && o.call(
|
|
742
747
|
t,
|
|
743
748
|
A,
|
|
744
|
-
|
|
745
|
-
|
|
749
|
+
f.isString(x) ? x.trim() : x,
|
|
750
|
+
p,
|
|
746
751
|
y
|
|
747
|
-
)) === !0 && S(A,
|
|
748
|
-
}),
|
|
752
|
+
)) === !0 && S(A, p ? p.concat(x) : [x]);
|
|
753
|
+
}), h.pop();
|
|
749
754
|
}
|
|
750
755
|
}
|
|
751
|
-
if (!
|
|
756
|
+
if (!f.isObject(e))
|
|
752
757
|
throw new TypeError("data must be an object");
|
|
753
758
|
return S(e), t;
|
|
754
759
|
}
|
|
@@ -789,7 +794,7 @@ function Zn(e, t, n) {
|
|
|
789
794
|
return e;
|
|
790
795
|
const r = n && n.encode || gs, o = n && n.serialize;
|
|
791
796
|
let s;
|
|
792
|
-
if (o ? s = o(t, n) : s =
|
|
797
|
+
if (o ? s = o(t, n) : s = f.isURLSearchParams(t) ? t.toString() : new Mt(t, n).toString(r), s) {
|
|
793
798
|
const a = e.indexOf("#");
|
|
794
799
|
a !== -1 && (e = e.slice(0, a)), e += (e.indexOf("?") === -1 ? "?" : "&") + s;
|
|
795
800
|
}
|
|
@@ -844,7 +849,7 @@ class en {
|
|
|
844
849
|
* @returns {void}
|
|
845
850
|
*/
|
|
846
851
|
forEach(t) {
|
|
847
|
-
|
|
852
|
+
f.forEach(this.handlers, function(r) {
|
|
848
853
|
r !== null && t(r);
|
|
849
854
|
});
|
|
850
855
|
}
|
|
@@ -873,15 +878,15 @@ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Cs
|
|
|
873
878
|
...Es,
|
|
874
879
|
...Ss
|
|
875
880
|
};
|
|
876
|
-
function
|
|
881
|
+
function ks(e, t) {
|
|
877
882
|
return ze(e, new j.classes.URLSearchParams(), Object.assign({
|
|
878
883
|
visitor: function(n, r, o, s) {
|
|
879
|
-
return j.isNode &&
|
|
884
|
+
return j.isNode && f.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
|
|
880
885
|
}
|
|
881
886
|
}, t));
|
|
882
887
|
}
|
|
883
|
-
function
|
|
884
|
-
return
|
|
888
|
+
function Ts(e) {
|
|
889
|
+
return f.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
|
|
885
890
|
}
|
|
886
891
|
function Ds(e) {
|
|
887
892
|
const t = {}, n = Object.keys(e);
|
|
@@ -897,20 +902,20 @@ function Qn(e) {
|
|
|
897
902
|
let a = n[s++];
|
|
898
903
|
if (a === "__proto__") return !0;
|
|
899
904
|
const l = Number.isFinite(+a), d = s >= n.length;
|
|
900
|
-
return a = !a &&
|
|
905
|
+
return a = !a && f.isArray(o) ? o.length : a, d ? (f.hasOwnProp(o, a) ? o[a] = [o[a], r] : o[a] = r, !l) : ((!o[a] || !f.isObject(o[a])) && (o[a] = []), t(n, r, o[a], s) && f.isArray(o[a]) && (o[a] = Ds(o[a])), !l);
|
|
901
906
|
}
|
|
902
|
-
if (
|
|
907
|
+
if (f.isFormData(e) && f.isFunction(e.entries)) {
|
|
903
908
|
const n = {};
|
|
904
|
-
return
|
|
905
|
-
t(
|
|
909
|
+
return f.forEachEntry(e, (r, o) => {
|
|
910
|
+
t(Ts(r), o, n, 0);
|
|
906
911
|
}), n;
|
|
907
912
|
}
|
|
908
913
|
return null;
|
|
909
914
|
}
|
|
910
915
|
function Os(e, t, n) {
|
|
911
|
-
if (
|
|
916
|
+
if (f.isString(e))
|
|
912
917
|
try {
|
|
913
|
-
return (t || JSON.parse)(e),
|
|
918
|
+
return (t || JSON.parse)(e), f.trim(e);
|
|
914
919
|
} catch (r) {
|
|
915
920
|
if (r.name !== "SyntaxError")
|
|
916
921
|
throw r;
|
|
@@ -921,20 +926,20 @@ const Ce = {
|
|
|
921
926
|
transitional: Xn,
|
|
922
927
|
adapter: ["xhr", "http", "fetch"],
|
|
923
928
|
transformRequest: [function(t, n) {
|
|
924
|
-
const r = n.getContentType() || "", o = r.indexOf("application/json") > -1, s =
|
|
925
|
-
if (s &&
|
|
929
|
+
const r = n.getContentType() || "", o = r.indexOf("application/json") > -1, s = f.isObject(t);
|
|
930
|
+
if (s && f.isHTMLForm(t) && (t = new FormData(t)), f.isFormData(t))
|
|
926
931
|
return o ? JSON.stringify(Qn(t)) : t;
|
|
927
|
-
if (
|
|
932
|
+
if (f.isArrayBuffer(t) || f.isBuffer(t) || f.isStream(t) || f.isFile(t) || f.isBlob(t) || f.isReadableStream(t))
|
|
928
933
|
return t;
|
|
929
|
-
if (
|
|
934
|
+
if (f.isArrayBufferView(t))
|
|
930
935
|
return t.buffer;
|
|
931
|
-
if (
|
|
936
|
+
if (f.isURLSearchParams(t))
|
|
932
937
|
return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
|
|
933
938
|
let l;
|
|
934
939
|
if (s) {
|
|
935
940
|
if (r.indexOf("application/x-www-form-urlencoded") > -1)
|
|
936
|
-
return
|
|
937
|
-
if ((l =
|
|
941
|
+
return ks(t, this.formSerializer).toString();
|
|
942
|
+
if ((l = f.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
|
|
938
943
|
const d = this.env && this.env.FormData;
|
|
939
944
|
return ze(
|
|
940
945
|
l ? { "files[]": t } : t,
|
|
@@ -947,9 +952,9 @@ const Ce = {
|
|
|
947
952
|
}],
|
|
948
953
|
transformResponse: [function(t) {
|
|
949
954
|
const n = this.transitional || Ce.transitional, r = n && n.forcedJSONParsing, o = this.responseType === "json";
|
|
950
|
-
if (
|
|
955
|
+
if (f.isResponse(t) || f.isReadableStream(t))
|
|
951
956
|
return t;
|
|
952
|
-
if (t &&
|
|
957
|
+
if (t && f.isString(t) && (r && !this.responseType || o)) {
|
|
953
958
|
const a = !(n && n.silentJSONParsing) && o;
|
|
954
959
|
try {
|
|
955
960
|
return JSON.parse(t);
|
|
@@ -983,10 +988,10 @@ const Ce = {
|
|
|
983
988
|
}
|
|
984
989
|
}
|
|
985
990
|
};
|
|
986
|
-
|
|
991
|
+
f.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
|
|
987
992
|
Ce.headers[e] = {};
|
|
988
993
|
});
|
|
989
|
-
const Rs =
|
|
994
|
+
const Rs = f.toObjectSet([
|
|
990
995
|
"age",
|
|
991
996
|
"authorization",
|
|
992
997
|
"content-length",
|
|
@@ -1016,7 +1021,7 @@ function be(e) {
|
|
|
1016
1021
|
return e && String(e).trim().toLowerCase();
|
|
1017
1022
|
}
|
|
1018
1023
|
function De(e) {
|
|
1019
|
-
return e === !1 || e == null ? e :
|
|
1024
|
+
return e === !1 || e == null ? e : f.isArray(e) ? e.map(De) : String(e);
|
|
1020
1025
|
}
|
|
1021
1026
|
function vs(e) {
|
|
1022
1027
|
const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
@@ -1027,12 +1032,12 @@ function vs(e) {
|
|
|
1027
1032
|
}
|
|
1028
1033
|
const Fs = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
|
|
1029
1034
|
function Xe(e, t, n, r, o) {
|
|
1030
|
-
if (
|
|
1035
|
+
if (f.isFunction(r))
|
|
1031
1036
|
return r.call(this, t, n);
|
|
1032
|
-
if (o && (t = n), !!
|
|
1033
|
-
if (
|
|
1037
|
+
if (o && (t = n), !!f.isString(t)) {
|
|
1038
|
+
if (f.isString(r))
|
|
1034
1039
|
return t.indexOf(r) !== -1;
|
|
1035
|
-
if (
|
|
1040
|
+
if (f.isRegExp(r))
|
|
1036
1041
|
return r.test(t);
|
|
1037
1042
|
}
|
|
1038
1043
|
}
|
|
@@ -1040,7 +1045,7 @@ function Ls(e) {
|
|
|
1040
1045
|
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
|
|
1041
1046
|
}
|
|
1042
1047
|
function Bs(e, t) {
|
|
1043
|
-
const n =
|
|
1048
|
+
const n = f.toCamelCase(" " + t);
|
|
1044
1049
|
["get", "set", "has"].forEach((r) => {
|
|
1045
1050
|
Object.defineProperty(e, r + n, {
|
|
1046
1051
|
value: function(o, s, a) {
|
|
@@ -1060,15 +1065,15 @@ let U = class {
|
|
|
1060
1065
|
const u = be(d);
|
|
1061
1066
|
if (!u)
|
|
1062
1067
|
throw new Error("header name must be a non-empty string");
|
|
1063
|
-
const
|
|
1064
|
-
(!
|
|
1068
|
+
const h = f.findKey(o, u);
|
|
1069
|
+
(!h || o[h] === void 0 || c === !0 || c === void 0 && o[h] !== !1) && (o[h || d] = De(l));
|
|
1065
1070
|
}
|
|
1066
|
-
const a = (l, d) =>
|
|
1067
|
-
if (
|
|
1071
|
+
const a = (l, d) => f.forEach(l, (c, u) => s(c, u, d));
|
|
1072
|
+
if (f.isPlainObject(t) || t instanceof this.constructor)
|
|
1068
1073
|
a(t, n);
|
|
1069
|
-
else if (
|
|
1074
|
+
else if (f.isString(t) && (t = t.trim()) && !Fs(t))
|
|
1070
1075
|
a(Ps(t), n);
|
|
1071
|
-
else if (
|
|
1076
|
+
else if (f.isHeaders(t))
|
|
1072
1077
|
for (const [l, d] of t.entries())
|
|
1073
1078
|
s(d, l, r);
|
|
1074
1079
|
else
|
|
@@ -1077,16 +1082,16 @@ let U = class {
|
|
|
1077
1082
|
}
|
|
1078
1083
|
get(t, n) {
|
|
1079
1084
|
if (t = be(t), t) {
|
|
1080
|
-
const r =
|
|
1085
|
+
const r = f.findKey(this, t);
|
|
1081
1086
|
if (r) {
|
|
1082
1087
|
const o = this[r];
|
|
1083
1088
|
if (!n)
|
|
1084
1089
|
return o;
|
|
1085
1090
|
if (n === !0)
|
|
1086
1091
|
return vs(o);
|
|
1087
|
-
if (
|
|
1092
|
+
if (f.isFunction(n))
|
|
1088
1093
|
return n.call(this, o, r);
|
|
1089
|
-
if (
|
|
1094
|
+
if (f.isRegExp(n))
|
|
1090
1095
|
return n.exec(o);
|
|
1091
1096
|
throw new TypeError("parser must be boolean|regexp|function");
|
|
1092
1097
|
}
|
|
@@ -1094,7 +1099,7 @@ let U = class {
|
|
|
1094
1099
|
}
|
|
1095
1100
|
has(t, n) {
|
|
1096
1101
|
if (t = be(t), t) {
|
|
1097
|
-
const r =
|
|
1102
|
+
const r = f.findKey(this, t);
|
|
1098
1103
|
return !!(r && this[r] !== void 0 && (!n || Xe(this, this[r], r, n)));
|
|
1099
1104
|
}
|
|
1100
1105
|
return !1;
|
|
@@ -1104,11 +1109,11 @@ let U = class {
|
|
|
1104
1109
|
let o = !1;
|
|
1105
1110
|
function s(a) {
|
|
1106
1111
|
if (a = be(a), a) {
|
|
1107
|
-
const l =
|
|
1112
|
+
const l = f.findKey(r, a);
|
|
1108
1113
|
l && (!n || Xe(r, r[l], l, n)) && (delete r[l], o = !0);
|
|
1109
1114
|
}
|
|
1110
1115
|
}
|
|
1111
|
-
return
|
|
1116
|
+
return f.isArray(t) ? t.forEach(s) : s(t), o;
|
|
1112
1117
|
}
|
|
1113
1118
|
clear(t) {
|
|
1114
1119
|
const n = Object.keys(this);
|
|
@@ -1121,8 +1126,8 @@ let U = class {
|
|
|
1121
1126
|
}
|
|
1122
1127
|
normalize(t) {
|
|
1123
1128
|
const n = this, r = {};
|
|
1124
|
-
return
|
|
1125
|
-
const a =
|
|
1129
|
+
return f.forEach(this, (o, s) => {
|
|
1130
|
+
const a = f.findKey(r, s);
|
|
1126
1131
|
if (a) {
|
|
1127
1132
|
n[a] = De(o), delete n[s];
|
|
1128
1133
|
return;
|
|
@@ -1136,8 +1141,8 @@ let U = class {
|
|
|
1136
1141
|
}
|
|
1137
1142
|
toJSON(t) {
|
|
1138
1143
|
const n = /* @__PURE__ */ Object.create(null);
|
|
1139
|
-
return
|
|
1140
|
-
r != null && r !== !1 && (n[o] = t &&
|
|
1144
|
+
return f.forEach(this, (r, o) => {
|
|
1145
|
+
r != null && r !== !1 && (n[o] = t && f.isArray(r) ? r.join(", ") : r);
|
|
1141
1146
|
}), n;
|
|
1142
1147
|
}
|
|
1143
1148
|
[Symbol.iterator]() {
|
|
@@ -1165,11 +1170,11 @@ let U = class {
|
|
|
1165
1170
|
const l = be(a);
|
|
1166
1171
|
r[l] || (Bs(o, a), r[l] = !0);
|
|
1167
1172
|
}
|
|
1168
|
-
return
|
|
1173
|
+
return f.isArray(t) ? t.forEach(s) : s(t), this;
|
|
1169
1174
|
}
|
|
1170
1175
|
};
|
|
1171
1176
|
U.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
1172
|
-
|
|
1177
|
+
f.reduceDescriptors(U.prototype, ({ value: e }, t) => {
|
|
1173
1178
|
let n = t[0].toUpperCase() + t.slice(1);
|
|
1174
1179
|
return {
|
|
1175
1180
|
get: () => e,
|
|
@@ -1178,11 +1183,11 @@ h.reduceDescriptors(U.prototype, ({ value: e }, t) => {
|
|
|
1178
1183
|
}
|
|
1179
1184
|
};
|
|
1180
1185
|
});
|
|
1181
|
-
|
|
1186
|
+
f.freezeMethods(U);
|
|
1182
1187
|
function Qe(e, t) {
|
|
1183
1188
|
const n = this || Ce, r = t || n, o = U.from(r.headers);
|
|
1184
1189
|
let s = r.data;
|
|
1185
|
-
return
|
|
1190
|
+
return f.forEach(e, function(l) {
|
|
1186
1191
|
s = l.call(n, s, o.normalize(), t ? t.status : void 0);
|
|
1187
1192
|
}), o.normalize(), s;
|
|
1188
1193
|
}
|
|
@@ -1192,7 +1197,7 @@ function er(e) {
|
|
|
1192
1197
|
function me(e, t, n) {
|
|
1193
1198
|
C.call(this, e ?? "canceled", C.ERR_CANCELED, t, n), this.name = "CanceledError";
|
|
1194
1199
|
}
|
|
1195
|
-
|
|
1200
|
+
f.inherits(me, C, {
|
|
1196
1201
|
__CANCEL__: !0
|
|
1197
1202
|
});
|
|
1198
1203
|
function tr(e, t, n) {
|
|
@@ -1216,9 +1221,9 @@ function Ms(e, t) {
|
|
|
1216
1221
|
return t = t !== void 0 ? t : 1e3, function(d) {
|
|
1217
1222
|
const c = Date.now(), u = r[s];
|
|
1218
1223
|
a || (a = c), n[o] = d, r[o] = c;
|
|
1219
|
-
let
|
|
1220
|
-
for (;
|
|
1221
|
-
y += n[
|
|
1224
|
+
let h = s, y = 0;
|
|
1225
|
+
for (; h !== o; )
|
|
1226
|
+
y += n[h++], h = h % e;
|
|
1222
1227
|
if (o = (o + 1) % e, o === s && (s = (s + 1) % e), c - a < t)
|
|
1223
1228
|
return;
|
|
1224
1229
|
const S = u && c - u;
|
|
@@ -1231,10 +1236,10 @@ function Ns(e, t) {
|
|
|
1231
1236
|
n = u, o = null, s && (clearTimeout(s), s = null), e.apply(null, c);
|
|
1232
1237
|
};
|
|
1233
1238
|
return [(...c) => {
|
|
1234
|
-
const u = Date.now(),
|
|
1235
|
-
|
|
1239
|
+
const u = Date.now(), h = u - n;
|
|
1240
|
+
h >= r ? a(c, u) : (o = c, s || (s = setTimeout(() => {
|
|
1236
1241
|
s = null, a(o);
|
|
1237
|
-
}, r -
|
|
1242
|
+
}, r - h)));
|
|
1238
1243
|
}, () => o && a(o)];
|
|
1239
1244
|
}
|
|
1240
1245
|
const Le = (e, t, n = 3) => {
|
|
@@ -1243,7 +1248,7 @@ const Le = (e, t, n = 3) => {
|
|
|
1243
1248
|
return Ns((s) => {
|
|
1244
1249
|
const a = s.loaded, l = s.lengthComputable ? s.total : void 0, d = a - r, c = o(d), u = a <= l;
|
|
1245
1250
|
r = a;
|
|
1246
|
-
const
|
|
1251
|
+
const h = {
|
|
1247
1252
|
loaded: a,
|
|
1248
1253
|
total: l,
|
|
1249
1254
|
progress: l ? a / l : void 0,
|
|
@@ -1254,7 +1259,7 @@ const Le = (e, t, n = 3) => {
|
|
|
1254
1259
|
lengthComputable: l != null,
|
|
1255
1260
|
[t ? "download" : "upload"]: !0
|
|
1256
1261
|
};
|
|
1257
|
-
e(
|
|
1262
|
+
e(h);
|
|
1258
1263
|
}, n);
|
|
1259
1264
|
}, nn = (e, t) => {
|
|
1260
1265
|
const n = e != null;
|
|
@@ -1263,7 +1268,7 @@ const Le = (e, t, n = 3) => {
|
|
|
1263
1268
|
total: e,
|
|
1264
1269
|
loaded: r
|
|
1265
1270
|
}), t[1]];
|
|
1266
|
-
}, rn = (e) => (...t) =>
|
|
1271
|
+
}, rn = (e) => (...t) => f.asap(() => e(...t)), js = j.hasStandardBrowserEnv ? (
|
|
1267
1272
|
// Standard browser envs have full support of the APIs needed to test
|
|
1268
1273
|
// whether the request URL is of the same origin as current location.
|
|
1269
1274
|
function() {
|
|
@@ -1283,7 +1288,7 @@ const Le = (e, t, n = 3) => {
|
|
|
1283
1288
|
};
|
|
1284
1289
|
}
|
|
1285
1290
|
return r = o(window.location.href), function(a) {
|
|
1286
|
-
const l =
|
|
1291
|
+
const l = f.isString(a) ? o(a) : a;
|
|
1287
1292
|
return l.protocol === r.protocol && l.host === r.host;
|
|
1288
1293
|
};
|
|
1289
1294
|
}()
|
|
@@ -1299,7 +1304,7 @@ const Le = (e, t, n = 3) => {
|
|
|
1299
1304
|
{
|
|
1300
1305
|
write(e, t, n, r, o, s) {
|
|
1301
1306
|
const a = [e + "=" + encodeURIComponent(t)];
|
|
1302
|
-
|
|
1307
|
+
f.isNumber(n) && a.push("expires=" + new Date(n).toGMTString()), f.isString(r) && a.push("path=" + r), f.isString(o) && a.push("domain=" + o), s === !0 && a.push("secure"), document.cookie = a.join("; ");
|
|
1303
1308
|
},
|
|
1304
1309
|
read(e) {
|
|
1305
1310
|
const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
|
|
@@ -1334,29 +1339,29 @@ const on = (e) => e instanceof U ? { ...e } : e;
|
|
|
1334
1339
|
function ue(e, t) {
|
|
1335
1340
|
t = t || {};
|
|
1336
1341
|
const n = {};
|
|
1337
|
-
function r(c, u,
|
|
1338
|
-
return
|
|
1342
|
+
function r(c, u, h) {
|
|
1343
|
+
return f.isPlainObject(c) && f.isPlainObject(u) ? f.merge.call({ caseless: h }, c, u) : f.isPlainObject(u) ? f.merge({}, u) : f.isArray(u) ? u.slice() : u;
|
|
1339
1344
|
}
|
|
1340
|
-
function o(c, u,
|
|
1341
|
-
if (
|
|
1342
|
-
if (!
|
|
1343
|
-
return r(void 0, c,
|
|
1344
|
-
} else return r(c, u,
|
|
1345
|
+
function o(c, u, h) {
|
|
1346
|
+
if (f.isUndefined(u)) {
|
|
1347
|
+
if (!f.isUndefined(c))
|
|
1348
|
+
return r(void 0, c, h);
|
|
1349
|
+
} else return r(c, u, h);
|
|
1345
1350
|
}
|
|
1346
1351
|
function s(c, u) {
|
|
1347
|
-
if (!
|
|
1352
|
+
if (!f.isUndefined(u))
|
|
1348
1353
|
return r(void 0, u);
|
|
1349
1354
|
}
|
|
1350
1355
|
function a(c, u) {
|
|
1351
|
-
if (
|
|
1352
|
-
if (!
|
|
1356
|
+
if (f.isUndefined(u)) {
|
|
1357
|
+
if (!f.isUndefined(c))
|
|
1353
1358
|
return r(void 0, c);
|
|
1354
1359
|
} else return r(void 0, u);
|
|
1355
1360
|
}
|
|
1356
|
-
function l(c, u,
|
|
1357
|
-
if (
|
|
1361
|
+
function l(c, u, h) {
|
|
1362
|
+
if (h in t)
|
|
1358
1363
|
return r(c, u);
|
|
1359
|
-
if (
|
|
1364
|
+
if (h in e)
|
|
1360
1365
|
return r(void 0, c);
|
|
1361
1366
|
}
|
|
1362
1367
|
const d = {
|
|
@@ -1390,9 +1395,9 @@ function ue(e, t) {
|
|
|
1390
1395
|
validateStatus: l,
|
|
1391
1396
|
headers: (c, u) => o(on(c), on(u), !0)
|
|
1392
1397
|
};
|
|
1393
|
-
return
|
|
1394
|
-
const
|
|
1395
|
-
|
|
1398
|
+
return f.forEach(Object.keys(Object.assign({}, e, t)), function(u) {
|
|
1399
|
+
const h = d[u] || o, y = h(e[u], t[u], u);
|
|
1400
|
+
f.isUndefined(y) && h !== l || (n[u] = y);
|
|
1396
1401
|
}), n;
|
|
1397
1402
|
}
|
|
1398
1403
|
const rr = (e) => {
|
|
@@ -1403,15 +1408,15 @@ const rr = (e) => {
|
|
|
1403
1408
|
"Basic " + btoa((l.username || "") + ":" + (l.password ? unescape(encodeURIComponent(l.password)) : ""))
|
|
1404
1409
|
);
|
|
1405
1410
|
let d;
|
|
1406
|
-
if (
|
|
1411
|
+
if (f.isFormData(n)) {
|
|
1407
1412
|
if (j.hasStandardBrowserEnv || j.hasStandardBrowserWebWorkerEnv)
|
|
1408
1413
|
a.setContentType(void 0);
|
|
1409
1414
|
else if ((d = a.getContentType()) !== !1) {
|
|
1410
|
-
const [c, ...u] = d ? d.split(";").map((
|
|
1415
|
+
const [c, ...u] = d ? d.split(";").map((h) => h.trim()).filter(Boolean) : [];
|
|
1411
1416
|
a.setContentType([c || "multipart/form-data", ...u].join("; "));
|
|
1412
1417
|
}
|
|
1413
1418
|
}
|
|
1414
|
-
if (j.hasStandardBrowserEnv && (r &&
|
|
1419
|
+
if (j.hasStandardBrowserEnv && (r && f.isFunction(r) && (r = r(t)), r || r !== !1 && js(t.url))) {
|
|
1415
1420
|
const c = o && s && Us.read(s);
|
|
1416
1421
|
c && a.set(o, c);
|
|
1417
1422
|
}
|
|
@@ -1421,8 +1426,8 @@ const rr = (e) => {
|
|
|
1421
1426
|
const o = rr(e);
|
|
1422
1427
|
let s = o.data;
|
|
1423
1428
|
const a = U.from(o.headers).normalize();
|
|
1424
|
-
let { responseType: l, onUploadProgress: d, onDownloadProgress: c } = o, u,
|
|
1425
|
-
function
|
|
1429
|
+
let { responseType: l, onUploadProgress: d, onDownloadProgress: c } = o, u, h, y, S, b;
|
|
1430
|
+
function p() {
|
|
1426
1431
|
S && S(), b && b(), o.cancelToken && o.cancelToken.unsubscribe(u), o.signal && o.signal.removeEventListener("abort", u);
|
|
1427
1432
|
}
|
|
1428
1433
|
let g = new XMLHttpRequest();
|
|
@@ -1441,9 +1446,9 @@ const rr = (e) => {
|
|
|
1441
1446
|
request: g
|
|
1442
1447
|
};
|
|
1443
1448
|
tr(function(D) {
|
|
1444
|
-
n(D),
|
|
1449
|
+
n(D), p();
|
|
1445
1450
|
}, function(D) {
|
|
1446
|
-
r(D),
|
|
1451
|
+
r(D), p();
|
|
1447
1452
|
}, O), g = null;
|
|
1448
1453
|
}
|
|
1449
1454
|
"onloadend" in g ? g.onloadend = A : g.onreadystatechange = function() {
|
|
@@ -1461,9 +1466,9 @@ const rr = (e) => {
|
|
|
1461
1466
|
e,
|
|
1462
1467
|
g
|
|
1463
1468
|
)), g = null;
|
|
1464
|
-
}, s === void 0 && a.setContentType(null), "setRequestHeader" in g &&
|
|
1469
|
+
}, s === void 0 && a.setContentType(null), "setRequestHeader" in g && f.forEach(a.toJSON(), function(P, O) {
|
|
1465
1470
|
g.setRequestHeader(O, P);
|
|
1466
|
-
}),
|
|
1471
|
+
}), f.isUndefined(o.withCredentials) || (g.withCredentials = !!o.withCredentials), l && l !== "json" && (g.responseType = o.responseType), c && ([y, b] = Le(c, !0), g.addEventListener("progress", y)), d && g.upload && ([h, S] = Le(d), g.upload.addEventListener("progress", h), g.upload.addEventListener("loadend", S)), (o.cancelToken || o.signal) && (u = (E) => {
|
|
1467
1472
|
g && (r(!E || E.type ? new me(null, e, g) : E), g.abort(), g = null);
|
|
1468
1473
|
}, o.cancelToken && o.cancelToken.subscribe(u), o.signal && (o.signal.aborted ? u() : o.signal.addEventListener("abort", u)));
|
|
1469
1474
|
const x = Is(o.url);
|
|
@@ -1494,7 +1499,7 @@ const rr = (e) => {
|
|
|
1494
1499
|
};
|
|
1495
1500
|
e.forEach((c) => c.addEventListener("abort", s));
|
|
1496
1501
|
const { signal: d } = r;
|
|
1497
|
-
return d.unsubscribe = () =>
|
|
1502
|
+
return d.unsubscribe = () => f.asap(l), d;
|
|
1498
1503
|
}
|
|
1499
1504
|
}, Ws = function* (e, t) {
|
|
1500
1505
|
let n = e.byteLength;
|
|
@@ -1537,9 +1542,9 @@ const rr = (e) => {
|
|
|
1537
1542
|
l(), d.close();
|
|
1538
1543
|
return;
|
|
1539
1544
|
}
|
|
1540
|
-
let
|
|
1545
|
+
let h = u.byteLength;
|
|
1541
1546
|
if (n) {
|
|
1542
|
-
let y = s +=
|
|
1547
|
+
let y = s += h;
|
|
1543
1548
|
n(y);
|
|
1544
1549
|
}
|
|
1545
1550
|
d.enqueue(new Uint8Array(u));
|
|
@@ -1569,12 +1574,12 @@ const rr = (e) => {
|
|
|
1569
1574
|
}
|
|
1570
1575
|
}).headers.has("Content-Type");
|
|
1571
1576
|
return e && !t;
|
|
1572
|
-
}), an = 64 * 1024, mt = or && sr(() =>
|
|
1577
|
+
}), an = 64 * 1024, mt = or && sr(() => f.isReadableStream(new Response("").body)), Be = {
|
|
1573
1578
|
stream: mt && ((e) => e.body)
|
|
1574
1579
|
};
|
|
1575
1580
|
Ve && ((e) => {
|
|
1576
1581
|
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((t) => {
|
|
1577
|
-
!Be[t] && (Be[t] =
|
|
1582
|
+
!Be[t] && (Be[t] = f.isFunction(e[t]) ? (n) => n[t]() : (n, r) => {
|
|
1578
1583
|
throw new C(`Response type '${t}' is not supported`, C.ERR_NOT_SUPPORT, r);
|
|
1579
1584
|
});
|
|
1580
1585
|
});
|
|
@@ -1582,19 +1587,19 @@ Ve && ((e) => {
|
|
|
1582
1587
|
const Gs = async (e) => {
|
|
1583
1588
|
if (e == null)
|
|
1584
1589
|
return 0;
|
|
1585
|
-
if (
|
|
1590
|
+
if (f.isBlob(e))
|
|
1586
1591
|
return e.size;
|
|
1587
|
-
if (
|
|
1592
|
+
if (f.isSpecCompliantForm(e))
|
|
1588
1593
|
return (await new Request(j.origin, {
|
|
1589
1594
|
method: "POST",
|
|
1590
1595
|
body: e
|
|
1591
1596
|
}).arrayBuffer()).byteLength;
|
|
1592
|
-
if (
|
|
1597
|
+
if (f.isArrayBufferView(e) || f.isArrayBuffer(e))
|
|
1593
1598
|
return e.byteLength;
|
|
1594
|
-
if (
|
|
1599
|
+
if (f.isURLSearchParams(e) && (e = e + ""), f.isString(e))
|
|
1595
1600
|
return (await Ys(e)).byteLength;
|
|
1596
1601
|
}, Zs = async (e, t) => {
|
|
1597
|
-
const n =
|
|
1602
|
+
const n = f.toFiniteNumber(e.getContentLength());
|
|
1598
1603
|
return n ?? Gs(t);
|
|
1599
1604
|
}, Xs = Ve && (async (e) => {
|
|
1600
1605
|
let {
|
|
@@ -1608,12 +1613,12 @@ const Gs = async (e) => {
|
|
|
1608
1613
|
onUploadProgress: d,
|
|
1609
1614
|
responseType: c,
|
|
1610
1615
|
headers: u,
|
|
1611
|
-
withCredentials:
|
|
1616
|
+
withCredentials: h = "same-origin",
|
|
1612
1617
|
fetchOptions: y
|
|
1613
1618
|
} = rr(e);
|
|
1614
1619
|
c = c ? (c + "").toLowerCase() : "text";
|
|
1615
1620
|
let S = Vs([o, s && s.toAbortSignal()], a), b;
|
|
1616
|
-
const
|
|
1621
|
+
const p = S && S.unsubscribe && (() => {
|
|
1617
1622
|
S.unsubscribe();
|
|
1618
1623
|
});
|
|
1619
1624
|
let g;
|
|
@@ -1624,7 +1629,7 @@ const Gs = async (e) => {
|
|
|
1624
1629
|
body: r,
|
|
1625
1630
|
duplex: "half"
|
|
1626
1631
|
}), R;
|
|
1627
|
-
if (
|
|
1632
|
+
if (f.isFormData(r) && (R = O.headers.get("content-type")) && u.setContentType(R), O.body) {
|
|
1628
1633
|
const [D, V] = nn(
|
|
1629
1634
|
g,
|
|
1630
1635
|
Le(rn(d))
|
|
@@ -1632,7 +1637,7 @@ const Gs = async (e) => {
|
|
|
1632
1637
|
r = sn(O.body, an, D, V);
|
|
1633
1638
|
}
|
|
1634
1639
|
}
|
|
1635
|
-
|
|
1640
|
+
f.isString(h) || (h = h ? "include" : "omit");
|
|
1636
1641
|
const A = "credentials" in Request.prototype;
|
|
1637
1642
|
b = new Request(t, {
|
|
1638
1643
|
...y,
|
|
@@ -1641,29 +1646,29 @@ const Gs = async (e) => {
|
|
|
1641
1646
|
headers: u.normalize().toJSON(),
|
|
1642
1647
|
body: r,
|
|
1643
1648
|
duplex: "half",
|
|
1644
|
-
credentials: A ?
|
|
1649
|
+
credentials: A ? h : void 0
|
|
1645
1650
|
});
|
|
1646
1651
|
let x = await fetch(b);
|
|
1647
1652
|
const E = mt && (c === "stream" || c === "response");
|
|
1648
|
-
if (mt && (l || E &&
|
|
1653
|
+
if (mt && (l || E && p)) {
|
|
1649
1654
|
const O = {};
|
|
1650
1655
|
["status", "statusText", "headers"].forEach((Ee) => {
|
|
1651
1656
|
O[Ee] = x[Ee];
|
|
1652
1657
|
});
|
|
1653
|
-
const R =
|
|
1658
|
+
const R = f.toFiniteNumber(x.headers.get("content-length")), [D, V] = l && nn(
|
|
1654
1659
|
R,
|
|
1655
1660
|
Le(rn(l), !0)
|
|
1656
1661
|
) || [];
|
|
1657
1662
|
x = new Response(
|
|
1658
1663
|
sn(x.body, an, D, () => {
|
|
1659
|
-
V && V(),
|
|
1664
|
+
V && V(), p && p();
|
|
1660
1665
|
}),
|
|
1661
1666
|
O
|
|
1662
1667
|
);
|
|
1663
1668
|
}
|
|
1664
1669
|
c = c || "text";
|
|
1665
|
-
let P = await Be[
|
|
1666
|
-
return !E &&
|
|
1670
|
+
let P = await Be[f.findKey(Be, c) || "text"](x, e);
|
|
1671
|
+
return !E && p && p(), await new Promise((O, R) => {
|
|
1667
1672
|
tr(O, R, {
|
|
1668
1673
|
data: P,
|
|
1669
1674
|
headers: U.from(x.headers),
|
|
@@ -1674,7 +1679,7 @@ const Gs = async (e) => {
|
|
|
1674
1679
|
});
|
|
1675
1680
|
});
|
|
1676
1681
|
} catch (A) {
|
|
1677
|
-
throw
|
|
1682
|
+
throw p && p(), A && A.name === "TypeError" && /fetch/i.test(A.message) ? Object.assign(
|
|
1678
1683
|
new C("Network Error", C.ERR_NETWORK, e, b),
|
|
1679
1684
|
{
|
|
1680
1685
|
cause: A.cause || A
|
|
@@ -1686,7 +1691,7 @@ const Gs = async (e) => {
|
|
|
1686
1691
|
xhr: zs,
|
|
1687
1692
|
fetch: Xs
|
|
1688
1693
|
};
|
|
1689
|
-
|
|
1694
|
+
f.forEach(gt, (e, t) => {
|
|
1690
1695
|
if (e) {
|
|
1691
1696
|
try {
|
|
1692
1697
|
Object.defineProperty(e, "name", { value: t });
|
|
@@ -1695,9 +1700,9 @@ h.forEach(gt, (e, t) => {
|
|
|
1695
1700
|
Object.defineProperty(e, "adapterName", { value: t });
|
|
1696
1701
|
}
|
|
1697
1702
|
});
|
|
1698
|
-
const ln = (e) => `- ${e}`, Qs = (e) =>
|
|
1703
|
+
const ln = (e) => `- ${e}`, Qs = (e) => f.isFunction(e) || e === null || e === !1, ar = {
|
|
1699
1704
|
getAdapter: (e) => {
|
|
1700
|
-
e =
|
|
1705
|
+
e = f.isArray(e) ? e : [e];
|
|
1701
1706
|
const { length: t } = e;
|
|
1702
1707
|
let n, r;
|
|
1703
1708
|
const o = {};
|
|
@@ -1833,17 +1838,17 @@ let le = class {
|
|
|
1833
1838
|
silentJSONParsing: ne.transitional(ne.boolean),
|
|
1834
1839
|
forcedJSONParsing: ne.transitional(ne.boolean),
|
|
1835
1840
|
clarifyTimeoutError: ne.transitional(ne.boolean)
|
|
1836
|
-
}, !1), o != null && (
|
|
1841
|
+
}, !1), o != null && (f.isFunction(o) ? n.paramsSerializer = {
|
|
1837
1842
|
serialize: o
|
|
1838
1843
|
} : bt.assertOptions(o, {
|
|
1839
1844
|
encode: ne.function,
|
|
1840
1845
|
serialize: ne.function
|
|
1841
1846
|
}, !0)), n.method = (n.method || this.defaults.method || "get").toLowerCase();
|
|
1842
|
-
let a = s &&
|
|
1847
|
+
let a = s && f.merge(
|
|
1843
1848
|
s.common,
|
|
1844
1849
|
s[n.method]
|
|
1845
1850
|
);
|
|
1846
|
-
s &&
|
|
1851
|
+
s && f.forEach(
|
|
1847
1852
|
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
1848
1853
|
(b) => {
|
|
1849
1854
|
delete s[b];
|
|
@@ -1851,28 +1856,28 @@ let le = class {
|
|
|
1851
1856
|
), n.headers = U.concat(a, s);
|
|
1852
1857
|
const l = [];
|
|
1853
1858
|
let d = !0;
|
|
1854
|
-
this.interceptors.request.forEach(function(
|
|
1855
|
-
typeof
|
|
1859
|
+
this.interceptors.request.forEach(function(p) {
|
|
1860
|
+
typeof p.runWhen == "function" && p.runWhen(n) === !1 || (d = d && p.synchronous, l.unshift(p.fulfilled, p.rejected));
|
|
1856
1861
|
});
|
|
1857
1862
|
const c = [];
|
|
1858
|
-
this.interceptors.response.forEach(function(
|
|
1859
|
-
c.push(
|
|
1863
|
+
this.interceptors.response.forEach(function(p) {
|
|
1864
|
+
c.push(p.fulfilled, p.rejected);
|
|
1860
1865
|
});
|
|
1861
|
-
let u,
|
|
1866
|
+
let u, h = 0, y;
|
|
1862
1867
|
if (!d) {
|
|
1863
1868
|
const b = [cn.bind(this), void 0];
|
|
1864
|
-
for (b.unshift.apply(b, l), b.push.apply(b, c), y = b.length, u = Promise.resolve(n);
|
|
1865
|
-
u = u.then(b[
|
|
1869
|
+
for (b.unshift.apply(b, l), b.push.apply(b, c), y = b.length, u = Promise.resolve(n); h < y; )
|
|
1870
|
+
u = u.then(b[h++], b[h++]);
|
|
1866
1871
|
return u;
|
|
1867
1872
|
}
|
|
1868
1873
|
y = l.length;
|
|
1869
1874
|
let S = n;
|
|
1870
|
-
for (
|
|
1871
|
-
const b = l[
|
|
1875
|
+
for (h = 0; h < y; ) {
|
|
1876
|
+
const b = l[h++], p = l[h++];
|
|
1872
1877
|
try {
|
|
1873
1878
|
S = b(S);
|
|
1874
1879
|
} catch (g) {
|
|
1875
|
-
|
|
1880
|
+
p.call(this, g);
|
|
1876
1881
|
break;
|
|
1877
1882
|
}
|
|
1878
1883
|
}
|
|
@@ -1881,8 +1886,8 @@ let le = class {
|
|
|
1881
1886
|
} catch (b) {
|
|
1882
1887
|
return Promise.reject(b);
|
|
1883
1888
|
}
|
|
1884
|
-
for (
|
|
1885
|
-
u = u.then(c[
|
|
1889
|
+
for (h = 0, y = c.length; h < y; )
|
|
1890
|
+
u = u.then(c[h++], c[h++]);
|
|
1886
1891
|
return u;
|
|
1887
1892
|
}
|
|
1888
1893
|
getUri(t) {
|
|
@@ -1891,7 +1896,7 @@ let le = class {
|
|
|
1891
1896
|
return Zn(n, t.params, t.paramsSerializer);
|
|
1892
1897
|
}
|
|
1893
1898
|
};
|
|
1894
|
-
|
|
1899
|
+
f.forEach(["delete", "get", "head", "options"], function(t) {
|
|
1895
1900
|
le.prototype[t] = function(n, r) {
|
|
1896
1901
|
return this.request(ue(r || {}, {
|
|
1897
1902
|
method: t,
|
|
@@ -1900,7 +1905,7 @@ h.forEach(["delete", "get", "head", "options"], function(t) {
|
|
|
1900
1905
|
}));
|
|
1901
1906
|
};
|
|
1902
1907
|
});
|
|
1903
|
-
|
|
1908
|
+
f.forEach(["post", "put", "patch"], function(t) {
|
|
1904
1909
|
function n(r) {
|
|
1905
1910
|
return function(s, a, l) {
|
|
1906
1911
|
return this.request(ue(l || {}, {
|
|
@@ -1994,7 +1999,7 @@ function na(e) {
|
|
|
1994
1999
|
};
|
|
1995
2000
|
}
|
|
1996
2001
|
function ra(e) {
|
|
1997
|
-
return
|
|
2002
|
+
return f.isObject(e) && e.isAxiosError === !0;
|
|
1998
2003
|
}
|
|
1999
2004
|
const yt = {
|
|
2000
2005
|
Continue: 100,
|
|
@@ -2066,7 +2071,7 @@ Object.entries(yt).forEach(([e, t]) => {
|
|
|
2066
2071
|
});
|
|
2067
2072
|
function cr(e) {
|
|
2068
2073
|
const t = new le(e), n = Un(le.prototype.request, t);
|
|
2069
|
-
return
|
|
2074
|
+
return f.extend(n, le.prototype, t, { allOwnKeys: !0 }), f.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(o) {
|
|
2070
2075
|
return cr(ue(e, o));
|
|
2071
2076
|
}, n;
|
|
2072
2077
|
}
|
|
@@ -2086,7 +2091,7 @@ F.spread = na;
|
|
|
2086
2091
|
F.isAxiosError = ra;
|
|
2087
2092
|
F.mergeConfig = ue;
|
|
2088
2093
|
F.AxiosHeaders = U;
|
|
2089
|
-
F.formToJSON = (e) => Qn(
|
|
2094
|
+
F.formToJSON = (e) => Qn(f.isHTMLForm(e) ? new FormData(e) : e);
|
|
2090
2095
|
F.getAdapter = ar.getAdapter;
|
|
2091
2096
|
F.HttpStatusCode = yt;
|
|
2092
2097
|
F.default = F;
|
|
@@ -2120,32 +2125,32 @@ function ce(e) {
|
|
|
2120
2125
|
};
|
|
2121
2126
|
}
|
|
2122
2127
|
function Ut() {
|
|
2123
|
-
return
|
|
2128
|
+
return m.useContext(Lt).notify;
|
|
2124
2129
|
}
|
|
2125
2130
|
function sa() {
|
|
2126
2131
|
const e = Ut();
|
|
2127
|
-
return
|
|
2132
|
+
return m.useCallback((t) => {
|
|
2128
2133
|
ce(e)(t);
|
|
2129
2134
|
}, [e]);
|
|
2130
2135
|
}
|
|
2131
2136
|
const aa = ({ create: e = !1 }) => {
|
|
2132
|
-
const [t, n] =
|
|
2137
|
+
const [t, n] = m.useState(), { id: r } = xr(), { t: o } = L(), s = Ut(), a = At(), l = te(), d = z("breakpoint", "md");
|
|
2133
2138
|
Bt(
|
|
2134
2139
|
t != null && t.exists ? o("Edit :model “:label“", { model: l.singular(), label: (t == null ? void 0 : t.getLabel()) || "..." }) : o("Create :model", { model: l.singular() })
|
|
2135
2140
|
), Do();
|
|
2136
|
-
const c =
|
|
2137
|
-
|
|
2141
|
+
const c = T("cms").getComponent("Breadcrumbs");
|
|
2142
|
+
m.useEffect(() => {
|
|
2138
2143
|
e ? n(new l()) : l.find(r).then((S) => n(S ?? void 0));
|
|
2139
2144
|
}, [r, l, e]);
|
|
2140
|
-
const u =
|
|
2141
|
-
s(o(":model saved successfully", { model: l.singular() })), t != null && t.wasRecentlyCreated && a(`/${
|
|
2142
|
-
}, [s, a, l, t, o]),
|
|
2145
|
+
const u = m.useCallback(() => {
|
|
2146
|
+
s(o(":model saved successfully", { model: l.singular() })), t != null && t.wasRecentlyCreated && a(`/${k.kebab(l.plural())}/${t.getKey()}`);
|
|
2147
|
+
}, [s, a, l, t, o]), h = sa(), y = m.useMemo(() => T("cms").getModelFormProps(t), [t]);
|
|
2143
2148
|
return t ? /* @__PURE__ */ i(H, { sx: { p: { xs: 1, sm: 2, md: 3 } }, children: /* @__PURE__ */ w(Q, { container: !0, children: [
|
|
2144
2149
|
/* @__PURE__ */ i(Q, { xs: 12, children: /* @__PURE__ */ i(
|
|
2145
2150
|
c,
|
|
2146
2151
|
{
|
|
2147
2152
|
parts: [
|
|
2148
|
-
{ name: l.plural(), href: "/" +
|
|
2153
|
+
{ name: l.plural(), href: "/" + k.kebab(l.plural()) },
|
|
2149
2154
|
{ name: t.exists ? t.getLabel() : o("New") }
|
|
2150
2155
|
]
|
|
2151
2156
|
}
|
|
@@ -2162,7 +2167,7 @@ const aa = ({ create: e = !1 }) => {
|
|
|
2162
2167
|
...y,
|
|
2163
2168
|
item: t,
|
|
2164
2169
|
onSuccess: u,
|
|
2165
|
-
onError:
|
|
2170
|
+
onError: h
|
|
2166
2171
|
}
|
|
2167
2172
|
)
|
|
2168
2173
|
}
|
|
@@ -2172,13 +2177,13 @@ const aa = ({ create: e = !1 }) => {
|
|
|
2172
2177
|
function ia(e) {
|
|
2173
2178
|
const {
|
|
2174
2179
|
setDisplacement: t
|
|
2175
|
-
} =
|
|
2176
|
-
|
|
2180
|
+
} = m.useContext(Lt), n = Ft(), r = v(), o = n.spacing(r ? 3 : 1), s = e === !1 ? o : n.spacing(e);
|
|
2181
|
+
m.useEffect(() => (t(s), () => {
|
|
2177
2182
|
t(o);
|
|
2178
2183
|
}), [s, o, t]);
|
|
2179
2184
|
}
|
|
2180
2185
|
function la() {
|
|
2181
|
-
return
|
|
2186
|
+
return m.useContext(jn).dialog;
|
|
2182
2187
|
}
|
|
2183
2188
|
function qt() {
|
|
2184
2189
|
const e = At(), t = Ut(), n = la(), { t: r } = L(), { refresh: o } = xe();
|
|
@@ -2193,25 +2198,25 @@ const ca = Z(vr)(({ theme: e }) => ({
|
|
|
2193
2198
|
bottom: e.spacing(2),
|
|
2194
2199
|
right: e.spacing(2)
|
|
2195
2200
|
})), da = ({ variant: e = "default" }) => {
|
|
2196
|
-
const t = te(), n = v(), [r] = G(), o = r.get("tab") ?? "all", [s, a] =
|
|
2201
|
+
const t = te(), n = v(), [r] = G(), o = r.get("tab") ?? "all", [s, a] = m.useState(!1), l = m.useRef(null), [d, c] = m.useState(0), u = qt(), h = m.useMemo(() => T("cms").getStaticActions(t, o), [t, o]);
|
|
2197
2202
|
if (ia(
|
|
2198
|
-
e === "fab" &&
|
|
2199
|
-
),
|
|
2203
|
+
e === "fab" && h.length > 0 ? n ? 12 : 10 : !1
|
|
2204
|
+
), h.length === 0)
|
|
2200
2205
|
return null;
|
|
2201
|
-
const y = (
|
|
2206
|
+
const y = (p, g) => {
|
|
2202
2207
|
c(g), a(!1);
|
|
2203
2208
|
}, S = () => {
|
|
2204
|
-
a((
|
|
2205
|
-
}, b = (
|
|
2206
|
-
l.current && l.current.contains(
|
|
2209
|
+
a((p) => !p);
|
|
2210
|
+
}, b = (p) => {
|
|
2211
|
+
l.current && l.current.contains(p.target) || a(!1);
|
|
2207
2212
|
};
|
|
2208
|
-
return e === "fab" ?
|
|
2213
|
+
return e === "fab" ? h.length === 1 ? Jt.createPortal(
|
|
2209
2214
|
/* @__PURE__ */ i(
|
|
2210
2215
|
ca,
|
|
2211
2216
|
{
|
|
2212
2217
|
color: "primary",
|
|
2213
|
-
onClick: () =>
|
|
2214
|
-
children:
|
|
2218
|
+
onClick: () => h[0].callback(u),
|
|
2219
|
+
children: h[0].icon || h[0].label.charAt(0).toUpperCase()
|
|
2215
2220
|
}
|
|
2216
2221
|
),
|
|
2217
2222
|
document.body
|
|
@@ -2225,14 +2230,14 @@ const ca = Z(vr)(({ theme: e }) => ({
|
|
|
2225
2230
|
onClose: () => a(!1),
|
|
2226
2231
|
onOpen: () => a(!0),
|
|
2227
2232
|
open: s,
|
|
2228
|
-
children:
|
|
2233
|
+
children: h.map((p) => /* @__PURE__ */ i(
|
|
2229
2234
|
Br,
|
|
2230
2235
|
{
|
|
2231
|
-
icon:
|
|
2232
|
-
tooltipTitle:
|
|
2233
|
-
onClick: () =>
|
|
2236
|
+
icon: p.icon || p.label.charAt(0).toUpperCase(),
|
|
2237
|
+
tooltipTitle: p.label,
|
|
2238
|
+
onClick: () => p.callback(u)
|
|
2234
2239
|
},
|
|
2235
|
-
|
|
2240
|
+
p.label
|
|
2236
2241
|
))
|
|
2237
2242
|
}
|
|
2238
2243
|
),
|
|
@@ -2243,10 +2248,10 @@ const ca = Z(vr)(({ theme: e }) => ({
|
|
|
2243
2248
|
{
|
|
2244
2249
|
variant: "contained",
|
|
2245
2250
|
ref: l,
|
|
2246
|
-
"aria-label":
|
|
2251
|
+
"aria-label": h[d].label,
|
|
2247
2252
|
children: [
|
|
2248
|
-
/* @__PURE__ */ i(M, { onClick: () =>
|
|
2249
|
-
|
|
2253
|
+
/* @__PURE__ */ i(M, { onClick: () => h[d].callback(u), children: h[d].label }),
|
|
2254
|
+
h.length > 1 && /* @__PURE__ */ i(
|
|
2250
2255
|
M,
|
|
2251
2256
|
{
|
|
2252
2257
|
variant: "contained",
|
|
@@ -2256,7 +2261,7 @@ const ca = Z(vr)(({ theme: e }) => ({
|
|
|
2256
2261
|
"aria-label": `select ${t.singular()} actions`,
|
|
2257
2262
|
"aria-haspopup": "menu",
|
|
2258
2263
|
onClick: S,
|
|
2259
|
-
children: /* @__PURE__ */ i(
|
|
2264
|
+
children: /* @__PURE__ */ i(Tn, {})
|
|
2260
2265
|
}
|
|
2261
2266
|
)
|
|
2262
2267
|
]
|
|
@@ -2269,14 +2274,14 @@ const ca = Z(vr)(({ theme: e }) => ({
|
|
|
2269
2274
|
anchorEl: l.current,
|
|
2270
2275
|
role: void 0,
|
|
2271
2276
|
transition: !0,
|
|
2272
|
-
children: ({ TransitionProps:
|
|
2277
|
+
children: ({ TransitionProps: p, placement: g }) => /* @__PURE__ */ i(
|
|
2273
2278
|
Nr,
|
|
2274
2279
|
{
|
|
2275
|
-
...
|
|
2280
|
+
...p,
|
|
2276
2281
|
style: {
|
|
2277
2282
|
transformOrigin: g === "bottom" ? "center top" : "center bottom"
|
|
2278
2283
|
},
|
|
2279
|
-
children: /* @__PURE__ */ i(Ot, { children: /* @__PURE__ */ i(jr, { onClickAway: b, children: /* @__PURE__ */ i(Ur, { id: "split-button-menu", children:
|
|
2284
|
+
children: /* @__PURE__ */ i(Ot, { children: /* @__PURE__ */ i(jr, { onClickAway: b, children: /* @__PURE__ */ i(Ur, { id: "split-button-menu", children: h.map((A, x) => /* @__PURE__ */ i(
|
|
2280
2285
|
se,
|
|
2281
2286
|
{
|
|
2282
2287
|
selected: x === d,
|
|
@@ -2292,7 +2297,7 @@ const ca = Z(vr)(({ theme: e }) => ({
|
|
|
2292
2297
|
] });
|
|
2293
2298
|
};
|
|
2294
2299
|
function _t() {
|
|
2295
|
-
const { open: e, setOpen: t } =
|
|
2300
|
+
const { open: e, setOpen: t } = m.useContext(X);
|
|
2296
2301
|
return {
|
|
2297
2302
|
open: e,
|
|
2298
2303
|
handleDrawerOpen: () => {
|
|
@@ -2307,15 +2312,15 @@ function _t() {
|
|
|
2307
2312
|
};
|
|
2308
2313
|
}
|
|
2309
2314
|
function ur() {
|
|
2310
|
-
const { currentPage: e } =
|
|
2315
|
+
const { currentPage: e } = m.useContext(X);
|
|
2311
2316
|
return e;
|
|
2312
2317
|
}
|
|
2313
2318
|
function dr() {
|
|
2314
|
-
const { showSearch: e } =
|
|
2319
|
+
const { showSearch: e } = m.useContext(X);
|
|
2315
2320
|
return e;
|
|
2316
2321
|
}
|
|
2317
2322
|
function fr() {
|
|
2318
|
-
const { showBackButton: e } =
|
|
2323
|
+
const { showBackButton: e } = m.useContext(X);
|
|
2319
2324
|
return e;
|
|
2320
2325
|
}
|
|
2321
2326
|
const fa = Z(
|
|
@@ -2345,16 +2350,16 @@ const fa = Z(
|
|
|
2345
2350
|
["Layout.SearchBar"]: s,
|
|
2346
2351
|
["Layout.BackButton"]: a,
|
|
2347
2352
|
["Layout.AppLogo"]: l
|
|
2348
|
-
} =
|
|
2353
|
+
} = T("cms").getComponents(), { open: d } = _t(), c = dr(), u = fr(), h = z("appBar.height"), y = z("drawer.width", 280), {
|
|
2349
2354
|
start: S = null,
|
|
2350
2355
|
//: title = config('app.name', document.title),
|
|
2351
2356
|
end: b = null
|
|
2352
|
-
} = e,
|
|
2357
|
+
} = e, p = ur();
|
|
2353
2358
|
return /* @__PURE__ */ i(
|
|
2354
2359
|
r,
|
|
2355
2360
|
{
|
|
2356
2361
|
open: d,
|
|
2357
|
-
height:
|
|
2362
|
+
height: h,
|
|
2358
2363
|
drawerWidth: y,
|
|
2359
2364
|
...t,
|
|
2360
2365
|
children: /* @__PURE__ */ w(qr, { children: [
|
|
@@ -2368,7 +2373,7 @@ const fa = Z(
|
|
|
2368
2373
|
variant: "h6",
|
|
2369
2374
|
noWrap: !0,
|
|
2370
2375
|
component: "div",
|
|
2371
|
-
children: !n &&
|
|
2376
|
+
children: !n && p || oe("app.name", document.title)
|
|
2372
2377
|
}
|
|
2373
2378
|
),
|
|
2374
2379
|
/* @__PURE__ */ i(H, { sx: { flexGrow: 1 } }),
|
|
@@ -2442,7 +2447,7 @@ const dn = (e, t) => ({
|
|
|
2442
2447
|
// necessary for content to be below app bar
|
|
2443
2448
|
...e.mixins.toolbar
|
|
2444
2449
|
})), wa = (e) => {
|
|
2445
|
-
const t = Ft(), n = v(), { open: r, handleDrawerClose: o } = _t(), s = n ? ga : ba, a = z("drawer.width", 280), l = z("appBar.height"), d =
|
|
2450
|
+
const t = Ft(), n = v(), { open: r, handleDrawerClose: o } = _t(), s = n ? ga : ba, a = z("drawer.width", 280), l = z("appBar.height"), d = T("cms").getComponent("RecursiveList"), c = T("cms").getMenuItems();
|
|
2446
2451
|
return /* @__PURE__ */ w(
|
|
2447
2452
|
s,
|
|
2448
2453
|
{
|
|
@@ -2475,7 +2480,7 @@ const dn = (e, t) => ({
|
|
|
2475
2480
|
}, Sa = () => {
|
|
2476
2481
|
const e = ur(), t = z("breakpoint", "md"), n = fr(), {
|
|
2477
2482
|
["Layout.BackButton"]: r
|
|
2478
|
-
} =
|
|
2483
|
+
} = T("cms").getComponents();
|
|
2479
2484
|
return /* @__PURE__ */ w(
|
|
2480
2485
|
Ot,
|
|
2481
2486
|
{
|
|
@@ -2493,7 +2498,7 @@ const dn = (e, t) => ({
|
|
|
2493
2498
|
]
|
|
2494
2499
|
}
|
|
2495
2500
|
);
|
|
2496
|
-
}, Ht =
|
|
2501
|
+
}, Ht = m.createContext({
|
|
2497
2502
|
Model: null,
|
|
2498
2503
|
anchorEl: null,
|
|
2499
2504
|
setAnchorEl: () => {
|
|
@@ -2510,7 +2515,7 @@ const dn = (e, t) => ({
|
|
|
2510
2515
|
},
|
|
2511
2516
|
clearFilters: () => {
|
|
2512
2517
|
}
|
|
2513
|
-
}), ge =
|
|
2518
|
+
}), ge = m.createContext({
|
|
2514
2519
|
key: "",
|
|
2515
2520
|
type: "",
|
|
2516
2521
|
operator: "",
|
|
@@ -2546,11 +2551,11 @@ const dn = (e, t) => ({
|
|
|
2546
2551
|
return a;
|
|
2547
2552
|
};
|
|
2548
2553
|
function Ea(e, t) {
|
|
2549
|
-
const n =
|
|
2554
|
+
const n = T("filter"), { Model: r, setColumnsFilter: o } = m.useContext(Ht), [s, a] = m.useState(t.key), [l, d] = m.useState(t.operator), [c, u] = m.useState(t.type), [h, y] = m.useState(t.value), [S, b] = m.useState(t.nullable), [p, g] = m.useState(t.is_relation), A = m.useMemo(() => n.getFilterableColumns(r), [r]), x = (O) => () => {
|
|
2550
2555
|
o((R) => R.filter((D, V) => V !== O));
|
|
2551
2556
|
}, E = async (O) => {
|
|
2552
2557
|
const R = O.target.value, D = A.find((mr) => mr.key === R), V = (D == null ? void 0 : D.type) ?? "text", Ee = (D == null ? void 0 : D.nullable) ?? !1, Wt = (D == null ? void 0 : D.is_relation) ?? !1;
|
|
2553
|
-
Wt ? (d("relation"), y([])) :
|
|
2558
|
+
Wt ? (d("relation"), y([])) : p && d("equals"), g(Wt), b(Ee), V !== c && (d("equals"), y(() => {
|
|
2554
2559
|
if (["between", "notBetween"].includes(l))
|
|
2555
2560
|
return [];
|
|
2556
2561
|
switch (n.getInputType(V)) {
|
|
@@ -2577,17 +2582,17 @@ function Ea(e, t) {
|
|
|
2577
2582
|
}
|
|
2578
2583
|
}), d(R);
|
|
2579
2584
|
};
|
|
2580
|
-
return
|
|
2585
|
+
return m.useEffect(() => {
|
|
2581
2586
|
o((O) => O.map((D, V) => e === V ? {
|
|
2582
2587
|
...D,
|
|
2583
2588
|
key: s,
|
|
2584
2589
|
operator: l,
|
|
2585
2590
|
type: c,
|
|
2586
|
-
value:
|
|
2591
|
+
value: h,
|
|
2587
2592
|
nullable: S,
|
|
2588
|
-
is_relation:
|
|
2593
|
+
is_relation: p
|
|
2589
2594
|
} : D));
|
|
2590
|
-
}, [s, l, c,
|
|
2595
|
+
}, [s, l, c, h, S, p]), {
|
|
2591
2596
|
columns: A,
|
|
2592
2597
|
key: s,
|
|
2593
2598
|
setKey: a,
|
|
@@ -2595,11 +2600,11 @@ function Ea(e, t) {
|
|
|
2595
2600
|
setOperator: d,
|
|
2596
2601
|
type: c,
|
|
2597
2602
|
setType: u,
|
|
2598
|
-
value:
|
|
2603
|
+
value: h,
|
|
2599
2604
|
setValue: y,
|
|
2600
2605
|
nullable: S,
|
|
2601
2606
|
setNullable: b,
|
|
2602
|
-
isRelation:
|
|
2607
|
+
isRelation: p,
|
|
2603
2608
|
setIsRelation: g,
|
|
2604
2609
|
handleKey: E,
|
|
2605
2610
|
handleOperator: P,
|
|
@@ -2609,31 +2614,31 @@ function Ea(e, t) {
|
|
|
2609
2614
|
const hn = async (e, t, n) => {
|
|
2610
2615
|
const r = e.getSchema().relations[t].model, { data: o } = await we().make(r).get(), s = o.all().filter((c) => !n.find((u) => u.getKey() === c.getKey())), a = s.length, l = n.length, d = 15;
|
|
2611
2616
|
return a + l > d ? W([...n, ...s.slice(0, d - l)]) : W([...n, ...s]);
|
|
2612
|
-
},
|
|
2617
|
+
}, ka = async (e, t, n = "", r) => {
|
|
2613
2618
|
const o = e.getSchema().relations[t], s = we().make(o.model), a = s.getSchema().primaryKey, { data: l } = await s.searchBy(n).get();
|
|
2614
2619
|
return W([...r, ...l]).unique(a);
|
|
2615
|
-
},
|
|
2620
|
+
}, Ta = () => {
|
|
2616
2621
|
const e = v(), t = te(), {
|
|
2617
2622
|
key: n,
|
|
2618
2623
|
value: r,
|
|
2619
2624
|
setValue: o
|
|
2620
|
-
} =
|
|
2625
|
+
} = m.useContext(ge), [s, a] = m.useState(!1), [l, d] = m.useState(""), [c, u] = m.useState(W([])), [h, y] = m.useState([]), S = m.useMemo(
|
|
2621
2626
|
() => s && c.count() === 0,
|
|
2622
2627
|
[s, c]
|
|
2623
|
-
), b = async (
|
|
2624
|
-
d(g), J.isEmpty(g) || u(await
|
|
2628
|
+
), b = async (p, g) => {
|
|
2629
|
+
d(g), J.isEmpty(g) || u(await ka(t, n, g, W(h)));
|
|
2625
2630
|
};
|
|
2626
|
-
return
|
|
2631
|
+
return m.useEffect(() => {
|
|
2627
2632
|
r.length > 0 && (async () => y(await Ca(t, n, r)))();
|
|
2628
|
-
}, []),
|
|
2629
|
-
let
|
|
2633
|
+
}, []), m.useEffect(() => {
|
|
2634
|
+
let p = !0;
|
|
2630
2635
|
if (S)
|
|
2631
|
-
return (async () =>
|
|
2632
|
-
|
|
2636
|
+
return (async () => p && u(await hn(t, n, h)))(), () => {
|
|
2637
|
+
p = !1;
|
|
2633
2638
|
};
|
|
2634
|
-
}, [S]),
|
|
2635
|
-
o(
|
|
2636
|
-
}, [
|
|
2639
|
+
}, [S]), m.useEffect(() => {
|
|
2640
|
+
o(h.map((p) => p.getKey())), J.isEmpty(l) ? (async () => u(await hn(t, n, h)))() : u(W([]));
|
|
2641
|
+
}, [h]), /* @__PURE__ */ i(
|
|
2637
2642
|
_r,
|
|
2638
2643
|
{
|
|
2639
2644
|
sx: { width: e ? 377 : "100%" },
|
|
@@ -2644,20 +2649,20 @@ const hn = async (e, t, n) => {
|
|
|
2644
2649
|
onClose: () => {
|
|
2645
2650
|
a(!1);
|
|
2646
2651
|
},
|
|
2647
|
-
value:
|
|
2648
|
-
onChange: (
|
|
2652
|
+
value: h,
|
|
2653
|
+
onChange: (p, g) => {
|
|
2649
2654
|
y(g);
|
|
2650
2655
|
},
|
|
2651
2656
|
inputValue: l,
|
|
2652
2657
|
onInputChange: b,
|
|
2653
2658
|
options: c.all() || [],
|
|
2654
|
-
getOptionLabel: (
|
|
2655
|
-
isOptionEqualToValue: (
|
|
2656
|
-
filterOptions: (
|
|
2657
|
-
renderInput: (
|
|
2659
|
+
getOptionLabel: (p) => p.getLabel(),
|
|
2660
|
+
isOptionEqualToValue: (p, g) => p.getKey() === g.getKey(),
|
|
2661
|
+
filterOptions: (p) => p,
|
|
2662
|
+
renderInput: (p) => /* @__PURE__ */ i(
|
|
2658
2663
|
Da,
|
|
2659
2664
|
{
|
|
2660
|
-
params:
|
|
2665
|
+
params: p,
|
|
2661
2666
|
loading: S
|
|
2662
2667
|
}
|
|
2663
2668
|
),
|
|
@@ -2677,7 +2682,7 @@ const hn = async (e, t, n) => {
|
|
|
2677
2682
|
label: n("Value"),
|
|
2678
2683
|
InputProps: {
|
|
2679
2684
|
...e.InputProps,
|
|
2680
|
-
endAdornment: /* @__PURE__ */ w(
|
|
2685
|
+
endAdornment: /* @__PURE__ */ w(m.Fragment, { children: [
|
|
2681
2686
|
t ? /* @__PURE__ */ i(Hr, { color: "inherit", size: 20 }) : null,
|
|
2682
2687
|
e.InputProps.endAdornment
|
|
2683
2688
|
] })
|
|
@@ -2685,14 +2690,14 @@ const hn = async (e, t, n) => {
|
|
|
2685
2690
|
}
|
|
2686
2691
|
);
|
|
2687
2692
|
}, tt = ({ index: e = null }) => {
|
|
2688
|
-
const { t } = L(), n = v(), r =
|
|
2693
|
+
const { t } = L(), n = v(), r = T("filter"), {
|
|
2689
2694
|
type: o,
|
|
2690
2695
|
value: s,
|
|
2691
2696
|
setValue: a
|
|
2692
|
-
} =
|
|
2697
|
+
} = m.useContext(ge), d = r.getInputType(o) === "datetime-local" ? 230 : 167.5, c = e !== null ? `${t("Date")} ${e + 1}` : `${t("Date")}`, u = m.useMemo(
|
|
2693
2698
|
() => e !== null ? s[e] : s,
|
|
2694
2699
|
[s]
|
|
2695
|
-
),
|
|
2700
|
+
), h = (y) => {
|
|
2696
2701
|
a(typeof e == "number" ? (S) => {
|
|
2697
2702
|
const b = S;
|
|
2698
2703
|
return b[e] = y.target.value, [...b];
|
|
@@ -2704,13 +2709,13 @@ const hn = async (e, t, n) => {
|
|
|
2704
2709
|
type: r.getInputType(o),
|
|
2705
2710
|
label: c,
|
|
2706
2711
|
value: Oe.toDateTimeLocal(Oe.parse(u)),
|
|
2707
|
-
onChange:
|
|
2712
|
+
onChange: h,
|
|
2708
2713
|
size: "small",
|
|
2709
2714
|
sx: { width: n ? d : "100%" }
|
|
2710
2715
|
}
|
|
2711
2716
|
);
|
|
2712
2717
|
}, Oa = () => {
|
|
2713
|
-
const e = v(), { value: t, setValue: n } =
|
|
2718
|
+
const e = v(), { value: t, setValue: n } = m.useContext(ge);
|
|
2714
2719
|
return /* @__PURE__ */ w(B, { children: [
|
|
2715
2720
|
/* @__PURE__ */ i(
|
|
2716
2721
|
zr,
|
|
@@ -2727,16 +2732,16 @@ const hn = async (e, t, n) => {
|
|
|
2727
2732
|
e && /* @__PURE__ */ i(H, { width: 325 })
|
|
2728
2733
|
] });
|
|
2729
2734
|
}, nt = ({ index: e = null }) => {
|
|
2730
|
-
const { t } = L(), n = v(), r =
|
|
2735
|
+
const { t } = L(), n = v(), r = T("filter"), {
|
|
2731
2736
|
type: o,
|
|
2732
2737
|
value: s,
|
|
2733
2738
|
setValue: a
|
|
2734
|
-
} =
|
|
2739
|
+
} = m.useContext(ge), l = e !== null ? `${t("Value")} ${e + 1}` : `${t("Value")}`, d = m.useMemo(
|
|
2735
2740
|
() => e !== null ? s[e] : s,
|
|
2736
2741
|
[s]
|
|
2737
2742
|
), c = (u) => {
|
|
2738
|
-
a(typeof e == "number" ? (
|
|
2739
|
-
const y =
|
|
2743
|
+
a(typeof e == "number" ? (h) => {
|
|
2744
|
+
const y = h;
|
|
2740
2745
|
return y[e] = u.target.value, [...y];
|
|
2741
2746
|
} : u.target.value);
|
|
2742
2747
|
};
|
|
@@ -2752,7 +2757,7 @@ const hn = async (e, t, n) => {
|
|
|
2752
2757
|
}
|
|
2753
2758
|
);
|
|
2754
2759
|
}, rt = () => {
|
|
2755
|
-
const e = v(), t =
|
|
2760
|
+
const e = v(), t = T("filter"), { type: n, operator: r } = m.useContext(ge), o = m.useMemo(
|
|
2756
2761
|
() => ["between", "notBetween"].includes(r),
|
|
2757
2762
|
[r]
|
|
2758
2763
|
);
|
|
@@ -2777,23 +2782,23 @@ const hn = async (e, t, n) => {
|
|
|
2777
2782
|
case "datetime-local":
|
|
2778
2783
|
return /* @__PURE__ */ i(tt, {});
|
|
2779
2784
|
case "autocomplete":
|
|
2780
|
-
return /* @__PURE__ */ i(
|
|
2785
|
+
return /* @__PURE__ */ i(Ta, {});
|
|
2781
2786
|
case "boolean":
|
|
2782
2787
|
return /* @__PURE__ */ i(Oa, {});
|
|
2783
2788
|
default:
|
|
2784
2789
|
return /* @__PURE__ */ i(nt, {});
|
|
2785
2790
|
}
|
|
2786
2791
|
}, Ra = ({ index: e, column: t }) => {
|
|
2787
|
-
const { t: n } = L(), r = v(), o = z("breakpoint", "md"), s =
|
|
2792
|
+
const { t: n } = L(), r = v(), o = z("breakpoint", "md"), s = T("filter"), a = m.useMemo(() => s.getMatchingOperators(t), [t]), {
|
|
2788
2793
|
columns: l,
|
|
2789
2794
|
key: d,
|
|
2790
2795
|
setKey: c,
|
|
2791
2796
|
operator: u,
|
|
2792
|
-
setOperator:
|
|
2797
|
+
setOperator: h,
|
|
2793
2798
|
type: y,
|
|
2794
2799
|
setType: S,
|
|
2795
2800
|
value: b,
|
|
2796
|
-
setValue:
|
|
2801
|
+
setValue: p,
|
|
2797
2802
|
isRelation: g,
|
|
2798
2803
|
setIsRelation: A,
|
|
2799
2804
|
handleKey: x,
|
|
@@ -2809,9 +2814,9 @@ const hn = async (e, t, n) => {
|
|
|
2809
2814
|
type: y,
|
|
2810
2815
|
setType: S,
|
|
2811
2816
|
operator: u,
|
|
2812
|
-
setOperator:
|
|
2817
|
+
setOperator: h,
|
|
2813
2818
|
value: b,
|
|
2814
|
-
setValue:
|
|
2819
|
+
setValue: p,
|
|
2815
2820
|
isRelation: g,
|
|
2816
2821
|
setIsRelation: A
|
|
2817
2822
|
},
|
|
@@ -2955,12 +2960,12 @@ const hn = async (e, t, n) => {
|
|
|
2955
2960
|
}
|
|
2956
2961
|
);
|
|
2957
2962
|
}, pn = ({ dialog: e = !1 }) => {
|
|
2958
|
-
const { t } = L(), n = v(), r = z("breakpoint", "md"), o =
|
|
2963
|
+
const { t } = L(), n = v(), r = z("breakpoint", "md"), o = T("filter"), {
|
|
2959
2964
|
columnsFilter: s,
|
|
2960
2965
|
setColumnsFilter: a,
|
|
2961
2966
|
handleApplyFilters: l,
|
|
2962
2967
|
clearFilters: d
|
|
2963
|
-
} =
|
|
2968
|
+
} = m.useContext(Ht), c = () => {
|
|
2964
2969
|
a((u) => [
|
|
2965
2970
|
...u,
|
|
2966
2971
|
{
|
|
@@ -2982,13 +2987,13 @@ const hn = async (e, t, n) => {
|
|
|
2982
2987
|
p: e ? 0 : 2
|
|
2983
2988
|
},
|
|
2984
2989
|
children: [
|
|
2985
|
-
/* @__PURE__ */ i(N, { children: s.map((u,
|
|
2986
|
-
const S =
|
|
2990
|
+
/* @__PURE__ */ i(N, { children: s.map((u, h, y) => {
|
|
2991
|
+
const S = h == y.length - 1;
|
|
2987
2992
|
return /* @__PURE__ */ w(B, { children: [
|
|
2988
2993
|
/* @__PURE__ */ i(
|
|
2989
2994
|
Ra,
|
|
2990
2995
|
{
|
|
2991
|
-
index:
|
|
2996
|
+
index: h,
|
|
2992
2997
|
column: u
|
|
2993
2998
|
},
|
|
2994
2999
|
`row_${u.key}`
|
|
@@ -3086,20 +3091,20 @@ function Pa(e, t) {
|
|
|
3086
3091
|
}), n);
|
|
3087
3092
|
}
|
|
3088
3093
|
const va = (e) => {
|
|
3089
|
-
const t =
|
|
3094
|
+
const t = T("filter"), n = new URLSearchParams();
|
|
3090
3095
|
return e.forEach((r) => {
|
|
3091
3096
|
const { key: o, operator: s, value: a, type: l } = r;
|
|
3092
3097
|
let d = `:${s}`;
|
|
3093
3098
|
if (["equals"].includes(s) && (d = ""), Array.isArray(a))
|
|
3094
3099
|
a.forEach((c, u) => {
|
|
3095
|
-
let
|
|
3100
|
+
let h = c;
|
|
3096
3101
|
switch (t.getInputType(l)) {
|
|
3097
3102
|
case "datetime-local": {
|
|
3098
|
-
|
|
3103
|
+
h = new Date(c).toISOString();
|
|
3099
3104
|
break;
|
|
3100
3105
|
}
|
|
3101
3106
|
}
|
|
3102
|
-
n.set(`where[${o}${d}][${u}]`,
|
|
3107
|
+
n.set(`where[${o}${d}][${u}]`, h);
|
|
3103
3108
|
});
|
|
3104
3109
|
else {
|
|
3105
3110
|
let c = a;
|
|
@@ -3113,13 +3118,13 @@ const va = (e) => {
|
|
|
3113
3118
|
}
|
|
3114
3119
|
}), n;
|
|
3115
3120
|
}, Fa = () => {
|
|
3116
|
-
const { t: e } = L(), t =
|
|
3121
|
+
const { t: e } = L(), t = T("filter"), n = v(), r = te(), [o, s] = G(), a = m.useMemo(() => "where" in mn.toObject(o), [o]), [l, d] = m.useState(null), [c, u] = m.useState([]), h = !!l, y = m.useMemo(() => t.getFilterableColumns(r), [r]), S = (x) => {
|
|
3117
3122
|
d(x.currentTarget);
|
|
3118
3123
|
}, b = () => {
|
|
3119
3124
|
d(null), setTimeout(() => {
|
|
3120
3125
|
u([]);
|
|
3121
3126
|
}, 300);
|
|
3122
|
-
},
|
|
3127
|
+
}, p = () => {
|
|
3123
3128
|
g();
|
|
3124
3129
|
const x = va(c);
|
|
3125
3130
|
s(x, { replace: !0 }), b();
|
|
@@ -3135,7 +3140,7 @@ const va = (e) => {
|
|
|
3135
3140
|
u([]);
|
|
3136
3141
|
}, 300);
|
|
3137
3142
|
};
|
|
3138
|
-
return
|
|
3143
|
+
return m.useEffect(() => {
|
|
3139
3144
|
const x = Pa(y, o);
|
|
3140
3145
|
u(x);
|
|
3141
3146
|
}, [y, o, l]), /* @__PURE__ */ w(
|
|
@@ -3149,7 +3154,7 @@ const va = (e) => {
|
|
|
3149
3154
|
setColumnsFilter: u,
|
|
3150
3155
|
searchParams: o,
|
|
3151
3156
|
setSearchParams: s,
|
|
3152
|
-
handleApplyFilters:
|
|
3157
|
+
handleApplyFilters: p,
|
|
3153
3158
|
clearSearchParams: g,
|
|
3154
3159
|
clearFilters: A
|
|
3155
3160
|
},
|
|
@@ -3175,7 +3180,7 @@ const va = (e) => {
|
|
|
3175
3180
|
Vr,
|
|
3176
3181
|
{
|
|
3177
3182
|
id: "model-filter-popover",
|
|
3178
|
-
open:
|
|
3183
|
+
open: h,
|
|
3179
3184
|
anchorEl: l,
|
|
3180
3185
|
onClose: b,
|
|
3181
3186
|
anchorOrigin: {
|
|
@@ -3187,11 +3192,11 @@ const va = (e) => {
|
|
|
3187
3192
|
) : /* @__PURE__ */ w(
|
|
3188
3193
|
Et,
|
|
3189
3194
|
{
|
|
3190
|
-
open:
|
|
3195
|
+
open: h,
|
|
3191
3196
|
onClose: b,
|
|
3192
3197
|
fullWidth: !0,
|
|
3193
3198
|
children: [
|
|
3194
|
-
/* @__PURE__ */ w(
|
|
3199
|
+
/* @__PURE__ */ w(kt, { children: [
|
|
3195
3200
|
e("Filter :model", { model: r.plural() }),
|
|
3196
3201
|
/* @__PURE__ */ i(
|
|
3197
3202
|
q,
|
|
@@ -3202,7 +3207,7 @@ const va = (e) => {
|
|
|
3202
3207
|
}
|
|
3203
3208
|
)
|
|
3204
3209
|
] }),
|
|
3205
|
-
/* @__PURE__ */ i(
|
|
3210
|
+
/* @__PURE__ */ i(Tt, { dividers: !0, children: /* @__PURE__ */ i(pn, { dialog: !0 }) }),
|
|
3206
3211
|
/* @__PURE__ */ w(Dt, { children: [
|
|
3207
3212
|
/* @__PURE__ */ i(
|
|
3208
3213
|
M,
|
|
@@ -3216,7 +3221,7 @@ const va = (e) => {
|
|
|
3216
3221
|
M,
|
|
3217
3222
|
{
|
|
3218
3223
|
variant: "contained",
|
|
3219
|
-
onClick:
|
|
3224
|
+
onClick: p,
|
|
3220
3225
|
disabled: t.checkIfCanApplyFilters(c),
|
|
3221
3226
|
children: e("Apply")
|
|
3222
3227
|
}
|
|
@@ -3228,7 +3233,7 @@ const va = (e) => {
|
|
|
3228
3233
|
]
|
|
3229
3234
|
}
|
|
3230
3235
|
);
|
|
3231
|
-
}, zt =
|
|
3236
|
+
}, zt = m.createContext({
|
|
3232
3237
|
columns: [],
|
|
3233
3238
|
columnCount: 0,
|
|
3234
3239
|
selected: W([]),
|
|
@@ -3241,7 +3246,7 @@ function Vt() {
|
|
|
3241
3246
|
const {
|
|
3242
3247
|
selected: e,
|
|
3243
3248
|
items: t
|
|
3244
|
-
} =
|
|
3249
|
+
} = m.useContext(zt), n = yn(e), r = () => {
|
|
3245
3250
|
e.splice(0, e.count());
|
|
3246
3251
|
}, o = (c) => {
|
|
3247
3252
|
const u = e.search(c);
|
|
@@ -3270,13 +3275,13 @@ function Vt() {
|
|
|
3270
3275
|
};
|
|
3271
3276
|
}
|
|
3272
3277
|
function ae() {
|
|
3273
|
-
return
|
|
3278
|
+
return m.useContext(zt);
|
|
3274
3279
|
}
|
|
3275
3280
|
function La(e) {
|
|
3276
|
-
const [t, n] =
|
|
3281
|
+
const [t, n] = m.useState(""), { selected: r } = Vt(), { t: o } = L(), s = qt(), { massActions: a } = ae(), l = (c) => {
|
|
3277
3282
|
n(c.target.value);
|
|
3278
3283
|
};
|
|
3279
|
-
if (
|
|
3284
|
+
if (m.useEffect(() => {
|
|
3280
3285
|
r.isEmpty() && n("");
|
|
3281
3286
|
}, [r]), a.length === 0)
|
|
3282
3287
|
return null;
|
|
@@ -3352,7 +3357,7 @@ const Ba = () => {
|
|
|
3352
3357
|
children: /* @__PURE__ */ i(Rn, {})
|
|
3353
3358
|
}
|
|
3354
3359
|
);
|
|
3355
|
-
}, We =
|
|
3360
|
+
}, We = m.forwardRef(({ to: e, children: t, ...n }, r) => /* @__PURE__ */ i(
|
|
3356
3361
|
lt,
|
|
3357
3362
|
{
|
|
3358
3363
|
component: Pe,
|
|
@@ -3370,7 +3375,7 @@ const Ia = ({ label: e }) => isNaN(e) || isNaN(parseFloat(e)) ? /* @__PURE__ */
|
|
|
3370
3375
|
"Last »": /* @__PURE__ */ i(Pn, {}),
|
|
3371
3376
|
"« First": /* @__PURE__ */ i(vn, {})
|
|
3372
3377
|
}[e] || e }) : /* @__PURE__ */ i(B, { children: e }), Ma = ({ variant: e = "default", ...t }) => {
|
|
3373
|
-
const n = e === "default", [r, o] = G(), [s, a] =
|
|
3378
|
+
const n = e === "default", [r, o] = G(), [s, a] = m.useState(r.get("page") || "1"), {
|
|
3374
3379
|
links: l,
|
|
3375
3380
|
meta: {
|
|
3376
3381
|
current_page: d = 1,
|
|
@@ -3378,20 +3383,20 @@ const Ia = ({ label: e }) => isNaN(e) || isNaN(parseFloat(e)) ? /* @__PURE__ */
|
|
|
3378
3383
|
last_page: u = 1
|
|
3379
3384
|
} = {}
|
|
3380
3385
|
} = xe(), {
|
|
3381
|
-
first:
|
|
3386
|
+
first: h,
|
|
3382
3387
|
prev: y,
|
|
3383
3388
|
next: S,
|
|
3384
3389
|
last: b
|
|
3385
|
-
} = l || {},
|
|
3390
|
+
} = l || {}, p = (A) => {
|
|
3386
3391
|
A.preventDefault(), o((x) => (x.set("page", s || "1"), x));
|
|
3387
3392
|
}, g = [
|
|
3388
|
-
{ url: d > 1 ?
|
|
3393
|
+
{ url: d > 1 ? h : null, label: "« First", active: !1 },
|
|
3389
3394
|
{ url: y, label: "« Previous", active: !1 },
|
|
3390
3395
|
{
|
|
3391
3396
|
element: /* @__PURE__ */ i(
|
|
3392
3397
|
Ar,
|
|
3393
3398
|
{
|
|
3394
|
-
onSubmit:
|
|
3399
|
+
onSubmit: p,
|
|
3395
3400
|
preventScrollReset: !0,
|
|
3396
3401
|
children: /* @__PURE__ */ i(
|
|
3397
3402
|
fe,
|
|
@@ -3429,7 +3434,7 @@ const Ia = ({ label: e }) => isNaN(e) || isNaN(parseFloat(e)) ? /* @__PURE__ */
|
|
|
3429
3434
|
{ url: S, label: "Next »", active: !1 },
|
|
3430
3435
|
{ url: d < u ? b : null, label: "Last »", active: !1 }
|
|
3431
3436
|
];
|
|
3432
|
-
return
|
|
3437
|
+
return m.useEffect(() => {
|
|
3433
3438
|
d && a(String(d));
|
|
3434
3439
|
}, [d]), /* @__PURE__ */ i(
|
|
3435
3440
|
N,
|
|
@@ -3484,7 +3489,7 @@ const Ia = ({ label: e }) => isNaN(e) || isNaN(parseFloat(e)) ? /* @__PURE__ */
|
|
|
3484
3489
|
return l.set("per_page", s.target.value.toString()), l;
|
|
3485
3490
|
});
|
|
3486
3491
|
}, o = Ct(
|
|
3487
|
-
|
|
3492
|
+
T("cms"),
|
|
3488
3493
|
"perPageOptions",
|
|
3489
3494
|
[15, 30, 75, 150]
|
|
3490
3495
|
);
|
|
@@ -3533,8 +3538,8 @@ const Ia = ({ label: e }) => isNaN(e) || isNaN(parseFloat(e)) ? /* @__PURE__ */
|
|
|
3533
3538
|
);
|
|
3534
3539
|
};
|
|
3535
3540
|
function Ua(e, t) {
|
|
3536
|
-
const [n, r] =
|
|
3537
|
-
return
|
|
3541
|
+
const [n, r] = m.useState(!1);
|
|
3542
|
+
return m.useEffect(() => {
|
|
3538
3543
|
const o = /* @__PURE__ */ new Set(), s = (l) => {
|
|
3539
3544
|
o.add(l.key), e.every((d) => o.has(d)) && (r(!0), t && t());
|
|
3540
3545
|
}, a = (l) => {
|
|
@@ -3556,8 +3561,8 @@ const qa = Z(fe)(({ theme: e }) => ({
|
|
|
3556
3561
|
return e ? r.set("q", e) : r.delete("q"), r;
|
|
3557
3562
|
});
|
|
3558
3563
|
}, 500), Ha = () => {
|
|
3559
|
-
const [e, t] = G(), n = e.get("q") || "", [r, o] =
|
|
3560
|
-
|
|
3564
|
+
const [e, t] = G(), n = e.get("q") || "", [r, o] = m.useState(n), [s, a] = m.useState(!1), l = m.useRef(null), { t: d } = L();
|
|
3565
|
+
m.useEffect(() => {
|
|
3561
3566
|
o(n);
|
|
3562
3567
|
}, [n]);
|
|
3563
3568
|
const c = (y) => {
|
|
@@ -3566,7 +3571,7 @@ const qa = Z(fe)(({ theme: e }) => ({
|
|
|
3566
3571
|
Ua(["Control", "/"], () => {
|
|
3567
3572
|
l.current.focus();
|
|
3568
3573
|
});
|
|
3569
|
-
const
|
|
3574
|
+
const h = u ? 300 : "calc(100vw - 58px)";
|
|
3570
3575
|
return /* @__PURE__ */ w(B, { children: [
|
|
3571
3576
|
!u && !s && /* @__PURE__ */ i(q, { color: "inherit", onClick: () => a(!0), children: /* @__PURE__ */ i(
|
|
3572
3577
|
Rt,
|
|
@@ -3604,7 +3609,7 @@ const qa = Z(fe)(({ theme: e }) => ({
|
|
|
3604
3609
|
},
|
|
3605
3610
|
onChange: c,
|
|
3606
3611
|
onBlur: () => a(!1),
|
|
3607
|
-
sx: { width:
|
|
3612
|
+
sx: { width: h },
|
|
3608
3613
|
size: "small"
|
|
3609
3614
|
}
|
|
3610
3615
|
)
|
|
@@ -3623,10 +3628,10 @@ const qa = Z(fe)(({ theme: e }) => ({
|
|
|
3623
3628
|
const { t: e } = L(), [t, n] = G(), {
|
|
3624
3629
|
columns: r,
|
|
3625
3630
|
Model: o
|
|
3626
|
-
} = ae(), s = t.get("order_by") || "", [a = "", l = ""] = s.split(":"), [d, c] =
|
|
3631
|
+
} = ae(), s = t.get("order_by") || "", [a = "", l = ""] = s.split(":"), [d, c] = m.useState(a), [u, h] = m.useState(l), [y, S] = m.useState(!1), b = () => {
|
|
3627
3632
|
S(!0);
|
|
3628
|
-
},
|
|
3629
|
-
S(!1), c(a),
|
|
3633
|
+
}, p = () => {
|
|
3634
|
+
S(!1), c(a), h(l);
|
|
3630
3635
|
}, g = () => {
|
|
3631
3636
|
if (!d || !u) {
|
|
3632
3637
|
S(!1);
|
|
@@ -3640,7 +3645,7 @@ const qa = Z(fe)(({ theme: e }) => ({
|
|
|
3640
3645
|
n((x) => {
|
|
3641
3646
|
const E = new URLSearchParams(x);
|
|
3642
3647
|
return E.delete("order_by"), E;
|
|
3643
|
-
}), S(!1), c(""),
|
|
3648
|
+
}), S(!1), c(""), h("");
|
|
3644
3649
|
};
|
|
3645
3650
|
return /* @__PURE__ */ w(B, { children: [
|
|
3646
3651
|
/* @__PURE__ */ i(q, { onClick: b, children: /* @__PURE__ */ i(
|
|
@@ -3652,25 +3657,25 @@ const qa = Z(fe)(({ theme: e }) => ({
|
|
|
3652
3657
|
children: /* @__PURE__ */ i(Fn, {})
|
|
3653
3658
|
}
|
|
3654
3659
|
) }),
|
|
3655
|
-
/* @__PURE__ */ w(Et, { open: y, onClose:
|
|
3656
|
-
/* @__PURE__ */ w(
|
|
3660
|
+
/* @__PURE__ */ w(Et, { open: y, onClose: p, fullWidth: !0, children: [
|
|
3661
|
+
/* @__PURE__ */ w(kt, { children: [
|
|
3657
3662
|
e("Sort :model", { model: o.plural() }),
|
|
3658
3663
|
/* @__PURE__ */ i(
|
|
3659
3664
|
q,
|
|
3660
3665
|
{
|
|
3661
|
-
onClick:
|
|
3666
|
+
onClick: p,
|
|
3662
3667
|
sx: { position: "absolute", right: 8, top: 8 },
|
|
3663
3668
|
children: /* @__PURE__ */ i(Ne, {})
|
|
3664
3669
|
}
|
|
3665
3670
|
)
|
|
3666
3671
|
] }),
|
|
3667
|
-
/* @__PURE__ */ w(
|
|
3672
|
+
/* @__PURE__ */ w(Tt, { dividers: !0, children: [
|
|
3668
3673
|
/* @__PURE__ */ w(
|
|
3669
3674
|
$t,
|
|
3670
3675
|
{
|
|
3671
3676
|
value: d,
|
|
3672
3677
|
onChange: (x) => {
|
|
3673
|
-
c(x.target.value), u ||
|
|
3678
|
+
c(x.target.value), u || h("asc");
|
|
3674
3679
|
},
|
|
3675
3680
|
children: [
|
|
3676
3681
|
/* @__PURE__ */ i($, { variant: "caption", children: e("Column") }),
|
|
@@ -3693,7 +3698,7 @@ const qa = Z(fe)(({ theme: e }) => ({
|
|
|
3693
3698
|
$t,
|
|
3694
3699
|
{
|
|
3695
3700
|
value: u,
|
|
3696
|
-
onChange: (x) =>
|
|
3701
|
+
onChange: (x) => h(x.target.value),
|
|
3697
3702
|
children: [
|
|
3698
3703
|
/* @__PURE__ */ i(
|
|
3699
3704
|
Ke,
|
|
@@ -3728,17 +3733,17 @@ const qa = Z(fe)(({ theme: e }) => ({
|
|
|
3728
3733
|
] })
|
|
3729
3734
|
] });
|
|
3730
3735
|
}, Wa = ({ items: e, loading: t, children: n, error: r }) => {
|
|
3731
|
-
const o = te(), s =
|
|
3736
|
+
const o = te(), s = m.useMemo(() => W([]), [o, e]), [a] = G(), l = a.get("tab") ?? "all", d = m.useMemo(() => [
|
|
3732
3737
|
{
|
|
3733
3738
|
key: o.getSchema().labeledBy,
|
|
3734
|
-
label:
|
|
3739
|
+
label: k.human(o.getSchema().labeledBy)
|
|
3735
3740
|
}
|
|
3736
|
-
], [o]), c = v(), u =
|
|
3737
|
-
|
|
3738
|
-
`model${
|
|
3741
|
+
], [o]), c = v(), u = m.useMemo(() => T("cms").getMassActions(o, l), [o, l]), h = Ct(
|
|
3742
|
+
T("cms"),
|
|
3743
|
+
`model${k.studly(o.getSchemaName())}Columns`,
|
|
3739
3744
|
d
|
|
3740
|
-
), S = (c ?
|
|
3741
|
-
columns:
|
|
3745
|
+
), S = (c ? h.length : 1) + (u.length > 0 ? 2 : 1), b = {
|
|
3746
|
+
columns: h,
|
|
3742
3747
|
columnCount: S,
|
|
3743
3748
|
massActions: u,
|
|
3744
3749
|
items: e,
|
|
@@ -3772,8 +3777,8 @@ const qa = Z(fe)(({ theme: e }) => ({
|
|
|
3772
3777
|
allSelected: c,
|
|
3773
3778
|
handleSelectToggleAll: u
|
|
3774
3779
|
} = Vt(), {
|
|
3775
|
-
["ModelIndex.Table.ShrinkedCell"]:
|
|
3776
|
-
} =
|
|
3780
|
+
["ModelIndex.Table.ShrinkedCell"]: h
|
|
3781
|
+
} = T("cms").getComponents(), y = a.get("order_by") || "", [S, b] = y.split(":"), p = (g) => () => {
|
|
3777
3782
|
l(S === g ? (A) => {
|
|
3778
3783
|
const x = new URLSearchParams(A);
|
|
3779
3784
|
return b ? b === "desc" ? (x.delete("order_by"), x) : (x.set("order_by", `${g}:desc`), x) : (x.set("order_by", `${g}:asc`), x);
|
|
@@ -3785,7 +3790,7 @@ const qa = Z(fe)(({ theme: e }) => ({
|
|
|
3785
3790
|
return /* @__PURE__ */ w(Kr, { ...t, children: [
|
|
3786
3791
|
e,
|
|
3787
3792
|
s && /* @__PURE__ */ w(he, { children: [
|
|
3788
|
-
n.length > 0 && /* @__PURE__ */ i(
|
|
3793
|
+
n.length > 0 && /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(
|
|
3789
3794
|
Pt,
|
|
3790
3795
|
{
|
|
3791
3796
|
indeterminate: d,
|
|
@@ -3804,7 +3809,7 @@ const qa = Z(fe)(({ theme: e }) => ({
|
|
|
3804
3809
|
{
|
|
3805
3810
|
active: x && S === g,
|
|
3806
3811
|
direction: b,
|
|
3807
|
-
onClick:
|
|
3812
|
+
onClick: p(g),
|
|
3808
3813
|
children: [
|
|
3809
3814
|
A,
|
|
3810
3815
|
x && S === g ? /* @__PURE__ */ i(H, { component: "span", sx: { visibility: "hidden", display: "none" }, children: b === "desc" ? "sorted descending" : "sorted ascending" }) : null
|
|
@@ -3814,7 +3819,7 @@ const qa = Z(fe)(({ theme: e }) => ({
|
|
|
3814
3819
|
},
|
|
3815
3820
|
g
|
|
3816
3821
|
)),
|
|
3817
|
-
/* @__PURE__ */ i(
|
|
3822
|
+
/* @__PURE__ */ i(h, {})
|
|
3818
3823
|
] })
|
|
3819
3824
|
] });
|
|
3820
3825
|
}, Ya = () => {
|
|
@@ -3824,10 +3829,10 @@ const qa = Z(fe)(({ theme: e }) => ({
|
|
|
3824
3829
|
items: n
|
|
3825
3830
|
} = ae(), r = v(), {
|
|
3826
3831
|
["ModelIndex.Table.ShrinkedCell"]: o
|
|
3827
|
-
} =
|
|
3832
|
+
} = T("cms").getComponents(), s = (n == null ? void 0 : n.count()) || 15;
|
|
3828
3833
|
return /* @__PURE__ */ i(B, { children: Array.from({ length: s }).map((a, l) => /* @__PURE__ */ w(he, { children: [
|
|
3829
3834
|
e.length > 0 && /* @__PURE__ */ i(o, { children: /* @__PURE__ */ i(Pt, {}) }),
|
|
3830
|
-
r && t.map(({ key: d, label: c, sortable: u, ...
|
|
3835
|
+
r && t.map(({ key: d, label: c, sortable: u, ...h }, y) => /* @__PURE__ */ i(ee, { ...h, children: /* @__PURE__ */ i(
|
|
3831
3836
|
Kt,
|
|
3832
3837
|
{
|
|
3833
3838
|
variant: "text",
|
|
@@ -3852,7 +3857,7 @@ const qa = Z(fe)(({ theme: e }) => ({
|
|
|
3852
3857
|
columnCount: a
|
|
3853
3858
|
} = ae(), {
|
|
3854
3859
|
["ModelIndex.StaticActions"]: l
|
|
3855
|
-
} =
|
|
3860
|
+
} = T("cms").getComponents(), d = m.isValidElement(e) ? e : (o || W([])).map(e);
|
|
3856
3861
|
return /* @__PURE__ */ i(Jr, { ...t, children: s || !(o != null && o.every((c) => c.getType() === n.getSchemaName())) ? /* @__PURE__ */ i(Ya, {}) : o && o.count() ? d : /* @__PURE__ */ i(he, { children: /* @__PURE__ */ w(ee, { colSpan: a, sx: { textAlign: "center", py: 10 }, children: [
|
|
3857
3862
|
/* @__PURE__ */ i($, { children: r("No :model found", {
|
|
3858
3863
|
model: n.plural().toLocaleLowerCase()
|
|
@@ -3873,7 +3878,7 @@ const I = St(Ga, xt), de = Z($)(() => ({
|
|
|
3873
3878
|
"& label": {
|
|
3874
3879
|
fontWeight: "bold"
|
|
3875
3880
|
}
|
|
3876
|
-
})), Za = ({ content: e }) => ["string", "number"].includes(typeof e) ? /* @__PURE__ */ i(de, { children: e }) : e instanceof Date ? /* @__PURE__ */ i(de, { children: e.toLocaleString(oe("app.locale", "en")) }) : typeof e == "object" && !
|
|
3881
|
+
})), Za = ({ content: e }) => ["string", "number"].includes(typeof e) ? /* @__PURE__ */ i(de, { children: e }) : e instanceof Date ? /* @__PURE__ */ i(de, { children: e.toLocaleString(oe("app.locale", "en")) }) : typeof e == "object" && !m.isValidElement(e) ? /* @__PURE__ */ i(de, { children: JSON.stringify(e) }) : /* @__PURE__ */ i(m.Fragment, { children: e }), Xa = ({ label: e, content: t }) => ["string", "number"].includes(typeof t) ? /* @__PURE__ */ w(de, { children: [
|
|
3877
3882
|
/* @__PURE__ */ w("label", { children: [
|
|
3878
3883
|
e,
|
|
3879
3884
|
":"
|
|
@@ -3886,14 +3891,14 @@ const I = St(Ga, xt), de = Z($)(() => ({
|
|
|
3886
3891
|
":"
|
|
3887
3892
|
] }),
|
|
3888
3893
|
t.toLocaleString(oe("app.locale", "en"))
|
|
3889
|
-
] }) : typeof t == "object" && !
|
|
3894
|
+
] }) : typeof t == "object" && !m.isValidElement(t) ? /* @__PURE__ */ w(de, { children: [
|
|
3890
3895
|
/* @__PURE__ */ w("label", { children: [
|
|
3891
3896
|
e,
|
|
3892
3897
|
":"
|
|
3893
3898
|
] }),
|
|
3894
3899
|
" ",
|
|
3895
3900
|
JSON.stringify(t)
|
|
3896
|
-
] }) : /* @__PURE__ */ w(
|
|
3901
|
+
] }) : /* @__PURE__ */ w(m.Fragment, { children: [
|
|
3897
3902
|
/* @__PURE__ */ i($, { sx: { display: "inline" }, children: /* @__PURE__ */ w("b", { children: [
|
|
3898
3903
|
e,
|
|
3899
3904
|
":"
|
|
@@ -3901,16 +3906,16 @@ const I = St(Ga, xt), de = Z($)(() => ({
|
|
|
3901
3906
|
" ",
|
|
3902
3907
|
t
|
|
3903
3908
|
] }), Qa = ({ item: e, ...t }) => {
|
|
3904
|
-
const n = v(), r = At(), o = te(), { massActions: s, columns: a } = ae(), l =
|
|
3909
|
+
const n = v(), r = At(), o = te(), { massActions: s, columns: a } = ae(), l = m.useMemo(() => a.map((y) => ({
|
|
3905
3910
|
...y,
|
|
3906
|
-
content: I[`model${
|
|
3911
|
+
content: I[`model${k.studly(e.getType())}Get${k.studly(y.key)}Content`](J.get(e, y.key), e)
|
|
3907
3912
|
//
|
|
3908
3913
|
})), [a, e]), {
|
|
3909
3914
|
["ModelIndex.Table.ShrinkedCell"]: d,
|
|
3910
3915
|
["ModelIndex.InstanceActions"]: c
|
|
3911
3916
|
} = I.getComponents(), {
|
|
3912
3917
|
isSelected: u,
|
|
3913
|
-
handleSelectToggle:
|
|
3918
|
+
handleSelectToggle: h
|
|
3914
3919
|
} = Vt();
|
|
3915
3920
|
return /* @__PURE__ */ w(
|
|
3916
3921
|
he,
|
|
@@ -3924,21 +3929,21 @@ const I = St(Ga, xt), de = Z($)(() => ({
|
|
|
3924
3929
|
Pt,
|
|
3925
3930
|
{
|
|
3926
3931
|
checked: u(e),
|
|
3927
|
-
onChange: () =>
|
|
3932
|
+
onChange: () => h(e)
|
|
3928
3933
|
}
|
|
3929
3934
|
) }),
|
|
3930
|
-
n && l.map(({ key: y, label: S, sortable: b, content:
|
|
3935
|
+
n && l.map(({ key: y, label: S, sortable: b, content: p, ...g }) => /* @__PURE__ */ i(
|
|
3931
3936
|
ee,
|
|
3932
3937
|
{
|
|
3933
3938
|
...g,
|
|
3934
3939
|
onClick: () => {
|
|
3935
|
-
e.deletedAt || r(`/${
|
|
3940
|
+
e.deletedAt || r(`/${k.kebab(o.plural())}/${e.getKey()}`);
|
|
3936
3941
|
},
|
|
3937
3942
|
children: /* @__PURE__ */ i(
|
|
3938
3943
|
Za,
|
|
3939
3944
|
{
|
|
3940
3945
|
label: S,
|
|
3941
|
-
content:
|
|
3946
|
+
content: p
|
|
3942
3947
|
}
|
|
3943
3948
|
)
|
|
3944
3949
|
},
|
|
@@ -3949,7 +3954,7 @@ const I = St(Ga, xt), de = Z($)(() => ({
|
|
|
3949
3954
|
{
|
|
3950
3955
|
sx: { maxWidth: 0, px: 0 },
|
|
3951
3956
|
onClick: () => {
|
|
3952
|
-
e.deletedAt || r(`/${
|
|
3957
|
+
e.deletedAt || r(`/${k.kebab(o.plural())}/${e.getKey()}`);
|
|
3953
3958
|
},
|
|
3954
3959
|
children: l.map(({ key: y, ...S }) => /* @__PURE__ */ i(Xa, { ...S }, y))
|
|
3955
3960
|
}
|
|
@@ -3965,7 +3970,7 @@ const I = St(Ga, xt), de = Z($)(() => ({
|
|
|
3965
3970
|
["ModelIndex.Pagination"]: s,
|
|
3966
3971
|
["ModelIndex.PaginationDetails"]: a,
|
|
3967
3972
|
["ModelIndex.PerPageSwitch"]: l
|
|
3968
|
-
} =
|
|
3973
|
+
} = T("cms").getComponents();
|
|
3969
3974
|
return /* @__PURE__ */ w(Gr, { ...t, children: [
|
|
3970
3975
|
/* @__PURE__ */ i(he, { children: /* @__PURE__ */ i(ee, { colSpan: n, children: /* @__PURE__ */ w(
|
|
3971
3976
|
N,
|
|
@@ -4010,7 +4015,7 @@ const I = St(Ga, xt), de = Z($)(() => ({
|
|
|
4010
4015
|
["ModelIndex.Sort"]: r,
|
|
4011
4016
|
["ModelIndex.Pagination"]: o
|
|
4012
4017
|
// ['ModelIndex.PaginationDetails']: PaginationDetails,
|
|
4013
|
-
} =
|
|
4018
|
+
} = T("cms").getComponents(), s = v(), a = z("breakpoint", "md");
|
|
4014
4019
|
return /* @__PURE__ */ i(he, { children: /* @__PURE__ */ i(ee, { colSpan: e, sx: { p: 1 }, children: /* @__PURE__ */ w(
|
|
4015
4020
|
N,
|
|
4016
4021
|
{
|
|
@@ -4057,9 +4062,9 @@ function ni() {
|
|
|
4057
4062
|
const u = new URLSearchParams();
|
|
4058
4063
|
return c !== "all" && u.set("tab", c), u;
|
|
4059
4064
|
});
|
|
4060
|
-
}, a =
|
|
4061
|
-
|
|
4062
|
-
`model${
|
|
4065
|
+
}, a = m.useMemo(() => e.getSchema().softDeletes ? [{ label: t("Trashed"), value: "trashed" }] : [], [e, t]), l = Ct(
|
|
4066
|
+
T("cms"),
|
|
4067
|
+
`model${k.studly(e.getSchemaName())}Tabs`,
|
|
4063
4068
|
a
|
|
4064
4069
|
);
|
|
4065
4070
|
return l.length === 0 ? null : /* @__PURE__ */ i(H, { sx: { maxWidth: { xs: 320, sm: 480 }, bgcolor: "background.paper" }, children: /* @__PURE__ */ w(
|
|
@@ -4140,19 +4145,19 @@ const hr = ({
|
|
|
4140
4145
|
onClick: n,
|
|
4141
4146
|
...r
|
|
4142
4147
|
}) => {
|
|
4143
|
-
const [o, s] =
|
|
4148
|
+
const [o, s] = m.useState(null), [a, l] = m.useState(null), [d, c] = m.useState({}), u = z("drawer.width", 280), h = T("cms").getComponent("RecursiveMenu");
|
|
4144
4149
|
return /* @__PURE__ */ w(Qr, { ...r, children: [
|
|
4145
4150
|
t.map((y) => {
|
|
4146
4151
|
const {
|
|
4147
4152
|
text: S,
|
|
4148
4153
|
icon: b,
|
|
4149
|
-
element:
|
|
4154
|
+
element: p = null,
|
|
4150
4155
|
key: g,
|
|
4151
4156
|
children: A,
|
|
4152
4157
|
to: x,
|
|
4153
4158
|
onClick: E
|
|
4154
4159
|
} = y;
|
|
4155
|
-
return
|
|
4160
|
+
return p || /* @__PURE__ */ w(
|
|
4156
4161
|
eo,
|
|
4157
4162
|
{
|
|
4158
4163
|
disablePadding: !0,
|
|
@@ -4234,7 +4239,7 @@ const hr = ({
|
|
|
4234
4239
|
);
|
|
4235
4240
|
}),
|
|
4236
4241
|
e && /* @__PURE__ */ i(
|
|
4237
|
-
|
|
4242
|
+
h,
|
|
4238
4243
|
{
|
|
4239
4244
|
items: a || [],
|
|
4240
4245
|
onClick: n,
|
|
@@ -4256,14 +4261,14 @@ const hr = ({
|
|
|
4256
4261
|
onClick: n,
|
|
4257
4262
|
...r
|
|
4258
4263
|
}) => {
|
|
4259
|
-
const [o, s] =
|
|
4264
|
+
const [o, s] = m.useState({}), a = z("drawer.width", 280);
|
|
4260
4265
|
return /* @__PURE__ */ w(B, { children: [
|
|
4261
4266
|
/* @__PURE__ */ i(En, { ...r, children: t.map((l) => {
|
|
4262
4267
|
const {
|
|
4263
4268
|
text: d,
|
|
4264
4269
|
icon: c,
|
|
4265
4270
|
element: u = null,
|
|
4266
|
-
key:
|
|
4271
|
+
key: h,
|
|
4267
4272
|
children: y,
|
|
4268
4273
|
onClick: S,
|
|
4269
4274
|
to: b
|
|
@@ -4271,15 +4276,15 @@ const hr = ({
|
|
|
4271
4276
|
return u || /* @__PURE__ */ w(
|
|
4272
4277
|
se,
|
|
4273
4278
|
{
|
|
4274
|
-
onClick: (
|
|
4275
|
-
if (S && S(
|
|
4279
|
+
onClick: (p) => {
|
|
4280
|
+
if (S && S(p), y) {
|
|
4276
4281
|
s({
|
|
4277
4282
|
...o,
|
|
4278
|
-
[
|
|
4283
|
+
[h]: o[h] ? null : p.currentTarget
|
|
4279
4284
|
});
|
|
4280
4285
|
return;
|
|
4281
4286
|
}
|
|
4282
|
-
n && n(
|
|
4287
|
+
n && n(p);
|
|
4283
4288
|
},
|
|
4284
4289
|
...b ? {
|
|
4285
4290
|
component: We,
|
|
@@ -4303,7 +4308,7 @@ const hr = ({
|
|
|
4303
4308
|
!e && y && /* @__PURE__ */ i(Ue, {})
|
|
4304
4309
|
]
|
|
4305
4310
|
},
|
|
4306
|
-
|
|
4311
|
+
h
|
|
4307
4312
|
);
|
|
4308
4313
|
}) }),
|
|
4309
4314
|
t.map((l) => {
|
|
@@ -4332,14 +4337,14 @@ const hr = ({
|
|
|
4332
4337
|
title: e.getSchema().softDeletes ? s("Confirm send to trash") : s("Confirm delete permanently"),
|
|
4333
4338
|
message: s(`Are you sure you want to ${a} :count :model?`, {
|
|
4334
4339
|
count: t.count(),
|
|
4335
|
-
model:
|
|
4340
|
+
model: k.lcfirst(t.count() === 1 ? e.singular() : e.plural())
|
|
4336
4341
|
}),
|
|
4337
4342
|
type: "confirm"
|
|
4338
4343
|
}))
|
|
4339
4344
|
try {
|
|
4340
4345
|
await e.delete(t.pluck(e.getSchema().primaryKey).all()), n(s(`Successfully ${l} :count :model`, {
|
|
4341
4346
|
count: t.count(),
|
|
4342
|
-
model:
|
|
4347
|
+
model: k.lcfirst(t.count() === 1 ? e.singular() : e.plural())
|
|
4343
4348
|
})), o();
|
|
4344
4349
|
} catch (c) {
|
|
4345
4350
|
ce(n)(c);
|
|
@@ -4350,14 +4355,14 @@ const hr = ({
|
|
|
4350
4355
|
title: s("Confirm restore"),
|
|
4351
4356
|
message: s("Are you sure you want to restore :count :model?", {
|
|
4352
4357
|
count: t.count(),
|
|
4353
|
-
model:
|
|
4358
|
+
model: k.lcfirst(t.count() === 1 ? e.singular() : e.plural())
|
|
4354
4359
|
}),
|
|
4355
4360
|
type: "confirm"
|
|
4356
4361
|
}))
|
|
4357
4362
|
try {
|
|
4358
4363
|
await e.restore(t.pluck(e.getSchema().primaryKey).all()), n(s("Successfully restored :count :model", {
|
|
4359
4364
|
count: t.count(),
|
|
4360
|
-
model:
|
|
4365
|
+
model: k.lcfirst(t.count() === 1 ? e.singular() : e.plural())
|
|
4361
4366
|
})), o();
|
|
4362
4367
|
} catch (l) {
|
|
4363
4368
|
ce(n)(l);
|
|
@@ -4368,14 +4373,14 @@ const hr = ({
|
|
|
4368
4373
|
title: s("Confirm permanent deletion"),
|
|
4369
4374
|
message: s("Are you sure you want to delete permanently :count :model?", {
|
|
4370
4375
|
count: t.count(),
|
|
4371
|
-
model:
|
|
4376
|
+
model: k.lcfirst(t.count() === 1 ? e.singular() : e.plural())
|
|
4372
4377
|
}),
|
|
4373
4378
|
type: "confirm"
|
|
4374
4379
|
}))
|
|
4375
4380
|
try {
|
|
4376
4381
|
await e.forceDelete(t.pluck(e.getSchema().primaryKey).all()), n(s("Successfully deleted :count :model", {
|
|
4377
4382
|
count: t.count(),
|
|
4378
|
-
model:
|
|
4383
|
+
model: k.lcfirst(t.count() === 1 ? e.singular() : e.plural())
|
|
4379
4384
|
})), o();
|
|
4380
4385
|
} catch (l) {
|
|
4381
4386
|
ce(n)(l);
|
|
@@ -4387,7 +4392,7 @@ const hr = ({
|
|
|
4387
4392
|
if (await r({
|
|
4388
4393
|
title: e.getSchema().softDeletes ? s("Confirm send to trash") : s("Confirm permanent deletion"),
|
|
4389
4394
|
message: s(`Are you sure you want to ${a}?`, {
|
|
4390
|
-
model:
|
|
4395
|
+
model: k.lcfirst(e.singular()),
|
|
4391
4396
|
label: t.getLabel()
|
|
4392
4397
|
}),
|
|
4393
4398
|
type: "confirm"
|
|
@@ -4405,7 +4410,7 @@ const hr = ({
|
|
|
4405
4410
|
if (await r({
|
|
4406
4411
|
title: s("Confirm restore"),
|
|
4407
4412
|
message: s("Are you sure you want to restore :model “:label”?", {
|
|
4408
|
-
model:
|
|
4413
|
+
model: k.lcfirst(e.singular()),
|
|
4409
4414
|
label: t.getLabel()
|
|
4410
4415
|
}),
|
|
4411
4416
|
type: "confirm"
|
|
@@ -4423,7 +4428,7 @@ const hr = ({
|
|
|
4423
4428
|
if (await r({
|
|
4424
4429
|
title: s("Confirm permanent deletion"),
|
|
4425
4430
|
message: s("Are you sure you want to delete :model “:label” permanently?", {
|
|
4426
|
-
model:
|
|
4431
|
+
model: k.lcfirst(e.singular()),
|
|
4427
4432
|
label: t.getLabel()
|
|
4428
4433
|
}),
|
|
4429
4434
|
type: "confirm"
|
|
@@ -4439,7 +4444,7 @@ const hr = ({
|
|
|
4439
4444
|
}
|
|
4440
4445
|
}, oi = {
|
|
4441
4446
|
create: (e) => ({ navigate: t }) => {
|
|
4442
|
-
t(`/${
|
|
4447
|
+
t(`/${k.kebab(e.plural())}/create`);
|
|
4443
4448
|
}
|
|
4444
4449
|
};
|
|
4445
4450
|
class si {
|
|
@@ -4447,7 +4452,7 @@ class si {
|
|
|
4447
4452
|
return "icon";
|
|
4448
4453
|
}
|
|
4449
4454
|
}
|
|
4450
|
-
const
|
|
4455
|
+
const ke = St(si, xt);
|
|
4451
4456
|
class ai {
|
|
4452
4457
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4453
4458
|
getComponents() {
|
|
@@ -4467,21 +4472,21 @@ class ai {
|
|
|
4467
4472
|
return this.wireModelFormProps({}, t);
|
|
4468
4473
|
}
|
|
4469
4474
|
getMassActions(t, n) {
|
|
4470
|
-
return this[`mass${
|
|
4475
|
+
return this[`mass${k.studly(t.getSchemaName())}Actions`](
|
|
4471
4476
|
this.massActions([], t, n),
|
|
4472
4477
|
t,
|
|
4473
4478
|
n
|
|
4474
4479
|
);
|
|
4475
4480
|
}
|
|
4476
4481
|
getInstanceActions(t, n) {
|
|
4477
|
-
return this[`instance${
|
|
4482
|
+
return this[`instance${k.studly(t.getSchemaName())}Actions`](
|
|
4478
4483
|
this.instanceActions([], t, n),
|
|
4479
4484
|
t,
|
|
4480
4485
|
n
|
|
4481
4486
|
);
|
|
4482
4487
|
}
|
|
4483
4488
|
getStaticActions(t, n) {
|
|
4484
|
-
return this[`static${
|
|
4489
|
+
return this[`static${k.studly(t.getSchemaName())}Actions`](
|
|
4485
4490
|
this.staticActions([], t, n),
|
|
4486
4491
|
t,
|
|
4487
4492
|
n
|
|
@@ -4543,7 +4548,7 @@ class li {
|
|
|
4543
4548
|
r = "<=";
|
|
4544
4549
|
break;
|
|
4545
4550
|
default:
|
|
4546
|
-
r =
|
|
4551
|
+
r = k.human(r);
|
|
4547
4552
|
break;
|
|
4548
4553
|
}
|
|
4549
4554
|
return {
|
|
@@ -4558,7 +4563,7 @@ class li {
|
|
|
4558
4563
|
let a = s.phpType ?? "string";
|
|
4559
4564
|
return s.cast !== null && !J.isEmpty(s.cast) && (a = s.cast), {
|
|
4560
4565
|
key: s.name,
|
|
4561
|
-
label:
|
|
4566
|
+
label: k.human(s.name),
|
|
4562
4567
|
type: a,
|
|
4563
4568
|
nullable: s.nullable,
|
|
4564
4569
|
is_relation: !1
|
|
@@ -4569,7 +4574,7 @@ class li {
|
|
|
4569
4574
|
...s,
|
|
4570
4575
|
{
|
|
4571
4576
|
key: a,
|
|
4572
|
-
label:
|
|
4577
|
+
label: k.human(a),
|
|
4573
4578
|
type: "autocomplete",
|
|
4574
4579
|
nullable: !1,
|
|
4575
4580
|
is_relation: !0
|
|
@@ -4609,7 +4614,7 @@ class ui {
|
|
|
4609
4614
|
);
|
|
4610
4615
|
}
|
|
4611
4616
|
forModel(t, n) {
|
|
4612
|
-
Re.reducer(`model${
|
|
4617
|
+
Re.reducer(`model${k.studly(t)}`, (r) => {
|
|
4613
4618
|
const o = this;
|
|
4614
4619
|
return class extends r {
|
|
4615
4620
|
static icon() {
|
|
@@ -4635,7 +4640,7 @@ class ui {
|
|
|
4635
4640
|
}
|
|
4636
4641
|
}
|
|
4637
4642
|
const di = ({ item: e }) => {
|
|
4638
|
-
const t = qt(), [n] = G(), r = n.get("tab") ?? "all", o =
|
|
4643
|
+
const t = qt(), [n] = G(), r = n.get("tab") ?? "all", o = m.useMemo(() => T("cms").getInstanceActions(e.constructor, r), [e, r]), [s, a] = m.useState(null), l = !!s, d = (u) => {
|
|
4639
4644
|
a(u.currentTarget);
|
|
4640
4645
|
}, c = () => {
|
|
4641
4646
|
a(null);
|
|
@@ -4721,11 +4726,11 @@ const Ie = class Ie extends bn {
|
|
|
4721
4726
|
// );
|
|
4722
4727
|
// }
|
|
4723
4728
|
registerIcons() {
|
|
4724
|
-
|
|
4729
|
+
ke.registerIcon({
|
|
4725
4730
|
Add: ao,
|
|
4726
4731
|
AddCircleOutline: Dn,
|
|
4727
4732
|
ArrowDownward: Bn,
|
|
4728
|
-
ArrowDropDown:
|
|
4733
|
+
ArrowDropDown: Tn,
|
|
4729
4734
|
ArrowUpward: Ln,
|
|
4730
4735
|
CategoryOutlined: io,
|
|
4731
4736
|
ChevronLeft: je,
|
|
@@ -4743,7 +4748,7 @@ const Ie = class Ie extends bn {
|
|
|
4743
4748
|
PeopleOutlined: co,
|
|
4744
4749
|
Search: ut,
|
|
4745
4750
|
SwapVert: Fn
|
|
4746
|
-
}),
|
|
4751
|
+
}), ke.forModel("user", "PeopleOutlined");
|
|
4747
4752
|
}
|
|
4748
4753
|
bootRoutes() {
|
|
4749
4754
|
I.reducer("cmsRoutes", So, 0), wr.reducer("domRouterOptions", (t) => ({
|
|
@@ -4755,7 +4760,7 @@ const Ie = class Ie extends bn {
|
|
|
4755
4760
|
I.reducer("componentMap", () => ({
|
|
4756
4761
|
Layout: Eo,
|
|
4757
4762
|
Dashboard: xo,
|
|
4758
|
-
ModelIndex:
|
|
4763
|
+
ModelIndex: To,
|
|
4759
4764
|
ModelItem: aa,
|
|
4760
4765
|
Error: Ao,
|
|
4761
4766
|
DesktopPageTitle: Sa,
|
|
@@ -4793,12 +4798,12 @@ const Ie = class Ie extends bn {
|
|
|
4793
4798
|
key: "dashboard",
|
|
4794
4799
|
text: "Dashboard",
|
|
4795
4800
|
to: "/",
|
|
4796
|
-
icon:
|
|
4801
|
+
icon: ke.render("DashboardOutlined")
|
|
4797
4802
|
},
|
|
4798
4803
|
...Object.entries(n).sort(([r], [o]) => r.localeCompare(o)).map(([r, o]) => ({
|
|
4799
4804
|
key: r,
|
|
4800
4805
|
text: o.plural(),
|
|
4801
|
-
to: "/" +
|
|
4806
|
+
to: "/" + k.kebab(o.plural()),
|
|
4802
4807
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4803
4808
|
icon: o.icon()
|
|
4804
4809
|
}))
|
|
@@ -4875,7 +4880,7 @@ const Ie = class Ie extends bn {
|
|
|
4875
4880
|
key: "create",
|
|
4876
4881
|
label: `Create ${n.singular()}`,
|
|
4877
4882
|
callback: oi.create(n),
|
|
4878
|
-
icon:
|
|
4883
|
+
icon: ke.render("Add")
|
|
4879
4884
|
}
|
|
4880
4885
|
], 0);
|
|
4881
4886
|
}
|
|
@@ -4930,7 +4935,7 @@ class mi extends bn {
|
|
|
4930
4935
|
translateModelColumns() {
|
|
4931
4936
|
for (const t of Object.keys(Re.make()))
|
|
4932
4937
|
I.reducer(
|
|
4933
|
-
`model${
|
|
4938
|
+
`model${k.studly(t)}Columns`,
|
|
4934
4939
|
(n) => n.map((r) => ({
|
|
4935
4940
|
...r,
|
|
4936
4941
|
label: Y.t(r.label)
|
|
@@ -4980,7 +4985,7 @@ class mi extends bn {
|
|
|
4980
4985
|
);
|
|
4981
4986
|
}
|
|
4982
4987
|
translateFormLabels() {
|
|
4983
|
-
|
|
4988
|
+
kr.reducer(
|
|
4984
4989
|
"getDefaultInputProps",
|
|
4985
4990
|
(t) => Array.isArray(t) ? t.map((n) => ({
|
|
4986
4991
|
...n,
|
|
@@ -5009,13 +5014,13 @@ const gi = {
|
|
|
5009
5014
|
providers: n,
|
|
5010
5015
|
...r
|
|
5011
5016
|
}) => {
|
|
5012
|
-
const o = Me("(prefers-color-scheme: dark)"), s =
|
|
5017
|
+
const o = Me("(prefers-color-scheme: dark)"), s = m.useMemo(() => uo({
|
|
5013
5018
|
...e,
|
|
5014
5019
|
palette: {
|
|
5015
5020
|
...e.palette,
|
|
5016
5021
|
mode: o ? "dark" : "light"
|
|
5017
5022
|
}
|
|
5018
|
-
}, ...t ?? []), [e, o, t]), a =
|
|
5023
|
+
}, ...t ?? []), [e, o, t]), a = m.useMemo(() => [
|
|
5019
5024
|
wt,
|
|
5020
5025
|
mi,
|
|
5021
5026
|
...n || []
|
|
@@ -5023,7 +5028,7 @@ const gi = {
|
|
|
5023
5028
|
return /* @__PURE__ */ w(fo, { theme: s, children: [
|
|
5024
5029
|
/* @__PURE__ */ i(ro, {}),
|
|
5025
5030
|
/* @__PURE__ */ i(
|
|
5026
|
-
|
|
5031
|
+
Tr,
|
|
5027
5032
|
{
|
|
5028
5033
|
routes: bi,
|
|
5029
5034
|
providers: a,
|
|
@@ -5043,7 +5048,7 @@ export {
|
|
|
5043
5048
|
wt as CmsServiceProvider,
|
|
5044
5049
|
go as DialogProvider,
|
|
5045
5050
|
Gi as Filter,
|
|
5046
|
-
|
|
5051
|
+
ke as Icon,
|
|
5047
5052
|
po as LayoutProvider,
|
|
5048
5053
|
We as Link,
|
|
5049
5054
|
Ji as LuminixCms,
|
|
@@ -5063,7 +5068,7 @@ export {
|
|
|
5063
5068
|
_t as useMenu,
|
|
5064
5069
|
Ut as useNotify,
|
|
5065
5070
|
ur as usePageTitle,
|
|
5066
|
-
|
|
5071
|
+
ko as useSearch,
|
|
5067
5072
|
Vt as useSelection,
|
|
5068
5073
|
Bt as useSetPageTitle,
|
|
5069
5074
|
ae as useTable
|