@tracktor/shared-module 0.2.1 → 0.3.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/react-google-tag-manager/releases)
2
2
 
3
- ## v0.2.1
4
- - **[fix]** : `printError` inside `useResponseError`
3
+ ## v0.3.0
4
+ - **[feat]** : Add GTMSendPageView
@@ -0,0 +1,8 @@
1
+ import { InjectDependenciesContextProps } from '../../context/InjectDependenciesProvider';
2
+ export interface GTMSendPageViewProps {
3
+ useGoogleTagManager?: InjectDependenciesContextProps["useGoogleTagManager"];
4
+ Outlet?: InjectDependenciesContextProps["Outlet"];
5
+ useLocation?: InjectDependenciesContextProps["useLocation"];
6
+ }
7
+ declare const GTMSendPageView: ({ ...props }: GTMSendPageViewProps) => JSX.Element;
8
+ export default GTMSendPageView;
@@ -0,0 +1,3 @@
1
+ import GTMSendPageView from "./GTMSendPageView";
2
+ export default GTMSendPageView;
3
+ export * from "./GTMSendPageView";
@@ -1,25 +1,12 @@
1
- import { ReactElement, ReactNode } from "react";
2
- interface NavigateProps {
3
- to: string;
4
- replace?: boolean;
5
- state?: any;
6
- }
7
- interface Location {
8
- state: any;
9
- }
10
- interface Auth {
11
- isLogged: boolean;
12
- }
13
- interface OutletProps {
14
- context?: unknown;
15
- }
1
+ import { ReactNode } from "react";
2
+ import { InjectDependenciesContextProps } from '../../context/InjectDependenciesProvider';
16
3
  export interface RequireAuthProps {
17
- Outlet?: (props: OutletProps) => ReactElement | null;
18
- Navigate?: (props: NavigateProps) => null;
19
4
  loginPath?: string;
20
5
  Fallback?: ReactNode;
21
- useLocation?(): Location;
22
- useAuth?(): Auth;
6
+ Outlet?: InjectDependenciesContextProps["Outlet"];
7
+ Navigate?: InjectDependenciesContextProps["Navigate"];
8
+ useLocation?: InjectDependenciesContextProps["useLocation"];
9
+ useAuth?: InjectDependenciesContextProps["useAuth"];
23
10
  }
24
11
  /**
25
12
  * RequireAuth component for protected routing
@@ -1,6 +1,4 @@
1
- import { ReactNode } from "react";
2
- import type { RequireAuthProps } from '../components/RequireAuth';
3
- import type { useResponseErrorParams } from '../hooks/useResponseError';
1
+ import { ReactElement, ReactNode } from "react";
4
2
  export interface InjectDependenciesContextProps {
5
3
  /**
6
4
  * Children
@@ -10,24 +8,44 @@ export interface InjectDependenciesContextProps {
10
8
  * Translate function dependency for useResponseError hook
11
9
  * @param str
12
10
  */
13
- translate?: useResponseErrorParams["translate"];
11
+ translate?(str: string): string;
14
12
  /**
15
13
  * Outlet dependency for RequireAuth component
16
14
  */
17
- Outlet?: RequireAuthProps["Outlet"];
15
+ Outlet?(props: {
16
+ context?: unknown;
17
+ }): ReactElement | null;
18
18
  /**
19
19
  * Navigate dependency for RequireAuth component
20
20
  */
21
- Navigate?: RequireAuthProps["Navigate"];
21
+ Navigate?(props: {
22
+ to: string;
23
+ replace?: boolean;
24
+ state?: any;
25
+ }): null;
22
26
  /**
23
27
  * useLocation dependency for RequireAuth component
24
28
  */
25
- useLocation?: RequireAuthProps["useLocation"];
29
+ useLocation?(): {
30
+ state: any;
31
+ pathname: string;
32
+ };
26
33
  /**
27
34
  * useAuth dependency for RequireAuth component
28
35
  */
29
- useAuth?: RequireAuthProps["useAuth"];
36
+ useAuth?(): {
37
+ isLogged: boolean;
38
+ };
39
+ /**
40
+ * useGoogleTagManager dependency for GTMSendPageView component
41
+ */
42
+ useGoogleTagManager?(): {
43
+ sendEvent: (event: {
44
+ event: string;
45
+ pathname: string;
46
+ }) => void;
47
+ };
30
48
  }
31
49
  export declare const InjectDependenciesContext: import("react").Context<InjectDependenciesContextProps>;
32
- declare const InjectDependenciesProvider: ({ children, translate, useAuth, Outlet, Navigate, useLocation }: InjectDependenciesContextProps) => JSX.Element;
50
+ declare const InjectDependenciesProvider: ({ children, translate, useAuth, Outlet, Navigate, useLocation, useGoogleTagManager, }: InjectDependenciesContextProps) => JSX.Element;
33
51
  export default InjectDependenciesProvider;
@@ -1,3 +1,4 @@
1
+ import { InjectDependenciesContextProps } from '../../context/InjectDependenciesProvider';
1
2
  export interface ResponseError {
2
3
  data?: {
3
4
  code?: number;
@@ -16,7 +17,7 @@ export interface useResponseErrorParams {
16
17
  * Translation function if you want to use your own translation function
17
18
  * @param str
18
19
  */
19
- translate?: (str: string) => string;
20
+ translate?: InjectDependenciesContextProps["translate"];
20
21
  /**
21
22
  * Translation key returned for the unknown error
22
23
  */
package/dist/main.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  export { default as RequireAuth } from './components/RequireAuth';
2
2
  export * from './components/RequireAuth';
3
+ export { default as GTMSendPageView } from './components/GTMSendPageView';
4
+ export * from './components/GTMSendPageView';
3
5
  export { default as InjectDependenciesProvider } from './context/InjectDependenciesProvider';
4
6
  export * from './context/InjectDependenciesProvider';
5
7
  export { default as useResponseError } from './hooks/useResponseError';
package/dist/main.js CHANGED
@@ -1,12 +1,12 @@
1
- import Pe, { createContext as lr, useMemo as cr, useContext as xe, Suspense as dr, useCallback as vr } from "react";
2
- var ee = {}, pr = {
1
+ import je, { createContext as lr, useMemo as dr, useContext as ne, Suspense as vr, useEffect as pr, useCallback as gr } from "react";
2
+ var te = {}, hr = {
3
3
  get exports() {
4
- return ee;
4
+ return te;
5
5
  },
6
- set exports(d) {
7
- ee = d;
6
+ set exports(f) {
7
+ te = f;
8
8
  }
9
- }, $ = {};
9
+ }, L = {};
10
10
  /**
11
11
  * @license React
12
12
  * react-jsx-runtime.production.min.js
@@ -16,25 +16,25 @@ var ee = {}, pr = {
16
16
  * This source code is licensed under the MIT license found in the
17
17
  * LICENSE file in the root directory of this source tree.
18
18
  */
19
- var Ce;
20
- function gr() {
21
- if (Ce)
22
- return $;
23
- Ce = 1;
24
- var d = Pe, y = Symbol.for("react.element"), g = Symbol.for("react.fragment"), b = Object.prototype.hasOwnProperty, p = d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, _ = { key: !0, ref: !0, __self: !0, __source: !0 };
25
- function i(T, f, w) {
26
- var v, h = {}, R = null, P = null;
27
- w !== void 0 && (R = "" + w), f.key !== void 0 && (R = "" + f.key), f.ref !== void 0 && (P = f.ref);
28
- for (v in f)
29
- b.call(f, v) && !_.hasOwnProperty(v) && (h[v] = f[v]);
30
- if (T && T.defaultProps)
31
- for (v in f = T.defaultProps, f)
32
- h[v] === void 0 && (h[v] = f[v]);
33
- return { $$typeof: y, type: T, key: R, ref: P, props: h, _owner: p.current };
19
+ var Pe;
20
+ function Er() {
21
+ if (Pe)
22
+ return L;
23
+ Pe = 1;
24
+ var f = je, h = Symbol.for("react.element"), g = Symbol.for("react.fragment"), E = Object.prototype.hasOwnProperty, v = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, m = { key: !0, ref: !0, __self: !0, __source: !0 };
25
+ function o(_, c, T) {
26
+ var p, y = {}, w = null, P = null;
27
+ T !== void 0 && (w = "" + T), c.key !== void 0 && (w = "" + c.key), c.ref !== void 0 && (P = c.ref);
28
+ for (p in c)
29
+ E.call(c, p) && !m.hasOwnProperty(p) && (y[p] = c[p]);
30
+ if (_ && _.defaultProps)
31
+ for (p in c = _.defaultProps, c)
32
+ y[p] === void 0 && (y[p] = c[p]);
33
+ return { $$typeof: h, type: _, key: w, ref: P, props: y, _owner: v.current };
34
34
  }
35
- return $.Fragment = g, $.jsx = i, $.jsxs = i, $;
35
+ return L.Fragment = g, L.jsx = o, L.jsxs = o, L;
36
36
  }
37
- var W = {};
37
+ var Y = {};
38
38
  /**
39
39
  * @license React
40
40
  * react-jsx-runtime.development.js
@@ -44,91 +44,91 @@ var W = {};
44
44
  * This source code is licensed under the MIT license found in the
45
45
  * LICENSE file in the root directory of this source tree.
46
46
  */
47
- var Se;
48
- function hr() {
49
- return Se || (Se = 1, process.env.NODE_ENV !== "production" && function() {
50
- var d = Pe, y = Symbol.for("react.element"), g = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), p = Symbol.for("react.strict_mode"), _ = Symbol.for("react.profiler"), i = Symbol.for("react.provider"), T = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), R = Symbol.for("react.lazy"), P = Symbol.for("react.offscreen"), D = Symbol.iterator, L = "@@iterator";
51
- function je(e) {
47
+ var xe;
48
+ function mr() {
49
+ return xe || (xe = 1, process.env.NODE_ENV !== "production" && function() {
50
+ var f = je, h = Symbol.for("react.element"), g = Symbol.for("react.portal"), E = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), m = Symbol.for("react.profiler"), o = Symbol.for("react.provider"), _ = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), T = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), y = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), P = Symbol.for("react.offscreen"), F = Symbol.iterator, W = "@@iterator";
51
+ function ke(e) {
52
52
  if (e === null || typeof e != "object")
53
53
  return null;
54
- var r = D && e[D] || e[L];
54
+ var r = F && e[F] || e[W];
55
55
  return typeof r == "function" ? r : null;
56
56
  }
57
- var j = d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
58
- function E(e) {
57
+ var j = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
58
+ function b(e) {
59
59
  {
60
60
  for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
61
61
  t[n - 1] = arguments[n];
62
- ke("error", e, t);
62
+ De("error", e, t);
63
63
  }
64
64
  }
65
- function ke(e, r, t) {
65
+ function De(e, r, t) {
66
66
  {
67
67
  var n = j.ReactDebugCurrentFrame, u = n.getStackAddendum();
68
68
  u !== "" && (r += "%s", t = t.concat([u]));
69
- var s = t.map(function(o) {
70
- return String(o);
69
+ var s = t.map(function(i) {
70
+ return String(i);
71
71
  });
72
72
  s.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, s);
73
73
  }
74
74
  }
75
- var Ae = !1, De = !1, Fe = !1, Ie = !1, $e = !1, te;
76
- te = Symbol.for("react.module.reference");
77
- function We(e) {
78
- return !!(typeof e == "string" || typeof e == "function" || e === b || e === _ || $e || e === p || e === w || e === v || Ie || e === P || Ae || De || Fe || typeof e == "object" && e !== null && (e.$$typeof === R || e.$$typeof === h || e.$$typeof === i || e.$$typeof === T || e.$$typeof === f || // This needs to include all possible module reference object
75
+ var Ae = !1, Fe = !1, Ie = !1, $e = !1, Le = !1, ae;
76
+ ae = Symbol.for("react.module.reference");
77
+ function Ye(e) {
78
+ return !!(typeof e == "string" || typeof e == "function" || e === E || e === m || Le || e === v || e === T || e === p || $e || e === P || Ae || Fe || Ie || typeof e == "object" && e !== null && (e.$$typeof === w || e.$$typeof === y || e.$$typeof === o || e.$$typeof === _ || e.$$typeof === c || // This needs to include all possible module reference object
79
79
  // types supported by any Flight configuration anywhere since
80
80
  // we don't know which Flight build this will end up being used
81
81
  // with.
82
- e.$$typeof === te || e.getModuleId !== void 0));
82
+ e.$$typeof === ae || e.getModuleId !== void 0));
83
83
  }
84
- function Ye(e, r, t) {
84
+ function We(e, r, t) {
85
85
  var n = e.displayName;
86
86
  if (n)
87
87
  return n;
88
88
  var u = r.displayName || r.name || "";
89
89
  return u !== "" ? t + "(" + u + ")" : t;
90
90
  }
91
- function ne(e) {
91
+ function oe(e) {
92
92
  return e.displayName || "Context";
93
93
  }
94
- function C(e) {
94
+ function S(e) {
95
95
  if (e == null)
96
96
  return null;
97
- if (typeof e.tag == "number" && E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
97
+ 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")
98
98
  return e.displayName || e.name || null;
99
99
  if (typeof e == "string")
100
100
  return e;
101
101
  switch (e) {
102
- case b:
102
+ case E:
103
103
  return "Fragment";
104
104
  case g:
105
105
  return "Portal";
106
- case _:
106
+ case m:
107
107
  return "Profiler";
108
- case p:
108
+ case v:
109
109
  return "StrictMode";
110
- case w:
110
+ case T:
111
111
  return "Suspense";
112
- case v:
112
+ case p:
113
113
  return "SuspenseList";
114
114
  }
115
115
  if (typeof e == "object")
116
116
  switch (e.$$typeof) {
117
- case T:
117
+ case _:
118
118
  var r = e;
119
- return ne(r) + ".Consumer";
120
- case i:
119
+ return oe(r) + ".Consumer";
120
+ case o:
121
121
  var t = e;
122
- return ne(t._context) + ".Provider";
123
- case f:
124
- return Ye(e, e.render, "ForwardRef");
125
- case h:
122
+ return oe(t._context) + ".Provider";
123
+ case c:
124
+ return We(e, e.render, "ForwardRef");
125
+ case y:
126
126
  var n = e.displayName || null;
127
- return n !== null ? n : C(e.type) || "Memo";
128
- case R: {
129
- var u = e, s = u._payload, o = u._init;
127
+ return n !== null ? n : S(e.type) || "Memo";
128
+ case w: {
129
+ var u = e, s = u._payload, i = u._init;
130
130
  try {
131
- return C(o(s));
131
+ return S(i(s));
132
132
  } catch {
133
133
  return null;
134
134
  }
@@ -136,18 +136,18 @@ function hr() {
136
136
  }
137
137
  return null;
138
138
  }
139
- var x = Object.assign, F = 0, ae, oe, ie, ue, se, fe, le;
140
- function ce() {
139
+ var x = Object.assign, I = 0, ie, ue, se, fe, ce, le, de;
140
+ function ve() {
141
141
  }
142
- ce.__reactDisabledLog = !0;
143
- function Le() {
142
+ ve.__reactDisabledLog = !0;
143
+ function Me() {
144
144
  {
145
- if (F === 0) {
146
- ae = console.log, oe = console.info, ie = console.warn, ue = console.error, se = console.group, fe = console.groupCollapsed, le = console.groupEnd;
145
+ if (I === 0) {
146
+ ie = console.log, ue = console.info, se = console.warn, fe = console.error, ce = console.group, le = console.groupCollapsed, de = console.groupEnd;
147
147
  var e = {
148
148
  configurable: !0,
149
149
  enumerable: !0,
150
- value: ce,
150
+ value: ve,
151
151
  writable: !0
152
152
  };
153
153
  Object.defineProperties(console, {
@@ -160,12 +160,12 @@ function hr() {
160
160
  groupEnd: e
161
161
  });
162
162
  }
163
- F++;
163
+ I++;
164
164
  }
165
165
  }
166
166
  function Ne() {
167
167
  {
168
- if (F--, F === 0) {
168
+ if (I--, I === 0) {
169
169
  var e = {
170
170
  configurable: !0,
171
171
  enumerable: !0,
@@ -173,186 +173,186 @@ function hr() {
173
173
  };
174
174
  Object.defineProperties(console, {
175
175
  log: x({}, e, {
176
- value: ae
176
+ value: ie
177
177
  }),
178
178
  info: x({}, e, {
179
- value: oe
179
+ value: ue
180
180
  }),
181
181
  warn: x({}, e, {
182
- value: ie
182
+ value: se
183
183
  }),
184
184
  error: x({}, e, {
185
- value: ue
185
+ value: fe
186
186
  }),
187
187
  group: x({}, e, {
188
- value: se
188
+ value: ce
189
189
  }),
190
190
  groupCollapsed: x({}, e, {
191
- value: fe
191
+ value: le
192
192
  }),
193
193
  groupEnd: x({}, e, {
194
- value: le
194
+ value: de
195
195
  })
196
196
  });
197
197
  }
198
- F < 0 && E("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
198
+ I < 0 && b("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
199
199
  }
200
200
  }
201
- var J = j.ReactCurrentDispatcher, G;
202
- function N(e, r, t) {
201
+ var J = j.ReactCurrentDispatcher, z;
202
+ function M(e, r, t) {
203
203
  {
204
- if (G === void 0)
204
+ if (z === void 0)
205
205
  try {
206
206
  throw Error();
207
207
  } catch (u) {
208
208
  var n = u.stack.trim().match(/\n( *(at )?)/);
209
- G = n && n[1] || "";
209
+ z = n && n[1] || "";
210
210
  }
211
211
  return `
212
- ` + G + e;
212
+ ` + z + e;
213
213
  }
214
214
  }
215
- var z = !1, M;
215
+ var K = !1, N;
216
216
  {
217
- var Me = typeof WeakMap == "function" ? WeakMap : Map;
218
- M = new Me();
217
+ var Ve = typeof WeakMap == "function" ? WeakMap : Map;
218
+ N = new Ve();
219
219
  }
220
- function de(e, r) {
221
- if (!e || z)
220
+ function pe(e, r) {
221
+ if (!e || K)
222
222
  return "";
223
223
  {
224
- var t = M.get(e);
224
+ var t = N.get(e);
225
225
  if (t !== void 0)
226
226
  return t;
227
227
  }
228
228
  var n;
229
- z = !0;
229
+ K = !0;
230
230
  var u = Error.prepareStackTrace;
231
231
  Error.prepareStackTrace = void 0;
232
232
  var s;
233
- s = J.current, J.current = null, Le();
233
+ s = J.current, J.current = null, Me();
234
234
  try {
235
235
  if (r) {
236
- var o = function() {
236
+ var i = function() {
237
237
  throw Error();
238
238
  };
239
- if (Object.defineProperty(o.prototype, "props", {
239
+ if (Object.defineProperty(i.prototype, "props", {
240
240
  set: function() {
241
241
  throw Error();
242
242
  }
243
243
  }), typeof Reflect == "object" && Reflect.construct) {
244
244
  try {
245
- Reflect.construct(o, []);
246
- } catch (S) {
247
- n = S;
245
+ Reflect.construct(i, []);
246
+ } catch (C) {
247
+ n = C;
248
248
  }
249
- Reflect.construct(e, [], o);
249
+ Reflect.construct(e, [], i);
250
250
  } else {
251
251
  try {
252
- o.call();
253
- } catch (S) {
254
- n = S;
252
+ i.call();
253
+ } catch (C) {
254
+ n = C;
255
255
  }
256
- e.call(o.prototype);
256
+ e.call(i.prototype);
257
257
  }
258
258
  } else {
259
259
  try {
260
260
  throw Error();
261
- } catch (S) {
262
- n = S;
261
+ } catch (C) {
262
+ n = C;
263
263
  }
264
264
  e();
265
265
  }
266
- } catch (S) {
267
- if (S && n && typeof S.stack == "string") {
268
- for (var a = S.stack.split(`
269
- `), m = n.stack.split(`
270
- `), l = a.length - 1, c = m.length - 1; l >= 1 && c >= 0 && a[l] !== m[c]; )
271
- c--;
272
- for (; l >= 1 && c >= 0; l--, c--)
273
- if (a[l] !== m[c]) {
274
- if (l !== 1 || c !== 1)
266
+ } catch (C) {
267
+ if (C && n && typeof C.stack == "string") {
268
+ for (var a = C.stack.split(`
269
+ `), R = n.stack.split(`
270
+ `), l = a.length - 1, d = R.length - 1; l >= 1 && d >= 0 && a[l] !== R[d]; )
271
+ d--;
272
+ for (; l >= 1 && d >= 0; l--, d--)
273
+ if (a[l] !== R[d]) {
274
+ if (l !== 1 || d !== 1)
275
275
  do
276
- if (l--, c--, c < 0 || a[l] !== m[c]) {
276
+ if (l--, d--, d < 0 || a[l] !== R[d]) {
277
277
  var O = `
278
278
  ` + a[l].replace(" at new ", " at ");
279
- return e.displayName && O.includes("<anonymous>") && (O = O.replace("<anonymous>", e.displayName)), typeof e == "function" && M.set(e, O), O;
279
+ return e.displayName && O.includes("<anonymous>") && (O = O.replace("<anonymous>", e.displayName)), typeof e == "function" && N.set(e, O), O;
280
280
  }
281
- while (l >= 1 && c >= 0);
281
+ while (l >= 1 && d >= 0);
282
282
  break;
283
283
  }
284
284
  }
285
285
  } finally {
286
- z = !1, J.current = s, Ne(), Error.prepareStackTrace = u;
286
+ K = !1, J.current = s, Ne(), Error.prepareStackTrace = u;
287
287
  }
288
- var A = e ? e.displayName || e.name : "", Oe = A ? N(A) : "";
289
- return typeof e == "function" && M.set(e, Oe), Oe;
288
+ var D = e ? e.displayName || e.name : "", Ce = D ? M(D) : "";
289
+ return typeof e == "function" && N.set(e, Ce), Ce;
290
290
  }
291
291
  function Ue(e, r, t) {
292
- return de(e, !1);
292
+ return pe(e, !1);
293
293
  }
294
- function Ve(e) {
294
+ function qe(e) {
295
295
  var r = e.prototype;
296
296
  return !!(r && r.isReactComponent);
297
297
  }
298
- function U(e, r, t) {
298
+ function V(e, r, t) {
299
299
  if (e == null)
300
300
  return "";
301
301
  if (typeof e == "function")
302
- return de(e, Ve(e));
302
+ return pe(e, qe(e));
303
303
  if (typeof e == "string")
304
- return N(e);
304
+ return M(e);
305
305
  switch (e) {
306
- case w:
307
- return N("Suspense");
308
- case v:
309
- return N("SuspenseList");
306
+ case T:
307
+ return M("Suspense");
308
+ case p:
309
+ return M("SuspenseList");
310
310
  }
311
311
  if (typeof e == "object")
312
312
  switch (e.$$typeof) {
313
- case f:
313
+ case c:
314
314
  return Ue(e.render);
315
- case h:
316
- return U(e.type, r, t);
317
- case R: {
315
+ case y:
316
+ return V(e.type, r, t);
317
+ case w: {
318
318
  var n = e, u = n._payload, s = n._init;
319
319
  try {
320
- return U(s(u), r, t);
320
+ return V(s(u), r, t);
321
321
  } catch {
322
322
  }
323
323
  }
324
324
  }
325
325
  return "";
326
326
  }
327
- var V = Object.prototype.hasOwnProperty, ve = {}, pe = j.ReactDebugCurrentFrame;
327
+ var U = Object.prototype.hasOwnProperty, ge = {}, he = j.ReactDebugCurrentFrame;
328
328
  function q(e) {
329
329
  if (e) {
330
- var r = e._owner, t = U(e.type, e._source, r ? r.type : null);
331
- pe.setExtraStackFrame(t);
330
+ var r = e._owner, t = V(e.type, e._source, r ? r.type : null);
331
+ he.setExtraStackFrame(t);
332
332
  } else
333
- pe.setExtraStackFrame(null);
333
+ he.setExtraStackFrame(null);
334
334
  }
335
- function qe(e, r, t, n, u) {
335
+ function Ge(e, r, t, n, u) {
336
336
  {
337
- var s = Function.call.bind(V);
338
- for (var o in e)
339
- if (s(e, o)) {
337
+ var s = Function.call.bind(U);
338
+ for (var i in e)
339
+ if (s(e, i)) {
340
340
  var a = void 0;
341
341
  try {
342
- if (typeof e[o] != "function") {
343
- var m = Error((n || "React class") + ": " + t + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
344
- throw m.name = "Invariant Violation", m;
342
+ if (typeof e[i] != "function") {
343
+ var R = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
344
+ throw R.name = "Invariant Violation", R;
345
345
  }
346
- a = e[o](r, o, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
346
+ a = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
347
347
  } catch (l) {
348
348
  a = l;
349
349
  }
350
- a && !(a instanceof Error) && (q(u), E("%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).", n || "React class", t, o, typeof a), q(null)), a instanceof Error && !(a.message in ve) && (ve[a.message] = !0, q(u), E("Failed %s type: %s", t, a.message), q(null));
350
+ a && !(a instanceof Error) && (q(u), 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).", n || "React class", t, i, typeof a), q(null)), a instanceof Error && !(a.message in ge) && (ge[a.message] = !0, q(u), b("Failed %s type: %s", t, a.message), q(null));
351
351
  }
352
352
  }
353
353
  }
354
354
  var Be = Array.isArray;
355
- function K(e) {
355
+ function H(e) {
356
356
  return Be(e);
357
357
  }
358
358
  function Je(e) {
@@ -361,53 +361,53 @@ function hr() {
361
361
  return t;
362
362
  }
363
363
  }
364
- function Ge(e) {
364
+ function ze(e) {
365
365
  try {
366
- return ge(e), !1;
366
+ return Ee(e), !1;
367
367
  } catch {
368
368
  return !0;
369
369
  }
370
370
  }
371
- function ge(e) {
371
+ function Ee(e) {
372
372
  return "" + e;
373
373
  }
374
- function he(e) {
375
- if (Ge(e))
376
- return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Je(e)), ge(e);
374
+ function me(e) {
375
+ if (ze(e))
376
+ return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Je(e)), Ee(e);
377
377
  }
378
- var I = j.ReactCurrentOwner, ze = {
378
+ var $ = j.ReactCurrentOwner, Ke = {
379
379
  key: !0,
380
380
  ref: !0,
381
381
  __self: !0,
382
382
  __source: !0
383
- }, Ee, me, H;
384
- H = {};
385
- function Ke(e) {
386
- if (V.call(e, "ref")) {
383
+ }, ye, be, X;
384
+ X = {};
385
+ function He(e) {
386
+ if (U.call(e, "ref")) {
387
387
  var r = Object.getOwnPropertyDescriptor(e, "ref").get;
388
388
  if (r && r.isReactWarning)
389
389
  return !1;
390
390
  }
391
391
  return e.ref !== void 0;
392
392
  }
393
- function He(e) {
394
- if (V.call(e, "key")) {
393
+ function Xe(e) {
394
+ if (U.call(e, "key")) {
395
395
  var r = Object.getOwnPropertyDescriptor(e, "key").get;
396
396
  if (r && r.isReactWarning)
397
397
  return !1;
398
398
  }
399
399
  return e.key !== void 0;
400
400
  }
401
- function Xe(e, r) {
402
- if (typeof e.ref == "string" && I.current && r && I.current.stateNode !== r) {
403
- var t = C(I.current.type);
404
- H[t] || (E('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', C(I.current.type), e.ref), H[t] = !0);
401
+ function Ze(e, r) {
402
+ if (typeof e.ref == "string" && $.current && r && $.current.stateNode !== r) {
403
+ var t = S($.current.type);
404
+ X[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', S($.current.type), e.ref), X[t] = !0);
405
405
  }
406
406
  }
407
- function Ze(e, r) {
407
+ function Qe(e, r) {
408
408
  {
409
409
  var t = function() {
410
- Ee || (Ee = !0, E("%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));
410
+ ye || (ye = !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));
411
411
  };
412
412
  t.isReactWarning = !0, Object.defineProperty(e, "key", {
413
413
  get: t,
@@ -415,10 +415,10 @@ function hr() {
415
415
  });
416
416
  }
417
417
  }
418
- function Qe(e, r) {
418
+ function er(e, r) {
419
419
  {
420
420
  var t = function() {
421
- me || (me = !0, E("%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));
421
+ be || (be = !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));
422
422
  };
423
423
  t.isReactWarning = !0, Object.defineProperty(e, "ref", {
424
424
  get: t,
@@ -426,15 +426,15 @@ function hr() {
426
426
  });
427
427
  }
428
428
  }
429
- var er = function(e, r, t, n, u, s, o) {
429
+ var rr = function(e, r, t, n, u, s, i) {
430
430
  var a = {
431
431
  // This tag allows us to uniquely identify this as a React Element
432
- $$typeof: y,
432
+ $$typeof: h,
433
433
  // Built-in properties that belong on the element
434
434
  type: e,
435
435
  key: r,
436
436
  ref: t,
437
- props: o,
437
+ props: i,
438
438
  // Record the component responsible for creating this element.
439
439
  _owner: s
440
440
  };
@@ -455,41 +455,41 @@ function hr() {
455
455
  value: u
456
456
  }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
457
457
  };
458
- function rr(e, r, t, n, u) {
458
+ function tr(e, r, t, n, u) {
459
459
  {
460
- var s, o = {}, a = null, m = null;
461
- t !== void 0 && (he(t), a = "" + t), He(r) && (he(r.key), a = "" + r.key), Ke(r) && (m = r.ref, Xe(r, u));
460
+ var s, i = {}, a = null, R = null;
461
+ t !== void 0 && (me(t), a = "" + t), Xe(r) && (me(r.key), a = "" + r.key), He(r) && (R = r.ref, Ze(r, u));
462
462
  for (s in r)
463
- V.call(r, s) && !ze.hasOwnProperty(s) && (o[s] = r[s]);
463
+ U.call(r, s) && !Ke.hasOwnProperty(s) && (i[s] = r[s]);
464
464
  if (e && e.defaultProps) {
465
465
  var l = e.defaultProps;
466
466
  for (s in l)
467
- o[s] === void 0 && (o[s] = l[s]);
467
+ i[s] === void 0 && (i[s] = l[s]);
468
468
  }
469
- if (a || m) {
470
- var c = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
471
- a && Ze(o, c), m && Qe(o, c);
469
+ if (a || R) {
470
+ var d = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
471
+ a && Qe(i, d), R && er(i, d);
472
472
  }
473
- return er(e, a, m, u, n, I.current, o);
473
+ return rr(e, a, R, u, n, $.current, i);
474
474
  }
475
475
  }
476
- var X = j.ReactCurrentOwner, ye = j.ReactDebugCurrentFrame;
476
+ var Z = j.ReactCurrentOwner, Re = j.ReactDebugCurrentFrame;
477
477
  function k(e) {
478
478
  if (e) {
479
- var r = e._owner, t = U(e.type, e._source, r ? r.type : null);
480
- ye.setExtraStackFrame(t);
479
+ var r = e._owner, t = V(e.type, e._source, r ? r.type : null);
480
+ Re.setExtraStackFrame(t);
481
481
  } else
482
- ye.setExtraStackFrame(null);
482
+ Re.setExtraStackFrame(null);
483
483
  }
484
- var Z;
485
- Z = !1;
486
- function Q(e) {
487
- return typeof e == "object" && e !== null && e.$$typeof === y;
484
+ var Q;
485
+ Q = !1;
486
+ function ee(e) {
487
+ return typeof e == "object" && e !== null && e.$$typeof === h;
488
488
  }
489
- function be() {
489
+ function _e() {
490
490
  {
491
- if (X.current) {
492
- var e = C(X.current.type);
491
+ if (Z.current) {
492
+ var e = S(Z.current.type);
493
493
  if (e)
494
494
  return `
495
495
 
@@ -498,7 +498,7 @@ Check the render method of \`` + e + "`.";
498
498
  return "";
499
499
  }
500
500
  }
501
- function tr(e) {
501
+ function nr(e) {
502
502
  {
503
503
  if (e !== void 0) {
504
504
  var r = e.fileName.replace(/^.*[\\\/]/, ""), t = e.lineNumber;
@@ -509,10 +509,10 @@ Check your code at ` + r + ":" + t + ".";
509
509
  return "";
510
510
  }
511
511
  }
512
- var Re = {};
513
- function nr(e) {
512
+ var we = {};
513
+ function ar(e) {
514
514
  {
515
- var r = be();
515
+ var r = _e();
516
516
  if (!r) {
517
517
  var t = typeof e == "string" ? e : e.displayName || e.name;
518
518
  t && (r = `
@@ -522,39 +522,39 @@ Check the top-level render call using <` + t + ">.");
522
522
  return r;
523
523
  }
524
524
  }
525
- function _e(e, r) {
525
+ function Te(e, r) {
526
526
  {
527
527
  if (!e._store || e._store.validated || e.key != null)
528
528
  return;
529
529
  e._store.validated = !0;
530
- var t = nr(r);
531
- if (Re[t])
530
+ var t = ar(r);
531
+ if (we[t])
532
532
  return;
533
- Re[t] = !0;
533
+ we[t] = !0;
534
534
  var n = "";
535
- e && e._owner && e._owner !== X.current && (n = " It was passed a child from " + C(e._owner.type) + "."), k(e), 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, n), k(null);
535
+ e && e._owner && e._owner !== Z.current && (n = " It was passed a child from " + S(e._owner.type) + "."), k(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, n), k(null);
536
536
  }
537
537
  }
538
- function Te(e, r) {
538
+ function Oe(e, r) {
539
539
  {
540
540
  if (typeof e != "object")
541
541
  return;
542
- if (K(e))
542
+ if (H(e))
543
543
  for (var t = 0; t < e.length; t++) {
544
544
  var n = e[t];
545
- Q(n) && _e(n, r);
545
+ ee(n) && Te(n, r);
546
546
  }
547
- else if (Q(e))
547
+ else if (ee(e))
548
548
  e._store && (e._store.validated = !0);
549
549
  else if (e) {
550
- var u = je(e);
550
+ var u = ke(e);
551
551
  if (typeof u == "function" && u !== e.entries)
552
- for (var s = u.call(e), o; !(o = s.next()).done; )
553
- Q(o.value) && _e(o.value, r);
552
+ for (var s = u.call(e), i; !(i = s.next()).done; )
553
+ ee(i.value) && Te(i.value, r);
554
554
  }
555
555
  }
556
556
  }
557
- function ar(e) {
557
+ function or(e) {
558
558
  {
559
559
  var r = e.type;
560
560
  if (r == null || typeof r == "string")
@@ -562,129 +562,155 @@ Check the top-level render call using <` + t + ">.");
562
562
  var t;
563
563
  if (typeof r == "function")
564
564
  t = r.propTypes;
565
- else if (typeof r == "object" && (r.$$typeof === f || // Note: Memo only checks outer props here.
565
+ else if (typeof r == "object" && (r.$$typeof === c || // Note: Memo only checks outer props here.
566
566
  // Inner props are checked in the reconciler.
567
- r.$$typeof === h))
567
+ r.$$typeof === y))
568
568
  t = r.propTypes;
569
569
  else
570
570
  return;
571
571
  if (t) {
572
- var n = C(r);
573
- qe(t, e.props, "prop", n, e);
574
- } else if (r.PropTypes !== void 0 && !Z) {
575
- Z = !0;
576
- var u = C(r);
577
- E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", u || "Unknown");
572
+ var n = S(r);
573
+ Ge(t, e.props, "prop", n, e);
574
+ } else if (r.PropTypes !== void 0 && !Q) {
575
+ Q = !0;
576
+ var u = S(r);
577
+ b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", u || "Unknown");
578
578
  }
579
- typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
579
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
580
580
  }
581
581
  }
582
- function or(e) {
582
+ function ir(e) {
583
583
  {
584
584
  for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
585
585
  var n = r[t];
586
586
  if (n !== "children" && n !== "key") {
587
- k(e), E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), k(null);
587
+ k(e), b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), k(null);
588
588
  break;
589
589
  }
590
590
  }
591
- e.ref !== null && (k(e), E("Invalid attribute `ref` supplied to `React.Fragment`."), k(null));
591
+ e.ref !== null && (k(e), b("Invalid attribute `ref` supplied to `React.Fragment`."), k(null));
592
592
  }
593
593
  }
594
- function we(e, r, t, n, u, s) {
594
+ function Se(e, r, t, n, u, s) {
595
595
  {
596
- var o = We(e);
597
- if (!o) {
596
+ var i = Ye(e);
597
+ if (!i) {
598
598
  var a = "";
599
599
  (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
600
- var m = tr(u);
601
- m ? a += m : a += be();
600
+ var R = nr(u);
601
+ R ? a += R : a += _e();
602
602
  var l;
603
- e === null ? l = "null" : K(e) ? l = "array" : e !== void 0 && e.$$typeof === y ? (l = "<" + (C(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : l = typeof e, E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", l, a);
603
+ e === null ? l = "null" : H(e) ? l = "array" : e !== void 0 && e.$$typeof === h ? (l = "<" + (S(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : l = 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", l, a);
604
604
  }
605
- var c = rr(e, r, t, u, s);
606
- if (c == null)
607
- return c;
608
- if (o) {
605
+ var d = tr(e, r, t, u, s);
606
+ if (d == null)
607
+ return d;
608
+ if (i) {
609
609
  var O = r.children;
610
610
  if (O !== void 0)
611
611
  if (n)
612
- if (K(O)) {
613
- for (var A = 0; A < O.length; A++)
614
- Te(O[A], e);
612
+ if (H(O)) {
613
+ for (var D = 0; D < O.length; D++)
614
+ Oe(O[D], e);
615
615
  Object.freeze && Object.freeze(O);
616
616
  } else
617
- E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
617
+ 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.");
618
618
  else
619
- Te(O, e);
619
+ Oe(O, e);
620
620
  }
621
- return e === b ? or(c) : ar(c), c;
621
+ return e === E ? ir(d) : or(d), d;
622
622
  }
623
623
  }
624
- function ir(e, r, t) {
625
- return we(e, r, t, !0);
626
- }
627
624
  function ur(e, r, t) {
628
- return we(e, r, t, !1);
625
+ return Se(e, r, t, !0);
629
626
  }
630
- var sr = ur, fr = ir;
631
- W.Fragment = b, W.jsx = sr, W.jsxs = fr;
632
- }()), W;
627
+ function sr(e, r, t) {
628
+ return Se(e, r, t, !1);
629
+ }
630
+ var fr = sr, cr = ur;
631
+ Y.Fragment = E, Y.jsx = fr, Y.jsxs = cr;
632
+ }()), Y;
633
633
  }
634
- (function(d) {
635
- process.env.NODE_ENV === "production" ? d.exports = gr() : d.exports = hr();
636
- })(pr);
637
- const Y = ee.jsx, re = lr({
634
+ (function(f) {
635
+ process.env.NODE_ENV === "production" ? f.exports = Er() : f.exports = mr();
636
+ })(hr);
637
+ const A = te.jsx, B = lr({
638
638
  children: void 0,
639
639
  Navigate: void 0,
640
640
  Outlet: void 0,
641
641
  translate: void 0,
642
642
  useAuth: void 0,
643
643
  useLocation: void 0
644
- }), mr = ({ children: d, translate: y, useAuth: g, Outlet: b, Navigate: p, useLocation: _ }) => {
645
- const i = cr(
644
+ }), br = ({
645
+ children: f,
646
+ translate: h,
647
+ useAuth: g,
648
+ Outlet: E,
649
+ Navigate: v,
650
+ useLocation: m,
651
+ useGoogleTagManager: o
652
+ }) => {
653
+ const _ = dr(
646
654
  () => ({
647
- Navigate: p,
648
- Outlet: b,
649
- translate: y,
655
+ Navigate: v,
656
+ Outlet: E,
657
+ translate: h,
650
658
  useAuth: g,
651
- useLocation: _
659
+ useGoogleTagManager: o,
660
+ useLocation: m
652
661
  }),
653
- [p, b, y, g, _]
662
+ [v, E, h, g, o, m]
654
663
  );
655
- return /* @__PURE__ */ Y(re.Provider, { value: i, children: d });
656
- }, B = (d) => `RequireAuth require « ${d} » dependency. You can provide with InjectDependenciesProvider or directly in props.`, yr = ({ Fallback: d, loginPath: y = "/login", ...g }) => {
657
- var w, v, h, R;
664
+ return /* @__PURE__ */ A(B.Provider, { value: _, children: f });
665
+ }, G = (f) => `RequireAuth require « ${f} » dependency. You can provide with InjectDependenciesProvider or directly in props.`, Rr = ({ Fallback: f, loginPath: h = "/login", ...g }) => {
666
+ var T, p, y, w;
667
+ const {
668
+ useLocation: E = g.useLocation,
669
+ useAuth: v = g.useAuth,
670
+ Outlet: m = g.Outlet,
671
+ Navigate: o = g.Navigate
672
+ } = ne(B);
673
+ if (v === void 0)
674
+ throw new Error(G("useAuth"));
675
+ if (E === void 0)
676
+ throw new Error(G("useLocation"));
677
+ if (m === void 0)
678
+ throw new Error(G("Outlet"));
679
+ if (o === void 0)
680
+ throw new Error(G("Navigate"));
681
+ const { isLogged: _ } = v(), c = E();
682
+ return _ ? /* @__PURE__ */ A(vr, { fallback: f, children: (p = (T = c.state) == null ? void 0 : T.from) != null && p.state && ((w = (y = c.state) == null ? void 0 : y.from) == null ? void 0 : w.pathname) === h ? /* @__PURE__ */ A(o, { to: c.state.from.state.from.pathname + c.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ A(m, {}) }) : /* @__PURE__ */ A(o, { to: h, state: { from: c }, replace: !0 });
683
+ }, re = (f) => `GTMSendPageView require « ${f} » dependency. You can provide with InjectDependenciesProvider or directly in props.`, _r = ({ ...f }) => {
658
684
  const {
659
- useLocation: b = g.useLocation,
660
- useAuth: p = g.useAuth,
661
- Outlet: _ = g.Outlet,
662
- Navigate: i = g.Navigate
663
- } = xe(re);
664
- if (p === void 0)
665
- throw new Error(B("useAuth"));
666
- if (b === void 0)
667
- throw new Error(B("useLocation"));
668
- if (_ === void 0)
669
- throw new Error(B("Outlet"));
670
- if (i === void 0)
671
- throw new Error(B("Navigate"));
672
- const { isLogged: T } = p(), f = b();
673
- return T ? /* @__PURE__ */ Y(dr, { fallback: d, children: (v = (w = f.state) == null ? void 0 : w.from) != null && v.state && ((R = (h = f.state) == null ? void 0 : h.from) == null ? void 0 : R.pathname) === y ? /* @__PURE__ */ Y(i, { to: f.state.from.state.from.pathname + f.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ Y(_, {}) }) : /* @__PURE__ */ Y(i, { to: y, state: { from: f }, replace: !0 });
674
- }, br = (d) => {
675
- const { unknownErrorTranslationKey: y = "error.unknownError" } = d || {}, { translate: g = d == null ? void 0 : d.translate } = xe(re);
676
- return { printError: vr(
677
- (p) => {
678
- var T, f, w, v, h, R, P, D, L;
679
- const _ = g ? g(y) : "Unknown error", { response: i } = p || {};
680
- return p != null && p.reason ? String(p.reason) : (T = i == null ? void 0 : i.data) != null && T.reason ? String(i.data.reason) : (f = i == null ? void 0 : i.data) != null && f.message ? String(i.data.message) : (v = (w = i == null ? void 0 : i.data) == null ? void 0 : w.detail) != null && v.length && Array.isArray((h = i == null ? void 0 : i.data) == null ? void 0 : h.detail) && ((P = (R = i == null ? void 0 : i.data) == null ? void 0 : R.detail[0]) != null && P.msg) && typeof ((L = (D = i == null ? void 0 : i.data) == null ? void 0 : D.detail[0]) == null ? void 0 : L.msg) == "string" ? String(i.data.detail[0].msg) : _;
685
+ useLocation: h = f.useLocation,
686
+ Outlet: g = f.Outlet,
687
+ useGoogleTagManager: E = f.useGoogleTagManager
688
+ } = ne(B);
689
+ if (h === void 0)
690
+ throw new Error(re("useLocation"));
691
+ if (g === void 0)
692
+ throw new Error(re("Outlet"));
693
+ if (E === void 0)
694
+ throw new Error(re("useGoogleTagManager"));
695
+ const { pathname: v } = h(), { sendEvent: m } = E();
696
+ return pr(() => {
697
+ m({ event: "pageView", pathname: v });
698
+ }, [v, m]), /* @__PURE__ */ A(g, {});
699
+ }, wr = (f) => {
700
+ const { unknownErrorTranslationKey: h = "error.unknownError" } = f || {}, { translate: g = f == null ? void 0 : f.translate } = ne(B);
701
+ return { printError: gr(
702
+ (v) => {
703
+ var _, c, T, p, y, w, P, F, W;
704
+ const m = g ? g(h) : "Unknown error", { response: o } = v || {};
705
+ return v != null && v.reason ? String(v.reason) : (_ = o == null ? void 0 : o.data) != null && _.reason ? String(o.data.reason) : (c = o == null ? void 0 : o.data) != null && c.message ? String(o.data.message) : (p = (T = o == null ? void 0 : o.data) == null ? void 0 : T.detail) != null && p.length && Array.isArray((y = o == null ? void 0 : o.data) == null ? void 0 : y.detail) && ((P = (w = o == null ? void 0 : o.data) == null ? void 0 : w.detail[0]) != null && P.msg) && typeof ((W = (F = o == null ? void 0 : o.data) == null ? void 0 : F.detail[0]) == null ? void 0 : W.msg) == "string" ? String(o.data.detail[0].msg) : m;
681
706
  },
682
- [g, y]
707
+ [g, h]
683
708
  ) };
684
709
  };
685
710
  export {
686
- re as InjectDependenciesContext,
687
- mr as InjectDependenciesProvider,
688
- yr as RequireAuth,
689
- br as useResponseError
711
+ _r as GTMSendPageView,
712
+ B as InjectDependenciesContext,
713
+ br as InjectDependenciesProvider,
714
+ Rr as RequireAuth,
715
+ wr as useResponseError
690
716
  };
package/dist/main.umd.cjs CHANGED
@@ -1,4 +1,4 @@
1
- (function(S,_){typeof exports=="object"&&typeof module<"u"?_(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],_):(S=typeof globalThis<"u"?globalThis:S||self,_(S["@tracktor/shared-module"]={},S.React))})(this,function(S,_){"use strict";var K={},xe={get exports(){return K},set exports(d){K=d}},I={};/**
1
+ (function(C,_){typeof exports=="object"&&typeof module<"u"?_(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],_):(C=typeof globalThis<"u"?globalThis:C||self,_(C["@tracktor/shared-module"]={},C.React))})(this,function(C,_){"use strict";var q={},ke={get exports(){return q},set exports(c){q=c}},L={};/**
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 ae;function ke(){if(ae)return I;ae=1;var d=_,y=Symbol.for("react.element"),g=Symbol.for("react.fragment"),b=Object.prototype.hasOwnProperty,p=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,T={key:!0,ref:!0,__self:!0,__source:!0};function i(w,f,O){var v,h={},R=null,x=null;O!==void 0&&(R=""+O),f.key!==void 0&&(R=""+f.key),f.ref!==void 0&&(x=f.ref);for(v in f)b.call(f,v)&&!T.hasOwnProperty(v)&&(h[v]=f[v]);if(w&&w.defaultProps)for(v in f=w.defaultProps,f)h[v]===void 0&&(h[v]=f[v]);return{$$typeof:y,type:w,key:R,ref:x,props:h,_owner:p.current}}return I.Fragment=g,I.jsx=i,I.jsxs=i,I}var W={};/**
9
+ */var oe;function De(){if(oe)return L;oe=1;var c=_,h=Symbol.for("react.element"),g=Symbol.for("react.fragment"),E=Object.prototype.hasOwnProperty,v=c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,m={key:!0,ref:!0,__self:!0,__source:!0};function o(w,f,O){var p,y={},T=null,x=null;O!==void 0&&(T=""+O),f.key!==void 0&&(T=""+f.key),f.ref!==void 0&&(x=f.ref);for(p in f)E.call(f,p)&&!m.hasOwnProperty(p)&&(y[p]=f[p]);if(w&&w.defaultProps)for(p in f=w.defaultProps,f)y[p]===void 0&&(y[p]=f[p]);return{$$typeof:h,type:w,key:T,ref:x,props:y,_owner:v.current}}return L.Fragment=g,L.jsx=o,L.jsxs=o,L}var M={};/**
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 oe;function De(){return oe||(oe=1,process.env.NODE_ENV!=="production"&&function(){var d=_,y=Symbol.for("react.element"),g=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),w=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),L=Symbol.iterator,$="@@iterator";function We(e){if(e===null||typeof e!="object")return null;var r=L&&e[L]||e[$];return typeof r=="function"?r:null}var D=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function E(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Ye("error",e,t)}}function Ye(e,r,t){{var n=D.ReactDebugCurrentFrame,u=n.getStackAddendum();u!==""&&(r+="%s",t=t.concat([u]));var s=t.map(function(o){return String(o)});s.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,s)}}var Le=!1,Ne=!1,Me=!1,Ue=!1,Ve=!1,ie;ie=Symbol.for("react.module.reference");function $e(e){return!!(typeof e=="string"||typeof e=="function"||e===b||e===T||Ve||e===p||e===O||e===v||Ue||e===x||Le||Ne||Me||typeof e=="object"&&e!==null&&(e.$$typeof===R||e.$$typeof===h||e.$$typeof===i||e.$$typeof===w||e.$$typeof===f||e.$$typeof===ie||e.getModuleId!==void 0))}function Be(e,r,t){var n=e.displayName;if(n)return n;var u=r.displayName||r.name||"";return u!==""?t+"("+u+")":t}function ue(e){return e.displayName||"Context"}function P(e){if(e==null)return null;if(typeof e.tag=="number"&&E("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 b:return"Fragment";case g:return"Portal";case T:return"Profiler";case p:return"StrictMode";case O:return"Suspense";case v:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case w:var r=e;return ue(r)+".Consumer";case i:var t=e;return ue(t._context)+".Provider";case f:return Be(e,e.render,"ForwardRef");case h:var n=e.displayName||null;return n!==null?n:P(e.type)||"Memo";case R:{var u=e,s=u._payload,o=u._init;try{return P(o(s))}catch{return null}}}return null}var k=Object.assign,N=0,se,fe,ce,le,de,ve,pe;function ge(){}ge.__reactDisabledLog=!0;function Je(){{if(N===0){se=console.log,fe=console.info,ce=console.warn,le=console.error,de=console.group,ve=console.groupCollapsed,pe=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ge,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}N++}}function Ge(){{if(N--,N===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:k({},e,{value:se}),info:k({},e,{value:fe}),warn:k({},e,{value:ce}),error:k({},e,{value:le}),group:k({},e,{value:de}),groupCollapsed:k({},e,{value:ve}),groupEnd:k({},e,{value:pe})})}N<0&&E("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var H=D.ReactCurrentDispatcher,X;function B(e,r,t){{if(X===void 0)try{throw Error()}catch(u){var n=u.stack.trim().match(/\n( *(at )?)/);X=n&&n[1]||""}return`
18
- `+X+e}}var Z=!1,J;{var qe=typeof WeakMap=="function"?WeakMap:Map;J=new qe}function he(e,r){if(!e||Z)return"";{var t=J.get(e);if(t!==void 0)return t}var n;Z=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var s;s=H.current,H.current=null,Je();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(j){n=j}Reflect.construct(e,[],o)}else{try{o.call()}catch(j){n=j}e.call(o.prototype)}}else{try{throw Error()}catch(j){n=j}e()}}catch(j){if(j&&n&&typeof j.stack=="string"){for(var a=j.stack.split(`
19
- `),m=n.stack.split(`
20
- `),c=a.length-1,l=m.length-1;c>=1&&l>=0&&a[c]!==m[l];)l--;for(;c>=1&&l>=0;c--,l--)if(a[c]!==m[l]){if(c!==1||l!==1)do if(c--,l--,l<0||a[c]!==m[l]){var C=`
21
- `+a[c].replace(" at new "," at ");return e.displayName&&C.includes("<anonymous>")&&(C=C.replace("<anonymous>",e.displayName)),typeof e=="function"&&J.set(e,C),C}while(c>=1&&l>=0);break}}}finally{Z=!1,H.current=s,Ge(),Error.prepareStackTrace=u}var F=e?e.displayName||e.name:"",je=F?B(F):"";return typeof e=="function"&&J.set(e,je),je}function ze(e,r,t){return he(e,!1)}function Ke(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function G(e,r,t){if(e==null)return"";if(typeof e=="function")return he(e,Ke(e));if(typeof e=="string")return B(e);switch(e){case O:return B("Suspense");case v:return B("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return ze(e.render);case h:return G(e.type,r,t);case R:{var n=e,u=n._payload,s=n._init;try{return G(s(u),r,t)}catch{}}}return""}var q=Object.prototype.hasOwnProperty,Ee={},me=D.ReactDebugCurrentFrame;function z(e){if(e){var r=e._owner,t=G(e.type,e._source,r?r.type:null);me.setExtraStackFrame(t)}else me.setExtraStackFrame(null)}function He(e,r,t,n,u){{var s=Function.call.bind(q);for(var o in e)if(s(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var m=Error((n||"React class")+": "+t+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw m.name="Invariant Violation",m}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(c){a=c}a&&!(a instanceof Error)&&(z(u),E("%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).",n||"React class",t,o,typeof a),z(null)),a instanceof Error&&!(a.message in Ee)&&(Ee[a.message]=!0,z(u),E("Failed %s type: %s",t,a.message),z(null))}}}var Xe=Array.isArray;function Q(e){return Xe(e)}function Ze(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Qe(e){try{return ye(e),!1}catch{return!0}}function ye(e){return""+e}function be(e){if(Qe(e))return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ze(e)),ye(e)}var M=D.ReactCurrentOwner,er={key:!0,ref:!0,__self:!0,__source:!0},Re,_e,ee;ee={};function rr(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 tr(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 nr(e,r){if(typeof e.ref=="string"&&M.current&&r&&M.current.stateNode!==r){var t=P(M.current.type);ee[t]||(E('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(M.current.type),e.ref),ee[t]=!0)}}function ar(e,r){{var t=function(){Re||(Re=!0,E("%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 or(e,r){{var t=function(){_e||(_e=!0,E("%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,n,u,s,o){var a={$$typeof:y,type:e,key:r,ref:t,props:o,_owner:s};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:u}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function ur(e,r,t,n,u){{var s,o={},a=null,m=null;t!==void 0&&(be(t),a=""+t),tr(r)&&(be(r.key),a=""+r.key),rr(r)&&(m=r.ref,nr(r,u));for(s in r)q.call(r,s)&&!er.hasOwnProperty(s)&&(o[s]=r[s]);if(e&&e.defaultProps){var c=e.defaultProps;for(s in c)o[s]===void 0&&(o[s]=c[s])}if(a||m){var l=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&ar(o,l),m&&or(o,l)}return ir(e,a,m,u,n,M.current,o)}}var re=D.ReactCurrentOwner,Te=D.ReactDebugCurrentFrame;function A(e){if(e){var r=e._owner,t=G(e.type,e._source,r?r.type:null);Te.setExtraStackFrame(t)}else Te.setExtraStackFrame(null)}var te;te=!1;function ne(e){return typeof e=="object"&&e!==null&&e.$$typeof===y}function we(){{if(re.current){var e=P(re.current.type);if(e)return`
17
+ */var ie;function Ae(){return ie||(ie=1,process.env.NODE_ENV!=="production"&&function(){var c=_,h=Symbol.for("react.element"),g=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),w=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),W=Symbol.iterator,G="@@iterator";function Ye(e){if(e===null||typeof e!="object")return null;var r=W&&e[W]||e[G];return typeof r=="function"?r:null}var A=c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];We("error",e,t)}}function We(e,r,t){{var n=A.ReactDebugCurrentFrame,u=n.getStackAddendum();u!==""&&(r+="%s",t=t.concat([u]));var s=t.map(function(i){return String(i)});s.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,s)}}var Ne=!1,Ve=!1,Ue=!1,Ge=!1,Be=!1,ue;ue=Symbol.for("react.module.reference");function $e(e){return!!(typeof e=="string"||typeof e=="function"||e===E||e===m||Be||e===v||e===O||e===p||Ge||e===x||Ne||Ve||Ue||typeof e=="object"&&e!==null&&(e.$$typeof===T||e.$$typeof===y||e.$$typeof===o||e.$$typeof===w||e.$$typeof===f||e.$$typeof===ue||e.getModuleId!==void 0))}function Je(e,r,t){var n=e.displayName;if(n)return n;var u=r.displayName||r.name||"";return u!==""?t+"("+u+")":t}function se(e){return e.displayName||"Context"}function P(e){if(e==null)return null;if(typeof e.tag=="number"&&b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case g:return"Portal";case m:return"Profiler";case v:return"StrictMode";case O:return"Suspense";case p:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case w:var r=e;return se(r)+".Consumer";case o:var t=e;return se(t._context)+".Provider";case f:return Je(e,e.render,"ForwardRef");case y:var n=e.displayName||null;return n!==null?n:P(e.type)||"Memo";case T:{var u=e,s=u._payload,i=u._init;try{return P(i(s))}catch{return null}}}return null}var k=Object.assign,N=0,ce,fe,le,de,ve,pe,ge;function he(){}he.__reactDisabledLog=!0;function ze(){{if(N===0){ce=console.log,fe=console.info,le=console.warn,de=console.error,ve=console.group,pe=console.groupCollapsed,ge=console.groupEnd;var e={configurable:!0,enumerable:!0,value:he,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}N++}}function Ke(){{if(N--,N===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:k({},e,{value:ce}),info:k({},e,{value:fe}),warn:k({},e,{value:le}),error:k({},e,{value:de}),group:k({},e,{value:ve}),groupCollapsed:k({},e,{value:pe}),groupEnd:k({},e,{value:ge})})}N<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var X=A.ReactCurrentDispatcher,Z;function B(e,r,t){{if(Z===void 0)try{throw Error()}catch(u){var n=u.stack.trim().match(/\n( *(at )?)/);Z=n&&n[1]||""}return`
18
+ `+Z+e}}var Q=!1,$;{var qe=typeof WeakMap=="function"?WeakMap:Map;$=new qe}function Ee(e,r){if(!e||Q)return"";{var t=$.get(e);if(t!==void 0)return t}var n;Q=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var s;s=X.current,X.current=null,ze();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(j){n=j}Reflect.construct(e,[],i)}else{try{i.call()}catch(j){n=j}e.call(i.prototype)}}else{try{throw Error()}catch(j){n=j}e()}}catch(j){if(j&&n&&typeof j.stack=="string"){for(var a=j.stack.split(`
19
+ `),R=n.stack.split(`
20
+ `),l=a.length-1,d=R.length-1;l>=1&&d>=0&&a[l]!==R[d];)d--;for(;l>=1&&d>=0;l--,d--)if(a[l]!==R[d]){if(l!==1||d!==1)do if(l--,d--,d<0||a[l]!==R[d]){var S=`
21
+ `+a[l].replace(" at new "," at ");return e.displayName&&S.includes("<anonymous>")&&(S=S.replace("<anonymous>",e.displayName)),typeof e=="function"&&$.set(e,S),S}while(l>=1&&d>=0);break}}}finally{Q=!1,X.current=s,Ke(),Error.prepareStackTrace=u}var I=e?e.displayName||e.name:"",xe=I?B(I):"";return typeof e=="function"&&$.set(e,xe),xe}function He(e,r,t){return Ee(e,!1)}function Xe(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function J(e,r,t){if(e==null)return"";if(typeof e=="function")return Ee(e,Xe(e));if(typeof e=="string")return B(e);switch(e){case O:return B("Suspense");case p:return B("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return He(e.render);case y:return J(e.type,r,t);case T:{var n=e,u=n._payload,s=n._init;try{return J(s(u),r,t)}catch{}}}return""}var z=Object.prototype.hasOwnProperty,me={},ye=A.ReactDebugCurrentFrame;function K(e){if(e){var r=e._owner,t=J(e.type,e._source,r?r.type:null);ye.setExtraStackFrame(t)}else ye.setExtraStackFrame(null)}function Ze(e,r,t,n,u){{var s=Function.call.bind(z);for(var i in e)if(s(e,i)){var a=void 0;try{if(typeof e[i]!="function"){var R=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw R.name="Invariant Violation",R}a=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(l){a=l}a&&!(a instanceof Error)&&(K(u),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).",n||"React class",t,i,typeof a),K(null)),a instanceof Error&&!(a.message in me)&&(me[a.message]=!0,K(u),b("Failed %s type: %s",t,a.message),K(null))}}}var Qe=Array.isArray;function ee(e){return Qe(e)}function er(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function rr(e){try{return be(e),!1}catch{return!0}}function be(e){return""+e}function Re(e){if(rr(e))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",er(e)),be(e)}var V=A.ReactCurrentOwner,tr={key:!0,ref:!0,__self:!0,__source:!0},_e,we,re;re={};function nr(e){if(z.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(z.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function or(e,r){if(typeof e.ref=="string"&&V.current&&r&&V.current.stateNode!==r){var t=P(V.current.type);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(V.current.type),e.ref),re[t]=!0)}}function ir(e,r){{var t=function(){_e||(_e=!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))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function ur(e,r){{var t=function(){we||(we=!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))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var sr=function(e,r,t,n,u,s,i){var a={$$typeof:h,type:e,key:r,ref:t,props:i,_owner:s};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:u}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function cr(e,r,t,n,u){{var s,i={},a=null,R=null;t!==void 0&&(Re(t),a=""+t),ar(r)&&(Re(r.key),a=""+r.key),nr(r)&&(R=r.ref,or(r,u));for(s in r)z.call(r,s)&&!tr.hasOwnProperty(s)&&(i[s]=r[s]);if(e&&e.defaultProps){var l=e.defaultProps;for(s in l)i[s]===void 0&&(i[s]=l[s])}if(a||R){var d=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&ir(i,d),R&&ur(i,d)}return sr(e,a,R,u,n,V.current,i)}}var te=A.ReactCurrentOwner,Te=A.ReactDebugCurrentFrame;function F(e){if(e){var r=e._owner,t=J(e.type,e._source,r?r.type:null);Te.setExtraStackFrame(t)}else Te.setExtraStackFrame(null)}var ne;ne=!1;function ae(e){return typeof e=="object"&&e!==null&&e.$$typeof===h}function Oe(){{if(te.current){var e=P(te.current.type);if(e)return`
22
22
 
23
- Check the render method of \``+e+"`."}return""}}function sr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
23
+ Check the render method of \``+e+"`."}return""}}function fr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
24
24
 
25
- Check your code at `+r+":"+t+"."}return""}}var Oe={};function fr(e){{var r=we();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
25
+ Check your code at `+r+":"+t+"."}return""}}var Se={};function lr(e){{var r=Oe();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 Ce(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=fr(r);if(Oe[t])return;Oe[t]=!0;var n="";e&&e._owner&&e._owner!==re.current&&(n=" It was passed a child from "+P(e._owner.type)+"."),A(e),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,n),A(null)}}function Se(e,r){{if(typeof e!="object")return;if(Q(e))for(var t=0;t<e.length;t++){var n=e[t];ne(n)&&Ce(n,r)}else if(ne(e))e._store&&(e._store.validated=!0);else if(e){var u=We(e);if(typeof u=="function"&&u!==e.entries)for(var s=u.call(e),o;!(o=s.next()).done;)ne(o.value)&&Ce(o.value,r)}}}function cr(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===f||r.$$typeof===h))t=r.propTypes;else return;if(t){var n=P(r);He(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!te){te=!0;var u=P(r);E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",u||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function lr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){A(e),E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),A(null);break}}e.ref!==null&&(A(e),E("Invalid attribute `ref` supplied to `React.Fragment`."),A(null))}}function Pe(e,r,t,n,u,s){{var o=$e(e);if(!o){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" 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 m=sr(u);m?a+=m:a+=we();var c;e===null?c="null":Q(e)?c="array":e!==void 0&&e.$$typeof===y?(c="<"+(P(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):c=typeof e,E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",c,a)}var l=ur(e,r,t,u,s);if(l==null)return l;if(o){var C=r.children;if(C!==void 0)if(n)if(Q(C)){for(var F=0;F<C.length;F++)Se(C[F],e);Object.freeze&&Object.freeze(C)}else E("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 Se(C,e)}return e===b?lr(l):cr(l),l}}function dr(e,r,t){return Pe(e,r,t,!0)}function vr(e,r,t){return Pe(e,r,t,!1)}var pr=vr,gr=dr;W.Fragment=b,W.jsx=pr,W.jsxs=gr}()),W}(function(d){process.env.NODE_ENV==="production"?d.exports=ke():d.exports=De()})(xe);const Y=K.jsx,U=_.createContext({children:void 0,Navigate:void 0,Outlet:void 0,translate:void 0,useAuth:void 0,useLocation:void 0}),Ae=({children:d,translate:y,useAuth:g,Outlet:b,Navigate:p,useLocation:T})=>{const i=_.useMemo(()=>({Navigate:p,Outlet:b,translate:y,useAuth:g,useLocation:T}),[p,b,y,g,T]);return Y(U.Provider,{value:i,children:d})},V=d=>`RequireAuth require « ${d} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Fe=({Fallback:d,loginPath:y="/login",...g})=>{var O,v,h,R;const{useLocation:b=g.useLocation,useAuth:p=g.useAuth,Outlet:T=g.Outlet,Navigate:i=g.Navigate}=_.useContext(U);if(p===void 0)throw new Error(V("useAuth"));if(b===void 0)throw new Error(V("useLocation"));if(T===void 0)throw new Error(V("Outlet"));if(i===void 0)throw new Error(V("Navigate"));const{isLogged:w}=p(),f=b();return w?Y(_.Suspense,{fallback:d,children:(v=(O=f.state)==null?void 0:O.from)!=null&&v.state&&((R=(h=f.state)==null?void 0:h.from)==null?void 0:R.pathname)===y?Y(i,{to:f.state.from.state.from.pathname+f.state.from.state.from.search,replace:!0}):Y(T,{})}):Y(i,{to:y,state:{from:f},replace:!0})},Ie=d=>{const{unknownErrorTranslationKey:y="error.unknownError"}=d||{},{translate:g=d==null?void 0:d.translate}=_.useContext(U);return{printError:_.useCallback(p=>{var w,f,O,v,h,R,x,L,$;const T=g?g(y):"Unknown error",{response:i}=p||{};return p!=null&&p.reason?String(p.reason):(w=i==null?void 0:i.data)!=null&&w.reason?String(i.data.reason):(f=i==null?void 0:i.data)!=null&&f.message?String(i.data.message):(v=(O=i==null?void 0:i.data)==null?void 0:O.detail)!=null&&v.length&&Array.isArray((h=i==null?void 0:i.data)==null?void 0:h.detail)&&((x=(R=i==null?void 0:i.data)==null?void 0:R.detail[0])!=null&&x.msg)&&typeof(($=(L=i==null?void 0:i.data)==null?void 0:L.detail[0])==null?void 0:$.msg)=="string"?String(i.data.detail[0].msg):T},[g,y])}};S.InjectDependenciesContext=U,S.InjectDependenciesProvider=Ae,S.RequireAuth=Fe,S.useResponseError=Ie,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});
27
+ Check the top-level render call using <`+t+">.")}return r}}function Ce(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=lr(r);if(Se[t])return;Se[t]=!0;var n="";e&&e._owner&&e._owner!==te.current&&(n=" It was passed a child from "+P(e._owner.type)+"."),F(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,n),F(null)}}function Pe(e,r){{if(typeof e!="object")return;if(ee(e))for(var t=0;t<e.length;t++){var n=e[t];ae(n)&&Ce(n,r)}else if(ae(e))e._store&&(e._store.validated=!0);else if(e){var u=Ye(e);if(typeof u=="function"&&u!==e.entries)for(var s=u.call(e),i;!(i=s.next()).done;)ae(i.value)&&Ce(i.value,r)}}}function dr(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===f||r.$$typeof===y))t=r.propTypes;else return;if(t){var n=P(r);Ze(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!ne){ne=!0;var u=P(r);b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",u||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function vr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){F(e),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),F(null);break}}e.ref!==null&&(F(e),b("Invalid attribute `ref` supplied to `React.Fragment`."),F(null))}}function je(e,r,t,n,u,s){{var i=$e(e);if(!i){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" 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 R=fr(u);R?a+=R:a+=Oe();var l;e===null?l="null":ee(e)?l="array":e!==void 0&&e.$$typeof===h?(l="<"+(P(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):l=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",l,a)}var d=cr(e,r,t,u,s);if(d==null)return d;if(i){var S=r.children;if(S!==void 0)if(n)if(ee(S)){for(var I=0;I<S.length;I++)Pe(S[I],e);Object.freeze&&Object.freeze(S)}else b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Pe(S,e)}return e===E?vr(d):dr(d),d}}function pr(e,r,t){return je(e,r,t,!0)}function gr(e,r,t){return je(e,r,t,!1)}var hr=gr,Er=pr;M.Fragment=E,M.jsx=hr,M.jsxs=Er}()),M}(function(c){process.env.NODE_ENV==="production"?c.exports=De():c.exports=Ae()})(ke);const D=q.jsx,Y=_.createContext({children:void 0,Navigate:void 0,Outlet:void 0,translate:void 0,useAuth:void 0,useLocation:void 0}),Fe=({children:c,translate:h,useAuth:g,Outlet:E,Navigate:v,useLocation:m,useGoogleTagManager:o})=>{const w=_.useMemo(()=>({Navigate:v,Outlet:E,translate:h,useAuth:g,useGoogleTagManager:o,useLocation:m}),[v,E,h,g,o,m]);return D(Y.Provider,{value:w,children:c})},U=c=>`RequireAuth require « ${c} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ie=({Fallback:c,loginPath:h="/login",...g})=>{var O,p,y,T;const{useLocation:E=g.useLocation,useAuth:v=g.useAuth,Outlet:m=g.Outlet,Navigate:o=g.Navigate}=_.useContext(Y);if(v===void 0)throw new Error(U("useAuth"));if(E===void 0)throw new Error(U("useLocation"));if(m===void 0)throw new Error(U("Outlet"));if(o===void 0)throw new Error(U("Navigate"));const{isLogged:w}=v(),f=E();return w?D(_.Suspense,{fallback:c,children:(p=(O=f.state)==null?void 0:O.from)!=null&&p.state&&((T=(y=f.state)==null?void 0:y.from)==null?void 0:T.pathname)===h?D(o,{to:f.state.from.state.from.pathname+f.state.from.state.from.search,replace:!0}):D(m,{})}):D(o,{to:h,state:{from:f},replace:!0})},H=c=>`GTMSendPageView require « ${c} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Le=({...c})=>{const{useLocation:h=c.useLocation,Outlet:g=c.Outlet,useGoogleTagManager:E=c.useGoogleTagManager}=_.useContext(Y);if(h===void 0)throw new Error(H("useLocation"));if(g===void 0)throw new Error(H("Outlet"));if(E===void 0)throw new Error(H("useGoogleTagManager"));const{pathname:v}=h(),{sendEvent:m}=E();return _.useEffect(()=>{m({event:"pageView",pathname:v})},[v,m]),D(g,{})},Me=c=>{const{unknownErrorTranslationKey:h="error.unknownError"}=c||{},{translate:g=c==null?void 0:c.translate}=_.useContext(Y);return{printError:_.useCallback(v=>{var w,f,O,p,y,T,x,W,G;const m=g?g(h):"Unknown error",{response:o}=v||{};return v!=null&&v.reason?String(v.reason):(w=o==null?void 0:o.data)!=null&&w.reason?String(o.data.reason):(f=o==null?void 0:o.data)!=null&&f.message?String(o.data.message):(p=(O=o==null?void 0:o.data)==null?void 0:O.detail)!=null&&p.length&&Array.isArray((y=o==null?void 0:o.data)==null?void 0:y.detail)&&((x=(T=o==null?void 0:o.data)==null?void 0:T.detail[0])!=null&&x.msg)&&typeof((G=(W=o==null?void 0:o.data)==null?void 0:W.detail[0])==null?void 0:G.msg)=="string"?String(o.data.detail[0].msg):m},[g,h])}};C.GTMSendPageView=Le,C.InjectDependenciesContext=Y,C.InjectDependenciesProvider=Fe,C.RequireAuth=Ie,C.useResponseError=Me,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tracktor/shared-module",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "types": "./dist/main.d.ts",