master-data-management-react 0.0.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,2145 +1,681 @@
1
- import mn, { createContext as hn, useContext as Tn, useRef as Ze, useState as H, useEffect as be, useMemo as Oe, useCallback as ye } from "react";
2
- import { useNavigate as Ut, useParams as Rn, Routes as Sn, Route as Te, Navigate as An } from "react-router-dom";
3
- import { styled as ie, Box as M, Select as yn, FormControl as gn, CircularProgress as Pe, Divider as bn, Button as re, Typography as pe, Paper as kt, Autocomplete as et, TextField as Z, Menu as On, MenuItem as We, Alert as _n } from "@mui/material";
4
- import { AgGridReact as wn } from "ag-grid-react";
5
- import { ModuleRegistry as xn, ClientSideRowModelModule as Bt, AllCommunityModule as Cn } from "ag-grid-community";
6
- var Ie = { exports: {} }, Re = {};
7
- var ct;
8
- function Nn() {
9
- if (ct) return Re;
10
- ct = 1;
11
- var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment");
12
- function n(r, s, o) {
13
- var a = null;
14
- if (o !== void 0 && (a = "" + o), s.key !== void 0 && (a = "" + s.key), "key" in s) {
15
- o = {};
16
- for (var l in s)
17
- l !== "key" && (o[l] = s[l]);
18
- } else o = s;
19
- return s = o.ref, {
20
- $$typeof: e,
21
- type: r,
22
- key: a,
23
- ref: s !== void 0 ? s : null,
24
- props: o
1
+ import Rt, { useRef as We, useMemo as Re, useState as F, useEffect as Ce, useCallback as Oe } from "react";
2
+ import { styled as ce, Box as N, Select as Ht, FormControl as Xt, CircularProgress as Le, Divider as zt, Button as ne, Typography as _e, Paper as _t, Autocomplete as Be, TextField as ee, Menu as qt, MenuItem as ke, Alert as Kt } from "@mui/material";
3
+ import { AgGridReact as Jt } from "ag-grid-react";
4
+ import { ModuleRegistry as Qt, ClientSideRowModelModule as gt, AllCommunityModule as Zt } from "ag-grid-community";
5
+ const vt = (a, f) => ({
6
+ getEntities: async () => {
7
+ const d = await a.get(f.entities);
8
+ return {
9
+ data: d.data.data ?? d.data
25
10
  };
26
- }
27
- return Re.Fragment = t, Re.jsx = n, Re.jsxs = n, Re;
11
+ },
12
+ getMetadata: async (d) => {
13
+ const E = await a.get(f.metadata(d));
14
+ return {
15
+ data: E.data.data ?? E.data
16
+ };
17
+ },
18
+ getRecords: async (d, E) => {
19
+ const s = await a.get(f.records(d), { params: E });
20
+ return {
21
+ data: s.data.data ?? s.data,
22
+ total: s.data.total ?? s.data.count ?? 0
23
+ };
24
+ },
25
+ getRecord: async (d, E) => {
26
+ const s = await a.get(f.recordById(d, E));
27
+ return {
28
+ data: s.data.data ?? s.data
29
+ };
30
+ },
31
+ createRecord: async (d, E) => {
32
+ const s = await a.post(f.records(d), E);
33
+ return {
34
+ data: s.data.data ?? s.data
35
+ };
36
+ },
37
+ updateRecord: async (d, E, s) => {
38
+ const k = await a.put(f.recordById(d, E), s);
39
+ return {
40
+ data: k.data.data ?? k.data
41
+ };
42
+ },
43
+ deleteRecord: async (d, E) => {
44
+ const s = await a.delete(f.recordById(d, E));
45
+ return {
46
+ data: s.data.data ?? s.data
47
+ };
48
+ },
49
+ exportCSV: async (d, E) => await a.get(f.exportCSV(d), {
50
+ params: E,
51
+ responseType: "blob"
52
+ }),
53
+ exportExcel: async (d, E) => await a.get(f.exportExcel(d), {
54
+ params: E,
55
+ responseType: "blob"
56
+ })
57
+ });
58
+ var be = { exports: {} }, Ae = {};
59
+ var st;
60
+ function er() {
61
+ if (st) return Ae;
62
+ st = 1;
63
+ var a = Rt, f = /* @__PURE__ */ Symbol.for("react.element"), d = /* @__PURE__ */ Symbol.for("react.fragment"), E = Object.prototype.hasOwnProperty, s = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, k = { key: !0, ref: !0, __self: !0, __source: !0 };
64
+ function z(p, g, Y) {
65
+ var S, O = {}, C = null, W = null;
66
+ Y !== void 0 && (C = "" + Y), g.key !== void 0 && (C = "" + g.key), g.ref !== void 0 && (W = g.ref);
67
+ for (S in g) E.call(g, S) && !k.hasOwnProperty(S) && (O[S] = g[S]);
68
+ if (p && p.defaultProps) for (S in g = p.defaultProps, g) O[S] === void 0 && (O[S] = g[S]);
69
+ return { $$typeof: f, type: p, key: C, ref: W, props: O, _owner: s.current };
70
+ }
71
+ return Ae.Fragment = d, Ae.jsx = z, Ae.jsxs = z, Ae;
28
72
  }
29
- var Se = {};
30
- var ut;
31
- function In() {
32
- return ut || (ut = 1, process.env.NODE_ENV !== "production" && (function() {
33
- function e(c) {
34
- if (c == null) return null;
35
- if (typeof c == "function")
36
- return c.$$typeof === N ? null : c.displayName || c.name || null;
37
- if (typeof c == "string") return c;
38
- switch (c) {
39
- case h:
73
+ var Ie = {};
74
+ var it;
75
+ function tr() {
76
+ return it || (it = 1, process.env.NODE_ENV !== "production" && (function() {
77
+ var a = Rt, f = /* @__PURE__ */ Symbol.for("react.element"), d = /* @__PURE__ */ Symbol.for("react.portal"), E = /* @__PURE__ */ Symbol.for("react.fragment"), s = /* @__PURE__ */ Symbol.for("react.strict_mode"), k = /* @__PURE__ */ Symbol.for("react.profiler"), z = /* @__PURE__ */ Symbol.for("react.provider"), p = /* @__PURE__ */ Symbol.for("react.context"), g = /* @__PURE__ */ Symbol.for("react.forward_ref"), Y = /* @__PURE__ */ Symbol.for("react.suspense"), S = /* @__PURE__ */ Symbol.for("react.suspense_list"), O = /* @__PURE__ */ Symbol.for("react.memo"), C = /* @__PURE__ */ Symbol.for("react.lazy"), W = /* @__PURE__ */ Symbol.for("react.offscreen"), te = Symbol.iterator, de = "@@iterator";
78
+ function K(e) {
79
+ if (e === null || typeof e != "object")
80
+ return null;
81
+ var t = te && e[te] || e[de];
82
+ return typeof t == "function" ? t : null;
83
+ }
84
+ var V = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
85
+ function D(e) {
86
+ {
87
+ for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), l = 1; l < t; l++)
88
+ n[l - 1] = arguments[l];
89
+ P("error", e, n);
90
+ }
91
+ }
92
+ function P(e, t, n) {
93
+ {
94
+ var l = V.ReactDebugCurrentFrame, A = l.getStackAddendum();
95
+ A !== "" && (t += "%s", n = n.concat([A]));
96
+ var y = n.map(function(_) {
97
+ return String(_);
98
+ });
99
+ y.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, y);
100
+ }
101
+ }
102
+ var re = !1, w = !1, G = !1, ue = !1, J = !1, oe;
103
+ oe = /* @__PURE__ */ Symbol.for("react.module.reference");
104
+ function R(e) {
105
+ return !!(typeof e == "string" || typeof e == "function" || e === E || e === k || J || e === s || e === Y || e === S || ue || e === W || re || w || G || typeof e == "object" && e !== null && (e.$$typeof === C || e.$$typeof === O || e.$$typeof === z || e.$$typeof === p || e.$$typeof === g || // This needs to include all possible module reference object
106
+ // types supported by any Flight configuration anywhere since
107
+ // we don't know which Flight build this will end up being used
108
+ // with.
109
+ e.$$typeof === oe || e.getModuleId !== void 0));
110
+ }
111
+ function u(e, t, n) {
112
+ var l = e.displayName;
113
+ if (l)
114
+ return l;
115
+ var A = t.displayName || t.name || "";
116
+ return A !== "" ? n + "(" + A + ")" : n;
117
+ }
118
+ function i(e) {
119
+ return e.displayName || "Context";
120
+ }
121
+ function T(e) {
122
+ if (e == null)
123
+ return null;
124
+ if (typeof e.tag == "number" && D("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
125
+ return e.displayName || e.name || null;
126
+ if (typeof e == "string")
127
+ return e;
128
+ switch (e) {
129
+ case E:
40
130
  return "Fragment";
41
- case j:
131
+ case d:
132
+ return "Portal";
133
+ case k:
42
134
  return "Profiler";
43
- case w:
135
+ case s:
44
136
  return "StrictMode";
45
- case V:
137
+ case Y:
46
138
  return "Suspense";
47
- case U:
139
+ case S:
48
140
  return "SuspenseList";
49
- case g:
50
- return "Activity";
51
141
  }
52
- if (typeof c == "object")
53
- switch (typeof c.tag == "number" && console.error(
54
- "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
55
- ), c.$$typeof) {
56
- case S:
57
- return "Portal";
58
- case D:
59
- return c.displayName || "Context";
60
- case I:
61
- return (c._context.displayName || "Context") + ".Consumer";
62
- case F:
63
- var A = c.render;
64
- return c = c.displayName, c || (c = A.displayName || A.name || "", c = c !== "" ? "ForwardRef(" + c + ")" : "ForwardRef"), c;
65
- case b:
66
- return A = c.displayName || null, A !== null ? A : e(c.type) || "Memo";
67
- case y:
68
- A = c._payload, c = c._init;
142
+ if (typeof e == "object")
143
+ switch (e.$$typeof) {
144
+ case p:
145
+ var t = e;
146
+ return i(t) + ".Consumer";
147
+ case z:
148
+ var n = e;
149
+ return i(n._context) + ".Provider";
150
+ case g:
151
+ return u(e, e.render, "ForwardRef");
152
+ case O:
153
+ var l = e.displayName || null;
154
+ return l !== null ? l : T(e.type) || "Memo";
155
+ case C: {
156
+ var A = e, y = A._payload, _ = A._init;
69
157
  try {
70
- return e(c(A));
158
+ return T(_(y));
71
159
  } catch {
160
+ return null;
72
161
  }
162
+ }
73
163
  }
74
164
  return null;
75
165
  }
76
- function t(c) {
77
- return "" + c;
166
+ var M = Object.assign, h = 0, Q, U, H, fe, Te, ae, ge;
167
+ function ve() {
78
168
  }
79
- function n(c) {
80
- try {
81
- t(c);
82
- var A = !1;
83
- } catch {
84
- A = !0;
85
- }
86
- if (A) {
87
- A = console;
88
- var p = A.error, R = typeof Symbol == "function" && Symbol.toStringTag && c[Symbol.toStringTag] || c.constructor.name || "Object";
89
- return p.call(
90
- A,
91
- "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
92
- R
93
- ), t(c);
94
- }
95
- }
96
- function r(c) {
97
- if (c === h) return "<>";
98
- if (typeof c == "object" && c !== null && c.$$typeof === y)
99
- return "<...>";
100
- try {
101
- var A = e(c);
102
- return A ? "<" + A + ">" : "<...>";
103
- } catch {
104
- return "<...>";
169
+ ve.__reactDisabledLog = !0;
170
+ function Me() {
171
+ {
172
+ if (h === 0) {
173
+ Q = console.log, U = console.info, H = console.warn, fe = console.error, Te = console.group, ae = console.groupCollapsed, ge = console.groupEnd;
174
+ var e = {
175
+ configurable: !0,
176
+ enumerable: !0,
177
+ value: ve,
178
+ writable: !0
179
+ };
180
+ Object.defineProperties(console, {
181
+ info: e,
182
+ log: e,
183
+ warn: e,
184
+ error: e,
185
+ group: e,
186
+ groupCollapsed: e,
187
+ groupEnd: e
188
+ });
189
+ }
190
+ h++;
105
191
  }
106
192
  }
107
- function s() {
108
- var c = B.A;
109
- return c === null ? null : c.getOwner();
110
- }
111
193
  function o() {
112
- return Error("react-stack-top-frame");
113
- }
114
- function a(c) {
115
- if (L.call(c, "key")) {
116
- var A = Object.getOwnPropertyDescriptor(c, "key").get;
117
- if (A && A.isReactWarning) return !1;
194
+ {
195
+ if (h--, h === 0) {
196
+ var e = {
197
+ configurable: !0,
198
+ enumerable: !0,
199
+ writable: !0
200
+ };
201
+ Object.defineProperties(console, {
202
+ log: M({}, e, {
203
+ value: Q
204
+ }),
205
+ info: M({}, e, {
206
+ value: U
207
+ }),
208
+ warn: M({}, e, {
209
+ value: H
210
+ }),
211
+ error: M({}, e, {
212
+ value: fe
213
+ }),
214
+ group: M({}, e, {
215
+ value: Te
216
+ }),
217
+ groupCollapsed: M({}, e, {
218
+ value: ae
219
+ }),
220
+ groupEnd: M({}, e, {
221
+ value: ge
222
+ })
223
+ });
224
+ }
225
+ h < 0 && D("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
118
226
  }
119
- return c.key !== void 0;
120
227
  }
121
- function l(c, A) {
122
- function p() {
123
- G || (G = !0, console.error(
124
- "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
125
- A
126
- ));
228
+ var c = V.ReactCurrentDispatcher, v;
229
+ function x(e, t, n) {
230
+ {
231
+ if (v === void 0)
232
+ try {
233
+ throw Error();
234
+ } catch (A) {
235
+ var l = A.stack.trim().match(/\n( *(at )?)/);
236
+ v = l && l[1] || "";
237
+ }
238
+ return `
239
+ ` + v + e;
127
240
  }
128
- p.isReactWarning = !0, Object.defineProperty(c, "key", {
129
- get: p,
130
- configurable: !0
131
- });
132
- }
133
- function m() {
134
- var c = e(this.type);
135
- return ne[c] || (ne[c] = !0, console.error(
136
- "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
137
- )), c = this.props.ref, c !== void 0 ? c : null;
138
241
  }
139
- function d(c, A, p, R, C, $) {
140
- var O = p.ref;
141
- return c = {
142
- $$typeof: f,
143
- type: c,
144
- key: A,
145
- props: p,
146
- _owner: R
147
- }, (O !== void 0 ? O : null) !== null ? Object.defineProperty(c, "ref", {
148
- enumerable: !1,
149
- get: m
150
- }) : Object.defineProperty(c, "ref", { enumerable: !1, value: null }), c._store = {}, Object.defineProperty(c._store, "validated", {
151
- configurable: !1,
152
- enumerable: !1,
153
- writable: !0,
154
- value: 0
155
- }), Object.defineProperty(c, "_debugInfo", {
156
- configurable: !1,
157
- enumerable: !1,
158
- writable: !0,
159
- value: null
160
- }), Object.defineProperty(c, "_debugStack", {
161
- configurable: !1,
162
- enumerable: !1,
163
- writable: !0,
164
- value: C
165
- }), Object.defineProperty(c, "_debugTask", {
166
- configurable: !1,
167
- enumerable: !1,
168
- writable: !0,
169
- value: $
170
- }), Object.freeze && (Object.freeze(c.props), Object.freeze(c)), c;
242
+ var I = !1, b;
243
+ {
244
+ var Z = typeof WeakMap == "function" ? WeakMap : Map;
245
+ b = new Z();
171
246
  }
172
- function u(c, A, p, R, C, $) {
173
- var O = A.children;
174
- if (O !== void 0)
175
- if (R)
176
- if (W(O)) {
177
- for (R = 0; R < O.length; R++)
178
- T(O[R]);
179
- Object.freeze && Object.freeze(O);
180
- } else
181
- console.error(
182
- "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
183
- );
184
- else T(O);
185
- if (L.call(A, "key")) {
186
- O = e(c);
187
- var v = Object.keys(A).filter(function(Ne) {
188
- return Ne !== "key";
189
- });
190
- R = 0 < v.length ? "{key: someKey, " + v.join(": ..., ") + ": ...}" : "{key: someKey}", ce[O + R] || (v = 0 < v.length ? "{" + v.join(": ..., ") + ": ...}" : "{}", console.error(
191
- `A props object containing a "key" prop is being spread into JSX:
192
- let props = %s;
193
- <%s {...props} />
194
- React keys must be passed directly to JSX without using spread:
195
- let props = %s;
196
- <%s key={someKey} {...props} />`,
197
- R,
198
- O,
199
- v,
200
- O
201
- ), ce[O + R] = !0);
247
+ function Se(e, t) {
248
+ if (!e || I)
249
+ return "";
250
+ {
251
+ var n = b.get(e);
252
+ if (n !== void 0)
253
+ return n;
202
254
  }
203
- if (O = null, p !== void 0 && (n(p), O = "" + p), a(A) && (n(A.key), O = "" + A.key), "key" in A) {
204
- p = {};
205
- for (var J in A)
206
- J !== "key" && (p[J] = A[J]);
207
- } else p = A;
208
- return O && l(
209
- p,
210
- typeof c == "function" ? c.displayName || c.name || "Unknown" : c
211
- ), d(
212
- c,
213
- O,
214
- p,
215
- s(),
216
- C,
217
- $
218
- );
255
+ var l;
256
+ I = !0;
257
+ var A = Error.prepareStackTrace;
258
+ Error.prepareStackTrace = void 0;
259
+ var y;
260
+ y = c.current, c.current = null, Me();
261
+ try {
262
+ if (t) {
263
+ var _ = function() {
264
+ throw Error();
265
+ };
266
+ if (Object.defineProperty(_.prototype, "props", {
267
+ set: function() {
268
+ throw Error();
269
+ }
270
+ }), typeof Reflect == "object" && Reflect.construct) {
271
+ try {
272
+ Reflect.construct(_, []);
273
+ } catch (B) {
274
+ l = B;
275
+ }
276
+ Reflect.construct(e, [], _);
277
+ } else {
278
+ try {
279
+ _.call();
280
+ } catch (B) {
281
+ l = B;
282
+ }
283
+ e.call(_.prototype);
284
+ }
285
+ } else {
286
+ try {
287
+ throw Error();
288
+ } catch (B) {
289
+ l = B;
290
+ }
291
+ e();
292
+ }
293
+ } catch (B) {
294
+ if (B && l && typeof B.stack == "string") {
295
+ for (var m = B.stack.split(`
296
+ `), $ = l.stack.split(`
297
+ `), L = m.length - 1, j = $.length - 1; L >= 1 && j >= 0 && m[L] !== $[j]; )
298
+ j--;
299
+ for (; L >= 1 && j >= 0; L--, j--)
300
+ if (m[L] !== $[j]) {
301
+ if (L !== 1 || j !== 1)
302
+ do
303
+ if (L--, j--, j < 0 || m[L] !== $[j]) {
304
+ var q = `
305
+ ` + m[L].replace(" at new ", " at ");
306
+ return e.displayName && q.includes("<anonymous>") && (q = q.replace("<anonymous>", e.displayName)), typeof e == "function" && b.set(e, q), q;
307
+ }
308
+ while (L >= 1 && j >= 0);
309
+ break;
310
+ }
311
+ }
312
+ } finally {
313
+ I = !1, c.current = y, o(), Error.prepareStackTrace = A;
314
+ }
315
+ var me = e ? e.displayName || e.name : "", Ee = me ? x(me) : "";
316
+ return typeof e == "function" && b.set(e, Ee), Ee;
219
317
  }
220
- function T(c) {
221
- x(c) ? c._store && (c._store.validated = 1) : typeof c == "object" && c !== null && c.$$typeof === y && (c._payload.status === "fulfilled" ? x(c._payload.value) && c._payload.value._store && (c._payload.value._store.validated = 1) : c._store && (c._store.validated = 1));
318
+ function ht(e, t, n) {
319
+ return Se(e, !1);
222
320
  }
223
- function x(c) {
224
- return typeof c == "object" && c !== null && c.$$typeof === f;
321
+ function At(e) {
322
+ var t = e.prototype;
323
+ return !!(t && t.isReactComponent);
225
324
  }
226
- var P = mn, f = /* @__PURE__ */ Symbol.for("react.transitional.element"), S = /* @__PURE__ */ Symbol.for("react.portal"), h = /* @__PURE__ */ Symbol.for("react.fragment"), w = /* @__PURE__ */ Symbol.for("react.strict_mode"), j = /* @__PURE__ */ Symbol.for("react.profiler"), I = /* @__PURE__ */ Symbol.for("react.consumer"), D = /* @__PURE__ */ Symbol.for("react.context"), F = /* @__PURE__ */ Symbol.for("react.forward_ref"), V = /* @__PURE__ */ Symbol.for("react.suspense"), U = /* @__PURE__ */ Symbol.for("react.suspense_list"), b = /* @__PURE__ */ Symbol.for("react.memo"), y = /* @__PURE__ */ Symbol.for("react.lazy"), g = /* @__PURE__ */ Symbol.for("react.activity"), N = /* @__PURE__ */ Symbol.for("react.client.reference"), B = P.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, L = Object.prototype.hasOwnProperty, W = Array.isArray, Q = console.createTask ? console.createTask : function() {
227
- return null;
228
- };
229
- P = {
230
- react_stack_bottom_frame: function(c) {
231
- return c();
325
+ function De(e, t, n) {
326
+ if (e == null)
327
+ return "";
328
+ if (typeof e == "function")
329
+ return Se(e, At(e));
330
+ if (typeof e == "string")
331
+ return x(e);
332
+ switch (e) {
333
+ case Y:
334
+ return x("Suspense");
335
+ case S:
336
+ return x("SuspenseList");
232
337
  }
233
- };
234
- var G, ne = {}, X = P.react_stack_bottom_frame.bind(
235
- P,
236
- o
237
- )(), le = Q(r(o)), ce = {};
238
- Se.Fragment = h, Se.jsx = function(c, A, p) {
239
- var R = 1e4 > B.recentlyCreatedOwnerStacks++;
240
- return u(
241
- c,
242
- A,
243
- p,
244
- !1,
245
- R ? Error("react-stack-top-frame") : X,
246
- R ? Q(r(c)) : le
247
- );
248
- }, Se.jsxs = function(c, A, p) {
249
- var R = 1e4 > B.recentlyCreatedOwnerStacks++;
250
- return u(
251
- c,
252
- A,
253
- p,
254
- !0,
255
- R ? Error("react-stack-top-frame") : X,
256
- R ? Q(r(c)) : le
257
- );
258
- };
259
- })()), Se;
260
- }
261
- var dt;
262
- function Dn() {
263
- return dt || (dt = 1, process.env.NODE_ENV === "production" ? Ie.exports = Nn() : Ie.exports = In()), Ie.exports;
264
- }
265
- var E = Dn();
266
- const Ln = {
267
- entities: "/master/entities",
268
- metadata: (e) => `/master/${e}/metadata`,
269
- records: (e) => `/master/${e}/records`,
270
- recordById: (e, t) => `/master/${e}/records/${t}`,
271
- exportCSV: (e) => `/master/${e}/export/csv`,
272
- exportExcel: (e) => `/master/${e}/export/excel`
273
- }, Pn = {
274
- basePath: "/master",
275
- entityNew: (e) => `/master/${e}/new`,
276
- entityView: (e, t) => `/master/${e}/${t}`,
277
- entityEdit: (e, t) => `/master/${e}/${t}/edit`
278
- }, $t = hn(null), Ds = ({
279
- config: e = {},
280
- children: t
281
- }) => {
282
- const n = {
283
- apiClient: e.apiClient,
284
- apiEndpoints: {
285
- ...Ln,
286
- ...e.apiEndpoints
287
- },
288
- routes: {
289
- ...Pn,
290
- ...e.routes
291
- },
292
- apiService: e.apiService
293
- };
294
- return /* @__PURE__ */ E.jsx($t.Provider, { value: n, children: t });
295
- }, ke = () => {
296
- const e = Tn($t);
297
- if (!e)
298
- throw new Error(
299
- "useMasterDataConfig must be used within MasterDataProvider"
300
- );
301
- return e;
302
- };
303
- function Ht(e, t) {
304
- return function() {
305
- return e.apply(t, arguments);
306
- };
307
- }
308
- const { toString: Fn } = Object.prototype, { getPrototypeOf: ot } = Object, { iterator: Be, toStringTag: Vt } = Symbol, $e = /* @__PURE__ */ ((e) => (t) => {
309
- const n = Fn.call(t);
310
- return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
311
- })(/* @__PURE__ */ Object.create(null)), ee = (e) => (e = e.toLowerCase(), (t) => $e(t) === e), He = (e) => (t) => typeof t === e, { isArray: me } = Array, Ee = He("undefined");
312
- function _e(e) {
313
- return e !== null && !Ee(e) && e.constructor !== null && !Ee(e.constructor) && Y(e.constructor.isBuffer) && e.constructor.isBuffer(e);
314
- }
315
- const Gt = ee("ArrayBuffer");
316
- function jn(e) {
317
- let t;
318
- return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && Gt(e.buffer), t;
319
- }
320
- const vn = He("string"), Y = He("function"), Wt = He("number"), we = (e) => e !== null && typeof e == "object", Mn = (e) => e === !0 || e === !1, Fe = (e) => {
321
- if ($e(e) !== "object")
322
- return !1;
323
- const t = ot(e);
324
- return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Vt in e) && !(Be in e);
325
- }, Un = (e) => {
326
- if (!we(e) || _e(e))
327
- return !1;
328
- try {
329
- return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
330
- } catch {
331
- return !1;
332
- }
333
- }, kn = ee("Date"), Bn = ee("File"), $n = ee("Blob"), Hn = ee("FileList"), Vn = (e) => we(e) && Y(e.pipe), Gn = (e) => {
334
- let t;
335
- return e && (typeof FormData == "function" && e instanceof FormData || Y(e.append) && ((t = $e(e)) === "formdata" || // detect form-data instance
336
- t === "object" && Y(e.toString) && e.toString() === "[object FormData]"));
337
- }, Wn = ee("URLSearchParams"), [qn, Yn, zn, Xn] = ["ReadableStream", "Request", "Response", "Headers"].map(ee), Jn = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
338
- function xe(e, t, { allOwnKeys: n = !1 } = {}) {
339
- if (e === null || typeof e > "u")
340
- return;
341
- let r, s;
342
- if (typeof e != "object" && (e = [e]), me(e))
343
- for (r = 0, s = e.length; r < s; r++)
344
- t.call(null, e[r], r, e);
345
- else {
346
- if (_e(e))
347
- return;
348
- const o = n ? Object.getOwnPropertyNames(e) : Object.keys(e), a = o.length;
349
- let l;
350
- for (r = 0; r < a; r++)
351
- l = o[r], t.call(null, e[l], l, e);
352
- }
353
- }
354
- function qt(e, t) {
355
- if (_e(e))
356
- return null;
357
- t = t.toLowerCase();
358
- const n = Object.keys(e);
359
- let r = n.length, s;
360
- for (; r-- > 0; )
361
- if (s = n[r], t === s.toLowerCase())
362
- return s;
363
- return null;
364
- }
365
- const ue = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Yt = (e) => !Ee(e) && e !== ue;
366
- function tt() {
367
- const { caseless: e, skipUndefined: t } = Yt(this) && this || {}, n = {}, r = (s, o) => {
368
- const a = e && qt(n, o) || o;
369
- Fe(n[a]) && Fe(s) ? n[a] = tt(n[a], s) : Fe(s) ? n[a] = tt({}, s) : me(s) ? n[a] = s.slice() : (!t || !Ee(s)) && (n[a] = s);
370
- };
371
- for (let s = 0, o = arguments.length; s < o; s++)
372
- arguments[s] && xe(arguments[s], r);
373
- return n;
374
- }
375
- const Kn = (e, t, n, { allOwnKeys: r } = {}) => (xe(t, (s, o) => {
376
- n && Y(s) ? e[o] = Ht(s, n) : e[o] = s;
377
- }, { allOwnKeys: r }), e), Qn = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Zn = (e, t, n, r) => {
378
- e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
379
- value: t.prototype
380
- }), n && Object.assign(e.prototype, n);
381
- }, er = (e, t, n, r) => {
382
- let s, o, a;
383
- const l = {};
384
- if (t = t || {}, e == null) return t;
385
- do {
386
- for (s = Object.getOwnPropertyNames(e), o = s.length; o-- > 0; )
387
- a = s[o], (!r || r(a, e, t)) && !l[a] && (t[a] = e[a], l[a] = !0);
388
- e = n !== !1 && ot(e);
389
- } while (e && (!n || n(e, t)) && e !== Object.prototype);
390
- return t;
391
- }, tr = (e, t, n) => {
392
- e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
393
- const r = e.indexOf(t, n);
394
- return r !== -1 && r === n;
395
- }, nr = (e) => {
396
- if (!e) return null;
397
- if (me(e)) return e;
398
- let t = e.length;
399
- if (!Wt(t)) return null;
400
- const n = new Array(t);
401
- for (; t-- > 0; )
402
- n[t] = e[t];
403
- return n;
404
- }, rr = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && ot(Uint8Array)), sr = (e, t) => {
405
- const r = (e && e[Be]).call(e);
406
- let s;
407
- for (; (s = r.next()) && !s.done; ) {
408
- const o = s.value;
409
- t.call(e, o[0], o[1]);
410
- }
411
- }, or = (e, t) => {
412
- let n;
413
- const r = [];
414
- for (; (n = e.exec(t)) !== null; )
415
- r.push(n);
416
- return r;
417
- }, ar = ee("HTMLFormElement"), ir = (e) => e.toLowerCase().replace(
418
- /[-_\s]([a-z\d])(\w*)/g,
419
- function(n, r, s) {
420
- return r.toUpperCase() + s;
421
- }
422
- ), ft = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), lr = ee("RegExp"), zt = (e, t) => {
423
- const n = Object.getOwnPropertyDescriptors(e), r = {};
424
- xe(n, (s, o) => {
425
- let a;
426
- (a = t(s, o, e)) !== !1 && (r[o] = a || s);
427
- }), Object.defineProperties(e, r);
428
- }, cr = (e) => {
429
- zt(e, (t, n) => {
430
- if (Y(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
431
- return !1;
432
- const r = e[n];
433
- if (Y(r)) {
434
- if (t.enumerable = !1, "writable" in t) {
435
- t.writable = !1;
436
- return;
437
- }
438
- t.set || (t.set = () => {
439
- throw Error("Can not rewrite read-only method '" + n + "'");
440
- });
338
+ if (typeof e == "object")
339
+ switch (e.$$typeof) {
340
+ case g:
341
+ return ht(e.render);
342
+ case O:
343
+ return De(e.type, t, n);
344
+ case C: {
345
+ var l = e, A = l._payload, y = l._init;
346
+ try {
347
+ return De(y(A), t, n);
348
+ } catch {
349
+ }
350
+ }
351
+ }
352
+ return "";
441
353
  }
442
- });
443
- }, ur = (e, t) => {
444
- const n = {}, r = (s) => {
445
- s.forEach((o) => {
446
- n[o] = !0;
447
- });
448
- };
449
- return me(e) ? r(e) : r(String(e).split(t)), n;
450
- }, dr = () => {
451
- }, fr = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
452
- function pr(e) {
453
- return !!(e && Y(e.append) && e[Vt] === "FormData" && e[Be]);
454
- }
455
- const Er = (e) => {
456
- const t = new Array(10), n = (r, s) => {
457
- if (we(r)) {
458
- if (t.indexOf(r) >= 0)
459
- return;
460
- if (_e(r))
461
- return r;
462
- if (!("toJSON" in r)) {
463
- t[s] = r;
464
- const o = me(r) ? [] : {};
465
- return xe(r, (a, l) => {
466
- const m = n(a, s + 1);
467
- !Ee(m) && (o[l] = m);
468
- }), t[s] = void 0, o;
469
- }
354
+ var he = Object.prototype.hasOwnProperty, He = {}, Xe = V.ReactDebugCurrentFrame;
355
+ function xe(e) {
356
+ if (e) {
357
+ var t = e._owner, n = De(e.type, e._source, t ? t.type : null);
358
+ Xe.setExtraStackFrame(n);
359
+ } else
360
+ Xe.setExtraStackFrame(null);
470
361
  }
471
- return r;
472
- };
473
- return n(e, 0);
474
- }, mr = ee("AsyncFunction"), hr = (e) => e && (we(e) || Y(e)) && Y(e.then) && Y(e.catch), Xt = ((e, t) => e ? setImmediate : t ? ((n, r) => (ue.addEventListener("message", ({ source: s, data: o }) => {
475
- s === ue && o === n && r.length && r.shift()();
476
- }, !1), (s) => {
477
- r.push(s), ue.postMessage(n, "*");
478
- }))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
479
- typeof setImmediate == "function",
480
- Y(ue.postMessage)
481
- ), Tr = typeof queueMicrotask < "u" ? queueMicrotask.bind(ue) : typeof process < "u" && process.nextTick || Xt, Rr = (e) => e != null && Y(e[Be]), i = {
482
- isArray: me,
483
- isArrayBuffer: Gt,
484
- isBuffer: _e,
485
- isFormData: Gn,
486
- isArrayBufferView: jn,
487
- isString: vn,
488
- isNumber: Wt,
489
- isBoolean: Mn,
490
- isObject: we,
491
- isPlainObject: Fe,
492
- isEmptyObject: Un,
493
- isReadableStream: qn,
494
- isRequest: Yn,
495
- isResponse: zn,
496
- isHeaders: Xn,
497
- isUndefined: Ee,
498
- isDate: kn,
499
- isFile: Bn,
500
- isBlob: $n,
501
- isRegExp: lr,
502
- isFunction: Y,
503
- isStream: Vn,
504
- isURLSearchParams: Wn,
505
- isTypedArray: rr,
506
- isFileList: Hn,
507
- forEach: xe,
508
- merge: tt,
509
- extend: Kn,
510
- trim: Jn,
511
- stripBOM: Qn,
512
- inherits: Zn,
513
- toFlatObject: er,
514
- kindOf: $e,
515
- kindOfTest: ee,
516
- endsWith: tr,
517
- toArray: nr,
518
- forEachEntry: sr,
519
- matchAll: or,
520
- isHTMLForm: ar,
521
- hasOwnProperty: ft,
522
- hasOwnProp: ft,
523
- // an alias to avoid ESLint no-prototype-builtins detection
524
- reduceDescriptors: zt,
525
- freezeMethods: cr,
526
- toObjectSet: ur,
527
- toCamelCase: ir,
528
- noop: dr,
529
- toFiniteNumber: fr,
530
- findKey: qt,
531
- global: ue,
532
- isContextDefined: Yt,
533
- isSpecCompliantForm: pr,
534
- toJSONObject: Er,
535
- isAsyncFn: mr,
536
- isThenable: hr,
537
- setImmediate: Xt,
538
- asap: Tr,
539
- isIterable: Rr
540
- };
541
- function _(e, t, n, r, s) {
542
- 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), s && (this.response = s, this.status = s.status ? s.status : null);
543
- }
544
- i.inherits(_, Error, {
545
- toJSON: function() {
546
- return {
547
- // Standard
548
- message: this.message,
549
- name: this.name,
550
- // Microsoft
551
- description: this.description,
552
- number: this.number,
553
- // Mozilla
554
- fileName: this.fileName,
555
- lineNumber: this.lineNumber,
556
- columnNumber: this.columnNumber,
557
- stack: this.stack,
558
- // Axios
559
- config: i.toJSONObject(this.config),
560
- code: this.code,
561
- status: this.status
562
- };
563
- }
564
- });
565
- const Jt = _.prototype, Kt = {};
566
- [
567
- "ERR_BAD_OPTION_VALUE",
568
- "ERR_BAD_OPTION",
569
- "ECONNABORTED",
570
- "ETIMEDOUT",
571
- "ERR_NETWORK",
572
- "ERR_FR_TOO_MANY_REDIRECTS",
573
- "ERR_DEPRECATED",
574
- "ERR_BAD_RESPONSE",
575
- "ERR_BAD_REQUEST",
576
- "ERR_CANCELED",
577
- "ERR_NOT_SUPPORT",
578
- "ERR_INVALID_URL"
579
- // eslint-disable-next-line func-names
580
- ].forEach((e) => {
581
- Kt[e] = { value: e };
582
- });
583
- Object.defineProperties(_, Kt);
584
- Object.defineProperty(Jt, "isAxiosError", { value: !0 });
585
- _.from = (e, t, n, r, s, o) => {
586
- const a = Object.create(Jt);
587
- i.toFlatObject(e, a, function(u) {
588
- return u !== Error.prototype;
589
- }, (d) => d !== "isAxiosError");
590
- const l = e && e.message ? e.message : "Error", m = t == null && e ? e.code : t;
591
- return _.call(a, l, m, n, r, s), e && a.cause == null && Object.defineProperty(a, "cause", { value: e, configurable: !0 }), a.name = e && e.name || "Error", o && Object.assign(a, o), a;
592
- };
593
- const Sr = null;
594
- function nt(e) {
595
- return i.isPlainObject(e) || i.isArray(e);
596
- }
597
- function Qt(e) {
598
- return i.endsWith(e, "[]") ? e.slice(0, -2) : e;
599
- }
600
- function pt(e, t, n) {
601
- return e ? e.concat(t).map(function(s, o) {
602
- return s = Qt(s), !n && o ? "[" + s + "]" : s;
603
- }).join(n ? "." : "") : t;
604
- }
605
- function Ar(e) {
606
- return i.isArray(e) && !e.some(nt);
607
- }
608
- const yr = i.toFlatObject(i, {}, null, function(t) {
609
- return /^is[A-Z]/.test(t);
610
- });
611
- function Ve(e, t, n) {
612
- if (!i.isObject(e))
613
- throw new TypeError("target must be an object");
614
- t = t || new FormData(), n = i.toFlatObject(n, {
615
- metaTokens: !0,
616
- dots: !1,
617
- indexes: !1
618
- }, !1, function(S, h) {
619
- return !i.isUndefined(h[S]);
620
- });
621
- const r = n.metaTokens, s = n.visitor || u, o = n.dots, a = n.indexes, m = (n.Blob || typeof Blob < "u" && Blob) && i.isSpecCompliantForm(t);
622
- if (!i.isFunction(s))
623
- throw new TypeError("visitor must be a function");
624
- function d(f) {
625
- if (f === null) return "";
626
- if (i.isDate(f))
627
- return f.toISOString();
628
- if (i.isBoolean(f))
629
- return f.toString();
630
- if (!m && i.isBlob(f))
631
- throw new _("Blob is not supported. Use a Buffer instead.");
632
- return i.isArrayBuffer(f) || i.isTypedArray(f) ? m && typeof Blob == "function" ? new Blob([f]) : Buffer.from(f) : f;
633
- }
634
- function u(f, S, h) {
635
- let w = f;
636
- if (f && !h && typeof f == "object") {
637
- if (i.endsWith(S, "{}"))
638
- S = r ? S : S.slice(0, -2), f = JSON.stringify(f);
639
- else if (i.isArray(f) && Ar(f) || (i.isFileList(f) || i.endsWith(S, "[]")) && (w = i.toArray(f)))
640
- return S = Qt(S), w.forEach(function(I, D) {
641
- !(i.isUndefined(I) || I === null) && t.append(
642
- // eslint-disable-next-line no-nested-ternary
643
- a === !0 ? pt([S], D, o) : a === null ? S : S + "[]",
644
- d(I)
645
- );
646
- }), !1;
647
- }
648
- return nt(f) ? !0 : (t.append(pt(h, S, o), d(f)), !1);
649
- }
650
- const T = [], x = Object.assign(yr, {
651
- defaultVisitor: u,
652
- convertValue: d,
653
- isVisitable: nt
654
- });
655
- function P(f, S) {
656
- if (!i.isUndefined(f)) {
657
- if (T.indexOf(f) !== -1)
658
- throw Error("Circular reference detected in " + S.join("."));
659
- T.push(f), i.forEach(f, function(w, j) {
660
- (!(i.isUndefined(w) || w === null) && s.call(
661
- t,
662
- w,
663
- i.isString(j) ? j.trim() : j,
664
- S,
665
- x
666
- )) === !0 && P(w, S ? S.concat(j) : [j]);
667
- }), T.pop();
362
+ function It(e, t, n, l, A) {
363
+ {
364
+ var y = Function.call.bind(he);
365
+ for (var _ in e)
366
+ if (y(e, _)) {
367
+ var m = void 0;
368
+ try {
369
+ if (typeof e[_] != "function") {
370
+ var $ = Error((l || "React class") + ": " + n + " type `" + _ + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[_] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
371
+ throw $.name = "Invariant Violation", $;
372
+ }
373
+ m = e[_](t, _, l, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
374
+ } catch (L) {
375
+ m = L;
376
+ }
377
+ m && !(m instanceof Error) && (xe(A), D("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", l || "React class", n, _, typeof m), xe(null)), m instanceof Error && !(m.message in He) && (He[m.message] = !0, xe(A), D("Failed %s type: %s", n, m.message), xe(null));
378
+ }
379
+ }
668
380
  }
669
- }
670
- if (!i.isObject(e))
671
- throw new TypeError("data must be an object");
672
- return P(e), t;
673
- }
674
- function Et(e) {
675
- const t = {
676
- "!": "%21",
677
- "'": "%27",
678
- "(": "%28",
679
- ")": "%29",
680
- "~": "%7E",
681
- "%20": "+",
682
- "%00": "\0"
683
- };
684
- return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(r) {
685
- return t[r];
686
- });
687
- }
688
- function at(e, t) {
689
- this._pairs = [], e && Ve(e, this, t);
690
- }
691
- const Zt = at.prototype;
692
- Zt.append = function(t, n) {
693
- this._pairs.push([t, n]);
694
- };
695
- Zt.toString = function(t) {
696
- const n = t ? function(r) {
697
- return t.call(this, r, Et);
698
- } : Et;
699
- return this._pairs.map(function(s) {
700
- return n(s[0]) + "=" + n(s[1]);
701
- }, "").join("&");
702
- };
703
- function gr(e) {
704
- return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
705
- }
706
- function en(e, t, n) {
707
- if (!t)
708
- return e;
709
- const r = n && n.encode || gr;
710
- i.isFunction(n) && (n = {
711
- serialize: n
712
- });
713
- const s = n && n.serialize;
714
- let o;
715
- if (s ? o = s(t, n) : o = i.isURLSearchParams(t) ? t.toString() : new at(t, n).toString(r), o) {
716
- const a = e.indexOf("#");
717
- a !== -1 && (e = e.slice(0, a)), e += (e.indexOf("?") === -1 ? "?" : "&") + o;
718
- }
719
- return e;
720
- }
721
- class mt {
722
- constructor() {
723
- this.handlers = [];
724
- }
725
- /**
726
- * Add a new interceptor to the stack
727
- *
728
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
729
- * @param {Function} rejected The function to handle `reject` for a `Promise`
730
- *
731
- * @return {Number} An ID used to remove interceptor later
732
- */
733
- use(t, n, r) {
734
- return this.handlers.push({
735
- fulfilled: t,
736
- rejected: n,
737
- synchronous: r ? r.synchronous : !1,
738
- runWhen: r ? r.runWhen : null
739
- }), this.handlers.length - 1;
740
- }
741
- /**
742
- * Remove an interceptor from the stack
743
- *
744
- * @param {Number} id The ID that was returned by `use`
745
- *
746
- * @returns {void}
747
- */
748
- eject(t) {
749
- this.handlers[t] && (this.handlers[t] = null);
750
- }
751
- /**
752
- * Clear all interceptors from the stack
753
- *
754
- * @returns {void}
755
- */
756
- clear() {
757
- this.handlers && (this.handlers = []);
758
- }
759
- /**
760
- * Iterate over all the registered interceptors
761
- *
762
- * This method is particularly useful for skipping over any
763
- * interceptors that may have become `null` calling `eject`.
764
- *
765
- * @param {Function} fn The function to call for each interceptor
766
- *
767
- * @returns {void}
768
- */
769
- forEach(t) {
770
- i.forEach(this.handlers, function(r) {
771
- r !== null && t(r);
772
- });
773
- }
774
- }
775
- const tn = {
776
- silentJSONParsing: !0,
777
- forcedJSONParsing: !0,
778
- clarifyTimeoutError: !1
779
- }, br = typeof URLSearchParams < "u" ? URLSearchParams : at, Or = typeof FormData < "u" ? FormData : null, _r = typeof Blob < "u" ? Blob : null, wr = {
780
- isBrowser: !0,
781
- classes: {
782
- URLSearchParams: br,
783
- FormData: Or,
784
- Blob: _r
785
- },
786
- protocols: ["http", "https", "file", "blob", "url", "data"]
787
- }, it = typeof window < "u" && typeof document < "u", rt = typeof navigator == "object" && navigator || void 0, xr = it && (!rt || ["ReactNative", "NativeScript", "NS"].indexOf(rt.product) < 0), Cr = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
788
- self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Nr = it && window.location.href || "http://localhost", Ir = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
789
- __proto__: null,
790
- hasBrowserEnv: it,
791
- hasStandardBrowserEnv: xr,
792
- hasStandardBrowserWebWorkerEnv: Cr,
793
- navigator: rt,
794
- origin: Nr
795
- }, Symbol.toStringTag, { value: "Module" })), q = {
796
- ...Ir,
797
- ...wr
798
- };
799
- function Dr(e, t) {
800
- return Ve(e, new q.classes.URLSearchParams(), {
801
- visitor: function(n, r, s, o) {
802
- return q.isNode && i.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
803
- },
804
- ...t
805
- });
806
- }
807
- function Lr(e) {
808
- return i.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
809
- }
810
- function Pr(e) {
811
- const t = {}, n = Object.keys(e);
812
- let r;
813
- const s = n.length;
814
- let o;
815
- for (r = 0; r < s; r++)
816
- o = n[r], t[o] = e[o];
817
- return t;
818
- }
819
- function nn(e) {
820
- function t(n, r, s, o) {
821
- let a = n[o++];
822
- if (a === "__proto__") return !0;
823
- const l = Number.isFinite(+a), m = o >= n.length;
824
- return a = !a && i.isArray(s) ? s.length : a, m ? (i.hasOwnProp(s, a) ? s[a] = [s[a], r] : s[a] = r, !l) : ((!s[a] || !i.isObject(s[a])) && (s[a] = []), t(n, r, s[a], o) && i.isArray(s[a]) && (s[a] = Pr(s[a])), !l);
825
- }
826
- if (i.isFormData(e) && i.isFunction(e.entries)) {
827
- const n = {};
828
- return i.forEachEntry(e, (r, s) => {
829
- t(Lr(r), s, n, 0);
830
- }), n;
831
- }
832
- return null;
833
- }
834
- function Fr(e, t, n) {
835
- if (i.isString(e))
836
- try {
837
- return (t || JSON.parse)(e), i.trim(e);
838
- } catch (r) {
839
- if (r.name !== "SyntaxError")
840
- throw r;
381
+ var Ot = Array.isArray;
382
+ function je(e) {
383
+ return Ot(e);
841
384
  }
842
- return (n || JSON.stringify)(e);
843
- }
844
- const Ce = {
845
- transitional: tn,
846
- adapter: ["xhr", "http", "fetch"],
847
- transformRequest: [function(t, n) {
848
- const r = n.getContentType() || "", s = r.indexOf("application/json") > -1, o = i.isObject(t);
849
- if (o && i.isHTMLForm(t) && (t = new FormData(t)), i.isFormData(t))
850
- return s ? JSON.stringify(nn(t)) : t;
851
- if (i.isArrayBuffer(t) || i.isBuffer(t) || i.isStream(t) || i.isFile(t) || i.isBlob(t) || i.isReadableStream(t))
852
- return t;
853
- if (i.isArrayBufferView(t))
854
- return t.buffer;
855
- if (i.isURLSearchParams(t))
856
- return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
857
- let l;
858
- if (o) {
859
- if (r.indexOf("application/x-www-form-urlencoded") > -1)
860
- return Dr(t, this.formSerializer).toString();
861
- if ((l = i.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
862
- const m = this.env && this.env.FormData;
863
- return Ve(
864
- l ? { "files[]": t } : t,
865
- m && new m(),
866
- this.formSerializer
867
- );
385
+ function yt(e) {
386
+ {
387
+ var t = typeof Symbol == "function" && Symbol.toStringTag, n = t && e[Symbol.toStringTag] || e.constructor.name || "Object";
388
+ return n;
868
389
  }
869
390
  }
870
- return o || s ? (n.setContentType("application/json", !1), Fr(t)) : t;
871
- }],
872
- transformResponse: [function(t) {
873
- const n = this.transitional || Ce.transitional, r = n && n.forcedJSONParsing, s = this.responseType === "json";
874
- if (i.isResponse(t) || i.isReadableStream(t))
875
- return t;
876
- if (t && i.isString(t) && (r && !this.responseType || s)) {
877
- const a = !(n && n.silentJSONParsing) && s;
391
+ function Ct(e) {
878
392
  try {
879
- return JSON.parse(t, this.parseReviver);
880
- } catch (l) {
881
- if (a)
882
- throw l.name === "SyntaxError" ? _.from(l, _.ERR_BAD_RESPONSE, this, null, this.response) : l;
393
+ return ze(e), !1;
394
+ } catch {
395
+ return !0;
883
396
  }
884
397
  }
885
- return t;
886
- }],
887
- /**
888
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
889
- * timeout is not created.
890
- */
891
- timeout: 0,
892
- xsrfCookieName: "XSRF-TOKEN",
893
- xsrfHeaderName: "X-XSRF-TOKEN",
894
- maxContentLength: -1,
895
- maxBodyLength: -1,
896
- env: {
897
- FormData: q.classes.FormData,
898
- Blob: q.classes.Blob
899
- },
900
- validateStatus: function(t) {
901
- return t >= 200 && t < 300;
902
- },
903
- headers: {
904
- common: {
905
- Accept: "application/json, text/plain, */*",
906
- "Content-Type": void 0
398
+ function ze(e) {
399
+ return "" + e;
907
400
  }
908
- }
909
- };
910
- i.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
911
- Ce.headers[e] = {};
912
- });
913
- const jr = i.toObjectSet([
914
- "age",
915
- "authorization",
916
- "content-length",
917
- "content-type",
918
- "etag",
919
- "expires",
920
- "from",
921
- "host",
922
- "if-modified-since",
923
- "if-unmodified-since",
924
- "last-modified",
925
- "location",
926
- "max-forwards",
927
- "proxy-authorization",
928
- "referer",
929
- "retry-after",
930
- "user-agent"
931
- ]), vr = (e) => {
932
- const t = {};
933
- let n, r, s;
934
- return e && e.split(`
935
- `).forEach(function(a) {
936
- s = a.indexOf(":"), n = a.substring(0, s).trim().toLowerCase(), r = a.substring(s + 1).trim(), !(!n || t[n] && jr[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
937
- }), t;
938
- }, ht = /* @__PURE__ */ Symbol("internals");
939
- function Ae(e) {
940
- return e && String(e).trim().toLowerCase();
941
- }
942
- function je(e) {
943
- return e === !1 || e == null ? e : i.isArray(e) ? e.map(je) : String(e);
944
- }
945
- function Mr(e) {
946
- const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
947
- let r;
948
- for (; r = n.exec(e); )
949
- t[r[1]] = r[2];
950
- return t;
951
- }
952
- const Ur = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
953
- function qe(e, t, n, r, s) {
954
- if (i.isFunction(r))
955
- return r.call(this, t, n);
956
- if (s && (t = n), !!i.isString(t)) {
957
- if (i.isString(r))
958
- return t.indexOf(r) !== -1;
959
- if (i.isRegExp(r))
960
- return r.test(t);
961
- }
962
- }
963
- function kr(e) {
964
- return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
965
- }
966
- function Br(e, t) {
967
- const n = i.toCamelCase(" " + t);
968
- ["get", "set", "has"].forEach((r) => {
969
- Object.defineProperty(e, r + n, {
970
- value: function(s, o, a) {
971
- return this[r].call(this, t, s, o, a);
972
- },
973
- configurable: !0
974
- });
975
- });
976
- }
977
- let z = class {
978
- constructor(t) {
979
- t && this.set(t);
980
- }
981
- set(t, n, r) {
982
- const s = this;
983
- function o(l, m, d) {
984
- const u = Ae(m);
985
- if (!u)
986
- throw new Error("header name must be a non-empty string");
987
- const T = i.findKey(s, u);
988
- (!T || s[T] === void 0 || d === !0 || d === void 0 && s[T] !== !1) && (s[T || m] = je(l));
401
+ function qe(e) {
402
+ if (Ct(e))
403
+ return D("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", yt(e)), ze(e);
989
404
  }
990
- const a = (l, m) => i.forEach(l, (d, u) => o(d, u, m));
991
- if (i.isPlainObject(t) || t instanceof this.constructor)
992
- a(t, n);
993
- else if (i.isString(t) && (t = t.trim()) && !Ur(t))
994
- a(vr(t), n);
995
- else if (i.isObject(t) && i.isIterable(t)) {
996
- let l = {}, m, d;
997
- for (const u of t) {
998
- if (!i.isArray(u))
999
- throw TypeError("Object iterator must return a key-value pair");
1000
- l[d = u[0]] = (m = l[d]) ? i.isArray(m) ? [...m, u[1]] : [m, u[1]] : u[1];
1001
- }
1002
- a(l, n);
1003
- } else
1004
- t != null && o(n, t, r);
1005
- return this;
1006
- }
1007
- get(t, n) {
1008
- if (t = Ae(t), t) {
1009
- const r = i.findKey(this, t);
1010
- if (r) {
1011
- const s = this[r];
1012
- if (!n)
1013
- return s;
1014
- if (n === !0)
1015
- return Mr(s);
1016
- if (i.isFunction(n))
1017
- return n.call(this, s, r);
1018
- if (i.isRegExp(n))
1019
- return n.exec(s);
1020
- throw new TypeError("parser must be boolean|regexp|function");
405
+ var Ke = V.ReactCurrentOwner, Dt = {
406
+ key: !0,
407
+ ref: !0,
408
+ __self: !0,
409
+ __source: !0
410
+ }, Je, Qe;
411
+ function xt(e) {
412
+ if (he.call(e, "ref")) {
413
+ var t = Object.getOwnPropertyDescriptor(e, "ref").get;
414
+ if (t && t.isReactWarning)
415
+ return !1;
1021
416
  }
417
+ return e.ref !== void 0;
1022
418
  }
1023
- }
1024
- has(t, n) {
1025
- if (t = Ae(t), t) {
1026
- const r = i.findKey(this, t);
1027
- return !!(r && this[r] !== void 0 && (!n || qe(this, this[r], r, n)));
1028
- }
1029
- return !1;
1030
- }
1031
- delete(t, n) {
1032
- const r = this;
1033
- let s = !1;
1034
- function o(a) {
1035
- if (a = Ae(a), a) {
1036
- const l = i.findKey(r, a);
1037
- l && (!n || qe(r, r[l], l, n)) && (delete r[l], s = !0);
419
+ function bt(e) {
420
+ if (he.call(e, "key")) {
421
+ var t = Object.getOwnPropertyDescriptor(e, "key").get;
422
+ if (t && t.isReactWarning)
423
+ return !1;
1038
424
  }
425
+ return e.key !== void 0;
1039
426
  }
1040
- return i.isArray(t) ? t.forEach(o) : o(t), s;
1041
- }
1042
- clear(t) {
1043
- const n = Object.keys(this);
1044
- let r = n.length, s = !1;
1045
- for (; r--; ) {
1046
- const o = n[r];
1047
- (!t || qe(this, this[o], o, t, !0)) && (delete this[o], s = !0);
427
+ function Nt(e, t) {
428
+ typeof e.ref == "string" && Ke.current;
1048
429
  }
1049
- return s;
1050
- }
1051
- normalize(t) {
1052
- const n = this, r = {};
1053
- return i.forEach(this, (s, o) => {
1054
- const a = i.findKey(r, o);
1055
- if (a) {
1056
- n[a] = je(s), delete n[o];
1057
- return;
430
+ function Lt(e, t) {
431
+ {
432
+ var n = function() {
433
+ Je || (Je = !0, D("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
434
+ };
435
+ n.isReactWarning = !0, Object.defineProperty(e, "key", {
436
+ get: n,
437
+ configurable: !0
438
+ });
1058
439
  }
1059
- const l = t ? kr(o) : String(o).trim();
1060
- l !== o && delete n[o], n[l] = je(s), r[l] = !0;
1061
- }), this;
1062
- }
1063
- concat(...t) {
1064
- return this.constructor.concat(this, ...t);
1065
- }
1066
- toJSON(t) {
1067
- const n = /* @__PURE__ */ Object.create(null);
1068
- return i.forEach(this, (r, s) => {
1069
- r != null && r !== !1 && (n[s] = t && i.isArray(r) ? r.join(", ") : r);
1070
- }), n;
1071
- }
1072
- [Symbol.iterator]() {
1073
- return Object.entries(this.toJSON())[Symbol.iterator]();
1074
- }
1075
- toString() {
1076
- return Object.entries(this.toJSON()).map(([t, n]) => t + ": " + n).join(`
1077
- `);
1078
- }
1079
- getSetCookie() {
1080
- return this.get("set-cookie") || [];
1081
- }
1082
- get [Symbol.toStringTag]() {
1083
- return "AxiosHeaders";
1084
- }
1085
- static from(t) {
1086
- return t instanceof this ? t : new this(t);
1087
- }
1088
- static concat(t, ...n) {
1089
- const r = new this(t);
1090
- return n.forEach((s) => r.set(s)), r;
1091
- }
1092
- static accessor(t) {
1093
- const r = (this[ht] = this[ht] = {
1094
- accessors: {}
1095
- }).accessors, s = this.prototype;
1096
- function o(a) {
1097
- const l = Ae(a);
1098
- r[l] || (Br(s, a), r[l] = !0);
1099
440
  }
1100
- return i.isArray(t) ? t.forEach(o) : o(t), this;
1101
- }
1102
- };
1103
- z.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
1104
- i.reduceDescriptors(z.prototype, ({ value: e }, t) => {
1105
- let n = t[0].toUpperCase() + t.slice(1);
1106
- return {
1107
- get: () => e,
1108
- set(r) {
1109
- this[n] = r;
441
+ function Pt(e, t) {
442
+ {
443
+ var n = function() {
444
+ Qe || (Qe = !0, D("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
445
+ };
446
+ n.isReactWarning = !0, Object.defineProperty(e, "ref", {
447
+ get: n,
448
+ configurable: !0
449
+ });
450
+ }
1110
451
  }
1111
- };
1112
- });
1113
- i.freezeMethods(z);
1114
- function Ye(e, t) {
1115
- const n = this || Ce, r = t || n, s = z.from(r.headers);
1116
- let o = r.data;
1117
- return i.forEach(e, function(l) {
1118
- o = l.call(n, o, s.normalize(), t ? t.status : void 0);
1119
- }), s.normalize(), o;
1120
- }
1121
- function rn(e) {
1122
- return !!(e && e.__CANCEL__);
1123
- }
1124
- function he(e, t, n) {
1125
- _.call(this, e ?? "canceled", _.ERR_CANCELED, t, n), this.name = "CanceledError";
1126
- }
1127
- i.inherits(he, _, {
1128
- __CANCEL__: !0
1129
- });
1130
- function sn(e, t, n) {
1131
- const r = n.config.validateStatus;
1132
- !n.status || !r || r(n.status) ? e(n) : t(new _(
1133
- "Request failed with status code " + n.status,
1134
- [_.ERR_BAD_REQUEST, _.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
1135
- n.config,
1136
- n.request,
1137
- n
1138
- ));
1139
- }
1140
- function $r(e) {
1141
- const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
1142
- return t && t[1] || "";
1143
- }
1144
- function Hr(e, t) {
1145
- e = e || 10;
1146
- const n = new Array(e), r = new Array(e);
1147
- let s = 0, o = 0, a;
1148
- return t = t !== void 0 ? t : 1e3, function(m) {
1149
- const d = Date.now(), u = r[o];
1150
- a || (a = d), n[s] = m, r[s] = d;
1151
- let T = o, x = 0;
1152
- for (; T !== s; )
1153
- x += n[T++], T = T % e;
1154
- if (s = (s + 1) % e, s === o && (o = (o + 1) % e), d - a < t)
1155
- return;
1156
- const P = u && d - u;
1157
- return P ? Math.round(x * 1e3 / P) : void 0;
1158
- };
1159
- }
1160
- function Vr(e, t) {
1161
- let n = 0, r = 1e3 / t, s, o;
1162
- const a = (d, u = Date.now()) => {
1163
- n = u, s = null, o && (clearTimeout(o), o = null), e(...d);
1164
- };
1165
- return [(...d) => {
1166
- const u = Date.now(), T = u - n;
1167
- T >= r ? a(d, u) : (s = d, o || (o = setTimeout(() => {
1168
- o = null, a(s);
1169
- }, r - T)));
1170
- }, () => s && a(s)];
1171
- }
1172
- const Ue = (e, t, n = 3) => {
1173
- let r = 0;
1174
- const s = Hr(50, 250);
1175
- return Vr((o) => {
1176
- const a = o.loaded, l = o.lengthComputable ? o.total : void 0, m = a - r, d = s(m), u = a <= l;
1177
- r = a;
1178
- const T = {
1179
- loaded: a,
1180
- total: l,
1181
- progress: l ? a / l : void 0,
1182
- bytes: m,
1183
- rate: d || void 0,
1184
- estimated: d && l && u ? (l - a) / d : void 0,
1185
- event: o,
1186
- lengthComputable: l != null,
1187
- [t ? "download" : "upload"]: !0
452
+ var Mt = function(e, t, n, l, A, y, _) {
453
+ var m = {
454
+ // This tag allows us to uniquely identify this as a React Element
455
+ $$typeof: f,
456
+ // Built-in properties that belong on the element
457
+ type: e,
458
+ key: t,
459
+ ref: n,
460
+ props: _,
461
+ // Record the component responsible for creating this element.
462
+ _owner: y
463
+ };
464
+ return m._store = {}, Object.defineProperty(m._store, "validated", {
465
+ configurable: !1,
466
+ enumerable: !1,
467
+ writable: !0,
468
+ value: !1
469
+ }), Object.defineProperty(m, "_self", {
470
+ configurable: !1,
471
+ enumerable: !1,
472
+ writable: !1,
473
+ value: l
474
+ }), Object.defineProperty(m, "_source", {
475
+ configurable: !1,
476
+ enumerable: !1,
477
+ writable: !1,
478
+ value: A
479
+ }), Object.freeze && (Object.freeze(m.props), Object.freeze(m)), m;
1188
480
  };
1189
- e(T);
1190
- }, n);
1191
- }, Tt = (e, t) => {
1192
- const n = e != null;
1193
- return [(r) => t[0]({
1194
- lengthComputable: n,
1195
- total: e,
1196
- loaded: r
1197
- }), t[1]];
1198
- }, Rt = (e) => (...t) => i.asap(() => e(...t)), Gr = q.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, q.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
1199
- new URL(q.origin),
1200
- q.navigator && /(msie|trident)/i.test(q.navigator.userAgent)
1201
- ) : () => !0, Wr = q.hasStandardBrowserEnv ? (
1202
- // Standard browser envs support document.cookie
1203
- {
1204
- write(e, t, n, r, s, o, a) {
1205
- if (typeof document > "u") return;
1206
- const l = [`${e}=${encodeURIComponent(t)}`];
1207
- i.isNumber(n) && l.push(`expires=${new Date(n).toUTCString()}`), i.isString(r) && l.push(`path=${r}`), i.isString(s) && l.push(`domain=${s}`), o === !0 && l.push("secure"), i.isString(a) && l.push(`SameSite=${a}`), document.cookie = l.join("; ");
1208
- },
1209
- read(e) {
1210
- if (typeof document > "u") return null;
1211
- const t = document.cookie.match(new RegExp("(?:^|; )" + e + "=([^;]*)"));
1212
- return t ? decodeURIComponent(t[1]) : null;
1213
- },
1214
- remove(e) {
1215
- this.write(e, "", Date.now() - 864e5, "/");
1216
- }
1217
- }
1218
- ) : (
1219
- // Non-standard browser env (web workers, react-native) lack needed support.
1220
- {
1221
- write() {
1222
- },
1223
- read() {
1224
- return null;
1225
- },
1226
- remove() {
481
+ function jt(e, t, n, l, A) {
482
+ {
483
+ var y, _ = {}, m = null, $ = null;
484
+ n !== void 0 && (qe(n), m = "" + n), bt(t) && (qe(t.key), m = "" + t.key), xt(t) && ($ = t.ref, Nt(t, A));
485
+ for (y in t)
486
+ he.call(t, y) && !Dt.hasOwnProperty(y) && (_[y] = t[y]);
487
+ if (e && e.defaultProps) {
488
+ var L = e.defaultProps;
489
+ for (y in L)
490
+ _[y] === void 0 && (_[y] = L[y]);
491
+ }
492
+ if (m || $) {
493
+ var j = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
494
+ m && Lt(_, j), $ && Pt(_, j);
495
+ }
496
+ return Mt(e, m, $, A, l, Ke.current, _);
497
+ }
1227
498
  }
1228
- }
1229
- );
1230
- function qr(e) {
1231
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
1232
- }
1233
- function Yr(e, t) {
1234
- return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
1235
- }
1236
- function on(e, t, n) {
1237
- let r = !qr(t);
1238
- return e && (r || n == !1) ? Yr(e, t) : t;
1239
- }
1240
- const St = (e) => e instanceof z ? { ...e } : e;
1241
- function fe(e, t) {
1242
- t = t || {};
1243
- const n = {};
1244
- function r(d, u, T, x) {
1245
- return i.isPlainObject(d) && i.isPlainObject(u) ? i.merge.call({ caseless: x }, d, u) : i.isPlainObject(u) ? i.merge({}, u) : i.isArray(u) ? u.slice() : u;
1246
- }
1247
- function s(d, u, T, x) {
1248
- if (i.isUndefined(u)) {
1249
- if (!i.isUndefined(d))
1250
- return r(void 0, d, T, x);
1251
- } else return r(d, u, T, x);
1252
- }
1253
- function o(d, u) {
1254
- if (!i.isUndefined(u))
1255
- return r(void 0, u);
1256
- }
1257
- function a(d, u) {
1258
- if (i.isUndefined(u)) {
1259
- if (!i.isUndefined(d))
1260
- return r(void 0, d);
1261
- } else return r(void 0, u);
1262
- }
1263
- function l(d, u, T) {
1264
- if (T in t)
1265
- return r(d, u);
1266
- if (T in e)
1267
- return r(void 0, d);
1268
- }
1269
- const m = {
1270
- url: o,
1271
- method: o,
1272
- data: o,
1273
- baseURL: a,
1274
- transformRequest: a,
1275
- transformResponse: a,
1276
- paramsSerializer: a,
1277
- timeout: a,
1278
- timeoutMessage: a,
1279
- withCredentials: a,
1280
- withXSRFToken: a,
1281
- adapter: a,
1282
- responseType: a,
1283
- xsrfCookieName: a,
1284
- xsrfHeaderName: a,
1285
- onUploadProgress: a,
1286
- onDownloadProgress: a,
1287
- decompress: a,
1288
- maxContentLength: a,
1289
- maxBodyLength: a,
1290
- beforeRedirect: a,
1291
- transport: a,
1292
- httpAgent: a,
1293
- httpsAgent: a,
1294
- cancelToken: a,
1295
- socketPath: a,
1296
- responseEncoding: a,
1297
- validateStatus: l,
1298
- headers: (d, u, T) => s(St(d), St(u), T, !0)
1299
- };
1300
- return i.forEach(Object.keys({ ...e, ...t }), function(u) {
1301
- const T = m[u] || s, x = T(e[u], t[u], u);
1302
- i.isUndefined(x) && T !== l || (n[u] = x);
1303
- }), n;
1304
- }
1305
- const an = (e) => {
1306
- const t = fe({}, e);
1307
- let { data: n, withXSRFToken: r, xsrfHeaderName: s, xsrfCookieName: o, headers: a, auth: l } = t;
1308
- if (t.headers = a = z.from(a), t.url = en(on(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), l && a.set(
1309
- "Authorization",
1310
- "Basic " + btoa((l.username || "") + ":" + (l.password ? unescape(encodeURIComponent(l.password)) : ""))
1311
- ), i.isFormData(n)) {
1312
- if (q.hasStandardBrowserEnv || q.hasStandardBrowserWebWorkerEnv)
1313
- a.setContentType(void 0);
1314
- else if (i.isFunction(n.getHeaders)) {
1315
- const m = n.getHeaders(), d = ["content-type", "content-length"];
1316
- Object.entries(m).forEach(([u, T]) => {
1317
- d.includes(u.toLowerCase()) && a.set(u, T);
1318
- });
499
+ var Fe = V.ReactCurrentOwner, Ze = V.ReactDebugCurrentFrame;
500
+ function pe(e) {
501
+ if (e) {
502
+ var t = e._owner, n = De(e.type, e._source, t ? t.type : null);
503
+ Ze.setExtraStackFrame(n);
504
+ } else
505
+ Ze.setExtraStackFrame(null);
1319
506
  }
1320
- }
1321
- if (q.hasStandardBrowserEnv && (r && i.isFunction(r) && (r = r(t)), r || r !== !1 && Gr(t.url))) {
1322
- const m = s && o && Wr.read(o);
1323
- m && a.set(s, m);
1324
- }
1325
- return t;
1326
- }, zr = typeof XMLHttpRequest < "u", Xr = zr && function(e) {
1327
- return new Promise(function(n, r) {
1328
- const s = an(e);
1329
- let o = s.data;
1330
- const a = z.from(s.headers).normalize();
1331
- let { responseType: l, onUploadProgress: m, onDownloadProgress: d } = s, u, T, x, P, f;
1332
- function S() {
1333
- P && P(), f && f(), s.cancelToken && s.cancelToken.unsubscribe(u), s.signal && s.signal.removeEventListener("abort", u);
507
+ var we;
508
+ we = !1;
509
+ function Ue(e) {
510
+ return typeof e == "object" && e !== null && e.$$typeof === f;
1334
511
  }
1335
- let h = new XMLHttpRequest();
1336
- h.open(s.method.toUpperCase(), s.url, !0), h.timeout = s.timeout;
1337
- function w() {
1338
- if (!h)
1339
- return;
1340
- const I = z.from(
1341
- "getAllResponseHeaders" in h && h.getAllResponseHeaders()
1342
- ), F = {
1343
- data: !l || l === "text" || l === "json" ? h.responseText : h.response,
1344
- status: h.status,
1345
- statusText: h.statusText,
1346
- headers: I,
1347
- config: e,
1348
- request: h
1349
- };
1350
- sn(function(U) {
1351
- n(U), S();
1352
- }, function(U) {
1353
- r(U), S();
1354
- }, F), h = null;
512
+ function et() {
513
+ {
514
+ if (Fe.current) {
515
+ var e = T(Fe.current.type);
516
+ if (e)
517
+ return `
518
+
519
+ Check the render method of \`` + e + "`.";
520
+ }
521
+ return "";
522
+ }
1355
523
  }
1356
- "onloadend" in h ? h.onloadend = w : h.onreadystatechange = function() {
1357
- !h || h.readyState !== 4 || h.status === 0 && !(h.responseURL && h.responseURL.indexOf("file:") === 0) || setTimeout(w);
1358
- }, h.onabort = function() {
1359
- h && (r(new _("Request aborted", _.ECONNABORTED, e, h)), h = null);
1360
- }, h.onerror = function(D) {
1361
- const F = D && D.message ? D.message : "Network Error", V = new _(F, _.ERR_NETWORK, e, h);
1362
- V.event = D || null, r(V), h = null;
1363
- }, h.ontimeout = function() {
1364
- let D = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
1365
- const F = s.transitional || tn;
1366
- s.timeoutErrorMessage && (D = s.timeoutErrorMessage), r(new _(
1367
- D,
1368
- F.clarifyTimeoutError ? _.ETIMEDOUT : _.ECONNABORTED,
1369
- e,
1370
- h
1371
- )), h = null;
1372
- }, o === void 0 && a.setContentType(null), "setRequestHeader" in h && i.forEach(a.toJSON(), function(D, F) {
1373
- h.setRequestHeader(F, D);
1374
- }), i.isUndefined(s.withCredentials) || (h.withCredentials = !!s.withCredentials), l && l !== "json" && (h.responseType = s.responseType), d && ([x, f] = Ue(d, !0), h.addEventListener("progress", x)), m && h.upload && ([T, P] = Ue(m), h.upload.addEventListener("progress", T), h.upload.addEventListener("loadend", P)), (s.cancelToken || s.signal) && (u = (I) => {
1375
- h && (r(!I || I.type ? new he(null, e, h) : I), h.abort(), h = null);
1376
- }, s.cancelToken && s.cancelToken.subscribe(u), s.signal && (s.signal.aborted ? u() : s.signal.addEventListener("abort", u)));
1377
- const j = $r(s.url);
1378
- if (j && q.protocols.indexOf(j) === -1) {
1379
- r(new _("Unsupported protocol " + j + ":", _.ERR_BAD_REQUEST, e));
1380
- return;
524
+ function Ft(e) {
525
+ return "";
1381
526
  }
1382
- h.send(o || null);
1383
- });
1384
- }, Jr = (e, t) => {
1385
- const { length: n } = e = e ? e.filter(Boolean) : [];
1386
- if (t || n) {
1387
- let r = new AbortController(), s;
1388
- const o = function(d) {
1389
- if (!s) {
1390
- s = !0, l();
1391
- const u = d instanceof Error ? d : this.reason;
1392
- r.abort(u instanceof _ ? u : new he(u instanceof Error ? u.message : u));
527
+ var tt = {};
528
+ function wt(e) {
529
+ {
530
+ var t = et();
531
+ if (!t) {
532
+ var n = typeof e == "string" ? e : e.displayName || e.name;
533
+ n && (t = `
534
+
535
+ Check the top-level render call using <` + n + ">.");
536
+ }
537
+ return t;
1393
538
  }
1394
- };
1395
- let a = t && setTimeout(() => {
1396
- a = null, o(new _(`timeout ${t} of ms exceeded`, _.ETIMEDOUT));
1397
- }, t);
1398
- const l = () => {
1399
- e && (a && clearTimeout(a), a = null, e.forEach((d) => {
1400
- d.unsubscribe ? d.unsubscribe(o) : d.removeEventListener("abort", o);
1401
- }), e = null);
1402
- };
1403
- e.forEach((d) => d.addEventListener("abort", o));
1404
- const { signal: m } = r;
1405
- return m.unsubscribe = () => i.asap(l), m;
1406
- }
1407
- }, Kr = function* (e, t) {
1408
- let n = e.byteLength;
1409
- if (n < t) {
1410
- yield e;
1411
- return;
1412
- }
1413
- let r = 0, s;
1414
- for (; r < n; )
1415
- s = r + t, yield e.slice(r, s), r = s;
1416
- }, Qr = async function* (e, t) {
1417
- for await (const n of Zr(e))
1418
- yield* Kr(n, t);
1419
- }, Zr = async function* (e) {
1420
- if (e[Symbol.asyncIterator]) {
1421
- yield* e;
1422
- return;
1423
- }
1424
- const t = e.getReader();
1425
- try {
1426
- for (; ; ) {
1427
- const { done: n, value: r } = await t.read();
1428
- if (n)
1429
- break;
1430
- yield r;
1431
539
  }
1432
- } finally {
1433
- await t.cancel();
1434
- }
1435
- }, At = (e, t, n, r) => {
1436
- const s = Qr(e, t);
1437
- let o = 0, a, l = (m) => {
1438
- a || (a = !0, r && r(m));
1439
- };
1440
- return new ReadableStream({
1441
- async pull(m) {
1442
- try {
1443
- const { done: d, value: u } = await s.next();
1444
- if (d) {
1445
- l(), m.close();
540
+ function rt(e, t) {
541
+ {
542
+ if (!e._store || e._store.validated || e.key != null)
1446
543
  return;
1447
- }
1448
- let T = u.byteLength;
1449
- if (n) {
1450
- let x = o += T;
1451
- n(x);
1452
- }
1453
- m.enqueue(new Uint8Array(u));
1454
- } catch (d) {
1455
- throw l(d), d;
544
+ e._store.validated = !0;
545
+ var n = wt(t);
546
+ if (tt[n])
547
+ return;
548
+ tt[n] = !0;
549
+ var l = "";
550
+ e && e._owner && e._owner !== Fe.current && (l = " It was passed a child from " + T(e._owner.type) + "."), pe(e), D('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, l), pe(null);
1456
551
  }
1457
- },
1458
- cancel(m) {
1459
- return l(m), s.return();
1460
552
  }
1461
- }, {
1462
- highWaterMark: 2
1463
- });
1464
- }, yt = 64 * 1024, { isFunction: De } = i, es = (({ Request: e, Response: t }) => ({
1465
- Request: e,
1466
- Response: t
1467
- }))(i.global), {
1468
- ReadableStream: gt,
1469
- TextEncoder: bt
1470
- } = i.global, Ot = (e, ...t) => {
1471
- try {
1472
- return !!e(...t);
1473
- } catch {
1474
- return !1;
1475
- }
1476
- }, ts = (e) => {
1477
- e = i.merge.call({
1478
- skipUndefined: !0
1479
- }, es, e);
1480
- const { fetch: t, Request: n, Response: r } = e, s = t ? De(t) : typeof fetch == "function", o = De(n), a = De(r);
1481
- if (!s)
1482
- return !1;
1483
- const l = s && De(gt), m = s && (typeof bt == "function" ? /* @__PURE__ */ ((f) => (S) => f.encode(S))(new bt()) : async (f) => new Uint8Array(await new n(f).arrayBuffer())), d = o && l && Ot(() => {
1484
- let f = !1;
1485
- const S = new n(q.origin, {
1486
- body: new gt(),
1487
- method: "POST",
1488
- get duplex() {
1489
- return f = !0, "half";
1490
- }
1491
- }).headers.has("Content-Type");
1492
- return f && !S;
1493
- }), u = a && l && Ot(() => i.isReadableStream(new r("").body)), T = {
1494
- stream: u && ((f) => f.body)
1495
- };
1496
- s && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((f) => {
1497
- !T[f] && (T[f] = (S, h) => {
1498
- let w = S && S[f];
1499
- if (w)
1500
- return w.call(S);
1501
- throw new _(`Response type '${f}' is not supported`, _.ERR_NOT_SUPPORT, h);
1502
- });
1503
- });
1504
- const x = async (f) => {
1505
- if (f == null)
1506
- return 0;
1507
- if (i.isBlob(f))
1508
- return f.size;
1509
- if (i.isSpecCompliantForm(f))
1510
- return (await new n(q.origin, {
1511
- method: "POST",
1512
- body: f
1513
- }).arrayBuffer()).byteLength;
1514
- if (i.isArrayBufferView(f) || i.isArrayBuffer(f))
1515
- return f.byteLength;
1516
- if (i.isURLSearchParams(f) && (f = f + ""), i.isString(f))
1517
- return (await m(f)).byteLength;
1518
- }, P = async (f, S) => {
1519
- const h = i.toFiniteNumber(f.getContentLength());
1520
- return h ?? x(S);
1521
- };
1522
- return async (f) => {
1523
- let {
1524
- url: S,
1525
- method: h,
1526
- data: w,
1527
- signal: j,
1528
- cancelToken: I,
1529
- timeout: D,
1530
- onDownloadProgress: F,
1531
- onUploadProgress: V,
1532
- responseType: U,
1533
- headers: b,
1534
- withCredentials: y = "same-origin",
1535
- fetchOptions: g
1536
- } = an(f), N = t || fetch;
1537
- U = U ? (U + "").toLowerCase() : "text";
1538
- let B = Jr([j, I && I.toAbortSignal()], D), L = null;
1539
- const W = B && B.unsubscribe && (() => {
1540
- B.unsubscribe();
1541
- });
1542
- let Q;
1543
- try {
1544
- if (V && d && h !== "get" && h !== "head" && (Q = await P(b, w)) !== 0) {
1545
- let c = new n(S, {
1546
- method: "POST",
1547
- body: w,
1548
- duplex: "half"
1549
- }), A;
1550
- if (i.isFormData(w) && (A = c.headers.get("content-type")) && b.setContentType(A), c.body) {
1551
- const [p, R] = Tt(
1552
- Q,
1553
- Ue(Rt(V))
1554
- );
1555
- w = At(c.body, yt, p, R);
553
+ function at(e, t) {
554
+ {
555
+ if (typeof e != "object")
556
+ return;
557
+ if (je(e))
558
+ for (var n = 0; n < e.length; n++) {
559
+ var l = e[n];
560
+ Ue(l) && rt(l, t);
561
+ }
562
+ else if (Ue(e))
563
+ e._store && (e._store.validated = !0);
564
+ else if (e) {
565
+ var A = K(e);
566
+ if (typeof A == "function" && A !== e.entries)
567
+ for (var y = A.call(e), _; !(_ = y.next()).done; )
568
+ Ue(_.value) && rt(_.value, t);
1556
569
  }
1557
570
  }
1558
- i.isString(y) || (y = y ? "include" : "omit");
1559
- const G = o && "credentials" in n.prototype, ne = {
1560
- ...g,
1561
- signal: B,
1562
- method: h.toUpperCase(),
1563
- headers: b.normalize().toJSON(),
1564
- body: w,
1565
- duplex: "half",
1566
- credentials: G ? y : void 0
1567
- };
1568
- L = o && new n(S, ne);
1569
- let X = await (o ? N(L, g) : N(S, ne));
1570
- const le = u && (U === "stream" || U === "response");
1571
- if (u && (F || le && W)) {
1572
- const c = {};
1573
- ["status", "statusText", "headers"].forEach((C) => {
1574
- c[C] = X[C];
1575
- });
1576
- const A = i.toFiniteNumber(X.headers.get("content-length")), [p, R] = F && Tt(
1577
- A,
1578
- Ue(Rt(F), !0)
1579
- ) || [];
1580
- X = new r(
1581
- At(X.body, yt, p, () => {
1582
- R && R(), W && W();
1583
- }),
1584
- c
1585
- );
1586
- }
1587
- U = U || "text";
1588
- let ce = await T[i.findKey(T, U) || "text"](X, f);
1589
- return !le && W && W(), await new Promise((c, A) => {
1590
- sn(c, A, {
1591
- data: ce,
1592
- headers: z.from(X.headers),
1593
- status: X.status,
1594
- statusText: X.statusText,
1595
- config: f,
1596
- request: L
1597
- });
1598
- });
1599
- } catch (G) {
1600
- throw W && W(), G && G.name === "TypeError" && /Load failed|fetch/i.test(G.message) ? Object.assign(
1601
- new _("Network Error", _.ERR_NETWORK, f, L),
1602
- {
1603
- cause: G.cause || G
1604
- }
1605
- ) : _.from(G, G && G.code, f, L);
1606
- }
1607
- };
1608
- }, ns = /* @__PURE__ */ new Map(), ln = (e) => {
1609
- let t = e && e.env || {};
1610
- const { fetch: n, Request: r, Response: s } = t, o = [
1611
- r,
1612
- s,
1613
- n
1614
- ];
1615
- let a = o.length, l = a, m, d, u = ns;
1616
- for (; l--; )
1617
- m = o[l], d = u.get(m), d === void 0 && u.set(m, d = l ? /* @__PURE__ */ new Map() : ts(t)), u = d;
1618
- return d;
1619
- };
1620
- ln();
1621
- const lt = {
1622
- http: Sr,
1623
- xhr: Xr,
1624
- fetch: {
1625
- get: ln
1626
- }
1627
- };
1628
- i.forEach(lt, (e, t) => {
1629
- if (e) {
1630
- try {
1631
- Object.defineProperty(e, "name", { value: t });
1632
- } catch {
1633
- }
1634
- Object.defineProperty(e, "adapterName", { value: t });
1635
- }
1636
- });
1637
- const _t = (e) => `- ${e}`, rs = (e) => i.isFunction(e) || e === null || e === !1;
1638
- function ss(e, t) {
1639
- e = i.isArray(e) ? e : [e];
1640
- const { length: n } = e;
1641
- let r, s;
1642
- const o = {};
1643
- for (let a = 0; a < n; a++) {
1644
- r = e[a];
1645
- let l;
1646
- if (s = r, !rs(r) && (s = lt[(l = String(r)).toLowerCase()], s === void 0))
1647
- throw new _(`Unknown adapter '${l}'`);
1648
- if (s && (i.isFunction(s) || (s = s.get(t))))
1649
- break;
1650
- o[l || "#" + a] = s;
1651
- }
1652
- if (!s) {
1653
- const a = Object.entries(o).map(
1654
- ([m, d]) => `adapter ${m} ` + (d === !1 ? "is not supported by the environment" : "is not available in the build")
1655
- );
1656
- let l = n ? a.length > 1 ? `since :
1657
- ` + a.map(_t).join(`
1658
- `) : " " + _t(a[0]) : "as no adapter specified";
1659
- throw new _(
1660
- "There is no suitable adapter to dispatch the request " + l,
1661
- "ERR_NOT_SUPPORT"
1662
- );
1663
- }
1664
- return s;
1665
- }
1666
- const cn = {
1667
- /**
1668
- * Resolve an adapter from a list of adapter names or functions.
1669
- * @type {Function}
1670
- */
1671
- getAdapter: ss,
1672
- /**
1673
- * Exposes all known adapters
1674
- * @type {Object<string, Function|Object>}
1675
- */
1676
- adapters: lt
1677
- };
1678
- function ze(e) {
1679
- if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
1680
- throw new he(null, e);
1681
- }
1682
- function wt(e) {
1683
- return ze(e), e.headers = z.from(e.headers), e.data = Ye.call(
1684
- e,
1685
- e.transformRequest
1686
- ), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), cn.getAdapter(e.adapter || Ce.adapter, e)(e).then(function(r) {
1687
- return ze(e), r.data = Ye.call(
1688
- e,
1689
- e.transformResponse,
1690
- r
1691
- ), r.headers = z.from(r.headers), r;
1692
- }, function(r) {
1693
- return rn(r) || (ze(e), r && r.response && (r.response.data = Ye.call(
1694
- e,
1695
- e.transformResponse,
1696
- r.response
1697
- ), r.response.headers = z.from(r.response.headers))), Promise.reject(r);
1698
- });
1699
- }
1700
- const un = "1.13.2", Ge = {};
1701
- ["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
1702
- Ge[e] = function(r) {
1703
- return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
1704
- };
1705
- });
1706
- const xt = {};
1707
- Ge.transitional = function(t, n, r) {
1708
- function s(o, a) {
1709
- return "[Axios v" + un + "] Transitional option '" + o + "'" + a + (r ? ". " + r : "");
1710
- }
1711
- return (o, a, l) => {
1712
- if (t === !1)
1713
- throw new _(
1714
- s(a, " has been removed" + (n ? " in " + n : "")),
1715
- _.ERR_DEPRECATED
1716
- );
1717
- return n && !xt[a] && (xt[a] = !0, console.warn(
1718
- s(
1719
- a,
1720
- " has been deprecated since v" + n + " and will be removed in the near future"
1721
- )
1722
- )), t ? t(o, a, l) : !0;
1723
- };
1724
- };
1725
- Ge.spelling = function(t) {
1726
- return (n, r) => (console.warn(`${r} is likely a misspelling of ${t}`), !0);
1727
- };
1728
- function os(e, t, n) {
1729
- if (typeof e != "object")
1730
- throw new _("options must be an object", _.ERR_BAD_OPTION_VALUE);
1731
- const r = Object.keys(e);
1732
- let s = r.length;
1733
- for (; s-- > 0; ) {
1734
- const o = r[s], a = t[o];
1735
- if (a) {
1736
- const l = e[o], m = l === void 0 || a(l, o, e);
1737
- if (m !== !0)
1738
- throw new _("option " + o + " must be " + m, _.ERR_BAD_OPTION_VALUE);
1739
- continue;
1740
571
  }
1741
- if (n !== !0)
1742
- throw new _("Unknown option " + o, _.ERR_BAD_OPTION);
1743
- }
1744
- }
1745
- const ve = {
1746
- assertOptions: os,
1747
- validators: Ge
1748
- }, te = ve.validators;
1749
- let de = class {
1750
- constructor(t) {
1751
- this.defaults = t || {}, this.interceptors = {
1752
- request: new mt(),
1753
- response: new mt()
1754
- };
1755
- }
1756
- /**
1757
- * Dispatch a request
1758
- *
1759
- * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
1760
- * @param {?Object} config
1761
- *
1762
- * @returns {Promise} The Promise to be fulfilled
1763
- */
1764
- async request(t, n) {
1765
- try {
1766
- return await this._request(t, n);
1767
- } catch (r) {
1768
- if (r instanceof Error) {
1769
- let s = {};
1770
- Error.captureStackTrace ? Error.captureStackTrace(s) : s = new Error();
1771
- const o = s.stack ? s.stack.replace(/^.+\n/, "") : "";
1772
- try {
1773
- r.stack ? o && !String(r.stack).endsWith(o.replace(/^.+\n.+\n/, "")) && (r.stack += `
1774
- ` + o) : r.stack = o;
1775
- } catch {
572
+ function Ut(e) {
573
+ {
574
+ var t = e.type;
575
+ if (t == null || typeof t == "string")
576
+ return;
577
+ var n;
578
+ if (typeof t == "function")
579
+ n = t.propTypes;
580
+ else if (typeof t == "object" && (t.$$typeof === g || // Note: Memo only checks outer props here.
581
+ // Inner props are checked in the reconciler.
582
+ t.$$typeof === O))
583
+ n = t.propTypes;
584
+ else
585
+ return;
586
+ if (n) {
587
+ var l = T(t);
588
+ It(n, e.props, "prop", l, e);
589
+ } else if (t.PropTypes !== void 0 && !we) {
590
+ we = !0;
591
+ var A = T(t);
592
+ D("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", A || "Unknown");
1776
593
  }
594
+ typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved && D("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
1777
595
  }
1778
- throw r;
1779
596
  }
1780
- }
1781
- _request(t, n) {
1782
- typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = fe(this.defaults, n);
1783
- const { transitional: r, paramsSerializer: s, headers: o } = n;
1784
- r !== void 0 && ve.assertOptions(r, {
1785
- silentJSONParsing: te.transitional(te.boolean),
1786
- forcedJSONParsing: te.transitional(te.boolean),
1787
- clarifyTimeoutError: te.transitional(te.boolean)
1788
- }, !1), s != null && (i.isFunction(s) ? n.paramsSerializer = {
1789
- serialize: s
1790
- } : ve.assertOptions(s, {
1791
- encode: te.function,
1792
- serialize: te.function
1793
- }, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), ve.assertOptions(n, {
1794
- baseUrl: te.spelling("baseURL"),
1795
- withXsrfToken: te.spelling("withXSRFToken")
1796
- }, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
1797
- let a = o && i.merge(
1798
- o.common,
1799
- o[n.method]
1800
- );
1801
- o && i.forEach(
1802
- ["delete", "get", "head", "post", "put", "patch", "common"],
1803
- (f) => {
1804
- delete o[f];
597
+ function Gt(e) {
598
+ {
599
+ for (var t = Object.keys(e.props), n = 0; n < t.length; n++) {
600
+ var l = t[n];
601
+ if (l !== "children" && l !== "key") {
602
+ pe(e), D("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", l), pe(null);
603
+ break;
604
+ }
605
+ }
606
+ e.ref !== null && (pe(e), D("Invalid attribute `ref` supplied to `React.Fragment`."), pe(null));
1805
607
  }
1806
- ), n.headers = z.concat(a, o);
1807
- const l = [];
1808
- let m = !0;
1809
- this.interceptors.request.forEach(function(S) {
1810
- typeof S.runWhen == "function" && S.runWhen(n) === !1 || (m = m && S.synchronous, l.unshift(S.fulfilled, S.rejected));
1811
- });
1812
- const d = [];
1813
- this.interceptors.response.forEach(function(S) {
1814
- d.push(S.fulfilled, S.rejected);
1815
- });
1816
- let u, T = 0, x;
1817
- if (!m) {
1818
- const f = [wt.bind(this), void 0];
1819
- for (f.unshift(...l), f.push(...d), x = f.length, u = Promise.resolve(n); T < x; )
1820
- u = u.then(f[T++], f[T++]);
1821
- return u;
1822
608
  }
1823
- x = l.length;
1824
- let P = n;
1825
- for (; T < x; ) {
1826
- const f = l[T++], S = l[T++];
1827
- try {
1828
- P = f(P);
1829
- } catch (h) {
1830
- S.call(this, h);
1831
- break;
609
+ var nt = {};
610
+ function ot(e, t, n, l, A, y) {
611
+ {
612
+ var _ = R(e);
613
+ if (!_) {
614
+ var m = "";
615
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (m += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
616
+ var $ = Ft();
617
+ $ ? m += $ : m += et();
618
+ var L;
619
+ e === null ? L = "null" : je(e) ? L = "array" : e !== void 0 && e.$$typeof === f ? (L = "<" + (T(e.type) || "Unknown") + " />", m = " Did you accidentally export a JSX literal instead of a component?") : L = typeof e, D("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", L, m);
620
+ }
621
+ var j = jt(e, t, n, A, y);
622
+ if (j == null)
623
+ return j;
624
+ if (_) {
625
+ var q = t.children;
626
+ if (q !== void 0)
627
+ if (l)
628
+ if (je(q)) {
629
+ for (var me = 0; me < q.length; me++)
630
+ at(q[me], e);
631
+ Object.freeze && Object.freeze(q);
632
+ } else
633
+ D("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
634
+ else
635
+ at(q, e);
636
+ }
637
+ if (he.call(t, "key")) {
638
+ var Ee = T(e), B = Object.keys(t).filter(function(Bt) {
639
+ return Bt !== "key";
640
+ }), Ge = B.length > 0 ? "{key: someKey, " + B.join(": ..., ") + ": ...}" : "{key: someKey}";
641
+ if (!nt[Ee + Ge]) {
642
+ var Wt = B.length > 0 ? "{" + B.join(": ..., ") + ": ...}" : "{}";
643
+ D(`A props object containing a "key" prop is being spread into JSX:
644
+ let props = %s;
645
+ <%s {...props} />
646
+ React keys must be passed directly to JSX without using spread:
647
+ let props = %s;
648
+ <%s key={someKey} {...props} />`, Ge, Ee, Wt, Ee), nt[Ee + Ge] = !0;
649
+ }
650
+ }
651
+ return e === E ? Gt(j) : Ut(j), j;
1832
652
  }
1833
653
  }
1834
- try {
1835
- u = wt.call(this, P);
1836
- } catch (f) {
1837
- return Promise.reject(f);
654
+ function kt(e, t, n) {
655
+ return ot(e, t, n, !0);
1838
656
  }
1839
- for (T = 0, x = d.length; T < x; )
1840
- u = u.then(d[T++], d[T++]);
1841
- return u;
1842
- }
1843
- getUri(t) {
1844
- t = fe(this.defaults, t);
1845
- const n = on(t.baseURL, t.url, t.allowAbsoluteUrls);
1846
- return en(n, t.params, t.paramsSerializer);
1847
- }
1848
- };
1849
- i.forEach(["delete", "get", "head", "options"], function(t) {
1850
- de.prototype[t] = function(n, r) {
1851
- return this.request(fe(r || {}, {
1852
- method: t,
1853
- url: n,
1854
- data: (r || {}).data
1855
- }));
1856
- };
1857
- });
1858
- i.forEach(["post", "put", "patch"], function(t) {
1859
- function n(r) {
1860
- return function(o, a, l) {
1861
- return this.request(fe(l || {}, {
1862
- method: t,
1863
- headers: r ? {
1864
- "Content-Type": "multipart/form-data"
1865
- } : {},
1866
- url: o,
1867
- data: a
1868
- }));
1869
- };
1870
- }
1871
- de.prototype[t] = n(), de.prototype[t + "Form"] = n(!0);
1872
- });
1873
- let as = class dn {
1874
- constructor(t) {
1875
- if (typeof t != "function")
1876
- throw new TypeError("executor must be a function.");
1877
- let n;
1878
- this.promise = new Promise(function(o) {
1879
- n = o;
1880
- });
1881
- const r = this;
1882
- this.promise.then((s) => {
1883
- if (!r._listeners) return;
1884
- let o = r._listeners.length;
1885
- for (; o-- > 0; )
1886
- r._listeners[o](s);
1887
- r._listeners = null;
1888
- }), this.promise.then = (s) => {
1889
- let o;
1890
- const a = new Promise((l) => {
1891
- r.subscribe(l), o = l;
1892
- }).then(s);
1893
- return a.cancel = function() {
1894
- r.unsubscribe(o);
1895
- }, a;
1896
- }, t(function(o, a, l) {
1897
- r.reason || (r.reason = new he(o, a, l), n(r.reason));
1898
- });
1899
- }
1900
- /**
1901
- * Throws a `CanceledError` if cancellation has been requested.
1902
- */
1903
- throwIfRequested() {
1904
- if (this.reason)
1905
- throw this.reason;
1906
- }
1907
- /**
1908
- * Subscribe to the cancel signal
1909
- */
1910
- subscribe(t) {
1911
- if (this.reason) {
1912
- t(this.reason);
1913
- return;
657
+ function Yt(e, t, n) {
658
+ return ot(e, t, n, !1);
1914
659
  }
1915
- this._listeners ? this._listeners.push(t) : this._listeners = [t];
1916
- }
1917
- /**
1918
- * Unsubscribe from the cancel signal
1919
- */
1920
- unsubscribe(t) {
1921
- if (!this._listeners)
1922
- return;
1923
- const n = this._listeners.indexOf(t);
1924
- n !== -1 && this._listeners.splice(n, 1);
1925
- }
1926
- toAbortSignal() {
1927
- const t = new AbortController(), n = (r) => {
1928
- t.abort(r);
1929
- };
1930
- return this.subscribe(n), t.signal.unsubscribe = () => this.unsubscribe(n), t.signal;
1931
- }
1932
- /**
1933
- * Returns an object that contains a new `CancelToken` and a function that, when called,
1934
- * cancels the `CancelToken`.
1935
- */
1936
- static source() {
1937
- let t;
1938
- return {
1939
- token: new dn(function(s) {
1940
- t = s;
1941
- }),
1942
- cancel: t
1943
- };
1944
- }
1945
- };
1946
- function is(e) {
1947
- return function(n) {
1948
- return e.apply(null, n);
1949
- };
1950
- }
1951
- function ls(e) {
1952
- return i.isObject(e) && e.isAxiosError === !0;
1953
- }
1954
- const st = {
1955
- Continue: 100,
1956
- SwitchingProtocols: 101,
1957
- Processing: 102,
1958
- EarlyHints: 103,
1959
- Ok: 200,
1960
- Created: 201,
1961
- Accepted: 202,
1962
- NonAuthoritativeInformation: 203,
1963
- NoContent: 204,
1964
- ResetContent: 205,
1965
- PartialContent: 206,
1966
- MultiStatus: 207,
1967
- AlreadyReported: 208,
1968
- ImUsed: 226,
1969
- MultipleChoices: 300,
1970
- MovedPermanently: 301,
1971
- Found: 302,
1972
- SeeOther: 303,
1973
- NotModified: 304,
1974
- UseProxy: 305,
1975
- Unused: 306,
1976
- TemporaryRedirect: 307,
1977
- PermanentRedirect: 308,
1978
- BadRequest: 400,
1979
- Unauthorized: 401,
1980
- PaymentRequired: 402,
1981
- Forbidden: 403,
1982
- NotFound: 404,
1983
- MethodNotAllowed: 405,
1984
- NotAcceptable: 406,
1985
- ProxyAuthenticationRequired: 407,
1986
- RequestTimeout: 408,
1987
- Conflict: 409,
1988
- Gone: 410,
1989
- LengthRequired: 411,
1990
- PreconditionFailed: 412,
1991
- PayloadTooLarge: 413,
1992
- UriTooLong: 414,
1993
- UnsupportedMediaType: 415,
1994
- RangeNotSatisfiable: 416,
1995
- ExpectationFailed: 417,
1996
- ImATeapot: 418,
1997
- MisdirectedRequest: 421,
1998
- UnprocessableEntity: 422,
1999
- Locked: 423,
2000
- FailedDependency: 424,
2001
- TooEarly: 425,
2002
- UpgradeRequired: 426,
2003
- PreconditionRequired: 428,
2004
- TooManyRequests: 429,
2005
- RequestHeaderFieldsTooLarge: 431,
2006
- UnavailableForLegalReasons: 451,
2007
- InternalServerError: 500,
2008
- NotImplemented: 501,
2009
- BadGateway: 502,
2010
- ServiceUnavailable: 503,
2011
- GatewayTimeout: 504,
2012
- HttpVersionNotSupported: 505,
2013
- VariantAlsoNegotiates: 506,
2014
- InsufficientStorage: 507,
2015
- LoopDetected: 508,
2016
- NotExtended: 510,
2017
- NetworkAuthenticationRequired: 511,
2018
- WebServerIsDown: 521,
2019
- ConnectionTimedOut: 522,
2020
- OriginIsUnreachable: 523,
2021
- TimeoutOccurred: 524,
2022
- SslHandshakeFailed: 525,
2023
- InvalidSslCertificate: 526
2024
- };
2025
- Object.entries(st).forEach(([e, t]) => {
2026
- st[t] = e;
2027
- });
2028
- function fn(e) {
2029
- const t = new de(e), n = Ht(de.prototype.request, t);
2030
- return i.extend(n, de.prototype, t, { allOwnKeys: !0 }), i.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(s) {
2031
- return fn(fe(e, s));
2032
- }, n;
660
+ var Vt = Yt, $t = kt;
661
+ Ie.Fragment = E, Ie.jsx = Vt, Ie.jsxs = $t;
662
+ })()), Ie;
2033
663
  }
2034
- const k = fn(Ce);
2035
- k.Axios = de;
2036
- k.CanceledError = he;
2037
- k.CancelToken = as;
2038
- k.isCancel = rn;
2039
- k.VERSION = un;
2040
- k.toFormData = Ve;
2041
- k.AxiosError = _;
2042
- k.Cancel = k.CanceledError;
2043
- k.all = function(t) {
2044
- return Promise.all(t);
2045
- };
2046
- k.spread = is;
2047
- k.isAxiosError = ls;
2048
- k.mergeConfig = fe;
2049
- k.AxiosHeaders = z;
2050
- k.formToJSON = (e) => nn(i.isHTMLForm(e) ? new FormData(e) : e);
2051
- k.getAdapter = cn.getAdapter;
2052
- k.HttpStatusCode = st;
2053
- k.default = k;
2054
- const {
2055
- Axios: Fs,
2056
- AxiosError: js,
2057
- CanceledError: vs,
2058
- isCancel: Ms,
2059
- CancelToken: Us,
2060
- VERSION: ks,
2061
- all: Bs,
2062
- Cancel: $s,
2063
- isAxiosError: Hs,
2064
- spread: Vs,
2065
- toFormData: Gs,
2066
- AxiosHeaders: Ws,
2067
- HttpStatusCode: qs,
2068
- formToJSON: Ys,
2069
- getAdapter: zs,
2070
- mergeConfig: Xs
2071
- } = k, pn = () => {
2072
- const { apiClient: e, apiEndpoints: t, apiService: n } = ke(), r = e || k.create();
2073
- return n ? {
2074
- ...Ct(r, t),
2075
- ...n
2076
- } : Ct(r, t);
2077
- };
2078
- function Ct(e, t) {
2079
- return {
2080
- getEntities: async () => {
2081
- const n = await e.get(t.entities);
2082
- return {
2083
- data: n.data.data ?? n.data
2084
- };
2085
- },
2086
- getMetadata: async (n) => {
2087
- const r = await e.get(t.metadata(n));
2088
- return {
2089
- data: r.data.data ?? r.data
2090
- };
2091
- },
2092
- getRecords: async (n, r) => {
2093
- const s = await e.get(t.records(n), { params: r });
2094
- return {
2095
- data: s.data.data ?? s.data,
2096
- total: s.data.total ?? s.data.count ?? 0
2097
- };
2098
- },
2099
- getRecord: async (n, r) => {
2100
- const s = await e.get(t.recordById(n, r));
2101
- return {
2102
- data: s.data.data ?? s.data
2103
- };
2104
- },
2105
- createRecord: async (n, r) => {
2106
- const s = await e.post(t.records(n), r);
2107
- return {
2108
- data: s.data.data ?? s.data
2109
- };
2110
- },
2111
- updateRecord: async (n, r, s) => {
2112
- const o = await e.put(t.recordById(n, r), s);
2113
- return {
2114
- data: o.data.data ?? o.data
2115
- };
2116
- },
2117
- deleteRecord: async (n, r) => {
2118
- const s = await e.delete(t.recordById(n, r));
2119
- return {
2120
- data: s.data.data ?? s.data
2121
- };
2122
- },
2123
- exportCSV: async (n, r) => (await e.get(t.exportCSV(n), {
2124
- params: r,
2125
- responseType: "blob"
2126
- })).data,
2127
- exportExcel: async (n, r) => (await e.get(t.exportExcel(n), {
2128
- params: r,
2129
- responseType: "blob"
2130
- })).data
2131
- };
664
+ var lt;
665
+ function rr() {
666
+ return lt || (lt = 1, process.env.NODE_ENV === "production" ? be.exports = er() : be.exports = tr()), be.exports;
2132
667
  }
2133
- const cs = ie(M)(({ theme: e }) => ({
668
+ var r = rr();
669
+ const ar = ce(N)(({ theme: a }) => ({
2134
670
  width: "100%",
2135
- fontFamily: e.typography.fontFamily
2136
- })), Nt = ie("div")(({ theme: e }) => ({
671
+ fontFamily: a.typography.fontFamily
672
+ })), ct = ce("div")(({ theme: a }) => ({
2137
673
  width: "100%",
2138
674
  "& .ag-header": {
2139
675
  borderRadius: "8px 8px 0 0"
2140
676
  },
2141
677
  "& .ag-theme-alpine": {
2142
- fontFamily: e.typography.fontFamily
678
+ fontFamily: a.typography.fontFamily
2143
679
  },
2144
680
  "& .ag-header-cell-text": {
2145
681
  fontSize: "14px",
@@ -2173,7 +709,7 @@ const cs = ie(M)(({ theme: e }) => ({
2173
709
  border: "1px solid transparent !important"
2174
710
  }
2175
711
  }));
2176
- ie(M)(() => ({
712
+ ce(N)(() => ({
2177
713
  position: "fixed",
2178
714
  inset: 0,
2179
715
  display: "flex",
@@ -2182,22 +718,22 @@ ie(M)(() => ({
2182
718
  zIndex: 1301,
2183
719
  background: "rgba(255, 255, 255, 0.5)"
2184
720
  }));
2185
- const us = ie(M)(({ theme: e }) => ({
721
+ const nr = ce(N)(({ theme: a }) => ({
2186
722
  display: "flex",
2187
723
  justifyContent: "flex-end",
2188
724
  marginTop: "16px",
2189
725
  gap: "16px",
2190
- [e.breakpoints.down("md")]: {
726
+ [a.breakpoints.down("md")]: {
2191
727
  flexWrap: "wrap",
2192
728
  justifyContent: "center",
2193
729
  gap: "12px"
2194
730
  },
2195
- [e.breakpoints.down("sm")]: {
731
+ [a.breakpoints.down("sm")]: {
2196
732
  flexDirection: "column",
2197
733
  alignItems: "center",
2198
734
  gap: "16px"
2199
735
  }
2200
- })), ds = ie(yn)(() => ({
736
+ })), or = ce(Ht)(() => ({
2201
737
  fontSize: "14px",
2202
738
  border: "none",
2203
739
  boxShadow: "none",
@@ -2213,10 +749,10 @@ const us = ie(M)(({ theme: e }) => ({
2213
749
  paddingLeft: "8px",
2214
750
  paddingRight: "32px !important"
2215
751
  }
2216
- })), fs = ie(M)(
2217
- ({ height: e }) => ({
2218
- ...e !== void 0 && {
2219
- height: `${e}px`
752
+ })), sr = ce(N)(
753
+ ({ height: a }) => ({
754
+ ...a !== void 0 && {
755
+ height: `${a}px`
2220
756
  },
2221
757
  "&.ag-theme-alpine": {
2222
758
  border: "none !important"
@@ -2249,146 +785,146 @@ const us = ie(M)(({ theme: e }) => ({
2249
785
  justifyContent: "space-between"
2250
786
  }
2251
787
  })
2252
- ), ps = ie(gn)(
2253
- ({ theme: e }) => ({
788
+ ), ir = ce(Xt)(
789
+ ({ theme: a }) => ({
2254
790
  display: "flex",
2255
791
  flexDirection: "row",
2256
792
  alignItems: "center",
2257
- [e.breakpoints.down("sm")]: {
793
+ [a.breakpoints.down("sm")]: {
2258
794
  flexWrap: "wrap",
2259
795
  justifyContent: "center",
2260
796
  gap: "8px"
2261
797
  }
2262
798
  })
2263
- ), It = ie(M)(({ theme: e }) => ({
799
+ ), dt = ce(N)(({ theme: a }) => ({
2264
800
  fontWeight: 300,
2265
801
  fontSize: "14px",
2266
- [e.breakpoints.down("sm")]: {
802
+ [a.breakpoints.down("sm")]: {
2267
803
  fontSize: "12px"
2268
804
  }
2269
- })), Es = {
805
+ })), lr = {
2270
806
  DEFAULT_HEIGHT: 500,
2271
807
  MIN_HEIGHT: 300,
2272
808
  MAX_HEIGHT: 800,
2273
809
  DEFAULT_ROW_HEIGHT: 50
2274
- }, Js = {
810
+ }, hr = {
2275
811
  DEFAULT_PAGE: 1,
2276
812
  DEFAULT_PAGE_SIZE: 10,
2277
813
  PAGE_SIZE_OPTIONS: [10, 20, 50, 100],
2278
814
  MIN_PAGE: 1
2279
- }, Ks = {
815
+ }, Ar = {
2280
816
  ASC: "asc",
2281
817
  DESC: "desc"
2282
- }, ms = {
818
+ }, cr = {
2283
819
  UI_COLUMN_SORTED: "uiColumnSorted",
2284
820
  API: "api",
2285
821
  COLUMN_MOVED: "columnMoved"
2286
- }, Dt = {
822
+ }, ut = {
2287
823
  NORMAL: "normal",
2288
824
  AUTO_HEIGHT: "autoHeight"
2289
- }, En = {
825
+ }, St = {
2290
826
  CLIENT_SIDE: "clientSide",
2291
827
  SERVER_SIDE: "serverSide",
2292
828
  INFINITE: "infinite",
2293
829
  VIEWPORT: "viewport"
2294
- }, Qs = {
830
+ }, Ir = {
2295
831
  DEFAULT_FLEX: 1,
2296
832
  ACTION_COLUMN_WIDTH: 150,
2297
833
  SORTABLE: !0,
2298
834
  FILTER: !1
2299
- }, hs = {
835
+ }, dr = {
2300
836
  NO_DATA: "N/A",
2301
837
  LOADING: "Loading...",
2302
838
  NO_RECORDS: "No records found"
2303
- }, Ts = {
839
+ }, ur = {
2304
840
  AG_THEME_ALPINE: "ag-theme-alpine",
2305
841
  AG_THEME_BALHAM: "ag-theme-balham",
2306
842
  AG_THEME_MATERIAL: "ag-theme-material"
2307
- }, Rs = {
843
+ }, fr = {
2308
844
  URL_REVOKE: 100
2309
845
  // milliseconds to wait before revoking blob URL
2310
846
  };
2311
- xn.registerModules([Bt, Cn]);
2312
- const Ss = ({
2313
- rows: e,
2314
- totalRecords: t,
2315
- currentPage: n,
2316
- loading: r,
847
+ Qt.registerModules([gt, Zt]);
848
+ const Er = ({
849
+ rows: a,
850
+ totalRecords: f,
851
+ currentPage: d,
852
+ loading: E,
2317
853
  onPageChange: s,
2318
- columns: o,
2319
- pageSize: a,
2320
- pageSizeOptions: l,
2321
- onPageSizeChange: m,
2322
- setSort: d,
2323
- sortModel: u,
2324
- height: T = Es.DEFAULT_HEIGHT,
2325
- domLayout: x = Dt.NORMAL,
2326
- getRowHeight: P,
2327
- pinnedBottomRowData: f,
2328
- showLoader: S = !0,
2329
- emptyDataMessage: h,
2330
- ...w
854
+ columns: k,
855
+ pageSize: z,
856
+ pageSizeOptions: p,
857
+ onPageSizeChange: g,
858
+ setSort: Y,
859
+ sortModel: S,
860
+ height: O = lr.DEFAULT_HEIGHT,
861
+ domLayout: C = ut.NORMAL,
862
+ getRowHeight: W,
863
+ pinnedBottomRowData: te,
864
+ showLoader: de = !0,
865
+ emptyDataMessage: K,
866
+ ...V
2331
867
  }) => {
2332
- const j = Ze(null), I = Ze([]), D = (F) => {
2333
- if (F.source !== ms.UI_COLUMN_SORTED || (console.log("Sort Changed Event (User Initiated):", F), !d)) return;
2334
- const V = F.api.getColumnState().filter((b) => b.sort).map((b) => ({
2335
- colId: b.colId,
2336
- sort: b.sort
868
+ const D = We(null), P = We([]), re = (w) => {
869
+ if (w.source !== cr.UI_COLUMN_SORTED || (console.log("Sort Changed Event (User Initiated):", w), !Y)) return;
870
+ const G = w.api.getColumnState().filter((J) => J.sort).map((J) => ({
871
+ colId: J.colId,
872
+ sort: J.sort
2337
873
  }));
2338
- console.log("New Sort Model:", V), JSON.stringify(V) !== JSON.stringify(I.current) && (I.current = V, d(V));
874
+ console.log("New Sort Model:", G), JSON.stringify(G) !== JSON.stringify(P.current) && (P.current = G, Y(G));
2339
875
  };
2340
- return S && r ? /* @__PURE__ */ E.jsx(
2341
- Nt,
876
+ return de && E ? /* @__PURE__ */ r.jsx(
877
+ ct,
2342
878
  {
2343
879
  style: {
2344
880
  display: "flex",
2345
881
  alignItems: "center",
2346
882
  justifyContent: "center",
2347
- height: T,
883
+ height: O,
2348
884
  minHeight: 120
2349
885
  },
2350
- children: /* @__PURE__ */ E.jsx(Pe, {})
886
+ children: /* @__PURE__ */ r.jsx(Le, {})
2351
887
  }
2352
- ) : /* @__PURE__ */ E.jsx(Nt, { "data-testid": "ServerSideGrid", className: Ts.AG_THEME_ALPINE, children: /* @__PURE__ */ E.jsxs(cs, { children: [
2353
- /* @__PURE__ */ E.jsx(
2354
- fs,
888
+ ) : /* @__PURE__ */ r.jsx(ct, { "data-testid": "ServerSideGrid", className: ur.AG_THEME_ALPINE, children: /* @__PURE__ */ r.jsxs(ar, { children: [
889
+ /* @__PURE__ */ r.jsx(
890
+ sr,
2355
891
  {
2356
- height: x === Dt.AUTO_HEIGHT ? void 0 : T,
2357
- children: /* @__PURE__ */ E.jsx(
2358
- wn,
892
+ height: C === ut.AUTO_HEIGHT ? void 0 : O,
893
+ children: /* @__PURE__ */ r.jsx(
894
+ Jt,
2359
895
  {
2360
- ref: j,
896
+ ref: D,
2361
897
  theme: "legacy",
2362
- columnDefs: o,
2363
- rowData: e,
2364
- pinnedBottomRowData: f,
2365
- domLayout: x,
2366
- rowModelType: En.CLIENT_SIDE,
2367
- modules: [Bt],
898
+ columnDefs: k,
899
+ rowData: a,
900
+ pinnedBottomRowData: te,
901
+ domLayout: C,
902
+ rowModelType: St.CLIENT_SIDE,
903
+ modules: [gt],
2368
904
  localeText: {
2369
- noRowsToShow: h || "No data to show"
905
+ noRowsToShow: K || "No data to show"
2370
906
  },
2371
- ...w,
907
+ ...V,
2372
908
  enableBrowserTooltips: !0,
2373
909
  suppressMovableColumns: !0,
2374
910
  suppressMenuHide: !0,
2375
- onSortChanged: D,
911
+ onSortChanged: re,
2376
912
  multiSortKey: "ctrl",
2377
913
  alwaysMultiSort: !0,
2378
914
  defaultColDef: {
2379
915
  width: 170,
2380
916
  sortable: !0,
2381
917
  unSortIcon: !0,
2382
- tooltipValueGetter: (F) => F.value ?? hs.NO_DATA
918
+ tooltipValueGetter: (w) => w.value ?? dr.NO_DATA
2383
919
  },
2384
920
  suppressRowTransform: !0,
2385
- getRowHeight: P ?? (() => 54),
921
+ getRowHeight: W ?? (() => 54),
2386
922
  maintainColumnOrder: !0,
2387
- initialState: u && u.length > 0 ? {
923
+ initialState: S && S.length > 0 ? {
2388
924
  sort: {
2389
- sortModel: u.map((F) => ({
2390
- colId: F.colId,
2391
- sort: F.sort
925
+ sortModel: S.map((w) => ({
926
+ colId: w.colId,
927
+ sort: w.sort
2392
928
  }))
2393
929
  }
2394
930
  } : void 0
@@ -2396,47 +932,47 @@ const Ss = ({
2396
932
  )
2397
933
  }
2398
934
  ),
2399
- t === 0 && /* @__PURE__ */ E.jsx(bn, {})
935
+ f === 0 && /* @__PURE__ */ r.jsx(zt, {})
2400
936
  ] }) });
2401
- }, As = ({
2402
- totalRecords: e,
2403
- currentPage: t,
2404
- pageSize: n,
2405
- onPageChange: r
937
+ }, Tr = ({
938
+ totalRecords: a,
939
+ currentPage: f,
940
+ pageSize: d,
941
+ onPageChange: E
2406
942
  }) => {
2407
- const s = Math.ceil(e / n);
2408
- return /* @__PURE__ */ E.jsxs(M, { sx: { display: "flex", gap: 2, alignItems: "center" }, children: [
2409
- /* @__PURE__ */ E.jsx(
2410
- re,
943
+ const s = Math.ceil(a / d);
944
+ return /* @__PURE__ */ r.jsxs(N, { sx: { display: "flex", gap: 2, alignItems: "center" }, children: [
945
+ /* @__PURE__ */ r.jsx(
946
+ ne,
2411
947
  {
2412
948
  size: "small",
2413
- disabled: t === 1,
2414
- onClick: () => r(t - 1),
949
+ disabled: f === 1,
950
+ onClick: () => E(f - 1),
2415
951
  children: "Previous"
2416
952
  }
2417
953
  ),
2418
- /* @__PURE__ */ E.jsxs(pe, { variant: "body2", children: [
954
+ /* @__PURE__ */ r.jsxs(_e, { variant: "body2", children: [
2419
955
  "Page ",
2420
- t,
956
+ f,
2421
957
  " of ",
2422
958
  s || 1
2423
959
  ] }),
2424
- /* @__PURE__ */ E.jsx(
2425
- re,
960
+ /* @__PURE__ */ r.jsx(
961
+ ne,
2426
962
  {
2427
963
  size: "small",
2428
- disabled: t >= s,
2429
- onClick: () => r(t + 1),
964
+ disabled: f >= s,
965
+ onClick: () => E(f + 1),
2430
966
  children: "Next"
2431
967
  }
2432
968
  )
2433
969
  ] });
2434
- }, Me = {
970
+ }, Pe = {
2435
971
  MASTER_DATA_MANAGEMENT: "Master Data Management",
2436
972
  ADD_NEW_RECORD: "Add New Record",
2437
973
  EDIT_RECORD: "Edit Record",
2438
974
  VIEW_RECORD: "View Record"
2439
- }, ae = {
975
+ }, le = {
2440
976
  VIEW: "View",
2441
977
  ADD_NEW_RECORD: "Add New Record",
2442
978
  EDIT: "Edit",
@@ -2445,22 +981,22 @@ const Ss = ({
2445
981
  CANCEL: "Cancel",
2446
982
  BACK: "Back",
2447
983
  EXPORT: "Export"
2448
- }, Xe = {
984
+ }, Ye = {
2449
985
  SELECT_ENTITY: "Select Entity",
2450
986
  ACTIONS: "Actions",
2451
987
  FROM: "From",
2452
988
  TO: "To"
2453
- }, ge = {
989
+ }, ye = {
2454
990
  SELECT_ENTITY: "Select Entity",
2455
- SELECT: (e) => `Select ${e}`,
2456
- FILTER_BY: (e) => `Filter by ${e}`
2457
- }, Lt = {
991
+ SELECT: (a) => `Select ${a}`,
992
+ FILTER_BY: (a) => `Filter by ${a}`
993
+ }, ft = {
2458
994
  CSV: "CSV Format",
2459
995
  EXCEL: "Excel Format"
2460
- }, Pt = {
996
+ }, Et = {
2461
997
  CSV: "csv",
2462
998
  EXCEL: "xlsx"
2463
- }, oe = {
999
+ }, ie = {
2464
1000
  FAILED_LOAD_ENTITIES: "Failed to load entities",
2465
1001
  FAILED_LOAD_METADATA: "Failed to load metadata",
2466
1002
  FAILED_LOAD_RECORD: "Failed to load record",
@@ -2468,29 +1004,29 @@ const Ss = ({
2468
1004
  FAILED_SAVE_RECORD: "Failed to save record. Please try again.",
2469
1005
  FAILED_EXPORT_CSV: "Failed to export CSV",
2470
1006
  FAILED_EXPORT_EXCEL: "Failed to export Excel",
2471
- FAILED_LOAD_OPTIONS: (e) => `Failed to load options for ${e}`,
1007
+ FAILED_LOAD_OPTIONS: (a) => `Failed to load options for ${a}`,
2472
1008
  FAILED_LOAD_FORM_CONFIG: "Failed to load form configuration",
2473
- FIELD_REQUIRED: (e) => `${e} is required`,
2474
- FIELD_MIN_VALUE: (e, t) => `${e} must be at least ${t}`,
2475
- FIELD_MAX_VALUE: (e, t) => `${e} must be at most ${t}`
2476
- }, Zs = {
1009
+ FIELD_REQUIRED: (a) => `${a} is required`,
1010
+ FIELD_MIN_VALUE: (a, f) => `${a} must be at least ${f}`,
1011
+ FIELD_MAX_VALUE: (a, f) => `${a} must be at most ${f}`
1012
+ }, Or = {
2477
1013
  RECORD_CREATED: "Record created successfully",
2478
1014
  RECORD_UPDATED: "Record updated successfully",
2479
1015
  RECORD_DELETED: "Record deleted successfully"
2480
- }, eo = {
1016
+ }, yr = {
2481
1017
  REQUIRED: "This field is required",
2482
1018
  INVALID_FORMAT: "Invalid format"
2483
- }, to = {
1019
+ }, Cr = {
2484
1020
  NO_DATA_AVAILABLE: "N/A",
2485
1021
  NO_RECORDS_FOUND: "No records found"
2486
- }, no = {
1022
+ }, Dr = {
2487
1023
  LOADING: "Loading...",
2488
1024
  PLEASE_WAIT: "Please wait..."
2489
- }, Je = {
1025
+ }, Ve = {
2490
1026
  SHOWING: "Showing",
2491
1027
  OF: "of",
2492
1028
  ENTRIES: "entries"
2493
- }, ro = {
1029
+ }, xr = {
2494
1030
  MASTER_VIEW: "master-view",
2495
1031
  MASTER_FORM: "master-form",
2496
1032
  FILTER_SECTION: "filter-section",
@@ -2503,7 +1039,7 @@ const Ss = ({
2503
1039
  ACTION_BUTTONS: "action-buttons",
2504
1040
  FORM_FIELDS: "form-fields",
2505
1041
  LOADING_CONTAINER: "loading-container"
2506
- }, so = {
1042
+ }, br = {
2507
1043
  DEFAULT_TABLE_HEIGHT: 500,
2508
1044
  DEFAULT_PAGE_SIZE: 10,
2509
1045
  DEFAULT_COLUMN_WIDTH: 150,
@@ -2511,64 +1047,64 @@ const Ss = ({
2511
1047
  ACTION_BUTTON_GAP: 1,
2512
1048
  FORM_MARGIN_TOP: 3,
2513
1049
  FORM_MARGIN_BOTTOM: 2
2514
- }, Ft = [10, 20, 50, 100], ys = " *", gs = "red", bs = "_display", oo = {
1050
+ }, Tt = [10, 20, 50, 100], pr = " *", mr = "red", Rr = "_display", Nr = {
2515
1051
  ISO_DATE: "YYYY-MM-DD",
2516
1052
  DISPLAY_DATE: "DD/MM/YYYY",
2517
1053
  FILE_DATE: "YYYY-MM-DD"
2518
- }, ao = {
1054
+ }, Lr = {
2519
1055
  PAGE_SIZE: "Page size"
2520
- }, io = {
1056
+ }, Pr = {
2521
1057
  BASE_URL: "http://localhost:3000",
2522
1058
  TIMEOUT: 3e4,
2523
1059
  HEADERS: {
2524
1060
  CONTENT_TYPE: "application/json"
2525
1061
  }
2526
- }, lo = {
1062
+ }, Mr = {
2527
1063
  MASTER: "/master"
2528
- }, co = {
1064
+ }, jr = {
2529
1065
  // Entity endpoints
2530
1066
  ENTITIES: "/master/entities",
2531
- ENTITY_METADATA: (e) => `/master/${e}/metadata`,
2532
- ENTITY_RECORDS: (e) => `/master/${e}/records`,
2533
- ENTITY_RECORD_BY_ID: (e, t) => `/master/${e}/records/${t}`,
2534
- ENTITY_OPTIONS: (e) => `/master/${e}/options`,
1067
+ ENTITY_METADATA: (a) => `/master/${a}/metadata`,
1068
+ ENTITY_RECORDS: (a) => `/master/${a}/records`,
1069
+ ENTITY_RECORD_BY_ID: (a, f) => `/master/${a}/records/${f}`,
1070
+ ENTITY_OPTIONS: (a) => `/master/${a}/options`,
2535
1071
  // Export endpoints
2536
- EXPORT_CSV: (e) => `/master/${e}/export/csv`,
2537
- EXPORT_EXCEL: (e) => `/master/${e}/export/excel`
2538
- }, uo = {
1072
+ EXPORT_CSV: (a) => `/master/${a}/export/csv`,
1073
+ EXPORT_EXCEL: (a) => `/master/${a}/export/excel`
1074
+ }, Fr = {
2539
1075
  GET: "GET",
2540
1076
  POST: "POST",
2541
1077
  PUT: "PUT",
2542
1078
  DELETE: "DELETE",
2543
1079
  PATCH: "PATCH"
2544
- }, fo = {
1080
+ }, wr = {
2545
1081
  PAGE: "page",
2546
1082
  LIMIT: "limit",
2547
1083
  SEARCH: "search",
2548
1084
  SEARCH_BY: "searchBy",
2549
1085
  SORT_BY: "sortBy",
2550
1086
  SORT_ORDER: "sortOrder"
2551
- }, jt = {
1087
+ }, pt = {
2552
1088
  ASC: "ASC",
2553
1089
  DESC: "DESC"
2554
- }, po = {
1090
+ }, Ur = {
2555
1091
  JSON: "json",
2556
1092
  BLOB: "blob",
2557
1093
  TEXT: "text"
2558
- }, vt = {
1094
+ }, mt = {
2559
1095
  CSV: "text/csv;charset=utf-8;",
2560
1096
  EXCEL: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
2561
1097
  JSON: "application/json"
2562
- }, Eo = {
1098
+ }, Gr = {
2563
1099
  DATA: "data",
2564
1100
  COUNT: "count",
2565
1101
  MESSAGE: "message",
2566
1102
  ERROR: "error"
2567
- }, K = {
1103
+ }, X = {
2568
1104
  CREATE: "create",
2569
1105
  EDIT: "edit",
2570
1106
  VIEW: "view"
2571
- }, Mt = {
1107
+ }, $e = {
2572
1108
  TEXT: "text",
2573
1109
  DROPDOWN: "dropdown",
2574
1110
  DATEPICKER: "datepicker",
@@ -2576,7 +1112,7 @@ const Ss = ({
2576
1112
  TEXTAREA: "textarea",
2577
1113
  CHECKBOX: "checkbox",
2578
1114
  RADIO: "radio"
2579
- }, Le = {
1115
+ }, Ne = {
2580
1116
  STRING: "string",
2581
1117
  NUMBER: "number",
2582
1118
  FLOAT: "float",
@@ -2585,18 +1121,18 @@ const Ss = ({
2585
1121
  BOOLEAN: "boolean",
2586
1122
  ARRAY: "array",
2587
1123
  OBJECT: "object"
2588
- }, mo = {
1124
+ }, kr = {
2589
1125
  API: "API",
2590
1126
  RAW: "Raw",
2591
1127
  STATIC: "Static"
2592
- }, ho = {
1128
+ }, Yr = {
2593
1129
  ID: "id",
2594
1130
  NAME: "name",
2595
1131
  LABEL: "label",
2596
1132
  VALUE: "value",
2597
1133
  DISPLAY_NAME: "displayName",
2598
1134
  TABLE_NAME: "tableName"
2599
- }, To = {
1135
+ }, Vr = {
2600
1136
  REQUIRED: "required",
2601
1137
  MIN: "min",
2602
1138
  MAX: "max",
@@ -2608,7 +1144,7 @@ const Ss = ({
2608
1144
  }, se = {
2609
1145
  FROM: "From",
2610
1146
  TO: "To"
2611
- }, Ro = {
1147
+ }, $r = {
2612
1148
  TEXT: "text",
2613
1149
  NUMBER: "number",
2614
1150
  DATE: "date",
@@ -2616,580 +1152,599 @@ const Ss = ({
2616
1152
  PASSWORD: "password",
2617
1153
  TEL: "tel",
2618
1154
  URL: "url"
2619
- }, So = {
1155
+ }, Wr = {
2620
1156
  FLOAT_STEP: 0.01,
2621
1157
  INTEGER_STEP: 1
2622
- }, Ao = {
1158
+ }, Br = {
2623
1159
  ENTITY_MATCH: /\/master\/([^\/]+)\/options/
2624
- }, Os = () => {
2625
- const e = Ut(), { routes: t } = ke(), n = pn(), [r, s] = H([]), [o, a] = H(null), [l, m] = H([]), [d, u] = H({}), [T, x] = H([]), [P, f] = H([]), [S, h] = H(0), [w, j] = H(10), [I, D] = H(1), [F, V] = H(!1), [U, b] = H(!1), [y, g] = H({}), [N, B] = H([]), [L, W] = H(null), Q = Ze(!0);
2626
- be(() => {
1160
+ }, Hr = ({
1161
+ apiClient: a,
1162
+ apiEndpoints: f,
1163
+ onNavigateToNew: d,
1164
+ onNavigateToEdit: E
1165
+ }) => {
1166
+ const s = Re(() => vt(a, f), [a, f]), [k, z] = F([]), [p, g] = F(null), [Y, S] = F([]), [O, C] = F({}), [W, te] = F([]), [de, K] = F([]), [V, D] = F(0), [P, re] = F(10), [w, G] = F(1), [ue, J] = F(!1), [oe, R] = F(!1), [u, i] = F({}), [T, M] = F([]), [h, Q] = F(null), U = We(!0);
1167
+ Ce(() => {
2627
1168
  (async () => {
2628
1169
  try {
2629
- const $ = ((await n.getEntities()).data || []).map((O) => ({
2630
- name: O.tableName || O.name,
2631
- label: O.displayName || O.label
1170
+ const x = ((await s.getEntities()).data || []).map((I) => ({
1171
+ name: I.tableName || I.name,
1172
+ label: I.displayName || I.label
2632
1173
  }));
2633
- s($), $.length > 0 && a($[0]);
2634
- } catch (R) {
2635
- console.error(oe.FAILED_LOAD_ENTITIES, R);
1174
+ z(x), x.length > 0 && g(x[0]);
1175
+ } catch (c) {
1176
+ console.error(ie.FAILED_LOAD_ENTITIES, c);
2636
1177
  }
2637
1178
  })();
2638
- }, []), be(() => {
2639
- if (!o) return;
1179
+ }, []), Ce(() => {
1180
+ if (!p) return;
2640
1181
  (async () => {
2641
1182
  try {
2642
- const C = (await n.getMetadata(o.name)).data || {};
2643
- m(C.parameterList || []), x(C.resultsList || []);
2644
- const $ = {};
2645
- (C.parameterList || []).forEach((v) => {
2646
- $[v.name] = null;
2647
- }), u($);
2648
- const O = {};
2649
- for (const v of C.parameterList || [])
2650
- v.options && Array.isArray(v.options) && (O[v.name] = v.options);
2651
- g(O), f([]), b(!1);
2652
- } catch (R) {
2653
- console.error(oe.FAILED_LOAD_METADATA, R);
1183
+ const v = (await s.getMetadata(p.name)).data || {};
1184
+ S(v.parameterList || []), te(v.resultsList || []);
1185
+ const x = {};
1186
+ (v.parameterList || []).forEach((b) => {
1187
+ x[b.name] = null;
1188
+ }), C(x);
1189
+ const I = {};
1190
+ for (const b of v.parameterList || [])
1191
+ b.options && Array.isArray(b.options) && (I[b.name] = b.options);
1192
+ i(I), K([]), R(!1);
1193
+ } catch (c) {
1194
+ console.error(ie.FAILED_LOAD_METADATA, c);
2654
1195
  }
2655
1196
  })();
2656
- }, [o]);
2657
- const G = Oe(() => {
2658
- const p = {}, R = [], C = [];
2659
- l.forEach((O) => {
2660
- if (O.dataType === Le.DATERANGE) {
2661
- const J = d[`${O.name}${se.FROM}`], Ne = d[`${O.name}${se.TO}`];
2662
- J && (p[`${O.name}${se.FROM}`] = J), Ne && (p[`${O.name}${se.TO}`] = Ne);
1197
+ }, [p]);
1198
+ const H = Re(() => {
1199
+ const o = {}, c = [], v = [];
1200
+ Y.forEach((I) => {
1201
+ if (I.dataType === Ne.DATERANGE) {
1202
+ const Z = O[`${I.name}${se.FROM}`], Se = O[`${I.name}${se.TO}`];
1203
+ Z && (o[`${I.name}${se.FROM}`] = Z), Se && (o[`${I.name}${se.TO}`] = Se);
2663
1204
  return;
2664
1205
  }
2665
- const v = d[O.name];
2666
- v == null || v === "" || (O.options ? p[O.name] = v : (R.push(O.name), C.push(String(v).trim())));
1206
+ const b = O[I.name];
1207
+ b == null || b === "" || (I.options ? o[I.name] = b : (c.push(I.name), v.push(String(b).trim())));
2667
1208
  });
2668
- const $ = {
2669
- page: I,
2670
- limit: w,
2671
- filters: p
1209
+ const x = {
1210
+ page: w,
1211
+ limit: P
2672
1212
  };
2673
- return R.length > 0 && ($.search = C.join(","), $.searchBy = R.join(",")), N.length > 0 && ($.sortBy = N.map((O) => O.colId).join(","), $.sortOrder = N.map((O) => O.sort === "desc" ? jt.DESC : jt.ASC).join(",")), $;
2674
- }, [l, d, I, w, N]), ne = ye(async () => {
2675
- if (!(!o || !Q.current)) {
2676
- Q.current = !1, V(!0);
1213
+ return Object.keys(o).length > 0 && Object.entries(o).forEach(([I, b]) => {
1214
+ x[`filters[${I}]`] = b;
1215
+ }), c.length > 0 && (x.search = v.join(","), x.searchBy = c.join(",")), T.length > 0 && (x.sortBy = T.map((I) => I.colId).join(","), x.sortOrder = T.map((I) => I.sort === "desc" ? pt.DESC : pt.ASC).join(",")), console.log("Query params:", x), x;
1216
+ }, [Y, O, w, P, T]), fe = Oe(async () => {
1217
+ if (!(!p || !U.current)) {
1218
+ U.current = !1, J(!0);
2677
1219
  try {
2678
- console.log("Fetching with params:", G);
2679
- const p = await n.getRecords(o.name, G), R = p.data || [], C = p.total || 0;
2680
- f(R), h(C);
2681
- } catch (p) {
2682
- console.error(oe.FAILED_FETCH_LIST, p), f([]), h(0);
1220
+ console.log("Fetching with params:", H);
1221
+ const o = await s.getRecords(p.name, H), c = o.data || [], v = o.total || 0;
1222
+ K(c), D(v);
1223
+ } catch (o) {
1224
+ console.error(ie.FAILED_FETCH_LIST, o), console.error("Full error:", o), K([]), D(0);
2683
1225
  } finally {
2684
- V(!1), Q.current = !0;
1226
+ J(!1), U.current = !0;
2685
1227
  }
2686
1228
  }
2687
- }, [o, G]);
2688
- be(() => {
2689
- U && (I > 1 || N.length > 0) && ne();
2690
- }, [I, w, N, U, ne]);
2691
- const X = () => {
2692
- D(1), b(!0), setTimeout(() => {
2693
- Q.current = !0, ne();
1229
+ }, [p, H]);
1230
+ Ce(() => {
1231
+ oe && (w > 1 || T.length > 0) && fe();
1232
+ }, [w, P, T, oe, fe]);
1233
+ const Te = () => {
1234
+ G(1), R(!0), setTimeout(() => {
1235
+ U.current = !0, fe();
2694
1236
  }, 0);
2695
- }, le = (p) => {
2696
- W(p.currentTarget);
2697
- }, ce = () => {
2698
- W(null);
2699
- }, c = async (p) => {
2700
- if (o)
1237
+ }, ae = (o) => {
1238
+ Q(o.currentTarget);
1239
+ }, ge = () => {
1240
+ Q(null);
1241
+ }, ve = async (o) => {
1242
+ if (p)
2701
1243
  try {
2702
- const R = p === "csv" ? await n.exportCSV(o.name, G) : await n.exportExcel(o.name, G), C = p === "csv" ? vt.CSV : vt.EXCEL, $ = p === "csv" ? Pt.CSV : Pt.EXCEL, O = new Blob([R.data], { type: C }), v = URL.createObjectURL(O), J = document.createElement("a");
2703
- J.href = v, J.download = `${o.name}_${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}.${$}`, J.style.visibility = "hidden", document.body.appendChild(J), J.click(), document.body.removeChild(J), setTimeout(() => URL.revokeObjectURL(v), Rs.URL_REVOKE);
2704
- } catch (R) {
2705
- console.error(`Failed to export ${p.toUpperCase()}:`, R);
1244
+ const c = o === "csv" ? await s.exportCSV(p.name, H) : await s.exportExcel(p.name, H), v = o === "csv" ? mt.CSV : mt.EXCEL, x = o === "csv" ? Et.CSV : Et.EXCEL, I = new Blob([c.data], { type: v }), b = URL.createObjectURL(I), Z = document.createElement("a");
1245
+ Z.href = b, Z.download = `${p.name}_${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}.${x}`, Z.style.visibility = "hidden", document.body.appendChild(Z), Z.click(), document.body.removeChild(Z), setTimeout(() => URL.revokeObjectURL(b), fr.URL_REVOKE);
1246
+ } catch (c) {
1247
+ console.error(`Failed to export ${o.toUpperCase()}:`, c);
2706
1248
  } finally {
2707
- ce();
1249
+ ge();
2708
1250
  }
2709
- }, A = Oe(() => {
2710
- const p = T.map((R) => ({
2711
- field: R.name,
2712
- headerName: R.label,
1251
+ }, Me = Re(() => {
1252
+ const o = W.map((c) => ({
1253
+ field: c.name,
1254
+ headerName: c.label,
2713
1255
  sortable: !0,
2714
1256
  filter: !1,
2715
1257
  flex: 1
2716
1258
  }));
2717
- return p.push({
1259
+ return o.push({
2718
1260
  field: "actions",
2719
- headerName: Xe.ACTIONS,
1261
+ headerName: Ye.ACTIONS,
2720
1262
  sortable: !1,
2721
1263
  filter: !1,
2722
1264
  width: 150,
2723
- cellRenderer: (R) => {
2724
- const C = R.data;
2725
- return !C || !o ? null : /* @__PURE__ */ E.jsx(M, { sx: { display: "flex", gap: 1, py: 1 }, children: /* @__PURE__ */ E.jsx(
2726
- re,
1265
+ cellRenderer: (c) => {
1266
+ const v = c.data;
1267
+ return !v || !p ? null : /* @__PURE__ */ r.jsx(N, { sx: { display: "flex", gap: 1, py: 1 }, children: /* @__PURE__ */ r.jsx(
1268
+ ne,
2727
1269
  {
2728
1270
  size: "small",
2729
1271
  variant: "outlined",
2730
- onClick: () => e(t.entityEdit(o.name, C.id)),
2731
- children: ae.EDIT
1272
+ onClick: () => E?.(p.name, v.id),
1273
+ children: le.EDIT
2732
1274
  }
2733
1275
  ) });
2734
1276
  }
2735
- }), p;
2736
- }, [T, o, e]);
2737
- return /* @__PURE__ */ E.jsxs(M, { className: "master-view", children: [
2738
- /* @__PURE__ */ E.jsxs(kt, { className: "filter-section", children: [
2739
- /* @__PURE__ */ E.jsx(pe, { variant: "h5", gutterBottom: !0, children: Me.MASTER_DATA_MANAGEMENT }),
2740
- /* @__PURE__ */ E.jsxs(M, { className: "filters", children: [
2741
- /* @__PURE__ */ E.jsxs(M, { className: "filter-field", children: [
2742
- /* @__PURE__ */ E.jsx(pe, { variant: "body2", className: "field-label", children: Xe.SELECT_ENTITY }),
2743
- /* @__PURE__ */ E.jsx(
2744
- et,
1277
+ }), o;
1278
+ }, [W, p, E]);
1279
+ return /* @__PURE__ */ r.jsxs(N, { className: "master-view", children: [
1280
+ /* @__PURE__ */ r.jsxs(_t, { className: "filter-section", children: [
1281
+ /* @__PURE__ */ r.jsx(_e, { variant: "h5", gutterBottom: !0, children: Pe.MASTER_DATA_MANAGEMENT }),
1282
+ /* @__PURE__ */ r.jsxs(N, { className: "filters", children: [
1283
+ /* @__PURE__ */ r.jsxs(N, { className: "filter-field", children: [
1284
+ /* @__PURE__ */ r.jsx(_e, { variant: "body2", className: "field-label", children: Ye.SELECT_ENTITY }),
1285
+ /* @__PURE__ */ r.jsx(
1286
+ Be,
2745
1287
  {
2746
- options: r,
2747
- getOptionLabel: (p) => p.label,
2748
- value: o,
2749
- onChange: (p, R) => a(R),
2750
- renderInput: (p) => /* @__PURE__ */ E.jsx(Z, { ...p, size: "small", placeholder: ge.SELECT_ENTITY }),
1288
+ options: k,
1289
+ getOptionLabel: (o) => o.label,
1290
+ value: p,
1291
+ onChange: (o, c) => g(c),
1292
+ renderInput: (o) => /* @__PURE__ */ r.jsx(ee, { ...o, size: "small", placeholder: ye.SELECT_ENTITY }),
2751
1293
  className: "field-input"
2752
1294
  }
2753
1295
  )
2754
1296
  ] }),
2755
- l.filter((p) => p.name.toLowerCase() !== "id").map((p) => /* @__PURE__ */ E.jsxs(M, { className: "filter-field", children: [
2756
- /* @__PURE__ */ E.jsx(pe, { variant: "body2", className: "field-label", children: p.label }),
2757
- p.dataType === Le.DATERANGE ? /* @__PURE__ */ E.jsxs(M, { sx: { display: "flex", gap: 1, width: "100%" }, children: [
2758
- /* @__PURE__ */ E.jsx(
2759
- Z,
1297
+ Y.filter((o) => o.name.toLowerCase() !== "id").map((o) => /* @__PURE__ */ r.jsxs(N, { className: "filter-field", children: [
1298
+ /* @__PURE__ */ r.jsx(_e, { variant: "body2", className: "field-label", children: o.label }),
1299
+ o.dataType === Ne.DATERANGE ? /* @__PURE__ */ r.jsxs(N, { sx: { display: "flex", gap: 1, width: "100%" }, children: [
1300
+ /* @__PURE__ */ r.jsx(
1301
+ ee,
2760
1302
  {
2761
1303
  type: "date",
2762
1304
  size: "small",
2763
- value: d[`${p.name}${se.FROM}`] || "",
2764
- onChange: (R) => u((C) => ({ ...C, [`${p.name}${se.FROM}`]: R.target.value })),
1305
+ value: O[`${o.name}${se.FROM}`] || "",
1306
+ onChange: (c) => C((v) => ({ ...v, [`${o.name}${se.FROM}`]: c.target.value })),
2765
1307
  sx: { flex: 1 }
2766
1308
  }
2767
1309
  ),
2768
- /* @__PURE__ */ E.jsx(
2769
- Z,
1310
+ /* @__PURE__ */ r.jsx(
1311
+ ee,
2770
1312
  {
2771
1313
  type: "date",
2772
1314
  size: "small",
2773
- label: Xe.TO,
2774
- value: d[`${p.name}${se.TO}`] || "",
2775
- onChange: (R) => u((C) => ({ ...C, [`${p.name}${se.TO}`]: R.target.value })),
1315
+ label: Ye.TO,
1316
+ value: O[`${o.name}${se.TO}`] || "",
1317
+ onChange: (c) => C((v) => ({ ...v, [`${o.name}${se.TO}`]: c.target.value })),
2776
1318
  sx: { flex: 1 }
2777
1319
  }
2778
1320
  )
2779
- ] }) : p.dataType === Le.DATE ? /* @__PURE__ */ E.jsx(
2780
- Z,
1321
+ ] }) : o.dataType === Ne.DATE ? /* @__PURE__ */ r.jsx(
1322
+ ee,
2781
1323
  {
2782
1324
  type: "date",
2783
1325
  size: "small",
2784
- value: d[p.name] || "",
2785
- onChange: (R) => u((C) => ({ ...C, [p.name]: R.target.value })),
1326
+ value: O[o.name] || "",
1327
+ onChange: (c) => C((v) => ({ ...v, [o.name]: c.target.value })),
2786
1328
  className: "field-input"
2787
1329
  }
2788
- ) : p.options ? /* @__PURE__ */ E.jsx(
2789
- et,
1330
+ ) : o.options ? /* @__PURE__ */ r.jsx(
1331
+ Be,
2790
1332
  {
2791
- options: y[p.name] || p.options,
2792
- getOptionLabel: (R) => R.label || String(R.value),
2793
- value: y[p.name]?.find((R) => R.value === d[p.name]) || null,
2794
- onChange: (R, C) => u(($) => ({ ...$, [p.name]: C?.value || null })),
2795
- renderInput: (R) => /* @__PURE__ */ E.jsx(Z, { ...R, size: "small", placeholder: ge.SELECT(p.label) }),
1333
+ options: u[o.name] || o.options,
1334
+ getOptionLabel: (c) => c.label || String(c.value),
1335
+ value: u[o.name]?.find((c) => c.value === O[o.name]) || null,
1336
+ onChange: (c, v) => C((x) => ({ ...x, [o.name]: v?.value || null })),
1337
+ renderInput: (c) => /* @__PURE__ */ r.jsx(ee, { ...c, size: "small", placeholder: ye.SELECT(o.label) }),
2796
1338
  className: "field-input"
2797
1339
  }
2798
- ) : p.dataType === Le.NUMBER ? /* @__PURE__ */ E.jsx(
2799
- Z,
1340
+ ) : o.dataType === Ne.NUMBER ? /* @__PURE__ */ r.jsx(
1341
+ ee,
2800
1342
  {
2801
1343
  type: "number",
2802
1344
  size: "small",
2803
- value: d[p.name] || "",
2804
- onChange: (R) => u((C) => ({ ...C, [p.name]: R.target.value })),
2805
- placeholder: ge.FILTER_BY(p.label),
1345
+ value: O[o.name] || "",
1346
+ onChange: (c) => C((v) => ({ ...v, [o.name]: c.target.value })),
1347
+ placeholder: ye.FILTER_BY(o.label),
2806
1348
  className: "field-input"
2807
1349
  }
2808
- ) : /* @__PURE__ */ E.jsx(
2809
- Z,
1350
+ ) : /* @__PURE__ */ r.jsx(
1351
+ ee,
2810
1352
  {
2811
1353
  size: "small",
2812
- value: d[p.name] || "",
2813
- onChange: (R) => u((C) => ({ ...C, [p.name]: R.target.value })),
2814
- placeholder: ge.FILTER_BY(p.label),
1354
+ value: O[o.name] || "",
1355
+ onChange: (c) => C((v) => ({ ...v, [o.name]: c.target.value })),
1356
+ placeholder: ye.FILTER_BY(o.label),
2815
1357
  className: "field-input"
2816
1358
  }
2817
1359
  )
2818
- ] }, p.name))
1360
+ ] }, o.name))
2819
1361
  ] }),
2820
- /* @__PURE__ */ E.jsxs(M, { className: "action-buttons", children: [
2821
- /* @__PURE__ */ E.jsx(re, { variant: "contained", onClick: X, children: ae.VIEW }),
2822
- /* @__PURE__ */ E.jsxs(
2823
- re,
1362
+ /* @__PURE__ */ r.jsxs(N, { className: "action-buttons", children: [
1363
+ /* @__PURE__ */ r.jsx(ne, { variant: "contained", onClick: Te, children: le.VIEW }),
1364
+ /* @__PURE__ */ r.jsx(
1365
+ ne,
2824
1366
  {
2825
1367
  variant: "contained",
2826
- disabled: !o,
2827
- onClick: () => e(t.entityNew(o?.name || "")),
2828
- children: [
2829
- ae.ADD_NEW_RECORD,
2830
- " seeeeee"
2831
- ]
1368
+ disabled: !p,
1369
+ onClick: () => p && d?.(p.name),
1370
+ children: le.ADD_NEW_RECORD
2832
1371
  }
2833
1372
  )
2834
1373
  ] })
2835
1374
  ] }),
2836
- U && /* @__PURE__ */ E.jsxs(M, { mt: 4, width: "100%", children: [
2837
- /* @__PURE__ */ E.jsxs(M, { display: "flex", justifyContent: "flex-end", mb: 2, children: [
2838
- /* @__PURE__ */ E.jsx(
2839
- re,
1375
+ oe && /* @__PURE__ */ r.jsxs(N, { mt: 4, width: "100%", children: [
1376
+ /* @__PURE__ */ r.jsxs(N, { display: "flex", justifyContent: "flex-end", mb: 2, children: [
1377
+ /* @__PURE__ */ r.jsx(
1378
+ ne,
2840
1379
  {
2841
1380
  variant: "outlined",
2842
- onClick: le,
2843
- disabled: !o,
2844
- children: ae.EXPORT
1381
+ onClick: ae,
1382
+ disabled: !p,
1383
+ children: le.EXPORT
2845
1384
  }
2846
1385
  ),
2847
- /* @__PURE__ */ E.jsxs(
2848
- On,
1386
+ /* @__PURE__ */ r.jsxs(
1387
+ qt,
2849
1388
  {
2850
- anchorEl: L,
2851
- open: !!L,
2852
- onClose: ce,
1389
+ anchorEl: h,
1390
+ open: !!h,
1391
+ onClose: ge,
2853
1392
  children: [
2854
- /* @__PURE__ */ E.jsx(We, { onClick: () => c("csv"), children: Lt.CSV }),
2855
- /* @__PURE__ */ E.jsx(We, { onClick: () => c("excel"), children: Lt.EXCEL })
1393
+ /* @__PURE__ */ r.jsx(ke, { onClick: () => ve("csv"), children: ft.CSV }),
1394
+ /* @__PURE__ */ r.jsx(ke, { onClick: () => ve("excel"), children: ft.EXCEL })
2856
1395
  ]
2857
1396
  }
2858
1397
  )
2859
1398
  ] }),
2860
- /* @__PURE__ */ E.jsx(
2861
- Ss,
1399
+ /* @__PURE__ */ r.jsx(
1400
+ Er,
2862
1401
  {
2863
- rows: P,
2864
- columns: A,
2865
- totalRecords: S,
2866
- currentPage: I,
2867
- loading: F,
2868
- rowModelType: En.CLIENT_SIDE,
2869
- onPageChange: D,
2870
- pageSize: w,
2871
- pageSizeOptions: [...Ft],
2872
- onPageSizeChange: (p) => {
2873
- j(p), D(1);
1402
+ rows: de,
1403
+ columns: Me,
1404
+ totalRecords: V,
1405
+ currentPage: w,
1406
+ loading: ue,
1407
+ rowModelType: St.CLIENT_SIDE,
1408
+ onPageChange: G,
1409
+ pageSize: P,
1410
+ pageSizeOptions: [...Tt],
1411
+ onPageSizeChange: (o) => {
1412
+ re(o), G(1);
2874
1413
  },
2875
- setSort: B,
2876
- sortModel: N,
1414
+ setSort: M,
1415
+ sortModel: T,
2877
1416
  height: 500
2878
1417
  },
2879
- o?.name
1418
+ p?.name
2880
1419
  ),
2881
- /* @__PURE__ */ E.jsxs(us, { children: [
2882
- /* @__PURE__ */ E.jsx(M, { display: "flex", alignItems: "center", gap: 1, children: /* @__PURE__ */ E.jsxs(ps, { variant: "outlined", size: "small", children: [
2883
- /* @__PURE__ */ E.jsxs(It, { children: [
2884
- Je.SHOWING,
1420
+ /* @__PURE__ */ r.jsxs(nr, { children: [
1421
+ /* @__PURE__ */ r.jsx(N, { display: "flex", alignItems: "center", gap: 1, children: /* @__PURE__ */ r.jsxs(ir, { variant: "outlined", size: "small", children: [
1422
+ /* @__PURE__ */ r.jsxs(dt, { children: [
1423
+ Ve.SHOWING,
2885
1424
  " "
2886
1425
  ] }),
2887
- /* @__PURE__ */ E.jsx(
2888
- ds,
1426
+ /* @__PURE__ */ r.jsx(
1427
+ or,
2889
1428
  {
2890
- value: w,
1429
+ value: P,
2891
1430
  inputProps: { "aria-label": "Page size" },
2892
- onChange: (p) => {
2893
- j(Number(p.target.value)), D(1);
1431
+ onChange: (o) => {
1432
+ re(Number(o.target.value)), G(1);
2894
1433
  },
2895
- children: Ft.map((p) => /* @__PURE__ */ E.jsx(We, { value: p, children: p }, p))
1434
+ children: Tt.map((o) => /* @__PURE__ */ r.jsx(ke, { value: o, children: o }, o))
2896
1435
  }
2897
1436
  ),
2898
- /* @__PURE__ */ E.jsxs(It, { children: [
2899
- Je.OF,
1437
+ /* @__PURE__ */ r.jsxs(dt, { children: [
1438
+ Ve.OF,
2900
1439
  " ",
2901
- S,
1440
+ V,
2902
1441
  " ",
2903
- Je.ENTRIES
1442
+ Ve.ENTRIES
2904
1443
  ] })
2905
1444
  ] }) }),
2906
- /* @__PURE__ */ E.jsx(
2907
- As,
1445
+ /* @__PURE__ */ r.jsx(
1446
+ Tr,
2908
1447
  {
2909
- totalRecords: S,
2910
- currentPage: I,
2911
- onPageChange: D,
2912
- pageSize: w
1448
+ totalRecords: V,
1449
+ currentPage: w,
1450
+ onPageChange: G,
1451
+ pageSize: P
2913
1452
  }
2914
1453
  )
2915
1454
  ] })
2916
1455
  ] })
2917
1456
  ] });
2918
- }, yo = {
2919
- ROOT: "/",
2920
- MASTER: "/master",
2921
- MASTER_ENTITY_NEW: (e) => `/master/${e}/new`,
2922
- MASTER_ENTITY_VIEW: (e, t) => `/master/${e}/${t}`,
2923
- MASTER_ENTITY_EDIT: (e, t) => `/master/${e}/${t}/edit`
2924
- }, go = {
2925
- ROOT: "/",
2926
- MASTER: "/master",
2927
- MASTER_ENTITY_NEW: "/master/:entity/new",
2928
- MASTER_ENTITY_VIEW: "/master/:entity/:id",
2929
- MASTER_ENTITY_EDIT: "/master/:entity/:id/edit"
2930
- }, Ke = {
2931
- NEW: "new",
2932
- EDIT: "edit",
2933
- VIEW: "view"
2934
- }, bo = {
2935
- ENTITY: "entity",
2936
- ID: "id"
2937
- }, _s = {
2938
- NEW: "/new",
2939
- EDIT: "/edit"
2940
- }, Qe = () => {
2941
- const e = Ut(), { entity: t, id: n } = Rn(), { routes: r } = ke(), s = pn(), o = Oe(() => n ? window.location.pathname.endsWith(_s.EDIT) ? K.EDIT : K.VIEW : K.CREATE, [n]), [a, l] = H({}), [m, d] = H({}), [u, T] = H(!1), [x, P] = H({}), [f, S] = H(!0), [h, w] = H(null), j = Oe(() => Object.keys(a), [a]), I = Oe(() => j.sort((b, y) => {
2942
- const g = a[b], N = a[y];
2943
- return g?.validation?.required && !N?.validation?.required ? -1 : !g?.validation?.required && N?.validation?.required ? 1 : b.localeCompare(y);
2944
- }), [j, a]);
2945
- be(() => {
2946
- if (!t) return;
2947
- let b = !0;
1457
+ }, Xr = ({
1458
+ apiClient: a,
1459
+ apiEndpoints: f,
1460
+ entity: d,
1461
+ id: E,
1462
+ mode: s,
1463
+ onBack: k,
1464
+ onSuccess: z
1465
+ }) => {
1466
+ const p = Re(() => vt(a, f), [a, f]), [g, Y] = F({}), [S, O] = F({}), [C, W] = F(!1), [te, de] = F({}), [K, V] = F(!0), [D, P] = F(null), re = Re(() => Object.keys(g), [g]), w = Re(() => re.sort((R, u) => {
1467
+ const i = g[R], T = g[u];
1468
+ return i?.validation?.required && !T?.validation?.required ? -1 : !i?.validation?.required && T?.validation?.required ? 1 : R.localeCompare(u);
1469
+ }), [re, g]);
1470
+ Ce(() => {
1471
+ if (!d) return;
1472
+ let R = !0;
2948
1473
  return (async () => {
2949
- S(!0), w(null);
1474
+ V(!0), P(null);
2950
1475
  try {
2951
- const g = await s.getMetadata(t);
2952
- if (!b) return;
2953
- const B = (g.data?.data || g.data || {}).formConfig || {};
2954
- l(B), P({});
2955
- } catch (g) {
2956
- console.error(oe.FAILED_LOAD_METADATA, g), b && w(oe.FAILED_LOAD_FORM_CONFIG);
1476
+ const i = await p.getMetadata(d);
1477
+ if (!R) return;
1478
+ const M = (i.data?.data || i.data || {}).formConfig || {};
1479
+ Y(M);
1480
+ const h = {};
1481
+ for (const [Q, U] of Object.entries(M))
1482
+ if (U.fieldType === $e.DROPDOWN)
1483
+ if (U.optionType === "API" && U.option && typeof U.option == "string")
1484
+ try {
1485
+ const H = await a.get(U.option), Te = (H.data?.data || H.data || []).map((ae) => ({
1486
+ value: ae.id,
1487
+ label: ae.name || ae.displayName || String(ae.id)
1488
+ }));
1489
+ h[U.fieldName] = Te;
1490
+ } catch (H) {
1491
+ console.error(`Failed to load options for ${Q}:`, H), h[U.fieldName] = [];
1492
+ }
1493
+ else U.optionType === "Raw" && Array.isArray(U.option) && (h[U.fieldName] = U.option);
1494
+ R && de(h);
1495
+ } catch (i) {
1496
+ console.error(ie.FAILED_LOAD_METADATA, i), R && P(ie.FAILED_LOAD_FORM_CONFIG);
2957
1497
  } finally {
2958
- b && S(!1);
1498
+ R && V(!1);
2959
1499
  }
2960
1500
  })(), () => {
2961
- b = !1;
1501
+ R = !1;
2962
1502
  };
2963
- }, [t, s]), be(() => {
2964
- if (!t || !n || o === K.CREATE) {
2965
- d({});
1503
+ }, [d, p, a]), Ce(() => {
1504
+ if (!d || !E || s === X.CREATE) {
1505
+ O({});
2966
1506
  return;
2967
1507
  }
2968
- let b = !0;
1508
+ let R = !0;
2969
1509
  return (async () => {
2970
- T(!0), w(null);
1510
+ W(!0), P(null);
2971
1511
  try {
2972
- const g = await s.getRecord(t, n);
2973
- if (!b) return;
2974
- const N = g.data || {}, B = {};
2975
- for (const [L, W] of Object.entries(N))
2976
- L.endsWith(bs) || (B[L] = W);
2977
- d(B);
2978
- } catch (g) {
2979
- console.error(oe.FAILED_LOAD_RECORD, g), b && w(oe.FAILED_LOAD_RECORD);
1512
+ const i = await p.getRecord(d, E);
1513
+ if (!R) return;
1514
+ const T = i.data?.data || i.data || {}, M = {};
1515
+ for (const [h, Q] of Object.entries(T))
1516
+ h.endsWith(Rr) || (M[h] = Q);
1517
+ O(M);
1518
+ } catch (i) {
1519
+ console.error(ie.FAILED_LOAD_RECORD, i), R && P(ie.FAILED_LOAD_RECORD);
2980
1520
  } finally {
2981
- b && T(!1);
1521
+ R && W(!1);
2982
1522
  }
2983
1523
  })(), () => {
2984
- b = !1;
1524
+ R = !1;
2985
1525
  };
2986
- }, [t, n, o]);
2987
- const D = ye((b, y) => {
2988
- d((g) => ({ ...g, [b]: y }));
2989
- }, []), F = ye(() => {
2990
- const b = [];
2991
- for (const [y, g] of Object.entries(a))
2992
- g.validation?.required && !m[g.fieldName] && b.push(oe.FIELD_REQUIRED(y)), g.validation?.min !== void 0 && m[g.fieldName] < g.validation.min && b.push(`${y} must be at least ${g.validation.min}`), g.validation?.max !== void 0 && m[g.fieldName] > g.validation.max && b.push(`${y} must be at most ${g.validation.max}`);
2993
- return b;
2994
- }, [a, m]), V = ye(async () => {
2995
- if (!t) return;
2996
- const b = F();
2997
- if (b.length > 0) {
2998
- w(b.join(", "));
1526
+ }, [d, E, s, p]);
1527
+ const G = Oe((R, u) => {
1528
+ O((i) => ({ ...i, [R]: u }));
1529
+ }, []), ue = Oe(() => {
1530
+ const R = [];
1531
+ for (const [u, i] of Object.entries(g))
1532
+ i.validation?.required && !S[i.fieldName] && R.push(ie.FIELD_REQUIRED(u)), i.validation?.min !== void 0 && S[i.fieldName] < i.validation.min && R.push(`${u} must be at least ${i.validation.min}`), i.validation?.max !== void 0 && S[i.fieldName] > i.validation.max && R.push(`${u} must be at most ${i.validation.max}`);
1533
+ return R;
1534
+ }, [g, S]), J = Oe(async () => {
1535
+ if (!d) return;
1536
+ const R = ue();
1537
+ if (R.length > 0) {
1538
+ P(R.join(", "));
2999
1539
  return;
3000
1540
  }
3001
- T(!0), w(null);
1541
+ W(!0), P(null);
3002
1542
  try {
3003
- const y = {};
3004
- for (const g of Object.values(a)) {
3005
- const N = g.fieldName;
3006
- N && m[N] !== void 0 && m[N] !== "" && (y[N] = m[N]);
1543
+ const u = {};
1544
+ for (const i of Object.values(g)) {
1545
+ const T = i.fieldName;
1546
+ T && S[T] !== void 0 && S[T] !== "" && (u[T] = S[T]);
3007
1547
  }
3008
- o === K.CREATE ? await s.createRecord(t, y) : n && await s.updateRecord(t, n, y), e(r.basePath, { replace: !0 });
3009
- } catch (y) {
3010
- console.error("Failed to save record:", y);
3011
- const g = y?.response?.data?.message || "Failed to save record. Please try again.";
3012
- w(g);
1548
+ if (s === X.CREATE) {
1549
+ const i = await p.createRecord(d, { data: u });
1550
+ z?.(i);
1551
+ } else if (E) {
1552
+ const i = await p.updateRecord(d, E, { data: u });
1553
+ z?.(i);
1554
+ }
1555
+ k?.();
1556
+ } catch (u) {
1557
+ console.error("Failed to save record:", u);
1558
+ const i = u?.response?.data?.message || (Array.isArray(u?.response?.data?.message) ? u.response.data.message.join(", ") : "Failed to save record. Please try again.");
1559
+ P(i);
3013
1560
  } finally {
3014
- T(!1);
1561
+ W(!1);
3015
1562
  }
3016
- }, [t, a, m, F, o, n, e]), U = ye((b) => {
3017
- const y = a[b], g = y?.fieldName;
3018
- if (!y || g === "id") return null;
3019
- const N = m[g] ?? "", B = o === K.VIEW || u;
3020
- return /* @__PURE__ */ E.jsxs(M, { className: "form-field", children: [
3021
- /* @__PURE__ */ E.jsxs(pe, { variant: "body2", className: "field-label", children: [
3022
- b,
3023
- y.validation?.required && o !== K.VIEW && /* @__PURE__ */ E.jsx("span", { style: { color: gs }, children: ys })
1563
+ }, [d, g, S, ue, s, E, p, k, z]), oe = Oe((R) => {
1564
+ const u = g[R], i = u?.fieldName;
1565
+ if (!u || i === "id") return null;
1566
+ const T = S[i] ?? "", M = s === X.VIEW || C;
1567
+ return /* @__PURE__ */ r.jsxs(N, { className: "form-field", children: [
1568
+ /* @__PURE__ */ r.jsxs(_e, { variant: "body2", className: "field-label", children: [
1569
+ R,
1570
+ u.validation?.required && s !== X.VIEW && /* @__PURE__ */ r.jsx("span", { style: { color: mr }, children: pr })
3024
1571
  ] }),
3025
- y.fieldType === Mt.DROPDOWN ? /* @__PURE__ */ E.jsx(
3026
- et,
1572
+ u.fieldType === $e.DROPDOWN ? /* @__PURE__ */ r.jsx(
1573
+ Be,
3027
1574
  {
3028
- options: x[g] || [],
3029
- getOptionLabel: (L) => L.label || String(L.value),
3030
- value: x[g]?.find((L) => L.value === N) || null,
3031
- onChange: (L, W) => D(g, W?.value ?? null),
3032
- disabled: B,
3033
- renderInput: (L) => /* @__PURE__ */ E.jsx(
3034
- Z,
1575
+ options: te[i] || [],
1576
+ getOptionLabel: (h) => h.label || String(h.value),
1577
+ value: te[i]?.find((h) => h.value === T) || null,
1578
+ onChange: (h, Q) => G(i, Q?.value ?? null),
1579
+ disabled: M,
1580
+ loading: K,
1581
+ renderInput: (h) => /* @__PURE__ */ r.jsx(
1582
+ ee,
3035
1583
  {
3036
- ...L,
1584
+ ...h,
3037
1585
  size: "small",
3038
- placeholder: ge.SELECT(b),
3039
- error: y.validation?.required && !N && o !== K.VIEW
1586
+ placeholder: ye.SELECT(R),
1587
+ error: u.validation?.required && !T && s !== X.VIEW
3040
1588
  }
3041
1589
  ),
3042
1590
  className: "field-input"
3043
1591
  }
3044
- ) : y.fieldType === Mt.DATEPICKER ? /* @__PURE__ */ E.jsx(
3045
- Z,
1592
+ ) : u.fieldType === $e.DATEPICKER ? /* @__PURE__ */ r.jsx(
1593
+ ee,
3046
1594
  {
3047
1595
  type: "date",
3048
1596
  size: "small",
3049
- value: N ? String(N).slice(0, 10) : "",
3050
- onChange: (L) => D(g, L.target.value),
3051
- disabled: B,
3052
- error: y.validation?.required && !N && o !== "view",
1597
+ value: T ? String(T).slice(0, 10) : "",
1598
+ onChange: (h) => G(i, h.target.value),
1599
+ disabled: M,
1600
+ error: u.validation?.required && !T && s !== X.VIEW,
3053
1601
  className: "field-input",
3054
1602
  InputLabelProps: { shrink: !0 }
3055
1603
  }
3056
- ) : y.dataType === "number" || y.dataType === "float" ? /* @__PURE__ */ E.jsx(
3057
- Z,
1604
+ ) : u.dataType === "number" || u.dataType === "float" ? /* @__PURE__ */ r.jsx(
1605
+ ee,
3058
1606
  {
3059
1607
  type: "number",
3060
1608
  size: "small",
3061
- value: N,
3062
- onChange: (L) => D(g, L.target.value),
3063
- disabled: B,
3064
- placeholder: b,
3065
- error: y.validation?.required && !N && o !== "view",
1609
+ value: T,
1610
+ onChange: (h) => G(i, h.target.value),
1611
+ disabled: M,
1612
+ placeholder: R,
1613
+ error: u.validation?.required && !T && s !== X.VIEW,
3066
1614
  inputProps: {
3067
- max: y.validation?.max,
3068
- min: y.validation?.min,
3069
- step: y.dataType === "float" ? 0.01 : 1
1615
+ max: u.validation?.max,
1616
+ min: u.validation?.min,
1617
+ step: u.dataType === "float" ? 0.01 : 1
3070
1618
  },
3071
1619
  className: "field-input"
3072
1620
  }
3073
- ) : /* @__PURE__ */ E.jsx(
3074
- Z,
1621
+ ) : /* @__PURE__ */ r.jsx(
1622
+ ee,
3075
1623
  {
3076
1624
  size: "small",
3077
- value: N,
3078
- onChange: (L) => D(g, L.target.value),
3079
- disabled: B,
3080
- placeholder: b,
3081
- error: y.validation?.required && !N && o !== K.VIEW,
1625
+ value: T,
1626
+ onChange: (h) => G(i, h.target.value),
1627
+ disabled: M,
1628
+ placeholder: R,
1629
+ error: u.validation?.required && !T && s !== X.VIEW,
3082
1630
  inputProps: {
3083
- maxLength: y.validation?.max
1631
+ maxLength: u.validation?.max
3084
1632
  },
3085
1633
  className: "field-input"
3086
1634
  }
3087
1635
  )
3088
- ] }, b);
3089
- }, [a, m, x, D, o, u]);
3090
- return f ? /* @__PURE__ */ E.jsx(M, { className: "loading-container", display: "flex", justifyContent: "center", alignItems: "center", minHeight: "400px", children: /* @__PURE__ */ E.jsx(Pe, {}) }) : /* @__PURE__ */ E.jsx(M, { className: "master-form", children: /* @__PURE__ */ E.jsxs(kt, { className: "form-section", children: [
3091
- /* @__PURE__ */ E.jsxs(pe, { variant: "h5", gutterBottom: !0, children: [
3092
- o === K.CREATE ? Me.ADD_NEW_RECORD : o === K.EDIT ? Me.EDIT_RECORD : Me.VIEW_RECORD,
3093
- t && ` - ${t.charAt(0).toUpperCase() + t.slice(1)}`
1636
+ ] }, R);
1637
+ }, [g, S, te, G, s, C, K]);
1638
+ return K ? /* @__PURE__ */ r.jsx(N, { className: "loading-container", display: "flex", justifyContent: "center", alignItems: "center", minHeight: "400px", children: /* @__PURE__ */ r.jsx(Le, {}) }) : /* @__PURE__ */ r.jsx(N, { className: "master-form", children: /* @__PURE__ */ r.jsxs(_t, { className: "form-section", children: [
1639
+ /* @__PURE__ */ r.jsxs(_e, { variant: "h5", gutterBottom: !0, children: [
1640
+ s === X.CREATE ? Pe.ADD_NEW_RECORD : s === X.EDIT ? Pe.EDIT_RECORD : Pe.VIEW_RECORD,
1641
+ d && ` - ${d.charAt(0).toUpperCase() + d.slice(1)}`
3094
1642
  ] }),
3095
- h && /* @__PURE__ */ E.jsx(_n, { severity: "error", onClose: () => w(null), sx: { mb: 2 }, children: h }),
3096
- u && o !== "view" && /* @__PURE__ */ E.jsx(M, { display: "flex", justifyContent: "center", my: 2, children: /* @__PURE__ */ E.jsx(Pe, { size: 24 }) }),
3097
- /* @__PURE__ */ E.jsx(M, { className: "form-fields", children: I.map(U) }),
3098
- /* @__PURE__ */ E.jsx(M, { className: "action-buttons", mt: 3, children: o !== K.VIEW ? /* @__PURE__ */ E.jsxs(E.Fragment, { children: [
3099
- /* @__PURE__ */ E.jsx(
3100
- re,
1643
+ D && /* @__PURE__ */ r.jsx(Kt, { severity: "error", onClose: () => P(null), sx: { mb: 2 }, children: D }),
1644
+ C && s !== X.VIEW && /* @__PURE__ */ r.jsx(N, { display: "flex", justifyContent: "center", my: 2, children: /* @__PURE__ */ r.jsx(Le, { size: 24 }) }),
1645
+ /* @__PURE__ */ r.jsx(N, { className: "form-fields", children: w.map(oe) }),
1646
+ /* @__PURE__ */ r.jsx(N, { className: "action-buttons", mt: 3, children: s !== X.VIEW ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
1647
+ /* @__PURE__ */ r.jsx(
1648
+ ne,
3101
1649
  {
3102
1650
  variant: "contained",
3103
- onClick: V,
3104
- disabled: u,
3105
- children: u ? /* @__PURE__ */ E.jsx(Pe, { size: 24 }) : o === K.CREATE ? ae.CREATE : ae.UPDATE
1651
+ onClick: J,
1652
+ disabled: C,
1653
+ children: C ? /* @__PURE__ */ r.jsx(Le, { size: 24 }) : s === X.CREATE ? le.CREATE : le.UPDATE
3106
1654
  }
3107
1655
  ),
3108
- /* @__PURE__ */ E.jsx(
3109
- re,
1656
+ /* @__PURE__ */ r.jsx(
1657
+ ne,
3110
1658
  {
3111
1659
  variant: "outlined",
3112
- onClick: () => e(-1),
3113
- disabled: u,
3114
- children: ae.CANCEL
1660
+ onClick: () => k?.(),
1661
+ disabled: C,
1662
+ children: le.CANCEL
3115
1663
  }
3116
1664
  )
3117
- ] }) : /* @__PURE__ */ E.jsx(re, { variant: "outlined", onClick: () => e(-1), children: ae.BACK }) })
1665
+ ] }) : /* @__PURE__ */ r.jsx(ne, { variant: "outlined", onClick: () => k?.(), children: le.BACK }) })
3118
1666
  ] }) });
3119
- }, Oo = () => {
3120
- const { routes: e } = ke(), t = e.basePath;
3121
- return /* @__PURE__ */ E.jsxs(Sn, { children: [
3122
- /* @__PURE__ */ E.jsx(Te, { path: "/", element: /* @__PURE__ */ E.jsx(An, { to: t, replace: !0 }) }),
3123
- /* @__PURE__ */ E.jsx(Te, { path: t, element: /* @__PURE__ */ E.jsx(Os, {}) }),
3124
- /* @__PURE__ */ E.jsx(Te, { path: `${t}/:entity/new`, element: /* @__PURE__ */ E.jsx(Qe, {}, Ke.NEW) }),
3125
- /* @__PURE__ */ E.jsx(Te, { path: `${t}/:entity/:id/edit`, element: /* @__PURE__ */ E.jsx(Qe, {}, Ke.EDIT) }),
3126
- /* @__PURE__ */ E.jsx(Te, { path: `${t}/:entity/:id`, element: /* @__PURE__ */ E.jsx(Qe, {}, Ke.VIEW) })
3127
- ] });
1667
+ }, zr = {
1668
+ ROOT: "/",
1669
+ MASTER: "/master",
1670
+ MASTER_ENTITY_NEW: (a) => `/master/${a}/new`,
1671
+ MASTER_ENTITY_VIEW: (a, f) => `/master/${a}/${f}`,
1672
+ MASTER_ENTITY_EDIT: (a, f) => `/master/${a}/${f}/edit`
1673
+ }, qr = {
1674
+ ROOT: "/",
1675
+ MASTER: "/master",
1676
+ MASTER_ENTITY_NEW: "/master/:entity/new",
1677
+ MASTER_ENTITY_VIEW: "/master/:entity/:id",
1678
+ MASTER_ENTITY_EDIT: "/master/:entity/:id/edit"
1679
+ }, Kr = {
1680
+ NEW: "new",
1681
+ EDIT: "edit",
1682
+ VIEW: "view"
1683
+ }, Jr = {
1684
+ ENTITY: "entity",
1685
+ ID: "id"
1686
+ }, Qr = {
1687
+ NEW: "/new",
1688
+ EDIT: "/edit"
3128
1689
  };
3129
1690
  export {
3130
- lo as API_BASE_PATHS,
3131
- io as API_CONFIG,
3132
- co as API_ENDPOINTS,
3133
- ao as ARIA_LABELS,
3134
- Oo as AppRoutes,
3135
- Oo as AppRoutesComponent,
3136
- ae as BUTTON_LABELS,
3137
- Qs as COLUMN_PROPERTIES,
3138
- ro as CSS_CLASSES,
3139
- Le as DATA_TYPES,
3140
- oo as DATE_FORMATS,
1691
+ Mr as API_BASE_PATHS,
1692
+ Pr as API_CONFIG,
1693
+ jr as API_ENDPOINTS,
1694
+ Lr as ARIA_LABELS,
1695
+ le as BUTTON_LABELS,
1696
+ Ir as COLUMN_PROPERTIES,
1697
+ xr as CSS_CLASSES,
1698
+ Ne as DATA_TYPES,
1699
+ Nr as DATE_FORMATS,
3141
1700
  se as DATE_RANGE_SUFFIXES,
3142
- bs as DISPLAY_FIELD_SUFFIX,
3143
- to as EMPTY_STATE_MESSAGES,
3144
- oe as ERROR_MESSAGES,
3145
- Lt as EXPORT_OPTIONS,
3146
- Xe as FIELD_LABELS,
3147
- ho as FIELD_NAMES,
3148
- Mt as FIELD_TYPES,
3149
- Pt as FILE_EXTENSIONS,
3150
- K as FORM_MODES,
3151
- Ts as GRID_CSS_CLASSES,
3152
- ms as GRID_EVENT_SOURCES,
3153
- Dt as GRID_LAYOUT,
3154
- hs as GRID_MESSAGES,
3155
- Es as GRID_SETTINGS,
3156
- Je as GRID_TEXT,
3157
- Rs as GRID_TIMEOUTS,
3158
- uo as HTTP_METHODS,
3159
- Ro as INPUT_TYPES,
3160
- no as LOADING_MESSAGES,
3161
- vt as MIME_TYPES,
3162
- Ds as MasterDataProvider,
3163
- Qe as MasterForm,
3164
- Qe as MasterFormComponent,
3165
- Os as MasterView,
3166
- Os as MasterViewComponent,
3167
- So as NUMBER_INPUT,
3168
- mo as OPTION_TYPES,
3169
- Ft as PAGE_SIZE_OPTIONS,
3170
- Me as PAGE_TITLES,
3171
- Js as PAGINATION_SETTINGS,
3172
- ge as PLACEHOLDERS,
3173
- As as Pagination,
3174
- fo as QUERY_PARAMS,
3175
- Ao as REGEX_PATTERNS,
3176
- ys as REQUIRED_INDICATOR,
3177
- gs as REQUIRED_INDICATOR_COLOR,
3178
- Eo as RESPONSE_KEYS,
3179
- po as RESPONSE_TYPES,
3180
- yo as ROUTES,
3181
- Ke as ROUTE_KEYS,
3182
- go as ROUTE_PATTERNS,
3183
- _s as ROUTE_SUFFIXES,
3184
- En as ROW_MODEL_TYPES,
3185
- jt as SORT_ORDER,
3186
- Ks as SORT_SETTINGS,
3187
- so as STYLE_CONSTANTS,
3188
- Zs as SUCCESS_MESSAGES,
3189
- Ss as ServerSideGrid,
3190
- bo as URL_PARAMS,
3191
- eo as VALIDATION_MESSAGES,
3192
- To as VALIDATION_RULES,
3193
- pn as useApiService,
3194
- ke as useMasterDataConfig
1701
+ Rr as DISPLAY_FIELD_SUFFIX,
1702
+ Cr as EMPTY_STATE_MESSAGES,
1703
+ ie as ERROR_MESSAGES,
1704
+ ft as EXPORT_OPTIONS,
1705
+ Ye as FIELD_LABELS,
1706
+ Yr as FIELD_NAMES,
1707
+ $e as FIELD_TYPES,
1708
+ Et as FILE_EXTENSIONS,
1709
+ X as FORM_MODES,
1710
+ ur as GRID_CSS_CLASSES,
1711
+ cr as GRID_EVENT_SOURCES,
1712
+ ut as GRID_LAYOUT,
1713
+ dr as GRID_MESSAGES,
1714
+ lr as GRID_SETTINGS,
1715
+ Ve as GRID_TEXT,
1716
+ fr as GRID_TIMEOUTS,
1717
+ Fr as HTTP_METHODS,
1718
+ $r as INPUT_TYPES,
1719
+ Dr as LOADING_MESSAGES,
1720
+ mt as MIME_TYPES,
1721
+ Xr as MasterForm,
1722
+ Hr as MasterView,
1723
+ Wr as NUMBER_INPUT,
1724
+ kr as OPTION_TYPES,
1725
+ Tt as PAGE_SIZE_OPTIONS,
1726
+ Pe as PAGE_TITLES,
1727
+ hr as PAGINATION_SETTINGS,
1728
+ ye as PLACEHOLDERS,
1729
+ Tr as Pagination,
1730
+ wr as QUERY_PARAMS,
1731
+ Br as REGEX_PATTERNS,
1732
+ pr as REQUIRED_INDICATOR,
1733
+ mr as REQUIRED_INDICATOR_COLOR,
1734
+ Gr as RESPONSE_KEYS,
1735
+ Ur as RESPONSE_TYPES,
1736
+ zr as ROUTES,
1737
+ Kr as ROUTE_KEYS,
1738
+ qr as ROUTE_PATTERNS,
1739
+ Qr as ROUTE_SUFFIXES,
1740
+ St as ROW_MODEL_TYPES,
1741
+ pt as SORT_ORDER,
1742
+ Ar as SORT_SETTINGS,
1743
+ br as STYLE_CONSTANTS,
1744
+ Or as SUCCESS_MESSAGES,
1745
+ Er as ServerSideGrid,
1746
+ Jr as URL_PARAMS,
1747
+ yr as VALIDATION_MESSAGES,
1748
+ Vr as VALIDATION_RULES,
1749
+ vt as createApiService
3195
1750
  };