@tracktor/shared-module 2.1.6 → 2.1.8

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.1.6
4
- - **[fix]** - axios instance
3
+ ## v2.1.8
4
+ - **[fix]** - dayjs load locale
package/dist/main.js CHANGED
@@ -1,4 +1,4 @@
1
- import Ne, { createContext as dt, useMemo as le, useContext as k, useState as vt, useRef as gt, useEffect as Z, Suspense as yt, useCallback as ce } from "react";
1
+ import Ne, { createContext as dt, useMemo as le, useContext as k, useState as vt, useRef as gt, useEffect as Z, Suspense as mt, useCallback as ce } from "react";
2
2
  var se = { exports: {} }, B = {};
3
3
  /**
4
4
  * @license React
@@ -10,18 +10,18 @@ var se = { exports: {} }, B = {};
10
10
  * LICENSE file in the root directory of this source tree.
11
11
  */
12
12
  var Fe;
13
- function mt() {
13
+ function yt() {
14
14
  if (Fe) return B;
15
15
  Fe = 1;
16
16
  var t = Ne, n = Symbol.for("react.element"), i = 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 };
17
- function d(v, s, m) {
18
- var E, w = {}, p = null, u = null;
19
- m !== void 0 && (p = "" + m), s.key !== void 0 && (p = "" + s.key), s.ref !== void 0 && (u = s.ref);
17
+ function v(d, s, y) {
18
+ var E, w = {}, R = null, u = null;
19
+ y !== void 0 && (R = "" + y), s.key !== void 0 && (R = "" + s.key), s.ref !== void 0 && (u = s.ref);
20
20
  for (E in s) c.call(s, E) && !l.hasOwnProperty(E) && (w[E] = s[E]);
21
- if (v && v.defaultProps) for (E in s = v.defaultProps, s) w[E] === void 0 && (w[E] = s[E]);
22
- return { $$typeof: n, type: v, key: p, ref: u, props: w, _owner: a.current };
21
+ if (d && d.defaultProps) for (E in s = d.defaultProps, s) w[E] === void 0 && (w[E] = s[E]);
22
+ return { $$typeof: n, type: d, key: R, ref: u, props: w, _owner: a.current };
23
23
  }
24
- return B.Fragment = i, B.jsx = d, B.jsxs = d, B;
24
+ return B.Fragment = i, B.jsx = v, B.jsxs = v, B;
25
25
  }
26
26
  var G = {};
27
27
  /**
@@ -36,7 +36,7 @@ var G = {};
36
36
  var Ye;
37
37
  function ht() {
38
38
  return Ye || (Ye = 1, process.env.NODE_ENV !== "production" && function() {
39
- var t = Ne, n = Symbol.for("react.element"), i = Symbol.for("react.portal"), c = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), d = Symbol.for("react.provider"), v = Symbol.for("react.context"), s = Symbol.for("react.forward_ref"), m = Symbol.for("react.suspense"), E = Symbol.for("react.suspense_list"), w = Symbol.for("react.memo"), p = Symbol.for("react.lazy"), u = Symbol.for("react.offscreen"), j = Symbol.iterator, S = "@@iterator";
39
+ var t = Ne, n = Symbol.for("react.element"), i = Symbol.for("react.portal"), c = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), v = Symbol.for("react.provider"), d = Symbol.for("react.context"), s = Symbol.for("react.forward_ref"), y = Symbol.for("react.suspense"), E = Symbol.for("react.suspense_list"), w = Symbol.for("react.memo"), R = Symbol.for("react.lazy"), u = Symbol.for("react.offscreen"), j = Symbol.iterator, S = "@@iterator";
40
40
  function x(e) {
41
41
  if (e === null || typeof e != "object")
42
42
  return null;
@@ -55,16 +55,16 @@ function ht() {
55
55
  {
56
56
  var f = D.ReactDebugCurrentFrame, h = f.getStackAddendum();
57
57
  h !== "" && (r += "%s", o = o.concat([h]));
58
- var R = o.map(function(y) {
59
- return String(y);
58
+ var p = o.map(function(m) {
59
+ return String(m);
60
60
  });
61
- R.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, R);
61
+ p.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, p);
62
62
  }
63
63
  }
64
64
  var N = !1, W = !1, C = !1, fe = !1, de = !1, M;
65
65
  M = Symbol.for("react.module.reference");
66
66
  function We(e) {
67
- return !!(typeof e == "string" || typeof e == "function" || e === c || e === l || de || e === a || e === m || e === E || fe || e === u || N || W || C || typeof e == "object" && e !== null && (e.$$typeof === p || e.$$typeof === w || e.$$typeof === d || e.$$typeof === v || e.$$typeof === s || // This needs to include all possible module reference object
67
+ return !!(typeof e == "string" || typeof e == "function" || e === c || e === l || de || e === a || e === y || e === E || fe || e === u || N || W || C || typeof e == "object" && e !== null && (e.$$typeof === R || e.$$typeof === w || e.$$typeof === v || e.$$typeof === d || e.$$typeof === s || // 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.
@@ -96,17 +96,17 @@ function ht() {
96
96
  return "Profiler";
97
97
  case a:
98
98
  return "StrictMode";
99
- case m:
99
+ case y:
100
100
  return "Suspense";
101
101
  case E:
102
102
  return "SuspenseList";
103
103
  }
104
104
  if (typeof e == "object")
105
105
  switch (e.$$typeof) {
106
- case v:
106
+ case d:
107
107
  var r = e;
108
108
  return ve(r) + ".Consumer";
109
- case d:
109
+ case v:
110
110
  var o = e;
111
111
  return ve(o._context) + ".Provider";
112
112
  case s:
@@ -114,10 +114,10 @@ function ht() {
114
114
  case w:
115
115
  var f = e.displayName || null;
116
116
  return f !== null ? f : I(e.type) || "Memo";
117
- case p: {
118
- var h = e, R = h._payload, y = h._init;
117
+ case R: {
118
+ var h = e, p = h._payload, m = h._init;
119
119
  try {
120
- return I(y(R));
120
+ return I(m(p));
121
121
  } catch {
122
122
  return null;
123
123
  }
@@ -125,14 +125,14 @@ function ht() {
125
125
  }
126
126
  return null;
127
127
  }
128
- var L = Object.assign, U = 0, ge, ye, me, he, Ee, Re, pe;
128
+ var L = Object.assign, U = 0, ge, me, ye, he, Ee, pe, Re;
129
129
  function we() {
130
130
  }
131
131
  we.__reactDisabledLog = !0;
132
132
  function Ve() {
133
133
  {
134
134
  if (U === 0) {
135
- ge = console.log, ye = console.info, me = console.warn, he = console.error, Ee = console.group, Re = console.groupCollapsed, pe = console.groupEnd;
135
+ ge = console.log, me = console.info, ye = console.warn, he = console.error, Ee = console.group, pe = console.groupCollapsed, Re = console.groupEnd;
136
136
  var e = {
137
137
  configurable: !0,
138
138
  enumerable: !0,
@@ -165,10 +165,10 @@ function ht() {
165
165
  value: ge
166
166
  }),
167
167
  info: L({}, e, {
168
- value: ye
168
+ value: me
169
169
  }),
170
170
  warn: L({}, e, {
171
- value: me
171
+ value: ye
172
172
  }),
173
173
  error: L({}, e, {
174
174
  value: he
@@ -177,10 +177,10 @@ function ht() {
177
177
  value: Ee
178
178
  }),
179
179
  groupCollapsed: L({}, e, {
180
- value: Re
180
+ value: pe
181
181
  }),
182
182
  groupEnd: L({}, e, {
183
- value: pe
183
+ value: Re
184
184
  })
185
185
  });
186
186
  }
@@ -218,31 +218,31 @@ function ht() {
218
218
  re = !0;
219
219
  var h = Error.prepareStackTrace;
220
220
  Error.prepareStackTrace = void 0;
221
- var R;
222
- R = ee.current, ee.current = null, Ve();
221
+ var p;
222
+ p = ee.current, ee.current = null, Ve();
223
223
  try {
224
224
  if (r) {
225
- var y = function() {
225
+ var m = function() {
226
226
  throw Error();
227
227
  };
228
- if (Object.defineProperty(y.prototype, "props", {
228
+ if (Object.defineProperty(m.prototype, "props", {
229
229
  set: function() {
230
230
  throw Error();
231
231
  }
232
232
  }), typeof Reflect == "object" && Reflect.construct) {
233
233
  try {
234
- Reflect.construct(y, []);
234
+ Reflect.construct(m, []);
235
235
  } catch ($) {
236
236
  f = $;
237
237
  }
238
- Reflect.construct(e, [], y);
238
+ Reflect.construct(e, [], m);
239
239
  } else {
240
240
  try {
241
- y.call();
241
+ m.call();
242
242
  } catch ($) {
243
243
  f = $;
244
244
  }
245
- e.call(y.prototype);
245
+ e.call(m.prototype);
246
246
  }
247
247
  } else {
248
248
  try {
@@ -272,7 +272,7 @@ function ht() {
272
272
  }
273
273
  }
274
274
  } finally {
275
- re = !1, ee.current = R, ze(), Error.prepareStackTrace = h;
275
+ re = !1, ee.current = p, ze(), Error.prepareStackTrace = h;
276
276
  }
277
277
  var z = e ? e.displayName || e.name : "", $e = z ? Q(z) : "";
278
278
  return typeof e == "function" && J.set(e, $e), $e;
@@ -292,7 +292,7 @@ function ht() {
292
292
  if (typeof e == "string")
293
293
  return Q(e);
294
294
  switch (e) {
295
- case m:
295
+ case y:
296
296
  return Q("Suspense");
297
297
  case E:
298
298
  return Q("SuspenseList");
@@ -303,10 +303,10 @@ function ht() {
303
303
  return Ue(e.render);
304
304
  case w:
305
305
  return X(e.type, r, o);
306
- case p: {
307
- var f = e, h = f._payload, R = f._init;
306
+ case R: {
307
+ var f = e, h = f._payload, p = f._init;
308
308
  try {
309
- return X(R(h), r, o);
309
+ return X(p(h), r, o);
310
310
  } catch {
311
311
  }
312
312
  }
@@ -323,20 +323,20 @@ function ht() {
323
323
  }
324
324
  function Be(e, r, o, f, h) {
325
325
  {
326
- var R = Function.call.bind(H);
327
- for (var y in e)
328
- if (R(e, y)) {
326
+ var p = Function.call.bind(H);
327
+ for (var m in e)
328
+ if (p(e, m)) {
329
329
  var g = void 0;
330
330
  try {
331
- if (typeof e[y] != "function") {
332
- var T = Error((f || "React class") + ": " + o + " type `" + y + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[y] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
331
+ if (typeof e[m] != "function") {
332
+ var T = Error((f || "React class") + ": " + o + " type `" + m + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[m] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
333
333
  throw T.name = "Invariant Violation", T;
334
334
  }
335
- g = e[y](r, y, f, o, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
335
+ g = e[m](r, m, f, o, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
336
336
  } catch (b) {
337
337
  g = b;
338
338
  }
339
- g && !(g instanceof Error) && (K(h), _("%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).", f || "React class", o, y, typeof g), K(null)), g instanceof Error && !(g.message in be) && (be[g.message] = !0, K(h), _("Failed %s type: %s", o, g.message), K(null));
339
+ g && !(g instanceof Error) && (K(h), _("%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).", f || "React class", o, m, typeof g), K(null)), g instanceof Error && !(g.message in be) && (be[g.message] = !0, K(h), _("Failed %s type: %s", o, g.message), K(null));
340
340
  }
341
341
  }
342
342
  }
@@ -415,7 +415,7 @@ function ht() {
415
415
  });
416
416
  }
417
417
  }
418
- var rt = function(e, r, o, f, h, R, y) {
418
+ var rt = function(e, r, o, f, h, p, m) {
419
419
  var g = {
420
420
  // This tag allows us to uniquely identify this as a React Element
421
421
  $$typeof: n,
@@ -423,9 +423,9 @@ function ht() {
423
423
  type: e,
424
424
  key: r,
425
425
  ref: o,
426
- props: y,
426
+ props: m,
427
427
  // Record the component responsible for creating this element.
428
- _owner: R
428
+ _owner: p
429
429
  };
430
430
  return g._store = {}, Object.defineProperty(g._store, "validated", {
431
431
  configurable: !1,
@@ -446,20 +446,20 @@ function ht() {
446
446
  };
447
447
  function nt(e, r, o, f, h) {
448
448
  {
449
- var R, y = {}, g = null, T = null;
449
+ var p, m = {}, g = null, T = null;
450
450
  o !== void 0 && (je(o), g = "" + o), Ke(r) && (je(r.key), g = "" + r.key), He(r) && (T = r.ref, Ze(r, h));
451
- for (R in r)
452
- H.call(r, R) && !Xe.hasOwnProperty(R) && (y[R] = r[R]);
451
+ for (p in r)
452
+ H.call(r, p) && !Xe.hasOwnProperty(p) && (m[p] = r[p]);
453
453
  if (e && e.defaultProps) {
454
454
  var b = e.defaultProps;
455
- for (R in b)
456
- y[R] === void 0 && (y[R] = b[R]);
455
+ for (p in b)
456
+ m[p] === void 0 && (m[p] = b[p]);
457
457
  }
458
458
  if (g || T) {
459
459
  var P = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
460
- g && et(y, P), T && tt(y, P);
460
+ g && et(m, P), T && tt(m, P);
461
461
  }
462
- return rt(e, g, T, h, f, q.current, y);
462
+ return rt(e, g, T, h, f, q.current, m);
463
463
  }
464
464
  }
465
465
  var ie = D.ReactCurrentOwner, Se = D.ReactDebugCurrentFrame;
@@ -530,8 +530,8 @@ Check the top-level render call using <` + o + ">.");
530
530
  else if (e) {
531
531
  var h = x(e);
532
532
  if (typeof h == "function" && h !== e.entries)
533
- for (var R = h.call(e), y; !(y = R.next()).done; )
534
- ue(y.value) && De(y.value, r);
533
+ for (var p = h.call(e), m; !(m = p.next()).done; )
534
+ ue(m.value) && De(m.value, r);
535
535
  }
536
536
  }
537
537
  }
@@ -572,10 +572,10 @@ Check the top-level render call using <` + o + ">.");
572
572
  e.ref !== null && (V(e), _("Invalid attribute `ref` supplied to `React.Fragment`."), V(null));
573
573
  }
574
574
  }
575
- function Ie(e, r, o, f, h, R) {
575
+ function Ie(e, r, o, f, h, p) {
576
576
  {
577
- var y = We(e);
578
- if (!y) {
577
+ var m = We(e);
578
+ if (!m) {
579
579
  var g = "";
580
580
  (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (g += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
581
581
  var T = ot();
@@ -583,10 +583,10 @@ Check the top-level render call using <` + o + ">.");
583
583
  var b;
584
584
  e === null ? b = "null" : ne(e) ? b = "array" : e !== void 0 && e.$$typeof === n ? (b = "<" + (I(e.type) || "Unknown") + " />", g = " Did you accidentally export a JSX literal instead of a component?") : b = 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", b, g);
585
585
  }
586
- var P = nt(e, r, o, h, R);
586
+ var P = nt(e, r, o, h, p);
587
587
  if (P == null)
588
588
  return P;
589
- if (y) {
589
+ if (m) {
590
590
  var O = r.children;
591
591
  if (O !== void 0)
592
592
  if (f)
@@ -612,7 +612,7 @@ Check the top-level render call using <` + o + ">.");
612
612
  G.Fragment = c, G.jsx = lt, G.jsxs = ft;
613
613
  }()), G;
614
614
  }
615
- process.env.NODE_ENV === "production" ? se.exports = mt() : se.exports = ht();
615
+ process.env.NODE_ENV === "production" ? se.exports = yt() : se.exports = ht();
616
616
  var F = se.exports;
617
617
  const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
618
618
  const c = le(
@@ -632,10 +632,10 @@ const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
632
632
  ...l
633
633
  }) => {
634
634
  var _, Y, N, W;
635
- const { libraries: d } = k(A), v = (l == null ? void 0 : l.reactRouter) || (d == null ? void 0 : d.reactRouter), s = (l == null ? void 0 : l.axios) || (d == null ? void 0 : d.axios);
636
- if (!v)
635
+ const { libraries: v } = k(A), d = (l == null ? void 0 : l.reactRouter) || (v == null ? void 0 : v.reactRouter), s = (l == null ? void 0 : l.axios) || (v == null ? void 0 : v.axios);
636
+ if (!d)
637
637
  throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
638
- const [m, E] = vt(null), { useLocation: w, Navigate: p, Outlet: u } = v, j = w(), S = gt(!1), x = typeof n == "function" ? n() : !!n, D = typeof x == "boolean" ? x : x == null ? void 0 : x.isLogged;
638
+ const [y, E] = vt(null), { useLocation: w, Navigate: R, Outlet: u } = d, j = w(), S = gt(!1), x = typeof n == "function" ? n() : !!n, D = typeof x == "boolean" ? x : x == null ? void 0 : x.isLogged;
639
639
  return Z(() => {
640
640
  S.current || (S.current = !0, s.interceptors.response.use(
641
641
  (C) => C,
@@ -644,7 +644,7 @@ const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
644
644
  return typeof C == "object" && C && "response" in C && C.response && typeof C.response == "object" && "status" in C.response && C.response && typeof C.response == "object" && "status" in C.response && ((M = C == null ? void 0 : C.response) == null ? void 0 : M.status) === 401 && (s.defaults.headers.common.Authorization = null, localStorage.removeItem(c), E(a)), Promise.reject(C);
645
645
  }
646
646
  ));
647
- }, [s.defaults.headers.common, s.interceptors.response, c, a]), D && !m ? /* @__PURE__ */ F.jsx(yt, { fallback: t, children: (Y = (_ = j.state) == null ? void 0 : _.from) != null && Y.state && ((W = (N = j.state) == null ? void 0 : N.from) == null ? void 0 : W.pathname) === i ? /* @__PURE__ */ F.jsx(p, { to: j.state.from.state.from.pathname + j.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ F.jsx(u, {}) }) : /* @__PURE__ */ F.jsx(p, { to: i, state: { from: j }, replace: !0 });
647
+ }, [s.defaults.headers.common, s.interceptors.response, c, a]), D && !y ? /* @__PURE__ */ F.jsx(mt, { fallback: t, children: (Y = (_ = j.state) == null ? void 0 : _.from) != null && Y.state && ((W = (N = j.state) == null ? void 0 : N.from) == null ? void 0 : W.pathname) === i ? /* @__PURE__ */ F.jsx(R, { to: j.state.from.state.from.pathname + j.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ F.jsx(u, {}) }) : /* @__PURE__ */ F.jsx(R, { to: i, state: { from: j }, replace: !0 });
648
648
  }, Dt = ({ ...t }) => {
649
649
  const { libraries: n } = k(A), i = (t == null ? void 0 : t.reactRouter) || (n == null ? void 0 : n.reactRouter), c = (t == null ? void 0 : t.gtm) || (n == null ? void 0 : n.gtm);
650
650
  if (!i)
@@ -653,10 +653,10 @@ const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
653
653
  );
654
654
  if (!c)
655
655
  throw new Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");
656
- const { useGoogleTagManager: a } = c, { useLocation: l, Outlet: d } = i, { pathname: v } = l(), { sendEvent: s } = a();
656
+ const { useGoogleTagManager: a } = c, { useLocation: l, Outlet: v } = i, { pathname: d } = l(), { sendEvent: s } = a();
657
657
  return Z(() => {
658
- s({ event: "pageView", pathname: v });
659
- }, [v, s]), /* @__PURE__ */ F.jsx(d, {});
658
+ s({ event: "pageView", pathname: d });
659
+ }, [d, s]), /* @__PURE__ */ F.jsx(v, {});
660
660
  }, kt = ({
661
661
  tokenTypeKey: t = "tokenType",
662
662
  userLocalStorageKey: n = "user",
@@ -664,18 +664,18 @@ const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
664
664
  postContentType: c = "application/json",
665
665
  ...a
666
666
  }) => {
667
- const { apiURL: l = a.apiURL, libraries: d } = k(A), v = (a == null ? void 0 : a.axios) || (d == null ? void 0 : d.axios);
668
- if (!v)
667
+ const { apiURL: l = a.apiURL, libraries: v } = k(A), d = (a == null ? void 0 : a.axios) || (v == null ? void 0 : v.axios);
668
+ if (!d)
669
669
  throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
670
- if (!(v != null && v.defaults))
670
+ if (!(d != null && d.defaults))
671
671
  return null;
672
- const s = localStorage.getItem(n), m = s ? JSON.parse(s) : null, E = m != null && m[t] ? m[t] : null, w = m != null && m[i] ? m[i] : null, p = s ? `${E} ${w}` : null;
673
- return v.defaults.baseURL = l, v.defaults.headers.post["Content-Type"] = c, p && (v.defaults.headers.common.Authorization = p), null;
672
+ const s = localStorage.getItem(n), y = s ? JSON.parse(s) : null, E = y != null && y[t] ? y[t] : null, w = y != null && y[i] ? y[i] : null, R = s ? `${E} ${w}` : null;
673
+ return d.defaults.baseURL = l, d.defaults.headers.post["Content-Type"] = c, R && (d.defaults.headers.common.Authorization = R), null;
674
674
  }, It = ({ debug: t, resources: n, ...i }) => {
675
- const { libraries: c } = k(A), a = (i == null ? void 0 : i.i18) || (c == null ? void 0 : c.i18), { i18next: l, initReactI18next: d, languageDetector: v } = a || {};
675
+ const { libraries: c } = k(A), a = (i == null ? void 0 : i.i18) || (c == null ? void 0 : c.i18), { i18next: l, initReactI18next: v, 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
- return l != null && l.isInitialized || (l.use(v).use(d).init({
678
+ return l != null && l.isInitialized || (l.use(d).use(v).init({
679
679
  debug: t,
680
680
  fallbackLng: "en",
681
681
  interpolation: {
@@ -700,24 +700,24 @@ const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
700
700
  replaysSessionSampleRate: c,
701
701
  replaysOnErrorSampleRate: a,
702
702
  tracePropagationTargets: l,
703
- ignoreErrors: d,
704
- debug: v,
703
+ ignoreErrors: v,
704
+ debug: d,
705
705
  environment: s,
706
- ...m
706
+ ...y
707
707
  }) => {
708
- const { libraries: E } = k(A), w = (m == null ? void 0 : m.sentry) || (E == null ? void 0 : E.sentry), p = (m == null ? void 0 : m.reactRouter) || (E == null ? void 0 : E.reactRouter);
708
+ const { libraries: E } = k(A), w = (y == null ? void 0 : y.sentry) || (E == null ? void 0 : E.sentry), R = (y == null ? void 0 : y.reactRouter) || (E == null ? void 0 : E.reactRouter);
709
709
  if (!w)
710
710
  throw new Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
711
- if (!p)
711
+ if (!R)
712
712
  throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
713
713
  if (w.isInitialized())
714
714
  return null;
715
- const { createRoutesFromChildren: u, matchRoutes: j, useLocation: S, useNavigationType: x } = p;
716
- return (v || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") && w.init({
717
- debug: v,
715
+ const { createRoutesFromChildren: u, matchRoutes: j, useLocation: S, useNavigationType: x } = R;
716
+ return (d || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") && w.init({
717
+ debug: d,
718
718
  dsn: t,
719
719
  environment: s || "production",
720
- ignoreErrors: [...d || [], /dynamically imported module/],
720
+ ignoreErrors: [...v || [], /dynamically imported module/],
721
721
  integrations: [
722
722
  w.reactRouterV6BrowserTracingIntegration({
723
723
  createRoutesFromChildren: u,
@@ -754,56 +754,57 @@ const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
754
754
  return Z(() => {
755
755
  (async () => {
756
756
  var d;
757
- t || (d = navigator.language) != null && d.slice(0, 2), a && a.forEach((v) => {
758
- v && c.extend(v);
757
+ const v = t || ((d = navigator.language) == null ? void 0 : d.slice(0, 2)) || "en";
758
+ import("dayjs/locale/en"), import("dayjs/locale/fr"), c.locale(v), a && a.forEach((s) => {
759
+ s && c.extend(s);
759
760
  });
760
761
  })().then();
761
762
  }, [c, a, t]), null;
762
- }, Et = (t) => t && typeof t == "function", Rt = (t) => t && typeof t == "function", Wt = ({
763
+ }, Et = (t) => t && typeof t == "function", pt = (t) => t && typeof t == "function", Wt = ({
763
764
  children: t,
764
765
  defaultQueriesOptions: n,
765
766
  defaultMutationsOptions: i,
766
767
  ...c
767
768
  }) => {
768
- var s, m;
769
- const { libraries: a } = k(A), l = (c == null ? void 0 : c.QueryClient) || ((s = a == null ? void 0 : a.reactQuery) == null ? void 0 : s.QueryClient), d = (c == null ? void 0 : c.QueryClientProvider) || ((m = a == null ? void 0 : a.reactQuery) == null ? void 0 : m.QueryClientProvider);
769
+ var s, y;
770
+ const { libraries: a } = k(A), l = (c == null ? void 0 : c.QueryClient) || ((s = a == null ? void 0 : a.reactQuery) == null ? void 0 : s.QueryClient), v = (c == null ? void 0 : c.QueryClientProvider) || ((y = a == null ? void 0 : a.reactQuery) == null ? void 0 : y.QueryClientProvider);
770
771
  if (!l)
771
772
  throw new Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
772
- if (!d)
773
+ if (!v)
773
774
  throw new Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
774
- if (!Et(d))
775
+ if (!Et(v))
775
776
  throw new Error("Provided QueryClientProvider dependencies are not valid.");
776
- if (!Rt(l))
777
+ if (!pt(l))
777
778
  throw new Error("Provided QueryClient dependencies are not valid.");
778
- const v = new l({
779
+ const d = new l({
779
780
  defaultOptions: {
780
781
  mutations: {
781
782
  ...i
782
783
  },
783
784
  queries: {
784
- getNextPageParam: (E, w, p) => E.length + (p || 0),
785
+ getNextPageParam: (E, w, R) => E.length + (R || 0),
785
786
  refetchOnWindowFocus: !1,
786
787
  retry: 3,
787
788
  ...n
788
789
  }
789
790
  }
790
791
  });
791
- return /* @__PURE__ */ F.jsx(d, { client: v, children: t });
792
+ return /* @__PURE__ */ F.jsx(v, { client: d, children: t });
792
793
  }, Lt = (t) => {
793
- var m, E, w;
794
- const { libraries: n } = k(A), i = (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) || ((E = n == null ? void 0 : n.i18) == null ? void 0 : E.translateFunction), a = ((w = i == null ? void 0 : i.i18next) == null ? void 0 : w.t) || c || ((p) => p), { unknownErrorTranslationKey: l = "error.unknownError" } = t || {}, d = a(l), v = ce(
795
- (p) => {
794
+ var y, E, w;
795
+ const { libraries: n } = k(A), i = (t == null ? void 0 : t.i18) || (n == null ? void 0 : n.i18), c = ((y = t == null ? void 0 : t.i18) == null ? void 0 : y.translateFunction) || ((E = n == null ? void 0 : n.i18) == null ? void 0 : E.translateFunction), a = ((w = i == null ? void 0 : i.i18next) == null ? void 0 : w.t) || c || ((R) => R), { unknownErrorTranslationKey: l = "error.unknownError" } = t || {}, v = a(l), d = ce(
796
+ (R) => {
796
797
  var j, S, x, D, _, Y, N, W, C;
797
- const { response: u } = p || {};
798
- return u != null && u.reason ? String(u.reason) : (j = u == null ? void 0 : u.data) != null && j.reason ? String(u.data.reason) : (S = u == null ? void 0 : u.data) != null && S.message ? String(u.data.message) : (D = (x = u == null ? void 0 : u.data) == null ? void 0 : x.detail) != null && D.length && Array.isArray((_ = u == null ? void 0 : u.data) == null ? void 0 : _.detail) && ((N = (Y = u == null ? void 0 : u.data) == null ? void 0 : Y.detail[0]) != null && N.msg) && typeof ((C = (W = u == null ? void 0 : u.data) == null ? void 0 : W.detail[0]) == null ? void 0 : C.msg) == "string" ? String(u.data.detail[0].msg) : d;
798
+ const { response: u } = R || {};
799
+ return u != null && u.reason ? String(u.reason) : (j = u == null ? void 0 : u.data) != null && j.reason ? String(u.data.reason) : (S = u == null ? void 0 : u.data) != null && S.message ? String(u.data.message) : (D = (x = u == null ? void 0 : u.data) == null ? void 0 : x.detail) != null && D.length && Array.isArray((_ = u == null ? void 0 : u.data) == null ? void 0 : _.detail) && ((N = (Y = u == null ? void 0 : u.data) == null ? void 0 : Y.detail[0]) != null && N.msg) && typeof ((C = (W = u == null ? void 0 : u.data) == null ? void 0 : W.detail[0]) == null ? void 0 : C.msg) == "string" ? String(u.data.detail[0].msg) : v;
799
800
  },
800
- [d]
801
+ [v]
801
802
  );
802
- return { getErrorCode: ce((p) => {
803
+ return { getErrorCode: ce((R) => {
803
804
  var j, S, x;
804
- const { response: u } = p || {};
805
+ const { response: u } = R || {};
805
806
  return u != null && u.error_code ? String(u == null ? void 0 : u.error_code) : (j = u == null ? void 0 : u.data) != null && j.error_code ? String((S = u == null ? void 0 : u.data) == null ? void 0 : S.error_code) : u != null && u.error_code ? String(u == null ? void 0 : u.error_code) : (x = u == null ? void 0 : u.data) != null && x.error_code ? String(u.data.error_code) : "unknown_error_code";
806
- }, []), printError: v };
807
+ }, []), printError: d };
807
808
  }, Vt = ({
808
809
  data: t,
809
810
  fetchNextPage: n,
@@ -812,20 +813,20 @@ const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
812
813
  isLoading: a,
813
814
  enabled: l = !0
814
815
  }) => {
815
- const d = ce(
816
+ const v = ce(
816
817
  async (s) => {
817
818
  i || !l || await n({ pageParam: (s == null ? void 0 : s.pageParam) || s.visibleRowsCount });
818
819
  },
819
820
  [l, n, i]
820
- ), v = le(() => {
821
+ ), d = le(() => {
821
822
  if (t)
822
- return t.pages.reduce((s, m) => [...s, ...m], []);
823
+ return t.pages.reduce((s, y) => [...s, ...y], []);
823
824
  }, [t]);
824
825
  return {
825
- fetchNextPageOnRowsScrollEnd: d,
826
+ fetchNextPageOnRowsScrollEnd: v,
826
827
  isLoading: i || a,
827
828
  loadingVariant: c ? "skeleton" : "linear",
828
- rows: v
829
+ rows: d
829
830
  };
830
831
  }, zt = (t) => {
831
832
  const { libraries: n } = k(A), i = (t == null ? void 0 : t.axios) || (n == null ? void 0 : n.axios);
@@ -835,11 +836,11 @@ const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
835
836
  clearAuthenticationToken: () => {
836
837
  i.defaults.headers.common.Authorization = null;
837
838
  },
838
- setAuthenticationToken: ({ tokenType: l, accessToken: d }) => {
839
- i.defaults.headers.common.Authorization = `${l} ${d}`;
839
+ setAuthenticationToken: ({ tokenType: l, accessToken: v }) => {
840
+ i.defaults.headers.common.Authorization = `${l} ${v}`;
840
841
  }
841
842
  };
842
- }, pt = ({ library: t, date: n, format: i = "ll" }) => t(n).format(i), wt = (t, n = "km") => {
843
+ }, Rt = ({ library: t, date: n, format: i = "ll" }) => t(n).format(i), wt = (t, n = "km") => {
843
844
  const i = Number(t);
844
845
  return Number.isNaN(i) ? `0 ${n}` : `${i.toFixed(2)} ${n}`;
845
846
  }, _t = (t) => t != null && t.startsWith("/") ? t != null && t.startsWith("/files") ? t : `/files${t}` : t != null && t.startsWith("files") ? `/${t}` : t != null && t.startsWith("files") ? `/${t}` : `/files/${t}`, bt = ({ path: t, size: n, apiURL: i }) => {
@@ -850,25 +851,25 @@ const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
850
851
  }, Mt = (t) => {
851
852
  const { apiURL: n, libraries: i } = k(A), c = (t == null ? void 0 : t.dayjs) || (i == null ? void 0 : i.dayjs);
852
853
  return {
853
- dateAdapter: (d, v) => {
854
+ dateAdapter: (v, d) => {
854
855
  if (!c)
855
856
  throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
856
- return pt({
857
- date: d,
858
- format: v,
857
+ return Rt({
858
+ date: v,
859
+ format: d,
859
860
  library: c
860
861
  });
861
862
  },
862
863
  distanceAdapter: wt,
863
- filePathAdapter: (d, v) => {
864
+ filePathAdapter: (v, d) => {
864
865
  if (!n)
865
866
  throw new Error(
866
867
  "API URL is not provided. You can provide it with InjectDependenciesProvider or directly in props to filePathAdapter."
867
868
  );
868
869
  return bt({
869
870
  apiURL: n,
870
- path: d,
871
- size: v
871
+ path: v,
872
+ size: d
872
873
  });
873
874
  }
874
875
  };
@@ -888,14 +889,14 @@ const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
888
889
  }
889
890
  }, n), {})) || {};
890
891
  }, Ut = (t) => (Array.isArray(t) ? t : [t]).reduce((i, c) => {
891
- const { output: a, operationsToGenerateInfiniteQueryHook: l, input: d = "./openapi.json" } = c || {}, v = jt(d);
892
+ const { output: a, operationsToGenerateInfiniteQueryHook: l, input: v = "./openapi.json" } = c || {}, d = jt(v);
892
893
  return {
893
894
  ...i,
894
- [v]: {
895
+ [d]: {
895
896
  hooks: {
896
897
  afterAllFilesWrite: "prettier src/api/ --write"
897
898
  },
898
- input: d,
899
+ input: v,
899
900
  output: {
900
901
  baseUrl: a == null ? void 0 : a.baseUrl,
901
902
  client: "react-query",
@@ -916,8 +917,8 @@ const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
916
917
  useQuery: !0
917
918
  }
918
919
  },
919
- schemas: (a == null ? void 0 : a.schemas) || `src/api/${v}/model`,
920
- target: (a == null ? void 0 : a.target) || `src/api/${v}/services/api.ts`,
920
+ schemas: (a == null ? void 0 : a.schemas) || `src/api/${d}/model`,
921
+ target: (a == null ? void 0 : a.target) || `src/api/${d}/services/api.ts`,
921
922
  ...a
922
923
  }
923
924
  }
@@ -935,7 +936,7 @@ export {
935
936
  Ft as MaskTextField,
936
937
  Wt as QueryClientProviderWithConfig,
937
938
  At as RequireAuth,
938
- pt as dateAdapter,
939
+ Rt as dateAdapter,
939
940
  wt as distanceAdapter,
940
941
  Ut as getOrvalConfig,
941
942
  Mt as useAdapter,
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 ue;function Ne(){if(ue)return B;ue=1;var t=h,n=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=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};function d(v,u,m){var R,_={},C=null,c=null;m!==void 0&&(C=""+m),u.key!==void 0&&(C=""+u.key),u.ref!==void 0&&(c=u.ref);for(R in u)s.call(u,R)&&!l.hasOwnProperty(R)&&(_[R]=u[R]);if(v&&v.defaultProps)for(R in u=v.defaultProps,u)_[R]===void 0&&(_[R]=u[R]);return{$$typeof:n,type:v,key:C,ref:c,props:_,_owner:a.current}}return B.Fragment=i,B.jsx=d,B.jsxs=d,B}var G={};/**
9
+ */var ue;function Ne(){if(ue)return B;ue=1;var t=h,n=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=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};function v(d,u,m){var R,_={},C=null,c=null;m!==void 0&&(C=""+m),u.key!==void 0&&(C=""+u.key),u.ref!==void 0&&(c=u.ref);for(R in u)s.call(u,R)&&!l.hasOwnProperty(R)&&(_[R]=u[R]);if(d&&d.defaultProps)for(R in u=d.defaultProps,u)_[R]===void 0&&(_[R]=u[R]);return{$$typeof:n,type:d,key:C,ref:c,props:_,_owner:a.current}}return B.Fragment=i,B.jsx=v,B.jsxs=v,B}var G={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,7 +14,7 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var le;function Le(){return le||(le=1,process.env.NODE_ENV!=="production"&&function(){var t=h,n=Symbol.for("react.element"),i=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),d=Symbol.for("react.provider"),v=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),c=Symbol.for("react.offscreen"),S=Symbol.iterator,I="@@iterator";function x(e){if(e===null||typeof e!="object")return null;var r=S&&e[S]||e[I];return typeof r=="function"?r:null}var k=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(e){{for(var r=arguments.length,o=new Array(r>1?r-1:0),f=1;f<r;f++)o[f-1]=arguments[f];N("error",e,o)}}function N(e,r,o){{var f=k.ReactDebugCurrentFrame,E=f.getStackAddendum();E!==""&&(r+="%s",o=o.concat([E]));var p=o.map(function(y){return String(y)});p.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,p)}}var L=!1,M=!1,j=!1,ve=!1,ge=!1,Q;Q=Symbol.for("react.module.reference");function lt(e){return!!(typeof e=="string"||typeof e=="function"||e===s||e===l||ge||e===a||e===m||e===R||ve||e===c||L||M||j||typeof e=="object"&&e!==null&&(e.$$typeof===C||e.$$typeof===_||e.$$typeof===d||e.$$typeof===v||e.$$typeof===u||e.$$typeof===Q||e.getModuleId!==void 0))}function ft(e,r,o){var f=e.displayName;if(f)return f;var E=r.displayName||r.name||"";return E!==""?o+"("+E+")":o}function ye(e){return e.displayName||"Context"}function Y(e){if(e==null)return null;if(typeof e.tag=="number"&&b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case s:return"Fragment";case i:return"Portal";case l:return"Profiler";case a:return"StrictMode";case m:return"Suspense";case R:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case v:var r=e;return ye(r)+".Consumer";case d:var o=e;return ye(o._context)+".Provider";case u:return ft(e,e.render,"ForwardRef");case _:var f=e.displayName||null;return f!==null?f:Y(e.type)||"Memo";case C:{var E=e,p=E._payload,y=E._init;try{return Y(y(p))}catch{return null}}}return null}var z=Object.assign,J=0,me,he,Ee,Re,pe,we,Ce;function _e(){}_e.__reactDisabledLog=!0;function dt(){{if(J===0){me=console.log,he=console.info,Ee=console.warn,Re=console.error,pe=console.group,we=console.groupCollapsed,Ce=console.groupEnd;var e={configurable:!0,enumerable:!0,value:_e,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}J++}}function vt(){{if(J--,J===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:z({},e,{value:me}),info:z({},e,{value:he}),warn:z({},e,{value:Ee}),error:z({},e,{value:Re}),group:z({},e,{value:pe}),groupCollapsed:z({},e,{value:we}),groupEnd:z({},e,{value:Ce})})}J<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var te=k.ReactCurrentDispatcher,re;function H(e,r,o){{if(re===void 0)try{throw Error()}catch(E){var f=E.stack.trim().match(/\n( *(at )?)/);re=f&&f[1]||""}return`
17
+ */var le;function Le(){return le||(le=1,process.env.NODE_ENV!=="production"&&function(){var t=h,n=Symbol.for("react.element"),i=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),v=Symbol.for("react.provider"),d=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),c=Symbol.for("react.offscreen"),S=Symbol.iterator,I="@@iterator";function x(e){if(e===null||typeof e!="object")return null;var r=S&&e[S]||e[I];return typeof r=="function"?r:null}var k=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(e){{for(var r=arguments.length,o=new Array(r>1?r-1:0),f=1;f<r;f++)o[f-1]=arguments[f];N("error",e,o)}}function N(e,r,o){{var f=k.ReactDebugCurrentFrame,E=f.getStackAddendum();E!==""&&(r+="%s",o=o.concat([E]));var p=o.map(function(y){return String(y)});p.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,p)}}var L=!1,M=!1,j=!1,ve=!1,ge=!1,Q;Q=Symbol.for("react.module.reference");function lt(e){return!!(typeof e=="string"||typeof e=="function"||e===s||e===l||ge||e===a||e===m||e===R||ve||e===c||L||M||j||typeof e=="object"&&e!==null&&(e.$$typeof===C||e.$$typeof===_||e.$$typeof===v||e.$$typeof===d||e.$$typeof===u||e.$$typeof===Q||e.getModuleId!==void 0))}function ft(e,r,o){var f=e.displayName;if(f)return f;var E=r.displayName||r.name||"";return E!==""?o+"("+E+")":o}function ye(e){return e.displayName||"Context"}function Y(e){if(e==null)return null;if(typeof e.tag=="number"&&b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case s:return"Fragment";case i:return"Portal";case l:return"Profiler";case a:return"StrictMode";case m:return"Suspense";case R:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case d:var r=e;return ye(r)+".Consumer";case v:var o=e;return ye(o._context)+".Provider";case u:return ft(e,e.render,"ForwardRef");case _:var f=e.displayName||null;return f!==null?f:Y(e.type)||"Memo";case C:{var E=e,p=E._payload,y=E._init;try{return Y(y(p))}catch{return null}}}return null}var z=Object.assign,J=0,me,he,Ee,Re,pe,we,Ce;function _e(){}_e.__reactDisabledLog=!0;function dt(){{if(J===0){me=console.log,he=console.info,Ee=console.warn,Re=console.error,pe=console.group,we=console.groupCollapsed,Ce=console.groupEnd;var e={configurable:!0,enumerable:!0,value:_e,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}J++}}function vt(){{if(J--,J===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:z({},e,{value:me}),info:z({},e,{value:he}),warn:z({},e,{value:Ee}),error:z({},e,{value:Re}),group:z({},e,{value:pe}),groupCollapsed:z({},e,{value:we}),groupEnd:z({},e,{value:Ce})})}J<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var te=k.ReactCurrentDispatcher,re;function H(e,r,o){{if(re===void 0)try{throw Error()}catch(E){var f=E.stack.trim().match(/\n( *(at )?)/);re=f&&f[1]||""}return`
18
18
  `+re+e}}var ne=!1,K;{var gt=typeof WeakMap=="function"?WeakMap:Map;K=new gt}function be(e,r){if(!e||ne)return"";{var o=K.get(e);if(o!==void 0)return o}var f;ne=!0;var E=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var p;p=te.current,te.current=null,dt();try{if(r){var y=function(){throw Error()};if(Object.defineProperty(y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(y,[])}catch(W){f=W}Reflect.construct(e,[],y)}else{try{y.call()}catch(W){f=W}e.call(y.prototype)}}else{try{throw Error()}catch(W){f=W}e()}}catch(W){if(W&&f&&typeof W.stack=="string"){for(var g=W.stack.split(`
19
19
  `),O=f.stack.split(`
20
20
  `),P=g.length-1,T=O.length-1;P>=1&&T>=0&&g[P]!==O[T];)T--;for(;P>=1&&T>=0;P--,T--)if(g[P]!==O[T]){if(P!==1||T!==1)do if(P--,T--,T<0||g[P]!==O[T]){var D=`
@@ -22,4 +22,4 @@
22
22
 
23
23
  Check the render method of \``+e+"`."}return""}}function xt(e){return""}var De={};function Ot(e){{var r=Ie();if(!r){var o=typeof e=="string"?e:e.displayName||e.name;o&&(r=`
24
24
 
25
- Check the top-level render call using <`+o+">.")}return r}}function ke(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var o=Ot(r);if(De[o])return;De[o]=!0;var f="";e&&e._owner&&e._owner!==ae.current&&(f=" It was passed a child from "+Y(e._owner.type)+"."),V(e),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',o,f),V(null)}}function Fe(e,r){{if(typeof e!="object")return;if(oe(e))for(var o=0;o<e.length;o++){var f=e[o];se(f)&&ke(f,r)}else if(se(e))e._store&&(e._store.validated=!0);else if(e){var E=x(e);if(typeof E=="function"&&E!==e.entries)for(var p=E.call(e),y;!(y=p.next()).done;)se(y.value)&&ke(y.value,r)}}}function At(e){{var r=e.type;if(r==null||typeof r=="string")return;var o;if(typeof r=="function")o=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===u||r.$$typeof===_))o=r.propTypes;else return;if(o){var f=Y(r);ht(o,e.props,"prop",f,e)}else if(r.PropTypes!==void 0&&!ce){ce=!0;var E=Y(r);b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",E||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function It(e){{for(var r=Object.keys(e.props),o=0;o<r.length;o++){var f=r[o];if(f!=="children"&&f!=="key"){V(e),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",f),V(null);break}}e.ref!==null&&(V(e),b("Invalid attribute `ref` supplied to `React.Fragment`."),V(null))}}function Ye(e,r,o,f,E,p){{var y=lt(e);if(!y){var g="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(g+=" 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 O=xt();O?g+=O:g+=Ie();var P;e===null?P="null":oe(e)?P="array":e!==void 0&&e.$$typeof===n?(P="<"+(Y(e.type)||"Unknown")+" />",g=" Did you accidentally export a JSX literal instead of a component?"):P=typeof e,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",P,g)}var T=St(e,r,o,E,p);if(T==null)return T;if(y){var D=r.children;if(D!==void 0)if(f)if(oe(D)){for(var U=0;U<D.length;U++)Fe(D[U],e);Object.freeze&&Object.freeze(D)}else b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Fe(D,e)}return e===s?It(T):At(T),T}}function Dt(e,r,o){return Ye(e,r,o,!0)}function kt(e,r,o){return Ye(e,r,o,!1)}var Ft=kt,Yt=Dt;G.Fragment=s,G.jsx=Ft,G.jsxs=Yt}()),G}process.env.NODE_ENV==="production"?ee.exports=Ne():ee.exports=Le();var F=ee.exports;const A=h.createContext({}),Me=({children:t,apiURL:n,libraries:i})=>{const s=h.useMemo(()=>({apiURL:n,libraries:i}),[n,i]);return F.jsx(A.Provider,{value:s,children:t})},ze=({Fallback:t,isLogged:n,loginPath:i="/login",localStorageKey:s="user",redirect401Path:a="/login",...l})=>{var b,N,L,M;const{libraries:d}=h.useContext(A),v=(l==null?void 0:l.reactRouter)||(d==null?void 0:d.reactRouter),u=(l==null?void 0:l.axios)||(d==null?void 0:d.axios);if(!v)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");const[m,R]=h.useState(null),{useLocation:_,Navigate:C,Outlet:c}=v,S=_(),I=h.useRef(!1),x=typeof n=="function"?n():!!n,k=typeof x=="boolean"?x:x==null?void 0:x.isLogged;return h.useEffect(()=>{I.current||(I.current=!0,u.interceptors.response.use(j=>j,async j=>{var Q;return typeof j=="object"&&j&&"response"in j&&j.response&&typeof j.response=="object"&&"status"in j.response&&j.response&&typeof j.response=="object"&&"status"in j.response&&((Q=j==null?void 0:j.response)==null?void 0:Q.status)===401&&(u.defaults.headers.common.Authorization=null,localStorage.removeItem(s),R(a)),Promise.reject(j)}))},[u.defaults.headers.common,u.interceptors.response,s,a]),k&&!m?F.jsx(h.Suspense,{fallback:t,children:(N=(b=S.state)==null?void 0:b.from)!=null&&N.state&&((M=(L=S.state)==null?void 0:L.from)==null?void 0:M.pathname)===i?F.jsx(C,{to:S.state.from.state.from.pathname+S.state.from.state.from.search,replace:!0}):F.jsx(c,{})}):F.jsx(C,{to:i,state:{from:S},replace:!0})},Ve=({...t})=>{const{libraries:n}=h.useContext(A),i=(t==null?void 0:t.reactRouter)||(n==null?void 0:n.reactRouter),s=(t==null?void 0:t.gtm)||(n==null?void 0:n.gtm);if(!i)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");if(!s)throw new Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");const{useGoogleTagManager:a}=s,{useLocation:l,Outlet:d}=i,{pathname:v}=l(),{sendEvent:u}=a();return h.useEffect(()=>{u({event:"pageView",pathname:v})},[v,u]),F.jsx(d,{})},Ue=({tokenTypeKey:t="tokenType",userLocalStorageKey:n="user",tokenKey:i="accessToken",postContentType:s="application/json",...a})=>{const{apiURL:l=a.apiURL,libraries:d}=h.useContext(A),v=(a==null?void 0:a.axios)||(d==null?void 0:d.axios);if(!v)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!(v!=null&&v.defaults))return null;const u=localStorage.getItem(n),m=u?JSON.parse(u):null,R=m!=null&&m[t]?m[t]:null,_=m!=null&&m[i]?m[i]:null,C=u?`${R} ${_}`:null;return v.defaults.baseURL=l,v.defaults.headers.post["Content-Type"]=s,C&&(v.defaults.headers.common.Authorization=C),null},Be=({debug:t,resources:n,...i})=>{const{libraries:s}=h.useContext(A),a=(i==null?void 0:i.i18)||(s==null?void 0:s.i18),{i18next:l,initReactI18next:d,languageDetector:v}=a||{};if(!a)throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return l!=null&&l.isInitialized||(l.use(v).use(d).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},Ge=({dsn:t,integrations:n,tracesSampleRate:i,replaysSessionSampleRate:s,replaysOnErrorSampleRate:a,tracePropagationTargets:l,ignoreErrors:d,debug:v,environment:u,...m})=>{const{libraries:R}=h.useContext(A),_=(m==null?void 0:m.sentry)||(R==null?void 0:R.sentry),C=(m==null?void 0:m.reactRouter)||(R==null?void 0:R.reactRouter);if(!_)throw new Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!C)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(_.isInitialized())return null;const{createRoutesFromChildren:c,matchRoutes:S,useLocation:I,useNavigationType:x}=C;return(v||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&_.init({debug:v,dsn:t,environment:u||"production",ignoreErrors:[...d||[],/dynamically imported module/],integrations:[_.reactRouterV6BrowserTracingIntegration({createRoutesFromChildren:c,matchRoutes:S,useEffect:h.useEffect,useLocation:I,useNavigationType:x}),...n||[]],replaysOnErrorSampleRate:a||1,replaysSessionSampleRate:s||.1,tracePropagationTargets:l,tracesSampleRate:i||1}),null},Qe=({IMaskMixin:t,...n})=>{const i=h.useMemo(()=>t(({TextField:s,...a})=>F.jsx(s,{...a})),[t]);return F.jsx(i,{...n})},Je=({accessToken:t,...n})=>{const{libraries:i}=h.useContext(A),s=(n==null?void 0:n.mapbox)||(i==null?void 0:i.mapbox);if(!s)throw new Error("Mapbox is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return t&&(s.accessToken=t),null},Xe=({language:t,...n})=>{const{libraries:i}=h.useContext(A),s=(n==null?void 0:n.dayjs)||(i==null?void 0:i.dayjs),a=(n==null?void 0:n.plugin)||(i==null?void 0:i.dayjsPlugin);if(!s)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;t||(d=navigator.language)!=null&&d.slice(0,2),a&&a.forEach(v=>{v&&s.extend(v)})})().then()},[s,a,t]),null},He=t=>t&&typeof t=="function",Ke=t=>t&&typeof t=="function",Ze=({children:t,defaultQueriesOptions:n,defaultMutationsOptions:i,...s})=>{var u,m;const{libraries:a}=h.useContext(A),l=(s==null?void 0:s.QueryClient)||((u=a==null?void 0:a.reactQuery)==null?void 0:u.QueryClient),d=(s==null?void 0:s.QueryClientProvider)||((m=a==null?void 0:a.reactQuery)==null?void 0:m.QueryClientProvider);if(!l)throw new Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!d)throw new Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!He(d))throw new Error("Provided QueryClientProvider dependencies are not valid.");if(!Ke(l))throw new Error("Provided QueryClient dependencies are not valid.");const v=new l({defaultOptions:{mutations:{...i},queries:{getNextPageParam:(R,_,C)=>R.length+(C||0),refetchOnWindowFocus:!1,retry:3,...n}}});return F.jsx(d,{client:v,children:t})},$e=t=>{var m,R,_;const{libraries:n}=h.useContext(A),i=(t==null?void 0:t.i18)||(n==null?void 0:n.i18),s=((m=t==null?void 0:t.i18)==null?void 0:m.translateFunction)||((R=n==null?void 0:n.i18)==null?void 0:R.translateFunction),a=((_=i==null?void 0:i.i18next)==null?void 0:_.t)||s||(C=>C),{unknownErrorTranslationKey:l="error.unknownError"}=t||{},d=a(l),v=h.useCallback(C=>{var S,I,x,k,b,N,L,M,j;const{response:c}=C||{};return c!=null&&c.reason?String(c.reason):(S=c==null?void 0:c.data)!=null&&S.reason?String(c.data.reason):(I=c==null?void 0:c.data)!=null&&I.message?String(c.data.message):(k=(x=c==null?void 0:c.data)==null?void 0:x.detail)!=null&&k.length&&Array.isArray((b=c==null?void 0:c.data)==null?void 0:b.detail)&&((L=(N=c==null?void 0:c.data)==null?void 0:N.detail[0])!=null&&L.msg)&&typeof((j=(M=c==null?void 0:c.data)==null?void 0:M.detail[0])==null?void 0:j.msg)=="string"?String(c.data.detail[0].msg):d},[d]);return{getErrorCode:h.useCallback(C=>{var S,I,x;const{response:c}=C||{};return c!=null&&c.error_code?String(c==null?void 0:c.error_code):(S=c==null?void 0:c.data)!=null&&S.error_code?String((I=c==null?void 0:c.data)==null?void 0:I.error_code):c!=null&&c.error_code?String(c==null?void 0:c.error_code):(x=c==null?void 0:c.data)!=null&&x.error_code?String(c.data.error_code):"unknown_error_code"},[]),printError:v}},qe=({data:t,fetchNextPage:n,isFetchingNextPage:i,isInitialLoading:s,isLoading:a,enabled:l=!0})=>{const d=h.useCallback(async u=>{i||!l||await n({pageParam:(u==null?void 0:u.pageParam)||u.visibleRowsCount})},[l,n,i]),v=h.useMemo(()=>{if(t)return t.pages.reduce((u,m)=>[...u,...m],[])},[t]);return{fetchNextPageOnRowsScrollEnd:d,isLoading:i||a,loadingVariant:s?"skeleton":"linear",rows:v}},et=t=>{const{libraries:n}=h.useContext(A),i=(t==null?void 0:t.axios)||(n==null?void 0:n.axios);if(!i)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");return{clearAuthenticationToken:()=>{i.defaults.headers.common.Authorization=null},setAuthenticationToken:({tokenType:l,accessToken:d})=>{i.defaults.headers.common.Authorization=`${l} ${d}`}}},fe=({library:t,date:n,format:i="ll"})=>t(n).format(i),de=(t,n="km")=>{const i=Number(t);return Number.isNaN(i)?`0 ${n}`:`${i.toFixed(2)} ${n}`},tt=t=>t!=null&&t.startsWith("/")?t!=null&&t.startsWith("/files")?t:`/files${t}`:t!=null&&t.startsWith("files")?`/${t}`:t!=null&&t.startsWith("files")?`/${t}`:`/files/${t}`,rt=({path:t,size:n,apiURL:i})=>{if(!t)return"";const s=tt(t),a=`${i}${s}`,l=a.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/)!==null;return typeof n=="number"&&l?`${a.replace("/files",`/thumbs/${n}`)}`:a},nt=t=>{const{apiURL:n,libraries:i}=h.useContext(A),s=(t==null?void 0:t.dayjs)||(i==null?void 0:i.dayjs);return{dateAdapter:(d,v)=>{if(!s)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return fe({date:d,format:v,library:s})},distanceAdapter:de,filePathAdapter:(d,v)=>{if(!n)throw new Error("API URL is not provided. You can provide it with InjectDependenciesProvider or directly in props to filePathAdapter.");return rt({apiURL:n,path:d,size:v})}}},ot=t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase(),it=t=>{const s=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("");return s.charAt(0).toLowerCase()+s.slice(1)},at=t=>(t.split("/").pop()||t).replace(/\.json$/,"").replace(/^openapi\./,""),ct=(t,n,i)=>{const s=it(n),a=ot(i);return`${s}${a}`},st=t=>{if(t)return(t==null?void 0:t.reduce((n,i)=>(n[i]={query:{useInfinite:!0,useInfiniteQueryParam:"offset",useQuery:!0}},n),{}))||{}},ut=t=>(Array.isArray(t)?t:[t]).reduce((i,s)=>{const{output:a,operationsToGenerateInfiniteQueryHook:l,input:d="./openapi.json"}=s||{},v=at(d);return{...i,[v]:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:d,output:{baseUrl:a==null?void 0:a.baseUrl,client:"react-query",mode:"tags-split",override:{...(l==null?void 0:l.length)&&{operations:st(l)},header:u=>["Generated by orval 🍺",...u.title?[u.title]:[],...u.description?[u.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/axiosCustomInstance.ts`},operationName:ct,query:{useQuery:!0}},schemas:(a==null?void 0:a.schemas)||`src/api/${v}/model`,target:(a==null?void 0:a.target)||`src/api/${v}/services/api.ts`,...a}}}},{});w.GTMSendPageView=Ve,w.InitializeAxiosConfig=Ue,w.InitializeDaysJSConfig=Xe,w.InitializeI18nConfig=Be,w.InitializeMapBoxConfig=Je,w.InitializeSentryConfig=Ge,w.InjectDependenciesContext=A,w.InjectDependenciesProvider=Me,w.MaskTextField=Qe,w.QueryClientProviderWithConfig=Ze,w.RequireAuth=ze,w.dateAdapter=fe,w.distanceAdapter=de,w.getOrvalConfig=ut,w.useAdapter=nt,w.useAuth=et,w.useInfiniteDataGrid=qe,w.useResponseError=$e,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
25
+ Check the top-level render call using <`+o+">.")}return r}}function ke(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var o=Ot(r);if(De[o])return;De[o]=!0;var f="";e&&e._owner&&e._owner!==ae.current&&(f=" It was passed a child from "+Y(e._owner.type)+"."),V(e),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',o,f),V(null)}}function Fe(e,r){{if(typeof e!="object")return;if(oe(e))for(var o=0;o<e.length;o++){var f=e[o];se(f)&&ke(f,r)}else if(se(e))e._store&&(e._store.validated=!0);else if(e){var E=x(e);if(typeof E=="function"&&E!==e.entries)for(var p=E.call(e),y;!(y=p.next()).done;)se(y.value)&&ke(y.value,r)}}}function At(e){{var r=e.type;if(r==null||typeof r=="string")return;var o;if(typeof r=="function")o=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===u||r.$$typeof===_))o=r.propTypes;else return;if(o){var f=Y(r);ht(o,e.props,"prop",f,e)}else if(r.PropTypes!==void 0&&!ce){ce=!0;var E=Y(r);b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",E||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function It(e){{for(var r=Object.keys(e.props),o=0;o<r.length;o++){var f=r[o];if(f!=="children"&&f!=="key"){V(e),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",f),V(null);break}}e.ref!==null&&(V(e),b("Invalid attribute `ref` supplied to `React.Fragment`."),V(null))}}function Ye(e,r,o,f,E,p){{var y=lt(e);if(!y){var g="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(g+=" 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 O=xt();O?g+=O:g+=Ie();var P;e===null?P="null":oe(e)?P="array":e!==void 0&&e.$$typeof===n?(P="<"+(Y(e.type)||"Unknown")+" />",g=" Did you accidentally export a JSX literal instead of a component?"):P=typeof e,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",P,g)}var T=St(e,r,o,E,p);if(T==null)return T;if(y){var D=r.children;if(D!==void 0)if(f)if(oe(D)){for(var U=0;U<D.length;U++)Fe(D[U],e);Object.freeze&&Object.freeze(D)}else b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Fe(D,e)}return e===s?It(T):At(T),T}}function Dt(e,r,o){return Ye(e,r,o,!0)}function kt(e,r,o){return Ye(e,r,o,!1)}var Ft=kt,Yt=Dt;G.Fragment=s,G.jsx=Ft,G.jsxs=Yt}()),G}process.env.NODE_ENV==="production"?ee.exports=Ne():ee.exports=Le();var F=ee.exports;const A=h.createContext({}),Me=({children:t,apiURL:n,libraries:i})=>{const s=h.useMemo(()=>({apiURL:n,libraries:i}),[n,i]);return F.jsx(A.Provider,{value:s,children:t})},ze=({Fallback:t,isLogged:n,loginPath:i="/login",localStorageKey:s="user",redirect401Path:a="/login",...l})=>{var b,N,L,M;const{libraries:v}=h.useContext(A),d=(l==null?void 0:l.reactRouter)||(v==null?void 0:v.reactRouter),u=(l==null?void 0:l.axios)||(v==null?void 0:v.axios);if(!d)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");const[m,R]=h.useState(null),{useLocation:_,Navigate:C,Outlet:c}=d,S=_(),I=h.useRef(!1),x=typeof n=="function"?n():!!n,k=typeof x=="boolean"?x:x==null?void 0:x.isLogged;return h.useEffect(()=>{I.current||(I.current=!0,u.interceptors.response.use(j=>j,async j=>{var Q;return typeof j=="object"&&j&&"response"in j&&j.response&&typeof j.response=="object"&&"status"in j.response&&j.response&&typeof j.response=="object"&&"status"in j.response&&((Q=j==null?void 0:j.response)==null?void 0:Q.status)===401&&(u.defaults.headers.common.Authorization=null,localStorage.removeItem(s),R(a)),Promise.reject(j)}))},[u.defaults.headers.common,u.interceptors.response,s,a]),k&&!m?F.jsx(h.Suspense,{fallback:t,children:(N=(b=S.state)==null?void 0:b.from)!=null&&N.state&&((M=(L=S.state)==null?void 0:L.from)==null?void 0:M.pathname)===i?F.jsx(C,{to:S.state.from.state.from.pathname+S.state.from.state.from.search,replace:!0}):F.jsx(c,{})}):F.jsx(C,{to:i,state:{from:S},replace:!0})},Ve=({...t})=>{const{libraries:n}=h.useContext(A),i=(t==null?void 0:t.reactRouter)||(n==null?void 0:n.reactRouter),s=(t==null?void 0:t.gtm)||(n==null?void 0:n.gtm);if(!i)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");if(!s)throw new Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");const{useGoogleTagManager:a}=s,{useLocation:l,Outlet:v}=i,{pathname:d}=l(),{sendEvent:u}=a();return h.useEffect(()=>{u({event:"pageView",pathname:d})},[d,u]),F.jsx(v,{})},Ue=({tokenTypeKey:t="tokenType",userLocalStorageKey:n="user",tokenKey:i="accessToken",postContentType:s="application/json",...a})=>{const{apiURL:l=a.apiURL,libraries:v}=h.useContext(A),d=(a==null?void 0:a.axios)||(v==null?void 0:v.axios);if(!d)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!(d!=null&&d.defaults))return null;const u=localStorage.getItem(n),m=u?JSON.parse(u):null,R=m!=null&&m[t]?m[t]:null,_=m!=null&&m[i]?m[i]:null,C=u?`${R} ${_}`:null;return d.defaults.baseURL=l,d.defaults.headers.post["Content-Type"]=s,C&&(d.defaults.headers.common.Authorization=C),null},Be=({debug:t,resources:n,...i})=>{const{libraries:s}=h.useContext(A),a=(i==null?void 0:i.i18)||(s==null?void 0:s.i18),{i18next:l,initReactI18next:v,languageDetector:d}=a||{};if(!a)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(v).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},Ge=({dsn:t,integrations:n,tracesSampleRate:i,replaysSessionSampleRate:s,replaysOnErrorSampleRate:a,tracePropagationTargets:l,ignoreErrors:v,debug:d,environment:u,...m})=>{const{libraries:R}=h.useContext(A),_=(m==null?void 0:m.sentry)||(R==null?void 0:R.sentry),C=(m==null?void 0:m.reactRouter)||(R==null?void 0:R.reactRouter);if(!_)throw new Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!C)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(_.isInitialized())return null;const{createRoutesFromChildren:c,matchRoutes:S,useLocation:I,useNavigationType:x}=C;return(d||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&_.init({debug:d,dsn:t,environment:u||"production",ignoreErrors:[...v||[],/dynamically imported module/],integrations:[_.reactRouterV6BrowserTracingIntegration({createRoutesFromChildren:c,matchRoutes:S,useEffect:h.useEffect,useLocation:I,useNavigationType:x}),...n||[]],replaysOnErrorSampleRate:a||1,replaysSessionSampleRate:s||.1,tracePropagationTargets:l,tracesSampleRate:i||1}),null},Qe=({IMaskMixin:t,...n})=>{const i=h.useMemo(()=>t(({TextField:s,...a})=>F.jsx(s,{...a})),[t]);return F.jsx(i,{...n})},Je=({accessToken:t,...n})=>{const{libraries:i}=h.useContext(A),s=(n==null?void 0:n.mapbox)||(i==null?void 0:i.mapbox);if(!s)throw new Error("Mapbox is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return t&&(s.accessToken=t),null},Xe=({language:t,...n})=>{const{libraries:i}=h.useContext(A),s=(n==null?void 0:n.dayjs)||(i==null?void 0:i.dayjs),a=(n==null?void 0:n.plugin)||(i==null?void 0:i.dayjsPlugin);if(!s)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 v=t||((d=navigator.language)==null?void 0:d.slice(0,2))||"en";import("dayjs/locale/en"),import("dayjs/locale/fr"),s.locale(v),a&&a.forEach(u=>{u&&s.extend(u)})})().then()},[s,a,t]),null},He=t=>t&&typeof t=="function",Ke=t=>t&&typeof t=="function",Ze=({children:t,defaultQueriesOptions:n,defaultMutationsOptions:i,...s})=>{var u,m;const{libraries:a}=h.useContext(A),l=(s==null?void 0:s.QueryClient)||((u=a==null?void 0:a.reactQuery)==null?void 0:u.QueryClient),v=(s==null?void 0:s.QueryClientProvider)||((m=a==null?void 0:a.reactQuery)==null?void 0:m.QueryClientProvider);if(!l)throw new Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!v)throw new Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!He(v))throw new Error("Provided QueryClientProvider dependencies are not valid.");if(!Ke(l))throw new Error("Provided QueryClient dependencies are not valid.");const d=new l({defaultOptions:{mutations:{...i},queries:{getNextPageParam:(R,_,C)=>R.length+(C||0),refetchOnWindowFocus:!1,retry:3,...n}}});return F.jsx(v,{client:d,children:t})},$e=t=>{var m,R,_;const{libraries:n}=h.useContext(A),i=(t==null?void 0:t.i18)||(n==null?void 0:n.i18),s=((m=t==null?void 0:t.i18)==null?void 0:m.translateFunction)||((R=n==null?void 0:n.i18)==null?void 0:R.translateFunction),a=((_=i==null?void 0:i.i18next)==null?void 0:_.t)||s||(C=>C),{unknownErrorTranslationKey:l="error.unknownError"}=t||{},v=a(l),d=h.useCallback(C=>{var S,I,x,k,b,N,L,M,j;const{response:c}=C||{};return c!=null&&c.reason?String(c.reason):(S=c==null?void 0:c.data)!=null&&S.reason?String(c.data.reason):(I=c==null?void 0:c.data)!=null&&I.message?String(c.data.message):(k=(x=c==null?void 0:c.data)==null?void 0:x.detail)!=null&&k.length&&Array.isArray((b=c==null?void 0:c.data)==null?void 0:b.detail)&&((L=(N=c==null?void 0:c.data)==null?void 0:N.detail[0])!=null&&L.msg)&&typeof((j=(M=c==null?void 0:c.data)==null?void 0:M.detail[0])==null?void 0:j.msg)=="string"?String(c.data.detail[0].msg):v},[v]);return{getErrorCode:h.useCallback(C=>{var S,I,x;const{response:c}=C||{};return c!=null&&c.error_code?String(c==null?void 0:c.error_code):(S=c==null?void 0:c.data)!=null&&S.error_code?String((I=c==null?void 0:c.data)==null?void 0:I.error_code):c!=null&&c.error_code?String(c==null?void 0:c.error_code):(x=c==null?void 0:c.data)!=null&&x.error_code?String(c.data.error_code):"unknown_error_code"},[]),printError:d}},qe=({data:t,fetchNextPage:n,isFetchingNextPage:i,isInitialLoading:s,isLoading:a,enabled:l=!0})=>{const v=h.useCallback(async u=>{i||!l||await n({pageParam:(u==null?void 0:u.pageParam)||u.visibleRowsCount})},[l,n,i]),d=h.useMemo(()=>{if(t)return t.pages.reduce((u,m)=>[...u,...m],[])},[t]);return{fetchNextPageOnRowsScrollEnd:v,isLoading:i||a,loadingVariant:s?"skeleton":"linear",rows:d}},et=t=>{const{libraries:n}=h.useContext(A),i=(t==null?void 0:t.axios)||(n==null?void 0:n.axios);if(!i)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");return{clearAuthenticationToken:()=>{i.defaults.headers.common.Authorization=null},setAuthenticationToken:({tokenType:l,accessToken:v})=>{i.defaults.headers.common.Authorization=`${l} ${v}`}}},fe=({library:t,date:n,format:i="ll"})=>t(n).format(i),de=(t,n="km")=>{const i=Number(t);return Number.isNaN(i)?`0 ${n}`:`${i.toFixed(2)} ${n}`},tt=t=>t!=null&&t.startsWith("/")?t!=null&&t.startsWith("/files")?t:`/files${t}`:t!=null&&t.startsWith("files")?`/${t}`:t!=null&&t.startsWith("files")?`/${t}`:`/files/${t}`,rt=({path:t,size:n,apiURL:i})=>{if(!t)return"";const s=tt(t),a=`${i}${s}`,l=a.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/)!==null;return typeof n=="number"&&l?`${a.replace("/files",`/thumbs/${n}`)}`:a},nt=t=>{const{apiURL:n,libraries:i}=h.useContext(A),s=(t==null?void 0:t.dayjs)||(i==null?void 0:i.dayjs);return{dateAdapter:(v,d)=>{if(!s)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return fe({date:v,format:d,library:s})},distanceAdapter:de,filePathAdapter:(v,d)=>{if(!n)throw new Error("API URL is not provided. You can provide it with InjectDependenciesProvider or directly in props to filePathAdapter.");return rt({apiURL:n,path:v,size:d})}}},ot=t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase(),it=t=>{const s=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("");return s.charAt(0).toLowerCase()+s.slice(1)},at=t=>(t.split("/").pop()||t).replace(/\.json$/,"").replace(/^openapi\./,""),ct=(t,n,i)=>{const s=it(n),a=ot(i);return`${s}${a}`},st=t=>{if(t)return(t==null?void 0:t.reduce((n,i)=>(n[i]={query:{useInfinite:!0,useInfiniteQueryParam:"offset",useQuery:!0}},n),{}))||{}},ut=t=>(Array.isArray(t)?t:[t]).reduce((i,s)=>{const{output:a,operationsToGenerateInfiniteQueryHook:l,input:v="./openapi.json"}=s||{},d=at(v);return{...i,[d]:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:v,output:{baseUrl:a==null?void 0:a.baseUrl,client:"react-query",mode:"tags-split",override:{...(l==null?void 0:l.length)&&{operations:st(l)},header:u=>["Generated by orval 🍺",...u.title?[u.title]:[],...u.description?[u.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/axiosCustomInstance.ts`},operationName:ct,query:{useQuery:!0}},schemas:(a==null?void 0:a.schemas)||`src/api/${d}/model`,target:(a==null?void 0:a.target)||`src/api/${d}/services/api.ts`,...a}}}},{});w.GTMSendPageView=Ve,w.InitializeAxiosConfig=Ue,w.InitializeDaysJSConfig=Xe,w.InitializeI18nConfig=Be,w.InitializeMapBoxConfig=Je,w.InitializeSentryConfig=Ge,w.InjectDependenciesContext=A,w.InjectDependenciesProvider=Me,w.MaskTextField=Qe,w.QueryClientProviderWithConfig=Ze,w.RequireAuth=ze,w.dateAdapter=fe,w.distanceAdapter=de,w.getOrvalConfig=ut,w.useAdapter=nt,w.useAuth=et,w.useInfiniteDataGrid=qe,w.useResponseError=$e,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tracktor/shared-module",
3
- "version": "2.1.6",
3
+ "version": "2.1.8",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "types": "./dist/main.d.ts",