@tracktor/shared-module 0.15.10 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -4
- package/dist/components/Utils/SentryConfig.d.ts +16 -1
- package/dist/main.js +131 -129
- package/dist/main.umd.cjs +8 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
# [Versions](https://github.com/Tracktor/shared-module/releases)
|
|
2
2
|
|
|
3
|
-
## v0.
|
|
4
|
-
- **[
|
|
5
|
-
- **[feat]** : `SentryConfig` improvement
|
|
6
|
-
- **[feat]** : `AxiosConfig` improvement
|
|
3
|
+
## v0.16.0
|
|
4
|
+
- **[feat]** : ignore sentry error by default _`Failed to fetch dynamically imported module`_ in`SentryConfig`
|
|
@@ -38,6 +38,11 @@ interface SentryConfigProps<T> {
|
|
|
38
38
|
* List of strings/regex controlling to which outgoing requests the SDK will attach tracing headers.
|
|
39
39
|
*/
|
|
40
40
|
tracePropagationTargets?: (string | RegExp)[];
|
|
41
|
+
/**
|
|
42
|
+
* A pattern for error messages which should not be sent to Sentry.
|
|
43
|
+
* By default, all errors will be sent.
|
|
44
|
+
*/
|
|
45
|
+
ignoreErrors?: Array<string | RegExp>;
|
|
41
46
|
}) => void;
|
|
42
47
|
BrowserTracing: any;
|
|
43
48
|
/**
|
|
@@ -48,6 +53,10 @@ interface SentryConfigProps<T> {
|
|
|
48
53
|
* This function is used to instrument React Router v6.
|
|
49
54
|
*/
|
|
50
55
|
reactRouterV6Instrumentation: any;
|
|
56
|
+
/**
|
|
57
|
+
* Returns true if the SDK is already initialized.
|
|
58
|
+
*/
|
|
59
|
+
isInitialized: () => boolean;
|
|
51
60
|
};
|
|
52
61
|
/**
|
|
53
62
|
* Sentry DSN
|
|
@@ -96,6 +105,11 @@ interface SentryConfigProps<T> {
|
|
|
96
105
|
* Enable debug mode.
|
|
97
106
|
*/
|
|
98
107
|
debug?: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* A pattern for error messages which should not be sent to Sentry.
|
|
110
|
+
* By default, all errors will be sent.
|
|
111
|
+
*/
|
|
112
|
+
ignoreErrors?: Array<string | RegExp>;
|
|
99
113
|
}
|
|
100
114
|
/**
|
|
101
115
|
* This component is used to initialize Sentry
|
|
@@ -107,8 +121,9 @@ interface SentryConfigProps<T> {
|
|
|
107
121
|
* @param replaysSessionSampleRate
|
|
108
122
|
* @param replaysOnErrorSampleRate
|
|
109
123
|
* @param tracePropagationTargets
|
|
124
|
+
* @param ignoreErrors
|
|
110
125
|
* @param debug
|
|
111
126
|
* @constructor
|
|
112
127
|
*/
|
|
113
|
-
declare const SentryConfig: <T extends unknown>({ dsn, sentry, integrations, tracesSampleRate, routingInstrumentationDependencies, replaysSessionSampleRate, replaysOnErrorSampleRate, tracePropagationTargets, debug, }: SentryConfigProps<T>) => null;
|
|
128
|
+
declare const SentryConfig: <T extends unknown>({ dsn, sentry, integrations, tracesSampleRate, routingInstrumentationDependencies, replaysSessionSampleRate, replaysOnErrorSampleRate, tracePropagationTargets, ignoreErrors, debug, }: SentryConfigProps<T>) => null;
|
|
114
129
|
export default SentryConfig;
|
package/dist/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Le, { createContext as vr, useMemo as se, useContext as ue, useState as pr, useRef as gr, useLayoutEffect as mr, Suspense as hr, useEffect as Er, useCallback as X } from "react";
|
|
2
2
|
var ie = { exports: {} }, W = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
@@ -14,16 +14,16 @@ function yr() {
|
|
|
14
14
|
if ($e)
|
|
15
15
|
return W;
|
|
16
16
|
$e = 1;
|
|
17
|
-
var n =
|
|
18
|
-
function u(g, c,
|
|
17
|
+
var n = Le, o = Symbol.for("react.element"), s = Symbol.for("react.fragment"), l = Object.prototype.hasOwnProperty, a = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, v = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
18
|
+
function u(g, c, y) {
|
|
19
19
|
var h, C = {}, O = null, T = null;
|
|
20
|
-
|
|
20
|
+
y !== void 0 && (O = "" + y), c.key !== void 0 && (O = "" + c.key), c.ref !== void 0 && (T = c.ref);
|
|
21
21
|
for (h in c)
|
|
22
22
|
l.call(c, h) && !v.hasOwnProperty(h) && (C[h] = c[h]);
|
|
23
23
|
if (g && g.defaultProps)
|
|
24
24
|
for (h in c = g.defaultProps, c)
|
|
25
25
|
C[h] === void 0 && (C[h] = c[h]);
|
|
26
|
-
return { $$typeof:
|
|
26
|
+
return { $$typeof: o, type: g, key: O, ref: T, props: C, _owner: a.current };
|
|
27
27
|
}
|
|
28
28
|
return W.Fragment = s, W.jsx = u, W.jsxs = u, W;
|
|
29
29
|
}
|
|
@@ -37,10 +37,10 @@ var M = {};
|
|
|
37
37
|
* This source code is licensed under the MIT license found in the
|
|
38
38
|
* LICENSE file in the root directory of this source tree.
|
|
39
39
|
*/
|
|
40
|
-
var
|
|
40
|
+
var Ie;
|
|
41
41
|
function Rr() {
|
|
42
|
-
return
|
|
43
|
-
var n =
|
|
42
|
+
return Ie || (Ie = 1, process.env.NODE_ENV !== "production" && function() {
|
|
43
|
+
var n = Le, o = Symbol.for("react.element"), s = Symbol.for("react.portal"), l = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), g = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), y = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), O = Symbol.for("react.lazy"), T = Symbol.for("react.offscreen"), A = Symbol.iterator, D = "@@iterator";
|
|
44
44
|
function V(e) {
|
|
45
45
|
if (e === null || typeof e != "object")
|
|
46
46
|
return null;
|
|
@@ -48,16 +48,16 @@ function Rr() {
|
|
|
48
48
|
return typeof r == "function" ? r : null;
|
|
49
49
|
}
|
|
50
50
|
var j = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
51
|
-
function
|
|
51
|
+
function b(e) {
|
|
52
52
|
{
|
|
53
|
-
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0),
|
|
54
|
-
t[
|
|
53
|
+
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), i = 1; i < r; i++)
|
|
54
|
+
t[i - 1] = arguments[i];
|
|
55
55
|
_("error", e, t);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
function _(e, r, t) {
|
|
59
59
|
{
|
|
60
|
-
var
|
|
60
|
+
var i = j.ReactDebugCurrentFrame, p = i.getStackAddendum();
|
|
61
61
|
p !== "" && (r += "%s", t = t.concat([p]));
|
|
62
62
|
var m = t.map(function(d) {
|
|
63
63
|
return String(d);
|
|
@@ -68,16 +68,16 @@ function Rr() {
|
|
|
68
68
|
var le = !1, ce = !1, Y = !1, Ne = !1, We = !1, fe;
|
|
69
69
|
fe = Symbol.for("react.module.reference");
|
|
70
70
|
function Me(e) {
|
|
71
|
-
return !!(typeof e == "string" || typeof e == "function" || e === l || e === v || We || e === a || e ===
|
|
71
|
+
return !!(typeof e == "string" || typeof e == "function" || e === l || e === v || We || e === a || e === y || e === h || Ne || e === T || le || ce || Y || typeof e == "object" && e !== null && (e.$$typeof === O || e.$$typeof === C || e.$$typeof === u || e.$$typeof === g || e.$$typeof === c || // This needs to include all possible module reference object
|
|
72
72
|
// types supported by any Flight configuration anywhere since
|
|
73
73
|
// we don't know which Flight build this will end up being used
|
|
74
74
|
// with.
|
|
75
75
|
e.$$typeof === fe || e.getModuleId !== void 0));
|
|
76
76
|
}
|
|
77
77
|
function Ve(e, r, t) {
|
|
78
|
-
var
|
|
79
|
-
if (
|
|
80
|
-
return
|
|
78
|
+
var i = e.displayName;
|
|
79
|
+
if (i)
|
|
80
|
+
return i;
|
|
81
81
|
var p = r.displayName || r.name || "";
|
|
82
82
|
return p !== "" ? t + "(" + p + ")" : t;
|
|
83
83
|
}
|
|
@@ -87,7 +87,7 @@ function Rr() {
|
|
|
87
87
|
function P(e) {
|
|
88
88
|
if (e == null)
|
|
89
89
|
return null;
|
|
90
|
-
if (typeof e.tag == "number" &&
|
|
90
|
+
if (typeof e.tag == "number" && b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
91
91
|
return e.displayName || e.name || null;
|
|
92
92
|
if (typeof e == "string")
|
|
93
93
|
return e;
|
|
@@ -100,7 +100,7 @@ function Rr() {
|
|
|
100
100
|
return "Profiler";
|
|
101
101
|
case a:
|
|
102
102
|
return "StrictMode";
|
|
103
|
-
case
|
|
103
|
+
case y:
|
|
104
104
|
return "Suspense";
|
|
105
105
|
case h:
|
|
106
106
|
return "SuspenseList";
|
|
@@ -116,8 +116,8 @@ function Rr() {
|
|
|
116
116
|
case c:
|
|
117
117
|
return Ve(e, e.render, "ForwardRef");
|
|
118
118
|
case C:
|
|
119
|
-
var
|
|
120
|
-
return
|
|
119
|
+
var i = e.displayName || null;
|
|
120
|
+
return i !== null ? i : P(e.type) || "Memo";
|
|
121
121
|
case O: {
|
|
122
122
|
var p = e, m = p._payload, d = p._init;
|
|
123
123
|
try {
|
|
@@ -129,13 +129,13 @@ function Rr() {
|
|
|
129
129
|
}
|
|
130
130
|
return null;
|
|
131
131
|
}
|
|
132
|
-
var F = Object.assign,
|
|
132
|
+
var F = Object.assign, L = 0, ve, pe, ge, me, he, Ee, ye;
|
|
133
133
|
function Re() {
|
|
134
134
|
}
|
|
135
135
|
Re.__reactDisabledLog = !0;
|
|
136
136
|
function Ye() {
|
|
137
137
|
{
|
|
138
|
-
if (
|
|
138
|
+
if (L === 0) {
|
|
139
139
|
ve = console.log, pe = console.info, ge = console.warn, me = console.error, he = console.group, Ee = console.groupCollapsed, ye = console.groupEnd;
|
|
140
140
|
var e = {
|
|
141
141
|
configurable: !0,
|
|
@@ -153,12 +153,12 @@ function Rr() {
|
|
|
153
153
|
groupEnd: e
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
|
-
|
|
156
|
+
L++;
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
function qe() {
|
|
160
160
|
{
|
|
161
|
-
if (
|
|
161
|
+
if (L--, L === 0) {
|
|
162
162
|
var e = {
|
|
163
163
|
configurable: !0,
|
|
164
164
|
enumerable: !0,
|
|
@@ -188,7 +188,7 @@ function Rr() {
|
|
|
188
188
|
})
|
|
189
189
|
});
|
|
190
190
|
}
|
|
191
|
-
|
|
191
|
+
L < 0 && b("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
var K = j.ReactCurrentDispatcher, Z;
|
|
@@ -198,8 +198,8 @@ function Rr() {
|
|
|
198
198
|
try {
|
|
199
199
|
throw Error();
|
|
200
200
|
} catch (p) {
|
|
201
|
-
var
|
|
202
|
-
Z =
|
|
201
|
+
var i = p.stack.trim().match(/\n( *(at )?)/);
|
|
202
|
+
Z = i && i[1] || "";
|
|
203
203
|
}
|
|
204
204
|
return `
|
|
205
205
|
` + Z + e;
|
|
@@ -218,7 +218,7 @@ function Rr() {
|
|
|
218
218
|
if (t !== void 0)
|
|
219
219
|
return t;
|
|
220
220
|
}
|
|
221
|
-
var
|
|
221
|
+
var i;
|
|
222
222
|
Q = !0;
|
|
223
223
|
var p = Error.prepareStackTrace;
|
|
224
224
|
Error.prepareStackTrace = void 0;
|
|
@@ -237,14 +237,14 @@ function Rr() {
|
|
|
237
237
|
try {
|
|
238
238
|
Reflect.construct(d, []);
|
|
239
239
|
} catch (x) {
|
|
240
|
-
|
|
240
|
+
i = x;
|
|
241
241
|
}
|
|
242
242
|
Reflect.construct(e, [], d);
|
|
243
243
|
} else {
|
|
244
244
|
try {
|
|
245
245
|
d.call();
|
|
246
246
|
} catch (x) {
|
|
247
|
-
|
|
247
|
+
i = x;
|
|
248
248
|
}
|
|
249
249
|
e.call(d.prototype);
|
|
250
250
|
}
|
|
@@ -252,33 +252,33 @@ function Rr() {
|
|
|
252
252
|
try {
|
|
253
253
|
throw Error();
|
|
254
254
|
} catch (x) {
|
|
255
|
-
|
|
255
|
+
i = x;
|
|
256
256
|
}
|
|
257
257
|
e();
|
|
258
258
|
}
|
|
259
259
|
} catch (x) {
|
|
260
|
-
if (x &&
|
|
260
|
+
if (x && i && typeof x.stack == "string") {
|
|
261
261
|
for (var f = x.stack.split(`
|
|
262
|
-
`), w =
|
|
263
|
-
`), E = f.length - 1,
|
|
264
|
-
|
|
265
|
-
for (; E >= 1 &&
|
|
266
|
-
if (f[E] !== w[
|
|
267
|
-
if (E !== 1 ||
|
|
262
|
+
`), w = i.stack.split(`
|
|
263
|
+
`), E = f.length - 1, R = w.length - 1; E >= 1 && R >= 0 && f[E] !== w[R]; )
|
|
264
|
+
R--;
|
|
265
|
+
for (; E >= 1 && R >= 0; E--, R--)
|
|
266
|
+
if (f[E] !== w[R]) {
|
|
267
|
+
if (E !== 1 || R !== 1)
|
|
268
268
|
do
|
|
269
|
-
if (E--,
|
|
269
|
+
if (E--, R--, R < 0 || f[E] !== w[R]) {
|
|
270
270
|
var S = `
|
|
271
271
|
` + f[E].replace(" at new ", " at ");
|
|
272
272
|
return e.displayName && S.includes("<anonymous>") && (S = S.replace("<anonymous>", e.displayName)), typeof e == "function" && z.set(e, S), S;
|
|
273
273
|
}
|
|
274
|
-
while (E >= 1 &&
|
|
274
|
+
while (E >= 1 && R >= 0);
|
|
275
275
|
break;
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
} finally {
|
|
279
279
|
Q = !1, K.current = m, qe(), Error.prepareStackTrace = p;
|
|
280
280
|
}
|
|
281
|
-
var
|
|
281
|
+
var I = e ? e.displayName || e.name : "", Fe = I ? q(I) : "";
|
|
282
282
|
return typeof e == "function" && z.set(e, Fe), Fe;
|
|
283
283
|
}
|
|
284
284
|
function Ue(e, r, t) {
|
|
@@ -296,7 +296,7 @@ function Rr() {
|
|
|
296
296
|
if (typeof e == "string")
|
|
297
297
|
return q(e);
|
|
298
298
|
switch (e) {
|
|
299
|
-
case
|
|
299
|
+
case y:
|
|
300
300
|
return q("Suspense");
|
|
301
301
|
case h:
|
|
302
302
|
return q("SuspenseList");
|
|
@@ -308,7 +308,7 @@ function Rr() {
|
|
|
308
308
|
case C:
|
|
309
309
|
return U(e.type, r, t);
|
|
310
310
|
case O: {
|
|
311
|
-
var
|
|
311
|
+
var i = e, p = i._payload, m = i._init;
|
|
312
312
|
try {
|
|
313
313
|
return U(m(p), r, t);
|
|
314
314
|
} catch {
|
|
@@ -325,7 +325,7 @@ function Rr() {
|
|
|
325
325
|
} else
|
|
326
326
|
we.setExtraStackFrame(null);
|
|
327
327
|
}
|
|
328
|
-
function Ge(e, r, t,
|
|
328
|
+
function Ge(e, r, t, i, p) {
|
|
329
329
|
{
|
|
330
330
|
var m = Function.call.bind(B);
|
|
331
331
|
for (var d in e)
|
|
@@ -333,14 +333,14 @@ function Rr() {
|
|
|
333
333
|
var f = void 0;
|
|
334
334
|
try {
|
|
335
335
|
if (typeof e[d] != "function") {
|
|
336
|
-
var w = Error((
|
|
336
|
+
var w = Error((i || "React class") + ": " + t + " type `" + d + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[d] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
337
337
|
throw w.name = "Invariant Violation", w;
|
|
338
338
|
}
|
|
339
|
-
f = e[d](r, d,
|
|
339
|
+
f = e[d](r, d, i, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
340
340
|
} catch (E) {
|
|
341
341
|
f = E;
|
|
342
342
|
}
|
|
343
|
-
f && !(f instanceof Error) && (G(p),
|
|
343
|
+
f && !(f instanceof Error) && (G(p), b("%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).", i || "React class", t, d, typeof f), G(null)), f instanceof Error && !(f.message in _e) && (_e[f.message] = !0, G(p), b("Failed %s type: %s", t, f.message), G(null));
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
}
|
|
@@ -366,7 +366,7 @@ function Rr() {
|
|
|
366
366
|
}
|
|
367
367
|
function Te(e) {
|
|
368
368
|
if (He(e))
|
|
369
|
-
return
|
|
369
|
+
return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Xe(e)), Ce(e);
|
|
370
370
|
}
|
|
371
371
|
var N = j.ReactCurrentOwner, Ke = {
|
|
372
372
|
key: !0,
|
|
@@ -394,13 +394,13 @@ function Rr() {
|
|
|
394
394
|
function er(e, r) {
|
|
395
395
|
if (typeof e.ref == "string" && N.current && r && N.current.stateNode !== r) {
|
|
396
396
|
var t = P(N.current.type);
|
|
397
|
-
re[t] || (
|
|
397
|
+
re[t] || (b('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', P(N.current.type), e.ref), re[t] = !0);
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
400
|
function rr(e, r) {
|
|
401
401
|
{
|
|
402
402
|
var t = function() {
|
|
403
|
-
Oe || (Oe = !0,
|
|
403
|
+
Oe || (Oe = !0, b("%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)", r));
|
|
404
404
|
};
|
|
405
405
|
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
406
406
|
get: t,
|
|
@@ -411,7 +411,7 @@ function Rr() {
|
|
|
411
411
|
function tr(e, r) {
|
|
412
412
|
{
|
|
413
413
|
var t = function() {
|
|
414
|
-
Se || (Se = !0,
|
|
414
|
+
Se || (Se = !0, b("%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)", r));
|
|
415
415
|
};
|
|
416
416
|
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
417
417
|
get: t,
|
|
@@ -419,10 +419,10 @@ function Rr() {
|
|
|
419
419
|
});
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
|
-
var nr = function(e, r, t,
|
|
422
|
+
var nr = function(e, r, t, i, p, m, d) {
|
|
423
423
|
var f = {
|
|
424
424
|
// This tag allows us to uniquely identify this as a React Element
|
|
425
|
-
$$typeof:
|
|
425
|
+
$$typeof: o,
|
|
426
426
|
// Built-in properties that belong on the element
|
|
427
427
|
type: e,
|
|
428
428
|
key: r,
|
|
@@ -440,7 +440,7 @@ function Rr() {
|
|
|
440
440
|
configurable: !1,
|
|
441
441
|
enumerable: !1,
|
|
442
442
|
writable: !1,
|
|
443
|
-
value:
|
|
443
|
+
value: i
|
|
444
444
|
}), Object.defineProperty(f, "_source", {
|
|
445
445
|
configurable: !1,
|
|
446
446
|
enumerable: !1,
|
|
@@ -448,7 +448,7 @@ function Rr() {
|
|
|
448
448
|
value: p
|
|
449
449
|
}), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
|
|
450
450
|
};
|
|
451
|
-
function ar(e, r, t,
|
|
451
|
+
function ar(e, r, t, i, p) {
|
|
452
452
|
{
|
|
453
453
|
var m, d = {}, f = null, w = null;
|
|
454
454
|
t !== void 0 && (Te(t), f = "" + t), Qe(r) && (Te(r.key), f = "" + r.key), Ze(r) && (w = r.ref, er(r, p));
|
|
@@ -460,10 +460,10 @@ function Rr() {
|
|
|
460
460
|
d[m] === void 0 && (d[m] = E[m]);
|
|
461
461
|
}
|
|
462
462
|
if (f || w) {
|
|
463
|
-
var
|
|
464
|
-
f && rr(d,
|
|
463
|
+
var R = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
464
|
+
f && rr(d, R), w && tr(d, R);
|
|
465
465
|
}
|
|
466
|
-
return nr(e, f, w, p,
|
|
466
|
+
return nr(e, f, w, p, i, N.current, d);
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
469
|
var te = j.ReactCurrentOwner, je = j.ReactDebugCurrentFrame;
|
|
@@ -477,7 +477,7 @@ function Rr() {
|
|
|
477
477
|
var ne;
|
|
478
478
|
ne = !1;
|
|
479
479
|
function ae(e) {
|
|
480
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
480
|
+
return typeof e == "object" && e !== null && e.$$typeof === o;
|
|
481
481
|
}
|
|
482
482
|
function Pe() {
|
|
483
483
|
{
|
|
@@ -524,8 +524,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
524
524
|
if (xe[t])
|
|
525
525
|
return;
|
|
526
526
|
xe[t] = !0;
|
|
527
|
-
var
|
|
528
|
-
e && e._owner && e._owner !== te.current && (
|
|
527
|
+
var i = "";
|
|
528
|
+
e && e._owner && e._owner !== te.current && (i = " It was passed a child from " + P(e._owner.type) + "."), $(e), b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, i), $(null);
|
|
529
529
|
}
|
|
530
530
|
}
|
|
531
531
|
function Ae(e, r) {
|
|
@@ -534,8 +534,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
534
534
|
return;
|
|
535
535
|
if (ee(e))
|
|
536
536
|
for (var t = 0; t < e.length; t++) {
|
|
537
|
-
var
|
|
538
|
-
ae(
|
|
537
|
+
var i = e[t];
|
|
538
|
+
ae(i) && ke(i, r);
|
|
539
539
|
}
|
|
540
540
|
else if (ae(e))
|
|
541
541
|
e._store && (e._store.validated = !0);
|
|
@@ -562,29 +562,29 @@ Check the top-level render call using <` + t + ">.");
|
|
|
562
562
|
else
|
|
563
563
|
return;
|
|
564
564
|
if (t) {
|
|
565
|
-
var
|
|
566
|
-
Ge(t, e.props, "prop",
|
|
565
|
+
var i = P(r);
|
|
566
|
+
Ge(t, e.props, "prop", i, e);
|
|
567
567
|
} else if (r.PropTypes !== void 0 && !ne) {
|
|
568
568
|
ne = !0;
|
|
569
569
|
var p = P(r);
|
|
570
|
-
|
|
570
|
+
b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", p || "Unknown");
|
|
571
571
|
}
|
|
572
|
-
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved &&
|
|
572
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
575
|
function ur(e) {
|
|
576
576
|
{
|
|
577
577
|
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
|
578
|
-
var
|
|
579
|
-
if (
|
|
580
|
-
$(e),
|
|
578
|
+
var i = r[t];
|
|
579
|
+
if (i !== "children" && i !== "key") {
|
|
580
|
+
$(e), b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", i), $(null);
|
|
581
581
|
break;
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
|
-
e.ref !== null && ($(e),
|
|
584
|
+
e.ref !== null && ($(e), b("Invalid attribute `ref` supplied to `React.Fragment`."), $(null));
|
|
585
585
|
}
|
|
586
586
|
}
|
|
587
|
-
function De(e, r, t,
|
|
587
|
+
function De(e, r, t, i, p, m) {
|
|
588
588
|
{
|
|
589
589
|
var d = Me(e);
|
|
590
590
|
if (!d) {
|
|
@@ -593,25 +593,25 @@ Check the top-level render call using <` + t + ">.");
|
|
|
593
593
|
var w = or(p);
|
|
594
594
|
w ? f += w : f += Pe();
|
|
595
595
|
var E;
|
|
596
|
-
e === null ? E = "null" : ee(e) ? E = "array" : e !== void 0 && e.$$typeof ===
|
|
596
|
+
e === null ? E = "null" : ee(e) ? E = "array" : e !== void 0 && e.$$typeof === o ? (E = "<" + (P(e.type) || "Unknown") + " />", f = " Did you accidentally export a JSX literal instead of a component?") : E = typeof e, b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", E, f);
|
|
597
597
|
}
|
|
598
|
-
var
|
|
599
|
-
if (
|
|
600
|
-
return
|
|
598
|
+
var R = ar(e, r, t, p, m);
|
|
599
|
+
if (R == null)
|
|
600
|
+
return R;
|
|
601
601
|
if (d) {
|
|
602
602
|
var S = r.children;
|
|
603
603
|
if (S !== void 0)
|
|
604
|
-
if (
|
|
604
|
+
if (i)
|
|
605
605
|
if (ee(S)) {
|
|
606
|
-
for (var
|
|
607
|
-
Ae(S[
|
|
606
|
+
for (var I = 0; I < S.length; I++)
|
|
607
|
+
Ae(S[I], e);
|
|
608
608
|
Object.freeze && Object.freeze(S);
|
|
609
609
|
} else
|
|
610
|
-
|
|
610
|
+
b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
611
611
|
else
|
|
612
612
|
Ae(S, e);
|
|
613
613
|
}
|
|
614
|
-
return e === l ? ur(
|
|
614
|
+
return e === l ? ur(R) : sr(R), R;
|
|
615
615
|
}
|
|
616
616
|
}
|
|
617
617
|
function lr(e, r, t) {
|
|
@@ -636,7 +636,7 @@ const H = vr({
|
|
|
636
636
|
useLocation: void 0
|
|
637
637
|
}), Or = ({
|
|
638
638
|
axios: n,
|
|
639
|
-
children:
|
|
639
|
+
children: o,
|
|
640
640
|
translate: s,
|
|
641
641
|
useAuth: l,
|
|
642
642
|
Outlet: a,
|
|
@@ -656,21 +656,21 @@ const H = vr({
|
|
|
656
656
|
}),
|
|
657
657
|
[v, a, n, s, l, g, u]
|
|
658
658
|
);
|
|
659
|
-
return /* @__PURE__ */ k.jsx(H.Provider, { value: c, children:
|
|
659
|
+
return /* @__PURE__ */ k.jsx(H.Provider, { value: c, children: o });
|
|
660
660
|
}, J = (n) => `RequireAuth require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`, Sr = ({
|
|
661
661
|
Fallback: n,
|
|
662
|
-
loginPath:
|
|
662
|
+
loginPath: o = "/login",
|
|
663
663
|
localStorageKey: s = "user",
|
|
664
664
|
redirect401Path: l = "/login",
|
|
665
665
|
...a
|
|
666
666
|
}) => {
|
|
667
|
-
var D, V, j,
|
|
667
|
+
var D, V, j, b;
|
|
668
668
|
const {
|
|
669
669
|
axios: v = a.axios,
|
|
670
670
|
useLocation: u = a.useLocation,
|
|
671
671
|
useAuth: g = a.useAuth,
|
|
672
672
|
Outlet: c = a.Outlet,
|
|
673
|
-
Navigate:
|
|
673
|
+
Navigate: y = a.Navigate
|
|
674
674
|
} = ue(H);
|
|
675
675
|
if (g === void 0)
|
|
676
676
|
throw new Error(J("useAuth"));
|
|
@@ -678,7 +678,7 @@ const H = vr({
|
|
|
678
678
|
throw new Error(J("useLocation"));
|
|
679
679
|
if (c === void 0)
|
|
680
680
|
throw new Error(J("Outlet"));
|
|
681
|
-
if (
|
|
681
|
+
if (y === void 0)
|
|
682
682
|
throw new Error(J("Navigate"));
|
|
683
683
|
const [h, C] = pr(null), { isLogged: O } = g(), T = u(), A = gr(!1);
|
|
684
684
|
return mr(() => {
|
|
@@ -689,26 +689,26 @@ const H = vr({
|
|
|
689
689
|
return typeof _ == "object" && _ && "response" in _ && _.response && typeof _.response == "object" && "status" in _.response && _.response && typeof _.response == "object" && "status" in _.response && ((Y = _ == null ? void 0 : _.response) == null ? void 0 : Y.status) === 401 && (v.defaults.headers.common.Authorization = null, localStorage.removeItem(s), C(l)), Promise.reject(_);
|
|
690
690
|
}
|
|
691
691
|
));
|
|
692
|
-
}, [v == null ? void 0 : v.defaults.headers.common, v == null ? void 0 : v.interceptors.response, s, l]), O && !h ? /* @__PURE__ */ k.jsx(hr, { fallback: n, children: (V = (D = T.state) == null ? void 0 : D.from) != null && V.state && ((
|
|
692
|
+
}, [v == null ? void 0 : v.defaults.headers.common, v == null ? void 0 : v.interceptors.response, s, l]), O && !h ? /* @__PURE__ */ k.jsx(hr, { fallback: n, children: (V = (D = T.state) == null ? void 0 : D.from) != null && V.state && ((b = (j = T.state) == null ? void 0 : j.from) == null ? void 0 : b.pathname) === o ? /* @__PURE__ */ k.jsx(y, { to: T.state.from.state.from.pathname + T.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ k.jsx(c, {}) }) : /* @__PURE__ */ k.jsx(y, { to: o, state: { from: T }, replace: !0 });
|
|
693
693
|
}, oe = (n) => `GTMSendPageView require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`, jr = ({ ...n }) => {
|
|
694
694
|
const {
|
|
695
|
-
useLocation:
|
|
695
|
+
useLocation: o = n.useLocation,
|
|
696
696
|
Outlet: s = n.Outlet,
|
|
697
697
|
useGoogleTagManager: l = n.useGoogleTagManager
|
|
698
698
|
} = ue(H);
|
|
699
|
-
if (
|
|
699
|
+
if (o === void 0)
|
|
700
700
|
throw new Error(oe("useLocation"));
|
|
701
701
|
if (s === void 0)
|
|
702
702
|
throw new Error(oe("Outlet"));
|
|
703
703
|
if (l === void 0)
|
|
704
704
|
throw new Error(oe("useGoogleTagManager"));
|
|
705
|
-
const { pathname: a } =
|
|
705
|
+
const { pathname: a } = o(), { sendEvent: v } = l();
|
|
706
706
|
return Er(() => {
|
|
707
707
|
v({ event: "pageView", pathname: a });
|
|
708
708
|
}, [a, v]), /* @__PURE__ */ k.jsx(s, {});
|
|
709
709
|
}, Pr = ({
|
|
710
710
|
axios: n,
|
|
711
|
-
baseURL:
|
|
711
|
+
baseURL: o,
|
|
712
712
|
tokenTypeKey: s = "tokenType",
|
|
713
713
|
userLocalStorageKey: l = "user",
|
|
714
714
|
tokenKey: a = "accessToken",
|
|
@@ -716,16 +716,16 @@ const H = vr({
|
|
|
716
716
|
}) => {
|
|
717
717
|
if (!n.defaults)
|
|
718
718
|
return null;
|
|
719
|
-
const u = localStorage.getItem(l), g = u ? JSON.parse(u) : null, c = g != null && g[s] ? g[s] : null,
|
|
720
|
-
return n.defaults.baseURL =
|
|
719
|
+
const u = localStorage.getItem(l), g = u ? JSON.parse(u) : null, c = g != null && g[s] ? g[s] : null, y = g != null && g[a] ? g[a] : null, h = u ? `${c} ${y}` : null;
|
|
720
|
+
return n.defaults.baseURL = o, n.defaults.headers.post["Content-Type"] = v, h && (n.defaults.headers.common.Authorization = h), null;
|
|
721
721
|
}, xr = ({
|
|
722
722
|
i18n: n,
|
|
723
|
-
debug:
|
|
723
|
+
debug: o,
|
|
724
724
|
initReactI18next: s,
|
|
725
725
|
resources: l,
|
|
726
726
|
LanguageDetector: a
|
|
727
727
|
}) => (n != null && n.isInitialized || (n.use(a).use(s).init({
|
|
728
|
-
debug:
|
|
728
|
+
debug: o,
|
|
729
729
|
fallbackLng: "en",
|
|
730
730
|
interpolation: {
|
|
731
731
|
escapeValue: !1
|
|
@@ -743,20 +743,22 @@ const H = vr({
|
|
|
743
743
|
document.documentElement.setAttribute("lang", v);
|
|
744
744
|
})), null), kr = ({
|
|
745
745
|
dsn: n,
|
|
746
|
-
sentry:
|
|
746
|
+
sentry: o,
|
|
747
747
|
integrations: s,
|
|
748
748
|
tracesSampleRate: l,
|
|
749
749
|
routingInstrumentationDependencies: a,
|
|
750
750
|
replaysSessionSampleRate: v,
|
|
751
751
|
replaysOnErrorSampleRate: u,
|
|
752
752
|
tracePropagationTargets: g,
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
753
|
+
ignoreErrors: c,
|
|
754
|
+
debug: y
|
|
755
|
+
}) => (o.isInitialized() || (y || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") && o.init({
|
|
756
|
+
debug: y,
|
|
756
757
|
dsn: n,
|
|
758
|
+
ignoreErrors: c || [/Failed to fetch dynamically imported module/],
|
|
757
759
|
integrations: [
|
|
758
|
-
new
|
|
759
|
-
routingInstrumentation:
|
|
760
|
+
new o.BrowserTracing({
|
|
761
|
+
routingInstrumentation: o.reactRouterV6Instrumentation(
|
|
760
762
|
a.useEffect,
|
|
761
763
|
a.useLocation,
|
|
762
764
|
a.useNavigationType,
|
|
@@ -764,23 +766,23 @@ const H = vr({
|
|
|
764
766
|
a.matchRoutes
|
|
765
767
|
)
|
|
766
768
|
}),
|
|
767
|
-
|
|
769
|
+
o.replayIntegration(),
|
|
768
770
|
...s || []
|
|
769
771
|
],
|
|
770
772
|
replaysOnErrorSampleRate: u || 1,
|
|
771
773
|
replaysSessionSampleRate: v || 0.1,
|
|
772
774
|
tracePropagationTargets: g,
|
|
773
775
|
tracesSampleRate: l || 1
|
|
774
|
-
}), null), Ar = ({ IMaskMixin: n, ...
|
|
776
|
+
}), null), Ar = ({ IMaskMixin: n, ...o }) => {
|
|
775
777
|
const s = se(
|
|
776
778
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
777
779
|
() => n(({ TextField: l, ...a }) => /* @__PURE__ */ k.jsx(l, { ...a })),
|
|
778
780
|
[n]
|
|
779
781
|
);
|
|
780
|
-
return /* @__PURE__ */ k.jsx(s, { ...
|
|
781
|
-
}, Dr = ({ mapbox: n, accessToken:
|
|
782
|
+
return /* @__PURE__ */ k.jsx(s, { ...o });
|
|
783
|
+
}, Dr = ({ mapbox: n, accessToken: o }) => (n && o && (n.accessToken = o), null), Fr = ({
|
|
782
784
|
children: n,
|
|
783
|
-
defaultOptions:
|
|
785
|
+
defaultOptions: o,
|
|
784
786
|
QueryClient: s,
|
|
785
787
|
QueryClientProvider: l
|
|
786
788
|
}) => {
|
|
@@ -789,24 +791,24 @@ const H = vr({
|
|
|
789
791
|
queries: {
|
|
790
792
|
refetchOnWindowFocus: !1,
|
|
791
793
|
retry: 3,
|
|
792
|
-
...
|
|
794
|
+
...o
|
|
793
795
|
}
|
|
794
796
|
}
|
|
795
797
|
});
|
|
796
798
|
return /* @__PURE__ */ k.jsx(l, { client: a, children: n });
|
|
797
799
|
}, $r = (n) => {
|
|
798
|
-
const { unknownErrorTranslationKey:
|
|
800
|
+
const { unknownErrorTranslationKey: o = "error.unknownError" } = n || {}, { translate: s = n == null ? void 0 : n.translate } = ue(H);
|
|
799
801
|
return { printError: X(
|
|
800
802
|
(a) => {
|
|
801
|
-
var g, c,
|
|
802
|
-
const v = s ? s(
|
|
803
|
-
return a != null && a.reason ? String(a.reason) : (g = u == null ? void 0 : u.data) != null && g.reason ? String(u.data.reason) : (c = u == null ? void 0 : u.data) != null && c.message ? String(u.data.message) : (h = (
|
|
803
|
+
var g, c, y, h, C, O, T, A, D;
|
|
804
|
+
const v = s ? s(o) : "Unknown error", { response: u } = a || {};
|
|
805
|
+
return a != null && a.reason ? String(a.reason) : (g = u == null ? void 0 : u.data) != null && g.reason ? String(u.data.reason) : (c = u == null ? void 0 : u.data) != null && c.message ? String(u.data.message) : (h = (y = u == null ? void 0 : u.data) == null ? void 0 : y.detail) != null && h.length && Array.isArray((C = u == null ? void 0 : u.data) == null ? void 0 : C.detail) && ((T = (O = u == null ? void 0 : u.data) == null ? void 0 : O.detail[0]) != null && T.msg) && typeof ((D = (A = u == null ? void 0 : u.data) == null ? void 0 : A.detail[0]) == null ? void 0 : D.msg) == "string" ? String(u.data.detail[0].msg) : v;
|
|
804
806
|
},
|
|
805
|
-
[s,
|
|
807
|
+
[s, o]
|
|
806
808
|
) };
|
|
807
|
-
},
|
|
809
|
+
}, Ir = ({
|
|
808
810
|
data: n,
|
|
809
|
-
fetchNextPage:
|
|
811
|
+
fetchNextPage: o,
|
|
810
812
|
isFetchingNextPage: s,
|
|
811
813
|
isInitialLoading: l,
|
|
812
814
|
isLoading: a,
|
|
@@ -814,12 +816,12 @@ const H = vr({
|
|
|
814
816
|
}) => {
|
|
815
817
|
const u = X(
|
|
816
818
|
async (c) => {
|
|
817
|
-
s || !v || await
|
|
819
|
+
s || !v || await o({ pageParam: (c == null ? void 0 : c.pageParam) || c.visibleRowsCount });
|
|
818
820
|
},
|
|
819
|
-
[v,
|
|
821
|
+
[v, o, s]
|
|
820
822
|
), g = se(() => {
|
|
821
823
|
if (n)
|
|
822
|
-
return n.pages.reduce((c,
|
|
824
|
+
return n.pages.reduce((c, y) => [...c, ...y], []);
|
|
823
825
|
}, [n]);
|
|
824
826
|
return {
|
|
825
827
|
fetchNextPageOnRowsScrollEnd: u,
|
|
@@ -827,8 +829,8 @@ const H = vr({
|
|
|
827
829
|
loadingVariant: l ? "skeleton" : "linear",
|
|
828
830
|
rows: g
|
|
829
831
|
};
|
|
830
|
-
},
|
|
831
|
-
const
|
|
832
|
+
}, Lr = (n) => {
|
|
833
|
+
const o = X(
|
|
832
834
|
({ tokenType: l, accessToken: a }) => {
|
|
833
835
|
n.defaults.headers.common.Authorization = `${l} ${a}`;
|
|
834
836
|
},
|
|
@@ -838,30 +840,30 @@ const H = vr({
|
|
|
838
840
|
clearAuthenticationToken: X(() => {
|
|
839
841
|
n.defaults.headers.common.Authorization = null;
|
|
840
842
|
}, [n.defaults.headers.common]),
|
|
841
|
-
setAuthenticationToken:
|
|
843
|
+
setAuthenticationToken: o
|
|
842
844
|
};
|
|
843
845
|
}, br = (n) => n.charAt(0).toUpperCase() + n.slice(1).toLowerCase(), _r = (n) => {
|
|
844
846
|
const l = n.split("/").filter((a) => a.length > 0).map((a) => a.replace(/\${([^}]*)}/g, "$1").split(/[_-]/).map((c) => c.charAt(0).toUpperCase() + c.slice(1)).join("")).join("");
|
|
845
847
|
return l.charAt(0).toLowerCase() + l.slice(1);
|
|
846
|
-
}, wr = (n,
|
|
847
|
-
const l = _r(
|
|
848
|
+
}, wr = (n, o, s) => {
|
|
849
|
+
const l = _r(o), a = br(s);
|
|
848
850
|
return `${l}${a}`;
|
|
849
851
|
}, Cr = (n) => {
|
|
850
852
|
if (n)
|
|
851
|
-
return (n == null ? void 0 : n.reduce((
|
|
853
|
+
return (n == null ? void 0 : n.reduce((o, s) => (o[s] = {
|
|
852
854
|
query: {
|
|
853
855
|
useInfinite: !0,
|
|
854
856
|
useInfiniteQueryParam: "offset"
|
|
855
857
|
}
|
|
856
|
-
},
|
|
858
|
+
}, o), {})) || {};
|
|
857
859
|
}, Nr = (n) => {
|
|
858
|
-
const { input:
|
|
860
|
+
const { input: o = "./openapi.json", operationsToGenerateInfiniteQueryHook: s = void 0 } = n || {};
|
|
859
861
|
return {
|
|
860
862
|
api: {
|
|
861
863
|
hooks: {
|
|
862
864
|
afterAllFilesWrite: "prettier src/api/ --write"
|
|
863
865
|
},
|
|
864
|
-
input:
|
|
866
|
+
input: o,
|
|
865
867
|
output: {
|
|
866
868
|
client: "react-query",
|
|
867
869
|
mode: "tags-split",
|
|
@@ -899,7 +901,7 @@ export {
|
|
|
899
901
|
Sr as RequireAuth,
|
|
900
902
|
kr as SentryConfig,
|
|
901
903
|
Nr as getOrvalConfig,
|
|
902
|
-
|
|
903
|
-
|
|
904
|
+
Lr as useAuth,
|
|
905
|
+
Ir as useInfiniteDataGrid,
|
|
904
906
|
$r as useResponseError
|
|
905
907
|
};
|
package/dist/main.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(R,
|
|
1
|
+
(function(R,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],h):(R=typeof globalThis<"u"?globalThis:R||self,h(R["@tracktor/shared-module"]={},R.React))})(this,function(R,h){"use strict";var $={exports:{}},W={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var ue;function Le(){if(ue)return W;ue=1;var n=
|
|
9
|
+
*/var ue;function Le(){if(ue)return W;ue=1;var n=h,o=Symbol.for("react.element"),s=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,a=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,v={key:!0,ref:!0,__self:!0,__source:!0};function u(g,c,b){var E,O={},j=null,S=null;b!==void 0&&(j=""+b),c.key!==void 0&&(j=""+c.key),c.ref!==void 0&&(S=c.ref);for(E in c)l.call(c,E)&&!v.hasOwnProperty(E)&&(O[E]=c[E]);if(g&&g.defaultProps)for(E in c=g.defaultProps,c)O[E]===void 0&&(O[E]=c[E]);return{$$typeof:o,type:g,key:j,ref:S,props:O,_owner:a.current}}return W.Fragment=s,W.jsx=u,W.jsxs=u,W}var V={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var le;function Me(){return le||(le=1,process.env.NODE_ENV!=="production"&&function(){var n=
|
|
18
|
-
`+re+e}}var te=!1,H;{var sr=typeof WeakMap=="function"?WeakMap:Map;H=new sr}function _e(e,r){if(!e||te)return"";{var t=H.get(e);if(t!==void 0)return t}var
|
|
19
|
-
`),T=
|
|
20
|
-
`),y=f.length-1,
|
|
21
|
-
`+f[y].replace(" at new "," at ");return e.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",e.displayName)),typeof e=="function"&&H.set(e,P),P}while(y>=1&&
|
|
17
|
+
*/var le;function Me(){return le||(le=1,process.env.NODE_ENV!=="production"&&function(){var n=h,o=Symbol.for("react.element"),s=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),g=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),S=Symbol.for("react.offscreen"),F=Symbol.iterator,I="@@iterator";function G(e){if(e===null||typeof e!="object")return null;var r=F&&e[F]||e[I];return typeof r=="function"?r:null}var A=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function C(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),i=1;i<r;i++)t[i-1]=arguments[i];w("error",e,t)}}function w(e,r,t){{var i=A.ReactDebugCurrentFrame,p=i.getStackAddendum();p!==""&&(r+="%s",t=t.concat([p]));var m=t.map(function(d){return String(d)});m.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,m)}}var ce=!1,fe=!1,J=!1,rr=!1,tr=!1,de;de=Symbol.for("react.module.reference");function nr(e){return!!(typeof e=="string"||typeof e=="function"||e===l||e===v||tr||e===a||e===b||e===E||rr||e===S||ce||fe||J||typeof e=="object"&&e!==null&&(e.$$typeof===j||e.$$typeof===O||e.$$typeof===u||e.$$typeof===g||e.$$typeof===c||e.$$typeof===de||e.getModuleId!==void 0))}function ar(e,r,t){var i=e.displayName;if(i)return i;var p=r.displayName||r.name||"";return p!==""?t+"("+p+")":t}function ve(e){return e.displayName||"Context"}function x(e){if(e==null)return null;if(typeof e.tag=="number"&&C("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case l:return"Fragment";case s:return"Portal";case v:return"Profiler";case a:return"StrictMode";case b:return"Suspense";case E:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case g:var r=e;return ve(r)+".Consumer";case u:var t=e;return ve(t._context)+".Provider";case c:return ar(e,e.render,"ForwardRef");case O:var i=e.displayName||null;return i!==null?i:x(e.type)||"Memo";case j:{var p=e,m=p._payload,d=p._init;try{return x(d(m))}catch{return null}}}return null}var L=Object.assign,z=0,pe,ge,me,he,Ee,ye,Re;function be(){}be.__reactDisabledLog=!0;function or(){{if(z===0){pe=console.log,ge=console.info,me=console.warn,he=console.error,Ee=console.group,ye=console.groupCollapsed,Re=console.groupEnd;var e={configurable:!0,enumerable:!0,value:be,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}z++}}function ir(){{if(z--,z===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:L({},e,{value:pe}),info:L({},e,{value:ge}),warn:L({},e,{value:me}),error:L({},e,{value:he}),group:L({},e,{value:Ee}),groupCollapsed:L({},e,{value:ye}),groupEnd:L({},e,{value:Re})})}z<0&&C("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ee=A.ReactCurrentDispatcher,re;function X(e,r,t){{if(re===void 0)try{throw Error()}catch(p){var i=p.stack.trim().match(/\n( *(at )?)/);re=i&&i[1]||""}return`
|
|
18
|
+
`+re+e}}var te=!1,H;{var sr=typeof WeakMap=="function"?WeakMap:Map;H=new sr}function _e(e,r){if(!e||te)return"";{var t=H.get(e);if(t!==void 0)return t}var i;te=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var m;m=ee.current,ee.current=null,or();try{if(r){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(D){i=D}Reflect.construct(e,[],d)}else{try{d.call()}catch(D){i=D}e.call(d.prototype)}}else{try{throw Error()}catch(D){i=D}e()}}catch(D){if(D&&i&&typeof D.stack=="string"){for(var f=D.stack.split(`
|
|
19
|
+
`),T=i.stack.split(`
|
|
20
|
+
`),y=f.length-1,_=T.length-1;y>=1&&_>=0&&f[y]!==T[_];)_--;for(;y>=1&&_>=0;y--,_--)if(f[y]!==T[_]){if(y!==1||_!==1)do if(y--,_--,_<0||f[y]!==T[_]){var P=`
|
|
21
|
+
`+f[y].replace(" at new "," at ");return e.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",e.displayName)),typeof e=="function"&&H.set(e,P),P}while(y>=1&&_>=0);break}}}finally{te=!1,ee.current=m,ir(),Error.prepareStackTrace=p}var N=e?e.displayName||e.name:"",Ie=N?X(N):"";return typeof e=="function"&&H.set(e,Ie),Ie}function ur(e,r,t){return _e(e,!1)}function lr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function K(e,r,t){if(e==null)return"";if(typeof e=="function")return _e(e,lr(e));if(typeof e=="string")return X(e);switch(e){case b:return X("Suspense");case E:return X("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case c:return ur(e.render);case O:return K(e.type,r,t);case j:{var i=e,p=i._payload,m=i._init;try{return K(m(p),r,t)}catch{}}}return""}var q=Object.prototype.hasOwnProperty,Ce={},we=A.ReactDebugCurrentFrame;function Z(e){if(e){var r=e._owner,t=K(e.type,e._source,r?r.type:null);we.setExtraStackFrame(t)}else we.setExtraStackFrame(null)}function cr(e,r,t,i,p){{var m=Function.call.bind(q);for(var d in e)if(m(e,d)){var f=void 0;try{if(typeof e[d]!="function"){var T=Error((i||"React class")+": "+t+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw T.name="Invariant Violation",T}f=e[d](r,d,i,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(y){f=y}f&&!(f instanceof Error)&&(Z(p),C("%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).",i||"React class",t,d,typeof f),Z(null)),f instanceof Error&&!(f.message in Ce)&&(Ce[f.message]=!0,Z(p),C("Failed %s type: %s",t,f.message),Z(null))}}}var fr=Array.isArray;function ne(e){return fr(e)}function dr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function vr(e){try{return Te(e),!1}catch{return!0}}function Te(e){return""+e}function Oe(e){if(vr(e))return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",dr(e)),Te(e)}var U=A.ReactCurrentOwner,pr={key:!0,ref:!0,__self:!0,__source:!0},Se,je,ae;ae={};function gr(e){if(q.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function mr(e){if(q.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function hr(e,r){if(typeof e.ref=="string"&&U.current&&r&&U.current.stateNode!==r){var t=x(U.current.type);ae[t]||(C('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',x(U.current.type),e.ref),ae[t]=!0)}}function Er(e,r){{var t=function(){Se||(Se=!0,C("%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)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function yr(e,r){{var t=function(){je||(je=!0,C("%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)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var Rr=function(e,r,t,i,p,m,d){var f={$$typeof:o,type:e,key:r,ref:t,props:d,_owner:m};return f._store={},Object.defineProperty(f._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(f,"_self",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.defineProperty(f,"_source",{configurable:!1,enumerable:!1,writable:!1,value:p}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f};function br(e,r,t,i,p){{var m,d={},f=null,T=null;t!==void 0&&(Oe(t),f=""+t),mr(r)&&(Oe(r.key),f=""+r.key),gr(r)&&(T=r.ref,hr(r,p));for(m in r)q.call(r,m)&&!pr.hasOwnProperty(m)&&(d[m]=r[m]);if(e&&e.defaultProps){var y=e.defaultProps;for(m in y)d[m]===void 0&&(d[m]=y[m])}if(f||T){var _=typeof e=="function"?e.displayName||e.name||"Unknown":e;f&&Er(d,_),T&&yr(d,_)}return Rr(e,f,T,p,i,U.current,d)}}var oe=A.ReactCurrentOwner,Pe=A.ReactDebugCurrentFrame;function M(e){if(e){var r=e._owner,t=K(e.type,e._source,r?r.type:null);Pe.setExtraStackFrame(t)}else Pe.setExtraStackFrame(null)}var ie;ie=!1;function se(e){return typeof e=="object"&&e!==null&&e.$$typeof===o}function ke(){{if(oe.current){var e=x(oe.current.type);if(e)return`
|
|
22
22
|
|
|
23
23
|
Check the render method of \``+e+"`."}return""}}function _r(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
|
|
24
24
|
|
|
25
25
|
Check your code at `+r+":"+t+"."}return""}}var Ae={};function Cr(e){{var r=ke();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
26
26
|
|
|
27
|
-
Check the top-level render call using <`+t+">.")}return r}}function xe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=Cr(r);if(Ae[t])return;Ae[t]=!0;var o="";e&&e._owner&&e._owner!==oe.current&&(o=" It was passed a child from "+x(e._owner.type)+"."),M(e),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,o),M(null)}}function De(e,r){{if(typeof e!="object")return;if(ne(e))for(var t=0;t<e.length;t++){var o=e[t];se(o)&&xe(o,r)}else if(se(e))e._store&&(e._store.validated=!0);else if(e){var p=G(e);if(typeof p=="function"&&p!==e.entries)for(var h=p.call(e),d;!(d=h.next()).done;)se(d.value)&&xe(d.value,r)}}}function wr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===c||r.$$typeof===O))t=r.propTypes;else return;if(t){var o=x(r);cr(t,e.props,"prop",o,e)}else if(r.PropTypes!==void 0&&!ie){ie=!0;var p=x(r);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",p||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Tr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var o=r[t];if(o!=="children"&&o!=="key"){M(e),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",o),M(null);break}}e.ref!==null&&(M(e),_("Invalid attribute `ref` supplied to `React.Fragment`."),M(null))}}function Fe(e,r,t,o,p,h){{var d=nr(e);if(!d){var f="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(f+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var T=_r(p);T?f+=T:f+=ke();var y;e===null?y="null":ne(e)?y="array":e!==void 0&&e.$$typeof===i?(y="<"+(x(e.type)||"Unknown")+" />",f=" Did you accidentally export a JSX literal instead of a component?"):y=typeof e,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",y,f)}var b=br(e,r,t,p,h);if(b==null)return b;if(d){var P=r.children;if(P!==void 0)if(o)if(ne(P)){for(var N=0;N<P.length;N++)De(P[N],e);Object.freeze&&Object.freeze(P)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else De(P,e)}return e===l?Tr(b):wr(b),b}}function Or(e,r,t){return Fe(e,r,t,!0)}function Sr(e,r,t){return Fe(e,r,t,!1)}var jr=Sr,Pr=Or;V.Fragment=l,V.jsx=jr,V.jsxs=Pr}()),V}process.env.NODE_ENV==="production"?$.exports=Le():$.exports=Me();var k=$.exports;const Y=m.createContext({axios:void 0,children:void 0,Navigate:void 0,Outlet:void 0,translate:void 0,useAuth:void 0,useLocation:void 0}),Ne=({axios:n,children:i,translate:s,useAuth:l,Outlet:a,Navigate:v,useLocation:u,useGoogleTagManager:g})=>{const c=m.useMemo(()=>({axios:n,Navigate:v,Outlet:a,translate:s,useAuth:l,useGoogleTagManager:g,useLocation:u}),[v,a,n,s,l,g,u]);return k.jsx(Y.Provider,{value:c,children:i})},B=n=>`RequireAuth require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,We=({Fallback:n,loginPath:i="/login",localStorageKey:s="user",redirect401Path:l="/login",...a})=>{var I,G,A,_;const{axios:v=a.axios,useLocation:u=a.useLocation,useAuth:g=a.useAuth,Outlet:c=a.Outlet,Navigate:C=a.Navigate}=m.useContext(Y);if(g===void 0)throw new Error(B("useAuth"));if(u===void 0)throw new Error(B("useLocation"));if(c===void 0)throw new Error(B("Outlet"));if(C===void 0)throw new Error(B("Navigate"));const[E,O]=m.useState(null),{isLogged:j}=g(),S=u(),F=m.useRef(!1);return m.useLayoutEffect(()=>{F.current||(F.current=!0,v==null||v.interceptors.response.use(w=>w,async w=>{var J;return typeof w=="object"&&w&&"response"in w&&w.response&&typeof w.response=="object"&&"status"in w.response&&w.response&&typeof w.response=="object"&&"status"in w.response&&((J=w==null?void 0:w.response)==null?void 0:J.status)===401&&(v.defaults.headers.common.Authorization=null,localStorage.removeItem(s),O(l)),Promise.reject(w)}))},[v==null?void 0:v.defaults.headers.common,v==null?void 0:v.interceptors.response,s,l]),j&&!E?k.jsx(m.Suspense,{fallback:n,children:(G=(I=S.state)==null?void 0:I.from)!=null&&G.state&&((_=(A=S.state)==null?void 0:A.from)==null?void 0:_.pathname)===i?k.jsx(C,{to:S.state.from.state.from.pathname+S.state.from.state.from.search,replace:!0}):k.jsx(c,{})}):k.jsx(C,{to:i,state:{from:S},replace:!0})},Q=n=>`GTMSendPageView require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ve=({...n})=>{const{useLocation:i=n.useLocation,Outlet:s=n.Outlet,useGoogleTagManager:l=n.useGoogleTagManager}=m.useContext(Y);if(i===void 0)throw new Error(Q("useLocation"));if(s===void 0)throw new Error(Q("Outlet"));if(l===void 0)throw new Error(Q("useGoogleTagManager"));const{pathname:a}=i(),{sendEvent:v}=l();return m.useEffect(()=>{v({event:"pageView",pathname:a})},[a,v]),k.jsx(s,{})},Ye=({axios:n,baseURL:i,tokenTypeKey:s="tokenType",userLocalStorageKey:l="user",tokenKey:a="accessToken",postContentType:v="application/json"})=>{if(!n.defaults)return null;const u=localStorage.getItem(l),g=u?JSON.parse(u):null,c=g!=null&&g[s]?g[s]:null,C=g!=null&&g[a]?g[a]:null,E=u?`${c} ${C}`:null;return n.defaults.baseURL=i,n.defaults.headers.post["Content-Type"]=v,E&&(n.defaults.headers.common.Authorization=E),null},ze=({i18n:n,debug:i,initReactI18next:s,resources:l,LanguageDetector:a})=>(n!=null&&n.isInitialized||(n.use(a).use(s).init({debug:i,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:!1,useSuspense:!0},resources:l,returnNull:!1}).then(()=>{document.documentElement.lang!==n.resolvedLanguage&&n.resolvedLanguage&&document.documentElement.setAttribute("lang",n.resolvedLanguage)}),n.on("languageChanged",v=>{document.documentElement.setAttribute("lang",v)})),null),Ue=({dsn:n,sentry:i,integrations:s,tracesSampleRate:l,routingInstrumentationDependencies:a,replaysSessionSampleRate:v,replaysOnErrorSampleRate:u,tracePropagationTargets:g,debug:c})=>((c||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&i.init({debug:c,dsn:n,integrations:[new i.BrowserTracing({routingInstrumentation:i.reactRouterV6Instrumentation(a.useEffect,a.useLocation,a.useNavigationType,a.createRoutesFromChildren,a.matchRoutes)}),i.replayIntegration(),...s||[]],replaysOnErrorSampleRate:u||1,replaysSessionSampleRate:v||.1,tracePropagationTargets:g,tracesSampleRate:l||1}),null),Be=({IMaskMixin:n,...i})=>{const s=m.useMemo(()=>n(({TextField:l,...a})=>k.jsx(l,{...a})),[n]);return k.jsx(s,{...i})},Ge=({mapbox:n,accessToken:i})=>(n&&i&&(n.accessToken=i),null),Je=({children:n,defaultOptions:i,QueryClient:s,QueryClientProvider:l})=>{const a=new s({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:3,...i}}});return k.jsx(l,{client:a,children:n})},Xe=n=>{const{unknownErrorTranslationKey:i="error.unknownError"}=n||{},{translate:s=n==null?void 0:n.translate}=m.useContext(Y);return{printError:m.useCallback(a=>{var g,c,C,E,O,j,S,F,I;const v=s?s(i):"Unknown error",{response:u}=a||{};return a!=null&&a.reason?String(a.reason):(g=u==null?void 0:u.data)!=null&&g.reason?String(u.data.reason):(c=u==null?void 0:u.data)!=null&&c.message?String(u.data.message):(E=(C=u==null?void 0:u.data)==null?void 0:C.detail)!=null&&E.length&&Array.isArray((O=u==null?void 0:u.data)==null?void 0:O.detail)&&((S=(j=u==null?void 0:u.data)==null?void 0:j.detail[0])!=null&&S.msg)&&typeof((I=(F=u==null?void 0:u.data)==null?void 0:F.detail[0])==null?void 0:I.msg)=="string"?String(u.data.detail[0].msg):v},[s,i])}},He=({data:n,fetchNextPage:i,isFetchingNextPage:s,isInitialLoading:l,isLoading:a,enabled:v=!0})=>{const u=m.useCallback(async c=>{s||!v||await i({pageParam:(c==null?void 0:c.pageParam)||c.visibleRowsCount})},[v,i,s]),g=m.useMemo(()=>{if(n)return n.pages.reduce((c,C)=>[...c,...C],[])},[n]);return{fetchNextPageOnRowsScrollEnd:u,isLoading:s||a,loadingVariant:l?"skeleton":"linear",rows:g}},Ke=n=>{const i=m.useCallback(({tokenType:l,accessToken:a})=>{n.defaults.headers.common.Authorization=`${l} ${a}`},[n.defaults.headers.common]);return{clearAuthenticationToken:m.useCallback(()=>{n.defaults.headers.common.Authorization=null},[n.defaults.headers.common]),setAuthenticationToken:i}},qe=n=>n.charAt(0).toUpperCase()+n.slice(1).toLowerCase(),Ze=n=>{const l=n.split("/").filter(a=>a.length>0).map(a=>a.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(c=>c.charAt(0).toUpperCase()+c.slice(1)).join("")).join("");return l.charAt(0).toLowerCase()+l.slice(1)},$e=(n,i,s)=>{const l=Ze(i),a=qe(s);return`${l}${a}`},Qe=n=>{if(n)return(n==null?void 0:n.reduce((i,s)=>(i[s]={query:{useInfinite:!0,useInfiniteQueryParam:"offset"}},i),{}))||{}},er=n=>{const{input:i="./openapi.json",operationsToGenerateInfiniteQueryHook:s=void 0}=n||{};return{api:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:i,output:{client:"react-query",mode:"tags-split",override:{header:l=>["Generated by orval 🍺",...l.title?[l.title]:[],...l.description?[l.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/config/orval/mutator/axiosCustomInstance.ts`},operationName:$e,...(s==null?void 0:s.length)&&{operations:Qe(s)},query:{useQuery:!0}},schemas:"src/api/model",target:"src/api/services/api.ts"}}}};R.AxiosConfig=Ye,R.GTMSendPageView=Ve,R.I18nConfig=ze,R.InjectDependenciesContext=Y,R.InjectDependenciesProvider=Ne,R.MapBoxConfig=Ge,R.MaskTextField=Be,R.QueryClientConfigProvider=Je,R.RequireAuth=We,R.SentryConfig=Ue,R.getOrvalConfig=er,R.useAuth=Ke,R.useInfiniteDataGrid=He,R.useResponseError=Xe,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
|
|
27
|
+
Check the top-level render call using <`+t+">.")}return r}}function xe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=Cr(r);if(Ae[t])return;Ae[t]=!0;var i="";e&&e._owner&&e._owner!==oe.current&&(i=" It was passed a child from "+x(e._owner.type)+"."),M(e),C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,i),M(null)}}function De(e,r){{if(typeof e!="object")return;if(ne(e))for(var t=0;t<e.length;t++){var i=e[t];se(i)&&xe(i,r)}else if(se(e))e._store&&(e._store.validated=!0);else if(e){var p=G(e);if(typeof p=="function"&&p!==e.entries)for(var m=p.call(e),d;!(d=m.next()).done;)se(d.value)&&xe(d.value,r)}}}function wr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===c||r.$$typeof===O))t=r.propTypes;else return;if(t){var i=x(r);cr(t,e.props,"prop",i,e)}else if(r.PropTypes!==void 0&&!ie){ie=!0;var p=x(r);C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",p||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Tr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var i=r[t];if(i!=="children"&&i!=="key"){M(e),C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",i),M(null);break}}e.ref!==null&&(M(e),C("Invalid attribute `ref` supplied to `React.Fragment`."),M(null))}}function Fe(e,r,t,i,p,m){{var d=nr(e);if(!d){var f="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(f+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var T=_r(p);T?f+=T:f+=ke();var y;e===null?y="null":ne(e)?y="array":e!==void 0&&e.$$typeof===o?(y="<"+(x(e.type)||"Unknown")+" />",f=" Did you accidentally export a JSX literal instead of a component?"):y=typeof e,C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",y,f)}var _=br(e,r,t,p,m);if(_==null)return _;if(d){var P=r.children;if(P!==void 0)if(i)if(ne(P)){for(var N=0;N<P.length;N++)De(P[N],e);Object.freeze&&Object.freeze(P)}else C("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else De(P,e)}return e===l?Tr(_):wr(_),_}}function Or(e,r,t){return Fe(e,r,t,!0)}function Sr(e,r,t){return Fe(e,r,t,!1)}var jr=Sr,Pr=Or;V.Fragment=l,V.jsx=jr,V.jsxs=Pr}()),V}process.env.NODE_ENV==="production"?$.exports=Le():$.exports=Me();var k=$.exports;const Y=h.createContext({axios:void 0,children:void 0,Navigate:void 0,Outlet:void 0,translate:void 0,useAuth:void 0,useLocation:void 0}),Ne=({axios:n,children:o,translate:s,useAuth:l,Outlet:a,Navigate:v,useLocation:u,useGoogleTagManager:g})=>{const c=h.useMemo(()=>({axios:n,Navigate:v,Outlet:a,translate:s,useAuth:l,useGoogleTagManager:g,useLocation:u}),[v,a,n,s,l,g,u]);return k.jsx(Y.Provider,{value:c,children:o})},B=n=>`RequireAuth require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,We=({Fallback:n,loginPath:o="/login",localStorageKey:s="user",redirect401Path:l="/login",...a})=>{var I,G,A,C;const{axios:v=a.axios,useLocation:u=a.useLocation,useAuth:g=a.useAuth,Outlet:c=a.Outlet,Navigate:b=a.Navigate}=h.useContext(Y);if(g===void 0)throw new Error(B("useAuth"));if(u===void 0)throw new Error(B("useLocation"));if(c===void 0)throw new Error(B("Outlet"));if(b===void 0)throw new Error(B("Navigate"));const[E,O]=h.useState(null),{isLogged:j}=g(),S=u(),F=h.useRef(!1);return h.useLayoutEffect(()=>{F.current||(F.current=!0,v==null||v.interceptors.response.use(w=>w,async w=>{var J;return typeof w=="object"&&w&&"response"in w&&w.response&&typeof w.response=="object"&&"status"in w.response&&w.response&&typeof w.response=="object"&&"status"in w.response&&((J=w==null?void 0:w.response)==null?void 0:J.status)===401&&(v.defaults.headers.common.Authorization=null,localStorage.removeItem(s),O(l)),Promise.reject(w)}))},[v==null?void 0:v.defaults.headers.common,v==null?void 0:v.interceptors.response,s,l]),j&&!E?k.jsx(h.Suspense,{fallback:n,children:(G=(I=S.state)==null?void 0:I.from)!=null&&G.state&&((C=(A=S.state)==null?void 0:A.from)==null?void 0:C.pathname)===o?k.jsx(b,{to:S.state.from.state.from.pathname+S.state.from.state.from.search,replace:!0}):k.jsx(c,{})}):k.jsx(b,{to:o,state:{from:S},replace:!0})},Q=n=>`GTMSendPageView require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ve=({...n})=>{const{useLocation:o=n.useLocation,Outlet:s=n.Outlet,useGoogleTagManager:l=n.useGoogleTagManager}=h.useContext(Y);if(o===void 0)throw new Error(Q("useLocation"));if(s===void 0)throw new Error(Q("Outlet"));if(l===void 0)throw new Error(Q("useGoogleTagManager"));const{pathname:a}=o(),{sendEvent:v}=l();return h.useEffect(()=>{v({event:"pageView",pathname:a})},[a,v]),k.jsx(s,{})},Ye=({axios:n,baseURL:o,tokenTypeKey:s="tokenType",userLocalStorageKey:l="user",tokenKey:a="accessToken",postContentType:v="application/json"})=>{if(!n.defaults)return null;const u=localStorage.getItem(l),g=u?JSON.parse(u):null,c=g!=null&&g[s]?g[s]:null,b=g!=null&&g[a]?g[a]:null,E=u?`${c} ${b}`:null;return n.defaults.baseURL=o,n.defaults.headers.post["Content-Type"]=v,E&&(n.defaults.headers.common.Authorization=E),null},ze=({i18n:n,debug:o,initReactI18next:s,resources:l,LanguageDetector:a})=>(n!=null&&n.isInitialized||(n.use(a).use(s).init({debug:o,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:!1,useSuspense:!0},resources:l,returnNull:!1}).then(()=>{document.documentElement.lang!==n.resolvedLanguage&&n.resolvedLanguage&&document.documentElement.setAttribute("lang",n.resolvedLanguage)}),n.on("languageChanged",v=>{document.documentElement.setAttribute("lang",v)})),null),Ue=({dsn:n,sentry:o,integrations:s,tracesSampleRate:l,routingInstrumentationDependencies:a,replaysSessionSampleRate:v,replaysOnErrorSampleRate:u,tracePropagationTargets:g,ignoreErrors:c,debug:b})=>(o.isInitialized()||(b||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&o.init({debug:b,dsn:n,ignoreErrors:c||[/Failed to fetch dynamically imported module/],integrations:[new o.BrowserTracing({routingInstrumentation:o.reactRouterV6Instrumentation(a.useEffect,a.useLocation,a.useNavigationType,a.createRoutesFromChildren,a.matchRoutes)}),o.replayIntegration(),...s||[]],replaysOnErrorSampleRate:u||1,replaysSessionSampleRate:v||.1,tracePropagationTargets:g,tracesSampleRate:l||1}),null),Be=({IMaskMixin:n,...o})=>{const s=h.useMemo(()=>n(({TextField:l,...a})=>k.jsx(l,{...a})),[n]);return k.jsx(s,{...o})},Ge=({mapbox:n,accessToken:o})=>(n&&o&&(n.accessToken=o),null),Je=({children:n,defaultOptions:o,QueryClient:s,QueryClientProvider:l})=>{const a=new s({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:3,...o}}});return k.jsx(l,{client:a,children:n})},Xe=n=>{const{unknownErrorTranslationKey:o="error.unknownError"}=n||{},{translate:s=n==null?void 0:n.translate}=h.useContext(Y);return{printError:h.useCallback(a=>{var g,c,b,E,O,j,S,F,I;const v=s?s(o):"Unknown error",{response:u}=a||{};return a!=null&&a.reason?String(a.reason):(g=u==null?void 0:u.data)!=null&&g.reason?String(u.data.reason):(c=u==null?void 0:u.data)!=null&&c.message?String(u.data.message):(E=(b=u==null?void 0:u.data)==null?void 0:b.detail)!=null&&E.length&&Array.isArray((O=u==null?void 0:u.data)==null?void 0:O.detail)&&((S=(j=u==null?void 0:u.data)==null?void 0:j.detail[0])!=null&&S.msg)&&typeof((I=(F=u==null?void 0:u.data)==null?void 0:F.detail[0])==null?void 0:I.msg)=="string"?String(u.data.detail[0].msg):v},[s,o])}},He=({data:n,fetchNextPage:o,isFetchingNextPage:s,isInitialLoading:l,isLoading:a,enabled:v=!0})=>{const u=h.useCallback(async c=>{s||!v||await o({pageParam:(c==null?void 0:c.pageParam)||c.visibleRowsCount})},[v,o,s]),g=h.useMemo(()=>{if(n)return n.pages.reduce((c,b)=>[...c,...b],[])},[n]);return{fetchNextPageOnRowsScrollEnd:u,isLoading:s||a,loadingVariant:l?"skeleton":"linear",rows:g}},Ke=n=>{const o=h.useCallback(({tokenType:l,accessToken:a})=>{n.defaults.headers.common.Authorization=`${l} ${a}`},[n.defaults.headers.common]);return{clearAuthenticationToken:h.useCallback(()=>{n.defaults.headers.common.Authorization=null},[n.defaults.headers.common]),setAuthenticationToken:o}},qe=n=>n.charAt(0).toUpperCase()+n.slice(1).toLowerCase(),Ze=n=>{const l=n.split("/").filter(a=>a.length>0).map(a=>a.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(c=>c.charAt(0).toUpperCase()+c.slice(1)).join("")).join("");return l.charAt(0).toLowerCase()+l.slice(1)},$e=(n,o,s)=>{const l=Ze(o),a=qe(s);return`${l}${a}`},Qe=n=>{if(n)return(n==null?void 0:n.reduce((o,s)=>(o[s]={query:{useInfinite:!0,useInfiniteQueryParam:"offset"}},o),{}))||{}},er=n=>{const{input:o="./openapi.json",operationsToGenerateInfiniteQueryHook:s=void 0}=n||{};return{api:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:o,output:{client:"react-query",mode:"tags-split",override:{header:l=>["Generated by orval 🍺",...l.title?[l.title]:[],...l.description?[l.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/config/orval/mutator/axiosCustomInstance.ts`},operationName:$e,...(s==null?void 0:s.length)&&{operations:Qe(s)},query:{useQuery:!0}},schemas:"src/api/model",target:"src/api/services/api.ts"}}}};R.AxiosConfig=Ye,R.GTMSendPageView=Ve,R.I18nConfig=ze,R.InjectDependenciesContext=Y,R.InjectDependenciesProvider=Ne,R.MapBoxConfig=Ge,R.MaskTextField=Be,R.QueryClientConfigProvider=Je,R.RequireAuth=We,R.SentryConfig=Ue,R.getOrvalConfig=er,R.useAuth=Ke,R.useInfiniteDataGrid=He,R.useResponseError=Xe,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
|