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