@tracktor/shared-module 0.23.3 → 0.23.4
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 -2
- package/dist/context/QueryClientConfigProvider.d.ts +9 -2
- package/dist/main.js +102 -97
- package/dist/main.umd.cjs +6 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,10 @@ interface QueryClientConfigProviderProps<T> extends PropsWithChildren {
|
|
|
9
9
|
queries: {
|
|
10
10
|
refetchOnWindowFocus: boolean;
|
|
11
11
|
retry: number;
|
|
12
|
+
getNextPageParam: (lastPage: [], allPages: [], lastPageParam: number) => number;
|
|
13
|
+
};
|
|
14
|
+
mutations: {
|
|
15
|
+
[key: string]: any;
|
|
12
16
|
};
|
|
13
17
|
};
|
|
14
18
|
}): T;
|
|
@@ -23,7 +27,10 @@ interface QueryClientConfigProviderProps<T> extends PropsWithChildren {
|
|
|
23
27
|
/**
|
|
24
28
|
* Default options for queries
|
|
25
29
|
*/
|
|
26
|
-
|
|
30
|
+
defaultQueriesOptions?: {
|
|
31
|
+
[key: string]: any;
|
|
32
|
+
};
|
|
33
|
+
defaultMutationsOptions?: {
|
|
27
34
|
[key: string]: any;
|
|
28
35
|
};
|
|
29
36
|
}
|
|
@@ -35,5 +42,5 @@ interface QueryClientConfigProviderProps<T> extends PropsWithChildren {
|
|
|
35
42
|
* @param QueryClientProvider
|
|
36
43
|
* @constructor
|
|
37
44
|
*/
|
|
38
|
-
declare const QueryClientConfigProvider: <T extends unknown>({ children,
|
|
45
|
+
declare const QueryClientConfigProvider: <T extends unknown>({ children, defaultQueriesOptions, defaultMutationsOptions, QueryClient, QueryClientProvider, }: QueryClientConfigProviderProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
39
46
|
export default QueryClientConfigProvider;
|
package/dist/main.js
CHANGED
|
@@ -12,7 +12,7 @@ var ue = { exports: {} }, M = {};
|
|
|
12
12
|
var Fe;
|
|
13
13
|
function br() {
|
|
14
14
|
return Fe || (Fe = 1, process.env.NODE_ENV !== "production" && function() {
|
|
15
|
-
var t = Ne, o = Symbol.for("react.element"), i = Symbol.for("react.portal"), u = Symbol.for("react.fragment"), c = Symbol.for("react.strict_mode"),
|
|
15
|
+
var t = Ne, o = Symbol.for("react.element"), i = Symbol.for("react.portal"), u = Symbol.for("react.fragment"), c = Symbol.for("react.strict_mode"), d = Symbol.for("react.profiler"), m = Symbol.for("react.provider"), n = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), E = 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"), k = Symbol.iterator, $ = "@@iterator";
|
|
16
16
|
function D(e) {
|
|
17
17
|
if (e === null || typeof e != "object")
|
|
18
18
|
return null;
|
|
@@ -31,8 +31,8 @@ function br() {
|
|
|
31
31
|
{
|
|
32
32
|
var s = j.ReactDebugCurrentFrame, p = s.getStackAddendum();
|
|
33
33
|
p !== "" && (r += "%s", a = a.concat([p]));
|
|
34
|
-
var g = a.map(function(
|
|
35
|
-
return String(
|
|
34
|
+
var g = a.map(function(v) {
|
|
35
|
+
return String(v);
|
|
36
36
|
});
|
|
37
37
|
g.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, g);
|
|
38
38
|
}
|
|
@@ -40,7 +40,7 @@ function br() {
|
|
|
40
40
|
var ce = !1, le = !1, U = !1, We = !1, Me = !1, fe;
|
|
41
41
|
fe = Symbol.for("react.module.reference");
|
|
42
42
|
function Ve(e) {
|
|
43
|
-
return !!(typeof e == "string" || typeof e == "function" || e === u || e ===
|
|
43
|
+
return !!(typeof e == "string" || typeof e == "function" || e === u || e === d || Me || e === c || e === E || e === h || We || e === T || ce || le || U || typeof e == "object" && e !== null && (e.$$typeof === O || e.$$typeof === C || e.$$typeof === m || e.$$typeof === n || e.$$typeof === l || // This needs to include all possible module reference object
|
|
44
44
|
// types supported by any Flight configuration anywhere since
|
|
45
45
|
// we don't know which Flight build this will end up being used
|
|
46
46
|
// with.
|
|
@@ -68,13 +68,13 @@ function br() {
|
|
|
68
68
|
return "Fragment";
|
|
69
69
|
case i:
|
|
70
70
|
return "Portal";
|
|
71
|
-
case
|
|
71
|
+
case d:
|
|
72
72
|
return "Profiler";
|
|
73
73
|
case c:
|
|
74
74
|
return "StrictMode";
|
|
75
|
-
case
|
|
75
|
+
case E:
|
|
76
76
|
return "Suspense";
|
|
77
|
-
case
|
|
77
|
+
case h:
|
|
78
78
|
return "SuspenseList";
|
|
79
79
|
}
|
|
80
80
|
if (typeof e == "object")
|
|
@@ -82,7 +82,7 @@ function br() {
|
|
|
82
82
|
case n:
|
|
83
83
|
var r = e;
|
|
84
84
|
return de(r) + ".Consumer";
|
|
85
|
-
case
|
|
85
|
+
case m:
|
|
86
86
|
var a = e;
|
|
87
87
|
return de(a._context) + ".Provider";
|
|
88
88
|
case l:
|
|
@@ -91,9 +91,9 @@ function br() {
|
|
|
91
91
|
var s = e.displayName || null;
|
|
92
92
|
return s !== null ? s : P(e.type) || "Memo";
|
|
93
93
|
case O: {
|
|
94
|
-
var p = e, g = p._payload,
|
|
94
|
+
var p = e, g = p._payload, v = p._init;
|
|
95
95
|
try {
|
|
96
|
-
return P(
|
|
96
|
+
return P(v(g));
|
|
97
97
|
} catch {
|
|
98
98
|
return null;
|
|
99
99
|
}
|
|
@@ -198,27 +198,27 @@ function br() {
|
|
|
198
198
|
g = Z.current, Z.current = null, qe();
|
|
199
199
|
try {
|
|
200
200
|
if (r) {
|
|
201
|
-
var
|
|
201
|
+
var v = function() {
|
|
202
202
|
throw Error();
|
|
203
203
|
};
|
|
204
|
-
if (Object.defineProperty(
|
|
204
|
+
if (Object.defineProperty(v.prototype, "props", {
|
|
205
205
|
set: function() {
|
|
206
206
|
throw Error();
|
|
207
207
|
}
|
|
208
208
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
209
209
|
try {
|
|
210
|
-
Reflect.construct(
|
|
210
|
+
Reflect.construct(v, []);
|
|
211
211
|
} catch (A) {
|
|
212
212
|
s = A;
|
|
213
213
|
}
|
|
214
|
-
Reflect.construct(e, [],
|
|
214
|
+
Reflect.construct(e, [], v);
|
|
215
215
|
} else {
|
|
216
216
|
try {
|
|
217
|
-
|
|
217
|
+
v.call();
|
|
218
218
|
} catch (A) {
|
|
219
219
|
s = A;
|
|
220
220
|
}
|
|
221
|
-
e.call(
|
|
221
|
+
e.call(v.prototype);
|
|
222
222
|
}
|
|
223
223
|
} else {
|
|
224
224
|
try {
|
|
@@ -268,9 +268,9 @@ function br() {
|
|
|
268
268
|
if (typeof e == "string")
|
|
269
269
|
return z(e);
|
|
270
270
|
switch (e) {
|
|
271
|
-
case
|
|
271
|
+
case E:
|
|
272
272
|
return z("Suspense");
|
|
273
|
-
case
|
|
273
|
+
case h:
|
|
274
274
|
return z("SuspenseList");
|
|
275
275
|
}
|
|
276
276
|
if (typeof e == "object")
|
|
@@ -300,19 +300,19 @@ function br() {
|
|
|
300
300
|
function Je(e, r, a, s, p) {
|
|
301
301
|
{
|
|
302
302
|
var g = Function.call.bind(J);
|
|
303
|
-
for (var
|
|
304
|
-
if (g(e,
|
|
303
|
+
for (var v in e)
|
|
304
|
+
if (g(e, v)) {
|
|
305
305
|
var f = void 0;
|
|
306
306
|
try {
|
|
307
|
-
if (typeof e[
|
|
308
|
-
var w = Error((s || "React class") + ": " + a + " type `" +
|
|
307
|
+
if (typeof e[v] != "function") {
|
|
308
|
+
var w = Error((s || "React class") + ": " + a + " type `" + v + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[v] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
309
309
|
throw w.name = "Invariant Violation", w;
|
|
310
310
|
}
|
|
311
|
-
f = e[
|
|
311
|
+
f = e[v](r, v, s, a, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
312
312
|
} catch (y) {
|
|
313
313
|
f = y;
|
|
314
314
|
}
|
|
315
|
-
f && !(f instanceof Error) && (X(p), R("%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).", s || "React class", a,
|
|
315
|
+
f && !(f instanceof Error) && (X(p), R("%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).", s || "React class", a, v, typeof f), X(null)), f instanceof Error && !(f.message in _e) && (_e[f.message] = !0, X(p), R("Failed %s type: %s", a, f.message), X(null));
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
}
|
|
@@ -391,7 +391,7 @@ function br() {
|
|
|
391
391
|
});
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
|
-
var ar = function(e, r, a, s, p, g,
|
|
394
|
+
var ar = function(e, r, a, s, p, g, v) {
|
|
395
395
|
var f = {
|
|
396
396
|
// This tag allows us to uniquely identify this as a React Element
|
|
397
397
|
$$typeof: o,
|
|
@@ -399,7 +399,7 @@ function br() {
|
|
|
399
399
|
type: e,
|
|
400
400
|
key: r,
|
|
401
401
|
ref: a,
|
|
402
|
-
props:
|
|
402
|
+
props: v,
|
|
403
403
|
// Record the component responsible for creating this element.
|
|
404
404
|
_owner: g
|
|
405
405
|
};
|
|
@@ -422,20 +422,20 @@ function br() {
|
|
|
422
422
|
};
|
|
423
423
|
function or(e, r, a, s, p) {
|
|
424
424
|
{
|
|
425
|
-
var g,
|
|
425
|
+
var g, v = {}, f = null, w = null;
|
|
426
426
|
a !== void 0 && (Te(a), f = "" + a), er(r) && (Te(r.key), f = "" + r.key), Qe(r) && (w = r.ref, rr(r, p));
|
|
427
427
|
for (g in r)
|
|
428
|
-
J.call(r, g) && !Ze.hasOwnProperty(g) && (
|
|
428
|
+
J.call(r, g) && !Ze.hasOwnProperty(g) && (v[g] = r[g]);
|
|
429
429
|
if (e && e.defaultProps) {
|
|
430
430
|
var y = e.defaultProps;
|
|
431
431
|
for (g in y)
|
|
432
|
-
|
|
432
|
+
v[g] === void 0 && (v[g] = y[g]);
|
|
433
433
|
}
|
|
434
434
|
if (f || w) {
|
|
435
435
|
var b = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
436
|
-
f && tr(
|
|
436
|
+
f && tr(v, b), w && nr(v, b);
|
|
437
437
|
}
|
|
438
|
-
return ar(e, f, w, p, s, W.current,
|
|
438
|
+
return ar(e, f, w, p, s, W.current, v);
|
|
439
439
|
}
|
|
440
440
|
}
|
|
441
441
|
var ne = j.ReactCurrentOwner, je = j.ReactDebugCurrentFrame;
|
|
@@ -514,8 +514,8 @@ Check the top-level render call using <` + a + ">.");
|
|
|
514
514
|
else if (e) {
|
|
515
515
|
var p = D(e);
|
|
516
516
|
if (typeof p == "function" && p !== e.entries)
|
|
517
|
-
for (var g = p.call(e),
|
|
518
|
-
oe(
|
|
517
|
+
for (var g = p.call(e), v; !(v = g.next()).done; )
|
|
518
|
+
oe(v.value) && xe(v.value, r);
|
|
519
519
|
}
|
|
520
520
|
}
|
|
521
521
|
}
|
|
@@ -558,8 +558,8 @@ Check the top-level render call using <` + a + ">.");
|
|
|
558
558
|
}
|
|
559
559
|
function $e(e, r, a, s, p, g) {
|
|
560
560
|
{
|
|
561
|
-
var
|
|
562
|
-
if (!
|
|
561
|
+
var v = Ve(e);
|
|
562
|
+
if (!v) {
|
|
563
563
|
var f = "";
|
|
564
564
|
(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.");
|
|
565
565
|
var w = ir(p);
|
|
@@ -570,7 +570,7 @@ Check the top-level render call using <` + a + ">.");
|
|
|
570
570
|
var b = or(e, r, a, p, g);
|
|
571
571
|
if (b == null)
|
|
572
572
|
return b;
|
|
573
|
-
if (
|
|
573
|
+
if (v) {
|
|
574
574
|
var S = r.children;
|
|
575
575
|
if (S !== void 0)
|
|
576
576
|
if (s)
|
|
@@ -611,18 +611,18 @@ function Rr() {
|
|
|
611
611
|
if (Le)
|
|
612
612
|
return V;
|
|
613
613
|
Le = 1;
|
|
614
|
-
var t = Ne, o = Symbol.for("react.element"), i = Symbol.for("react.fragment"), u = Object.prototype.hasOwnProperty, c = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,
|
|
615
|
-
function
|
|
616
|
-
var
|
|
617
|
-
|
|
618
|
-
for (
|
|
619
|
-
u.call(l,
|
|
614
|
+
var t = Ne, o = Symbol.for("react.element"), i = Symbol.for("react.fragment"), u = Object.prototype.hasOwnProperty, c = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, d = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
615
|
+
function m(n, l, E) {
|
|
616
|
+
var h, C = {}, O = null, T = null;
|
|
617
|
+
E !== void 0 && (O = "" + E), l.key !== void 0 && (O = "" + l.key), l.ref !== void 0 && (T = l.ref);
|
|
618
|
+
for (h in l)
|
|
619
|
+
u.call(l, h) && !d.hasOwnProperty(h) && (C[h] = l[h]);
|
|
620
620
|
if (n && n.defaultProps)
|
|
621
|
-
for (
|
|
622
|
-
C[
|
|
621
|
+
for (h in l = n.defaultProps, l)
|
|
622
|
+
C[h] === void 0 && (C[h] = l[h]);
|
|
623
623
|
return { $$typeof: o, type: n, key: O, ref: T, props: C, _owner: c.current };
|
|
624
624
|
}
|
|
625
|
-
return V.Fragment = i, V.jsx =
|
|
625
|
+
return V.Fragment = i, V.jsx = m, V.jsxs = m, V;
|
|
626
626
|
}
|
|
627
627
|
process.env.NODE_ENV === "production" ? ue.exports = Rr() : ue.exports = br();
|
|
628
628
|
var x = ue.exports;
|
|
@@ -641,25 +641,25 @@ const q = pr({
|
|
|
641
641
|
translate: i,
|
|
642
642
|
useAuth: u,
|
|
643
643
|
Outlet: c,
|
|
644
|
-
Navigate:
|
|
645
|
-
useLocation:
|
|
644
|
+
Navigate: d,
|
|
645
|
+
useLocation: m,
|
|
646
646
|
useGoogleTagManager: n,
|
|
647
647
|
apiURL: l
|
|
648
648
|
}) => {
|
|
649
|
-
const
|
|
649
|
+
const E = se(
|
|
650
650
|
() => ({
|
|
651
651
|
apiURL: l,
|
|
652
652
|
axios: t,
|
|
653
|
-
Navigate:
|
|
653
|
+
Navigate: d,
|
|
654
654
|
Outlet: c,
|
|
655
655
|
translate: i,
|
|
656
656
|
useAuth: u,
|
|
657
657
|
useGoogleTagManager: n,
|
|
658
|
-
useLocation:
|
|
658
|
+
useLocation: m
|
|
659
659
|
}),
|
|
660
|
-
[
|
|
660
|
+
[d, c, l, t, i, u, n, m]
|
|
661
661
|
);
|
|
662
|
-
return /* @__PURE__ */ x.jsx(q.Provider, { value:
|
|
662
|
+
return /* @__PURE__ */ x.jsx(q.Provider, { value: E, children: o });
|
|
663
663
|
}, H = (t) => `RequireAuth require « ${t} » dependency. You can provide with InjectDependenciesProvider or directly in props.`, Ar = ({
|
|
664
664
|
Fallback: t,
|
|
665
665
|
loginPath: o = "/login",
|
|
@@ -669,30 +669,30 @@ const q = pr({
|
|
|
669
669
|
}) => {
|
|
670
670
|
var $, D, j, R;
|
|
671
671
|
const {
|
|
672
|
-
axios:
|
|
673
|
-
useLocation:
|
|
672
|
+
axios: d = c.axios,
|
|
673
|
+
useLocation: m = c.useLocation,
|
|
674
674
|
useAuth: n = c.useAuth,
|
|
675
675
|
Outlet: l = c.Outlet,
|
|
676
|
-
Navigate:
|
|
676
|
+
Navigate: E = c.Navigate
|
|
677
677
|
} = K(q);
|
|
678
678
|
if (n === void 0)
|
|
679
679
|
throw new Error(H("useAuth"));
|
|
680
|
-
if (
|
|
680
|
+
if (m === void 0)
|
|
681
681
|
throw new Error(H("useLocation"));
|
|
682
682
|
if (l === void 0)
|
|
683
683
|
throw new Error(H("Outlet"));
|
|
684
|
-
if (
|
|
684
|
+
if (E === void 0)
|
|
685
685
|
throw new Error(H("Navigate"));
|
|
686
|
-
const [
|
|
686
|
+
const [h, C] = gr(null), { isLogged: O } = n(), T = m(), k = mr(!1);
|
|
687
687
|
return hr(() => {
|
|
688
|
-
k.current || (k.current = !0,
|
|
688
|
+
k.current || (k.current = !0, d == null || d.interceptors.response.use(
|
|
689
689
|
(_) => _,
|
|
690
690
|
async (_) => {
|
|
691
691
|
var U;
|
|
692
|
-
return typeof _ == "object" && _ && "response" in _ && _.response && typeof _.response == "object" && "status" in _.response && _.response && typeof _.response == "object" && "status" in _.response && ((U = _ == null ? void 0 : _.response) == null ? void 0 : U.status) === 401 && (
|
|
692
|
+
return typeof _ == "object" && _ && "response" in _ && _.response && typeof _.response == "object" && "status" in _.response && _.response && typeof _.response == "object" && "status" in _.response && ((U = _ == null ? void 0 : _.response) == null ? void 0 : U.status) === 401 && (d.defaults.headers.common.Authorization = null, localStorage.removeItem(i), C(u)), Promise.reject(_);
|
|
693
693
|
}
|
|
694
694
|
));
|
|
695
|
-
}, [
|
|
695
|
+
}, [d == null ? void 0 : d.defaults.headers.common, d == null ? void 0 : d.interceptors.response, i, u]), O && !h ? /* @__PURE__ */ x.jsx(Er, { fallback: t, children: (D = ($ = T.state) == null ? void 0 : $.from) != null && D.state && ((R = (j = T.state) == null ? void 0 : j.from) == null ? void 0 : R.pathname) === o ? /* @__PURE__ */ x.jsx(E, { to: T.state.from.state.from.pathname + T.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ x.jsx(l, {}) }) : /* @__PURE__ */ x.jsx(E, { to: o, state: { from: T }, replace: !0 });
|
|
696
696
|
}, ie = (t) => `GTMSendPageView require « ${t} » dependency. You can provide with InjectDependenciesProvider or directly in props.`, xr = ({ ...t }) => {
|
|
697
697
|
const {
|
|
698
698
|
useLocation: o = t.useLocation,
|
|
@@ -705,22 +705,22 @@ const q = pr({
|
|
|
705
705
|
throw new Error(ie("Outlet"));
|
|
706
706
|
if (u === void 0)
|
|
707
707
|
throw new Error(ie("useGoogleTagManager"));
|
|
708
|
-
const { pathname: c } = o(), { sendEvent:
|
|
708
|
+
const { pathname: c } = o(), { sendEvent: d } = u();
|
|
709
709
|
return yr(() => {
|
|
710
|
-
|
|
711
|
-
}, [c,
|
|
710
|
+
d({ event: "pageView", pathname: c });
|
|
711
|
+
}, [c, d]), /* @__PURE__ */ x.jsx(i, {});
|
|
712
712
|
}, kr = ({
|
|
713
713
|
axios: t,
|
|
714
714
|
baseURL: o,
|
|
715
715
|
tokenTypeKey: i = "tokenType",
|
|
716
716
|
userLocalStorageKey: u = "user",
|
|
717
717
|
tokenKey: c = "accessToken",
|
|
718
|
-
postContentType:
|
|
718
|
+
postContentType: d = "application/json"
|
|
719
719
|
}) => {
|
|
720
720
|
if (!t.defaults)
|
|
721
721
|
return null;
|
|
722
|
-
const
|
|
723
|
-
return t.defaults.baseURL = o, t.defaults.headers.post["Content-Type"] =
|
|
722
|
+
const m = localStorage.getItem(u), n = m ? JSON.parse(m) : null, l = n != null && n[i] ? n[i] : null, E = n != null && n[c] ? n[c] : null, h = m ? `${l} ${E}` : null;
|
|
723
|
+
return t.defaults.baseURL = o, t.defaults.headers.post["Content-Type"] = d, h && (t.defaults.headers.common.Authorization = h), null;
|
|
724
724
|
}, $r = ({
|
|
725
725
|
i18n: t,
|
|
726
726
|
debug: o,
|
|
@@ -742,24 +742,24 @@ const q = pr({
|
|
|
742
742
|
returnNull: !1
|
|
743
743
|
}).then(() => {
|
|
744
744
|
document.documentElement.lang !== t.resolvedLanguage && t.resolvedLanguage && document.documentElement.setAttribute("lang", t.resolvedLanguage);
|
|
745
|
-
}), t.on("languageChanged", (
|
|
746
|
-
document.documentElement.setAttribute("lang",
|
|
745
|
+
}), t.on("languageChanged", (d) => {
|
|
746
|
+
document.documentElement.setAttribute("lang", d);
|
|
747
747
|
})), null), Dr = ({
|
|
748
748
|
dsn: t,
|
|
749
749
|
sentry: o,
|
|
750
750
|
integrations: i,
|
|
751
751
|
tracesSampleRate: u,
|
|
752
752
|
routingInstrumentationDependencies: c,
|
|
753
|
-
replaysSessionSampleRate:
|
|
754
|
-
replaysOnErrorSampleRate:
|
|
753
|
+
replaysSessionSampleRate: d,
|
|
754
|
+
replaysOnErrorSampleRate: m,
|
|
755
755
|
tracePropagationTargets: n,
|
|
756
756
|
ignoreErrors: l,
|
|
757
|
-
debug:
|
|
758
|
-
environment:
|
|
759
|
-
}) => (o.isInitialized() || (
|
|
760
|
-
debug:
|
|
757
|
+
debug: E,
|
|
758
|
+
environment: h
|
|
759
|
+
}) => (o.isInitialized() || (E || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") && o.init({
|
|
760
|
+
debug: E,
|
|
761
761
|
dsn: t,
|
|
762
|
-
environment:
|
|
762
|
+
environment: h || "production",
|
|
763
763
|
ignoreErrors: [...l || [], /dynamically imported module/],
|
|
764
764
|
integrations: [
|
|
765
765
|
new o.BrowserTracing({
|
|
@@ -774,8 +774,8 @@ const q = pr({
|
|
|
774
774
|
o.replayIntegration(),
|
|
775
775
|
...i || []
|
|
776
776
|
],
|
|
777
|
-
replaysOnErrorSampleRate:
|
|
778
|
-
replaysSessionSampleRate:
|
|
777
|
+
replaysOnErrorSampleRate: m || 1,
|
|
778
|
+
replaysSessionSampleRate: d || 0.1,
|
|
779
779
|
tracePropagationTargets: n,
|
|
780
780
|
tracesSampleRate: u || 1
|
|
781
781
|
}), null), Fr = ({ IMaskMixin: t, ...o }) => {
|
|
@@ -787,33 +787,38 @@ const q = pr({
|
|
|
787
787
|
return /* @__PURE__ */ x.jsx(i, { ...o });
|
|
788
788
|
}, Lr = ({ mapbox: t, accessToken: o }) => (t && o && (t.accessToken = o), null), Ir = ({
|
|
789
789
|
children: t,
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
790
|
+
defaultQueriesOptions: o,
|
|
791
|
+
defaultMutationsOptions: i,
|
|
792
|
+
QueryClient: u,
|
|
793
|
+
QueryClientProvider: c
|
|
793
794
|
}) => {
|
|
794
|
-
const
|
|
795
|
+
const d = new u({
|
|
795
796
|
defaultOptions: {
|
|
797
|
+
mutations: {
|
|
798
|
+
...i
|
|
799
|
+
},
|
|
796
800
|
queries: {
|
|
801
|
+
getNextPageParam: (m, n, l) => m.length + (l || 0),
|
|
797
802
|
refetchOnWindowFocus: !1,
|
|
798
803
|
retry: 3,
|
|
799
804
|
...o
|
|
800
805
|
}
|
|
801
806
|
}
|
|
802
807
|
});
|
|
803
|
-
return /* @__PURE__ */ x.jsx(
|
|
808
|
+
return /* @__PURE__ */ x.jsx(c, { client: d, children: t });
|
|
804
809
|
}, Nr = (t) => {
|
|
805
810
|
const { unknownErrorTranslationKey: o = "error.unknownError" } = t || {}, { translate: i = t == null ? void 0 : t.translate } = K(q), u = i ? i(o) : "Unknown error", c = Y(
|
|
806
|
-
(
|
|
807
|
-
var l,
|
|
808
|
-
const { response: n } =
|
|
809
|
-
return n != null && n.reason ? String(n.reason) : (l = n == null ? void 0 : n.data) != null && l.reason ? String(n.data.reason) : (
|
|
811
|
+
(m) => {
|
|
812
|
+
var l, E, h, C, O, T, k, $, D;
|
|
813
|
+
const { response: n } = m || {};
|
|
814
|
+
return n != null && n.reason ? String(n.reason) : (l = n == null ? void 0 : n.data) != null && l.reason ? String(n.data.reason) : (E = n == null ? void 0 : n.data) != null && E.message ? String(n.data.message) : (C = (h = n == null ? void 0 : n.data) == null ? void 0 : h.detail) != null && C.length && Array.isArray((O = n == null ? void 0 : n.data) == null ? void 0 : O.detail) && ((k = (T = n == null ? void 0 : n.data) == null ? void 0 : T.detail[0]) != null && k.msg) && typeof ((D = ($ = n == null ? void 0 : n.data) == null ? void 0 : $.detail[0]) == null ? void 0 : D.msg) == "string" ? String(n.data.detail[0].msg) : u;
|
|
810
815
|
},
|
|
811
816
|
[u]
|
|
812
817
|
);
|
|
813
|
-
return { getErrorCode: Y((
|
|
814
|
-
var l,
|
|
815
|
-
const { response: n } =
|
|
816
|
-
return n != null && n.error_code ? String(n == null ? void 0 : n.error_code) : (l = n == null ? void 0 : n.data) != null && l.error_code ? String((
|
|
818
|
+
return { getErrorCode: Y((m) => {
|
|
819
|
+
var l, E, h;
|
|
820
|
+
const { response: n } = m || {};
|
|
821
|
+
return n != null && n.error_code ? String(n == null ? void 0 : n.error_code) : (l = n == null ? void 0 : n.data) != null && l.error_code ? String((E = n == null ? void 0 : n.data) == null ? void 0 : E.error_code) : n != null && n.error_code ? String(n == null ? void 0 : n.error_code) : (h = n == null ? void 0 : n.data) != null && h.error_code ? String(n.data.error_code) : "unknown_error_code";
|
|
817
822
|
}, []), printError: c };
|
|
818
823
|
}, Wr = ({
|
|
819
824
|
data: t,
|
|
@@ -821,19 +826,19 @@ const q = pr({
|
|
|
821
826
|
isFetchingNextPage: i,
|
|
822
827
|
isInitialLoading: u,
|
|
823
828
|
isLoading: c,
|
|
824
|
-
enabled:
|
|
829
|
+
enabled: d = !0
|
|
825
830
|
}) => {
|
|
826
|
-
const
|
|
831
|
+
const m = Y(
|
|
827
832
|
async (l) => {
|
|
828
|
-
i || !
|
|
833
|
+
i || !d || await o({ pageParam: (l == null ? void 0 : l.pageParam) || l.visibleRowsCount });
|
|
829
834
|
},
|
|
830
|
-
[
|
|
835
|
+
[d, o, i]
|
|
831
836
|
), n = se(() => {
|
|
832
837
|
if (t)
|
|
833
|
-
return t.pages.reduce((l,
|
|
838
|
+
return t.pages.reduce((l, E) => [...l, ...E], []);
|
|
834
839
|
}, [t]);
|
|
835
840
|
return {
|
|
836
|
-
fetchNextPageOnRowsScrollEnd:
|
|
841
|
+
fetchNextPageOnRowsScrollEnd: m,
|
|
837
842
|
isLoading: i || c,
|
|
838
843
|
loadingVariant: u ? "skeleton" : "linear",
|
|
839
844
|
rows: n
|
package/dist/main.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(b,
|
|
1
|
+
(function(b,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],y):(b=typeof globalThis<"u"?globalThis:b||self,y(b["@tracktor/shared-module"]={},b.React))})(this,function(b,y){"use strict";var q={exports:{}},Y={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.development.js
|
|
4
4
|
*
|
|
@@ -6,17 +6,17 @@
|
|
|
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 se;function Ne(){return se||(se=1,process.env.NODE_ENV!=="production"&&function(){var t=
|
|
10
|
-
`+re+e}}var te=!1,X;{var fr=typeof WeakMap=="function"?WeakMap:Map;X=new fr}function Ce(e,r){if(!e||te)return"";{var a=X.get(e);if(a!==void 0)return a}var s;te=!0;var g=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var p;p=ee.current,ee.current=null,cr();try{if(r){var
|
|
9
|
+
*/var se;function Ne(){return se||(se=1,process.env.NODE_ENV!=="production"&&function(){var t=y,o=Symbol.for("react.element"),i=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),n=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),S=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),O=Symbol.for("react.offscreen"),F=Symbol.iterator,I="@@iterator";function L(e){if(e===null||typeof e!="object")return null;var r=F&&e[F]||e[I];return typeof r=="function"?r:null}var k=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function C(e){{for(var r=arguments.length,a=new Array(r>1?r-1:0),s=1;s<r;s++)a[s-1]=arguments[s];w("error",e,a)}}function w(e,r,a){{var s=k.ReactDebugCurrentFrame,g=s.getStackAddendum();g!==""&&(r+="%s",a=a.concat([g]));var p=a.map(function(v){return String(v)});p.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,p)}}var fe=!1,de=!1,$=!1,or=!1,ir=!1,ve;ve=Symbol.for("react.module.reference");function ur(e){return!!(typeof e=="string"||typeof e=="function"||e===u||e===d||ir||e===c||e===E||e===h||or||e===O||fe||de||$||typeof e=="object"&&e!==null&&(e.$$typeof===j||e.$$typeof===S||e.$$typeof===m||e.$$typeof===n||e.$$typeof===l||e.$$typeof===ve||e.getModuleId!==void 0))}function sr(e,r,a){var s=e.displayName;if(s)return s;var g=r.displayName||r.name||"";return g!==""?a+"("+g+")":a}function ge(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 u:return"Fragment";case i:return"Portal";case d:return"Profiler";case c:return"StrictMode";case E:return"Suspense";case h:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case n:var r=e;return ge(r)+".Consumer";case m:var a=e;return ge(a._context)+".Provider";case l:return sr(e,e.render,"ForwardRef");case S:var s=e.displayName||null;return s!==null?s:x(e.type)||"Memo";case j:{var g=e,p=g._payload,v=g._init;try{return x(v(p))}catch{return null}}}return null}var N=Object.assign,z=0,pe,me,he,Ee,ye,be,Re;function _e(){}_e.__reactDisabledLog=!0;function cr(){{if(z===0){pe=console.log,me=console.info,he=console.warn,Ee=console.error,ye=console.group,be=console.groupCollapsed,Re=console.groupEnd;var e={configurable:!0,enumerable:!0,value:_e,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}z++}}function lr(){{if(z--,z===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:N({},e,{value:pe}),info:N({},e,{value:me}),warn:N({},e,{value:he}),error:N({},e,{value:Ee}),group:N({},e,{value:ye}),groupCollapsed:N({},e,{value:be}),groupEnd:N({},e,{value:Re})})}z<0&&C("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ee=k.ReactCurrentDispatcher,re;function J(e,r,a){{if(re===void 0)try{throw Error()}catch(g){var s=g.stack.trim().match(/\n( *(at )?)/);re=s&&s[1]||""}return`
|
|
10
|
+
`+re+e}}var te=!1,X;{var fr=typeof WeakMap=="function"?WeakMap:Map;X=new fr}function Ce(e,r){if(!e||te)return"";{var a=X.get(e);if(a!==void 0)return a}var s;te=!0;var g=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var p;p=ee.current,ee.current=null,cr();try{if(r){var v=function(){throw Error()};if(Object.defineProperty(v.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(v,[])}catch(D){s=D}Reflect.construct(e,[],v)}else{try{v.call()}catch(D){s=D}e.call(v.prototype)}}else{try{throw Error()}catch(D){s=D}e()}}catch(D){if(D&&s&&typeof D.stack=="string"){for(var f=D.stack.split(`
|
|
11
11
|
`),T=s.stack.split(`
|
|
12
12
|
`),R=f.length-1,_=T.length-1;R>=1&&_>=0&&f[R]!==T[_];)_--;for(;R>=1&&_>=0;R--,_--)if(f[R]!==T[_]){if(R!==1||_!==1)do if(R--,_--,_<0||f[R]!==T[_]){var P=`
|
|
13
|
-
`+f[R].replace(" at new "," at ");return e.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",e.displayName)),typeof e=="function"&&X.set(e,P),P}while(R>=1&&_>=0);break}}}finally{te=!1,ee.current=p,lr(),Error.prepareStackTrace=g}var V=e?e.displayName||e.name:"",Le=V?J(V):"";return typeof e=="function"&&X.set(e,Le),Le}function dr(e,r,a){return Ce(e,!1)}function vr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function H(e,r,a){if(e==null)return"";if(typeof e=="function")return Ce(e,vr(e));if(typeof e=="string")return J(e);switch(e){case
|
|
13
|
+
`+f[R].replace(" at new "," at ");return e.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",e.displayName)),typeof e=="function"&&X.set(e,P),P}while(R>=1&&_>=0);break}}}finally{te=!1,ee.current=p,lr(),Error.prepareStackTrace=g}var V=e?e.displayName||e.name:"",Le=V?J(V):"";return typeof e=="function"&&X.set(e,Le),Le}function dr(e,r,a){return Ce(e,!1)}function vr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function H(e,r,a){if(e==null)return"";if(typeof e=="function")return Ce(e,vr(e));if(typeof e=="string")return J(e);switch(e){case E:return J("Suspense");case h:return J("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case l:return dr(e.render);case S:return H(e.type,r,a);case j:{var s=e,g=s._payload,p=s._init;try{return H(p(g),r,a)}catch{}}}return""}var K=Object.prototype.hasOwnProperty,we={},Te=k.ReactDebugCurrentFrame;function Z(e){if(e){var r=e._owner,a=H(e.type,e._source,r?r.type:null);Te.setExtraStackFrame(a)}else Te.setExtraStackFrame(null)}function gr(e,r,a,s,g){{var p=Function.call.bind(K);for(var v in e)if(p(e,v)){var f=void 0;try{if(typeof e[v]!="function"){var T=Error((s||"React class")+": "+a+" type `"+v+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[v]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw T.name="Invariant Violation",T}f=e[v](r,v,s,a,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(R){f=R}f&&!(f instanceof Error)&&(Z(g),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).",s||"React class",a,v,typeof f),Z(null)),f instanceof Error&&!(f.message in we)&&(we[f.message]=!0,Z(g),C("Failed %s type: %s",a,f.message),Z(null))}}}var pr=Array.isArray;function ne(e){return pr(e)}function mr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,a=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return a}}function hr(e){try{return Se(e),!1}catch{return!0}}function Se(e){return""+e}function Oe(e){if(hr(e))return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",mr(e)),Se(e)}var B=k.ReactCurrentOwner,Er={key:!0,ref:!0,__self:!0,__source:!0},je,Pe,ae;ae={};function yr(e){if(K.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function br(e){if(K.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Rr(e,r){if(typeof e.ref=="string"&&B.current&&r&&B.current.stateNode!==r){var a=x(B.current.type);ae[a]||(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(B.current.type),e.ref),ae[a]=!0)}}function _r(e,r){{var a=function(){je||(je=!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))};a.isReactWarning=!0,Object.defineProperty(e,"key",{get:a,configurable:!0})}}function Cr(e,r){{var a=function(){Pe||(Pe=!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))};a.isReactWarning=!0,Object.defineProperty(e,"ref",{get:a,configurable:!0})}}var wr=function(e,r,a,s,g,p,v){var f={$$typeof:o,type:e,key:r,ref:a,props:v,_owner:p};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:s}),Object.defineProperty(f,"_source",{configurable:!1,enumerable:!1,writable:!1,value:g}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f};function Tr(e,r,a,s,g){{var p,v={},f=null,T=null;a!==void 0&&(Oe(a),f=""+a),br(r)&&(Oe(r.key),f=""+r.key),yr(r)&&(T=r.ref,Rr(r,g));for(p in r)K.call(r,p)&&!Er.hasOwnProperty(p)&&(v[p]=r[p]);if(e&&e.defaultProps){var R=e.defaultProps;for(p in R)v[p]===void 0&&(v[p]=R[p])}if(f||T){var _=typeof e=="function"?e.displayName||e.name||"Unknown":e;f&&_r(v,_),T&&Cr(v,_)}return wr(e,f,T,g,s,B.current,v)}}var oe=k.ReactCurrentOwner,Ae=k.ReactDebugCurrentFrame;function M(e){if(e){var r=e._owner,a=H(e.type,e._source,r?r.type:null);Ae.setExtraStackFrame(a)}else Ae.setExtraStackFrame(null)}var ie;ie=!1;function ue(e){return typeof e=="object"&&e!==null&&e.$$typeof===o}function ke(){{if(oe.current){var e=x(oe.current.type);if(e)return`
|
|
14
14
|
|
|
15
15
|
Check the render method of \``+e+"`."}return""}}function Sr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),a=e.lineNumber;return`
|
|
16
16
|
|
|
17
17
|
Check your code at `+r+":"+a+"."}return""}}var xe={};function Or(e){{var r=ke();if(!r){var a=typeof e=="string"?e:e.displayName||e.name;a&&(r=`
|
|
18
18
|
|
|
19
|
-
Check the top-level render call using <`+a+">.")}return r}}function De(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var a=Or(r);if(xe[a])return;xe[a]=!0;var s="";e&&e._owner&&e._owner!==oe.current&&(s=" 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.',a,s),M(null)}}function Fe(e,r){{if(typeof e!="object")return;if(ne(e))for(var a=0;a<e.length;a++){var s=e[a];ue(s)&&De(s,r)}else if(ue(e))e._store&&(e._store.validated=!0);else if(e){var g=L(e);if(typeof g=="function"&&g!==e.entries)for(var p=g.call(e),
|
|
19
|
+
Check the top-level render call using <`+a+">.")}return r}}function De(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var a=Or(r);if(xe[a])return;xe[a]=!0;var s="";e&&e._owner&&e._owner!==oe.current&&(s=" 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.',a,s),M(null)}}function Fe(e,r){{if(typeof e!="object")return;if(ne(e))for(var a=0;a<e.length;a++){var s=e[a];ue(s)&&De(s,r)}else if(ue(e))e._store&&(e._store.validated=!0);else if(e){var g=L(e);if(typeof g=="function"&&g!==e.entries)for(var p=g.call(e),v;!(v=p.next()).done;)ue(v.value)&&De(v.value,r)}}}function jr(e){{var r=e.type;if(r==null||typeof r=="string")return;var a;if(typeof r=="function")a=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===l||r.$$typeof===S))a=r.propTypes;else return;if(a){var s=x(r);gr(a,e.props,"prop",s,e)}else if(r.PropTypes!==void 0&&!ie){ie=!0;var g=x(r);C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",g||"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 Pr(e){{for(var r=Object.keys(e.props),a=0;a<r.length;a++){var s=r[a];if(s!=="children"&&s!=="key"){M(e),C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",s),M(null);break}}e.ref!==null&&(M(e),C("Invalid attribute `ref` supplied to `React.Fragment`."),M(null))}}function Ie(e,r,a,s,g,p){{var v=ur(e);if(!v){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=Sr(g);T?f+=T:f+=ke();var R;e===null?R="null":ne(e)?R="array":e!==void 0&&e.$$typeof===o?(R="<"+(x(e.type)||"Unknown")+" />",f=" Did you accidentally export a JSX literal instead of a component?"):R=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",R,f)}var _=Tr(e,r,a,g,p);if(_==null)return _;if(v){var P=r.children;if(P!==void 0)if(s)if(ne(P)){for(var V=0;V<P.length;V++)Fe(P[V],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 Fe(P,e)}return e===u?Pr(_):jr(_),_}}function Ar(e,r,a){return Ie(e,r,a,!0)}function kr(e,r,a){return Ie(e,r,a,!1)}var xr=kr,Dr=Ar;Y.Fragment=u,Y.jsx=xr,Y.jsxs=Dr}()),Y}var U={};/**
|
|
20
20
|
* @license React
|
|
21
21
|
* react-jsx-runtime.production.min.js
|
|
22
22
|
*
|
|
@@ -24,4 +24,4 @@ Check the top-level render call using <`+a+">.")}return r}}function De(e,r){{if(
|
|
|
24
24
|
*
|
|
25
25
|
* This source code is licensed under the MIT license found in the
|
|
26
26
|
* LICENSE file in the root directory of this source tree.
|
|
27
|
-
*/var ce;function We(){if(ce)return U;ce=1;var t=
|
|
27
|
+
*/var ce;function We(){if(ce)return U;ce=1;var t=y,o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,c=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d={key:!0,ref:!0,__self:!0,__source:!0};function m(n,l,E){var h,S={},j=null,O=null;E!==void 0&&(j=""+E),l.key!==void 0&&(j=""+l.key),l.ref!==void 0&&(O=l.ref);for(h in l)u.call(l,h)&&!d.hasOwnProperty(h)&&(S[h]=l[h]);if(n&&n.defaultProps)for(h in l=n.defaultProps,l)S[h]===void 0&&(S[h]=l[h]);return{$$typeof:o,type:n,key:j,ref:O,props:S,_owner:c.current}}return U.Fragment=i,U.jsx=m,U.jsxs=m,U}process.env.NODE_ENV==="production"?q.exports=We():q.exports=Ne();var A=q.exports;const W=y.createContext({apiURL:void 0,axios:void 0,children:void 0,Navigate:void 0,Outlet:void 0,translate:void 0,useAuth:void 0,useLocation:void 0}),Me=({axios:t,children:o,translate:i,useAuth:u,Outlet:c,Navigate:d,useLocation:m,useGoogleTagManager:n,apiURL:l})=>{const E=y.useMemo(()=>({apiURL:l,axios:t,Navigate:d,Outlet:c,translate:i,useAuth:u,useGoogleTagManager:n,useLocation:m}),[d,c,l,t,i,u,n,m]);return A.jsx(W.Provider,{value:E,children:o})},G=t=>`RequireAuth require « ${t} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ve=({Fallback:t,loginPath:o="/login",localStorageKey:i="user",redirect401Path:u="/login",...c})=>{var I,L,k,C;const{axios:d=c.axios,useLocation:m=c.useLocation,useAuth:n=c.useAuth,Outlet:l=c.Outlet,Navigate:E=c.Navigate}=y.useContext(W);if(n===void 0)throw new Error(G("useAuth"));if(m===void 0)throw new Error(G("useLocation"));if(l===void 0)throw new Error(G("Outlet"));if(E===void 0)throw new Error(G("Navigate"));const[h,S]=y.useState(null),{isLogged:j}=n(),O=m(),F=y.useRef(!1);return y.useLayoutEffect(()=>{F.current||(F.current=!0,d==null||d.interceptors.response.use(w=>w,async w=>{var $;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&&(($=w==null?void 0:w.response)==null?void 0:$.status)===401&&(d.defaults.headers.common.Authorization=null,localStorage.removeItem(i),S(u)),Promise.reject(w)}))},[d==null?void 0:d.defaults.headers.common,d==null?void 0:d.interceptors.response,i,u]),j&&!h?A.jsx(y.Suspense,{fallback:t,children:(L=(I=O.state)==null?void 0:I.from)!=null&&L.state&&((C=(k=O.state)==null?void 0:k.from)==null?void 0:C.pathname)===o?A.jsx(E,{to:O.state.from.state.from.pathname+O.state.from.state.from.search,replace:!0}):A.jsx(l,{})}):A.jsx(E,{to:o,state:{from:O},replace:!0})},Q=t=>`GTMSendPageView require « ${t} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ye=({...t})=>{const{useLocation:o=t.useLocation,Outlet:i=t.Outlet,useGoogleTagManager:u=t.useGoogleTagManager}=y.useContext(W);if(o===void 0)throw new Error(Q("useLocation"));if(i===void 0)throw new Error(Q("Outlet"));if(u===void 0)throw new Error(Q("useGoogleTagManager"));const{pathname:c}=o(),{sendEvent:d}=u();return y.useEffect(()=>{d({event:"pageView",pathname:c})},[c,d]),A.jsx(i,{})},Ue=({axios:t,baseURL:o,tokenTypeKey:i="tokenType",userLocalStorageKey:u="user",tokenKey:c="accessToken",postContentType:d="application/json"})=>{if(!t.defaults)return null;const m=localStorage.getItem(u),n=m?JSON.parse(m):null,l=n!=null&&n[i]?n[i]:null,E=n!=null&&n[c]?n[c]:null,h=m?`${l} ${E}`:null;return t.defaults.baseURL=o,t.defaults.headers.post["Content-Type"]=d,h&&(t.defaults.headers.common.Authorization=h),null},ze=({i18n:t,debug:o,initReactI18next:i,resources:u,LanguageDetector:c})=>(t!=null&&t.isInitialized||(t.use(c).use(i).init({debug:o,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:!1,useSuspense:!0},resources:u,returnNull:!1}).then(()=>{document.documentElement.lang!==t.resolvedLanguage&&t.resolvedLanguage&&document.documentElement.setAttribute("lang",t.resolvedLanguage)}),t.on("languageChanged",d=>{document.documentElement.setAttribute("lang",d)})),null),Be=({dsn:t,sentry:o,integrations:i,tracesSampleRate:u,routingInstrumentationDependencies:c,replaysSessionSampleRate:d,replaysOnErrorSampleRate:m,tracePropagationTargets:n,ignoreErrors:l,debug:E,environment:h})=>(o.isInitialized()||(E||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&o.init({debug:E,dsn:t,environment:h||"production",ignoreErrors:[...l||[],/dynamically imported module/],integrations:[new o.BrowserTracing({routingInstrumentation:o.reactRouterV6Instrumentation(c.useEffect,c.useLocation,c.useNavigationType,c.createRoutesFromChildren,c.matchRoutes)}),o.replayIntegration(),...i||[]],replaysOnErrorSampleRate:m||1,replaysSessionSampleRate:d||.1,tracePropagationTargets:n,tracesSampleRate:u||1}),null),Ge=({IMaskMixin:t,...o})=>{const i=y.useMemo(()=>t(({TextField:u,...c})=>A.jsx(u,{...c})),[t]);return A.jsx(i,{...o})},$e=({mapbox:t,accessToken:o})=>(t&&o&&(t.accessToken=o),null),Je=({children:t,defaultQueriesOptions:o,defaultMutationsOptions:i,QueryClient:u,QueryClientProvider:c})=>{const d=new u({defaultOptions:{mutations:{...i},queries:{getNextPageParam:(m,n,l)=>m.length+(l||0),refetchOnWindowFocus:!1,retry:3,...o}}});return A.jsx(c,{client:d,children:t})},Xe=t=>{const{unknownErrorTranslationKey:o="error.unknownError"}=t||{},{translate:i=t==null?void 0:t.translate}=y.useContext(W),u=i?i(o):"Unknown error",c=y.useCallback(m=>{var l,E,h,S,j,O,F,I,L;const{response:n}=m||{};return n!=null&&n.reason?String(n.reason):(l=n==null?void 0:n.data)!=null&&l.reason?String(n.data.reason):(E=n==null?void 0:n.data)!=null&&E.message?String(n.data.message):(S=(h=n==null?void 0:n.data)==null?void 0:h.detail)!=null&&S.length&&Array.isArray((j=n==null?void 0:n.data)==null?void 0:j.detail)&&((F=(O=n==null?void 0:n.data)==null?void 0:O.detail[0])!=null&&F.msg)&&typeof((L=(I=n==null?void 0:n.data)==null?void 0:I.detail[0])==null?void 0:L.msg)=="string"?String(n.data.detail[0].msg):u},[u]);return{getErrorCode:y.useCallback(m=>{var l,E,h;const{response:n}=m||{};return n!=null&&n.error_code?String(n==null?void 0:n.error_code):(l=n==null?void 0:n.data)!=null&&l.error_code?String((E=n==null?void 0:n.data)==null?void 0:E.error_code):n!=null&&n.error_code?String(n==null?void 0:n.error_code):(h=n==null?void 0:n.data)!=null&&h.error_code?String(n.data.error_code):"unknown_error_code"},[]),printError:c}},He=({data:t,fetchNextPage:o,isFetchingNextPage:i,isInitialLoading:u,isLoading:c,enabled:d=!0})=>{const m=y.useCallback(async l=>{i||!d||await o({pageParam:(l==null?void 0:l.pageParam)||l.visibleRowsCount})},[d,o,i]),n=y.useMemo(()=>{if(t)return t.pages.reduce((l,E)=>[...l,...E],[])},[t]);return{fetchNextPageOnRowsScrollEnd:m,isLoading:i||c,loadingVariant:u?"skeleton":"linear",rows:n}},Ke=t=>{const o=y.useCallback(({tokenType:u,accessToken:c})=>{t.defaults.headers.common.Authorization=`${u} ${c}`},[t.defaults.headers.common]);return{clearAuthenticationToken:y.useCallback(()=>{t.defaults.headers.common.Authorization=null},[t.defaults.headers.common]),setAuthenticationToken:o}},Ze=(t,o="km")=>{const i=Number(t);return Number.isNaN(i)?`0 ${o}`:`${i.toFixed(2)} ${o}`},qe=t=>{const o=t&&typeof t=="object"&&"pathname"in t&&t.pathname?t.pathname:t;return typeof o=="string"?o!=null&&o.startsWith("/")?o!=null&&o.startsWith("/files")?o:`/files${o}`:o!=null&&o.startsWith("files")?`/${o}`:o!=null&&o.startsWith("files")?`/${o}`:`/files/${o}`:o},le=(t,o)=>{if(!t)return"";const i=qe(t),u=typeof t=="object"&&"pathname"in t?`${t.origin}${i}`:t;return typeof o=="number"?`${u.replace("/files",`/thumbs/${o}`)}`:u},Qe=()=>{const{apiURL:t}=y.useContext(W);return{distanceAdapter:Ze,filePathAdapter:(i,u)=>le(t&&typeof i=="string"?{origin:t,pathname:i}:i,u)}},er=t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase(),rr=t=>{const u=t.split("/").filter(c=>c.length>0).map(c=>c.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(l=>l.charAt(0).toUpperCase()+l.slice(1)).join("")).join("");return u.charAt(0).toLowerCase()+u.slice(1)},tr=(t,o,i)=>{const u=rr(o),c=er(i);return`${u}${c}`},nr=t=>{if(t)return(t==null?void 0:t.reduce((o,i)=>(o[i]={query:{useInfinite:!0,useInfiniteQueryParam:"offset",useQuery:!0}},o),{}))||{}},ar=t=>{const{input:o="./openapi.json",operationsToGenerateInfiniteQueryHook:i=void 0}=t||{};return{api:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:o,output:{client:"react-query",mode:"tags-split",override:{header:u=>["Generated by orval 🍺",...u.title?[u.title]:[],...u.description?[u.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/config/orval/mutator/axiosCustomInstance.ts`},operationName:tr,...(i==null?void 0:i.length)&&{operations:nr(i)},query:{useQuery:!0}},schemas:"src/api/model",target:"src/api/services/api.ts"}}}};b.AxiosConfig=Ue,b.GTMSendPageView=Ye,b.I18nConfig=ze,b.InjectDependenciesContext=W,b.InjectDependenciesProvider=Me,b.MapBoxConfig=$e,b.MaskTextField=Ge,b.QueryClientConfigProvider=Je,b.RequireAuth=Ve,b.SentryConfig=Be,b.getOrvalConfig=ar,b.useAdapter=Qe,b.useAuth=Ke,b.useInfiniteDataGrid=He,b.useResponseError=Xe,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})});
|