@tracktor/shared-module 2.21.0 → 2.22.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/dist/main.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Z from "axios";
|
|
2
|
-
import fe, { useMemo as
|
|
3
|
-
const
|
|
2
|
+
import fe, { useMemo as M, createContext as pe, useContext as j, useEffect as k, useState as J, Suspense as ge, useCallback as Y } from "react";
|
|
3
|
+
const De = (e, r) => {
|
|
4
4
|
const a = Z.CancelToken.source(), o = Z({
|
|
5
5
|
...e,
|
|
6
6
|
...r,
|
|
@@ -10,28 +10,28 @@ const ze = (e, r) => {
|
|
|
10
10
|
a.cancel("Query was cancelled");
|
|
11
11
|
}, o;
|
|
12
12
|
};
|
|
13
|
-
var
|
|
13
|
+
var $ = { exports: {} }, I = {};
|
|
14
14
|
var ee;
|
|
15
|
-
function
|
|
16
|
-
if (ee) return
|
|
15
|
+
function me() {
|
|
16
|
+
if (ee) return I;
|
|
17
17
|
ee = 1;
|
|
18
18
|
var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), r = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
19
|
-
function a(o, n,
|
|
19
|
+
function a(o, n, i) {
|
|
20
20
|
var c = null;
|
|
21
|
-
if (
|
|
22
|
-
|
|
23
|
-
for (var
|
|
24
|
-
|
|
25
|
-
} else
|
|
26
|
-
return n =
|
|
21
|
+
if (i !== void 0 && (c = "" + i), n.key !== void 0 && (c = "" + n.key), "key" in n) {
|
|
22
|
+
i = {};
|
|
23
|
+
for (var l in n)
|
|
24
|
+
l !== "key" && (i[l] = n[l]);
|
|
25
|
+
} else i = n;
|
|
26
|
+
return n = i.ref, {
|
|
27
27
|
$$typeof: e,
|
|
28
28
|
type: o,
|
|
29
29
|
key: c,
|
|
30
30
|
ref: n !== void 0 ? n : null,
|
|
31
|
-
props:
|
|
31
|
+
props: i
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
return
|
|
34
|
+
return I.Fragment = r, I.jsx = a, I.jsxs = a, I;
|
|
35
35
|
}
|
|
36
36
|
var N = {};
|
|
37
37
|
var te;
|
|
@@ -43,15 +43,15 @@ function ye() {
|
|
|
43
43
|
return t.$$typeof === le ? null : t.displayName || t.name || null;
|
|
44
44
|
if (typeof t == "string") return t;
|
|
45
45
|
switch (t) {
|
|
46
|
-
case
|
|
46
|
+
case P:
|
|
47
47
|
return "Fragment";
|
|
48
48
|
case d:
|
|
49
49
|
return "Profiler";
|
|
50
|
-
case
|
|
50
|
+
case g:
|
|
51
51
|
return "StrictMode";
|
|
52
|
-
case
|
|
52
|
+
case x:
|
|
53
53
|
return "Suspense";
|
|
54
|
-
case
|
|
54
|
+
case se:
|
|
55
55
|
return "SuspenseList";
|
|
56
56
|
case ce:
|
|
57
57
|
return "Activity";
|
|
@@ -60,21 +60,21 @@ function ye() {
|
|
|
60
60
|
switch (typeof t.tag == "number" && console.error(
|
|
61
61
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
62
62
|
), t.$$typeof) {
|
|
63
|
-
case
|
|
63
|
+
case A:
|
|
64
64
|
return "Portal";
|
|
65
|
-
case R:
|
|
66
|
-
return t.displayName || "Context";
|
|
67
65
|
case b:
|
|
66
|
+
return t.displayName || "Context";
|
|
67
|
+
case R:
|
|
68
68
|
return (t._context.displayName || "Context") + ".Consumer";
|
|
69
69
|
case _:
|
|
70
|
-
var
|
|
71
|
-
return t = t.displayName, t || (t =
|
|
72
|
-
case
|
|
73
|
-
return
|
|
70
|
+
var f = t.render;
|
|
71
|
+
return t = t.displayName, t || (t = f.displayName || f.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
|
|
72
|
+
case ie:
|
|
73
|
+
return f = t.displayName || null, f !== null ? f : e(t.type) || "Memo";
|
|
74
74
|
case z:
|
|
75
|
-
|
|
75
|
+
f = t._payload, t = t._init;
|
|
76
76
|
try {
|
|
77
|
-
return e(t(
|
|
77
|
+
return e(t(f));
|
|
78
78
|
} catch {
|
|
79
79
|
}
|
|
80
80
|
}
|
|
@@ -86,27 +86,27 @@ function ye() {
|
|
|
86
86
|
function a(t) {
|
|
87
87
|
try {
|
|
88
88
|
r(t);
|
|
89
|
-
var
|
|
89
|
+
var f = !1;
|
|
90
90
|
} catch {
|
|
91
|
-
|
|
91
|
+
f = !0;
|
|
92
92
|
}
|
|
93
|
-
if (
|
|
94
|
-
|
|
95
|
-
var
|
|
96
|
-
return
|
|
97
|
-
|
|
93
|
+
if (f) {
|
|
94
|
+
f = console;
|
|
95
|
+
var h = f.error, E = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
|
|
96
|
+
return h.call(
|
|
97
|
+
f,
|
|
98
98
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
99
|
-
|
|
99
|
+
E
|
|
100
100
|
), r(t);
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
function o(t) {
|
|
104
|
-
if (t ===
|
|
104
|
+
if (t === P) return "<>";
|
|
105
105
|
if (typeof t == "object" && t !== null && t.$$typeof === z)
|
|
106
106
|
return "<...>";
|
|
107
107
|
try {
|
|
108
|
-
var
|
|
109
|
-
return
|
|
108
|
+
var f = e(t);
|
|
109
|
+
return f ? "<" + f + ">" : "<...>";
|
|
110
110
|
} catch {
|
|
111
111
|
return "<...>";
|
|
112
112
|
}
|
|
@@ -115,45 +115,45 @@ function ye() {
|
|
|
115
115
|
var t = U.A;
|
|
116
116
|
return t === null ? null : t.getOwner();
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function i() {
|
|
119
119
|
return Error("react-stack-top-frame");
|
|
120
120
|
}
|
|
121
121
|
function c(t) {
|
|
122
|
-
if (
|
|
123
|
-
var
|
|
124
|
-
if (
|
|
122
|
+
if (q.call(t, "key")) {
|
|
123
|
+
var f = Object.getOwnPropertyDescriptor(t, "key").get;
|
|
124
|
+
if (f && f.isReactWarning) return !1;
|
|
125
125
|
}
|
|
126
126
|
return t.key !== void 0;
|
|
127
127
|
}
|
|
128
|
-
function
|
|
129
|
-
function
|
|
130
|
-
|
|
128
|
+
function l(t, f) {
|
|
129
|
+
function h() {
|
|
130
|
+
G || (G = !0, console.error(
|
|
131
131
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
132
|
-
|
|
132
|
+
f
|
|
133
133
|
));
|
|
134
134
|
}
|
|
135
|
-
|
|
136
|
-
get:
|
|
135
|
+
h.isReactWarning = !0, Object.defineProperty(t, "key", {
|
|
136
|
+
get: h,
|
|
137
137
|
configurable: !0
|
|
138
138
|
});
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function u() {
|
|
141
141
|
var t = e(this.type);
|
|
142
142
|
return K[t] || (K[t] = !0, console.error(
|
|
143
143
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
144
144
|
)), t = this.props.ref, t !== void 0 ? t : null;
|
|
145
145
|
}
|
|
146
|
-
function
|
|
147
|
-
var
|
|
146
|
+
function p(t, f, h, E, F, Q) {
|
|
147
|
+
var w = h.ref;
|
|
148
148
|
return t = {
|
|
149
|
-
$$typeof:
|
|
149
|
+
$$typeof: T,
|
|
150
150
|
type: t,
|
|
151
|
-
key:
|
|
152
|
-
props:
|
|
153
|
-
_owner:
|
|
154
|
-
}, (
|
|
151
|
+
key: f,
|
|
152
|
+
props: h,
|
|
153
|
+
_owner: E
|
|
154
|
+
}, (w !== void 0 ? w : null) !== null ? Object.defineProperty(t, "ref", {
|
|
155
155
|
enumerable: !1,
|
|
156
|
-
get:
|
|
156
|
+
get: u
|
|
157
157
|
}) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
|
|
158
158
|
configurable: !1,
|
|
159
159
|
enumerable: !1,
|
|
@@ -168,69 +168,69 @@ function ye() {
|
|
|
168
168
|
configurable: !1,
|
|
169
169
|
enumerable: !1,
|
|
170
170
|
writable: !0,
|
|
171
|
-
value:
|
|
171
|
+
value: F
|
|
172
172
|
}), Object.defineProperty(t, "_debugTask", {
|
|
173
173
|
configurable: !1,
|
|
174
174
|
enumerable: !1,
|
|
175
175
|
writable: !0,
|
|
176
|
-
value:
|
|
176
|
+
value: Q
|
|
177
177
|
}), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
|
|
178
178
|
}
|
|
179
|
-
function
|
|
180
|
-
var
|
|
181
|
-
if (
|
|
182
|
-
if (
|
|
183
|
-
if (ue(
|
|
184
|
-
for (
|
|
185
|
-
m(E
|
|
186
|
-
Object.freeze && Object.freeze(
|
|
179
|
+
function s(t, f, h, E, F, Q) {
|
|
180
|
+
var w = f.children;
|
|
181
|
+
if (w !== void 0)
|
|
182
|
+
if (E)
|
|
183
|
+
if (ue(w)) {
|
|
184
|
+
for (E = 0; E < w.length; E++)
|
|
185
|
+
m(w[E]);
|
|
186
|
+
Object.freeze && Object.freeze(w);
|
|
187
187
|
} else
|
|
188
188
|
console.error(
|
|
189
189
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
190
190
|
);
|
|
191
|
-
else m(
|
|
192
|
-
if (
|
|
193
|
-
|
|
194
|
-
var
|
|
191
|
+
else m(w);
|
|
192
|
+
if (q.call(f, "key")) {
|
|
193
|
+
w = e(t);
|
|
194
|
+
var O = Object.keys(f).filter(function(de) {
|
|
195
195
|
return de !== "key";
|
|
196
196
|
});
|
|
197
|
-
|
|
197
|
+
E = 0 < O.length ? "{key: someKey, " + O.join(": ..., ") + ": ...}" : "{key: someKey}", X[w + E] || (O = 0 < O.length ? "{" + O.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
198
198
|
`A props object containing a "key" prop is being spread into JSX:
|
|
199
199
|
let props = %s;
|
|
200
200
|
<%s {...props} />
|
|
201
201
|
React keys must be passed directly to JSX without using spread:
|
|
202
202
|
let props = %s;
|
|
203
203
|
<%s key={someKey} {...props} />`,
|
|
204
|
-
w,
|
|
205
204
|
E,
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
205
|
+
w,
|
|
206
|
+
O,
|
|
207
|
+
w
|
|
208
|
+
), X[w + E] = !0);
|
|
209
209
|
}
|
|
210
|
-
if (
|
|
211
|
-
|
|
212
|
-
for (var
|
|
213
|
-
|
|
214
|
-
} else
|
|
215
|
-
return
|
|
216
|
-
|
|
210
|
+
if (w = null, h !== void 0 && (a(h), w = "" + h), c(f) && (a(f.key), w = "" + f.key), "key" in f) {
|
|
211
|
+
h = {};
|
|
212
|
+
for (var V in f)
|
|
213
|
+
V !== "key" && (h[V] = f[V]);
|
|
214
|
+
} else h = f;
|
|
215
|
+
return w && l(
|
|
216
|
+
h,
|
|
217
217
|
typeof t == "function" ? t.displayName || t.name || "Unknown" : t
|
|
218
|
-
),
|
|
218
|
+
), p(
|
|
219
219
|
t,
|
|
220
|
-
|
|
221
|
-
|
|
220
|
+
w,
|
|
221
|
+
h,
|
|
222
222
|
n(),
|
|
223
|
-
|
|
224
|
-
|
|
223
|
+
F,
|
|
224
|
+
Q
|
|
225
225
|
);
|
|
226
226
|
}
|
|
227
227
|
function m(t) {
|
|
228
|
-
|
|
228
|
+
y(t) ? t._store && (t._store.validated = 1) : typeof t == "object" && t !== null && t.$$typeof === z && (t._payload.status === "fulfilled" ? y(t._payload.value) && t._payload.value._store && (t._payload.value._store.validated = 1) : t._store && (t._store.validated = 1));
|
|
229
229
|
}
|
|
230
|
-
function
|
|
231
|
-
return typeof t == "object" && t !== null && t.$$typeof ===
|
|
230
|
+
function y(t) {
|
|
231
|
+
return typeof t == "object" && t !== null && t.$$typeof === T;
|
|
232
232
|
}
|
|
233
|
-
var v = fe,
|
|
233
|
+
var v = fe, T = /* @__PURE__ */ Symbol.for("react.transitional.element"), A = /* @__PURE__ */ Symbol.for("react.portal"), P = /* @__PURE__ */ Symbol.for("react.fragment"), g = /* @__PURE__ */ Symbol.for("react.strict_mode"), d = /* @__PURE__ */ Symbol.for("react.profiler"), R = /* @__PURE__ */ Symbol.for("react.consumer"), b = /* @__PURE__ */ Symbol.for("react.context"), _ = /* @__PURE__ */ Symbol.for("react.forward_ref"), x = /* @__PURE__ */ Symbol.for("react.suspense"), se = /* @__PURE__ */ Symbol.for("react.suspense_list"), ie = /* @__PURE__ */ Symbol.for("react.memo"), z = /* @__PURE__ */ Symbol.for("react.lazy"), ce = /* @__PURE__ */ Symbol.for("react.activity"), le = /* @__PURE__ */ Symbol.for("react.client.reference"), U = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, q = Object.prototype.hasOwnProperty, ue = Array.isArray, W = console.createTask ? console.createTask : function() {
|
|
234
234
|
return null;
|
|
235
235
|
};
|
|
236
236
|
v = {
|
|
@@ -238,47 +238,47 @@ React keys must be passed directly to JSX without using spread:
|
|
|
238
238
|
return t();
|
|
239
239
|
}
|
|
240
240
|
};
|
|
241
|
-
var
|
|
241
|
+
var G, K = {}, B = v.react_stack_bottom_frame.bind(
|
|
242
242
|
v,
|
|
243
|
-
|
|
244
|
-
)(),
|
|
245
|
-
N.Fragment =
|
|
246
|
-
var
|
|
247
|
-
return
|
|
243
|
+
i
|
|
244
|
+
)(), H = W(o(i)), X = {};
|
|
245
|
+
N.Fragment = P, N.jsx = function(t, f, h) {
|
|
246
|
+
var E = 1e4 > U.recentlyCreatedOwnerStacks++;
|
|
247
|
+
return s(
|
|
248
248
|
t,
|
|
249
|
-
|
|
250
|
-
|
|
249
|
+
f,
|
|
250
|
+
h,
|
|
251
251
|
!1,
|
|
252
|
-
|
|
253
|
-
|
|
252
|
+
E ? Error("react-stack-top-frame") : B,
|
|
253
|
+
E ? W(o(t)) : H
|
|
254
254
|
);
|
|
255
|
-
}, N.jsxs = function(t,
|
|
256
|
-
var
|
|
257
|
-
return
|
|
255
|
+
}, N.jsxs = function(t, f, h) {
|
|
256
|
+
var E = 1e4 > U.recentlyCreatedOwnerStacks++;
|
|
257
|
+
return s(
|
|
258
258
|
t,
|
|
259
|
-
|
|
260
|
-
|
|
259
|
+
f,
|
|
260
|
+
h,
|
|
261
261
|
!0,
|
|
262
|
-
|
|
263
|
-
|
|
262
|
+
E ? Error("react-stack-top-frame") : B,
|
|
263
|
+
E ? W(o(t)) : H
|
|
264
264
|
);
|
|
265
265
|
};
|
|
266
266
|
})()), N;
|
|
267
267
|
}
|
|
268
268
|
var re;
|
|
269
|
-
function
|
|
270
|
-
return re || (re = 1, process.env.NODE_ENV === "production" ?
|
|
269
|
+
function he() {
|
|
270
|
+
return re || (re = 1, process.env.NODE_ENV === "production" ? $.exports = me() : $.exports = ye()), $.exports;
|
|
271
271
|
}
|
|
272
|
-
var C =
|
|
273
|
-
const
|
|
274
|
-
const a =
|
|
272
|
+
var C = he();
|
|
273
|
+
const Ye = ({ IMaskMixin: e, ...r }) => {
|
|
274
|
+
const a = M(
|
|
275
275
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
276
276
|
() => e(({ TextField: o, ...n }) => /* @__PURE__ */ C.jsx(o, { ...n })),
|
|
277
277
|
[e]
|
|
278
278
|
);
|
|
279
279
|
return /* @__PURE__ */ C.jsx(a, { ...r });
|
|
280
|
-
},
|
|
281
|
-
const n =
|
|
280
|
+
}, S = pe({}), ze = ({ children: e, apiURL: r, libraries: a, localStorageKeys: o }) => {
|
|
281
|
+
const n = M(
|
|
282
282
|
() => ({
|
|
283
283
|
apiURL: r,
|
|
284
284
|
libraries: a,
|
|
@@ -286,24 +286,24 @@ const Ue = ({ IMaskMixin: e, ...r }) => {
|
|
|
286
286
|
}),
|
|
287
287
|
[r, a, o]
|
|
288
288
|
);
|
|
289
|
-
return /* @__PURE__ */ C.jsx(
|
|
290
|
-
},
|
|
291
|
-
const { libraries: a } =
|
|
289
|
+
return /* @__PURE__ */ C.jsx(S.Provider, { value: n, children: e });
|
|
290
|
+
}, Ue = ({ data: e, ...r }) => {
|
|
291
|
+
const { libraries: a } = j(S), o = r?.reactRouter || a?.reactRouter, n = r?.gtm || a?.gtm;
|
|
292
292
|
if (!o)
|
|
293
293
|
throw new Error(
|
|
294
294
|
"React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView."
|
|
295
295
|
);
|
|
296
296
|
if (!n)
|
|
297
297
|
throw new Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");
|
|
298
|
-
const { useGoogleTagManager:
|
|
299
|
-
return
|
|
300
|
-
|
|
298
|
+
const { useGoogleTagManager: i } = n, { useLocation: c, Outlet: l } = o, { pathname: u } = c(), { sendEvent: p } = i();
|
|
299
|
+
return k(() => {
|
|
300
|
+
p({
|
|
301
301
|
event: "pageView",
|
|
302
|
-
pathname:
|
|
302
|
+
pathname: u,
|
|
303
303
|
...e
|
|
304
304
|
});
|
|
305
|
-
}, [e,
|
|
306
|
-
},
|
|
305
|
+
}, [e, u, p]), /* @__PURE__ */ C.jsx(l, {});
|
|
306
|
+
}, L = (() => {
|
|
307
307
|
try {
|
|
308
308
|
return typeof global == "object" && global !== null && ("HermesInternal" in global || // Hermes JS engine
|
|
309
309
|
"__fbBatchedBridge" in global || // RN Bridge
|
|
@@ -311,43 +311,43 @@ const Ue = ({ IMaskMixin: e, ...r }) => {
|
|
|
311
311
|
} catch {
|
|
312
312
|
return !1;
|
|
313
313
|
}
|
|
314
|
-
})(),
|
|
314
|
+
})(), ve = "user", We = ({
|
|
315
315
|
tokenTypeKey: e = "tokenType",
|
|
316
316
|
tokenKey: r = "accessToken",
|
|
317
317
|
postContentType: a = "application/json",
|
|
318
318
|
...o
|
|
319
319
|
}) => {
|
|
320
|
-
const { apiURL: n = o.apiURL, libraries:
|
|
321
|
-
if (!
|
|
320
|
+
const { apiURL: n = o.apiURL, libraries: i, localStorageKeys: c } = j(S), l = o?.userLocalStorageKey || c?.user || ve, u = o?.axios || i?.axios;
|
|
321
|
+
if (!u)
|
|
322
322
|
throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
323
|
-
if (!
|
|
323
|
+
if (!u?.defaults || L)
|
|
324
324
|
return null;
|
|
325
325
|
if (typeof window < "u" && window.localStorage) {
|
|
326
|
-
const
|
|
327
|
-
v && (
|
|
326
|
+
const p = localStorage.getItem(l), s = p ? JSON.parse(p) : null, m = s?.[e] ? s[e] : null, y = s?.[r] ? s[r] : null, v = p ? `${m} ${y}` : null;
|
|
327
|
+
v && (u.defaults.headers.common.Authorization = v);
|
|
328
328
|
}
|
|
329
|
-
return
|
|
330
|
-
},
|
|
331
|
-
const { libraries: a } =
|
|
329
|
+
return u.defaults.baseURL = n, u.defaults.headers.post["Content-Type"] = a, null;
|
|
330
|
+
}, Qe = ({ language: e, ...r }) => {
|
|
331
|
+
const { libraries: a } = j(S), o = r?.dayjs || a?.dayjs, n = r?.plugin || a?.dayjsPlugin;
|
|
332
332
|
if (!o)
|
|
333
333
|
throw new Error(
|
|
334
334
|
"Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props of InitializeDaysJSConfig."
|
|
335
335
|
);
|
|
336
|
-
return
|
|
336
|
+
return k(() => {
|
|
337
337
|
(async () => {
|
|
338
338
|
const c = e || navigator.language?.slice(0, 2) || "en";
|
|
339
|
-
n && n.forEach((
|
|
340
|
-
|
|
339
|
+
n && n.forEach((l) => {
|
|
340
|
+
l && o.extend(l);
|
|
341
341
|
}), await import("dayjs/locale/en"), await import("dayjs/locale/fr"), o.locale(c);
|
|
342
342
|
})().then();
|
|
343
343
|
}, [o, n, e]), null;
|
|
344
|
-
},
|
|
345
|
-
const { libraries: o } =
|
|
346
|
-
if (
|
|
344
|
+
}, Ve = ({ debug: e, resources: r, ...a }) => {
|
|
345
|
+
const { libraries: o } = j(S), n = a?.i18 || o?.i18, { i18next: i, initReactI18next: c, languageDetector: l } = n || {};
|
|
346
|
+
if (L)
|
|
347
347
|
return null;
|
|
348
348
|
if (!n)
|
|
349
349
|
throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
350
|
-
return
|
|
350
|
+
return i?.isInitialized || (i.use(l).use(c).init({
|
|
351
351
|
debug: e,
|
|
352
352
|
fallbackLng: "en",
|
|
353
353
|
interpolation: {
|
|
@@ -361,35 +361,35 @@ const Ue = ({ IMaskMixin: e, ...r }) => {
|
|
|
361
361
|
resources: r,
|
|
362
362
|
returnNull: !1
|
|
363
363
|
}).then(() => {
|
|
364
|
-
document.documentElement.lang !==
|
|
365
|
-
}),
|
|
366
|
-
document.documentElement.setAttribute("lang",
|
|
364
|
+
document.documentElement.lang !== i.resolvedLanguage && i.resolvedLanguage && document.documentElement.setAttribute("lang", i.resolvedLanguage);
|
|
365
|
+
}), i.on("languageChanged", (u) => {
|
|
366
|
+
document.documentElement.setAttribute("lang", u);
|
|
367
367
|
})), null;
|
|
368
|
-
},
|
|
368
|
+
}, Me = ({
|
|
369
369
|
dsn: e,
|
|
370
370
|
integrations: r,
|
|
371
371
|
tracesSampleRate: a,
|
|
372
372
|
replaysSessionSampleRate: o,
|
|
373
373
|
replaysOnErrorSampleRate: n,
|
|
374
|
-
tracePropagationTargets:
|
|
374
|
+
tracePropagationTargets: i,
|
|
375
375
|
ignoreErrors: c,
|
|
376
|
-
debug:
|
|
377
|
-
environment:
|
|
378
|
-
release:
|
|
379
|
-
...
|
|
376
|
+
debug: l,
|
|
377
|
+
environment: u,
|
|
378
|
+
release: p,
|
|
379
|
+
...s
|
|
380
380
|
}) => {
|
|
381
|
-
const { libraries: m } =
|
|
382
|
-
if (!
|
|
381
|
+
const { libraries: m } = j(S), y = s?.sentry || m?.sentry, v = s?.reactRouter || m?.reactRouter;
|
|
382
|
+
if (!y)
|
|
383
383
|
throw new Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
384
384
|
if (!v)
|
|
385
385
|
throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
386
|
-
if (
|
|
386
|
+
if (y.isInitialized())
|
|
387
387
|
return null;
|
|
388
|
-
const { createRoutesFromChildren:
|
|
389
|
-
return (
|
|
390
|
-
debug:
|
|
388
|
+
const { createRoutesFromChildren: T, matchRoutes: A, useLocation: P, useNavigationType: g } = v;
|
|
389
|
+
return (l || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") && y.init({
|
|
390
|
+
debug: l,
|
|
391
391
|
dsn: e,
|
|
392
|
-
environment:
|
|
392
|
+
environment: u || "production",
|
|
393
393
|
ignoreErrors: [
|
|
394
394
|
...c || [],
|
|
395
395
|
/dynamically imported module/,
|
|
@@ -400,23 +400,23 @@ const Ue = ({ IMaskMixin: e, ...r }) => {
|
|
|
400
400
|
/vite:preloadError/
|
|
401
401
|
],
|
|
402
402
|
integrations: [
|
|
403
|
-
|
|
404
|
-
createRoutesFromChildren:
|
|
405
|
-
matchRoutes:
|
|
406
|
-
useEffect:
|
|
407
|
-
useLocation:
|
|
408
|
-
useNavigationType:
|
|
403
|
+
y.reactRouterV6BrowserTracingIntegration({
|
|
404
|
+
createRoutesFromChildren: T,
|
|
405
|
+
matchRoutes: A,
|
|
406
|
+
useEffect: k,
|
|
407
|
+
useLocation: P,
|
|
408
|
+
useNavigationType: g
|
|
409
409
|
}),
|
|
410
410
|
...r || []
|
|
411
411
|
],
|
|
412
|
-
release:
|
|
412
|
+
release: p,
|
|
413
413
|
replaysOnErrorSampleRate: n || 1,
|
|
414
414
|
replaysSessionSampleRate: o || 0.1,
|
|
415
|
-
tracePropagationTargets:
|
|
415
|
+
tracePropagationTargets: i,
|
|
416
416
|
tracesSampleRate: a || 1
|
|
417
417
|
}), null;
|
|
418
|
-
},
|
|
419
|
-
if (
|
|
418
|
+
}, Je = () => (k(() => {
|
|
419
|
+
if (L)
|
|
420
420
|
return;
|
|
421
421
|
const e = (r) => {
|
|
422
422
|
try {
|
|
@@ -427,85 +427,27 @@ const Ue = ({ IMaskMixin: e, ...r }) => {
|
|
|
427
427
|
return window.addEventListener("vite:preloadError", e), () => {
|
|
428
428
|
window.removeEventListener("vite:preloadError", e);
|
|
429
429
|
};
|
|
430
|
-
}, []), null), ne = /* @__PURE__ */ new WeakMap(), Ee = "user",
|
|
431
|
-
const { libraries:
|
|
432
|
-
if (!
|
|
430
|
+
}, []), null), ne = /* @__PURE__ */ new WeakMap(), Ee = "user", qe = ({ Fallback: e, isLogged: r, loginPath: a = "/login", redirect401Path: o = "/login", ...n }) => {
|
|
431
|
+
const { libraries: i, localStorageKeys: c } = j(S), l = n?.reactRouter || i?.reactRouter, u = n?.axios || i?.axios, p = n?.localStorageKey || c?.user || Ee;
|
|
432
|
+
if (!l)
|
|
433
433
|
throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
434
|
-
const [
|
|
435
|
-
return
|
|
436
|
-
ne.has(
|
|
434
|
+
const [s, m] = J(null), { useLocation: y, Navigate: v, Outlet: T } = l, A = y(), P = typeof r == "function" ? r() : !!r, g = typeof P == "boolean" ? P : P?.isLogged;
|
|
435
|
+
return k(() => {
|
|
436
|
+
ne.has(u) || (ne.set(u, !0), u.interceptors.response.use(
|
|
437
437
|
(d) => d,
|
|
438
|
-
(d) => (typeof d == "object" && d && "response" in d && d.response && typeof d.response == "object" && "status" in d.response && d.response && typeof d.response == "object" && "status" in d.response && d?.response?.status === 401 && (typeof d == "object" && d && "config" in d && d.config && typeof d.config == "object" && "headers" in d.config && d.config.headers && typeof d.config.headers == "object" && "Authorization" in d.config.headers && d.config.headers.Authorization && (
|
|
438
|
+
(d) => (typeof d == "object" && d && "response" in d && d.response && typeof d.response == "object" && "status" in d.response && d.response && typeof d.response == "object" && "status" in d.response && d?.response?.status === 401 && (typeof d == "object" && d && "config" in d && d.config && typeof d.config == "object" && "headers" in d.config && d.config.headers && typeof d.config.headers == "object" && "Authorization" in d.config.headers && d.config.headers.Authorization && (u.defaults.headers.common.Authorization = null, typeof window < "u" && window.localStorage && localStorage.removeItem(p)), m(o)), Promise.reject(d))
|
|
439
439
|
));
|
|
440
|
-
}, [
|
|
441
|
-
},
|
|
442
|
-
if ("serviceWorker" in navigator)
|
|
443
|
-
try {
|
|
444
|
-
const e = await navigator.serviceWorker.getRegistrations();
|
|
445
|
-
await Promise.all(e.map((r) => r.unregister()));
|
|
446
|
-
} catch (e) {
|
|
447
|
-
console.error("Failed to unregister service workers:", e);
|
|
448
|
-
}
|
|
449
|
-
}, Be = () => (S(() => {
|
|
450
|
-
Re();
|
|
451
|
-
}, []), null), be = async () => {
|
|
452
|
-
if ("caches" in window)
|
|
453
|
-
try {
|
|
454
|
-
const e = await caches.keys();
|
|
455
|
-
await Promise.all(e.map((r) => caches.delete(r)));
|
|
456
|
-
} catch (e) {
|
|
457
|
-
console.error("Failed to clear caches:", e);
|
|
458
|
-
}
|
|
459
|
-
}, Xe = ({ autoUpdate: e, renderDialog: r, clearCachesOnReload: a }) => {
|
|
460
|
-
const o = me(null), [n, s] = Y(!1), c = O(() => {
|
|
461
|
-
if (o.current && o.current.postMessage({ type: "SKIP_WAITING" }), a)
|
|
462
|
-
try {
|
|
463
|
-
localStorage.setItem("tracktor_clear_caches", "1");
|
|
464
|
-
} catch {
|
|
465
|
-
}
|
|
466
|
-
window.location.reload();
|
|
467
|
-
}, [a]);
|
|
468
|
-
S(() => {
|
|
469
|
-
try {
|
|
470
|
-
localStorage.getItem("tracktor_clear_caches") === "1" && (localStorage.removeItem("tracktor_clear_caches"), be().catch(console.error));
|
|
471
|
-
} catch {
|
|
472
|
-
}
|
|
473
|
-
}, []);
|
|
474
|
-
const u = O(() => {
|
|
475
|
-
window.confirm("A new version is available. The app will reload now.") && c();
|
|
476
|
-
}, [c]);
|
|
477
|
-
return S(() => {
|
|
478
|
-
if (!("serviceWorker" in navigator))
|
|
479
|
-
return;
|
|
480
|
-
let l, f;
|
|
481
|
-
const i = (g) => {
|
|
482
|
-
g && navigator.serviceWorker.controller && (o.current = g, s(!0));
|
|
483
|
-
}, m = () => {
|
|
484
|
-
const g = l?.installing;
|
|
485
|
-
g && (f = () => {
|
|
486
|
-
g.state === "installed" && i(g);
|
|
487
|
-
}, g.addEventListener("statechange", f));
|
|
488
|
-
};
|
|
489
|
-
return (async () => {
|
|
490
|
-
l = await navigator.serviceWorker.getRegistration(), l && (i(l.waiting), l.addEventListener("updatefound", m));
|
|
491
|
-
})().catch(console.error), () => {
|
|
492
|
-
l?.removeEventListener("updatefound", m), f && l?.installing && l.installing.removeEventListener("statechange", f);
|
|
493
|
-
};
|
|
494
|
-
}, []), S(() => {
|
|
495
|
-
n && e && c();
|
|
496
|
-
}, [e, n, c]), S(() => {
|
|
497
|
-
n && !e && !r && u();
|
|
498
|
-
}, [r, u, n, e]), n && !e && r ? r(c) : null;
|
|
499
|
-
}, _e = (e) => e.charAt(0).toUpperCase() + e.slice(1).toLowerCase(), Se = (e) => {
|
|
440
|
+
}, [u, p, o]), g && !s ? /* @__PURE__ */ C.jsx(ge, { fallback: e, children: A.state?.from?.state && A.state?.from?.pathname === a ? /* @__PURE__ */ C.jsx(v, { to: A.state.from.state.from.pathname + A.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ C.jsx(T, {}) }) : /* @__PURE__ */ C.jsx(v, { to: a + A.search, state: { from: A }, replace: !0 });
|
|
441
|
+
}, we = (e) => e.charAt(0).toUpperCase() + e.slice(1).toLowerCase(), be = (e) => {
|
|
500
442
|
const r = e.split(/[/\\]/).pop() || "";
|
|
501
443
|
return r.substring(0, r.lastIndexOf("."));
|
|
502
|
-
},
|
|
503
|
-
const o = e.split("/").filter((n) => n.length > 0).map((n) => n.replace(/\${([^}]*)}/g, "$1").split(/[_-]/).map((
|
|
444
|
+
}, Re = (e) => {
|
|
445
|
+
const o = e.split("/").filter((n) => n.length > 0).map((n) => n.replace(/\${([^}]*)}/g, "$1").split(/[_-]/).map((u) => u.charAt(0).toUpperCase() + u.slice(1)).join("")).join("");
|
|
504
446
|
return o.charAt(0).toLowerCase() + o.slice(1);
|
|
505
|
-
},
|
|
506
|
-
const n =
|
|
447
|
+
}, _e = (e) => (e.split("/").pop() || e).replace(/\.json$/, "").replace(/^openapi\./, ""), Se = (e, r, a, o) => {
|
|
448
|
+
const n = Re(r), i = we(a), c = `${n}${i}`;
|
|
507
449
|
return e && typeof e == "object" && "operationId" in e && o?.includes(String(e.operationId)) ? `${c}AsQuery` : c;
|
|
508
|
-
},
|
|
450
|
+
}, Ae = (e, r) => {
|
|
509
451
|
const a = {};
|
|
510
452
|
return e?.forEach((o) => {
|
|
511
453
|
a[o] = {
|
|
@@ -522,149 +464,149 @@ const Ue = ({ IMaskMixin: e, ...r }) => {
|
|
|
522
464
|
}
|
|
523
465
|
};
|
|
524
466
|
}), Object.keys(a).length ? a : void 0;
|
|
525
|
-
},
|
|
526
|
-
const { output: n, useInfiniteIds:
|
|
467
|
+
}, Ge = (e) => (Array.isArray(e) ? e : [e]).reduce((a, o) => {
|
|
468
|
+
const { output: n, useInfiniteIds: i, useQueryIds: c, input: l = "./openapi.json", customAxiosInstancePath: u, overrideApiName: p } = o || {}, s = p || _e(l), m = u || "./node_modules/@tracktor/shared-module/dist/axiosCustomInstance.ts";
|
|
527
469
|
return {
|
|
528
470
|
...a,
|
|
529
|
-
[
|
|
530
|
-
input:
|
|
471
|
+
[s]: {
|
|
472
|
+
input: l,
|
|
531
473
|
output: {
|
|
532
474
|
baseUrl: n?.baseUrl,
|
|
533
475
|
client: "react-query",
|
|
534
476
|
mode: "tags-split",
|
|
535
477
|
override: {
|
|
536
|
-
...(
|
|
537
|
-
operations:
|
|
478
|
+
...(i?.length || c?.length) && {
|
|
479
|
+
operations: Ae(i, c)
|
|
538
480
|
},
|
|
539
|
-
header: (
|
|
481
|
+
header: (y) => [
|
|
540
482
|
"Generated by orval 🍺",
|
|
541
|
-
...
|
|
542
|
-
...
|
|
483
|
+
...y.title ? [y.title] : [],
|
|
484
|
+
...y.description ? [y.description] : []
|
|
543
485
|
],
|
|
544
486
|
mutator: {
|
|
545
|
-
name:
|
|
487
|
+
name: be(m),
|
|
546
488
|
path: m
|
|
547
489
|
},
|
|
548
|
-
operationName: (
|
|
490
|
+
operationName: (y, v, T) => Se(y, v, T, c),
|
|
549
491
|
query: {
|
|
550
492
|
useQuery: !0
|
|
551
493
|
}
|
|
552
494
|
},
|
|
553
|
-
schemas: n?.schemas || `src/api/${
|
|
554
|
-
target: n?.target || `src/api/${
|
|
495
|
+
schemas: n?.schemas || `src/api/${s}/model`,
|
|
496
|
+
target: n?.target || `src/api/${s}/services/api.ts`,
|
|
555
497
|
...n
|
|
556
498
|
}
|
|
557
499
|
}
|
|
558
500
|
};
|
|
559
|
-
}, {}),
|
|
501
|
+
}, {}), je = (e) => e && typeof e == "function", Pe = (e) => e && typeof e == "function", Ke = ({
|
|
560
502
|
children: e,
|
|
561
503
|
defaultQueriesOptions: r,
|
|
562
504
|
defaultMutationsOptions: a,
|
|
563
505
|
...o
|
|
564
506
|
}) => {
|
|
565
|
-
const { libraries: n } =
|
|
566
|
-
if (!
|
|
507
|
+
const { libraries: n } = j(S), i = o?.QueryClient || n?.reactQuery?.QueryClient, c = o?.QueryClientProvider || n?.reactQuery?.QueryClientProvider;
|
|
508
|
+
if (!i)
|
|
567
509
|
throw new Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
568
510
|
if (!c)
|
|
569
511
|
throw new Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
570
|
-
if (!
|
|
512
|
+
if (!je(c))
|
|
571
513
|
throw new Error("Provided QueryClientProvider dependencies are not valid.");
|
|
572
|
-
if (!
|
|
514
|
+
if (!Pe(i))
|
|
573
515
|
throw new Error("Provided QueryClient dependencies are not valid.");
|
|
574
|
-
const
|
|
516
|
+
const l = new i({
|
|
575
517
|
defaultOptions: {
|
|
576
518
|
mutations: {
|
|
577
519
|
...a
|
|
578
520
|
},
|
|
579
521
|
queries: {
|
|
580
|
-
getNextPageParam: (
|
|
522
|
+
getNextPageParam: (u, p, s) => u.length + (s || 0),
|
|
581
523
|
refetchOnWindowFocus: !1,
|
|
582
524
|
retry: 3,
|
|
583
525
|
...r
|
|
584
526
|
}
|
|
585
527
|
}
|
|
586
528
|
});
|
|
587
|
-
return /* @__PURE__ */ C.jsx(c, { client:
|
|
588
|
-
},
|
|
589
|
-
const { fractionDigits: a = 0, metric: o = "km", spacingBetween: n = !0 } = r || {},
|
|
590
|
-
return Number.isNaN(
|
|
591
|
-
},
|
|
529
|
+
return /* @__PURE__ */ C.jsx(c, { client: l, children: e });
|
|
530
|
+
}, Te = ({ library: e, date: r, format: a = "ll" }) => e(r).format(a), Ce = (e, r) => {
|
|
531
|
+
const { fractionDigits: a = 0, metric: o = "km", spacingBetween: n = !0 } = r || {}, i = Number(e), c = n ? " " : "";
|
|
532
|
+
return Number.isNaN(i) ? `0${c}${o}` : `${i.toFixed(a)}${c}${o}`;
|
|
533
|
+
}, xe = (e) => !e || typeof e != "string" ? "" : e.replace(/_/g, " ").toLowerCase().split(" ").map((a) => a.length > 0 ? a.charAt(0).toUpperCase() + a.slice(1) : a).join(" "), ke = (e) => e?.startsWith("/") ? e?.startsWith("/files") ? e : `/files${e}` : e?.startsWith("files") ? `/${e}` : `/files/${e}`, Oe = ({ path: e, size: r, apiURL: a }) => {
|
|
592
534
|
if (!e)
|
|
593
535
|
return "";
|
|
594
|
-
const o =
|
|
595
|
-
return typeof r == "number" &&
|
|
596
|
-
},
|
|
597
|
-
const { apiURL: r, libraries: a } =
|
|
536
|
+
const o = ke(e), n = `${a}${o}`, i = n.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/) !== null;
|
|
537
|
+
return typeof r == "number" && i ? `${n.replace("/files", `/thumbs/${r}`)}` : n;
|
|
538
|
+
}, Be = (e) => {
|
|
539
|
+
const { apiURL: r, libraries: a } = j(S), o = e?.dayjs || a?.dayjs;
|
|
598
540
|
return {
|
|
599
|
-
dateAdapter: (c,
|
|
541
|
+
dateAdapter: (c, l) => {
|
|
600
542
|
if (!o)
|
|
601
543
|
throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
602
|
-
return
|
|
544
|
+
return Te({
|
|
603
545
|
date: c,
|
|
604
|
-
format:
|
|
546
|
+
format: l,
|
|
605
547
|
library: o
|
|
606
548
|
});
|
|
607
549
|
},
|
|
608
|
-
distanceAdapter:
|
|
609
|
-
filePathAdapter: (c,
|
|
550
|
+
distanceAdapter: Ce,
|
|
551
|
+
filePathAdapter: (c, l) => {
|
|
610
552
|
if (!r)
|
|
611
553
|
throw new Error(
|
|
612
554
|
"API URL is not provided. You can provide it with InjectDependenciesProvider or directly in props to filePathAdapter."
|
|
613
555
|
);
|
|
614
|
-
return typeof c == "string" && /^https?:\/\//.test(c) ? c :
|
|
556
|
+
return typeof c == "string" && /^https?:\/\//.test(c) ? c : Oe({
|
|
615
557
|
apiURL: r,
|
|
616
558
|
path: c,
|
|
617
|
-
size:
|
|
559
|
+
size: l
|
|
618
560
|
});
|
|
619
561
|
},
|
|
620
|
-
worksiteNameAdapter:
|
|
562
|
+
worksiteNameAdapter: xe
|
|
621
563
|
};
|
|
622
|
-
},
|
|
623
|
-
const { libraries: r, localStorageKeys: a } =
|
|
564
|
+
}, He = (e) => {
|
|
565
|
+
const { libraries: r, localStorageKeys: a } = j(S), o = e?.axios || r?.axios, n = e?.localStorageKey || a?.user || "user";
|
|
624
566
|
if (!o)
|
|
625
567
|
throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");
|
|
626
|
-
const
|
|
627
|
-
({ tokenType:
|
|
628
|
-
o.defaults.headers.common.Authorization = `${
|
|
568
|
+
const i = Y(
|
|
569
|
+
({ tokenType: l, accessToken: u }) => {
|
|
570
|
+
o.defaults.headers.common.Authorization = `${l} ${u}`;
|
|
629
571
|
},
|
|
630
572
|
[o.defaults.headers.common]
|
|
631
573
|
), c = () => {
|
|
632
574
|
o.defaults.headers.common.Authorization = null;
|
|
633
575
|
};
|
|
634
|
-
return
|
|
635
|
-
if (
|
|
576
|
+
return k(() => {
|
|
577
|
+
if (L)
|
|
636
578
|
return;
|
|
637
|
-
const
|
|
638
|
-
if (
|
|
579
|
+
const l = ({ newValue: u, key: p }) => {
|
|
580
|
+
if (p === n && u)
|
|
639
581
|
try {
|
|
640
|
-
const { accessToken:
|
|
641
|
-
|
|
642
|
-
} catch (
|
|
643
|
-
console.error("Failed to parse newValue from localStorage:",
|
|
582
|
+
const { accessToken: s, tokenType: m } = JSON.parse(u);
|
|
583
|
+
i({ accessToken: s, tokenType: m });
|
|
584
|
+
} catch (s) {
|
|
585
|
+
console.error("Failed to parse newValue from localStorage:", s);
|
|
644
586
|
}
|
|
645
587
|
};
|
|
646
|
-
return window.addEventListener("storage",
|
|
647
|
-
window.removeEventListener("storage",
|
|
588
|
+
return window.addEventListener("storage", l), () => {
|
|
589
|
+
window.removeEventListener("storage", l);
|
|
648
590
|
};
|
|
649
|
-
}, [n,
|
|
591
|
+
}, [n, i]), {
|
|
650
592
|
clearAuthenticationToken: c,
|
|
651
|
-
setAuthenticationToken:
|
|
593
|
+
setAuthenticationToken: i
|
|
652
594
|
};
|
|
653
|
-
},
|
|
654
|
-
const [a, o] =
|
|
595
|
+
}, D = (e, r) => r === "short" ? e.split("-")[0] : e, Xe = (e, r = "full") => {
|
|
596
|
+
const [a, o] = J(() => {
|
|
655
597
|
const n = e?.language || navigator.language;
|
|
656
|
-
return e && "isInitialized" in e && e.isInitialized,
|
|
598
|
+
return e && "isInitialized" in e && e.isInitialized, D(n, r);
|
|
657
599
|
});
|
|
658
|
-
return
|
|
659
|
-
e && "isInitialized" in e && e.isInitialized && e.language && o(
|
|
660
|
-
const n = (
|
|
661
|
-
o(
|
|
600
|
+
return k(() => {
|
|
601
|
+
e && "isInitialized" in e && e.isInitialized && e.language && o(D(e.language, r));
|
|
602
|
+
const n = (i) => {
|
|
603
|
+
o(D(i, r));
|
|
662
604
|
};
|
|
663
605
|
return e?.on?.("languageChanged", n), () => {
|
|
664
606
|
e?.off?.("languageChanged", n);
|
|
665
607
|
};
|
|
666
608
|
}, [e, r]), a;
|
|
667
|
-
},
|
|
609
|
+
}, Ie = "tracktor.filter", Ne = {
|
|
668
610
|
getFilter: () => {
|
|
669
611
|
},
|
|
670
612
|
getFilters: () => ({}),
|
|
@@ -678,158 +620,156 @@ const Ue = ({ IMaskMixin: e, ...r }) => {
|
|
|
678
620
|
} catch {
|
|
679
621
|
return e;
|
|
680
622
|
}
|
|
681
|
-
}, ae = (e, r, a) => `${a}_${e}=>${r}`,
|
|
623
|
+
}, ae = (e, r, a) => `${a}_${e}=>${r}`, Le = (e) => e.reduce((r, a) => {
|
|
682
624
|
const o = localStorage.getItem(a);
|
|
683
625
|
if (o)
|
|
684
626
|
try {
|
|
685
|
-
const n = JSON.parse(o),
|
|
686
|
-
|
|
627
|
+
const n = JSON.parse(o), i = Object.keys(n)?.[0];
|
|
628
|
+
i && (r[i] = Object.values(n)?.[0]);
|
|
687
629
|
} catch {
|
|
688
630
|
}
|
|
689
631
|
return r;
|
|
690
|
-
}, {}),
|
|
691
|
-
const { libraries: r, localStorageKeys: a } =
|
|
692
|
-
}], [
|
|
693
|
-
if (
|
|
694
|
-
return
|
|
632
|
+
}, {}), Ze = (e) => {
|
|
633
|
+
const { libraries: r, localStorageKeys: a } = j(S), o = e?.reactRouter || r?.reactRouter, { pathname: n } = o?.useLocation?.() ?? { pathname: "/" }, [i, c] = o?.useSearchParams?.() ?? [new URLSearchParams(), () => {
|
|
634
|
+
}], [l, u] = J({}), p = a?.filter || Ie, s = e?.syncWithUrl === void 0 ? !0 : e?.syncWithUrl, m = e?.persistToLocalStorage === void 0 ? !0 : e?.persistToLocalStorage;
|
|
635
|
+
if (L)
|
|
636
|
+
return Ne;
|
|
695
637
|
if (!o)
|
|
696
638
|
throw new Error(
|
|
697
639
|
"React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of reactRouter."
|
|
698
640
|
);
|
|
699
|
-
const
|
|
700
|
-
(
|
|
701
|
-
), v = (
|
|
702
|
-
const
|
|
641
|
+
const y = () => Object.keys(localStorage).filter(
|
|
642
|
+
(g) => g.startsWith(p) && g.endsWith(e?.pathname || n)
|
|
643
|
+
), v = (g, d, R = !0) => {
|
|
644
|
+
const b = ae(g, e?.pathname || n, p);
|
|
703
645
|
if (!d || Array.isArray(d) && !d.length) {
|
|
704
|
-
|
|
705
|
-
const
|
|
706
|
-
return delete
|
|
707
|
-
}), m && localStorage.removeItem(
|
|
646
|
+
s ? (i.delete(g), c(i)) : u((_) => {
|
|
647
|
+
const x = { ..._ };
|
|
648
|
+
return delete x[g], x;
|
|
649
|
+
}), m && localStorage.removeItem(b);
|
|
708
650
|
return;
|
|
709
651
|
}
|
|
710
|
-
m &&
|
|
652
|
+
m && R && d && localStorage.setItem(b, JSON.stringify({ ...i, [g]: d })), s && d ? (i.set(g, JSON.stringify(d)), c(i)) : !s && d && u((_) => ({ ..._, [g]: d }));
|
|
711
653
|
};
|
|
712
654
|
return {
|
|
713
|
-
getFilter: (
|
|
714
|
-
if (
|
|
715
|
-
const
|
|
716
|
-
if (
|
|
717
|
-
return oe(
|
|
655
|
+
getFilter: (g, d) => {
|
|
656
|
+
if (s) {
|
|
657
|
+
const R = i.get(g);
|
|
658
|
+
if (R)
|
|
659
|
+
return oe(R);
|
|
718
660
|
} else {
|
|
719
|
-
const
|
|
720
|
-
if (
|
|
721
|
-
return
|
|
661
|
+
const R = l[g];
|
|
662
|
+
if (R !== void 0)
|
|
663
|
+
return R;
|
|
722
664
|
}
|
|
723
665
|
if (m) {
|
|
724
|
-
const
|
|
725
|
-
if (
|
|
666
|
+
const R = ae(g, e?.pathname || n, p), b = localStorage.getItem(R);
|
|
667
|
+
if (b)
|
|
726
668
|
try {
|
|
727
|
-
const _ = JSON.parse(
|
|
728
|
-
return !
|
|
669
|
+
const _ = JSON.parse(b)[g];
|
|
670
|
+
return !s && _ !== void 0 && u((x) => ({ ...x, [g]: _ })), _;
|
|
729
671
|
} catch {
|
|
730
672
|
}
|
|
731
673
|
}
|
|
732
674
|
return d;
|
|
733
675
|
},
|
|
734
676
|
getFilters: () => {
|
|
735
|
-
const
|
|
736
|
-
if (
|
|
737
|
-
const d = Array.from(
|
|
677
|
+
const g = m ? Le(y()) : {};
|
|
678
|
+
if (s) {
|
|
679
|
+
const d = Array.from(i.entries()).reduce((R, [b, _]) => (R[b] = oe(_), R), {});
|
|
738
680
|
return {
|
|
739
|
-
...
|
|
681
|
+
...g,
|
|
740
682
|
...d
|
|
741
683
|
};
|
|
742
684
|
}
|
|
743
685
|
return {
|
|
744
|
-
...
|
|
745
|
-
...
|
|
686
|
+
...g,
|
|
687
|
+
...l
|
|
746
688
|
};
|
|
747
689
|
},
|
|
748
|
-
handleFilter: (
|
|
749
|
-
if (
|
|
750
|
-
const _ = d || "value",
|
|
751
|
-
v(
|
|
690
|
+
handleFilter: (g, d) => (R, b) => {
|
|
691
|
+
if (b || Array.isArray(b) && b.length === 0) {
|
|
692
|
+
const _ = d || "value", x = typeof b == "object" && _ in b ? b[_] : b;
|
|
693
|
+
v(g, x);
|
|
752
694
|
return;
|
|
753
695
|
}
|
|
754
|
-
v(
|
|
696
|
+
v(g, void 0);
|
|
755
697
|
},
|
|
756
698
|
setFilter: v
|
|
757
699
|
};
|
|
758
|
-
},
|
|
700
|
+
}, et = ({
|
|
759
701
|
data: e,
|
|
760
702
|
fetchNextPage: r,
|
|
761
703
|
isFetchingNextPage: a,
|
|
762
704
|
isInitialLoading: o,
|
|
763
705
|
isLoading: n,
|
|
764
|
-
enabled:
|
|
706
|
+
enabled: i = !0
|
|
765
707
|
}) => {
|
|
766
|
-
const c =
|
|
767
|
-
async (
|
|
768
|
-
a || !
|
|
708
|
+
const c = Y(
|
|
709
|
+
async (u) => {
|
|
710
|
+
a || !i || await r({ pageParam: u?.pageParam || u.visibleRowsCount });
|
|
769
711
|
},
|
|
770
|
-
[
|
|
771
|
-
),
|
|
712
|
+
[i, r, a]
|
|
713
|
+
), l = M(() => {
|
|
772
714
|
if (e)
|
|
773
|
-
return e.pages.reduce((
|
|
715
|
+
return e.pages.reduce((u, p) => [...u, ...p], []);
|
|
774
716
|
}, [e]);
|
|
775
717
|
return {
|
|
776
718
|
fetchNextPageOnRowsScrollEnd: c,
|
|
777
719
|
isLoading: a || n,
|
|
778
720
|
loadingVariant: o ? "skeleton" : "linear-progress",
|
|
779
|
-
rows:
|
|
721
|
+
rows: l
|
|
780
722
|
};
|
|
781
|
-
},
|
|
782
|
-
const { libraries: r } =
|
|
783
|
-
(
|
|
784
|
-
if (
|
|
785
|
-
const { response:
|
|
786
|
-
if (
|
|
787
|
-
return String(
|
|
788
|
-
if (
|
|
789
|
-
return String(
|
|
790
|
-
if (
|
|
791
|
-
return String(
|
|
792
|
-
if (
|
|
793
|
-
const { detail: m } =
|
|
723
|
+
}, tt = (e) => {
|
|
724
|
+
const { libraries: r } = j(S), a = e?.i18 || r?.i18, o = e?.i18?.translateFunction || r?.i18?.translateFunction, n = a?.i18next?.t || o || ((p) => p), { unknownErrorTranslationKey: i = "error.unknownError" } = e || {}, c = n(i), l = Y(
|
|
725
|
+
(p) => {
|
|
726
|
+
if (p && typeof p == "object" && "response" in p) {
|
|
727
|
+
const { response: s } = p || {};
|
|
728
|
+
if (s && typeof s == "object" && "reason" in s && s.reason)
|
|
729
|
+
return String(s.reason);
|
|
730
|
+
if (s && typeof s == "object" && "data" in s && s.data && typeof s.data == "object" && "reason" in s.data && s.data.reason)
|
|
731
|
+
return String(s.data.reason);
|
|
732
|
+
if (s && typeof s == "object" && "data" in s && s.data && typeof s.data == "object" && "message" in s.data && s.data.message)
|
|
733
|
+
return String(s.data.message);
|
|
734
|
+
if (s && typeof s == "object" && "data" in s && s.data && typeof s.data == "object" && "detail" in s.data) {
|
|
735
|
+
const { detail: m } = s.data;
|
|
794
736
|
if (Array.isArray(m) && m.length > 0 && typeof m[0] == "object" && m[0] !== null && "msg" in m[0]) {
|
|
795
|
-
const { msg:
|
|
796
|
-
if (typeof
|
|
797
|
-
return String(
|
|
737
|
+
const { msg: y } = m[0];
|
|
738
|
+
if (typeof y == "string")
|
|
739
|
+
return String(y);
|
|
798
740
|
}
|
|
799
741
|
}
|
|
800
742
|
}
|
|
801
|
-
return
|
|
743
|
+
return p instanceof Error ? p.message : c;
|
|
802
744
|
},
|
|
803
745
|
[c]
|
|
804
746
|
);
|
|
805
|
-
return { getErrorCode:
|
|
806
|
-
const { response:
|
|
807
|
-
return
|
|
808
|
-
}, []), printError:
|
|
747
|
+
return { getErrorCode: Y((p) => {
|
|
748
|
+
const { response: s } = p || {};
|
|
749
|
+
return s?.error_code ? String(s?.error_code) : s?.data?.error_code ? String(s?.data?.error_code) : s?.error_code ? String(s?.error_code) : s?.data?.error_code ? String(s.data.error_code) : "unknown_error_code";
|
|
750
|
+
}, []), printError: l };
|
|
809
751
|
};
|
|
810
752
|
export {
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
it as useResponseError,
|
|
834
|
-
Oe as worksiteNameAdapter
|
|
753
|
+
Ue as GTMSendPageView,
|
|
754
|
+
We as InitializeAxiosConfig,
|
|
755
|
+
Qe as InitializeDaysJSConfig,
|
|
756
|
+
Ve as InitializeI18nConfig,
|
|
757
|
+
Me as InitializeSentryConfig,
|
|
758
|
+
S as InjectDependenciesContext,
|
|
759
|
+
ze as InjectDependenciesProvider,
|
|
760
|
+
Ye as MaskTextField,
|
|
761
|
+
Je as PreloadErrorHandler,
|
|
762
|
+
Ke as QueryClientProviderWithConfig,
|
|
763
|
+
qe as RequireAuth,
|
|
764
|
+
De as axiosCustomInstance,
|
|
765
|
+
Te as dateAdapter,
|
|
766
|
+
Ce as distanceAdapter,
|
|
767
|
+
Ge as getOrvalConfig,
|
|
768
|
+
Be as useAdapter,
|
|
769
|
+
He as useAuth,
|
|
770
|
+
Xe as useCurrentLanguage,
|
|
771
|
+
Ze as useFilters,
|
|
772
|
+
et as useInfiniteDataGrid,
|
|
773
|
+
tt as useResponseError,
|
|
774
|
+
xe as worksiteNameAdapter
|
|
835
775
|
};
|