@tracktor/shared-module 2.10.0 → 2.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,4 +1,4 @@
1
1
  # [Versions](https://github.com/Tracktor/shared-module/releases)
2
2
 
3
- ## v2.10.0
4
- - **[feat]** - remove `InitializeMapBoxConfig` component
3
+ ## v2.11.1
4
+ - **[fix]** - spacing`distanceAdapter`
@@ -11,7 +11,10 @@ export interface useAdapterParams {
11
11
  */
12
12
  export declare const useAdapter: (params?: useAdapterParams) => {
13
13
  dateAdapter: (date: string | number | Date | null | undefined, format?: string) => string;
14
- distanceAdapter: (distance?: string | number | null | undefined, metric?: string) => string;
14
+ distanceAdapter: (distance?: string | number | null | undefined, options?: {
15
+ fractionDigits?: number | undefined;
16
+ metric?: string | undefined;
17
+ } | undefined) => string;
15
18
  filePathAdapter: (path?: string | null, size?: number | "full") => string;
16
19
  worksiteNameAdapter: (name: unknown) => string;
17
20
  };
package/dist/main.js CHANGED
@@ -13,11 +13,11 @@ var Ne;
13
13
  function Et() {
14
14
  if (Ne) return K;
15
15
  Ne = 1;
16
- var t = Ve, n = Symbol.for("react.element"), o = Symbol.for("react.fragment"), c = Object.prototype.hasOwnProperty, a = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, l = { key: !0, ref: !0, __self: !0, __source: !0 };
16
+ var t = Ve, n = Symbol.for("react.element"), o = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, a = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, l = { key: !0, ref: !0, __self: !0, __source: !0 };
17
17
  function f(d, u, m) {
18
18
  var g, C = {}, b = null, s = null;
19
19
  m !== void 0 && (b = "" + m), u.key !== void 0 && (b = "" + u.key), u.ref !== void 0 && (s = u.ref);
20
- for (g in u) c.call(u, g) && !l.hasOwnProperty(g) && (C[g] = u[g]);
20
+ for (g in u) i.call(u, g) && !l.hasOwnProperty(g) && (C[g] = u[g]);
21
21
  if (d && d.defaultProps) for (g in u = d.defaultProps, u) C[g] === void 0 && (C[g] = u[g]);
22
22
  return { $$typeof: n, type: d, key: b, ref: s, props: C, _owner: a.current };
23
23
  }
@@ -36,7 +36,7 @@ var q = {};
36
36
  var Ye;
37
37
  function Rt() {
38
38
  return Ye || (Ye = 1, process.env.NODE_ENV !== "production" && function() {
39
- var t = Ve, n = Symbol.for("react.element"), o = Symbol.for("react.portal"), c = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), f = Symbol.for("react.provider"), d = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), m = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), b = Symbol.for("react.lazy"), s = Symbol.for("react.offscreen"), S = Symbol.iterator, w = "@@iterator";
39
+ var t = Ve, n = Symbol.for("react.element"), o = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), f = Symbol.for("react.provider"), d = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), m = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), b = Symbol.for("react.lazy"), s = Symbol.for("react.offscreen"), S = Symbol.iterator, w = "@@iterator";
40
40
  function P(e) {
41
41
  if (e === null || typeof e != "object")
42
42
  return null;
@@ -46,16 +46,16 @@ function Rt() {
46
46
  var h = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
47
47
  function _(e) {
48
48
  {
49
- for (var r = arguments.length, i = new Array(r > 1 ? r - 1 : 0), v = 1; v < r; v++)
50
- i[v - 1] = arguments[v];
51
- x("error", e, i);
49
+ for (var r = arguments.length, c = new Array(r > 1 ? r - 1 : 0), v = 1; v < r; v++)
50
+ c[v - 1] = arguments[v];
51
+ x("error", e, c);
52
52
  }
53
53
  }
54
- function x(e, r, i) {
54
+ function x(e, r, c) {
55
55
  {
56
56
  var v = h.ReactDebugCurrentFrame, R = v.getStackAddendum();
57
- R !== "" && (r += "%s", i = i.concat([R]));
58
- var p = i.map(function(E) {
57
+ R !== "" && (r += "%s", c = c.concat([R]));
58
+ var p = c.map(function(E) {
59
59
  return String(E);
60
60
  });
61
61
  p.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, p);
@@ -64,18 +64,18 @@ function Rt() {
64
64
  var F = !1, L = !1, $ = !1, T = !1, ge = !1, ne;
65
65
  ne = Symbol.for("react.module.reference");
66
66
  function B(e) {
67
- return !!(typeof e == "string" || typeof e == "function" || e === c || e === l || ge || e === a || e === m || e === g || T || e === s || F || L || $ || typeof e == "object" && e !== null && (e.$$typeof === b || e.$$typeof === C || e.$$typeof === f || e.$$typeof === d || e.$$typeof === u || // This needs to include all possible module reference object
67
+ return !!(typeof e == "string" || typeof e == "function" || e === i || e === l || ge || e === a || e === m || e === g || T || e === s || F || L || $ || typeof e == "object" && e !== null && (e.$$typeof === b || e.$$typeof === C || e.$$typeof === f || e.$$typeof === d || e.$$typeof === u || // This needs to include all possible module reference object
68
68
  // types supported by any Flight configuration anywhere since
69
69
  // we don't know which Flight build this will end up being used
70
70
  // with.
71
71
  e.$$typeof === ne || e.getModuleId !== void 0));
72
72
  }
73
- function Ue(e, r, i) {
73
+ function Ue(e, r, c) {
74
74
  var v = e.displayName;
75
75
  if (v)
76
76
  return v;
77
77
  var R = r.displayName || r.name || "";
78
- return R !== "" ? i + "(" + R + ")" : i;
78
+ return R !== "" ? c + "(" + R + ")" : c;
79
79
  }
80
80
  function he(e) {
81
81
  return e.displayName || "Context";
@@ -88,7 +88,7 @@ function Rt() {
88
88
  if (typeof e == "string")
89
89
  return e;
90
90
  switch (e) {
91
- case c:
91
+ case i:
92
92
  return "Fragment";
93
93
  case o:
94
94
  return "Portal";
@@ -107,8 +107,8 @@ function Rt() {
107
107
  var r = e;
108
108
  return he(r) + ".Consumer";
109
109
  case f:
110
- var i = e;
111
- return he(i._context) + ".Provider";
110
+ var c = e;
111
+ return he(c._context) + ".Provider";
112
112
  case u:
113
113
  return Ue(e, e.render, "ForwardRef");
114
114
  case C:
@@ -188,7 +188,7 @@ function Rt() {
188
188
  }
189
189
  }
190
190
  var oe = h.ReactCurrentDispatcher, ae;
191
- function Q(e, r, i) {
191
+ function Q(e, r, c) {
192
192
  {
193
193
  if (ae === void 0)
194
194
  try {
@@ -210,9 +210,9 @@ function Rt() {
210
210
  if (!e || ie)
211
211
  return "";
212
212
  {
213
- var i = X.get(e);
214
- if (i !== void 0)
215
- return i;
213
+ var c = X.get(e);
214
+ if (c !== void 0)
215
+ return c;
216
216
  }
217
217
  var v;
218
218
  ie = !0;
@@ -277,14 +277,14 @@ function Rt() {
277
277
  var M = e ? e.displayName || e.name : "", $e = M ? Q(M) : "";
278
278
  return typeof e == "function" && X.set(e, $e), $e;
279
279
  }
280
- function Ke(e, r, i) {
280
+ function Ke(e, r, c) {
281
281
  return Ce(e, !1);
282
282
  }
283
283
  function qe(e) {
284
284
  var r = e.prototype;
285
285
  return !!(r && r.isReactComponent);
286
286
  }
287
- function H(e, r, i) {
287
+ function H(e, r, c) {
288
288
  if (e == null)
289
289
  return "";
290
290
  if (typeof e == "function")
@@ -302,11 +302,11 @@ function Rt() {
302
302
  case u:
303
303
  return Ke(e.render);
304
304
  case C:
305
- return H(e.type, r, i);
305
+ return H(e.type, r, c);
306
306
  case b: {
307
307
  var v = e, R = v._payload, p = v._init;
308
308
  try {
309
- return H(p(R), r, i);
309
+ return H(p(R), r, c);
310
310
  } catch {
311
311
  }
312
312
  }
@@ -316,12 +316,12 @@ function Rt() {
316
316
  var Z = Object.prototype.hasOwnProperty, be = {}, Pe = h.ReactDebugCurrentFrame;
317
317
  function ee(e) {
318
318
  if (e) {
319
- var r = e._owner, i = H(e.type, e._source, r ? r.type : null);
320
- Pe.setExtraStackFrame(i);
319
+ var r = e._owner, c = H(e.type, e._source, r ? r.type : null);
320
+ Pe.setExtraStackFrame(c);
321
321
  } else
322
322
  Pe.setExtraStackFrame(null);
323
323
  }
324
- function Be(e, r, i, v, R) {
324
+ function Be(e, r, c, v, R) {
325
325
  {
326
326
  var p = Function.call.bind(Z);
327
327
  for (var E in e)
@@ -329,14 +329,14 @@ function Rt() {
329
329
  var y = void 0;
330
330
  try {
331
331
  if (typeof e[E] != "function") {
332
- var A = Error((v || "React class") + ": " + i + " type `" + E + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[E] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
332
+ var A = Error((v || "React class") + ": " + c + " type `" + E + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[E] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
333
333
  throw A.name = "Invariant Violation", A;
334
334
  }
335
- y = e[E](r, E, v, i, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
335
+ y = e[E](r, E, v, c, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
336
336
  } catch (j) {
337
337
  y = j;
338
338
  }
339
- y && !(y instanceof Error) && (ee(R), _("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", v || "React class", i, E, typeof y), ee(null)), y instanceof Error && !(y.message in be) && (be[y.message] = !0, ee(R), _("Failed %s type: %s", i, y.message), ee(null));
339
+ y && !(y instanceof Error) && (ee(R), _("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", v || "React class", c, E, typeof y), ee(null)), y instanceof Error && !(y.message in be) && (be[y.message] = !0, ee(R), _("Failed %s type: %s", c, y.message), ee(null));
340
340
  }
341
341
  }
342
342
  }
@@ -346,8 +346,8 @@ function Rt() {
346
346
  }
347
347
  function Xe(e) {
348
348
  {
349
- var r = typeof Symbol == "function" && Symbol.toStringTag, i = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
350
- return i;
349
+ var r = typeof Symbol == "function" && Symbol.toStringTag, c = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
350
+ return c;
351
351
  }
352
352
  }
353
353
  function He(e) {
@@ -389,40 +389,40 @@ function Rt() {
389
389
  }
390
390
  function rt(e, r) {
391
391
  if (typeof e.ref == "string" && J.current && r && J.current.stateNode !== r) {
392
- var i = N(J.current.type);
393
- se[i] || (_('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', N(J.current.type), e.ref), se[i] = !0);
392
+ var c = N(J.current.type);
393
+ se[c] || (_('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', N(J.current.type), e.ref), se[c] = !0);
394
394
  }
395
395
  }
396
396
  function nt(e, r) {
397
397
  {
398
- var i = function() {
398
+ var c = function() {
399
399
  Te || (Te = !0, _("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
400
400
  };
401
- i.isReactWarning = !0, Object.defineProperty(e, "key", {
402
- get: i,
401
+ c.isReactWarning = !0, Object.defineProperty(e, "key", {
402
+ get: c,
403
403
  configurable: !0
404
404
  });
405
405
  }
406
406
  }
407
407
  function ot(e, r) {
408
408
  {
409
- var i = function() {
409
+ var c = function() {
410
410
  Ae || (Ae = !0, _("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
411
411
  };
412
- i.isReactWarning = !0, Object.defineProperty(e, "ref", {
413
- get: i,
412
+ c.isReactWarning = !0, Object.defineProperty(e, "ref", {
413
+ get: c,
414
414
  configurable: !0
415
415
  });
416
416
  }
417
417
  }
418
- var at = function(e, r, i, v, R, p, E) {
418
+ var at = function(e, r, c, v, R, p, E) {
419
419
  var y = {
420
420
  // This tag allows us to uniquely identify this as a React Element
421
421
  $$typeof: n,
422
422
  // Built-in properties that belong on the element
423
423
  type: e,
424
424
  key: r,
425
- ref: i,
425
+ ref: c,
426
426
  props: E,
427
427
  // Record the component responsible for creating this element.
428
428
  _owner: p
@@ -444,10 +444,10 @@ function Rt() {
444
444
  value: R
445
445
  }), Object.freeze && (Object.freeze(y.props), Object.freeze(y)), y;
446
446
  };
447
- function it(e, r, i, v, R) {
447
+ function it(e, r, c, v, R) {
448
448
  {
449
449
  var p, E = {}, y = null, A = null;
450
- i !== void 0 && (Oe(i), y = "" + i), tt(r) && (Oe(r.key), y = "" + r.key), et(r) && (A = r.ref, rt(r, R));
450
+ c !== void 0 && (Oe(c), y = "" + c), tt(r) && (Oe(r.key), y = "" + r.key), et(r) && (A = r.ref, rt(r, R));
451
451
  for (p in r)
452
452
  Z.call(r, p) && !Ze.hasOwnProperty(p) && (E[p] = r[p]);
453
453
  if (e && e.defaultProps) {
@@ -465,8 +465,8 @@ function Rt() {
465
465
  var ue = h.ReactCurrentOwner, xe = h.ReactDebugCurrentFrame;
466
466
  function U(e) {
467
467
  if (e) {
468
- var r = e._owner, i = H(e.type, e._source, r ? r.type : null);
469
- xe.setExtraStackFrame(i);
468
+ var r = e._owner, c = H(e.type, e._source, r ? r.type : null);
469
+ xe.setExtraStackFrame(c);
470
470
  } else
471
471
  xe.setExtraStackFrame(null);
472
472
  }
@@ -495,10 +495,10 @@ Check the render method of \`` + e + "`.";
495
495
  {
496
496
  var r = Ie();
497
497
  if (!r) {
498
- var i = typeof e == "string" ? e : e.displayName || e.name;
499
- i && (r = `
498
+ var c = typeof e == "string" ? e : e.displayName || e.name;
499
+ c && (r = `
500
500
 
501
- Check the top-level render call using <` + i + ">.");
501
+ Check the top-level render call using <` + c + ">.");
502
502
  }
503
503
  return r;
504
504
  }
@@ -508,12 +508,12 @@ Check the top-level render call using <` + i + ">.");
508
508
  if (!e._store || e._store.validated || e.key != null)
509
509
  return;
510
510
  e._store.validated = !0;
511
- var i = st(r);
512
- if (ke[i])
511
+ var c = st(r);
512
+ if (ke[c])
513
513
  return;
514
- ke[i] = !0;
514
+ ke[c] = !0;
515
515
  var v = "";
516
- e && e._owner && e._owner !== ue.current && (v = " It was passed a child from " + N(e._owner.type) + "."), U(e), _('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', i, v), U(null);
516
+ e && e._owner && e._owner !== ue.current && (v = " It was passed a child from " + N(e._owner.type) + "."), U(e), _('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', c, v), U(null);
517
517
  }
518
518
  }
519
519
  function Fe(e, r) {
@@ -521,8 +521,8 @@ Check the top-level render call using <` + i + ">.");
521
521
  if (typeof e != "object")
522
522
  return;
523
523
  if (ce(e))
524
- for (var i = 0; i < e.length; i++) {
525
- var v = e[i];
524
+ for (var c = 0; c < e.length; c++) {
525
+ var v = e[c];
526
526
  fe(v) && De(v, r);
527
527
  }
528
528
  else if (fe(e))
@@ -540,18 +540,18 @@ Check the top-level render call using <` + i + ">.");
540
540
  var r = e.type;
541
541
  if (r == null || typeof r == "string")
542
542
  return;
543
- var i;
543
+ var c;
544
544
  if (typeof r == "function")
545
- i = r.propTypes;
545
+ c = r.propTypes;
546
546
  else if (typeof r == "object" && (r.$$typeof === u || // Note: Memo only checks outer props here.
547
547
  // Inner props are checked in the reconciler.
548
548
  r.$$typeof === C))
549
- i = r.propTypes;
549
+ c = r.propTypes;
550
550
  else
551
551
  return;
552
- if (i) {
552
+ if (c) {
553
553
  var v = N(r);
554
- Be(i, e.props, "prop", v, e);
554
+ Be(c, e.props, "prop", v, e);
555
555
  } else if (r.PropTypes !== void 0 && !le) {
556
556
  le = !0;
557
557
  var R = N(r);
@@ -562,8 +562,8 @@ Check the top-level render call using <` + i + ">.");
562
562
  }
563
563
  function lt(e) {
564
564
  {
565
- for (var r = Object.keys(e.props), i = 0; i < r.length; i++) {
566
- var v = r[i];
565
+ for (var r = Object.keys(e.props), c = 0; c < r.length; c++) {
566
+ var v = r[c];
567
567
  if (v !== "children" && v !== "key") {
568
568
  U(e), _("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", v), U(null);
569
569
  break;
@@ -572,7 +572,7 @@ Check the top-level render call using <` + i + ">.");
572
572
  e.ref !== null && (U(e), _("Invalid attribute `ref` supplied to `React.Fragment`."), U(null));
573
573
  }
574
574
  }
575
- function Le(e, r, i, v, R, p) {
575
+ function Le(e, r, c, v, R, p) {
576
576
  {
577
577
  var E = B(e);
578
578
  if (!E) {
@@ -583,7 +583,7 @@ Check the top-level render call using <` + i + ">.");
583
583
  var j;
584
584
  e === null ? j = "null" : ce(e) ? j = "array" : e !== void 0 && e.$$typeof === n ? (j = "<" + (N(e.type) || "Unknown") + " />", y = " Did you accidentally export a JSX literal instead of a component?") : j = typeof e, _("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", j, y);
585
585
  }
586
- var O = it(e, r, i, R, p);
586
+ var O = it(e, r, c, R, p);
587
587
  if (O == null)
588
588
  return O;
589
589
  if (E) {
@@ -599,32 +599,32 @@ Check the top-level render call using <` + i + ">.");
599
599
  else
600
600
  Fe(I, e);
601
601
  }
602
- return e === c ? lt(O) : ut(O), O;
602
+ return e === i ? lt(O) : ut(O), O;
603
603
  }
604
604
  }
605
- function ft(e, r, i) {
606
- return Le(e, r, i, !0);
605
+ function ft(e, r, c) {
606
+ return Le(e, r, c, !0);
607
607
  }
608
- function dt(e, r, i) {
609
- return Le(e, r, i, !1);
608
+ function dt(e, r, c) {
609
+ return Le(e, r, c, !1);
610
610
  }
611
611
  var vt = dt, gt = ft;
612
- q.Fragment = c, q.jsx = vt, q.jsxs = gt;
612
+ q.Fragment = i, q.jsx = vt, q.jsxs = gt;
613
613
  }()), q;
614
614
  }
615
615
  process.env.NODE_ENV === "production" ? de.exports = Et() : de.exports = Rt();
616
616
  var W = de.exports;
617
- const k = ht({}), Lt = ({ children: t, apiURL: n, libraries: o, localStorageKeys: c }) => {
617
+ const k = ht({}), Lt = ({ children: t, apiURL: n, libraries: o, localStorageKeys: i }) => {
618
618
  const a = ve(
619
619
  () => ({
620
620
  apiURL: n,
621
621
  libraries: o,
622
- localStorageKeys: c
622
+ localStorageKeys: i
623
623
  }),
624
- [n, o, c]
624
+ [n, o, i]
625
625
  );
626
626
  return /* @__PURE__ */ W.jsx(k.Provider, { value: a, children: t });
627
- }, wt = "user", $t = ({ Fallback: t, isLogged: n, loginPath: o = "/login", redirect401Path: c = "/login", ...a }) => {
627
+ }, wt = "user", $t = ({ Fallback: t, isLogged: n, loginPath: o = "/login", redirect401Path: i = "/login", ...a }) => {
628
628
  var x, F, L, $;
629
629
  const { libraries: l, localStorageKeys: f } = D(k), d = (a == null ? void 0 : a.reactRouter) || (l == null ? void 0 : l.reactRouter), u = (a == null ? void 0 : a.axios) || (l == null ? void 0 : l.axios), m = (a == null ? void 0 : a.localStorageKey) || (f == null ? void 0 : f.user) || wt;
630
630
  if (!d)
@@ -635,19 +635,19 @@ const k = ht({}), Lt = ({ children: t, apiURL: n, libraries: o, localStorageKeys
635
635
  (T) => T,
636
636
  async (T) => {
637
637
  var B;
638
- return typeof T == "object" && T && "response" in T && T.response && typeof T.response == "object" && "status" in T.response && T.response && typeof T.response == "object" && "status" in T.response && ((B = T == null ? void 0 : T.response) == null ? void 0 : B.status) === 401 && (u.defaults.headers.common.Authorization = null, typeof window < "u" && window.localStorage && localStorage.removeItem(m), C(c)), Promise.reject(T);
638
+ return typeof T == "object" && T && "response" in T && T.response && typeof T.response == "object" && "status" in T.response && T.response && typeof T.response == "object" && "status" in T.response && ((B = T == null ? void 0 : T.response) == null ? void 0 : B.status) === 401 && (u.defaults.headers.common.Authorization = null, typeof window < "u" && window.localStorage && localStorage.removeItem(m), C(i)), Promise.reject(T);
639
639
  }
640
640
  ));
641
- }, [u.defaults.headers.common, u.interceptors.response, m, c]), _ && !g ? /* @__PURE__ */ W.jsx(mt, { fallback: t, children: (F = (x = w.state) == null ? void 0 : x.from) != null && F.state && (($ = (L = w.state) == null ? void 0 : L.from) == null ? void 0 : $.pathname) === o ? /* @__PURE__ */ W.jsx(s, { to: w.state.from.state.from.pathname + w.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ W.jsx(S, {}) }) : /* @__PURE__ */ W.jsx(s, { to: o + w.search, state: { from: w }, replace: !0 });
641
+ }, [u.defaults.headers.common, u.interceptors.response, m, i]), _ && !g ? /* @__PURE__ */ W.jsx(mt, { fallback: t, children: (F = (x = w.state) == null ? void 0 : x.from) != null && F.state && (($ = (L = w.state) == null ? void 0 : L.from) == null ? void 0 : $.pathname) === o ? /* @__PURE__ */ W.jsx(s, { to: w.state.from.state.from.pathname + w.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ W.jsx(S, {}) }) : /* @__PURE__ */ W.jsx(s, { to: o + w.search, state: { from: w }, replace: !0 });
642
642
  }, Nt = ({ data: t, ...n }) => {
643
- const { libraries: o } = D(k), c = (n == null ? void 0 : n.reactRouter) || (o == null ? void 0 : o.reactRouter), a = (n == null ? void 0 : n.gtm) || (o == null ? void 0 : o.gtm);
644
- if (!c)
643
+ const { libraries: o } = D(k), i = (n == null ? void 0 : n.reactRouter) || (o == null ? void 0 : o.reactRouter), a = (n == null ? void 0 : n.gtm) || (o == null ? void 0 : o.gtm);
644
+ if (!i)
645
645
  throw new Error(
646
646
  "React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView."
647
647
  );
648
648
  if (!a)
649
649
  throw new Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");
650
- const { useGoogleTagManager: l } = a, { useLocation: f, Outlet: d } = c, { pathname: u } = f(), { sendEvent: m } = l();
650
+ const { useGoogleTagManager: l } = a, { useLocation: f, Outlet: d } = i, { pathname: u } = f(), { sendEvent: m } = l();
651
651
  return z(() => {
652
652
  m({
653
653
  event: "pageView",
@@ -659,9 +659,9 @@ const k = ht({}), Lt = ({ children: t, apiURL: n, libraries: o, localStorageKeys
659
659
  tokenTypeKey: t = "tokenType",
660
660
  tokenKey: n = "accessToken",
661
661
  postContentType: o = "application/json",
662
- ...c
662
+ ...i
663
663
  }) => {
664
- const { apiURL: a = c.apiURL, libraries: l, localStorageKeys: f } = D(k), d = (c == null ? void 0 : c.userLocalStorageKey) || (f == null ? void 0 : f.user) || _t, u = (c == null ? void 0 : c.axios) || (l == null ? void 0 : l.axios);
664
+ const { apiURL: a = i.apiURL, libraries: l, localStorageKeys: f } = D(k), d = (i == null ? void 0 : i.userLocalStorageKey) || (f == null ? void 0 : f.user) || _t, u = (i == null ? void 0 : i.axios) || (l == null ? void 0 : l.axios);
665
665
  if (!u)
666
666
  throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
667
667
  if (!(u != null && u.defaults))
@@ -672,7 +672,7 @@ const k = ht({}), Lt = ({ children: t, apiURL: n, libraries: o, localStorageKeys
672
672
  }
673
673
  return u.defaults.baseURL = a, u.defaults.headers.post["Content-Type"] = o, null;
674
674
  }, Wt = ({ debug: t, resources: n, ...o }) => {
675
- const { libraries: c } = D(k), a = (o == null ? void 0 : o.i18) || (c == null ? void 0 : c.i18), { i18next: l, initReactI18next: f, languageDetector: d } = a || {};
675
+ const { libraries: i } = D(k), a = (o == null ? void 0 : o.i18) || (i == null ? void 0 : i.i18), { i18next: l, initReactI18next: f, languageDetector: d } = a || {};
676
676
  if (!a)
677
677
  throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
678
678
  return l != null && l.isInitialized || (l.use(d).use(f).init({
@@ -697,7 +697,7 @@ const k = ht({}), Lt = ({ children: t, apiURL: n, libraries: o, localStorageKeys
697
697
  dsn: t,
698
698
  integrations: n,
699
699
  tracesSampleRate: o,
700
- replaysSessionSampleRate: c,
700
+ replaysSessionSampleRate: i,
701
701
  replaysOnErrorSampleRate: a,
702
702
  tracePropagationTargets: l,
703
703
  ignoreErrors: f,
@@ -739,20 +739,20 @@ const k = ht({}), Lt = ({ children: t, apiURL: n, libraries: o, localStorageKeys
739
739
  ],
740
740
  release: m,
741
741
  replaysOnErrorSampleRate: a || 1,
742
- replaysSessionSampleRate: c || 0.1,
742
+ replaysSessionSampleRate: i || 0.1,
743
743
  tracePropagationTargets: l,
744
744
  tracesSampleRate: o || 1
745
745
  }), null;
746
746
  }, zt = ({ IMaskMixin: t, ...n }) => {
747
747
  const o = ve(
748
748
  // eslint-disable-next-line react/jsx-props-no-spreading
749
- () => t(({ TextField: c, ...a }) => /* @__PURE__ */ W.jsx(c, { ...a })),
749
+ () => t(({ TextField: i, ...a }) => /* @__PURE__ */ W.jsx(i, { ...a })),
750
750
  [t]
751
751
  );
752
752
  return /* @__PURE__ */ W.jsx(o, { ...n });
753
753
  }, Ut = ({ language: t, ...n }) => {
754
- const { libraries: o } = D(k), c = (n == null ? void 0 : n.dayjs) || (o == null ? void 0 : o.dayjs), a = (n == null ? void 0 : n.plugin) || (o == null ? void 0 : o.dayjsPlugin);
755
- if (!c)
754
+ const { libraries: o } = D(k), i = (n == null ? void 0 : n.dayjs) || (o == null ? void 0 : o.dayjs), a = (n == null ? void 0 : n.plugin) || (o == null ? void 0 : o.dayjsPlugin);
755
+ if (!i)
756
756
  throw new Error(
757
757
  "Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props of InitializeDaysJSConfig."
758
758
  );
@@ -761,10 +761,10 @@ const k = ht({}), Lt = ({ children: t, apiURL: n, libraries: o, localStorageKeys
761
761
  var d;
762
762
  const f = t || ((d = navigator.language) == null ? void 0 : d.slice(0, 2)) || "en";
763
763
  a && a.forEach((u) => {
764
- u && c.extend(u);
765
- }), await import("dayjs/locale/en"), await import("dayjs/locale/fr"), c.locale(f);
764
+ u && i.extend(u);
765
+ }), await import("dayjs/locale/en"), await import("dayjs/locale/fr"), i.locale(f);
766
766
  })().then();
767
- }, [c, a, t]), null;
767
+ }, [i, a, t]), null;
768
768
  }, Mt = () => (z(() => {
769
769
  const t = (n) => {
770
770
  try {
@@ -779,10 +779,10 @@ const k = ht({}), Lt = ({ children: t, apiURL: n, libraries: o, localStorageKeys
779
779
  children: t,
780
780
  defaultQueriesOptions: n,
781
781
  defaultMutationsOptions: o,
782
- ...c
782
+ ...i
783
783
  }) => {
784
784
  var u, m;
785
- const { libraries: a } = D(k), l = (c == null ? void 0 : c.QueryClient) || ((u = a == null ? void 0 : a.reactQuery) == null ? void 0 : u.QueryClient), f = (c == null ? void 0 : c.QueryClientProvider) || ((m = a == null ? void 0 : a.reactQuery) == null ? void 0 : m.QueryClientProvider);
785
+ const { libraries: a } = D(k), l = (i == null ? void 0 : i.QueryClient) || ((u = a == null ? void 0 : a.reactQuery) == null ? void 0 : u.QueryClient), f = (i == null ? void 0 : i.QueryClientProvider) || ((m = a == null ? void 0 : a.reactQuery) == null ? void 0 : m.QueryClientProvider);
786
786
  if (!l)
787
787
  throw new Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
788
788
  if (!f)
@@ -807,7 +807,7 @@ const k = ht({}), Lt = ({ children: t, apiURL: n, libraries: o, localStorageKeys
807
807
  return /* @__PURE__ */ W.jsx(f, { client: d, children: t });
808
808
  }, Jt = (t) => {
809
809
  var m, g, C;
810
- const { libraries: n } = D(k), o = (t == null ? void 0 : t.i18) || (n == null ? void 0 : n.i18), c = ((m = t == null ? void 0 : t.i18) == null ? void 0 : m.translateFunction) || ((g = n == null ? void 0 : n.i18) == null ? void 0 : g.translateFunction), a = ((C = o == null ? void 0 : o.i18next) == null ? void 0 : C.t) || c || ((b) => b), { unknownErrorTranslationKey: l = "error.unknownError" } = t || {}, f = a(l), d = re(
810
+ const { libraries: n } = D(k), o = (t == null ? void 0 : t.i18) || (n == null ? void 0 : n.i18), i = ((m = t == null ? void 0 : t.i18) == null ? void 0 : m.translateFunction) || ((g = n == null ? void 0 : n.i18) == null ? void 0 : g.translateFunction), a = ((C = o == null ? void 0 : o.i18next) == null ? void 0 : C.t) || i || ((b) => b), { unknownErrorTranslationKey: l = "error.unknownError" } = t || {}, f = a(l), d = re(
811
811
  (b) => {
812
812
  var S, w, P, h, _, x, F, L, $;
813
813
  const { response: s } = b || {};
@@ -824,7 +824,7 @@ const k = ht({}), Lt = ({ children: t, apiURL: n, libraries: o, localStorageKeys
824
824
  data: t,
825
825
  fetchNextPage: n,
826
826
  isFetchingNextPage: o,
827
- isInitialLoading: c,
827
+ isInitialLoading: i,
828
828
  isLoading: a,
829
829
  enabled: l = !0
830
830
  }) => {
@@ -840,11 +840,11 @@ const k = ht({}), Lt = ({ children: t, apiURL: n, libraries: o, localStorageKeys
840
840
  return {
841
841
  fetchNextPageOnRowsScrollEnd: f,
842
842
  isLoading: o || a,
843
- loadingVariant: c ? "skeleton" : "linear",
843
+ loadingVariant: i ? "skeleton" : "linear",
844
844
  rows: d
845
845
  };
846
846
  }, qt = (t) => {
847
- const { libraries: n } = D(k), o = (t == null ? void 0 : t.axios) || (n == null ? void 0 : n.axios), c = (t == null ? void 0 : t.localStorageKey) || "user";
847
+ const { libraries: n } = D(k), o = (t == null ? void 0 : t.axios) || (n == null ? void 0 : n.axios), i = (t == null ? void 0 : t.localStorageKey) || "user";
848
848
  if (!o)
849
849
  throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");
850
850
  const a = re(
@@ -857,7 +857,7 @@ const k = ht({}), Lt = ({ children: t, apiURL: n, libraries: o, localStorageKeys
857
857
  };
858
858
  return z(() => {
859
859
  const f = ({ newValue: d, key: u }) => {
860
- if (u === c && d)
860
+ if (u === i && d)
861
861
  try {
862
862
  const { accessToken: m, tokenType: g } = JSON.parse(d);
863
863
  a({ accessToken: m, tokenType: g });
@@ -868,28 +868,28 @@ const k = ht({}), Lt = ({ children: t, apiURL: n, libraries: o, localStorageKeys
868
868
  return window.addEventListener("storage", f), () => {
869
869
  window.removeEventListener("storage", f);
870
870
  };
871
- }, [c, a]), {
871
+ }, [i, a]), {
872
872
  clearAuthenticationToken: l,
873
873
  setAuthenticationToken: a
874
874
  };
875
- }, Ct = ({ library: t, date: n, format: o = "ll" }) => t(n).format(o), bt = (t, n = "km") => {
876
- const o = Number(t);
877
- return Number.isNaN(o) ? `0 ${n}` : `${o.toFixed(2)} ${n}`;
875
+ }, Ct = ({ library: t, date: n, format: o = "ll" }) => t(n).format(o), bt = (t, n) => {
876
+ const { fractionDigits: o = 0, metric: i = "km" } = n || {}, a = Number(t);
877
+ return Number.isNaN(a) ? `0${i}` : `${a.toFixed(o)} ${i}`;
878
878
  }, Pt = (t) => !t || typeof t != "string" ? "" : t.replace(/_/g, " ").toLowerCase().split(" ").map((o) => o.length > 0 ? o.charAt(0).toUpperCase() + o.slice(1) : o).join(" "), jt = (t) => t != null && t.startsWith("/") ? t != null && t.startsWith("/files") ? t : `/files${t}` : t != null && t.startsWith("files") ? `/${t}` : `/files/${t}`, Ot = ({ path: t, size: n, apiURL: o }) => {
879
879
  if (!t)
880
880
  return "";
881
- const c = jt(t), a = `${o}${c}`, l = a.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/) !== null;
881
+ const i = jt(t), a = `${o}${i}`, l = a.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/) !== null;
882
882
  return typeof n == "number" && l ? `${a.replace("/files", `/thumbs/${n}`)}` : a;
883
883
  }, Bt = (t) => {
884
- const { apiURL: n, libraries: o } = D(k), c = (t == null ? void 0 : t.dayjs) || (o == null ? void 0 : o.dayjs);
884
+ const { apiURL: n, libraries: o } = D(k), i = (t == null ? void 0 : t.dayjs) || (o == null ? void 0 : o.dayjs);
885
885
  return {
886
886
  dateAdapter: (f, d) => {
887
- if (!c)
887
+ if (!i)
888
888
  throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
889
889
  return Ct({
890
890
  date: f,
891
891
  format: d,
892
- library: c
892
+ library: i
893
893
  });
894
894
  },
895
895
  distanceAdapter: bt,
@@ -907,15 +907,15 @@ const k = ht({}), Lt = ({ children: t, apiURL: n, libraries: o, localStorageKeys
907
907
  worksiteNameAdapter: Pt
908
908
  };
909
909
  }, te = (t, n) => n === "short" ? t.split("-")[0] : t, Qt = (t, n = "full") => {
910
- const [o, c] = ze(() => {
910
+ const [o, i] = ze(() => {
911
911
  const a = (t == null ? void 0 : t.language) || navigator.language;
912
912
  return t && "isInitialized" in t && t.isInitialized, te(a, n);
913
913
  });
914
914
  return z(() => {
915
915
  var l;
916
- t && "isInitialized" in t && t.isInitialized && t.language && c(te(t.language, n));
916
+ t && "isInitialized" in t && t.isInitialized && t.language && i(te(t.language, n));
917
917
  const a = (f) => {
918
- c(te(f, n));
918
+ i(te(f, n));
919
919
  };
920
920
  return (l = t == null ? void 0 : t.on) == null || l.call(t, "languageChanged", a), () => {
921
921
  var f;
@@ -923,8 +923,8 @@ const k = ht({}), Lt = ({ children: t, apiURL: n, libraries: o, localStorageKeys
923
923
  };
924
924
  }, [t, n]), o;
925
925
  }, Tt = "tracktor.filter", We = (t, n, o) => `${o}_${t}=>${n}`, Xt = (t) => {
926
- const { libraries: n, localStorageKeys: o } = D(k), c = (t == null ? void 0 : t.reactRouter) || (n == null ? void 0 : n.reactRouter), { useLocation: a, useSearchParams: l } = c, { pathname: f } = a(), [d, u] = l(), m = (o == null ? void 0 : o.filter) || Tt;
927
- if (!c)
926
+ const { libraries: n, localStorageKeys: o } = D(k), i = (t == null ? void 0 : t.reactRouter) || (n == null ? void 0 : n.reactRouter), { useLocation: a, useSearchParams: l } = i, { pathname: f } = a(), [d, u] = l(), m = (o == null ? void 0 : o.filter) || Tt;
927
+ if (!i)
928
928
  throw new Error(
929
929
  "React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView."
930
930
  );
@@ -981,11 +981,11 @@ const k = ht({}), Lt = ({ children: t, apiURL: n, libraries: o, localStorageKeys
981
981
  setFilter: g
982
982
  };
983
983
  }, At = (t) => t.charAt(0).toUpperCase() + t.slice(1).toLowerCase(), xt = (t) => {
984
- const c = t.split("/").filter((a) => a.length > 0).map((a) => a.replace(/\${([^}]*)}/g, "$1").split(/[_-]/).map((u) => u.charAt(0).toUpperCase() + u.slice(1)).join("")).join("");
985
- return c.charAt(0).toLowerCase() + c.slice(1);
984
+ const i = t.split("/").filter((a) => a.length > 0).map((a) => a.replace(/\${([^}]*)}/g, "$1").split(/[_-]/).map((u) => u.charAt(0).toUpperCase() + u.slice(1)).join("")).join("");
985
+ return i.charAt(0).toLowerCase() + i.slice(1);
986
986
  }, It = (t) => (t.split("/").pop() || t).replace(/\.json$/, "").replace(/^openapi\./, ""), kt = (t, n, o) => {
987
- const c = xt(n), a = At(o);
988
- return `${c}${a}`;
987
+ const i = xt(n), a = At(o);
988
+ return `${i}${a}`;
989
989
  }, Dt = (t) => {
990
990
  if (t)
991
991
  return (t == null ? void 0 : t.reduce((n, o) => (n[o] = {
@@ -995,8 +995,8 @@ const k = ht({}), Lt = ({ children: t, apiURL: n, libraries: o, localStorageKeys
995
995
  useQuery: !0
996
996
  }
997
997
  }, n), {})) || {};
998
- }, Ht = (t) => (Array.isArray(t) ? t : [t]).reduce((o, c) => {
999
- const { output: a, operationsToGenerateInfiniteQueryHook: l, input: f = "./openapi.json" } = c || {}, d = It(f);
998
+ }, Ht = (t) => (Array.isArray(t) ? t : [t]).reduce((o, i) => {
999
+ const { output: a, operationsToGenerateInfiniteQueryHook: l, input: f = "./openapi.json" } = i || {}, d = It(f);
1000
1000
  return {
1001
1001
  ...o,
1002
1002
  [d]: {
package/dist/main.umd.cjs CHANGED
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var de;function Me(){if(de)return J;de=1;var t=h,n=Symbol.for("react.element"),a=Symbol.for("react.fragment"),c=Object.prototype.hasOwnProperty,o=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function f(d,u,E){var g,P={},j=null,s=null;E!==void 0&&(j=""+E),u.key!==void 0&&(j=""+u.key),u.ref!==void 0&&(s=u.ref);for(g in u)c.call(u,g)&&!l.hasOwnProperty(g)&&(P[g]=u[g]);if(d&&d.defaultProps)for(g in u=d.defaultProps,u)P[g]===void 0&&(P[g]=u[g]);return{$$typeof:n,type:d,key:j,ref:s,props:P,_owner:o.current}}return J.Fragment=a,J.jsx=f,J.jsxs=f,J}var K={};/**
9
+ */var de;function Me(){if(de)return J;de=1;var t=h,n=Symbol.for("react.element"),a=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,o=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function f(d,u,E){var g,P={},j=null,s=null;E!==void 0&&(j=""+E),u.key!==void 0&&(j=""+u.key),u.ref!==void 0&&(s=u.ref);for(g in u)i.call(u,g)&&!l.hasOwnProperty(g)&&(P[g]=u[g]);if(d&&d.defaultProps)for(g in u=d.defaultProps,u)P[g]===void 0&&(P[g]=u[g]);return{$$typeof:n,type:d,key:j,ref:s,props:P,_owner:o.current}}return J.Fragment=a,J.jsx=f,J.jsxs=f,J}var K={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,12 +14,12 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var ve;function Ue(){return ve||(ve=1,process.env.NODE_ENV!=="production"&&function(){var t=h,n=Symbol.for("react.element"),a=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),d=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),s=Symbol.for("react.offscreen"),b=Symbol.iterator,C="@@iterator";function T(e){if(e===null||typeof e!="object")return null;var r=b&&e[b]||e[C];return typeof r=="function"?r:null}var y=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(e){{for(var r=arguments.length,i=new Array(r>1?r-1:0),v=1;v<r;v++)i[v-1]=arguments[v];k("error",e,i)}}function k(e,r,i){{var v=y.ReactDebugCurrentFrame,w=v.getStackAddendum();w!==""&&(r+="%s",i=i.concat([w]));var S=i.map(function(R){return String(R)});S.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,S)}}var L=!1,N=!1,Y=!1,x=!1,Ee=!1,ne;ne=Symbol.for("react.module.reference");function X(e){return!!(typeof e=="string"||typeof e=="function"||e===c||e===l||Ee||e===o||e===E||e===g||x||e===s||L||N||Y||typeof e=="object"&&e!==null&&(e.$$typeof===j||e.$$typeof===P||e.$$typeof===f||e.$$typeof===d||e.$$typeof===u||e.$$typeof===ne||e.getModuleId!==void 0))}function Rt(e,r,i){var v=e.displayName;if(v)return v;var w=r.displayName||r.name||"";return w!==""?i+"("+w+")":i}function Re(e){return e.displayName||"Context"}function z(e){if(e==null)return null;if(typeof e.tag=="number"&&_("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case c:return"Fragment";case a:return"Portal";case l:return"Profiler";case o:return"StrictMode";case E:return"Suspense";case g:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case d:var r=e;return Re(r)+".Consumer";case f:var i=e;return Re(i._context)+".Provider";case u:return Rt(e,e.render,"ForwardRef");case P:var v=e.displayName||null;return v!==null?v:z(e.type)||"Memo";case j:{var w=e,S=w._payload,R=w._init;try{return z(R(S))}catch{return null}}}return null}var M=Object.assign,Q=0,we,Ce,_e,pe,Se,be,Pe;function je(){}je.__reactDisabledLog=!0;function wt(){{if(Q===0){we=console.log,Ce=console.info,_e=console.warn,pe=console.error,Se=console.group,be=console.groupCollapsed,Pe=console.groupEnd;var e={configurable:!0,enumerable:!0,value:je,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}Q++}}function Ct(){{if(Q--,Q===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:M({},e,{value:we}),info:M({},e,{value:Ce}),warn:M({},e,{value:_e}),error:M({},e,{value:pe}),group:M({},e,{value:Se}),groupCollapsed:M({},e,{value:be}),groupEnd:M({},e,{value:Pe})})}Q<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ae=y.ReactCurrentDispatcher,oe;function Z(e,r,i){{if(oe===void 0)try{throw Error()}catch(w){var v=w.stack.trim().match(/\n( *(at )?)/);oe=v&&v[1]||""}return`
18
- `+oe+e}}var ie=!1,$;{var _t=typeof WeakMap=="function"?WeakMap:Map;$=new _t}function Te(e,r){if(!e||ie)return"";{var i=$.get(e);if(i!==void 0)return i}var v;ie=!0;var w=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var S;S=ae.current,ae.current=null,wt();try{if(r){var R=function(){throw Error()};if(Object.defineProperty(R.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(R,[])}catch(V){v=V}Reflect.construct(e,[],R)}else{try{R.call()}catch(V){v=V}e.call(R.prototype)}}else{try{throw Error()}catch(V){v=V}e()}}catch(V){if(V&&v&&typeof V.stack=="string"){for(var m=V.stack.split(`
17
+ */var ve;function Ue(){return ve||(ve=1,process.env.NODE_ENV!=="production"&&function(){var t=h,n=Symbol.for("react.element"),a=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),d=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),s=Symbol.for("react.offscreen"),b=Symbol.iterator,C="@@iterator";function T(e){if(e===null||typeof e!="object")return null;var r=b&&e[b]||e[C];return typeof r=="function"?r:null}var y=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(e){{for(var r=arguments.length,c=new Array(r>1?r-1:0),v=1;v<r;v++)c[v-1]=arguments[v];k("error",e,c)}}function k(e,r,c){{var v=y.ReactDebugCurrentFrame,w=v.getStackAddendum();w!==""&&(r+="%s",c=c.concat([w]));var S=c.map(function(R){return String(R)});S.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,S)}}var L=!1,N=!1,Y=!1,x=!1,Ee=!1,ne;ne=Symbol.for("react.module.reference");function X(e){return!!(typeof e=="string"||typeof e=="function"||e===i||e===l||Ee||e===o||e===E||e===g||x||e===s||L||N||Y||typeof e=="object"&&e!==null&&(e.$$typeof===j||e.$$typeof===P||e.$$typeof===f||e.$$typeof===d||e.$$typeof===u||e.$$typeof===ne||e.getModuleId!==void 0))}function Rt(e,r,c){var v=e.displayName;if(v)return v;var w=r.displayName||r.name||"";return w!==""?c+"("+w+")":c}function Re(e){return e.displayName||"Context"}function z(e){if(e==null)return null;if(typeof e.tag=="number"&&_("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case i:return"Fragment";case a:return"Portal";case l:return"Profiler";case o:return"StrictMode";case E:return"Suspense";case g:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case d:var r=e;return Re(r)+".Consumer";case f:var c=e;return Re(c._context)+".Provider";case u:return Rt(e,e.render,"ForwardRef");case P:var v=e.displayName||null;return v!==null?v:z(e.type)||"Memo";case j:{var w=e,S=w._payload,R=w._init;try{return z(R(S))}catch{return null}}}return null}var M=Object.assign,Q=0,we,Ce,_e,pe,Se,be,Pe;function je(){}je.__reactDisabledLog=!0;function wt(){{if(Q===0){we=console.log,Ce=console.info,_e=console.warn,pe=console.error,Se=console.group,be=console.groupCollapsed,Pe=console.groupEnd;var e={configurable:!0,enumerable:!0,value:je,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}Q++}}function Ct(){{if(Q--,Q===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:M({},e,{value:we}),info:M({},e,{value:Ce}),warn:M({},e,{value:_e}),error:M({},e,{value:pe}),group:M({},e,{value:Se}),groupCollapsed:M({},e,{value:be}),groupEnd:M({},e,{value:Pe})})}Q<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ae=y.ReactCurrentDispatcher,oe;function Z(e,r,c){{if(oe===void 0)try{throw Error()}catch(w){var v=w.stack.trim().match(/\n( *(at )?)/);oe=v&&v[1]||""}return`
18
+ `+oe+e}}var ie=!1,$;{var _t=typeof WeakMap=="function"?WeakMap:Map;$=new _t}function Te(e,r){if(!e||ie)return"";{var c=$.get(e);if(c!==void 0)return c}var v;ie=!0;var w=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var S;S=ae.current,ae.current=null,wt();try{if(r){var R=function(){throw Error()};if(Object.defineProperty(R.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(R,[])}catch(V){v=V}Reflect.construct(e,[],R)}else{try{R.call()}catch(V){v=V}e.call(R.prototype)}}else{try{throw Error()}catch(V){v=V}e()}}catch(V){if(V&&v&&typeof V.stack=="string"){for(var m=V.stack.split(`
19
19
  `),I=v.stack.split(`
20
20
  `),O=m.length-1,A=I.length-1;O>=1&&A>=0&&m[O]!==I[A];)A--;for(;O>=1&&A>=0;O--,A--)if(m[O]!==I[A]){if(O!==1||A!==1)do if(O--,A--,A<0||m[O]!==I[A]){var F=`
21
- `+m[O].replace(" at new "," at ");return e.displayName&&F.includes("<anonymous>")&&(F=F.replace("<anonymous>",e.displayName)),typeof e=="function"&&$.set(e,F),F}while(O>=1&&A>=0);break}}}finally{ie=!1,ae.current=S,Ct(),Error.prepareStackTrace=w}var G=e?e.displayName||e.name:"",Ve=G?Z(G):"";return typeof e=="function"&&$.set(e,Ve),Ve}function pt(e,r,i){return Te(e,!1)}function St(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function q(e,r,i){if(e==null)return"";if(typeof e=="function")return Te(e,St(e));if(typeof e=="string")return Z(e);switch(e){case E:return Z("Suspense");case g:return Z("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case u:return pt(e.render);case P:return q(e.type,r,i);case j:{var v=e,w=v._payload,S=v._init;try{return q(S(w),r,i)}catch{}}}return""}var ee=Object.prototype.hasOwnProperty,Oe={},Ae=y.ReactDebugCurrentFrame;function te(e){if(e){var r=e._owner,i=q(e.type,e._source,r?r.type:null);Ae.setExtraStackFrame(i)}else Ae.setExtraStackFrame(null)}function bt(e,r,i,v,w){{var S=Function.call.bind(ee);for(var R in e)if(S(e,R)){var m=void 0;try{if(typeof e[R]!="function"){var I=Error((v||"React class")+": "+i+" type `"+R+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[R]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw I.name="Invariant Violation",I}m=e[R](r,R,v,i,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(O){m=O}m&&!(m instanceof Error)&&(te(w),_("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",v||"React class",i,R,typeof m),te(null)),m instanceof Error&&!(m.message in Oe)&&(Oe[m.message]=!0,te(w),_("Failed %s type: %s",i,m.message),te(null))}}}var Pt=Array.isArray;function ce(e){return Pt(e)}function jt(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,i=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return i}}function Tt(e){try{return xe(e),!1}catch{return!0}}function xe(e){return""+e}function Ie(e){if(Tt(e))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",jt(e)),xe(e)}var B=y.ReactCurrentOwner,Ot={key:!0,ref:!0,__self:!0,__source:!0},ke,De,se;se={};function At(e){if(ee.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function xt(e){if(ee.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function It(e,r){if(typeof e.ref=="string"&&B.current&&r&&B.current.stateNode!==r){var i=z(B.current.type);se[i]||(_('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',z(B.current.type),e.ref),se[i]=!0)}}function kt(e,r){{var i=function(){ke||(ke=!0,_("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};i.isReactWarning=!0,Object.defineProperty(e,"key",{get:i,configurable:!0})}}function Dt(e,r){{var i=function(){De||(De=!0,_("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};i.isReactWarning=!0,Object.defineProperty(e,"ref",{get:i,configurable:!0})}}var Ft=function(e,r,i,v,w,S,R){var m={$$typeof:n,type:e,key:r,ref:i,props:R,_owner:S};return m._store={},Object.defineProperty(m._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(m,"_self",{configurable:!1,enumerable:!1,writable:!1,value:v}),Object.defineProperty(m,"_source",{configurable:!1,enumerable:!1,writable:!1,value:w}),Object.freeze&&(Object.freeze(m.props),Object.freeze(m)),m};function Lt(e,r,i,v,w){{var S,R={},m=null,I=null;i!==void 0&&(Ie(i),m=""+i),xt(r)&&(Ie(r.key),m=""+r.key),At(r)&&(I=r.ref,It(r,w));for(S in r)ee.call(r,S)&&!Ot.hasOwnProperty(S)&&(R[S]=r[S]);if(e&&e.defaultProps){var O=e.defaultProps;for(S in O)R[S]===void 0&&(R[S]=O[S])}if(m||I){var A=typeof e=="function"?e.displayName||e.name||"Unknown":e;m&&kt(R,A),I&&Dt(R,A)}return Ft(e,m,I,w,v,B.current,R)}}var ue=y.ReactCurrentOwner,Fe=y.ReactDebugCurrentFrame;function U(e){if(e){var r=e._owner,i=q(e.type,e._source,r?r.type:null);Fe.setExtraStackFrame(i)}else Fe.setExtraStackFrame(null)}var le;le=!1;function fe(e){return typeof e=="object"&&e!==null&&e.$$typeof===n}function Le(){{if(ue.current){var e=z(ue.current.type);if(e)return`
21
+ `+m[O].replace(" at new "," at ");return e.displayName&&F.includes("<anonymous>")&&(F=F.replace("<anonymous>",e.displayName)),typeof e=="function"&&$.set(e,F),F}while(O>=1&&A>=0);break}}}finally{ie=!1,ae.current=S,Ct(),Error.prepareStackTrace=w}var G=e?e.displayName||e.name:"",Ve=G?Z(G):"";return typeof e=="function"&&$.set(e,Ve),Ve}function pt(e,r,c){return Te(e,!1)}function St(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function q(e,r,c){if(e==null)return"";if(typeof e=="function")return Te(e,St(e));if(typeof e=="string")return Z(e);switch(e){case E:return Z("Suspense");case g:return Z("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case u:return pt(e.render);case P:return q(e.type,r,c);case j:{var v=e,w=v._payload,S=v._init;try{return q(S(w),r,c)}catch{}}}return""}var ee=Object.prototype.hasOwnProperty,Oe={},Ae=y.ReactDebugCurrentFrame;function te(e){if(e){var r=e._owner,c=q(e.type,e._source,r?r.type:null);Ae.setExtraStackFrame(c)}else Ae.setExtraStackFrame(null)}function bt(e,r,c,v,w){{var S=Function.call.bind(ee);for(var R in e)if(S(e,R)){var m=void 0;try{if(typeof e[R]!="function"){var I=Error((v||"React class")+": "+c+" type `"+R+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[R]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw I.name="Invariant Violation",I}m=e[R](r,R,v,c,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(O){m=O}m&&!(m instanceof Error)&&(te(w),_("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",v||"React class",c,R,typeof m),te(null)),m instanceof Error&&!(m.message in Oe)&&(Oe[m.message]=!0,te(w),_("Failed %s type: %s",c,m.message),te(null))}}}var Pt=Array.isArray;function ce(e){return Pt(e)}function jt(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,c=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return c}}function Tt(e){try{return xe(e),!1}catch{return!0}}function xe(e){return""+e}function Ie(e){if(Tt(e))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",jt(e)),xe(e)}var B=y.ReactCurrentOwner,Ot={key:!0,ref:!0,__self:!0,__source:!0},ke,De,se;se={};function At(e){if(ee.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function xt(e){if(ee.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function It(e,r){if(typeof e.ref=="string"&&B.current&&r&&B.current.stateNode!==r){var c=z(B.current.type);se[c]||(_('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',z(B.current.type),e.ref),se[c]=!0)}}function kt(e,r){{var c=function(){ke||(ke=!0,_("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};c.isReactWarning=!0,Object.defineProperty(e,"key",{get:c,configurable:!0})}}function Dt(e,r){{var c=function(){De||(De=!0,_("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};c.isReactWarning=!0,Object.defineProperty(e,"ref",{get:c,configurable:!0})}}var Ft=function(e,r,c,v,w,S,R){var m={$$typeof:n,type:e,key:r,ref:c,props:R,_owner:S};return m._store={},Object.defineProperty(m._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(m,"_self",{configurable:!1,enumerable:!1,writable:!1,value:v}),Object.defineProperty(m,"_source",{configurable:!1,enumerable:!1,writable:!1,value:w}),Object.freeze&&(Object.freeze(m.props),Object.freeze(m)),m};function Lt(e,r,c,v,w){{var S,R={},m=null,I=null;c!==void 0&&(Ie(c),m=""+c),xt(r)&&(Ie(r.key),m=""+r.key),At(r)&&(I=r.ref,It(r,w));for(S in r)ee.call(r,S)&&!Ot.hasOwnProperty(S)&&(R[S]=r[S]);if(e&&e.defaultProps){var O=e.defaultProps;for(S in O)R[S]===void 0&&(R[S]=O[S])}if(m||I){var A=typeof e=="function"?e.displayName||e.name||"Unknown":e;m&&kt(R,A),I&&Dt(R,A)}return Ft(e,m,I,w,v,B.current,R)}}var ue=y.ReactCurrentOwner,Fe=y.ReactDebugCurrentFrame;function U(e){if(e){var r=e._owner,c=q(e.type,e._source,r?r.type:null);Fe.setExtraStackFrame(c)}else Fe.setExtraStackFrame(null)}var le;le=!1;function fe(e){return typeof e=="object"&&e!==null&&e.$$typeof===n}function Le(){{if(ue.current){var e=z(ue.current.type);if(e)return`
22
22
 
23
- Check the render method of \``+e+"`."}return""}}function Nt(e){return""}var Ne={};function Yt(e){{var r=Le();if(!r){var i=typeof e=="string"?e:e.displayName||e.name;i&&(r=`
23
+ Check the render method of \``+e+"`."}return""}}function Nt(e){return""}var Ne={};function Yt(e){{var r=Le();if(!r){var c=typeof e=="string"?e:e.displayName||e.name;c&&(r=`
24
24
 
25
- Check the top-level render call using <`+i+">.")}return r}}function Ye(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var i=Yt(r);if(Ne[i])return;Ne[i]=!0;var v="";e&&e._owner&&e._owner!==ue.current&&(v=" It was passed a child from "+z(e._owner.type)+"."),U(e),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',i,v),U(null)}}function We(e,r){{if(typeof e!="object")return;if(ce(e))for(var i=0;i<e.length;i++){var v=e[i];fe(v)&&Ye(v,r)}else if(fe(e))e._store&&(e._store.validated=!0);else if(e){var w=T(e);if(typeof w=="function"&&w!==e.entries)for(var S=w.call(e),R;!(R=S.next()).done;)fe(R.value)&&Ye(R.value,r)}}}function Wt(e){{var r=e.type;if(r==null||typeof r=="string")return;var i;if(typeof r=="function")i=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===u||r.$$typeof===P))i=r.propTypes;else return;if(i){var v=z(r);bt(i,e.props,"prop",v,e)}else if(r.PropTypes!==void 0&&!le){le=!0;var w=z(r);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",w||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function zt(e){{for(var r=Object.keys(e.props),i=0;i<r.length;i++){var v=r[i];if(v!=="children"&&v!=="key"){U(e),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",v),U(null);break}}e.ref!==null&&(U(e),_("Invalid attribute `ref` supplied to `React.Fragment`."),U(null))}}function ze(e,r,i,v,w,S){{var R=X(e);if(!R){var m="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(m+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var I=Nt();I?m+=I:m+=Le();var O;e===null?O="null":ce(e)?O="array":e!==void 0&&e.$$typeof===n?(O="<"+(z(e.type)||"Unknown")+" />",m=" Did you accidentally export a JSX literal instead of a component?"):O=typeof e,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",O,m)}var A=Lt(e,r,i,w,S);if(A==null)return A;if(R){var F=r.children;if(F!==void 0)if(v)if(ce(F)){for(var G=0;G<F.length;G++)We(F[G],e);Object.freeze&&Object.freeze(F)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else We(F,e)}return e===c?zt(A):Wt(A),A}}function Vt(e,r,i){return ze(e,r,i,!0)}function Mt(e,r,i){return ze(e,r,i,!1)}var Ut=Mt,Gt=Vt;K.Fragment=c,K.jsx=Ut,K.jsxs=Gt}()),K}process.env.NODE_ENV==="production"?re.exports=Me():re.exports=Ue();var W=re.exports;const D=h.createContext({}),Ge=({children:t,apiURL:n,libraries:a,localStorageKeys:c})=>{const o=h.useMemo(()=>({apiURL:n,libraries:a,localStorageKeys:c}),[n,a,c]);return W.jsx(D.Provider,{value:o,children:t})},Je="user",Ke=({Fallback:t,isLogged:n,loginPath:a="/login",redirect401Path:c="/login",...o})=>{var k,L,N,Y;const{libraries:l,localStorageKeys:f}=h.useContext(D),d=(o==null?void 0:o.reactRouter)||(l==null?void 0:l.reactRouter),u=(o==null?void 0:o.axios)||(l==null?void 0:l.axios),E=(o==null?void 0:o.localStorageKey)||(f==null?void 0:f.user)||Je;if(!d)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");const[g,P]=h.useState(null),{useLocation:j,Navigate:s,Outlet:b}=d,C=j(),T=h.useRef(!1),y=typeof n=="function"?n():!!n,_=typeof y=="boolean"?y:y==null?void 0:y.isLogged;return h.useEffect(()=>{T.current||(T.current=!0,u.interceptors.response.use(x=>x,async x=>{var X;return typeof x=="object"&&x&&"response"in x&&x.response&&typeof x.response=="object"&&"status"in x.response&&x.response&&typeof x.response=="object"&&"status"in x.response&&((X=x==null?void 0:x.response)==null?void 0:X.status)===401&&(u.defaults.headers.common.Authorization=null,typeof window<"u"&&window.localStorage&&localStorage.removeItem(E),P(c)),Promise.reject(x)}))},[u.defaults.headers.common,u.interceptors.response,E,c]),_&&!g?W.jsx(h.Suspense,{fallback:t,children:(L=(k=C.state)==null?void 0:k.from)!=null&&L.state&&((Y=(N=C.state)==null?void 0:N.from)==null?void 0:Y.pathname)===a?W.jsx(s,{to:C.state.from.state.from.pathname+C.state.from.state.from.search,replace:!0}):W.jsx(b,{})}):W.jsx(s,{to:a+C.search,state:{from:C},replace:!0})},Qe=({data:t,...n})=>{const{libraries:a}=h.useContext(D),c=(n==null?void 0:n.reactRouter)||(a==null?void 0:a.reactRouter),o=(n==null?void 0:n.gtm)||(a==null?void 0:a.gtm);if(!c)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");if(!o)throw new Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");const{useGoogleTagManager:l}=o,{useLocation:f,Outlet:d}=c,{pathname:u}=f(),{sendEvent:E}=l();return h.useEffect(()=>{E({event:"pageView",pathname:u,...t})},[t,u,E]),W.jsx(d,{})},Be="user",He=({tokenTypeKey:t="tokenType",tokenKey:n="accessToken",postContentType:a="application/json",...c})=>{const{apiURL:o=c.apiURL,libraries:l,localStorageKeys:f}=h.useContext(D),d=(c==null?void 0:c.userLocalStorageKey)||(f==null?void 0:f.user)||Be,u=(c==null?void 0:c.axios)||(l==null?void 0:l.axios);if(!u)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!(u!=null&&u.defaults))return null;if(typeof window<"u"&&window.localStorage){const E=localStorage.getItem(d),g=E?JSON.parse(E):null,P=g!=null&&g[t]?g[t]:null,j=g!=null&&g[n]?g[n]:null,s=E?`${P} ${j}`:null;s&&(u.defaults.headers.common.Authorization=s)}return u.defaults.baseURL=o,u.defaults.headers.post["Content-Type"]=a,null},Xe=({debug:t,resources:n,...a})=>{const{libraries:c}=h.useContext(D),o=(a==null?void 0:a.i18)||(c==null?void 0:c.i18),{i18next:l,initReactI18next:f,languageDetector:d}=o||{};if(!o)throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return l!=null&&l.isInitialized||(l.use(d).use(f).init({debug:t,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:"languageChanged loaded",useSuspense:!0},resources:n,returnNull:!1}).then(()=>{document.documentElement.lang!==l.resolvedLanguage&&l.resolvedLanguage&&document.documentElement.setAttribute("lang",l.resolvedLanguage)}),l.on("languageChanged",u=>{document.documentElement.setAttribute("lang",u)})),null},Ze=({dsn:t,integrations:n,tracesSampleRate:a,replaysSessionSampleRate:c,replaysOnErrorSampleRate:o,tracePropagationTargets:l,ignoreErrors:f,debug:d,environment:u,release:E,...g})=>{const{libraries:P}=h.useContext(D),j=(g==null?void 0:g.sentry)||(P==null?void 0:P.sentry),s=(g==null?void 0:g.reactRouter)||(P==null?void 0:P.reactRouter);if(!j)throw new Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!s)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(j.isInitialized())return null;const{createRoutesFromChildren:b,matchRoutes:C,useLocation:T,useNavigationType:y}=s;return(d||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&j.init({debug:d,dsn:t,environment:u||"production",ignoreErrors:[...f||[],/dynamically imported module/,/Cannot read properties of undefined \(reading 'default'\)/,/Loading chunk \d+ failed/,/ChunkLoadError/,/Failed to fetch dynamically imported module/,/vite:preloadError/],integrations:[j.reactRouterV6BrowserTracingIntegration({createRoutesFromChildren:b,matchRoutes:C,useEffect:h.useEffect,useLocation:T,useNavigationType:y}),...n||[]],release:E,replaysOnErrorSampleRate:o||1,replaysSessionSampleRate:c||.1,tracePropagationTargets:l,tracesSampleRate:a||1}),null},$e=({IMaskMixin:t,...n})=>{const a=h.useMemo(()=>t(({TextField:c,...o})=>W.jsx(c,{...o})),[t]);return W.jsx(a,{...n})},qe=({language:t,...n})=>{const{libraries:a}=h.useContext(D),c=(n==null?void 0:n.dayjs)||(a==null?void 0:a.dayjs),o=(n==null?void 0:n.plugin)||(a==null?void 0:a.dayjsPlugin);if(!c)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props of InitializeDaysJSConfig.");return h.useEffect(()=>{(async()=>{var d;const f=t||((d=navigator.language)==null?void 0:d.slice(0,2))||"en";o&&o.forEach(u=>{u&&c.extend(u)}),await import("dayjs/locale/en"),await import("dayjs/locale/fr"),c.locale(f)})().then()},[c,o,t]),null},et=()=>(h.useEffect(()=>{const t=n=>{try{n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation(),window.location.reload()}catch{}};return window.addEventListener("vite:preloadError",t),()=>{window.removeEventListener("vite:preloadError",t)}},[]),null),tt=t=>t&&typeof t=="function",rt=t=>t&&typeof t=="function",nt=({children:t,defaultQueriesOptions:n,defaultMutationsOptions:a,...c})=>{var u,E;const{libraries:o}=h.useContext(D),l=(c==null?void 0:c.QueryClient)||((u=o==null?void 0:o.reactQuery)==null?void 0:u.QueryClient),f=(c==null?void 0:c.QueryClientProvider)||((E=o==null?void 0:o.reactQuery)==null?void 0:E.QueryClientProvider);if(!l)throw new Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!f)throw new Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!tt(f))throw new Error("Provided QueryClientProvider dependencies are not valid.");if(!rt(l))throw new Error("Provided QueryClient dependencies are not valid.");const d=new l({defaultOptions:{mutations:{...a},queries:{getNextPageParam:(g,P,j)=>g.length+(j||0),refetchOnWindowFocus:!1,retry:3,...n}}});return W.jsx(f,{client:d,children:t})},at=t=>{var E,g,P;const{libraries:n}=h.useContext(D),a=(t==null?void 0:t.i18)||(n==null?void 0:n.i18),c=((E=t==null?void 0:t.i18)==null?void 0:E.translateFunction)||((g=n==null?void 0:n.i18)==null?void 0:g.translateFunction),o=((P=a==null?void 0:a.i18next)==null?void 0:P.t)||c||(j=>j),{unknownErrorTranslationKey:l="error.unknownError"}=t||{},f=o(l),d=h.useCallback(j=>{var b,C,T,y,_,k,L,N,Y;const{response:s}=j||{};return s!=null&&s.reason?String(s.reason):(b=s==null?void 0:s.data)!=null&&b.reason?String(s.data.reason):(C=s==null?void 0:s.data)!=null&&C.message?String(s.data.message):(y=(T=s==null?void 0:s.data)==null?void 0:T.detail)!=null&&y.length&&Array.isArray((_=s==null?void 0:s.data)==null?void 0:_.detail)&&((L=(k=s==null?void 0:s.data)==null?void 0:k.detail[0])!=null&&L.msg)&&typeof((Y=(N=s==null?void 0:s.data)==null?void 0:N.detail[0])==null?void 0:Y.msg)=="string"?String(s.data.detail[0].msg):f},[f]);return{getErrorCode:h.useCallback(j=>{var b,C,T;const{response:s}=j||{};return s!=null&&s.error_code?String(s==null?void 0:s.error_code):(b=s==null?void 0:s.data)!=null&&b.error_code?String((C=s==null?void 0:s.data)==null?void 0:C.error_code):s!=null&&s.error_code?String(s==null?void 0:s.error_code):(T=s==null?void 0:s.data)!=null&&T.error_code?String(s.data.error_code):"unknown_error_code"},[]),printError:d}},ot=({data:t,fetchNextPage:n,isFetchingNextPage:a,isInitialLoading:c,isLoading:o,enabled:l=!0})=>{const f=h.useCallback(async u=>{a||!l||await n({pageParam:(u==null?void 0:u.pageParam)||u.visibleRowsCount})},[l,n,a]),d=h.useMemo(()=>{if(t)return t.pages.reduce((u,E)=>[...u,...E],[])},[t]);return{fetchNextPageOnRowsScrollEnd:f,isLoading:a||o,loadingVariant:c?"skeleton":"linear",rows:d}},it=t=>{const{libraries:n}=h.useContext(D),a=(t==null?void 0:t.axios)||(n==null?void 0:n.axios),c=(t==null?void 0:t.localStorageKey)||"user";if(!a)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");const o=h.useCallback(({tokenType:f,accessToken:d})=>{a.defaults.headers.common.Authorization=`${f} ${d}`},[a.defaults.headers.common]),l=()=>{a.defaults.headers.common.Authorization=null};return h.useEffect(()=>{const f=({newValue:d,key:u})=>{if(u===c&&d)try{const{accessToken:E,tokenType:g}=JSON.parse(d);o({accessToken:E,tokenType:g})}catch(E){console.error("Failed to parse newValue from localStorage:",E)}};return window.addEventListener("storage",f),()=>{window.removeEventListener("storage",f)}},[c,o]),{clearAuthenticationToken:l,setAuthenticationToken:o}},ge=({library:t,date:n,format:a="ll"})=>t(n).format(a),he=(t,n="km")=>{const a=Number(t);return Number.isNaN(a)?`0 ${n}`:`${a.toFixed(2)} ${n}`},ye=t=>!t||typeof t!="string"?"":t.replace(/_/g," ").toLowerCase().split(" ").map(a=>a.length>0?a.charAt(0).toUpperCase()+a.slice(1):a).join(" "),ct=t=>t!=null&&t.startsWith("/")?t!=null&&t.startsWith("/files")?t:`/files${t}`:t!=null&&t.startsWith("files")?`/${t}`:`/files/${t}`,st=({path:t,size:n,apiURL:a})=>{if(!t)return"";const c=ct(t),o=`${a}${c}`,l=o.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/)!==null;return typeof n=="number"&&l?`${o.replace("/files",`/thumbs/${n}`)}`:o},ut=t=>{const{apiURL:n,libraries:a}=h.useContext(D),c=(t==null?void 0:t.dayjs)||(a==null?void 0:a.dayjs);return{dateAdapter:(f,d)=>{if(!c)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return ge({date:f,format:d,library:c})},distanceAdapter:he,filePathAdapter:(f,d)=>{if(!n)throw new Error("API URL is not provided. You can provide it with InjectDependenciesProvider or directly in props to filePathAdapter.");return st({apiURL:n,path:f,size:d})},worksiteNameAdapter:ye}},H=(t,n)=>n==="short"?t.split("-")[0]:t,lt=(t,n="full")=>{const[a,c]=h.useState(()=>{const o=(t==null?void 0:t.language)||navigator.language;return t&&"isInitialized"in t&&t.isInitialized,H(o,n)});return h.useEffect(()=>{var l;t&&"isInitialized"in t&&t.isInitialized&&t.language&&c(H(t.language,n));const o=f=>{c(H(f,n))};return(l=t==null?void 0:t.on)==null||l.call(t,"languageChanged",o),()=>{var f;(f=t==null?void 0:t.off)==null||f.call(t,"languageChanged",o)}},[t,n]),a},ft="tracktor.filter",me=(t,n,a)=>`${a}_${t}=>${n}`,dt=t=>{const{libraries:n,localStorageKeys:a}=h.useContext(D),c=(t==null?void 0:t.reactRouter)||(n==null?void 0:n.reactRouter),{useLocation:o,useSearchParams:l}=c,{pathname:f}=o(),[d,u]=l(),E=(a==null?void 0:a.filter)||ft;if(!c)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");const g=(b,C,T=!0)=>{const y=me(b,(t==null?void 0:t.pathname)||f,E);if(!C||Array.isArray(C)&&!C.length){d.delete(b),u(d),localStorage.removeItem(y);return}T&&C&&localStorage.setItem(y,JSON.stringify({...d,[b]:C})),C&&(d.set(b,JSON.stringify(C)),u(d))};return{getFilter:(b,C)=>{const T=d.get(b);if(T)try{return JSON.parse(T)}catch{return T}const y=me(b,(t==null?void 0:t.pathname)||f,E),_=localStorage.getItem(y);if(_)try{return JSON.parse(_)[b]}catch{}return C},getFilters:()=>{const b=Object.fromEntries(d.entries()),T=Object.keys(localStorage).filter(y=>y.startsWith(E)&&y.endsWith((t==null?void 0:t.pathname)||f)).reduce((y,_)=>{var L,N;const k=localStorage.getItem(_);if(k){const Y=JSON.parse(k),x=(L=Object.keys(Y))==null?void 0:L[0];y[x]=(N=Object.values(Y))==null?void 0:N[0]}return y},{});return{...b,...T}},handleFilter:(b,C)=>(T,y)=>{if(y||Array.isArray(y)&&y.length===0){const _=C||"value",k=typeof y=="object"&&_ in y?y[_||"value"]:y;g(b,k);return}g(b,void 0)},setFilter:g}},vt=t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase(),gt=t=>{const c=t.split("/").filter(o=>o.length>0).map(o=>o.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(u=>u.charAt(0).toUpperCase()+u.slice(1)).join("")).join("");return c.charAt(0).toLowerCase()+c.slice(1)},ht=t=>(t.split("/").pop()||t).replace(/\.json$/,"").replace(/^openapi\./,""),yt=(t,n,a)=>{const c=gt(n),o=vt(a);return`${c}${o}`},mt=t=>{if(t)return(t==null?void 0:t.reduce((n,a)=>(n[a]={query:{useInfinite:!0,useInfiniteQueryParam:"offset",useQuery:!0}},n),{}))||{}},Et=t=>(Array.isArray(t)?t:[t]).reduce((a,c)=>{const{output:o,operationsToGenerateInfiniteQueryHook:l,input:f="./openapi.json"}=c||{},d=ht(f);return{...a,[d]:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:f,output:{baseUrl:o==null?void 0:o.baseUrl,client:"react-query",mode:"tags-split",override:{...(l==null?void 0:l.length)&&{operations:mt(l)},header:u=>["Generated by orval 🍺",...u.title?[u.title]:[],...u.description?[u.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/axiosCustomInstance.ts`},operationName:yt,query:{useQuery:!0}},schemas:(o==null?void 0:o.schemas)||`src/api/${d}/model`,target:(o==null?void 0:o.target)||`src/api/${d}/services/api.ts`,...o}}}},{});p.GTMSendPageView=Qe,p.InitializeAxiosConfig=He,p.InitializeDaysJSConfig=qe,p.InitializeI18nConfig=Xe,p.InitializeSentryConfig=Ze,p.InjectDependenciesContext=D,p.InjectDependenciesProvider=Ge,p.MaskTextField=$e,p.PreloadErrorHandler=et,p.QueryClientProviderWithConfig=nt,p.RequireAuth=Ke,p.dateAdapter=ge,p.distanceAdapter=he,p.getOrvalConfig=Et,p.useAdapter=ut,p.useAuth=it,p.useCurrentLanguage=lt,p.useFilters=dt,p.useInfiniteDataGrid=ot,p.useResponseError=at,p.worksiteNameAdapter=ye,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
25
+ Check the top-level render call using <`+c+">.")}return r}}function Ye(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var c=Yt(r);if(Ne[c])return;Ne[c]=!0;var v="";e&&e._owner&&e._owner!==ue.current&&(v=" It was passed a child from "+z(e._owner.type)+"."),U(e),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',c,v),U(null)}}function We(e,r){{if(typeof e!="object")return;if(ce(e))for(var c=0;c<e.length;c++){var v=e[c];fe(v)&&Ye(v,r)}else if(fe(e))e._store&&(e._store.validated=!0);else if(e){var w=T(e);if(typeof w=="function"&&w!==e.entries)for(var S=w.call(e),R;!(R=S.next()).done;)fe(R.value)&&Ye(R.value,r)}}}function Wt(e){{var r=e.type;if(r==null||typeof r=="string")return;var c;if(typeof r=="function")c=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===u||r.$$typeof===P))c=r.propTypes;else return;if(c){var v=z(r);bt(c,e.props,"prop",v,e)}else if(r.PropTypes!==void 0&&!le){le=!0;var w=z(r);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",w||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function zt(e){{for(var r=Object.keys(e.props),c=0;c<r.length;c++){var v=r[c];if(v!=="children"&&v!=="key"){U(e),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",v),U(null);break}}e.ref!==null&&(U(e),_("Invalid attribute `ref` supplied to `React.Fragment`."),U(null))}}function ze(e,r,c,v,w,S){{var R=X(e);if(!R){var m="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(m+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var I=Nt();I?m+=I:m+=Le();var O;e===null?O="null":ce(e)?O="array":e!==void 0&&e.$$typeof===n?(O="<"+(z(e.type)||"Unknown")+" />",m=" Did you accidentally export a JSX literal instead of a component?"):O=typeof e,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",O,m)}var A=Lt(e,r,c,w,S);if(A==null)return A;if(R){var F=r.children;if(F!==void 0)if(v)if(ce(F)){for(var G=0;G<F.length;G++)We(F[G],e);Object.freeze&&Object.freeze(F)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else We(F,e)}return e===i?zt(A):Wt(A),A}}function Vt(e,r,c){return ze(e,r,c,!0)}function Mt(e,r,c){return ze(e,r,c,!1)}var Ut=Mt,Gt=Vt;K.Fragment=i,K.jsx=Ut,K.jsxs=Gt}()),K}process.env.NODE_ENV==="production"?re.exports=Me():re.exports=Ue();var W=re.exports;const D=h.createContext({}),Ge=({children:t,apiURL:n,libraries:a,localStorageKeys:i})=>{const o=h.useMemo(()=>({apiURL:n,libraries:a,localStorageKeys:i}),[n,a,i]);return W.jsx(D.Provider,{value:o,children:t})},Je="user",Ke=({Fallback:t,isLogged:n,loginPath:a="/login",redirect401Path:i="/login",...o})=>{var k,L,N,Y;const{libraries:l,localStorageKeys:f}=h.useContext(D),d=(o==null?void 0:o.reactRouter)||(l==null?void 0:l.reactRouter),u=(o==null?void 0:o.axios)||(l==null?void 0:l.axios),E=(o==null?void 0:o.localStorageKey)||(f==null?void 0:f.user)||Je;if(!d)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");const[g,P]=h.useState(null),{useLocation:j,Navigate:s,Outlet:b}=d,C=j(),T=h.useRef(!1),y=typeof n=="function"?n():!!n,_=typeof y=="boolean"?y:y==null?void 0:y.isLogged;return h.useEffect(()=>{T.current||(T.current=!0,u.interceptors.response.use(x=>x,async x=>{var X;return typeof x=="object"&&x&&"response"in x&&x.response&&typeof x.response=="object"&&"status"in x.response&&x.response&&typeof x.response=="object"&&"status"in x.response&&((X=x==null?void 0:x.response)==null?void 0:X.status)===401&&(u.defaults.headers.common.Authorization=null,typeof window<"u"&&window.localStorage&&localStorage.removeItem(E),P(i)),Promise.reject(x)}))},[u.defaults.headers.common,u.interceptors.response,E,i]),_&&!g?W.jsx(h.Suspense,{fallback:t,children:(L=(k=C.state)==null?void 0:k.from)!=null&&L.state&&((Y=(N=C.state)==null?void 0:N.from)==null?void 0:Y.pathname)===a?W.jsx(s,{to:C.state.from.state.from.pathname+C.state.from.state.from.search,replace:!0}):W.jsx(b,{})}):W.jsx(s,{to:a+C.search,state:{from:C},replace:!0})},Qe=({data:t,...n})=>{const{libraries:a}=h.useContext(D),i=(n==null?void 0:n.reactRouter)||(a==null?void 0:a.reactRouter),o=(n==null?void 0:n.gtm)||(a==null?void 0:a.gtm);if(!i)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");if(!o)throw new Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");const{useGoogleTagManager:l}=o,{useLocation:f,Outlet:d}=i,{pathname:u}=f(),{sendEvent:E}=l();return h.useEffect(()=>{E({event:"pageView",pathname:u,...t})},[t,u,E]),W.jsx(d,{})},Be="user",He=({tokenTypeKey:t="tokenType",tokenKey:n="accessToken",postContentType:a="application/json",...i})=>{const{apiURL:o=i.apiURL,libraries:l,localStorageKeys:f}=h.useContext(D),d=(i==null?void 0:i.userLocalStorageKey)||(f==null?void 0:f.user)||Be,u=(i==null?void 0:i.axios)||(l==null?void 0:l.axios);if(!u)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!(u!=null&&u.defaults))return null;if(typeof window<"u"&&window.localStorage){const E=localStorage.getItem(d),g=E?JSON.parse(E):null,P=g!=null&&g[t]?g[t]:null,j=g!=null&&g[n]?g[n]:null,s=E?`${P} ${j}`:null;s&&(u.defaults.headers.common.Authorization=s)}return u.defaults.baseURL=o,u.defaults.headers.post["Content-Type"]=a,null},Xe=({debug:t,resources:n,...a})=>{const{libraries:i}=h.useContext(D),o=(a==null?void 0:a.i18)||(i==null?void 0:i.i18),{i18next:l,initReactI18next:f,languageDetector:d}=o||{};if(!o)throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return l!=null&&l.isInitialized||(l.use(d).use(f).init({debug:t,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:"languageChanged loaded",useSuspense:!0},resources:n,returnNull:!1}).then(()=>{document.documentElement.lang!==l.resolvedLanguage&&l.resolvedLanguage&&document.documentElement.setAttribute("lang",l.resolvedLanguage)}),l.on("languageChanged",u=>{document.documentElement.setAttribute("lang",u)})),null},Ze=({dsn:t,integrations:n,tracesSampleRate:a,replaysSessionSampleRate:i,replaysOnErrorSampleRate:o,tracePropagationTargets:l,ignoreErrors:f,debug:d,environment:u,release:E,...g})=>{const{libraries:P}=h.useContext(D),j=(g==null?void 0:g.sentry)||(P==null?void 0:P.sentry),s=(g==null?void 0:g.reactRouter)||(P==null?void 0:P.reactRouter);if(!j)throw new Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!s)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(j.isInitialized())return null;const{createRoutesFromChildren:b,matchRoutes:C,useLocation:T,useNavigationType:y}=s;return(d||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&j.init({debug:d,dsn:t,environment:u||"production",ignoreErrors:[...f||[],/dynamically imported module/,/Cannot read properties of undefined \(reading 'default'\)/,/Loading chunk \d+ failed/,/ChunkLoadError/,/Failed to fetch dynamically imported module/,/vite:preloadError/],integrations:[j.reactRouterV6BrowserTracingIntegration({createRoutesFromChildren:b,matchRoutes:C,useEffect:h.useEffect,useLocation:T,useNavigationType:y}),...n||[]],release:E,replaysOnErrorSampleRate:o||1,replaysSessionSampleRate:i||.1,tracePropagationTargets:l,tracesSampleRate:a||1}),null},$e=({IMaskMixin:t,...n})=>{const a=h.useMemo(()=>t(({TextField:i,...o})=>W.jsx(i,{...o})),[t]);return W.jsx(a,{...n})},qe=({language:t,...n})=>{const{libraries:a}=h.useContext(D),i=(n==null?void 0:n.dayjs)||(a==null?void 0:a.dayjs),o=(n==null?void 0:n.plugin)||(a==null?void 0:a.dayjsPlugin);if(!i)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props of InitializeDaysJSConfig.");return h.useEffect(()=>{(async()=>{var d;const f=t||((d=navigator.language)==null?void 0:d.slice(0,2))||"en";o&&o.forEach(u=>{u&&i.extend(u)}),await import("dayjs/locale/en"),await import("dayjs/locale/fr"),i.locale(f)})().then()},[i,o,t]),null},et=()=>(h.useEffect(()=>{const t=n=>{try{n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation(),window.location.reload()}catch{}};return window.addEventListener("vite:preloadError",t),()=>{window.removeEventListener("vite:preloadError",t)}},[]),null),tt=t=>t&&typeof t=="function",rt=t=>t&&typeof t=="function",nt=({children:t,defaultQueriesOptions:n,defaultMutationsOptions:a,...i})=>{var u,E;const{libraries:o}=h.useContext(D),l=(i==null?void 0:i.QueryClient)||((u=o==null?void 0:o.reactQuery)==null?void 0:u.QueryClient),f=(i==null?void 0:i.QueryClientProvider)||((E=o==null?void 0:o.reactQuery)==null?void 0:E.QueryClientProvider);if(!l)throw new Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!f)throw new Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!tt(f))throw new Error("Provided QueryClientProvider dependencies are not valid.");if(!rt(l))throw new Error("Provided QueryClient dependencies are not valid.");const d=new l({defaultOptions:{mutations:{...a},queries:{getNextPageParam:(g,P,j)=>g.length+(j||0),refetchOnWindowFocus:!1,retry:3,...n}}});return W.jsx(f,{client:d,children:t})},at=t=>{var E,g,P;const{libraries:n}=h.useContext(D),a=(t==null?void 0:t.i18)||(n==null?void 0:n.i18),i=((E=t==null?void 0:t.i18)==null?void 0:E.translateFunction)||((g=n==null?void 0:n.i18)==null?void 0:g.translateFunction),o=((P=a==null?void 0:a.i18next)==null?void 0:P.t)||i||(j=>j),{unknownErrorTranslationKey:l="error.unknownError"}=t||{},f=o(l),d=h.useCallback(j=>{var b,C,T,y,_,k,L,N,Y;const{response:s}=j||{};return s!=null&&s.reason?String(s.reason):(b=s==null?void 0:s.data)!=null&&b.reason?String(s.data.reason):(C=s==null?void 0:s.data)!=null&&C.message?String(s.data.message):(y=(T=s==null?void 0:s.data)==null?void 0:T.detail)!=null&&y.length&&Array.isArray((_=s==null?void 0:s.data)==null?void 0:_.detail)&&((L=(k=s==null?void 0:s.data)==null?void 0:k.detail[0])!=null&&L.msg)&&typeof((Y=(N=s==null?void 0:s.data)==null?void 0:N.detail[0])==null?void 0:Y.msg)=="string"?String(s.data.detail[0].msg):f},[f]);return{getErrorCode:h.useCallback(j=>{var b,C,T;const{response:s}=j||{};return s!=null&&s.error_code?String(s==null?void 0:s.error_code):(b=s==null?void 0:s.data)!=null&&b.error_code?String((C=s==null?void 0:s.data)==null?void 0:C.error_code):s!=null&&s.error_code?String(s==null?void 0:s.error_code):(T=s==null?void 0:s.data)!=null&&T.error_code?String(s.data.error_code):"unknown_error_code"},[]),printError:d}},ot=({data:t,fetchNextPage:n,isFetchingNextPage:a,isInitialLoading:i,isLoading:o,enabled:l=!0})=>{const f=h.useCallback(async u=>{a||!l||await n({pageParam:(u==null?void 0:u.pageParam)||u.visibleRowsCount})},[l,n,a]),d=h.useMemo(()=>{if(t)return t.pages.reduce((u,E)=>[...u,...E],[])},[t]);return{fetchNextPageOnRowsScrollEnd:f,isLoading:a||o,loadingVariant:i?"skeleton":"linear",rows:d}},it=t=>{const{libraries:n}=h.useContext(D),a=(t==null?void 0:t.axios)||(n==null?void 0:n.axios),i=(t==null?void 0:t.localStorageKey)||"user";if(!a)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");const o=h.useCallback(({tokenType:f,accessToken:d})=>{a.defaults.headers.common.Authorization=`${f} ${d}`},[a.defaults.headers.common]),l=()=>{a.defaults.headers.common.Authorization=null};return h.useEffect(()=>{const f=({newValue:d,key:u})=>{if(u===i&&d)try{const{accessToken:E,tokenType:g}=JSON.parse(d);o({accessToken:E,tokenType:g})}catch(E){console.error("Failed to parse newValue from localStorage:",E)}};return window.addEventListener("storage",f),()=>{window.removeEventListener("storage",f)}},[i,o]),{clearAuthenticationToken:l,setAuthenticationToken:o}},ge=({library:t,date:n,format:a="ll"})=>t(n).format(a),he=(t,n)=>{const{fractionDigits:a=0,metric:i="km"}=n||{},o=Number(t);return Number.isNaN(o)?`0${i}`:`${o.toFixed(a)} ${i}`},ye=t=>!t||typeof t!="string"?"":t.replace(/_/g," ").toLowerCase().split(" ").map(a=>a.length>0?a.charAt(0).toUpperCase()+a.slice(1):a).join(" "),ct=t=>t!=null&&t.startsWith("/")?t!=null&&t.startsWith("/files")?t:`/files${t}`:t!=null&&t.startsWith("files")?`/${t}`:`/files/${t}`,st=({path:t,size:n,apiURL:a})=>{if(!t)return"";const i=ct(t),o=`${a}${i}`,l=o.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/)!==null;return typeof n=="number"&&l?`${o.replace("/files",`/thumbs/${n}`)}`:o},ut=t=>{const{apiURL:n,libraries:a}=h.useContext(D),i=(t==null?void 0:t.dayjs)||(a==null?void 0:a.dayjs);return{dateAdapter:(f,d)=>{if(!i)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return ge({date:f,format:d,library:i})},distanceAdapter:he,filePathAdapter:(f,d)=>{if(!n)throw new Error("API URL is not provided. You can provide it with InjectDependenciesProvider or directly in props to filePathAdapter.");return st({apiURL:n,path:f,size:d})},worksiteNameAdapter:ye}},H=(t,n)=>n==="short"?t.split("-")[0]:t,lt=(t,n="full")=>{const[a,i]=h.useState(()=>{const o=(t==null?void 0:t.language)||navigator.language;return t&&"isInitialized"in t&&t.isInitialized,H(o,n)});return h.useEffect(()=>{var l;t&&"isInitialized"in t&&t.isInitialized&&t.language&&i(H(t.language,n));const o=f=>{i(H(f,n))};return(l=t==null?void 0:t.on)==null||l.call(t,"languageChanged",o),()=>{var f;(f=t==null?void 0:t.off)==null||f.call(t,"languageChanged",o)}},[t,n]),a},ft="tracktor.filter",me=(t,n,a)=>`${a}_${t}=>${n}`,dt=t=>{const{libraries:n,localStorageKeys:a}=h.useContext(D),i=(t==null?void 0:t.reactRouter)||(n==null?void 0:n.reactRouter),{useLocation:o,useSearchParams:l}=i,{pathname:f}=o(),[d,u]=l(),E=(a==null?void 0:a.filter)||ft;if(!i)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");const g=(b,C,T=!0)=>{const y=me(b,(t==null?void 0:t.pathname)||f,E);if(!C||Array.isArray(C)&&!C.length){d.delete(b),u(d),localStorage.removeItem(y);return}T&&C&&localStorage.setItem(y,JSON.stringify({...d,[b]:C})),C&&(d.set(b,JSON.stringify(C)),u(d))};return{getFilter:(b,C)=>{const T=d.get(b);if(T)try{return JSON.parse(T)}catch{return T}const y=me(b,(t==null?void 0:t.pathname)||f,E),_=localStorage.getItem(y);if(_)try{return JSON.parse(_)[b]}catch{}return C},getFilters:()=>{const b=Object.fromEntries(d.entries()),T=Object.keys(localStorage).filter(y=>y.startsWith(E)&&y.endsWith((t==null?void 0:t.pathname)||f)).reduce((y,_)=>{var L,N;const k=localStorage.getItem(_);if(k){const Y=JSON.parse(k),x=(L=Object.keys(Y))==null?void 0:L[0];y[x]=(N=Object.values(Y))==null?void 0:N[0]}return y},{});return{...b,...T}},handleFilter:(b,C)=>(T,y)=>{if(y||Array.isArray(y)&&y.length===0){const _=C||"value",k=typeof y=="object"&&_ in y?y[_||"value"]:y;g(b,k);return}g(b,void 0)},setFilter:g}},vt=t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase(),gt=t=>{const i=t.split("/").filter(o=>o.length>0).map(o=>o.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(u=>u.charAt(0).toUpperCase()+u.slice(1)).join("")).join("");return i.charAt(0).toLowerCase()+i.slice(1)},ht=t=>(t.split("/").pop()||t).replace(/\.json$/,"").replace(/^openapi\./,""),yt=(t,n,a)=>{const i=gt(n),o=vt(a);return`${i}${o}`},mt=t=>{if(t)return(t==null?void 0:t.reduce((n,a)=>(n[a]={query:{useInfinite:!0,useInfiniteQueryParam:"offset",useQuery:!0}},n),{}))||{}},Et=t=>(Array.isArray(t)?t:[t]).reduce((a,i)=>{const{output:o,operationsToGenerateInfiniteQueryHook:l,input:f="./openapi.json"}=i||{},d=ht(f);return{...a,[d]:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:f,output:{baseUrl:o==null?void 0:o.baseUrl,client:"react-query",mode:"tags-split",override:{...(l==null?void 0:l.length)&&{operations:mt(l)},header:u=>["Generated by orval 🍺",...u.title?[u.title]:[],...u.description?[u.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/axiosCustomInstance.ts`},operationName:yt,query:{useQuery:!0}},schemas:(o==null?void 0:o.schemas)||`src/api/${d}/model`,target:(o==null?void 0:o.target)||`src/api/${d}/services/api.ts`,...o}}}},{});p.GTMSendPageView=Qe,p.InitializeAxiosConfig=He,p.InitializeDaysJSConfig=qe,p.InitializeI18nConfig=Xe,p.InitializeSentryConfig=Ze,p.InjectDependenciesContext=D,p.InjectDependenciesProvider=Ge,p.MaskTextField=$e,p.PreloadErrorHandler=et,p.QueryClientProviderWithConfig=nt,p.RequireAuth=Ke,p.dateAdapter=ge,p.distanceAdapter=he,p.getOrvalConfig=Et,p.useAdapter=ut,p.useAuth=it,p.useCurrentLanguage=lt,p.useFilters=dt,p.useInfiniteDataGrid=ot,p.useResponseError=at,p.worksiteNameAdapter=ye,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
@@ -2,7 +2,10 @@
2
2
  * Adapter for distance
3
3
  * Get distance and metric and return formatted distance
4
4
  * @param distance
5
- * @param metric
5
+ * @param options
6
6
  */
7
- declare const distanceAdapter: (distance?: string | number | null, metric?: string) => string;
7
+ declare const distanceAdapter: (distance?: string | number | null, options?: {
8
+ fractionDigits?: number;
9
+ metric?: string;
10
+ }) => string;
8
11
  export default distanceAdapter;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tracktor/shared-module",
3
- "version": "2.10.0",
3
+ "version": "2.11.1",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "types": "./dist/main.d.ts",