@tracktor/shared-module 0.15.11 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,4 +1,4 @@
1
1
  # [Versions](https://github.com/Tracktor/shared-module/releases)
2
2
 
3
- ## v0.15.11
4
- - **[fix]** : `SentryConfig` initialization
3
+ ## v0.16.0
4
+ - **[feat]** : ignore sentry error by default _`Failed to fetch dynamically imported module`_ in`SentryConfig`
@@ -38,6 +38,11 @@ interface SentryConfigProps<T> {
38
38
  * List of strings/regex controlling to which outgoing requests the SDK will attach tracing headers.
39
39
  */
40
40
  tracePropagationTargets?: (string | RegExp)[];
41
+ /**
42
+ * A pattern for error messages which should not be sent to Sentry.
43
+ * By default, all errors will be sent.
44
+ */
45
+ ignoreErrors?: Array<string | RegExp>;
41
46
  }) => void;
42
47
  BrowserTracing: any;
43
48
  /**
@@ -100,6 +105,11 @@ interface SentryConfigProps<T> {
100
105
  * Enable debug mode.
101
106
  */
102
107
  debug?: boolean;
108
+ /**
109
+ * A pattern for error messages which should not be sent to Sentry.
110
+ * By default, all errors will be sent.
111
+ */
112
+ ignoreErrors?: Array<string | RegExp>;
103
113
  }
104
114
  /**
105
115
  * This component is used to initialize Sentry
@@ -111,8 +121,9 @@ interface SentryConfigProps<T> {
111
121
  * @param replaysSessionSampleRate
112
122
  * @param replaysOnErrorSampleRate
113
123
  * @param tracePropagationTargets
124
+ * @param ignoreErrors
114
125
  * @param debug
115
126
  * @constructor
116
127
  */
117
- declare const SentryConfig: <T extends unknown>({ dsn, sentry, integrations, tracesSampleRate, routingInstrumentationDependencies, replaysSessionSampleRate, replaysOnErrorSampleRate, tracePropagationTargets, debug, }: SentryConfigProps<T>) => null;
128
+ declare const SentryConfig: <T extends unknown>({ dsn, sentry, integrations, tracesSampleRate, routingInstrumentationDependencies, replaysSessionSampleRate, replaysOnErrorSampleRate, tracePropagationTargets, ignoreErrors, debug, }: SentryConfigProps<T>) => null;
118
129
  export default SentryConfig;
package/dist/main.js CHANGED
@@ -15,9 +15,9 @@ function yr() {
15
15
  return W;
16
16
  $e = 1;
17
17
  var n = Le, o = Symbol.for("react.element"), s = Symbol.for("react.fragment"), l = Object.prototype.hasOwnProperty, a = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, v = { key: !0, ref: !0, __self: !0, __source: !0 };
18
- function u(g, c, b) {
18
+ function u(g, c, y) {
19
19
  var h, C = {}, O = null, T = null;
20
- b !== void 0 && (O = "" + b), c.key !== void 0 && (O = "" + c.key), c.ref !== void 0 && (T = c.ref);
20
+ y !== void 0 && (O = "" + y), c.key !== void 0 && (O = "" + c.key), c.ref !== void 0 && (T = c.ref);
21
21
  for (h in c)
22
22
  l.call(c, h) && !v.hasOwnProperty(h) && (C[h] = c[h]);
23
23
  if (g && g.defaultProps)
@@ -40,7 +40,7 @@ var M = {};
40
40
  var Ie;
41
41
  function Rr() {
42
42
  return Ie || (Ie = 1, process.env.NODE_ENV !== "production" && function() {
43
- var n = Le, o = Symbol.for("react.element"), s = Symbol.for("react.portal"), l = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), g = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), b = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), O = Symbol.for("react.lazy"), T = Symbol.for("react.offscreen"), A = Symbol.iterator, D = "@@iterator";
43
+ var n = Le, o = Symbol.for("react.element"), s = Symbol.for("react.portal"), l = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), g = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), y = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), O = Symbol.for("react.lazy"), T = Symbol.for("react.offscreen"), A = Symbol.iterator, D = "@@iterator";
44
44
  function V(e) {
45
45
  if (e === null || typeof e != "object")
46
46
  return null;
@@ -48,7 +48,7 @@ function Rr() {
48
48
  return typeof r == "function" ? r : null;
49
49
  }
50
50
  var j = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
51
- function R(e) {
51
+ function b(e) {
52
52
  {
53
53
  for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), i = 1; i < r; i++)
54
54
  t[i - 1] = arguments[i];
@@ -68,7 +68,7 @@ function Rr() {
68
68
  var le = !1, ce = !1, Y = !1, Ne = !1, We = !1, fe;
69
69
  fe = Symbol.for("react.module.reference");
70
70
  function Me(e) {
71
- return !!(typeof e == "string" || typeof e == "function" || e === l || e === v || We || e === a || e === b || e === h || Ne || e === T || le || ce || Y || typeof e == "object" && e !== null && (e.$$typeof === O || e.$$typeof === C || e.$$typeof === u || e.$$typeof === g || e.$$typeof === c || // This needs to include all possible module reference object
71
+ return !!(typeof e == "string" || typeof e == "function" || e === l || e === v || We || e === a || e === y || e === h || Ne || e === T || le || ce || Y || typeof e == "object" && e !== null && (e.$$typeof === O || e.$$typeof === C || e.$$typeof === u || e.$$typeof === g || e.$$typeof === c || // This needs to include all possible module reference object
72
72
  // types supported by any Flight configuration anywhere since
73
73
  // we don't know which Flight build this will end up being used
74
74
  // with.
@@ -87,7 +87,7 @@ function Rr() {
87
87
  function P(e) {
88
88
  if (e == null)
89
89
  return null;
90
- if (typeof e.tag == "number" && R("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
90
+ 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")
91
91
  return e.displayName || e.name || null;
92
92
  if (typeof e == "string")
93
93
  return e;
@@ -100,7 +100,7 @@ function Rr() {
100
100
  return "Profiler";
101
101
  case a:
102
102
  return "StrictMode";
103
- case b:
103
+ case y:
104
104
  return "Suspense";
105
105
  case h:
106
106
  return "SuspenseList";
@@ -188,7 +188,7 @@ function Rr() {
188
188
  })
189
189
  });
190
190
  }
191
- L < 0 && R("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
191
+ L < 0 && b("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
192
192
  }
193
193
  }
194
194
  var K = j.ReactCurrentDispatcher, Z;
@@ -260,18 +260,18 @@ function Rr() {
260
260
  if (x && i && typeof x.stack == "string") {
261
261
  for (var f = x.stack.split(`
262
262
  `), w = i.stack.split(`
263
- `), E = f.length - 1, y = w.length - 1; E >= 1 && y >= 0 && f[E] !== w[y]; )
264
- y--;
265
- for (; E >= 1 && y >= 0; E--, y--)
266
- if (f[E] !== w[y]) {
267
- if (E !== 1 || y !== 1)
263
+ `), E = f.length - 1, R = w.length - 1; E >= 1 && R >= 0 && f[E] !== w[R]; )
264
+ R--;
265
+ for (; E >= 1 && R >= 0; E--, R--)
266
+ if (f[E] !== w[R]) {
267
+ if (E !== 1 || R !== 1)
268
268
  do
269
- if (E--, y--, y < 0 || f[E] !== w[y]) {
269
+ if (E--, R--, R < 0 || f[E] !== w[R]) {
270
270
  var S = `
271
271
  ` + f[E].replace(" at new ", " at ");
272
272
  return e.displayName && S.includes("<anonymous>") && (S = S.replace("<anonymous>", e.displayName)), typeof e == "function" && z.set(e, S), S;
273
273
  }
274
- while (E >= 1 && y >= 0);
274
+ while (E >= 1 && R >= 0);
275
275
  break;
276
276
  }
277
277
  }
@@ -296,7 +296,7 @@ function Rr() {
296
296
  if (typeof e == "string")
297
297
  return q(e);
298
298
  switch (e) {
299
- case b:
299
+ case y:
300
300
  return q("Suspense");
301
301
  case h:
302
302
  return q("SuspenseList");
@@ -340,7 +340,7 @@ function Rr() {
340
340
  } catch (E) {
341
341
  f = E;
342
342
  }
343
- f && !(f instanceof Error) && (G(p), R("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", i || "React class", t, d, typeof f), G(null)), f instanceof Error && !(f.message in _e) && (_e[f.message] = !0, G(p), R("Failed %s type: %s", t, f.message), G(null));
343
+ f && !(f instanceof Error) && (G(p), b("%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).", i || "React class", t, d, typeof f), G(null)), f instanceof Error && !(f.message in _e) && (_e[f.message] = !0, G(p), b("Failed %s type: %s", t, f.message), G(null));
344
344
  }
345
345
  }
346
346
  }
@@ -366,7 +366,7 @@ function Rr() {
366
366
  }
367
367
  function Te(e) {
368
368
  if (He(e))
369
- return R("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Xe(e)), Ce(e);
369
+ return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Xe(e)), Ce(e);
370
370
  }
371
371
  var N = j.ReactCurrentOwner, Ke = {
372
372
  key: !0,
@@ -394,13 +394,13 @@ function Rr() {
394
394
  function er(e, r) {
395
395
  if (typeof e.ref == "string" && N.current && r && N.current.stateNode !== r) {
396
396
  var t = P(N.current.type);
397
- re[t] || (R('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', P(N.current.type), e.ref), re[t] = !0);
397
+ re[t] || (b('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', P(N.current.type), e.ref), re[t] = !0);
398
398
  }
399
399
  }
400
400
  function rr(e, r) {
401
401
  {
402
402
  var t = function() {
403
- Oe || (Oe = !0, R("%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));
403
+ Oe || (Oe = !0, b("%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));
404
404
  };
405
405
  t.isReactWarning = !0, Object.defineProperty(e, "key", {
406
406
  get: t,
@@ -411,7 +411,7 @@ function Rr() {
411
411
  function tr(e, r) {
412
412
  {
413
413
  var t = function() {
414
- Se || (Se = !0, R("%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));
414
+ Se || (Se = !0, b("%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));
415
415
  };
416
416
  t.isReactWarning = !0, Object.defineProperty(e, "ref", {
417
417
  get: t,
@@ -460,8 +460,8 @@ function Rr() {
460
460
  d[m] === void 0 && (d[m] = E[m]);
461
461
  }
462
462
  if (f || w) {
463
- var y = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
464
- f && rr(d, y), w && tr(d, y);
463
+ var R = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
464
+ f && rr(d, R), w && tr(d, R);
465
465
  }
466
466
  return nr(e, f, w, p, i, N.current, d);
467
467
  }
@@ -525,7 +525,7 @@ Check the top-level render call using <` + t + ">.");
525
525
  return;
526
526
  xe[t] = !0;
527
527
  var i = "";
528
- e && e._owner && e._owner !== te.current && (i = " It was passed a child from " + P(e._owner.type) + "."), $(e), R('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, i), $(null);
528
+ e && e._owner && e._owner !== te.current && (i = " It was passed a child from " + P(e._owner.type) + "."), $(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.', t, i), $(null);
529
529
  }
530
530
  }
531
531
  function Ae(e, r) {
@@ -567,9 +567,9 @@ Check the top-level render call using <` + t + ">.");
567
567
  } else if (r.PropTypes !== void 0 && !ne) {
568
568
  ne = !0;
569
569
  var p = P(r);
570
- R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", p || "Unknown");
570
+ b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", p || "Unknown");
571
571
  }
572
- typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
572
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
573
573
  }
574
574
  }
575
575
  function ur(e) {
@@ -577,11 +577,11 @@ Check the top-level render call using <` + t + ">.");
577
577
  for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
578
578
  var i = r[t];
579
579
  if (i !== "children" && i !== "key") {
580
- $(e), R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", i), $(null);
580
+ $(e), b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", i), $(null);
581
581
  break;
582
582
  }
583
583
  }
584
- e.ref !== null && ($(e), R("Invalid attribute `ref` supplied to `React.Fragment`."), $(null));
584
+ e.ref !== null && ($(e), b("Invalid attribute `ref` supplied to `React.Fragment`."), $(null));
585
585
  }
586
586
  }
587
587
  function De(e, r, t, i, p, m) {
@@ -593,11 +593,11 @@ Check the top-level render call using <` + t + ">.");
593
593
  var w = or(p);
594
594
  w ? f += w : f += Pe();
595
595
  var E;
596
- e === null ? E = "null" : ee(e) ? E = "array" : e !== void 0 && e.$$typeof === o ? (E = "<" + (P(e.type) || "Unknown") + " />", f = " Did you accidentally export a JSX literal instead of a component?") : E = typeof e, R("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", E, f);
596
+ e === null ? E = "null" : ee(e) ? E = "array" : e !== void 0 && e.$$typeof === o ? (E = "<" + (P(e.type) || "Unknown") + " />", f = " Did you accidentally export a JSX literal instead of a component?") : E = 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", E, f);
597
597
  }
598
- var y = ar(e, r, t, p, m);
599
- if (y == null)
600
- return y;
598
+ var R = ar(e, r, t, p, m);
599
+ if (R == null)
600
+ return R;
601
601
  if (d) {
602
602
  var S = r.children;
603
603
  if (S !== void 0)
@@ -607,11 +607,11 @@ Check the top-level render call using <` + t + ">.");
607
607
  Ae(S[I], e);
608
608
  Object.freeze && Object.freeze(S);
609
609
  } else
610
- R("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
610
+ 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.");
611
611
  else
612
612
  Ae(S, e);
613
613
  }
614
- return e === l ? ur(y) : sr(y), y;
614
+ return e === l ? ur(R) : sr(R), R;
615
615
  }
616
616
  }
617
617
  function lr(e, r, t) {
@@ -664,13 +664,13 @@ const H = vr({
664
664
  redirect401Path: l = "/login",
665
665
  ...a
666
666
  }) => {
667
- var D, V, j, R;
667
+ var D, V, j, b;
668
668
  const {
669
669
  axios: v = a.axios,
670
670
  useLocation: u = a.useLocation,
671
671
  useAuth: g = a.useAuth,
672
672
  Outlet: c = a.Outlet,
673
- Navigate: b = a.Navigate
673
+ Navigate: y = a.Navigate
674
674
  } = ue(H);
675
675
  if (g === void 0)
676
676
  throw new Error(J("useAuth"));
@@ -678,7 +678,7 @@ const H = vr({
678
678
  throw new Error(J("useLocation"));
679
679
  if (c === void 0)
680
680
  throw new Error(J("Outlet"));
681
- if (b === void 0)
681
+ if (y === void 0)
682
682
  throw new Error(J("Navigate"));
683
683
  const [h, C] = pr(null), { isLogged: O } = g(), T = u(), A = gr(!1);
684
684
  return mr(() => {
@@ -689,7 +689,7 @@ const H = vr({
689
689
  return typeof _ == "object" && _ && "response" in _ && _.response && typeof _.response == "object" && "status" in _.response && _.response && typeof _.response == "object" && "status" in _.response && ((Y = _ == null ? void 0 : _.response) == null ? void 0 : Y.status) === 401 && (v.defaults.headers.common.Authorization = null, localStorage.removeItem(s), C(l)), Promise.reject(_);
690
690
  }
691
691
  ));
692
- }, [v == null ? void 0 : v.defaults.headers.common, v == null ? void 0 : v.interceptors.response, s, l]), O && !h ? /* @__PURE__ */ k.jsx(hr, { fallback: n, children: (V = (D = T.state) == null ? void 0 : D.from) != null && V.state && ((R = (j = T.state) == null ? void 0 : j.from) == null ? void 0 : R.pathname) === o ? /* @__PURE__ */ k.jsx(b, { to: T.state.from.state.from.pathname + T.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ k.jsx(c, {}) }) : /* @__PURE__ */ k.jsx(b, { to: o, state: { from: T }, replace: !0 });
692
+ }, [v == null ? void 0 : v.defaults.headers.common, v == null ? void 0 : v.interceptors.response, s, l]), O && !h ? /* @__PURE__ */ k.jsx(hr, { fallback: n, children: (V = (D = T.state) == null ? void 0 : D.from) != null && V.state && ((b = (j = T.state) == null ? void 0 : j.from) == null ? void 0 : b.pathname) === o ? /* @__PURE__ */ k.jsx(y, { to: T.state.from.state.from.pathname + T.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ k.jsx(c, {}) }) : /* @__PURE__ */ k.jsx(y, { to: o, state: { from: T }, replace: !0 });
693
693
  }, oe = (n) => `GTMSendPageView require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`, jr = ({ ...n }) => {
694
694
  const {
695
695
  useLocation: o = n.useLocation,
@@ -716,7 +716,7 @@ const H = vr({
716
716
  }) => {
717
717
  if (!n.defaults)
718
718
  return null;
719
- const u = localStorage.getItem(l), g = u ? JSON.parse(u) : null, c = g != null && g[s] ? g[s] : null, b = g != null && g[a] ? g[a] : null, h = u ? `${c} ${b}` : null;
719
+ const u = localStorage.getItem(l), g = u ? JSON.parse(u) : null, c = g != null && g[s] ? g[s] : null, y = g != null && g[a] ? g[a] : null, h = u ? `${c} ${y}` : null;
720
720
  return n.defaults.baseURL = o, n.defaults.headers.post["Content-Type"] = v, h && (n.defaults.headers.common.Authorization = h), null;
721
721
  }, xr = ({
722
722
  i18n: n,
@@ -750,10 +750,12 @@ const H = vr({
750
750
  replaysSessionSampleRate: v,
751
751
  replaysOnErrorSampleRate: u,
752
752
  tracePropagationTargets: g,
753
- debug: c
754
- }) => (o.isInitialized() || (c || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") && o.init({
755
- debug: c,
753
+ ignoreErrors: c,
754
+ debug: y
755
+ }) => (o.isInitialized() || (y || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") && o.init({
756
+ debug: y,
756
757
  dsn: n,
758
+ ignoreErrors: c || [/Failed to fetch dynamically imported module/],
757
759
  integrations: [
758
760
  new o.BrowserTracing({
759
761
  routingInstrumentation: o.reactRouterV6Instrumentation(
@@ -798,9 +800,9 @@ const H = vr({
798
800
  const { unknownErrorTranslationKey: o = "error.unknownError" } = n || {}, { translate: s = n == null ? void 0 : n.translate } = ue(H);
799
801
  return { printError: X(
800
802
  (a) => {
801
- var g, c, b, h, C, O, T, A, D;
803
+ var g, c, y, h, C, O, T, A, D;
802
804
  const v = s ? s(o) : "Unknown error", { response: u } = a || {};
803
- return a != null && a.reason ? String(a.reason) : (g = u == null ? void 0 : u.data) != null && g.reason ? String(u.data.reason) : (c = u == null ? void 0 : u.data) != null && c.message ? String(u.data.message) : (h = (b = u == null ? void 0 : u.data) == null ? void 0 : b.detail) != null && h.length && Array.isArray((C = u == null ? void 0 : u.data) == null ? void 0 : C.detail) && ((T = (O = u == null ? void 0 : u.data) == null ? void 0 : O.detail[0]) != null && T.msg) && typeof ((D = (A = u == null ? void 0 : u.data) == null ? void 0 : A.detail[0]) == null ? void 0 : D.msg) == "string" ? String(u.data.detail[0].msg) : v;
805
+ return a != null && a.reason ? String(a.reason) : (g = u == null ? void 0 : u.data) != null && g.reason ? String(u.data.reason) : (c = u == null ? void 0 : u.data) != null && c.message ? String(u.data.message) : (h = (y = u == null ? void 0 : u.data) == null ? void 0 : y.detail) != null && h.length && Array.isArray((C = u == null ? void 0 : u.data) == null ? void 0 : C.detail) && ((T = (O = u == null ? void 0 : u.data) == null ? void 0 : O.detail[0]) != null && T.msg) && typeof ((D = (A = u == null ? void 0 : u.data) == null ? void 0 : A.detail[0]) == null ? void 0 : D.msg) == "string" ? String(u.data.detail[0].msg) : v;
804
806
  },
805
807
  [s, o]
806
808
  ) };
@@ -819,7 +821,7 @@ const H = vr({
819
821
  [v, o, s]
820
822
  ), g = se(() => {
821
823
  if (n)
822
- return n.pages.reduce((c, b) => [...c, ...b], []);
824
+ return n.pages.reduce((c, y) => [...c, ...y], []);
823
825
  }, [n]);
824
826
  return {
825
827
  fetchNextPageOnRowsScrollEnd: u,
package/dist/main.umd.cjs CHANGED
@@ -1,4 +1,4 @@
1
- (function(R,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],m):(R=typeof globalThis<"u"?globalThis:R||self,m(R["@tracktor/shared-module"]={},R.React))})(this,function(R,m){"use strict";var $={exports:{}},W={};/**
1
+ (function(R,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],h):(R=typeof globalThis<"u"?globalThis:R||self,h(R["@tracktor/shared-module"]={},R.React))})(this,function(R,h){"use strict";var $={exports:{}},W={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -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 Le(){if(ue)return W;ue=1;var n=m,o=Symbol.for("react.element"),s=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,a=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,v={key:!0,ref:!0,__self:!0,__source:!0};function u(g,c,C){var E,O={},j=null,S=null;C!==void 0&&(j=""+C),c.key!==void 0&&(j=""+c.key),c.ref!==void 0&&(S=c.ref);for(E in c)l.call(c,E)&&!v.hasOwnProperty(E)&&(O[E]=c[E]);if(g&&g.defaultProps)for(E in c=g.defaultProps,c)O[E]===void 0&&(O[E]=c[E]);return{$$typeof:o,type:g,key:j,ref:S,props:O,_owner:a.current}}return W.Fragment=s,W.jsx=u,W.jsxs=u,W}var V={};/**
9
+ */var ue;function Le(){if(ue)return W;ue=1;var n=h,o=Symbol.for("react.element"),s=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,a=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,v={key:!0,ref:!0,__self:!0,__source:!0};function u(g,c,b){var E,O={},j=null,S=null;b!==void 0&&(j=""+b),c.key!==void 0&&(j=""+c.key),c.ref!==void 0&&(S=c.ref);for(E in c)l.call(c,E)&&!v.hasOwnProperty(E)&&(O[E]=c[E]);if(g&&g.defaultProps)for(E in c=g.defaultProps,c)O[E]===void 0&&(O[E]=c[E]);return{$$typeof:o,type:g,key:j,ref:S,props:O,_owner:a.current}}return W.Fragment=s,W.jsx=u,W.jsxs=u,W}var V={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,14 +14,14 @@
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 Me(){return le||(le=1,process.env.NODE_ENV!=="production"&&function(){var n=m,o=Symbol.for("react.element"),s=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),g=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),S=Symbol.for("react.offscreen"),F=Symbol.iterator,I="@@iterator";function G(e){if(e===null||typeof e!="object")return null;var r=F&&e[F]||e[I];return typeof r=="function"?r:null}var A=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),i=1;i<r;i++)t[i-1]=arguments[i];w("error",e,t)}}function w(e,r,t){{var i=A.ReactDebugCurrentFrame,p=i.getStackAddendum();p!==""&&(r+="%s",t=t.concat([p]));var h=t.map(function(d){return String(d)});h.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,h)}}var ce=!1,fe=!1,J=!1,rr=!1,tr=!1,de;de=Symbol.for("react.module.reference");function nr(e){return!!(typeof e=="string"||typeof e=="function"||e===l||e===v||tr||e===a||e===C||e===E||rr||e===S||ce||fe||J||typeof e=="object"&&e!==null&&(e.$$typeof===j||e.$$typeof===O||e.$$typeof===u||e.$$typeof===g||e.$$typeof===c||e.$$typeof===de||e.getModuleId!==void 0))}function ar(e,r,t){var i=e.displayName;if(i)return i;var p=r.displayName||r.name||"";return p!==""?t+"("+p+")":t}function ve(e){return e.displayName||"Context"}function x(e){if(e==null)return null;if(typeof e.tag=="number"&&_("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case l:return"Fragment";case s:return"Portal";case v:return"Profiler";case a:return"StrictMode";case C:return"Suspense";case E:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case g:var r=e;return ve(r)+".Consumer";case u:var t=e;return ve(t._context)+".Provider";case c:return ar(e,e.render,"ForwardRef");case O:var i=e.displayName||null;return i!==null?i:x(e.type)||"Memo";case j:{var p=e,h=p._payload,d=p._init;try{return x(d(h))}catch{return null}}}return null}var L=Object.assign,z=0,pe,ge,he,me,Ee,ye,Re;function be(){}be.__reactDisabledLog=!0;function or(){{if(z===0){pe=console.log,ge=console.info,he=console.warn,me=console.error,Ee=console.group,ye=console.groupCollapsed,Re=console.groupEnd;var e={configurable:!0,enumerable:!0,value:be,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}z++}}function ir(){{if(z--,z===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:L({},e,{value:pe}),info:L({},e,{value:ge}),warn:L({},e,{value:he}),error:L({},e,{value:me}),group:L({},e,{value:Ee}),groupCollapsed:L({},e,{value:ye}),groupEnd:L({},e,{value:Re})})}z<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ee=A.ReactCurrentDispatcher,re;function X(e,r,t){{if(re===void 0)try{throw Error()}catch(p){var i=p.stack.trim().match(/\n( *(at )?)/);re=i&&i[1]||""}return`
18
- `+re+e}}var te=!1,H;{var sr=typeof WeakMap=="function"?WeakMap:Map;H=new sr}function _e(e,r){if(!e||te)return"";{var t=H.get(e);if(t!==void 0)return t}var i;te=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var h;h=ee.current,ee.current=null,or();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){i=D}Reflect.construct(e,[],d)}else{try{d.call()}catch(D){i=D}e.call(d.prototype)}}else{try{throw Error()}catch(D){i=D}e()}}catch(D){if(D&&i&&typeof D.stack=="string"){for(var f=D.stack.split(`
17
+ */var le;function Me(){return le||(le=1,process.env.NODE_ENV!=="production"&&function(){var n=h,o=Symbol.for("react.element"),s=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),g=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),S=Symbol.for("react.offscreen"),F=Symbol.iterator,I="@@iterator";function G(e){if(e===null||typeof e!="object")return null;var r=F&&e[F]||e[I];return typeof r=="function"?r:null}var A=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function C(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),i=1;i<r;i++)t[i-1]=arguments[i];w("error",e,t)}}function w(e,r,t){{var i=A.ReactDebugCurrentFrame,p=i.getStackAddendum();p!==""&&(r+="%s",t=t.concat([p]));var m=t.map(function(d){return String(d)});m.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,m)}}var ce=!1,fe=!1,J=!1,rr=!1,tr=!1,de;de=Symbol.for("react.module.reference");function nr(e){return!!(typeof e=="string"||typeof e=="function"||e===l||e===v||tr||e===a||e===b||e===E||rr||e===S||ce||fe||J||typeof e=="object"&&e!==null&&(e.$$typeof===j||e.$$typeof===O||e.$$typeof===u||e.$$typeof===g||e.$$typeof===c||e.$$typeof===de||e.getModuleId!==void 0))}function ar(e,r,t){var i=e.displayName;if(i)return i;var p=r.displayName||r.name||"";return p!==""?t+"("+p+")":t}function ve(e){return e.displayName||"Context"}function x(e){if(e==null)return null;if(typeof e.tag=="number"&&C("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 l:return"Fragment";case s:return"Portal";case v:return"Profiler";case a:return"StrictMode";case b:return"Suspense";case E:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case g:var r=e;return ve(r)+".Consumer";case u:var t=e;return ve(t._context)+".Provider";case c:return ar(e,e.render,"ForwardRef");case O:var i=e.displayName||null;return i!==null?i:x(e.type)||"Memo";case j:{var p=e,m=p._payload,d=p._init;try{return x(d(m))}catch{return null}}}return null}var L=Object.assign,z=0,pe,ge,me,he,Ee,ye,Re;function be(){}be.__reactDisabledLog=!0;function or(){{if(z===0){pe=console.log,ge=console.info,me=console.warn,he=console.error,Ee=console.group,ye=console.groupCollapsed,Re=console.groupEnd;var e={configurable:!0,enumerable:!0,value:be,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}z++}}function ir(){{if(z--,z===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:L({},e,{value:pe}),info:L({},e,{value:ge}),warn:L({},e,{value:me}),error:L({},e,{value:he}),group:L({},e,{value:Ee}),groupCollapsed:L({},e,{value:ye}),groupEnd:L({},e,{value:Re})})}z<0&&C("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ee=A.ReactCurrentDispatcher,re;function X(e,r,t){{if(re===void 0)try{throw Error()}catch(p){var i=p.stack.trim().match(/\n( *(at )?)/);re=i&&i[1]||""}return`
18
+ `+re+e}}var te=!1,H;{var sr=typeof WeakMap=="function"?WeakMap:Map;H=new sr}function _e(e,r){if(!e||te)return"";{var t=H.get(e);if(t!==void 0)return t}var i;te=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var m;m=ee.current,ee.current=null,or();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){i=D}Reflect.construct(e,[],d)}else{try{d.call()}catch(D){i=D}e.call(d.prototype)}}else{try{throw Error()}catch(D){i=D}e()}}catch(D){if(D&&i&&typeof D.stack=="string"){for(var f=D.stack.split(`
19
19
  `),T=i.stack.split(`
20
- `),y=f.length-1,b=T.length-1;y>=1&&b>=0&&f[y]!==T[b];)b--;for(;y>=1&&b>=0;y--,b--)if(f[y]!==T[b]){if(y!==1||b!==1)do if(y--,b--,b<0||f[y]!==T[b]){var P=`
21
- `+f[y].replace(" at new "," at ");return e.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",e.displayName)),typeof e=="function"&&H.set(e,P),P}while(y>=1&&b>=0);break}}}finally{te=!1,ee.current=h,ir(),Error.prepareStackTrace=p}var N=e?e.displayName||e.name:"",Ie=N?X(N):"";return typeof e=="function"&&H.set(e,Ie),Ie}function ur(e,r,t){return _e(e,!1)}function lr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function K(e,r,t){if(e==null)return"";if(typeof e=="function")return _e(e,lr(e));if(typeof e=="string")return X(e);switch(e){case C:return X("Suspense");case E:return X("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case c:return ur(e.render);case O:return K(e.type,r,t);case j:{var i=e,p=i._payload,h=i._init;try{return K(h(p),r,t)}catch{}}}return""}var q=Object.prototype.hasOwnProperty,Ce={},we=A.ReactDebugCurrentFrame;function Z(e){if(e){var r=e._owner,t=K(e.type,e._source,r?r.type:null);we.setExtraStackFrame(t)}else we.setExtraStackFrame(null)}function cr(e,r,t,i,p){{var h=Function.call.bind(q);for(var d in e)if(h(e,d)){var f=void 0;try{if(typeof e[d]!="function"){var T=Error((i||"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 T.name="Invariant Violation",T}f=e[d](r,d,i,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(y){f=y}f&&!(f instanceof Error)&&(Z(p),_("%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).",i||"React class",t,d,typeof f),Z(null)),f instanceof Error&&!(f.message in Ce)&&(Ce[f.message]=!0,Z(p),_("Failed %s type: %s",t,f.message),Z(null))}}}var fr=Array.isArray;function ne(e){return fr(e)}function dr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function vr(e){try{return Te(e),!1}catch{return!0}}function Te(e){return""+e}function Oe(e){if(vr(e))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",dr(e)),Te(e)}var U=A.ReactCurrentOwner,pr={key:!0,ref:!0,__self:!0,__source:!0},Se,je,ae;ae={};function gr(e){if(q.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function hr(e){if(q.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function mr(e,r){if(typeof e.ref=="string"&&U.current&&r&&U.current.stateNode!==r){var t=x(U.current.type);ae[t]||(_('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',x(U.current.type),e.ref),ae[t]=!0)}}function Er(e,r){{var t=function(){Se||(Se=!0,_("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function yr(e,r){{var t=function(){je||(je=!0,_("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var Rr=function(e,r,t,i,p,h,d){var f={$$typeof:o,type:e,key:r,ref:t,props:d,_owner:h};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:i}),Object.defineProperty(f,"_source",{configurable:!1,enumerable:!1,writable:!1,value:p}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f};function br(e,r,t,i,p){{var h,d={},f=null,T=null;t!==void 0&&(Oe(t),f=""+t),hr(r)&&(Oe(r.key),f=""+r.key),gr(r)&&(T=r.ref,mr(r,p));for(h in r)q.call(r,h)&&!pr.hasOwnProperty(h)&&(d[h]=r[h]);if(e&&e.defaultProps){var y=e.defaultProps;for(h in y)d[h]===void 0&&(d[h]=y[h])}if(f||T){var b=typeof e=="function"?e.displayName||e.name||"Unknown":e;f&&Er(d,b),T&&yr(d,b)}return Rr(e,f,T,p,i,U.current,d)}}var oe=A.ReactCurrentOwner,Pe=A.ReactDebugCurrentFrame;function M(e){if(e){var r=e._owner,t=K(e.type,e._source,r?r.type:null);Pe.setExtraStackFrame(t)}else Pe.setExtraStackFrame(null)}var ie;ie=!1;function se(e){return typeof e=="object"&&e!==null&&e.$$typeof===o}function ke(){{if(oe.current){var e=x(oe.current.type);if(e)return`
20
+ `),y=f.length-1,_=T.length-1;y>=1&&_>=0&&f[y]!==T[_];)_--;for(;y>=1&&_>=0;y--,_--)if(f[y]!==T[_]){if(y!==1||_!==1)do if(y--,_--,_<0||f[y]!==T[_]){var P=`
21
+ `+f[y].replace(" at new "," at ");return e.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",e.displayName)),typeof e=="function"&&H.set(e,P),P}while(y>=1&&_>=0);break}}}finally{te=!1,ee.current=m,ir(),Error.prepareStackTrace=p}var N=e?e.displayName||e.name:"",Ie=N?X(N):"";return typeof e=="function"&&H.set(e,Ie),Ie}function ur(e,r,t){return _e(e,!1)}function lr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function K(e,r,t){if(e==null)return"";if(typeof e=="function")return _e(e,lr(e));if(typeof e=="string")return X(e);switch(e){case b:return X("Suspense");case E:return X("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case c:return ur(e.render);case O:return K(e.type,r,t);case j:{var i=e,p=i._payload,m=i._init;try{return K(m(p),r,t)}catch{}}}return""}var q=Object.prototype.hasOwnProperty,Ce={},we=A.ReactDebugCurrentFrame;function Z(e){if(e){var r=e._owner,t=K(e.type,e._source,r?r.type:null);we.setExtraStackFrame(t)}else we.setExtraStackFrame(null)}function cr(e,r,t,i,p){{var m=Function.call.bind(q);for(var d in e)if(m(e,d)){var f=void 0;try{if(typeof e[d]!="function"){var T=Error((i||"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 T.name="Invariant Violation",T}f=e[d](r,d,i,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(y){f=y}f&&!(f instanceof Error)&&(Z(p),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).",i||"React class",t,d,typeof f),Z(null)),f instanceof Error&&!(f.message in Ce)&&(Ce[f.message]=!0,Z(p),C("Failed %s type: %s",t,f.message),Z(null))}}}var fr=Array.isArray;function ne(e){return fr(e)}function dr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function vr(e){try{return Te(e),!1}catch{return!0}}function Te(e){return""+e}function Oe(e){if(vr(e))return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",dr(e)),Te(e)}var U=A.ReactCurrentOwner,pr={key:!0,ref:!0,__self:!0,__source:!0},Se,je,ae;ae={};function gr(e){if(q.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function mr(e){if(q.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function hr(e,r){if(typeof e.ref=="string"&&U.current&&r&&U.current.stateNode!==r){var t=x(U.current.type);ae[t]||(C('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',x(U.current.type),e.ref),ae[t]=!0)}}function Er(e,r){{var t=function(){Se||(Se=!0,C("%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 yr(e,r){{var t=function(){je||(je=!0,C("%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 Rr=function(e,r,t,i,p,m,d){var f={$$typeof:o,type:e,key:r,ref:t,props:d,_owner:m};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:i}),Object.defineProperty(f,"_source",{configurable:!1,enumerable:!1,writable:!1,value:p}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f};function br(e,r,t,i,p){{var m,d={},f=null,T=null;t!==void 0&&(Oe(t),f=""+t),mr(r)&&(Oe(r.key),f=""+r.key),gr(r)&&(T=r.ref,hr(r,p));for(m in r)q.call(r,m)&&!pr.hasOwnProperty(m)&&(d[m]=r[m]);if(e&&e.defaultProps){var y=e.defaultProps;for(m in y)d[m]===void 0&&(d[m]=y[m])}if(f||T){var _=typeof e=="function"?e.displayName||e.name||"Unknown":e;f&&Er(d,_),T&&yr(d,_)}return Rr(e,f,T,p,i,U.current,d)}}var oe=A.ReactCurrentOwner,Pe=A.ReactDebugCurrentFrame;function M(e){if(e){var r=e._owner,t=K(e.type,e._source,r?r.type:null);Pe.setExtraStackFrame(t)}else Pe.setExtraStackFrame(null)}var ie;ie=!1;function se(e){return typeof e=="object"&&e!==null&&e.$$typeof===o}function ke(){{if(oe.current){var e=x(oe.current.type);if(e)return`
22
22
 
23
23
  Check the render method of \``+e+"`."}return""}}function _r(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
24
24
 
25
25
  Check your code at `+r+":"+t+"."}return""}}var Ae={};function Cr(e){{var r=ke();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
26
26
 
27
- Check the top-level render call using <`+t+">.")}return r}}function xe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=Cr(r);if(Ae[t])return;Ae[t]=!0;var i="";e&&e._owner&&e._owner!==oe.current&&(i=" It was passed a child from "+x(e._owner.type)+"."),M(e),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,i),M(null)}}function De(e,r){{if(typeof e!="object")return;if(ne(e))for(var t=0;t<e.length;t++){var i=e[t];se(i)&&xe(i,r)}else if(se(e))e._store&&(e._store.validated=!0);else if(e){var p=G(e);if(typeof p=="function"&&p!==e.entries)for(var h=p.call(e),d;!(d=h.next()).done;)se(d.value)&&xe(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===O))t=r.propTypes;else return;if(t){var i=x(r);cr(t,e.props,"prop",i,e)}else if(r.PropTypes!==void 0&&!ie){ie=!0;var p=x(r);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",p||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Tr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var i=r[t];if(i!=="children"&&i!=="key"){M(e),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",i),M(null);break}}e.ref!==null&&(M(e),_("Invalid attribute `ref` supplied to `React.Fragment`."),M(null))}}function Fe(e,r,t,i,p,h){{var d=nr(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 T=_r(p);T?f+=T:f+=ke();var y;e===null?y="null":ne(e)?y="array":e!==void 0&&e.$$typeof===o?(y="<"+(x(e.type)||"Unknown")+" />",f=" Did you accidentally export a JSX literal instead of a component?"):y=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",y,f)}var b=br(e,r,t,p,h);if(b==null)return b;if(d){var P=r.children;if(P!==void 0)if(i)if(ne(P)){for(var N=0;N<P.length;N++)De(P[N],e);Object.freeze&&Object.freeze(P)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else De(P,e)}return e===l?Tr(b):wr(b),b}}function Or(e,r,t){return Fe(e,r,t,!0)}function Sr(e,r,t){return Fe(e,r,t,!1)}var jr=Sr,Pr=Or;V.Fragment=l,V.jsx=jr,V.jsxs=Pr}()),V}process.env.NODE_ENV==="production"?$.exports=Le():$.exports=Me();var k=$.exports;const Y=m.createContext({axios:void 0,children:void 0,Navigate:void 0,Outlet:void 0,translate:void 0,useAuth:void 0,useLocation:void 0}),Ne=({axios:n,children:o,translate:s,useAuth:l,Outlet:a,Navigate:v,useLocation:u,useGoogleTagManager:g})=>{const c=m.useMemo(()=>({axios:n,Navigate:v,Outlet:a,translate:s,useAuth:l,useGoogleTagManager:g,useLocation:u}),[v,a,n,s,l,g,u]);return k.jsx(Y.Provider,{value:c,children:o})},B=n=>`RequireAuth require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,We=({Fallback:n,loginPath:o="/login",localStorageKey:s="user",redirect401Path:l="/login",...a})=>{var I,G,A,_;const{axios:v=a.axios,useLocation:u=a.useLocation,useAuth:g=a.useAuth,Outlet:c=a.Outlet,Navigate:C=a.Navigate}=m.useContext(Y);if(g===void 0)throw new Error(B("useAuth"));if(u===void 0)throw new Error(B("useLocation"));if(c===void 0)throw new Error(B("Outlet"));if(C===void 0)throw new Error(B("Navigate"));const[E,O]=m.useState(null),{isLogged:j}=g(),S=u(),F=m.useRef(!1);return m.useLayoutEffect(()=>{F.current||(F.current=!0,v==null||v.interceptors.response.use(w=>w,async w=>{var J;return typeof w=="object"&&w&&"response"in w&&w.response&&typeof w.response=="object"&&"status"in w.response&&w.response&&typeof w.response=="object"&&"status"in w.response&&((J=w==null?void 0:w.response)==null?void 0:J.status)===401&&(v.defaults.headers.common.Authorization=null,localStorage.removeItem(s),O(l)),Promise.reject(w)}))},[v==null?void 0:v.defaults.headers.common,v==null?void 0:v.interceptors.response,s,l]),j&&!E?k.jsx(m.Suspense,{fallback:n,children:(G=(I=S.state)==null?void 0:I.from)!=null&&G.state&&((_=(A=S.state)==null?void 0:A.from)==null?void 0:_.pathname)===o?k.jsx(C,{to:S.state.from.state.from.pathname+S.state.from.state.from.search,replace:!0}):k.jsx(c,{})}):k.jsx(C,{to:o,state:{from:S},replace:!0})},Q=n=>`GTMSendPageView require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ve=({...n})=>{const{useLocation:o=n.useLocation,Outlet:s=n.Outlet,useGoogleTagManager:l=n.useGoogleTagManager}=m.useContext(Y);if(o===void 0)throw new Error(Q("useLocation"));if(s===void 0)throw new Error(Q("Outlet"));if(l===void 0)throw new Error(Q("useGoogleTagManager"));const{pathname:a}=o(),{sendEvent:v}=l();return m.useEffect(()=>{v({event:"pageView",pathname:a})},[a,v]),k.jsx(s,{})},Ye=({axios:n,baseURL:o,tokenTypeKey:s="tokenType",userLocalStorageKey:l="user",tokenKey:a="accessToken",postContentType:v="application/json"})=>{if(!n.defaults)return null;const u=localStorage.getItem(l),g=u?JSON.parse(u):null,c=g!=null&&g[s]?g[s]:null,C=g!=null&&g[a]?g[a]:null,E=u?`${c} ${C}`:null;return n.defaults.baseURL=o,n.defaults.headers.post["Content-Type"]=v,E&&(n.defaults.headers.common.Authorization=E),null},ze=({i18n:n,debug:o,initReactI18next:s,resources:l,LanguageDetector:a})=>(n!=null&&n.isInitialized||(n.use(a).use(s).init({debug:o,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:!1,useSuspense:!0},resources:l,returnNull:!1}).then(()=>{document.documentElement.lang!==n.resolvedLanguage&&n.resolvedLanguage&&document.documentElement.setAttribute("lang",n.resolvedLanguage)}),n.on("languageChanged",v=>{document.documentElement.setAttribute("lang",v)})),null),Ue=({dsn:n,sentry:o,integrations:s,tracesSampleRate:l,routingInstrumentationDependencies:a,replaysSessionSampleRate:v,replaysOnErrorSampleRate:u,tracePropagationTargets:g,debug:c})=>(o.isInitialized()||(c||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&o.init({debug:c,dsn:n,integrations:[new o.BrowserTracing({routingInstrumentation:o.reactRouterV6Instrumentation(a.useEffect,a.useLocation,a.useNavigationType,a.createRoutesFromChildren,a.matchRoutes)}),o.replayIntegration(),...s||[]],replaysOnErrorSampleRate:u||1,replaysSessionSampleRate:v||.1,tracePropagationTargets:g,tracesSampleRate:l||1}),null),Be=({IMaskMixin:n,...o})=>{const s=m.useMemo(()=>n(({TextField:l,...a})=>k.jsx(l,{...a})),[n]);return k.jsx(s,{...o})},Ge=({mapbox:n,accessToken:o})=>(n&&o&&(n.accessToken=o),null),Je=({children:n,defaultOptions:o,QueryClient:s,QueryClientProvider:l})=>{const a=new s({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:3,...o}}});return k.jsx(l,{client:a,children:n})},Xe=n=>{const{unknownErrorTranslationKey:o="error.unknownError"}=n||{},{translate:s=n==null?void 0:n.translate}=m.useContext(Y);return{printError:m.useCallback(a=>{var g,c,C,E,O,j,S,F,I;const v=s?s(o):"Unknown error",{response:u}=a||{};return a!=null&&a.reason?String(a.reason):(g=u==null?void 0:u.data)!=null&&g.reason?String(u.data.reason):(c=u==null?void 0:u.data)!=null&&c.message?String(u.data.message):(E=(C=u==null?void 0:u.data)==null?void 0:C.detail)!=null&&E.length&&Array.isArray((O=u==null?void 0:u.data)==null?void 0:O.detail)&&((S=(j=u==null?void 0:u.data)==null?void 0:j.detail[0])!=null&&S.msg)&&typeof((I=(F=u==null?void 0:u.data)==null?void 0:F.detail[0])==null?void 0:I.msg)=="string"?String(u.data.detail[0].msg):v},[s,o])}},He=({data:n,fetchNextPage:o,isFetchingNextPage:s,isInitialLoading:l,isLoading:a,enabled:v=!0})=>{const u=m.useCallback(async c=>{s||!v||await o({pageParam:(c==null?void 0:c.pageParam)||c.visibleRowsCount})},[v,o,s]),g=m.useMemo(()=>{if(n)return n.pages.reduce((c,C)=>[...c,...C],[])},[n]);return{fetchNextPageOnRowsScrollEnd:u,isLoading:s||a,loadingVariant:l?"skeleton":"linear",rows:g}},Ke=n=>{const o=m.useCallback(({tokenType:l,accessToken:a})=>{n.defaults.headers.common.Authorization=`${l} ${a}`},[n.defaults.headers.common]);return{clearAuthenticationToken:m.useCallback(()=>{n.defaults.headers.common.Authorization=null},[n.defaults.headers.common]),setAuthenticationToken:o}},qe=n=>n.charAt(0).toUpperCase()+n.slice(1).toLowerCase(),Ze=n=>{const l=n.split("/").filter(a=>a.length>0).map(a=>a.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(c=>c.charAt(0).toUpperCase()+c.slice(1)).join("")).join("");return l.charAt(0).toLowerCase()+l.slice(1)},$e=(n,o,s)=>{const l=Ze(o),a=qe(s);return`${l}${a}`},Qe=n=>{if(n)return(n==null?void 0:n.reduce((o,s)=>(o[s]={query:{useInfinite:!0,useInfiniteQueryParam:"offset"}},o),{}))||{}},er=n=>{const{input:o="./openapi.json",operationsToGenerateInfiniteQueryHook:s=void 0}=n||{};return{api:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:o,output:{client:"react-query",mode:"tags-split",override:{header:l=>["Generated by orval 🍺",...l.title?[l.title]:[],...l.description?[l.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/config/orval/mutator/axiosCustomInstance.ts`},operationName:$e,...(s==null?void 0:s.length)&&{operations:Qe(s)},query:{useQuery:!0}},schemas:"src/api/model",target:"src/api/services/api.ts"}}}};R.AxiosConfig=Ye,R.GTMSendPageView=Ve,R.I18nConfig=ze,R.InjectDependenciesContext=Y,R.InjectDependenciesProvider=Ne,R.MapBoxConfig=Ge,R.MaskTextField=Be,R.QueryClientConfigProvider=Je,R.RequireAuth=We,R.SentryConfig=Ue,R.getOrvalConfig=er,R.useAuth=Ke,R.useInfiniteDataGrid=He,R.useResponseError=Xe,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
27
+ Check the top-level render call using <`+t+">.")}return r}}function xe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=Cr(r);if(Ae[t])return;Ae[t]=!0;var i="";e&&e._owner&&e._owner!==oe.current&&(i=" It was passed a child from "+x(e._owner.type)+"."),M(e),C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,i),M(null)}}function De(e,r){{if(typeof e!="object")return;if(ne(e))for(var t=0;t<e.length;t++){var i=e[t];se(i)&&xe(i,r)}else if(se(e))e._store&&(e._store.validated=!0);else if(e){var p=G(e);if(typeof p=="function"&&p!==e.entries)for(var m=p.call(e),d;!(d=m.next()).done;)se(d.value)&&xe(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===O))t=r.propTypes;else return;if(t){var i=x(r);cr(t,e.props,"prop",i,e)}else if(r.PropTypes!==void 0&&!ie){ie=!0;var p=x(r);C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",p||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Tr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var i=r[t];if(i!=="children"&&i!=="key"){M(e),C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",i),M(null);break}}e.ref!==null&&(M(e),C("Invalid attribute `ref` supplied to `React.Fragment`."),M(null))}}function Fe(e,r,t,i,p,m){{var d=nr(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 T=_r(p);T?f+=T:f+=ke();var y;e===null?y="null":ne(e)?y="array":e!==void 0&&e.$$typeof===o?(y="<"+(x(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)}var _=br(e,r,t,p,m);if(_==null)return _;if(d){var P=r.children;if(P!==void 0)if(i)if(ne(P)){for(var N=0;N<P.length;N++)De(P[N],e);Object.freeze&&Object.freeze(P)}else C("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 De(P,e)}return e===l?Tr(_):wr(_),_}}function Or(e,r,t){return Fe(e,r,t,!0)}function Sr(e,r,t){return Fe(e,r,t,!1)}var jr=Sr,Pr=Or;V.Fragment=l,V.jsx=jr,V.jsxs=Pr}()),V}process.env.NODE_ENV==="production"?$.exports=Le():$.exports=Me();var k=$.exports;const Y=h.createContext({axios:void 0,children:void 0,Navigate:void 0,Outlet:void 0,translate:void 0,useAuth:void 0,useLocation:void 0}),Ne=({axios:n,children:o,translate:s,useAuth:l,Outlet:a,Navigate:v,useLocation:u,useGoogleTagManager:g})=>{const c=h.useMemo(()=>({axios:n,Navigate:v,Outlet:a,translate:s,useAuth:l,useGoogleTagManager:g,useLocation:u}),[v,a,n,s,l,g,u]);return k.jsx(Y.Provider,{value:c,children:o})},B=n=>`RequireAuth require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,We=({Fallback:n,loginPath:o="/login",localStorageKey:s="user",redirect401Path:l="/login",...a})=>{var I,G,A,C;const{axios:v=a.axios,useLocation:u=a.useLocation,useAuth:g=a.useAuth,Outlet:c=a.Outlet,Navigate:b=a.Navigate}=h.useContext(Y);if(g===void 0)throw new Error(B("useAuth"));if(u===void 0)throw new Error(B("useLocation"));if(c===void 0)throw new Error(B("Outlet"));if(b===void 0)throw new Error(B("Navigate"));const[E,O]=h.useState(null),{isLogged:j}=g(),S=u(),F=h.useRef(!1);return h.useLayoutEffect(()=>{F.current||(F.current=!0,v==null||v.interceptors.response.use(w=>w,async w=>{var J;return typeof w=="object"&&w&&"response"in w&&w.response&&typeof w.response=="object"&&"status"in w.response&&w.response&&typeof w.response=="object"&&"status"in w.response&&((J=w==null?void 0:w.response)==null?void 0:J.status)===401&&(v.defaults.headers.common.Authorization=null,localStorage.removeItem(s),O(l)),Promise.reject(w)}))},[v==null?void 0:v.defaults.headers.common,v==null?void 0:v.interceptors.response,s,l]),j&&!E?k.jsx(h.Suspense,{fallback:n,children:(G=(I=S.state)==null?void 0:I.from)!=null&&G.state&&((C=(A=S.state)==null?void 0:A.from)==null?void 0:C.pathname)===o?k.jsx(b,{to:S.state.from.state.from.pathname+S.state.from.state.from.search,replace:!0}):k.jsx(c,{})}):k.jsx(b,{to:o,state:{from:S},replace:!0})},Q=n=>`GTMSendPageView require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ve=({...n})=>{const{useLocation:o=n.useLocation,Outlet:s=n.Outlet,useGoogleTagManager:l=n.useGoogleTagManager}=h.useContext(Y);if(o===void 0)throw new Error(Q("useLocation"));if(s===void 0)throw new Error(Q("Outlet"));if(l===void 0)throw new Error(Q("useGoogleTagManager"));const{pathname:a}=o(),{sendEvent:v}=l();return h.useEffect(()=>{v({event:"pageView",pathname:a})},[a,v]),k.jsx(s,{})},Ye=({axios:n,baseURL:o,tokenTypeKey:s="tokenType",userLocalStorageKey:l="user",tokenKey:a="accessToken",postContentType:v="application/json"})=>{if(!n.defaults)return null;const u=localStorage.getItem(l),g=u?JSON.parse(u):null,c=g!=null&&g[s]?g[s]:null,b=g!=null&&g[a]?g[a]:null,E=u?`${c} ${b}`:null;return n.defaults.baseURL=o,n.defaults.headers.post["Content-Type"]=v,E&&(n.defaults.headers.common.Authorization=E),null},ze=({i18n:n,debug:o,initReactI18next:s,resources:l,LanguageDetector:a})=>(n!=null&&n.isInitialized||(n.use(a).use(s).init({debug:o,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:!1,useSuspense:!0},resources:l,returnNull:!1}).then(()=>{document.documentElement.lang!==n.resolvedLanguage&&n.resolvedLanguage&&document.documentElement.setAttribute("lang",n.resolvedLanguage)}),n.on("languageChanged",v=>{document.documentElement.setAttribute("lang",v)})),null),Ue=({dsn:n,sentry:o,integrations:s,tracesSampleRate:l,routingInstrumentationDependencies:a,replaysSessionSampleRate:v,replaysOnErrorSampleRate:u,tracePropagationTargets:g,ignoreErrors:c,debug:b})=>(o.isInitialized()||(b||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&o.init({debug:b,dsn:n,ignoreErrors:c||[/Failed to fetch dynamically imported module/],integrations:[new o.BrowserTracing({routingInstrumentation:o.reactRouterV6Instrumentation(a.useEffect,a.useLocation,a.useNavigationType,a.createRoutesFromChildren,a.matchRoutes)}),o.replayIntegration(),...s||[]],replaysOnErrorSampleRate:u||1,replaysSessionSampleRate:v||.1,tracePropagationTargets:g,tracesSampleRate:l||1}),null),Be=({IMaskMixin:n,...o})=>{const s=h.useMemo(()=>n(({TextField:l,...a})=>k.jsx(l,{...a})),[n]);return k.jsx(s,{...o})},Ge=({mapbox:n,accessToken:o})=>(n&&o&&(n.accessToken=o),null),Je=({children:n,defaultOptions:o,QueryClient:s,QueryClientProvider:l})=>{const a=new s({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:3,...o}}});return k.jsx(l,{client:a,children:n})},Xe=n=>{const{unknownErrorTranslationKey:o="error.unknownError"}=n||{},{translate:s=n==null?void 0:n.translate}=h.useContext(Y);return{printError:h.useCallback(a=>{var g,c,b,E,O,j,S,F,I;const v=s?s(o):"Unknown error",{response:u}=a||{};return a!=null&&a.reason?String(a.reason):(g=u==null?void 0:u.data)!=null&&g.reason?String(u.data.reason):(c=u==null?void 0:u.data)!=null&&c.message?String(u.data.message):(E=(b=u==null?void 0:u.data)==null?void 0:b.detail)!=null&&E.length&&Array.isArray((O=u==null?void 0:u.data)==null?void 0:O.detail)&&((S=(j=u==null?void 0:u.data)==null?void 0:j.detail[0])!=null&&S.msg)&&typeof((I=(F=u==null?void 0:u.data)==null?void 0:F.detail[0])==null?void 0:I.msg)=="string"?String(u.data.detail[0].msg):v},[s,o])}},He=({data:n,fetchNextPage:o,isFetchingNextPage:s,isInitialLoading:l,isLoading:a,enabled:v=!0})=>{const u=h.useCallback(async c=>{s||!v||await o({pageParam:(c==null?void 0:c.pageParam)||c.visibleRowsCount})},[v,o,s]),g=h.useMemo(()=>{if(n)return n.pages.reduce((c,b)=>[...c,...b],[])},[n]);return{fetchNextPageOnRowsScrollEnd:u,isLoading:s||a,loadingVariant:l?"skeleton":"linear",rows:g}},Ke=n=>{const o=h.useCallback(({tokenType:l,accessToken:a})=>{n.defaults.headers.common.Authorization=`${l} ${a}`},[n.defaults.headers.common]);return{clearAuthenticationToken:h.useCallback(()=>{n.defaults.headers.common.Authorization=null},[n.defaults.headers.common]),setAuthenticationToken:o}},qe=n=>n.charAt(0).toUpperCase()+n.slice(1).toLowerCase(),Ze=n=>{const l=n.split("/").filter(a=>a.length>0).map(a=>a.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(c=>c.charAt(0).toUpperCase()+c.slice(1)).join("")).join("");return l.charAt(0).toLowerCase()+l.slice(1)},$e=(n,o,s)=>{const l=Ze(o),a=qe(s);return`${l}${a}`},Qe=n=>{if(n)return(n==null?void 0:n.reduce((o,s)=>(o[s]={query:{useInfinite:!0,useInfiniteQueryParam:"offset"}},o),{}))||{}},er=n=>{const{input:o="./openapi.json",operationsToGenerateInfiniteQueryHook:s=void 0}=n||{};return{api:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:o,output:{client:"react-query",mode:"tags-split",override:{header:l=>["Generated by orval 🍺",...l.title?[l.title]:[],...l.description?[l.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/config/orval/mutator/axiosCustomInstance.ts`},operationName:$e,...(s==null?void 0:s.length)&&{operations:Qe(s)},query:{useQuery:!0}},schemas:"src/api/model",target:"src/api/services/api.ts"}}}};R.AxiosConfig=Ye,R.GTMSendPageView=Ve,R.I18nConfig=ze,R.InjectDependenciesContext=Y,R.InjectDependenciesProvider=Ne,R.MapBoxConfig=Ge,R.MaskTextField=Be,R.QueryClientConfigProvider=Je,R.RequireAuth=We,R.SentryConfig=Ue,R.getOrvalConfig=er,R.useAuth=Ke,R.useInfiniteDataGrid=He,R.useResponseError=Xe,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tracktor/shared-module",
3
- "version": "0.15.11",
3
+ "version": "0.16.0",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "types": "./dist/main.d.ts",