@tracktor/shared-module 1.0.0-beta.0 → 1.0.0-beta.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,5 +1,4 @@
1
1
  # [Versions](https://github.com/Tracktor/shared-module/releases)
2
2
 
3
- ## v1.0.0-beta.0
4
- - **[feat]** : add date adapter
5
- - **[refactor]** : all dependencies are now peer dependencies
3
+ ## v1.0.0-beta.1
4
+ - **[fix]** : remove useless props `QueryClient` in`QueryClientConfigProvider`
@@ -1,22 +1,5 @@
1
1
  import { PropsWithChildren } from "react";
2
- interface QueryClientConfigProviderProps<T> extends PropsWithChildren {
3
- /**
4
- * QueryClient instance
5
- */
6
- QueryClient: {
7
- new (config: {
8
- defaultOptions: {
9
- queries: {
10
- refetchOnWindowFocus: boolean;
11
- retry: number;
12
- getNextPageParam: (lastPage: [], allPages: [], lastPageParam: number) => number;
13
- };
14
- mutations: {
15
- [key: string]: any;
16
- };
17
- };
18
- }): T;
19
- };
2
+ interface QueryClientConfigProviderProps extends PropsWithChildren {
20
3
  /**
21
4
  * Default options for queries
22
5
  */
@@ -32,8 +15,7 @@ interface QueryClientConfigProviderProps<T> extends PropsWithChildren {
32
15
  * @param children
33
16
  * @param defaultQueriesOptions
34
17
  * @param defaultMutationsOptions
35
- * @param QueryClient
36
18
  * @constructor
37
19
  */
38
- declare const QueryClientConfigProvider: <T extends unknown>({ children, defaultQueriesOptions, defaultMutationsOptions, QueryClient, }: QueryClientConfigProviderProps<T>) => import("react/jsx-runtime").JSX.Element;
20
+ declare const QueryClientConfigProvider: ({ children, defaultQueriesOptions, defaultMutationsOptions }: QueryClientConfigProviderProps) => import("react/jsx-runtime").JSX.Element;
39
21
  export default QueryClientConfigProvider;
package/dist/main.js CHANGED
@@ -7,8 +7,8 @@ import Pr from "i18next-browser-languagedetector";
7
7
  import { initReactI18next as Ar } from "react-i18next";
8
8
  import * as re from "@sentry/react";
9
9
  import $e from "mapbox-gl";
10
- import { QueryClientProvider as kr } from "@tanstack/react-query";
11
- import $r from "dayjs";
10
+ import { QueryClient as kr, QueryClientProvider as $r } from "@tanstack/react-query";
11
+ import Dr from "dayjs";
12
12
  var ne = { exports: {} }, Y = {};
13
13
  /**
14
14
  * @license React
@@ -20,16 +20,16 @@ var ne = { exports: {} }, Y = {};
20
20
  * LICENSE file in the root directory of this source tree.
21
21
  */
22
22
  var De;
23
- function Dr() {
23
+ function Fr() {
24
24
  return De || (De = 1, process.env.NODE_ENV !== "production" && function() {
25
- var a = Ne, n = Symbol.for("react.element"), i = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), E = Symbol.for("react.profiler"), o = Symbol.for("react.provider"), c = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), R = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), _ = Symbol.for("react.memo"), S = Symbol.for("react.lazy"), O = Symbol.for("react.offscreen"), h = Symbol.iterator, N = "@@iterator";
25
+ var o = Ne, n = Symbol.for("react.element"), i = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), b = Symbol.for("react.profiler"), a = Symbol.for("react.provider"), f = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), R = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), _ = Symbol.for("react.memo"), S = Symbol.for("react.lazy"), O = Symbol.for("react.offscreen"), h = Symbol.iterator, N = "@@iterator";
26
26
  function ue(e) {
27
27
  if (e === null || typeof e != "object")
28
28
  return null;
29
29
  var r = h && e[h] || e[N];
30
30
  return typeof r == "function" ? r : null;
31
31
  }
32
- var x = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
32
+ var x = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
33
33
  function C(e) {
34
34
  {
35
35
  for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), u = 1; u < r; u++)
@@ -50,7 +50,7 @@ function Dr() {
50
50
  var Ve = !1, Ue = !1, qe = !1, ze = !1, Be = !1, se;
51
51
  se = Symbol.for("react.module.reference");
52
52
  function Ge(e) {
53
- return !!(typeof e == "string" || typeof e == "function" || e === s || e === E || Be || e === m || e === R || e === g || ze || e === O || Ve || Ue || qe || typeof e == "object" && e !== null && (e.$$typeof === S || e.$$typeof === _ || e.$$typeof === o || e.$$typeof === c || e.$$typeof === l || // This needs to include all possible module reference object
53
+ return !!(typeof e == "string" || typeof e == "function" || e === s || e === b || Be || e === m || e === R || e === g || ze || e === O || Ve || Ue || qe || typeof e == "object" && e !== null && (e.$$typeof === S || e.$$typeof === _ || e.$$typeof === a || e.$$typeof === f || e.$$typeof === l || // This needs to include all possible module reference object
54
54
  // types supported by any Flight configuration anywhere since
55
55
  // we don't know which Flight build this will end up being used
56
56
  // with.
@@ -78,7 +78,7 @@ function Dr() {
78
78
  return "Fragment";
79
79
  case i:
80
80
  return "Portal";
81
- case E:
81
+ case b:
82
82
  return "Profiler";
83
83
  case m:
84
84
  return "StrictMode";
@@ -89,10 +89,10 @@ function Dr() {
89
89
  }
90
90
  if (typeof e == "object")
91
91
  switch (e.$$typeof) {
92
- case c:
92
+ case f:
93
93
  var r = e;
94
94
  return le(r) + ".Consumer";
95
- case o:
95
+ case a:
96
96
  var t = e;
97
97
  return le(t._context) + ".Provider";
98
98
  case l:
@@ -240,20 +240,20 @@ function Dr() {
240
240
  }
241
241
  } catch (P) {
242
242
  if (P && u && typeof P.stack == "string") {
243
- for (var f = P.stack.split(`
243
+ for (var c = P.stack.split(`
244
244
  `), T = u.stack.split(`
245
- `), y = f.length - 1, b = T.length - 1; y >= 1 && b >= 0 && f[y] !== T[b]; )
246
- b--;
247
- for (; y >= 1 && b >= 0; y--, b--)
248
- if (f[y] !== T[b]) {
249
- if (y !== 1 || b !== 1)
245
+ `), y = c.length - 1, E = T.length - 1; y >= 1 && E >= 0 && c[y] !== T[E]; )
246
+ E--;
247
+ for (; y >= 1 && E >= 0; y--, E--)
248
+ if (c[y] !== T[E]) {
249
+ if (y !== 1 || E !== 1)
250
250
  do
251
- if (y--, b--, b < 0 || f[y] !== T[b]) {
251
+ if (y--, E--, E < 0 || c[y] !== T[E]) {
252
252
  var w = `
253
- ` + f[y].replace(" at new ", " at ");
253
+ ` + c[y].replace(" at new ", " at ");
254
254
  return e.displayName && w.includes("<anonymous>") && (w = w.replace("<anonymous>", e.displayName)), typeof e == "function" && U.set(e, w), w;
255
255
  }
256
- while (y >= 1 && b >= 0);
256
+ while (y >= 1 && E >= 0);
257
257
  break;
258
258
  }
259
259
  }
@@ -312,17 +312,17 @@ function Dr() {
312
312
  var p = Function.call.bind(z);
313
313
  for (var d in e)
314
314
  if (p(e, d)) {
315
- var f = void 0;
315
+ var c = void 0;
316
316
  try {
317
317
  if (typeof e[d] != "function") {
318
318
  var T = Error((u || "React class") + ": " + t + " type `" + d + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[d] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
319
319
  throw T.name = "Invariant Violation", T;
320
320
  }
321
- f = e[d](r, d, u, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
321
+ c = e[d](r, d, u, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
322
322
  } catch (y) {
323
- f = y;
323
+ c = y;
324
324
  }
325
- f && !(f instanceof Error) && (B(v), C("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", u || "React class", t, d, typeof f), B(null)), f instanceof Error && !(f.message in Ee) && (Ee[f.message] = !0, B(v), C("Failed %s type: %s", t, f.message), B(null));
325
+ c && !(c instanceof Error) && (B(v), C("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", u || "React class", t, d, typeof c), B(null)), c instanceof Error && !(c.message in Ee) && (Ee[c.message] = !0, B(v), C("Failed %s type: %s", t, c.message), B(null));
326
326
  }
327
327
  }
328
328
  }
@@ -402,7 +402,7 @@ function Dr() {
402
402
  }
403
403
  }
404
404
  var cr = function(e, r, t, u, v, p, d) {
405
- var f = {
405
+ var c = {
406
406
  // This tag allows us to uniquely identify this as a React Element
407
407
  $$typeof: n,
408
408
  // Built-in properties that belong on the element
@@ -413,27 +413,27 @@ function Dr() {
413
413
  // Record the component responsible for creating this element.
414
414
  _owner: p
415
415
  };
416
- return f._store = {}, Object.defineProperty(f._store, "validated", {
416
+ return c._store = {}, Object.defineProperty(c._store, "validated", {
417
417
  configurable: !1,
418
418
  enumerable: !1,
419
419
  writable: !0,
420
420
  value: !1
421
- }), Object.defineProperty(f, "_self", {
421
+ }), Object.defineProperty(c, "_self", {
422
422
  configurable: !1,
423
423
  enumerable: !1,
424
424
  writable: !1,
425
425
  value: u
426
- }), Object.defineProperty(f, "_source", {
426
+ }), Object.defineProperty(c, "_source", {
427
427
  configurable: !1,
428
428
  enumerable: !1,
429
429
  writable: !1,
430
430
  value: v
431
- }), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
431
+ }), Object.freeze && (Object.freeze(c.props), Object.freeze(c)), c;
432
432
  };
433
433
  function fr(e, r, t, u, v) {
434
434
  {
435
- var p, d = {}, f = null, T = null;
436
- t !== void 0 && (_e(t), f = "" + t), ir(r) && (_e(r.key), f = "" + r.key), or(r) && (T = r.ref, ur(r, v));
435
+ var p, d = {}, c = null, T = null;
436
+ t !== void 0 && (_e(t), c = "" + t), ir(r) && (_e(r.key), c = "" + r.key), or(r) && (T = r.ref, ur(r, v));
437
437
  for (p in r)
438
438
  z.call(r, p) && !ar.hasOwnProperty(p) && (d[p] = r[p]);
439
439
  if (e && e.defaultProps) {
@@ -441,11 +441,11 @@ function Dr() {
441
441
  for (p in y)
442
442
  d[p] === void 0 && (d[p] = y[p]);
443
443
  }
444
- if (f || T) {
445
- var b = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
446
- f && sr(d, b), T && lr(d, b);
444
+ if (c || T) {
445
+ var E = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
446
+ c && sr(d, E), T && lr(d, E);
447
447
  }
448
- return cr(e, f, T, v, u, W.current, d);
448
+ return cr(e, c, T, v, u, W.current, d);
449
449
  }
450
450
  }
451
451
  var Z = x.ReactCurrentOwner, Se = x.ReactDebugCurrentFrame;
@@ -570,16 +570,16 @@ Check the top-level render call using <` + t + ">.");
570
570
  {
571
571
  var d = Ge(e);
572
572
  if (!d) {
573
- var f = "";
574
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (f += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
573
+ var c = "";
574
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (c += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
575
575
  var T = dr(v);
576
- T ? f += T : f += we();
576
+ T ? c += T : c += we();
577
577
  var y;
578
- e === null ? y = "null" : H(e) ? y = "array" : e !== void 0 && e.$$typeof === n ? (y = "<" + (j(e.type) || "Unknown") + " />", f = " Did you accidentally export a JSX literal instead of a component?") : y = typeof e, C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", y, f);
578
+ e === null ? y = "null" : H(e) ? y = "array" : e !== void 0 && e.$$typeof === n ? (y = "<" + (j(e.type) || "Unknown") + " />", c = " Did you accidentally export a JSX literal instead of a component?") : y = typeof e, C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", y, c);
579
579
  }
580
- var b = fr(e, r, t, v, p);
581
- if (b == null)
582
- return b;
580
+ var E = fr(e, r, t, v, p);
581
+ if (E == null)
582
+ return E;
583
583
  if (d) {
584
584
  var w = r.children;
585
585
  if (w !== void 0)
@@ -593,7 +593,7 @@ Check the top-level render call using <` + t + ">.");
593
593
  else
594
594
  je(w, e);
595
595
  }
596
- return e === s ? mr(b) : pr(b), b;
596
+ return e === s ? mr(E) : pr(E), E;
597
597
  }
598
598
  }
599
599
  function gr(e, r, t) {
@@ -617,76 +617,76 @@ var M = {};
617
617
  * LICENSE file in the root directory of this source tree.
618
618
  */
619
619
  var Fe;
620
- function Fr() {
620
+ function Ir() {
621
621
  if (Fe)
622
622
  return M;
623
623
  Fe = 1;
624
- var a = Ne, n = Symbol.for("react.element"), i = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, m = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, E = { key: !0, ref: !0, __self: !0, __source: !0 };
625
- function o(c, l, R) {
624
+ var o = Ne, n = Symbol.for("react.element"), i = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, m = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, b = { key: !0, ref: !0, __self: !0, __source: !0 };
625
+ function a(f, l, R) {
626
626
  var g, _ = {}, S = null, O = null;
627
627
  R !== void 0 && (S = "" + R), l.key !== void 0 && (S = "" + l.key), l.ref !== void 0 && (O = l.ref);
628
628
  for (g in l)
629
- s.call(l, g) && !E.hasOwnProperty(g) && (_[g] = l[g]);
630
- if (c && c.defaultProps)
631
- for (g in l = c.defaultProps, l)
629
+ s.call(l, g) && !b.hasOwnProperty(g) && (_[g] = l[g]);
630
+ if (f && f.defaultProps)
631
+ for (g in l = f.defaultProps, l)
632
632
  _[g] === void 0 && (_[g] = l[g]);
633
- return { $$typeof: n, type: c, key: S, ref: O, props: _, _owner: m.current };
633
+ return { $$typeof: n, type: f, key: S, ref: O, props: _, _owner: m.current };
634
634
  }
635
- return M.Fragment = i, M.jsx = o, M.jsxs = o, M;
635
+ return M.Fragment = i, M.jsx = a, M.jsxs = a, M;
636
636
  }
637
- process.env.NODE_ENV === "production" ? ne.exports = Fr() : ne.exports = Dr();
637
+ process.env.NODE_ENV === "production" ? ne.exports = Ir() : ne.exports = Fr();
638
638
  var A = ne.exports;
639
- const Qr = ({
640
- Fallback: a,
639
+ const et = ({
640
+ Fallback: o,
641
641
  loginPath: n = "/login",
642
642
  localStorageKey: i = "user",
643
643
  redirect401Path: s = "/login",
644
644
  isLogged: m
645
645
  }) => {
646
646
  var R, g, _, S;
647
- const [E, o] = br(null), c = oe(), l = Rr(!1);
647
+ const [b, a] = br(null), f = oe(), l = Rr(!1);
648
648
  return _r(() => {
649
649
  var O;
650
650
  l.current || (l.current = !0, (O = k) == null || O.interceptors.response.use(
651
651
  (h) => h,
652
652
  async (h) => {
653
653
  var x;
654
- return typeof h == "object" && h && "response" in h && h.response && typeof h.response == "object" && "status" in h.response && h.response && typeof h.response == "object" && "status" in h.response && ((x = h == null ? void 0 : h.response) == null ? void 0 : x.status) === 401 && (k.defaults.headers.common.Authorization = null, localStorage.removeItem(i), o(s)), Promise.reject(h);
654
+ return typeof h == "object" && h && "response" in h && h.response && typeof h.response == "object" && "status" in h.response && h.response && typeof h.response == "object" && "status" in h.response && ((x = h == null ? void 0 : h.response) == null ? void 0 : x.status) === 401 && (k.defaults.headers.common.Authorization = null, localStorage.removeItem(i), a(s)), Promise.reject(h);
655
655
  }
656
656
  ));
657
- }, [i, s]), m && !E ? /* @__PURE__ */ A.jsx(Cr, { fallback: a, children: (g = (R = c.state) == null ? void 0 : R.from) != null && g.state && ((S = (_ = c.state) == null ? void 0 : _.from) == null ? void 0 : S.pathname) === n ? /* @__PURE__ */ A.jsx(ke, { to: c.state.from.state.from.pathname + c.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ A.jsx(Ye, {}) }) : /* @__PURE__ */ A.jsx(ke, { to: n, state: { from: c }, replace: !0 });
658
- }, et = () => {
659
- const { pathname: a } = oe(), { sendEvent: n } = xr();
657
+ }, [i, s]), m && !b ? /* @__PURE__ */ A.jsx(Cr, { fallback: o, children: (g = (R = f.state) == null ? void 0 : R.from) != null && g.state && ((S = (_ = f.state) == null ? void 0 : _.from) == null ? void 0 : S.pathname) === n ? /* @__PURE__ */ A.jsx(ke, { to: f.state.from.state.from.pathname + f.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ A.jsx(Ye, {}) }) : /* @__PURE__ */ A.jsx(ke, { to: n, state: { from: f }, replace: !0 });
658
+ }, rt = () => {
659
+ const { pathname: o } = oe(), { sendEvent: n } = xr();
660
660
  return Le(() => {
661
- n({ event: "pageView", pathname: a });
662
- }, [a, n]), /* @__PURE__ */ A.jsx(Ye, {});
661
+ n({ event: "pageView", pathname: o });
662
+ }, [o, n]), /* @__PURE__ */ A.jsx(Ye, {});
663
663
  }, ie = Tr({
664
664
  apiURL: void 0,
665
665
  children: void 0
666
- }), rt = ({ children: a, apiURL: n }) => {
666
+ }), tt = ({ children: o, apiURL: n }) => {
667
667
  const i = ae(
668
668
  () => ({
669
669
  apiURL: n
670
670
  }),
671
671
  [n]
672
672
  );
673
- return /* @__PURE__ */ A.jsx(ie.Provider, { value: i, children: a });
674
- }, tt = ({
675
- tokenTypeKey: a = "tokenType",
673
+ return /* @__PURE__ */ A.jsx(ie.Provider, { value: i, children: o });
674
+ }, nt = ({
675
+ tokenTypeKey: o = "tokenType",
676
676
  userLocalStorageKey: n = "user",
677
677
  tokenKey: i = "accessToken",
678
678
  postContentType: s = "application/json",
679
679
  ...m
680
680
  }) => {
681
- const { apiURL: E = m.baseURL } = We(ie);
681
+ const { apiURL: b = m.baseURL } = We(ie);
682
682
  if (!k.defaults)
683
683
  return null;
684
- const o = localStorage.getItem(n), c = o ? JSON.parse(o) : null, l = c != null && c[a] ? c[a] : null, R = c != null && c[i] ? c[i] : null, g = o ? `${l} ${R}` : null;
685
- return k.defaults.baseURL = E, k.defaults.headers.post["Content-Type"] = s, g && (k.defaults.headers.common.Authorization = g), null;
686
- }, nt = ({ debug: a, resources: n }) => {
684
+ const a = localStorage.getItem(n), f = a ? JSON.parse(a) : null, l = f != null && f[o] ? f[o] : null, R = f != null && f[i] ? f[i] : null, g = a ? `${l} ${R}` : null;
685
+ return k.defaults.baseURL = b, k.defaults.headers.post["Content-Type"] = s, g && (k.defaults.headers.common.Authorization = g), null;
686
+ }, at = ({ debug: o, resources: n }) => {
687
687
  var i;
688
688
  return (i = I) != null && i.isInitialized || (I.use(Pr).use(Ar).init({
689
- debug: a,
689
+ debug: o,
690
690
  fallbackLng: "en",
691
691
  interpolation: {
692
692
  escapeValue: !1
@@ -703,21 +703,21 @@ const Qr = ({
703
703
  }), I.on("languageChanged", (s) => {
704
704
  document.documentElement.setAttribute("lang", s);
705
705
  })), null;
706
- }, at = ({
707
- dsn: a,
706
+ }, ot = ({
707
+ dsn: o,
708
708
  integrations: n,
709
709
  tracesSampleRate: i,
710
710
  replaysSessionSampleRate: s,
711
711
  replaysOnErrorSampleRate: m,
712
- tracePropagationTargets: E,
713
- ignoreErrors: o,
714
- debug: c,
712
+ tracePropagationTargets: b,
713
+ ignoreErrors: a,
714
+ debug: f,
715
715
  environment: l
716
- }) => (re.isInitialized() || (c || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") && re.init({
717
- debug: c,
718
- dsn: a,
716
+ }) => (re.isInitialized() || (f || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") && re.init({
717
+ debug: f,
718
+ dsn: o,
719
719
  environment: l || "production",
720
- ignoreErrors: [...o || [], /dynamically imported module/],
720
+ ignoreErrors: [...a || [], /dynamically imported module/],
721
721
  integrations: [
722
722
  re.reactRouterV6BrowserTracingIntegration({
723
723
  createRoutesFromChildren: Sr,
@@ -730,120 +730,115 @@ const Qr = ({
730
730
  ],
731
731
  replaysOnErrorSampleRate: m || 1,
732
732
  replaysSessionSampleRate: s || 0.1,
733
- tracePropagationTargets: E,
733
+ tracePropagationTargets: b,
734
734
  tracesSampleRate: i || 1
735
- }), null), ot = ({ IMaskMixin: a, ...n }) => {
735
+ }), null), it = ({ IMaskMixin: o, ...n }) => {
736
736
  const i = ae(
737
737
  // eslint-disable-next-line react/jsx-props-no-spreading
738
- () => a(({ TextField: s, ...m }) => /* @__PURE__ */ A.jsx(s, { ...m })),
739
- [a]
738
+ () => o(({ TextField: s, ...m }) => /* @__PURE__ */ A.jsx(s, { ...m })),
739
+ [o]
740
740
  );
741
741
  return /* @__PURE__ */ A.jsx(i, { ...n });
742
- }, it = ({ accessToken: a }) => ($e && a && ($e.accessToken = a), null), ut = ({
743
- children: a,
744
- defaultQueriesOptions: n,
745
- defaultMutationsOptions: i,
746
- QueryClient: s
747
- }) => {
748
- const m = new s({
742
+ }, ut = ({ accessToken: o }) => ($e && o && ($e.accessToken = o), null), st = ({ children: o, defaultQueriesOptions: n, defaultMutationsOptions: i }) => {
743
+ const s = new kr({
749
744
  defaultOptions: {
750
745
  mutations: {
751
746
  ...i
752
747
  },
753
748
  queries: {
754
- getNextPageParam: (E, o, c) => E.length + (c || 0),
749
+ getNextPageParam: (m, b, a) => m.length + (a || 0),
755
750
  refetchOnWindowFocus: !1,
756
751
  retry: 3,
757
752
  ...n
758
753
  }
759
754
  }
760
755
  });
761
- return /* @__PURE__ */ A.jsx(kr, { client: m, children: a });
762
- }, st = (a) => {
763
- const { unknownErrorTranslationKey: n = "error.unknownError" } = a || {}, i = jr(n), s = te(
764
- (E) => {
765
- var c, l, R, g, _, S, O, h, N;
766
- const { response: o } = E || {};
767
- return o != null && o.reason ? String(o.reason) : (c = o == null ? void 0 : o.data) != null && c.reason ? String(o.data.reason) : (l = o == null ? void 0 : o.data) != null && l.message ? String(o.data.message) : (g = (R = o == null ? void 0 : o.data) == null ? void 0 : R.detail) != null && g.length && Array.isArray((_ = o == null ? void 0 : o.data) == null ? void 0 : _.detail) && ((O = (S = o == null ? void 0 : o.data) == null ? void 0 : S.detail[0]) != null && O.msg) && typeof ((N = (h = o == null ? void 0 : o.data) == null ? void 0 : h.detail[0]) == null ? void 0 : N.msg) == "string" ? String(o.data.detail[0].msg) : i;
756
+ return /* @__PURE__ */ A.jsx($r, { client: s, children: o });
757
+ }, lt = (o) => {
758
+ const { unknownErrorTranslationKey: n = "error.unknownError" } = o || {}, i = jr(n), s = te(
759
+ (b) => {
760
+ var f, l, R, g, _, S, O, h, N;
761
+ const { response: a } = b || {};
762
+ return a != null && a.reason ? String(a.reason) : (f = a == null ? void 0 : a.data) != null && f.reason ? String(a.data.reason) : (l = a == null ? void 0 : a.data) != null && l.message ? String(a.data.message) : (g = (R = a == null ? void 0 : a.data) == null ? void 0 : R.detail) != null && g.length && Array.isArray((_ = a == null ? void 0 : a.data) == null ? void 0 : _.detail) && ((O = (S = a == null ? void 0 : a.data) == null ? void 0 : S.detail[0]) != null && O.msg) && typeof ((N = (h = a == null ? void 0 : a.data) == null ? void 0 : h.detail[0]) == null ? void 0 : N.msg) == "string" ? String(a.data.detail[0].msg) : i;
768
763
  },
769
764
  [i]
770
765
  );
771
- return { getErrorCode: te((E) => {
772
- var c, l, R;
773
- const { response: o } = E || {};
774
- return o != null && o.error_code ? String(o == null ? void 0 : o.error_code) : (c = o == null ? void 0 : o.data) != null && c.error_code ? String((l = o == null ? void 0 : o.data) == null ? void 0 : l.error_code) : o != null && o.error_code ? String(o == null ? void 0 : o.error_code) : (R = o == null ? void 0 : o.data) != null && R.error_code ? String(o.data.error_code) : "unknown_error_code";
766
+ return { getErrorCode: te((b) => {
767
+ var f, l, R;
768
+ const { response: a } = b || {};
769
+ return a != null && a.error_code ? String(a == null ? void 0 : a.error_code) : (f = a == null ? void 0 : a.data) != null && f.error_code ? String((l = a == null ? void 0 : a.data) == null ? void 0 : l.error_code) : a != null && a.error_code ? String(a == null ? void 0 : a.error_code) : (R = a == null ? void 0 : a.data) != null && R.error_code ? String(a.data.error_code) : "unknown_error_code";
775
770
  }, []), printError: s };
776
- }, lt = ({
777
- data: a,
771
+ }, ct = ({
772
+ data: o,
778
773
  fetchNextPage: n,
779
774
  isFetchingNextPage: i,
780
775
  isInitialLoading: s,
781
776
  isLoading: m,
782
- enabled: E = !0
777
+ enabled: b = !0
783
778
  }) => {
784
- const o = te(
779
+ const a = te(
785
780
  async (l) => {
786
- i || !E || await n({ pageParam: (l == null ? void 0 : l.pageParam) || l.visibleRowsCount });
781
+ i || !b || await n({ pageParam: (l == null ? void 0 : l.pageParam) || l.visibleRowsCount });
787
782
  },
788
- [E, n, i]
789
- ), c = ae(() => {
790
- if (a)
791
- return a.pages.reduce((l, R) => [...l, ...R], []);
792
- }, [a]);
783
+ [b, n, i]
784
+ ), f = ae(() => {
785
+ if (o)
786
+ return o.pages.reduce((l, R) => [...l, ...R], []);
787
+ }, [o]);
793
788
  return {
794
- fetchNextPageOnRowsScrollEnd: o,
789
+ fetchNextPageOnRowsScrollEnd: a,
795
790
  isLoading: i || m,
796
791
  loadingVariant: s ? "skeleton" : "linear",
797
- rows: c
792
+ rows: f
798
793
  };
799
- }, ct = () => ({
794
+ }, ft = () => ({
800
795
  clearAuthenticationToken: () => {
801
796
  k.defaults.headers.common.Authorization = null;
802
797
  },
803
798
  setAuthenticationToken: ({ tokenType: i, accessToken: s }) => {
804
799
  k.defaults.headers.common.Authorization = `${i} ${s}`;
805
800
  }
806
- }), Ir = (a, n = "ddd D MMM YY") => $r(a).format(n), Nr = (a, n = "km") => {
807
- const i = Number(a);
801
+ }), Nr = (o, n = "ddd D MMM YY") => Dr(o).format(n), Lr = (o, n = "km") => {
802
+ const i = Number(o);
808
803
  return Number.isNaN(i) ? `0 ${n}` : `${i.toFixed(2)} ${n}`;
809
- }, Lr = (a) => {
810
- const n = a && typeof a == "object" && "pathname" in a && a.pathname ? a.pathname : a;
804
+ }, Wr = (o) => {
805
+ const n = o && typeof o == "object" && "pathname" in o && o.pathname ? o.pathname : o;
811
806
  return typeof n == "string" ? n != null && n.startsWith("/") ? n != null && n.startsWith("/files") ? n : `/files${n}` : n != null && n.startsWith("files") ? `/${n}` : n != null && n.startsWith("files") ? `/${n}` : `/files/${n}` : n;
812
- }, Ie = (a, n) => {
813
- if (!a)
807
+ }, Ie = (o, n) => {
808
+ if (!o)
814
809
  return "";
815
- const i = Lr(a), s = typeof a == "object" && "pathname" in a ? `${a.origin}${i}` : a;
810
+ const i = Wr(o), s = typeof o == "object" && "pathname" in o ? `${o.origin}${i}` : o;
816
811
  return typeof n == "number" ? `${s.replace("/files", `/thumbs/${n}`)}` : s;
817
- }, ft = () => {
818
- const { apiURL: a } = We(ie);
812
+ }, dt = () => {
813
+ const { apiURL: o } = We(ie);
819
814
  return {
820
- dateAdapter: Ir,
821
- distanceAdapter: Nr,
815
+ dateAdapter: Nr,
816
+ distanceAdapter: Lr,
822
817
  filePathAdapter: (i, s) => Ie(
823
- a && typeof i == "string" ? {
824
- origin: a,
818
+ o && typeof i == "string" ? {
819
+ origin: o,
825
820
  pathname: i
826
821
  } : i,
827
822
  s
828
823
  )
829
824
  };
830
- }, Wr = (a) => a.charAt(0).toUpperCase() + a.slice(1).toLowerCase(), Yr = (a) => {
831
- const s = a.split("/").filter((m) => m.length > 0).map((m) => m.replace(/\${([^}]*)}/g, "$1").split(/[_-]/).map((l) => l.charAt(0).toUpperCase() + l.slice(1)).join("")).join("");
825
+ }, Yr = (o) => o.charAt(0).toUpperCase() + o.slice(1).toLowerCase(), Mr = (o) => {
826
+ const s = o.split("/").filter((m) => m.length > 0).map((m) => m.replace(/\${([^}]*)}/g, "$1").split(/[_-]/).map((l) => l.charAt(0).toUpperCase() + l.slice(1)).join("")).join("");
832
827
  return s.charAt(0).toLowerCase() + s.slice(1);
833
- }, Mr = (a, n, i) => {
834
- const s = Yr(n), m = Wr(i);
828
+ }, Vr = (o, n, i) => {
829
+ const s = Mr(n), m = Yr(i);
835
830
  return `${s}${m}`;
836
- }, Vr = (a) => {
837
- if (a)
838
- return (a == null ? void 0 : a.reduce((n, i) => (n[i] = {
831
+ }, Ur = (o) => {
832
+ if (o)
833
+ return (o == null ? void 0 : o.reduce((n, i) => (n[i] = {
839
834
  query: {
840
835
  useInfinite: !0,
841
836
  useInfiniteQueryParam: "offset",
842
837
  useQuery: !0
843
838
  }
844
839
  }, n), {})) || {};
845
- }, dt = (a) => {
846
- const { input: n = "./openapi.json", operationsToGenerateInfiniteQueryHook: i = void 0 } = a || {};
840
+ }, vt = (o) => {
841
+ const { input: n = "./openapi.json", operationsToGenerateInfiniteQueryHook: i = void 0 } = o || {};
847
842
  return {
848
843
  api: {
849
844
  hooks: {
@@ -863,8 +858,8 @@ const Qr = ({
863
858
  name: "axiosCustomInstance",
864
859
  path: `${__dirname}/config/orval/mutator/axiosCustomInstance.ts`
865
860
  },
866
- operationName: Mr,
867
- ...(i == null ? void 0 : i.length) && { operations: Vr(i) },
861
+ operationName: Vr,
862
+ ...(i == null ? void 0 : i.length) && { operations: Ur(i) },
868
863
  query: {
869
864
  useQuery: !0
870
865
  }
@@ -876,21 +871,21 @@ const Qr = ({
876
871
  };
877
872
  };
878
873
  export {
879
- tt as AxiosConfig,
880
- et as GTMSendPageView,
881
- nt as I18nConfig,
874
+ nt as AxiosConfig,
875
+ rt as GTMSendPageView,
876
+ at as I18nConfig,
882
877
  ie as InjectDependenciesContext,
883
- rt as InjectDependenciesProvider,
884
- it as MapBoxConfig,
885
- ot as MaskTextField,
886
- ut as QueryClientConfigProvider,
887
- Qr as RequireAuth,
888
- at as SentryConfig,
889
- Ir as dateAdapter,
890
- Nr as distanceAdapter,
891
- dt as getOrvalConfig,
892
- ft as useAdapter,
893
- ct as useAuth,
894
- lt as useInfiniteDataGrid,
895
- st as useResponseError
878
+ tt as InjectDependenciesProvider,
879
+ ut as MapBoxConfig,
880
+ it as MaskTextField,
881
+ st as QueryClientConfigProvider,
882
+ et as RequireAuth,
883
+ ot as SentryConfig,
884
+ Nr as dateAdapter,
885
+ Lr as distanceAdapter,
886
+ vt as getOrvalConfig,
887
+ dt as useAdapter,
888
+ ft as useAuth,
889
+ ct as useInfiniteDataGrid,
890
+ lt as useResponseError
896
891
  };
package/dist/main.umd.cjs CHANGED
@@ -1,4 +1,4 @@
1
- (function(v,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("react"),require("axios"),require("react-router-dom"),require("@tracktor/react-google-tag-manager"),require("i18next"),require("i18next-browser-languagedetector"),require("react-i18next"),require("@sentry/react"),require("mapbox-gl"),require("@tanstack/react-query"),require("dayjs")):typeof define=="function"&&define.amd?define(["exports","react","axios","react-router-dom","@tracktor/react-google-tag-manager","i18next","i18next-browser-languagedetector","react-i18next","@sentry/react","mapbox-gl","@tanstack/react-query","dayjs"],E):(v=typeof globalThis<"u"?globalThis:v||self,E(v["@tracktor/shared-module"]={},v.React,v.axios,v.reactRouterDom,v.reactGoogleTagManager,v.i18n,v.LanguageDetector,v.reactI18next,v.Sentry,v.mapbox,v.reactQuery,v.dayjs))})(this,function(v,E,P,k,Me,A,We,Ve,Ye,se,Ue,ze){"use strict";function Be(n){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const i in n)if(i!=="default"){const s=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(a,i,s.get?s:{enumerable:!0,get:()=>n[i]})}}return a.default=n,Object.freeze(a)}const Q=Be(Ye);var Z={exports:{}},V={};/**
1
+ (function(v,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("react"),require("axios"),require("react-router-dom"),require("@tracktor/react-google-tag-manager"),require("i18next"),require("i18next-browser-languagedetector"),require("react-i18next"),require("@sentry/react"),require("mapbox-gl"),require("@tanstack/react-query"),require("dayjs")):typeof define=="function"&&define.amd?define(["exports","react","axios","react-router-dom","@tracktor/react-google-tag-manager","i18next","i18next-browser-languagedetector","react-i18next","@sentry/react","mapbox-gl","@tanstack/react-query","dayjs"],E):(v=typeof globalThis<"u"?globalThis:v||self,E(v["@tracktor/shared-module"]={},v.React,v.axios,v.reactRouterDom,v.reactGoogleTagManager,v.i18n,v.LanguageDetector,v.reactI18next,v.Sentry,v.mapbox,v.reactQuery,v.dayjs))})(this,function(v,E,P,k,We,A,Ve,Ye,Ue,se,ce,ze){"use strict";function Be(n){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const i in n)if(i!=="default"){const s=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(a,i,s.get?s:{enumerable:!0,get:()=>n[i]})}}return a.default=n,Object.freeze(a)}const Q=Be(Ue);var Z={exports:{}},V={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.development.js
4
4
  *
@@ -6,17 +6,17 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var ce;function $e(){return ce||(ce=1,process.env.NODE_ENV!=="production"&&function(){var n=E,a=Symbol.for("react.element"),i=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),N=Symbol.iterator,U="@@iterator";function G(e){if(e===null||typeof e!="object")return null;var r=N&&e[N]||e[U];return typeof r=="function"?r:null}var L=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),u=1;u<r;u++)t[u-1]=arguments[u];dr("error",e,t)}}function dr(e,r,t){{var u=L.ReactDebugCurrentFrame,p=u.getStackAddendum();p!==""&&(r+="%s",t=t.concat([p]));var g=t.map(function(d){return String(d)});g.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,g)}}var vr=!1,pr=!1,gr=!1,mr=!1,hr=!1,pe;pe=Symbol.for("react.module.reference");function yr(e){return!!(typeof e=="string"||typeof e=="function"||e===s||e===_||hr||e===m||e===C||e===y||mr||e===h||vr||pr||gr||typeof e=="object"&&e!==null&&(e.$$typeof===j||e.$$typeof===T||e.$$typeof===o||e.$$typeof===l||e.$$typeof===c||e.$$typeof===pe||e.getModuleId!==void 0))}function Er(e,r,t){var u=e.displayName;if(u)return u;var p=r.displayName||r.name||"";return p!==""?t+"("+p+")":t}function ge(e){return e.displayName||"Context"}function F(e){if(e==null)return null;if(typeof e.tag=="number"&&S("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 _:return"Profiler";case m:return"StrictMode";case C:return"Suspense";case y:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case l:var r=e;return ge(r)+".Consumer";case o:var t=e;return ge(t._context)+".Provider";case c:return Er(e,e.render,"ForwardRef");case T:var u=e.displayName||null;return u!==null?u:F(e.type)||"Memo";case j:{var p=e,g=p._payload,d=p._init;try{return F(d(g))}catch{return null}}}return null}var I=Object.assign,z=0,me,he,ye,Ee,be,_e,Re;function Ce(){}Ce.__reactDisabledLog=!0;function br(){{if(z===0){me=console.log,he=console.info,ye=console.warn,Ee=console.error,be=console.group,_e=console.groupCollapsed,Re=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Ce,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}z++}}function _r(){{if(z--,z===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:I({},e,{value:me}),info:I({},e,{value:he}),warn:I({},e,{value:ye}),error:I({},e,{value:Ee}),group:I({},e,{value:be}),groupCollapsed:I({},e,{value:_e}),groupEnd:I({},e,{value:Re})})}z<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ee=L.ReactCurrentDispatcher,re;function q(e,r,t){{if(re===void 0)try{throw Error()}catch(p){var u=p.stack.trim().match(/\n( *(at )?)/);re=u&&u[1]||""}return`
10
- `+re+e}}var te=!1,J;{var Rr=typeof WeakMap=="function"?WeakMap:Map;J=new Rr}function Te(e,r){if(!e||te)return"";{var t=J.get(e);if(t!==void 0)return t}var u;te=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var g;g=ee.current,ee.current=null,br();try{if(r){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(D){u=D}Reflect.construct(e,[],d)}else{try{d.call()}catch(D){u=D}e.call(d.prototype)}}else{try{throw Error()}catch(D){u=D}e()}}catch(D){if(D&&u&&typeof D.stack=="string"){for(var f=D.stack.split(`
9
+ */var le;function $e(){return le||(le=1,process.env.NODE_ENV!=="production"&&function(){var n=E,a=Symbol.for("react.element"),i=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),f=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),N=Symbol.iterator,U="@@iterator";function G(e){if(e===null||typeof e!="object")return null;var r=N&&e[N]||e[U];return typeof r=="function"?r:null}var L=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),u=1;u<r;u++)t[u-1]=arguments[u];dr("error",e,t)}}function dr(e,r,t){{var u=L.ReactDebugCurrentFrame,p=u.getStackAddendum();p!==""&&(r+="%s",t=t.concat([p]));var g=t.map(function(d){return String(d)});g.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,g)}}var vr=!1,pr=!1,gr=!1,mr=!1,hr=!1,ge;ge=Symbol.for("react.module.reference");function yr(e){return!!(typeof e=="string"||typeof e=="function"||e===s||e===R||hr||e===m||e===C||e===y||mr||e===h||vr||pr||gr||typeof e=="object"&&e!==null&&(e.$$typeof===j||e.$$typeof===T||e.$$typeof===o||e.$$typeof===f||e.$$typeof===c||e.$$typeof===ge||e.getModuleId!==void 0))}function Er(e,r,t){var u=e.displayName;if(u)return u;var p=r.displayName||r.name||"";return p!==""?t+"("+p+")":t}function me(e){return e.displayName||"Context"}function F(e){if(e==null)return null;if(typeof e.tag=="number"&&S("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 R:return"Profiler";case m:return"StrictMode";case C:return"Suspense";case y:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case f:var r=e;return me(r)+".Consumer";case o:var t=e;return me(t._context)+".Provider";case c:return Er(e,e.render,"ForwardRef");case T:var u=e.displayName||null;return u!==null?u:F(e.type)||"Memo";case j:{var p=e,g=p._payload,d=p._init;try{return F(d(g))}catch{return null}}}return null}var I=Object.assign,z=0,he,ye,Ee,be,_e,Re,Ce;function Te(){}Te.__reactDisabledLog=!0;function br(){{if(z===0){he=console.log,ye=console.info,Ee=console.warn,be=console.error,_e=console.group,Re=console.groupCollapsed,Ce=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Te,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}z++}}function _r(){{if(z--,z===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:I({},e,{value:he}),info:I({},e,{value:ye}),warn:I({},e,{value:Ee}),error:I({},e,{value:be}),group:I({},e,{value:_e}),groupCollapsed:I({},e,{value:Re}),groupEnd:I({},e,{value:Ce})})}z<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ee=L.ReactCurrentDispatcher,re;function q(e,r,t){{if(re===void 0)try{throw Error()}catch(p){var u=p.stack.trim().match(/\n( *(at )?)/);re=u&&u[1]||""}return`
10
+ `+re+e}}var te=!1,J;{var Rr=typeof WeakMap=="function"?WeakMap:Map;J=new Rr}function Se(e,r){if(!e||te)return"";{var t=J.get(e);if(t!==void 0)return t}var u;te=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var g;g=ee.current,ee.current=null,br();try{if(r){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(D){u=D}Reflect.construct(e,[],d)}else{try{d.call()}catch(D){u=D}e.call(d.prototype)}}else{try{throw Error()}catch(D){u=D}e()}}catch(D){if(D&&u&&typeof D.stack=="string"){for(var l=D.stack.split(`
11
11
  `),O=u.stack.split(`
12
- `),b=f.length-1,R=O.length-1;b>=1&&R>=0&&f[b]!==O[R];)R--;for(;b>=1&&R>=0;b--,R--)if(f[b]!==O[R]){if(b!==1||R!==1)do if(b--,R--,R<0||f[b]!==O[R]){var w=`
13
- `+f[b].replace(" at new "," at ");return e.displayName&&w.includes("<anonymous>")&&(w=w.replace("<anonymous>",e.displayName)),typeof e=="function"&&J.set(e,w),w}while(b>=1&&R>=0);break}}}finally{te=!1,ee.current=g,_r(),Error.prepareStackTrace=p}var W=e?e.displayName||e.name:"",Le=W?q(W):"";return typeof e=="function"&&J.set(e,Le),Le}function Cr(e,r,t){return Te(e,!1)}function Tr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function X(e,r,t){if(e==null)return"";if(typeof e=="function")return Te(e,Tr(e));if(typeof e=="string")return q(e);switch(e){case C:return q("Suspense");case y:return q("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case c:return Cr(e.render);case T:return X(e.type,r,t);case j:{var u=e,p=u._payload,g=u._init;try{return X(g(p),r,t)}catch{}}}return""}var H=Object.prototype.hasOwnProperty,Se={},Oe=L.ReactDebugCurrentFrame;function K(e){if(e){var r=e._owner,t=X(e.type,e._source,r?r.type:null);Oe.setExtraStackFrame(t)}else Oe.setExtraStackFrame(null)}function Sr(e,r,t,u,p){{var g=Function.call.bind(H);for(var d in e)if(g(e,d)){var f=void 0;try{if(typeof e[d]!="function"){var O=Error((u||"React class")+": "+t+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw O.name="Invariant Violation",O}f=e[d](r,d,u,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(b){f=b}f&&!(f instanceof Error)&&(K(p),S("%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).",u||"React class",t,d,typeof f),K(null)),f instanceof Error&&!(f.message in Se)&&(Se[f.message]=!0,K(p),S("Failed %s type: %s",t,f.message),K(null))}}}var Or=Array.isArray;function ne(e){return Or(e)}function jr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function wr(e){try{return je(e),!1}catch{return!0}}function je(e){return""+e}function we(e){if(wr(e))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",jr(e)),je(e)}var B=L.ReactCurrentOwner,Pr={key:!0,ref:!0,__self:!0,__source:!0},Pe,ke,ae;ae={};function kr(e){if(H.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Ar(e){if(H.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function xr(e,r){if(typeof e.ref=="string"&&B.current&&r&&B.current.stateNode!==r){var t=F(B.current.type);ae[t]||(S('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',F(B.current.type),e.ref),ae[t]=!0)}}function Fr(e,r){{var t=function(){Pe||(Pe=!0,S("%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))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function Dr(e,r){{var t=function(){ke||(ke=!0,S("%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))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var Ir=function(e,r,t,u,p,g,d){var f={$$typeof:a,type:e,key:r,ref:t,props:d,_owner:g};return f._store={},Object.defineProperty(f._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(f,"_self",{configurable:!1,enumerable:!1,writable:!1,value:u}),Object.defineProperty(f,"_source",{configurable:!1,enumerable:!1,writable:!1,value:p}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f};function Nr(e,r,t,u,p){{var g,d={},f=null,O=null;t!==void 0&&(we(t),f=""+t),Ar(r)&&(we(r.key),f=""+r.key),kr(r)&&(O=r.ref,xr(r,p));for(g in r)H.call(r,g)&&!Pr.hasOwnProperty(g)&&(d[g]=r[g]);if(e&&e.defaultProps){var b=e.defaultProps;for(g in b)d[g]===void 0&&(d[g]=b[g])}if(f||O){var R=typeof e=="function"?e.displayName||e.name||"Unknown":e;f&&Fr(d,R),O&&Dr(d,R)}return Ir(e,f,O,p,u,B.current,d)}}var oe=L.ReactCurrentOwner,Ae=L.ReactDebugCurrentFrame;function M(e){if(e){var r=e._owner,t=X(e.type,e._source,r?r.type:null);Ae.setExtraStackFrame(t)}else Ae.setExtraStackFrame(null)}var ie;ie=!1;function ue(e){return typeof e=="object"&&e!==null&&e.$$typeof===a}function xe(){{if(oe.current){var e=F(oe.current.type);if(e)return`
12
+ `),b=l.length-1,_=O.length-1;b>=1&&_>=0&&l[b]!==O[_];)_--;for(;b>=1&&_>=0;b--,_--)if(l[b]!==O[_]){if(b!==1||_!==1)do if(b--,_--,_<0||l[b]!==O[_]){var w=`
13
+ `+l[b].replace(" at new "," at ");return e.displayName&&w.includes("<anonymous>")&&(w=w.replace("<anonymous>",e.displayName)),typeof e=="function"&&J.set(e,w),w}while(b>=1&&_>=0);break}}}finally{te=!1,ee.current=g,_r(),Error.prepareStackTrace=p}var W=e?e.displayName||e.name:"",Me=W?q(W):"";return typeof e=="function"&&J.set(e,Me),Me}function Cr(e,r,t){return Se(e,!1)}function Tr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function X(e,r,t){if(e==null)return"";if(typeof e=="function")return Se(e,Tr(e));if(typeof e=="string")return q(e);switch(e){case C:return q("Suspense");case y:return q("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case c:return Cr(e.render);case T:return X(e.type,r,t);case j:{var u=e,p=u._payload,g=u._init;try{return X(g(p),r,t)}catch{}}}return""}var H=Object.prototype.hasOwnProperty,Oe={},je=L.ReactDebugCurrentFrame;function K(e){if(e){var r=e._owner,t=X(e.type,e._source,r?r.type:null);je.setExtraStackFrame(t)}else je.setExtraStackFrame(null)}function Sr(e,r,t,u,p){{var g=Function.call.bind(H);for(var d in e)if(g(e,d)){var l=void 0;try{if(typeof e[d]!="function"){var O=Error((u||"React class")+": "+t+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw O.name="Invariant Violation",O}l=e[d](r,d,u,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(b){l=b}l&&!(l instanceof Error)&&(K(p),S("%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).",u||"React class",t,d,typeof l),K(null)),l instanceof Error&&!(l.message in Oe)&&(Oe[l.message]=!0,K(p),S("Failed %s type: %s",t,l.message),K(null))}}}var Or=Array.isArray;function ne(e){return Or(e)}function jr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function wr(e){try{return we(e),!1}catch{return!0}}function we(e){return""+e}function Pe(e){if(wr(e))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",jr(e)),we(e)}var B=L.ReactCurrentOwner,Pr={key:!0,ref:!0,__self:!0,__source:!0},ke,Ae,ae;ae={};function kr(e){if(H.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Ar(e){if(H.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function xr(e,r){if(typeof e.ref=="string"&&B.current&&r&&B.current.stateNode!==r){var t=F(B.current.type);ae[t]||(S('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',F(B.current.type),e.ref),ae[t]=!0)}}function Fr(e,r){{var t=function(){ke||(ke=!0,S("%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))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function Dr(e,r){{var t=function(){Ae||(Ae=!0,S("%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))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var Ir=function(e,r,t,u,p,g,d){var l={$$typeof:a,type:e,key:r,ref:t,props:d,_owner:g};return l._store={},Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(l,"_self",{configurable:!1,enumerable:!1,writable:!1,value:u}),Object.defineProperty(l,"_source",{configurable:!1,enumerable:!1,writable:!1,value:p}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l};function Nr(e,r,t,u,p){{var g,d={},l=null,O=null;t!==void 0&&(Pe(t),l=""+t),Ar(r)&&(Pe(r.key),l=""+r.key),kr(r)&&(O=r.ref,xr(r,p));for(g in r)H.call(r,g)&&!Pr.hasOwnProperty(g)&&(d[g]=r[g]);if(e&&e.defaultProps){var b=e.defaultProps;for(g in b)d[g]===void 0&&(d[g]=b[g])}if(l||O){var _=typeof e=="function"?e.displayName||e.name||"Unknown":e;l&&Fr(d,_),O&&Dr(d,_)}return Ir(e,l,O,p,u,B.current,d)}}var oe=L.ReactCurrentOwner,xe=L.ReactDebugCurrentFrame;function M(e){if(e){var r=e._owner,t=X(e.type,e._source,r?r.type:null);xe.setExtraStackFrame(t)}else xe.setExtraStackFrame(null)}var ie;ie=!1;function ue(e){return typeof e=="object"&&e!==null&&e.$$typeof===a}function Fe(){{if(oe.current){var e=F(oe.current.type);if(e)return`
14
14
 
15
15
  Check the render method of \``+e+"`."}return""}}function Lr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
16
16
 
17
- Check your code at `+r+":"+t+"."}return""}}var Fe={};function Mr(e){{var r=xe();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
17
+ Check your code at `+r+":"+t+"."}return""}}var De={};function Mr(e){{var r=Fe();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
18
18
 
19
- Check the top-level render call using <`+t+">.")}return r}}function De(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=Mr(r);if(Fe[t])return;Fe[t]=!0;var u="";e&&e._owner&&e._owner!==oe.current&&(u=" It was passed a child from "+F(e._owner.type)+"."),M(e),S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,u),M(null)}}function Ie(e,r){{if(typeof e!="object")return;if(ne(e))for(var t=0;t<e.length;t++){var u=e[t];ue(u)&&De(u,r)}else if(ue(e))e._store&&(e._store.validated=!0);else if(e){var p=G(e);if(typeof p=="function"&&p!==e.entries)for(var g=p.call(e),d;!(d=g.next()).done;)ue(d.value)&&De(d.value,r)}}}function Wr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===c||r.$$typeof===T))t=r.propTypes;else return;if(t){var u=F(r);Sr(t,e.props,"prop",u,e)}else if(r.PropTypes!==void 0&&!ie){ie=!0;var p=F(r);S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",p||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Vr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var u=r[t];if(u!=="children"&&u!=="key"){M(e),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",u),M(null);break}}e.ref!==null&&(M(e),S("Invalid attribute `ref` supplied to `React.Fragment`."),M(null))}}function Ne(e,r,t,u,p,g){{var d=yr(e);if(!d){var f="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(f+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var O=Lr(p);O?f+=O:f+=xe();var b;e===null?b="null":ne(e)?b="array":e!==void 0&&e.$$typeof===a?(b="<"+(F(e.type)||"Unknown")+" />",f=" Did you accidentally export a JSX literal instead of a component?"):b=typeof e,S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",b,f)}var R=Nr(e,r,t,p,g);if(R==null)return R;if(d){var w=r.children;if(w!==void 0)if(u)if(ne(w)){for(var W=0;W<w.length;W++)Ie(w[W],e);Object.freeze&&Object.freeze(w)}else S("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 Ie(w,e)}return e===s?Vr(R):Wr(R),R}}function Yr(e,r,t){return Ne(e,r,t,!0)}function Ur(e,r,t){return Ne(e,r,t,!1)}var zr=Ur,Br=Yr;V.Fragment=s,V.jsx=zr,V.jsxs=Br}()),V}var Y={};/**
19
+ Check the top-level render call using <`+t+">.")}return r}}function Ie(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=Mr(r);if(De[t])return;De[t]=!0;var u="";e&&e._owner&&e._owner!==oe.current&&(u=" It was passed a child from "+F(e._owner.type)+"."),M(e),S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,u),M(null)}}function Ne(e,r){{if(typeof e!="object")return;if(ne(e))for(var t=0;t<e.length;t++){var u=e[t];ue(u)&&Ie(u,r)}else if(ue(e))e._store&&(e._store.validated=!0);else if(e){var p=G(e);if(typeof p=="function"&&p!==e.entries)for(var g=p.call(e),d;!(d=g.next()).done;)ue(d.value)&&Ie(d.value,r)}}}function Wr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===c||r.$$typeof===T))t=r.propTypes;else return;if(t){var u=F(r);Sr(t,e.props,"prop",u,e)}else if(r.PropTypes!==void 0&&!ie){ie=!0;var p=F(r);S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",p||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Vr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var u=r[t];if(u!=="children"&&u!=="key"){M(e),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",u),M(null);break}}e.ref!==null&&(M(e),S("Invalid attribute `ref` supplied to `React.Fragment`."),M(null))}}function Le(e,r,t,u,p,g){{var d=yr(e);if(!d){var l="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(l+=" 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=Lr(p);O?l+=O:l+=Fe();var b;e===null?b="null":ne(e)?b="array":e!==void 0&&e.$$typeof===a?(b="<"+(F(e.type)||"Unknown")+" />",l=" Did you accidentally export a JSX literal instead of a component?"):b=typeof e,S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",b,l)}var _=Nr(e,r,t,p,g);if(_==null)return _;if(d){var w=r.children;if(w!==void 0)if(u)if(ne(w)){for(var W=0;W<w.length;W++)Ne(w[W],e);Object.freeze&&Object.freeze(w)}else S("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 Ne(w,e)}return e===s?Vr(_):Wr(_),_}}function Yr(e,r,t){return Le(e,r,t,!0)}function Ur(e,r,t){return Le(e,r,t,!1)}var zr=Ur,Br=Yr;V.Fragment=s,V.jsx=zr,V.jsxs=Br}()),V}var Y={};/**
20
20
  * @license React
21
21
  * react-jsx-runtime.production.min.js
22
22
  *
@@ -24,4 +24,4 @@ Check the top-level render call using <`+t+">.")}return r}}function De(e,r){{if(
24
24
  *
25
25
  * This source code is licensed under the MIT license found in the
26
26
  * LICENSE file in the root directory of this source tree.
27
- */var le;function Ge(){if(le)return Y;le=1;var n=E,a=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,m=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,_={key:!0,ref:!0,__self:!0,__source:!0};function o(l,c,C){var y,T={},j=null,h=null;C!==void 0&&(j=""+C),c.key!==void 0&&(j=""+c.key),c.ref!==void 0&&(h=c.ref);for(y in c)s.call(c,y)&&!_.hasOwnProperty(y)&&(T[y]=c[y]);if(l&&l.defaultProps)for(y in c=l.defaultProps,c)T[y]===void 0&&(T[y]=c[y]);return{$$typeof:a,type:l,key:j,ref:h,props:T,_owner:m.current}}return Y.Fragment=i,Y.jsx=o,Y.jsxs=o,Y}process.env.NODE_ENV==="production"?Z.exports=Ge():Z.exports=$e();var x=Z.exports;const qe=({Fallback:n,loginPath:a="/login",localStorageKey:i="user",redirect401Path:s="/login",isLogged:m})=>{var C,y,T,j;const[_,o]=E.useState(null),l=k.useLocation(),c=E.useRef(!1);return E.useLayoutEffect(()=>{c.current||(c.current=!0,P==null||P.interceptors.response.use(h=>h,async h=>{var G;return typeof h=="object"&&h&&"response"in h&&h.response&&typeof h.response=="object"&&"status"in h.response&&h.response&&typeof h.response=="object"&&"status"in h.response&&((G=h==null?void 0:h.response)==null?void 0:G.status)===401&&(P.defaults.headers.common.Authorization=null,localStorage.removeItem(i),o(s)),Promise.reject(h)}))},[i,s]),m&&!_?x.jsx(E.Suspense,{fallback:n,children:(y=(C=l.state)==null?void 0:C.from)!=null&&y.state&&((j=(T=l.state)==null?void 0:T.from)==null?void 0:j.pathname)===a?x.jsx(k.Navigate,{to:l.state.from.state.from.pathname+l.state.from.state.from.search,replace:!0}):x.jsx(k.Outlet,{})}):x.jsx(k.Navigate,{to:a,state:{from:l},replace:!0})},Je=()=>{const{pathname:n}=k.useLocation(),{sendEvent:a}=Me.useGoogleTagManager();return E.useEffect(()=>{a({event:"pageView",pathname:n})},[n,a]),x.jsx(k.Outlet,{})},$=E.createContext({apiURL:void 0,children:void 0}),Xe=({children:n,apiURL:a})=>{const i=E.useMemo(()=>({apiURL:a}),[a]);return x.jsx($.Provider,{value:i,children:n})},He=({tokenTypeKey:n="tokenType",userLocalStorageKey:a="user",tokenKey:i="accessToken",postContentType:s="application/json",...m})=>{const{apiURL:_=m.baseURL}=E.useContext($);if(!P.defaults)return null;const o=localStorage.getItem(a),l=o?JSON.parse(o):null,c=l!=null&&l[n]?l[n]:null,C=l!=null&&l[i]?l[i]:null,y=o?`${c} ${C}`:null;return P.defaults.baseURL=_,P.defaults.headers.post["Content-Type"]=s,y&&(P.defaults.headers.common.Authorization=y),null},Ke=({debug:n,resources:a})=>(A!=null&&A.isInitialized||(A.use(We).use(Ve.initReactI18next).init({debug:n,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:!1,useSuspense:!0},resources:a,returnNull:!1}).then(()=>{document.documentElement.lang!==A.resolvedLanguage&&A.resolvedLanguage&&document.documentElement.setAttribute("lang",A.resolvedLanguage)}),A.on("languageChanged",i=>{document.documentElement.setAttribute("lang",i)})),null),Qe=({dsn:n,integrations:a,tracesSampleRate:i,replaysSessionSampleRate:s,replaysOnErrorSampleRate:m,tracePropagationTargets:_,ignoreErrors:o,debug:l,environment:c})=>(Q.isInitialized()||(l||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&Q.init({debug:l,dsn:n,environment:c||"production",ignoreErrors:[...o||[],/dynamically imported module/],integrations:[Q.reactRouterV6BrowserTracingIntegration({createRoutesFromChildren:k.createRoutesFromChildren,matchRoutes:k.matchRoutes,useEffect:E.useEffect,useLocation:k.useLocation,useNavigationType:k.useNavigationType}),...a||[]],replaysOnErrorSampleRate:m||1,replaysSessionSampleRate:s||.1,tracePropagationTargets:_,tracesSampleRate:i||1}),null),Ze=({IMaskMixin:n,...a})=>{const i=E.useMemo(()=>n(({TextField:s,...m})=>x.jsx(s,{...m})),[n]);return x.jsx(i,{...a})},er=({accessToken:n})=>(se&&n&&(se.accessToken=n),null),rr=({children:n,defaultQueriesOptions:a,defaultMutationsOptions:i,QueryClient:s})=>{const m=new s({defaultOptions:{mutations:{...i},queries:{getNextPageParam:(_,o,l)=>_.length+(l||0),refetchOnWindowFocus:!1,retry:3,...a}}});return x.jsx(Ue.QueryClientProvider,{client:m,children:n})},tr=n=>{const{unknownErrorTranslationKey:a="error.unknownError"}=n||{},i=A.t(a),s=E.useCallback(_=>{var l,c,C,y,T,j,h,N,U;const{response:o}=_||{};return o!=null&&o.reason?String(o.reason):(l=o==null?void 0:o.data)!=null&&l.reason?String(o.data.reason):(c=o==null?void 0:o.data)!=null&&c.message?String(o.data.message):(y=(C=o==null?void 0:o.data)==null?void 0:C.detail)!=null&&y.length&&Array.isArray((T=o==null?void 0:o.data)==null?void 0:T.detail)&&((h=(j=o==null?void 0:o.data)==null?void 0:j.detail[0])!=null&&h.msg)&&typeof((U=(N=o==null?void 0:o.data)==null?void 0:N.detail[0])==null?void 0:U.msg)=="string"?String(o.data.detail[0].msg):i},[i]);return{getErrorCode:E.useCallback(_=>{var l,c,C;const{response:o}=_||{};return o!=null&&o.error_code?String(o==null?void 0:o.error_code):(l=o==null?void 0:o.data)!=null&&l.error_code?String((c=o==null?void 0:o.data)==null?void 0:c.error_code):o!=null&&o.error_code?String(o==null?void 0:o.error_code):(C=o==null?void 0:o.data)!=null&&C.error_code?String(o.data.error_code):"unknown_error_code"},[]),printError:s}},nr=({data:n,fetchNextPage:a,isFetchingNextPage:i,isInitialLoading:s,isLoading:m,enabled:_=!0})=>{const o=E.useCallback(async c=>{i||!_||await a({pageParam:(c==null?void 0:c.pageParam)||c.visibleRowsCount})},[_,a,i]),l=E.useMemo(()=>{if(n)return n.pages.reduce((c,C)=>[...c,...C],[])},[n]);return{fetchNextPageOnRowsScrollEnd:o,isLoading:i||m,loadingVariant:s?"skeleton":"linear",rows:l}},ar=()=>({clearAuthenticationToken:()=>{P.defaults.headers.common.Authorization=null},setAuthenticationToken:({tokenType:i,accessToken:s})=>{P.defaults.headers.common.Authorization=`${i} ${s}`}}),fe=(n,a="ddd D MMM YY")=>ze(n).format(a),de=(n,a="km")=>{const i=Number(n);return Number.isNaN(i)?`0 ${a}`:`${i.toFixed(2)} ${a}`},or=n=>{const a=n&&typeof n=="object"&&"pathname"in n&&n.pathname?n.pathname:n;return typeof a=="string"?a!=null&&a.startsWith("/")?a!=null&&a.startsWith("/files")?a:`/files${a}`:a!=null&&a.startsWith("files")?`/${a}`:a!=null&&a.startsWith("files")?`/${a}`:`/files/${a}`:a},ve=(n,a)=>{if(!n)return"";const i=or(n),s=typeof n=="object"&&"pathname"in n?`${n.origin}${i}`:n;return typeof a=="number"?`${s.replace("/files",`/thumbs/${a}`)}`:s},ir=()=>{const{apiURL:n}=E.useContext($);return{dateAdapter:fe,distanceAdapter:de,filePathAdapter:(i,s)=>ve(n&&typeof i=="string"?{origin:n,pathname:i}:i,s)}},ur=n=>n.charAt(0).toUpperCase()+n.slice(1).toLowerCase(),sr=n=>{const s=n.split("/").filter(m=>m.length>0).map(m=>m.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(c=>c.charAt(0).toUpperCase()+c.slice(1)).join("")).join("");return s.charAt(0).toLowerCase()+s.slice(1)},cr=(n,a,i)=>{const s=sr(a),m=ur(i);return`${s}${m}`},lr=n=>{if(n)return(n==null?void 0:n.reduce((a,i)=>(a[i]={query:{useInfinite:!0,useInfiniteQueryParam:"offset",useQuery:!0}},a),{}))||{}},fr=n=>{const{input:a="./openapi.json",operationsToGenerateInfiniteQueryHook:i=void 0}=n||{};return{api:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:a,output:{client:"react-query",mode:"tags-split",override:{header:s=>["Generated by orval 🍺",...s.title?[s.title]:[],...s.description?[s.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/config/orval/mutator/axiosCustomInstance.ts`},operationName:cr,...(i==null?void 0:i.length)&&{operations:lr(i)},query:{useQuery:!0}},schemas:"src/api/model",target:"src/api/services/api.ts"}}}};v.AxiosConfig=He,v.GTMSendPageView=Je,v.I18nConfig=Ke,v.InjectDependenciesContext=$,v.InjectDependenciesProvider=Xe,v.MapBoxConfig=er,v.MaskTextField=Ze,v.QueryClientConfigProvider=rr,v.RequireAuth=qe,v.SentryConfig=Qe,v.dateAdapter=fe,v.distanceAdapter=de,v.getOrvalConfig=fr,v.useAdapter=ir,v.useAuth=ar,v.useInfiniteDataGrid=nr,v.useResponseError=tr,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})});
27
+ */var fe;function Ge(){if(fe)return Y;fe=1;var n=E,a=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,m=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,R={key:!0,ref:!0,__self:!0,__source:!0};function o(f,c,C){var y,T={},j=null,h=null;C!==void 0&&(j=""+C),c.key!==void 0&&(j=""+c.key),c.ref!==void 0&&(h=c.ref);for(y in c)s.call(c,y)&&!R.hasOwnProperty(y)&&(T[y]=c[y]);if(f&&f.defaultProps)for(y in c=f.defaultProps,c)T[y]===void 0&&(T[y]=c[y]);return{$$typeof:a,type:f,key:j,ref:h,props:T,_owner:m.current}}return Y.Fragment=i,Y.jsx=o,Y.jsxs=o,Y}process.env.NODE_ENV==="production"?Z.exports=Ge():Z.exports=$e();var x=Z.exports;const qe=({Fallback:n,loginPath:a="/login",localStorageKey:i="user",redirect401Path:s="/login",isLogged:m})=>{var C,y,T,j;const[R,o]=E.useState(null),f=k.useLocation(),c=E.useRef(!1);return E.useLayoutEffect(()=>{c.current||(c.current=!0,P==null||P.interceptors.response.use(h=>h,async h=>{var G;return typeof h=="object"&&h&&"response"in h&&h.response&&typeof h.response=="object"&&"status"in h.response&&h.response&&typeof h.response=="object"&&"status"in h.response&&((G=h==null?void 0:h.response)==null?void 0:G.status)===401&&(P.defaults.headers.common.Authorization=null,localStorage.removeItem(i),o(s)),Promise.reject(h)}))},[i,s]),m&&!R?x.jsx(E.Suspense,{fallback:n,children:(y=(C=f.state)==null?void 0:C.from)!=null&&y.state&&((j=(T=f.state)==null?void 0:T.from)==null?void 0:j.pathname)===a?x.jsx(k.Navigate,{to:f.state.from.state.from.pathname+f.state.from.state.from.search,replace:!0}):x.jsx(k.Outlet,{})}):x.jsx(k.Navigate,{to:a,state:{from:f},replace:!0})},Je=()=>{const{pathname:n}=k.useLocation(),{sendEvent:a}=We.useGoogleTagManager();return E.useEffect(()=>{a({event:"pageView",pathname:n})},[n,a]),x.jsx(k.Outlet,{})},$=E.createContext({apiURL:void 0,children:void 0}),Xe=({children:n,apiURL:a})=>{const i=E.useMemo(()=>({apiURL:a}),[a]);return x.jsx($.Provider,{value:i,children:n})},He=({tokenTypeKey:n="tokenType",userLocalStorageKey:a="user",tokenKey:i="accessToken",postContentType:s="application/json",...m})=>{const{apiURL:R=m.baseURL}=E.useContext($);if(!P.defaults)return null;const o=localStorage.getItem(a),f=o?JSON.parse(o):null,c=f!=null&&f[n]?f[n]:null,C=f!=null&&f[i]?f[i]:null,y=o?`${c} ${C}`:null;return P.defaults.baseURL=R,P.defaults.headers.post["Content-Type"]=s,y&&(P.defaults.headers.common.Authorization=y),null},Ke=({debug:n,resources:a})=>(A!=null&&A.isInitialized||(A.use(Ve).use(Ye.initReactI18next).init({debug:n,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:!1,useSuspense:!0},resources:a,returnNull:!1}).then(()=>{document.documentElement.lang!==A.resolvedLanguage&&A.resolvedLanguage&&document.documentElement.setAttribute("lang",A.resolvedLanguage)}),A.on("languageChanged",i=>{document.documentElement.setAttribute("lang",i)})),null),Qe=({dsn:n,integrations:a,tracesSampleRate:i,replaysSessionSampleRate:s,replaysOnErrorSampleRate:m,tracePropagationTargets:R,ignoreErrors:o,debug:f,environment:c})=>(Q.isInitialized()||(f||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&Q.init({debug:f,dsn:n,environment:c||"production",ignoreErrors:[...o||[],/dynamically imported module/],integrations:[Q.reactRouterV6BrowserTracingIntegration({createRoutesFromChildren:k.createRoutesFromChildren,matchRoutes:k.matchRoutes,useEffect:E.useEffect,useLocation:k.useLocation,useNavigationType:k.useNavigationType}),...a||[]],replaysOnErrorSampleRate:m||1,replaysSessionSampleRate:s||.1,tracePropagationTargets:R,tracesSampleRate:i||1}),null),Ze=({IMaskMixin:n,...a})=>{const i=E.useMemo(()=>n(({TextField:s,...m})=>x.jsx(s,{...m})),[n]);return x.jsx(i,{...a})},er=({accessToken:n})=>(se&&n&&(se.accessToken=n),null),rr=({children:n,defaultQueriesOptions:a,defaultMutationsOptions:i})=>{const s=new ce.QueryClient({defaultOptions:{mutations:{...i},queries:{getNextPageParam:(m,R,o)=>m.length+(o||0),refetchOnWindowFocus:!1,retry:3,...a}}});return x.jsx(ce.QueryClientProvider,{client:s,children:n})},tr=n=>{const{unknownErrorTranslationKey:a="error.unknownError"}=n||{},i=A.t(a),s=E.useCallback(R=>{var f,c,C,y,T,j,h,N,U;const{response:o}=R||{};return o!=null&&o.reason?String(o.reason):(f=o==null?void 0:o.data)!=null&&f.reason?String(o.data.reason):(c=o==null?void 0:o.data)!=null&&c.message?String(o.data.message):(y=(C=o==null?void 0:o.data)==null?void 0:C.detail)!=null&&y.length&&Array.isArray((T=o==null?void 0:o.data)==null?void 0:T.detail)&&((h=(j=o==null?void 0:o.data)==null?void 0:j.detail[0])!=null&&h.msg)&&typeof((U=(N=o==null?void 0:o.data)==null?void 0:N.detail[0])==null?void 0:U.msg)=="string"?String(o.data.detail[0].msg):i},[i]);return{getErrorCode:E.useCallback(R=>{var f,c,C;const{response:o}=R||{};return o!=null&&o.error_code?String(o==null?void 0:o.error_code):(f=o==null?void 0:o.data)!=null&&f.error_code?String((c=o==null?void 0:o.data)==null?void 0:c.error_code):o!=null&&o.error_code?String(o==null?void 0:o.error_code):(C=o==null?void 0:o.data)!=null&&C.error_code?String(o.data.error_code):"unknown_error_code"},[]),printError:s}},nr=({data:n,fetchNextPage:a,isFetchingNextPage:i,isInitialLoading:s,isLoading:m,enabled:R=!0})=>{const o=E.useCallback(async c=>{i||!R||await a({pageParam:(c==null?void 0:c.pageParam)||c.visibleRowsCount})},[R,a,i]),f=E.useMemo(()=>{if(n)return n.pages.reduce((c,C)=>[...c,...C],[])},[n]);return{fetchNextPageOnRowsScrollEnd:o,isLoading:i||m,loadingVariant:s?"skeleton":"linear",rows:f}},ar=()=>({clearAuthenticationToken:()=>{P.defaults.headers.common.Authorization=null},setAuthenticationToken:({tokenType:i,accessToken:s})=>{P.defaults.headers.common.Authorization=`${i} ${s}`}}),de=(n,a="ddd D MMM YY")=>ze(n).format(a),ve=(n,a="km")=>{const i=Number(n);return Number.isNaN(i)?`0 ${a}`:`${i.toFixed(2)} ${a}`},or=n=>{const a=n&&typeof n=="object"&&"pathname"in n&&n.pathname?n.pathname:n;return typeof a=="string"?a!=null&&a.startsWith("/")?a!=null&&a.startsWith("/files")?a:`/files${a}`:a!=null&&a.startsWith("files")?`/${a}`:a!=null&&a.startsWith("files")?`/${a}`:`/files/${a}`:a},pe=(n,a)=>{if(!n)return"";const i=or(n),s=typeof n=="object"&&"pathname"in n?`${n.origin}${i}`:n;return typeof a=="number"?`${s.replace("/files",`/thumbs/${a}`)}`:s},ir=()=>{const{apiURL:n}=E.useContext($);return{dateAdapter:de,distanceAdapter:ve,filePathAdapter:(i,s)=>pe(n&&typeof i=="string"?{origin:n,pathname:i}:i,s)}},ur=n=>n.charAt(0).toUpperCase()+n.slice(1).toLowerCase(),sr=n=>{const s=n.split("/").filter(m=>m.length>0).map(m=>m.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(c=>c.charAt(0).toUpperCase()+c.slice(1)).join("")).join("");return s.charAt(0).toLowerCase()+s.slice(1)},cr=(n,a,i)=>{const s=sr(a),m=ur(i);return`${s}${m}`},lr=n=>{if(n)return(n==null?void 0:n.reduce((a,i)=>(a[i]={query:{useInfinite:!0,useInfiniteQueryParam:"offset",useQuery:!0}},a),{}))||{}},fr=n=>{const{input:a="./openapi.json",operationsToGenerateInfiniteQueryHook:i=void 0}=n||{};return{api:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:a,output:{client:"react-query",mode:"tags-split",override:{header:s=>["Generated by orval 🍺",...s.title?[s.title]:[],...s.description?[s.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/config/orval/mutator/axiosCustomInstance.ts`},operationName:cr,...(i==null?void 0:i.length)&&{operations:lr(i)},query:{useQuery:!0}},schemas:"src/api/model",target:"src/api/services/api.ts"}}}};v.AxiosConfig=He,v.GTMSendPageView=Je,v.I18nConfig=Ke,v.InjectDependenciesContext=$,v.InjectDependenciesProvider=Xe,v.MapBoxConfig=er,v.MaskTextField=Ze,v.QueryClientConfigProvider=rr,v.RequireAuth=qe,v.SentryConfig=Qe,v.dateAdapter=de,v.distanceAdapter=ve,v.getOrvalConfig=fr,v.useAdapter=ir,v.useAuth=ar,v.useInfiniteDataGrid=nr,v.useResponseError=tr,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tracktor/shared-module",
3
- "version": "1.0.0-beta.0",
3
+ "version": "1.0.0-beta.1",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "types": "./dist/main.d.ts",