@tracktor/shared-module 2.32.0 → 2.34.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/dist/chat/types.d.ts +1 -0
- package/dist/context/ChatProvider.d.ts +3 -1
- package/dist/hooks/useChat.d.ts +3 -2
- package/dist/main.js +398 -390
- package/dist/main.umd.cjs +5 -5
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import le from "axios";
|
|
2
|
-
import _e, { useMemo as
|
|
2
|
+
import _e, { useMemo as ce, createContext as ve, useContext as O, useEffect as P, useState as L, Suspense as be, useRef as oe, useCallback as A } from "react";
|
|
3
3
|
const Xe = (e, t) => {
|
|
4
|
-
const
|
|
4
|
+
const n = le.CancelToken.source(), o = le({
|
|
5
5
|
...e,
|
|
6
6
|
...t,
|
|
7
|
-
cancelToken:
|
|
7
|
+
cancelToken: n.token
|
|
8
8
|
}).then(({ data: s }) => s);
|
|
9
9
|
return o.cancel = () => {
|
|
10
|
-
|
|
10
|
+
n.cancel("Query was cancelled");
|
|
11
11
|
}, o;
|
|
12
|
-
},
|
|
13
|
-
Object.entries(e).map(([t,
|
|
12
|
+
}, Re = 3e4, ue = 1e3, se = (e) => Array.isArray(e) ? e.map(se) : e !== null && typeof e == "object" ? Object.fromEntries(
|
|
13
|
+
Object.entries(e).map(([t, n]) => [
|
|
14
14
|
t.replace(/_([a-z])/g, (o, s) => s.toUpperCase()),
|
|
15
|
-
|
|
15
|
+
se(n)
|
|
16
16
|
])
|
|
17
|
-
) : e,
|
|
18
|
-
Object.entries(e).map(([t,
|
|
17
|
+
) : e, ae = (e) => Array.isArray(e) ? e.map(ae) : e !== null && typeof e == "object" ? Object.fromEntries(
|
|
18
|
+
Object.entries(e).map(([t, n]) => [
|
|
19
19
|
t.replace(/[A-Z]/g, (o) => `_${o.toLowerCase()}`),
|
|
20
|
-
|
|
20
|
+
ae(n)
|
|
21
21
|
])
|
|
22
22
|
) : e;
|
|
23
23
|
class Se {
|
|
@@ -50,12 +50,12 @@ class Se {
|
|
|
50
50
|
if (!t)
|
|
51
51
|
return;
|
|
52
52
|
this.intentionalClose = !1;
|
|
53
|
-
const
|
|
53
|
+
const n = this.url.includes("?") ? "&" : "?", o = `${this.url}${n}token=${t}`;
|
|
54
54
|
this.ws = new WebSocket(o), this.ws.onopen = () => {
|
|
55
55
|
this._connected = !0, this.reconnectAttempt = 0, this.onConnectionChange?.(!0), this.rejoinThreads(), this.flushPendingMessages();
|
|
56
56
|
}, this.ws.onmessage = (s) => {
|
|
57
57
|
try {
|
|
58
|
-
const a = JSON.parse(s.data), c =
|
|
58
|
+
const a = JSON.parse(s.data), c = se(a);
|
|
59
59
|
c.type === "ready" && (this._ready = !0), this.onEvent?.(c);
|
|
60
60
|
} catch {
|
|
61
61
|
}
|
|
@@ -73,29 +73,29 @@ class Se {
|
|
|
73
73
|
leaveThread(t) {
|
|
74
74
|
this.joinedThreads.delete(t), this.send({ threadId: t, type: "leave_thread" });
|
|
75
75
|
}
|
|
76
|
-
sendMessage(t,
|
|
77
|
-
if (
|
|
76
|
+
sendMessage(t, n) {
|
|
77
|
+
if (n.length > ue)
|
|
78
78
|
throw new Error(`Message body exceeds maximum length of ${ue} characters`);
|
|
79
|
-
this.send({ body:
|
|
79
|
+
this.send({ body: n, threadId: t, type: "send_message" });
|
|
80
80
|
}
|
|
81
81
|
markRead(t) {
|
|
82
82
|
this.send({ threadId: t, type: "mark_read" });
|
|
83
83
|
}
|
|
84
|
-
listThreads(t,
|
|
85
|
-
this.send({ limit: t, offset:
|
|
84
|
+
listThreads(t, n) {
|
|
85
|
+
this.send({ limit: t, offset: n, type: "list_threads" });
|
|
86
86
|
}
|
|
87
87
|
send(t) {
|
|
88
88
|
if (!this.ws || this.ws.readyState !== WebSocket.OPEN) {
|
|
89
89
|
this.pendingMessages.push(t);
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
92
|
-
this.ws.send(JSON.stringify(
|
|
92
|
+
this.ws.send(JSON.stringify(ae(t)));
|
|
93
93
|
}
|
|
94
94
|
flushPendingMessages() {
|
|
95
95
|
const t = [...this.pendingMessages];
|
|
96
96
|
this.pendingMessages = [];
|
|
97
|
-
for (const
|
|
98
|
-
this.send(
|
|
97
|
+
for (const n of t)
|
|
98
|
+
this.send(n);
|
|
99
99
|
}
|
|
100
100
|
rejoinThreads() {
|
|
101
101
|
for (const t of this.joinedThreads)
|
|
@@ -103,7 +103,7 @@ class Se {
|
|
|
103
103
|
}
|
|
104
104
|
scheduleReconnect() {
|
|
105
105
|
this.clearReconnectTimer();
|
|
106
|
-
const t = Math.min(this.reconnectBaseDelay * 2 ** this.reconnectAttempt,
|
|
106
|
+
const t = Math.min(this.reconnectBaseDelay * 2 ** this.reconnectAttempt, Re);
|
|
107
107
|
this.reconnectAttempt++, this.reconnectTimer = setTimeout(() => {
|
|
108
108
|
this.connect();
|
|
109
109
|
}, t);
|
|
@@ -112,13 +112,13 @@ class Se {
|
|
|
112
112
|
this.reconnectTimer !== null && (clearTimeout(this.reconnectTimer), this.reconnectTimer = null);
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
var
|
|
115
|
+
var B = { exports: {} }, U = {};
|
|
116
116
|
var de;
|
|
117
117
|
function Te() {
|
|
118
|
-
if (de) return
|
|
118
|
+
if (de) return U;
|
|
119
119
|
de = 1;
|
|
120
120
|
var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
121
|
-
function
|
|
121
|
+
function n(o, s, a) {
|
|
122
122
|
var c = null;
|
|
123
123
|
if (a !== void 0 && (c = "" + a), s.key !== void 0 && (c = "" + s.key), "key" in s) {
|
|
124
124
|
a = {};
|
|
@@ -133,279 +133,279 @@ function Te() {
|
|
|
133
133
|
props: a
|
|
134
134
|
};
|
|
135
135
|
}
|
|
136
|
-
return
|
|
136
|
+
return U.Fragment = t, U.jsx = n, U.jsxs = n, U;
|
|
137
137
|
}
|
|
138
|
-
var
|
|
138
|
+
var M = {};
|
|
139
139
|
var fe;
|
|
140
140
|
function Ce() {
|
|
141
141
|
return fe || (fe = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
142
|
-
function e(
|
|
143
|
-
if (
|
|
144
|
-
if (typeof
|
|
145
|
-
return
|
|
146
|
-
if (typeof
|
|
147
|
-
switch (
|
|
148
|
-
case
|
|
142
|
+
function e(r) {
|
|
143
|
+
if (r == null) return null;
|
|
144
|
+
if (typeof r == "function")
|
|
145
|
+
return r.$$typeof === ee ? null : r.displayName || r.name || null;
|
|
146
|
+
if (typeof r == "string") return r;
|
|
147
|
+
switch (r) {
|
|
148
|
+
case C:
|
|
149
149
|
return "Fragment";
|
|
150
150
|
case d:
|
|
151
151
|
return "Profiler";
|
|
152
|
-
case
|
|
152
|
+
case m:
|
|
153
153
|
return "StrictMode";
|
|
154
154
|
case I:
|
|
155
155
|
return "Suspense";
|
|
156
|
-
case B:
|
|
157
|
-
return "SuspenseList";
|
|
158
156
|
case q:
|
|
157
|
+
return "SuspenseList";
|
|
158
|
+
case Z:
|
|
159
159
|
return "Activity";
|
|
160
160
|
}
|
|
161
|
-
if (typeof
|
|
162
|
-
switch (typeof
|
|
161
|
+
if (typeof r == "object")
|
|
162
|
+
switch (typeof r.tag == "number" && console.error(
|
|
163
163
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
164
|
-
),
|
|
165
|
-
case
|
|
164
|
+
), r.$$typeof) {
|
|
165
|
+
case T:
|
|
166
166
|
return "Portal";
|
|
167
|
-
case
|
|
168
|
-
return
|
|
167
|
+
case E:
|
|
168
|
+
return r.displayName || "Context";
|
|
169
|
+
case y:
|
|
170
|
+
return (r._context.displayName || "Context") + ".Consumer";
|
|
169
171
|
case S:
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
return
|
|
174
|
-
case
|
|
175
|
-
|
|
176
|
-
case Y:
|
|
177
|
-
p = n._payload, n = n._init;
|
|
172
|
+
var f = r.render;
|
|
173
|
+
return r = r.displayName, r || (r = f.displayName || f.name || "", r = r !== "" ? "ForwardRef(" + r + ")" : "ForwardRef"), r;
|
|
174
|
+
case X:
|
|
175
|
+
return f = r.displayName || null, f !== null ? f : e(r.type) || "Memo";
|
|
176
|
+
case F:
|
|
177
|
+
f = r._payload, r = r._init;
|
|
178
178
|
try {
|
|
179
|
-
return e(
|
|
179
|
+
return e(r(f));
|
|
180
180
|
} catch {
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
return null;
|
|
184
184
|
}
|
|
185
|
-
function t(
|
|
186
|
-
return "" +
|
|
185
|
+
function t(r) {
|
|
186
|
+
return "" + r;
|
|
187
187
|
}
|
|
188
|
-
function r
|
|
188
|
+
function n(r) {
|
|
189
189
|
try {
|
|
190
|
-
t(
|
|
191
|
-
var
|
|
190
|
+
t(r);
|
|
191
|
+
var f = !1;
|
|
192
192
|
} catch {
|
|
193
|
-
|
|
193
|
+
f = !0;
|
|
194
194
|
}
|
|
195
|
-
if (
|
|
196
|
-
|
|
197
|
-
var
|
|
198
|
-
return
|
|
199
|
-
|
|
195
|
+
if (f) {
|
|
196
|
+
f = console;
|
|
197
|
+
var _ = f.error, b = typeof Symbol == "function" && Symbol.toStringTag && r[Symbol.toStringTag] || r.constructor.name || "Object";
|
|
198
|
+
return _.call(
|
|
199
|
+
f,
|
|
200
200
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
201
|
-
|
|
202
|
-
), t(
|
|
201
|
+
b
|
|
202
|
+
), t(r);
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
|
-
function o(
|
|
206
|
-
if (
|
|
207
|
-
if (typeof
|
|
205
|
+
function o(r) {
|
|
206
|
+
if (r === C) return "<>";
|
|
207
|
+
if (typeof r == "object" && r !== null && r.$$typeof === F)
|
|
208
208
|
return "<...>";
|
|
209
209
|
try {
|
|
210
|
-
var
|
|
211
|
-
return
|
|
210
|
+
var f = e(r);
|
|
211
|
+
return f ? "<" + f + ">" : "<...>";
|
|
212
212
|
} catch {
|
|
213
213
|
return "<...>";
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
216
|
function s() {
|
|
217
|
-
var
|
|
218
|
-
return
|
|
217
|
+
var r = D.A;
|
|
218
|
+
return r === null ? null : r.getOwner();
|
|
219
219
|
}
|
|
220
220
|
function a() {
|
|
221
221
|
return Error("react-stack-top-frame");
|
|
222
222
|
}
|
|
223
|
-
function c(
|
|
224
|
-
if (
|
|
225
|
-
var
|
|
226
|
-
if (
|
|
223
|
+
function c(r) {
|
|
224
|
+
if (V.call(r, "key")) {
|
|
225
|
+
var f = Object.getOwnPropertyDescriptor(r, "key").get;
|
|
226
|
+
if (f && f.isReactWarning) return !1;
|
|
227
227
|
}
|
|
228
|
-
return
|
|
228
|
+
return r.key !== void 0;
|
|
229
229
|
}
|
|
230
|
-
function l(
|
|
231
|
-
function
|
|
232
|
-
|
|
230
|
+
function l(r, f) {
|
|
231
|
+
function _() {
|
|
232
|
+
w || (w = !0, console.error(
|
|
233
233
|
"%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://react.dev/link/special-props)",
|
|
234
|
-
|
|
234
|
+
f
|
|
235
235
|
));
|
|
236
236
|
}
|
|
237
|
-
|
|
238
|
-
get:
|
|
237
|
+
_.isReactWarning = !0, Object.defineProperty(r, "key", {
|
|
238
|
+
get: _,
|
|
239
239
|
configurable: !0
|
|
240
240
|
});
|
|
241
241
|
}
|
|
242
242
|
function u() {
|
|
243
|
-
var
|
|
244
|
-
return
|
|
243
|
+
var r = e(this.type);
|
|
244
|
+
return k[r] || (k[r] = !0, console.error(
|
|
245
245
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
246
|
-
)),
|
|
246
|
+
)), r = this.props.ref, r !== void 0 ? r : null;
|
|
247
247
|
}
|
|
248
|
-
function
|
|
249
|
-
var
|
|
250
|
-
return
|
|
248
|
+
function p(r, f, _, b, H, re) {
|
|
249
|
+
var R = _.ref;
|
|
250
|
+
return r = {
|
|
251
251
|
$$typeof: j,
|
|
252
|
-
type:
|
|
253
|
-
key:
|
|
254
|
-
props:
|
|
255
|
-
_owner:
|
|
256
|
-
}, (
|
|
252
|
+
type: r,
|
|
253
|
+
key: f,
|
|
254
|
+
props: _,
|
|
255
|
+
_owner: b
|
|
256
|
+
}, (R !== void 0 ? R : null) !== null ? Object.defineProperty(r, "ref", {
|
|
257
257
|
enumerable: !1,
|
|
258
258
|
get: u
|
|
259
|
-
}) : Object.defineProperty(
|
|
259
|
+
}) : Object.defineProperty(r, "ref", { enumerable: !1, value: null }), r._store = {}, Object.defineProperty(r._store, "validated", {
|
|
260
260
|
configurable: !1,
|
|
261
261
|
enumerable: !1,
|
|
262
262
|
writable: !0,
|
|
263
263
|
value: 0
|
|
264
|
-
}), Object.defineProperty(
|
|
264
|
+
}), Object.defineProperty(r, "_debugInfo", {
|
|
265
265
|
configurable: !1,
|
|
266
266
|
enumerable: !1,
|
|
267
267
|
writable: !0,
|
|
268
268
|
value: null
|
|
269
|
-
}), Object.defineProperty(
|
|
269
|
+
}), Object.defineProperty(r, "_debugStack", {
|
|
270
270
|
configurable: !1,
|
|
271
271
|
enumerable: !1,
|
|
272
272
|
writable: !0,
|
|
273
|
-
value:
|
|
274
|
-
}), Object.defineProperty(
|
|
273
|
+
value: H
|
|
274
|
+
}), Object.defineProperty(r, "_debugTask", {
|
|
275
275
|
configurable: !1,
|
|
276
276
|
enumerable: !1,
|
|
277
277
|
writable: !0,
|
|
278
|
-
value:
|
|
279
|
-
}), Object.freeze && (Object.freeze(
|
|
278
|
+
value: re
|
|
279
|
+
}), Object.freeze && (Object.freeze(r.props), Object.freeze(r)), r;
|
|
280
280
|
}
|
|
281
|
-
function i(
|
|
282
|
-
var
|
|
283
|
-
if (
|
|
284
|
-
if (
|
|
285
|
-
if (
|
|
286
|
-
for (
|
|
287
|
-
|
|
288
|
-
Object.freeze && Object.freeze(
|
|
281
|
+
function i(r, f, _, b, H, re) {
|
|
282
|
+
var R = f.children;
|
|
283
|
+
if (R !== void 0)
|
|
284
|
+
if (b)
|
|
285
|
+
if (te(R)) {
|
|
286
|
+
for (b = 0; b < R.length; b++)
|
|
287
|
+
h(R[b]);
|
|
288
|
+
Object.freeze && Object.freeze(R);
|
|
289
289
|
} else
|
|
290
290
|
console.error(
|
|
291
291
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
292
292
|
);
|
|
293
|
-
else
|
|
294
|
-
if (
|
|
295
|
-
|
|
296
|
-
var
|
|
293
|
+
else h(R);
|
|
294
|
+
if (V.call(f, "key")) {
|
|
295
|
+
R = e(r);
|
|
296
|
+
var $ = Object.keys(f).filter(function(Ee) {
|
|
297
297
|
return Ee !== "key";
|
|
298
298
|
});
|
|
299
|
-
|
|
299
|
+
b = 0 < $.length ? "{key: someKey, " + $.join(": ..., ") + ": ...}" : "{key: someKey}", G[R + b] || ($ = 0 < $.length ? "{" + $.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
300
300
|
`A props object containing a "key" prop is being spread into JSX:
|
|
301
301
|
let props = %s;
|
|
302
302
|
<%s {...props} />
|
|
303
303
|
React keys must be passed directly to JSX without using spread:
|
|
304
304
|
let props = %s;
|
|
305
305
|
<%s key={someKey} {...props} />`,
|
|
306
|
-
R,
|
|
307
306
|
b,
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
307
|
+
R,
|
|
308
|
+
$,
|
|
309
|
+
R
|
|
310
|
+
), G[R + b] = !0);
|
|
311
311
|
}
|
|
312
|
-
if (
|
|
313
|
-
|
|
314
|
-
for (var
|
|
315
|
-
|
|
316
|
-
} else
|
|
317
|
-
return
|
|
318
|
-
|
|
319
|
-
typeof
|
|
320
|
-
),
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
312
|
+
if (R = null, _ !== void 0 && (n(_), R = "" + _), c(f) && (n(f.key), R = "" + f.key), "key" in f) {
|
|
313
|
+
_ = {};
|
|
314
|
+
for (var ne in f)
|
|
315
|
+
ne !== "key" && (_[ne] = f[ne]);
|
|
316
|
+
} else _ = f;
|
|
317
|
+
return R && l(
|
|
318
|
+
_,
|
|
319
|
+
typeof r == "function" ? r.displayName || r.name || "Unknown" : r
|
|
320
|
+
), p(
|
|
321
|
+
r,
|
|
322
|
+
R,
|
|
323
|
+
_,
|
|
324
324
|
s(),
|
|
325
|
-
|
|
326
|
-
|
|
325
|
+
H,
|
|
326
|
+
re
|
|
327
327
|
);
|
|
328
328
|
}
|
|
329
|
-
function
|
|
330
|
-
|
|
329
|
+
function h(r) {
|
|
330
|
+
g(r) ? r._store && (r._store.validated = 1) : typeof r == "object" && r !== null && r.$$typeof === F && (r._payload.status === "fulfilled" ? g(r._payload.value) && r._payload.value._store && (r._payload.value._store.validated = 1) : r._store && (r._store.validated = 1));
|
|
331
331
|
}
|
|
332
|
-
function
|
|
333
|
-
return typeof
|
|
332
|
+
function g(r) {
|
|
333
|
+
return typeof r == "object" && r !== null && r.$$typeof === j;
|
|
334
334
|
}
|
|
335
|
-
var
|
|
335
|
+
var v = _e, j = /* @__PURE__ */ Symbol.for("react.transitional.element"), T = /* @__PURE__ */ Symbol.for("react.portal"), C = /* @__PURE__ */ Symbol.for("react.fragment"), m = /* @__PURE__ */ Symbol.for("react.strict_mode"), d = /* @__PURE__ */ Symbol.for("react.profiler"), y = /* @__PURE__ */ Symbol.for("react.consumer"), E = /* @__PURE__ */ Symbol.for("react.context"), S = /* @__PURE__ */ Symbol.for("react.forward_ref"), I = /* @__PURE__ */ Symbol.for("react.suspense"), q = /* @__PURE__ */ Symbol.for("react.suspense_list"), X = /* @__PURE__ */ Symbol.for("react.memo"), F = /* @__PURE__ */ Symbol.for("react.lazy"), Z = /* @__PURE__ */ Symbol.for("react.activity"), ee = /* @__PURE__ */ Symbol.for("react.client.reference"), D = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, V = Object.prototype.hasOwnProperty, te = Array.isArray, Y = console.createTask ? console.createTask : function() {
|
|
336
336
|
return null;
|
|
337
337
|
};
|
|
338
|
-
|
|
339
|
-
react_stack_bottom_frame: function(
|
|
340
|
-
return
|
|
338
|
+
v = {
|
|
339
|
+
react_stack_bottom_frame: function(r) {
|
|
340
|
+
return r();
|
|
341
341
|
}
|
|
342
342
|
};
|
|
343
|
-
var
|
|
344
|
-
|
|
343
|
+
var w, k = {}, Q = v.react_stack_bottom_frame.bind(
|
|
344
|
+
v,
|
|
345
345
|
a
|
|
346
|
-
)(),
|
|
347
|
-
|
|
348
|
-
var
|
|
346
|
+
)(), J = Y(o(a)), G = {};
|
|
347
|
+
M.Fragment = C, M.jsx = function(r, f, _) {
|
|
348
|
+
var b = 1e4 > D.recentlyCreatedOwnerStacks++;
|
|
349
349
|
return i(
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
350
|
+
r,
|
|
351
|
+
f,
|
|
352
|
+
_,
|
|
353
353
|
!1,
|
|
354
|
-
|
|
355
|
-
|
|
354
|
+
b ? Error("react-stack-top-frame") : Q,
|
|
355
|
+
b ? Y(o(r)) : J
|
|
356
356
|
);
|
|
357
|
-
},
|
|
358
|
-
var
|
|
357
|
+
}, M.jsxs = function(r, f, _) {
|
|
358
|
+
var b = 1e4 > D.recentlyCreatedOwnerStacks++;
|
|
359
359
|
return i(
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
360
|
+
r,
|
|
361
|
+
f,
|
|
362
|
+
_,
|
|
363
363
|
!0,
|
|
364
|
-
|
|
365
|
-
|
|
364
|
+
b ? Error("react-stack-top-frame") : Q,
|
|
365
|
+
b ? Y(o(r)) : J
|
|
366
366
|
);
|
|
367
367
|
};
|
|
368
|
-
})()),
|
|
368
|
+
})()), M;
|
|
369
369
|
}
|
|
370
370
|
var pe;
|
|
371
371
|
function Ae() {
|
|
372
|
-
return pe || (pe = 1, process.env.NODE_ENV === "production" ?
|
|
372
|
+
return pe || (pe = 1, process.env.NODE_ENV === "production" ? B.exports = Te() : B.exports = Ce()), B.exports;
|
|
373
373
|
}
|
|
374
374
|
var N = Ae();
|
|
375
375
|
const Ze = ({ IMaskMixin: e, ...t }) => {
|
|
376
|
-
const
|
|
376
|
+
const n = ce(
|
|
377
377
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
378
378
|
() => e(({ TextField: o, ...s }) => /* @__PURE__ */ N.jsx(o, { ...s })),
|
|
379
379
|
[e]
|
|
380
380
|
);
|
|
381
|
-
return /* @__PURE__ */ N.jsx(
|
|
382
|
-
},
|
|
383
|
-
const s =
|
|
381
|
+
return /* @__PURE__ */ N.jsx(n, { ...t });
|
|
382
|
+
}, x = ve({}), et = ({ children: e, apiURL: t, libraries: n, localStorageKeys: o }) => {
|
|
383
|
+
const s = ce(
|
|
384
384
|
() => ({
|
|
385
385
|
apiURL: t,
|
|
386
|
-
libraries:
|
|
386
|
+
libraries: n,
|
|
387
387
|
localStorageKeys: o
|
|
388
388
|
}),
|
|
389
|
-
[t,
|
|
389
|
+
[t, n, o]
|
|
390
390
|
);
|
|
391
|
-
return /* @__PURE__ */ N.jsx(
|
|
391
|
+
return /* @__PURE__ */ N.jsx(x.Provider, { value: s, children: e });
|
|
392
392
|
}, tt = ({ data: e, ...t }) => {
|
|
393
|
-
const { libraries:
|
|
393
|
+
const { libraries: n } = O(x), o = t?.reactRouter || n?.reactRouter, s = t?.gtm || n?.gtm;
|
|
394
394
|
if (!o)
|
|
395
395
|
throw new Error(
|
|
396
396
|
"React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView."
|
|
397
397
|
);
|
|
398
398
|
if (!s)
|
|
399
399
|
throw new Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");
|
|
400
|
-
const { useGoogleTagManager: a } = s, { useLocation: c, Outlet: l } = o, { pathname: u } = c(), { sendEvent:
|
|
401
|
-
return
|
|
402
|
-
|
|
400
|
+
const { useGoogleTagManager: a } = s, { useLocation: c, Outlet: l } = o, { pathname: u } = c(), { sendEvent: p } = a();
|
|
401
|
+
return P(() => {
|
|
402
|
+
p({
|
|
403
403
|
event: "pageView",
|
|
404
404
|
pathname: u,
|
|
405
405
|
...e
|
|
406
406
|
});
|
|
407
|
-
}, [e, u,
|
|
408
|
-
},
|
|
407
|
+
}, [e, u, p]), /* @__PURE__ */ N.jsx(l, {});
|
|
408
|
+
}, W = (() => {
|
|
409
409
|
try {
|
|
410
410
|
return typeof global == "object" && global !== null && ("HermesInternal" in global || // Hermes JS engine
|
|
411
411
|
"__fbBatchedBridge" in global || // RN Bridge
|
|
@@ -416,26 +416,26 @@ const Ze = ({ IMaskMixin: e, ...t }) => {
|
|
|
416
416
|
})(), je = "user", rt = ({
|
|
417
417
|
tokenTypeKey: e = "tokenType",
|
|
418
418
|
tokenKey: t = "accessToken",
|
|
419
|
-
postContentType:
|
|
419
|
+
postContentType: n = "application/json",
|
|
420
420
|
...o
|
|
421
421
|
}) => {
|
|
422
|
-
const { apiURL: s = o.apiURL, libraries: a, localStorageKeys: c } =
|
|
422
|
+
const { apiURL: s = o.apiURL, libraries: a, localStorageKeys: c } = O(x), l = o?.userLocalStorageKey || c?.user || je, u = o?.axios || a?.axios;
|
|
423
423
|
if (!u)
|
|
424
424
|
throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
425
|
-
if (!u?.defaults ||
|
|
425
|
+
if (!u?.defaults || W)
|
|
426
426
|
return null;
|
|
427
427
|
if (typeof window < "u" && window.localStorage) {
|
|
428
|
-
const
|
|
429
|
-
|
|
428
|
+
const p = localStorage.getItem(l), i = p ? JSON.parse(p) : null, h = i?.[e] ? i[e] : null, g = i?.[t] ? i[t] : null, v = p ? `${h} ${g}` : null;
|
|
429
|
+
v && (u.defaults.headers.common.Authorization = v);
|
|
430
430
|
}
|
|
431
|
-
return u.defaults.baseURL = s, u.defaults.headers.post["Content-Type"] =
|
|
431
|
+
return u.defaults.baseURL = s, u.defaults.headers.post["Content-Type"] = n, null;
|
|
432
432
|
}, nt = ({ language: e, ...t }) => {
|
|
433
|
-
const { libraries:
|
|
433
|
+
const { libraries: n } = O(x), o = t?.dayjs || n?.dayjs, s = t?.plugin || n?.dayjsPlugin;
|
|
434
434
|
if (!o)
|
|
435
435
|
throw new Error(
|
|
436
436
|
"Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props of InitializeDaysJSConfig."
|
|
437
437
|
);
|
|
438
|
-
return
|
|
438
|
+
return P(() => {
|
|
439
439
|
(async () => {
|
|
440
440
|
const c = e || navigator.language?.slice(0, 2) || "en";
|
|
441
441
|
s && s.forEach((l) => {
|
|
@@ -443,21 +443,21 @@ const Ze = ({ IMaskMixin: e, ...t }) => {
|
|
|
443
443
|
}), await import("dayjs/locale/en"), await import("dayjs/locale/fr"), o.locale(c);
|
|
444
444
|
})().then();
|
|
445
445
|
}, [o, s, e]), null;
|
|
446
|
-
},
|
|
446
|
+
}, ie = "hubspot-messages-iframe-container", z = "hs-show", ot = ({ hubId: e }) => (P(() => {
|
|
447
447
|
if (!e)
|
|
448
448
|
return;
|
|
449
449
|
const t = document.createElement("style");
|
|
450
450
|
t.textContent = `
|
|
451
|
-
div#${
|
|
452
|
-
div#${
|
|
451
|
+
div#${ie} { display: none !important; }
|
|
452
|
+
div#${ie}.${z} { display: initial !important; }
|
|
453
453
|
`, document.head.appendChild(t);
|
|
454
|
-
const
|
|
455
|
-
return
|
|
456
|
-
t.remove(),
|
|
454
|
+
const n = document.createElement("script");
|
|
455
|
+
return n.id = "hs-script-loader", n.src = `//js-eu1.hs-scripts.com/${e}.js`, n.async = !0, n.defer = !0, document.body.appendChild(n), () => {
|
|
456
|
+
t.remove(), n.remove();
|
|
457
457
|
};
|
|
458
|
-
}, [e]), null), st = ({ debug: e, resources: t, ...
|
|
459
|
-
const { libraries: o } =
|
|
460
|
-
if (
|
|
458
|
+
}, [e]), null), st = ({ debug: e, resources: t, ...n }) => {
|
|
459
|
+
const { libraries: o } = O(x), s = n?.i18 || o?.i18, { i18next: a, initReactI18next: c, languageDetector: l } = s || {};
|
|
460
|
+
if (W)
|
|
461
461
|
return null;
|
|
462
462
|
if (!s)
|
|
463
463
|
throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
@@ -482,25 +482,25 @@ const Ze = ({ IMaskMixin: e, ...t }) => {
|
|
|
482
482
|
}, at = ({
|
|
483
483
|
dsn: e,
|
|
484
484
|
integrations: t,
|
|
485
|
-
tracesSampleRate:
|
|
485
|
+
tracesSampleRate: n,
|
|
486
486
|
replaysSessionSampleRate: o,
|
|
487
487
|
replaysOnErrorSampleRate: s,
|
|
488
488
|
tracePropagationTargets: a,
|
|
489
489
|
ignoreErrors: c,
|
|
490
490
|
debug: l,
|
|
491
491
|
environment: u,
|
|
492
|
-
release:
|
|
492
|
+
release: p,
|
|
493
493
|
...i
|
|
494
494
|
}) => {
|
|
495
|
-
const { libraries:
|
|
496
|
-
if (!
|
|
495
|
+
const { libraries: h } = O(x), g = i?.sentry || h?.sentry, v = i?.reactRouter || h?.reactRouter;
|
|
496
|
+
if (!g)
|
|
497
497
|
throw new Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
498
|
-
if (!
|
|
498
|
+
if (!v)
|
|
499
499
|
throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
500
|
-
if (
|
|
500
|
+
if (g.isInitialized())
|
|
501
501
|
return null;
|
|
502
|
-
const { createRoutesFromChildren: j, matchRoutes:
|
|
503
|
-
return (l || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") &&
|
|
502
|
+
const { createRoutesFromChildren: j, matchRoutes: T, useLocation: C, useNavigationType: m } = v;
|
|
503
|
+
return (l || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") && g.init({
|
|
504
504
|
debug: l,
|
|
505
505
|
dsn: e,
|
|
506
506
|
environment: u || "production",
|
|
@@ -514,23 +514,23 @@ const Ze = ({ IMaskMixin: e, ...t }) => {
|
|
|
514
514
|
/vite:preloadError/
|
|
515
515
|
],
|
|
516
516
|
integrations: [
|
|
517
|
-
|
|
517
|
+
g.reactRouterV6BrowserTracingIntegration({
|
|
518
518
|
createRoutesFromChildren: j,
|
|
519
|
-
matchRoutes:
|
|
520
|
-
useEffect:
|
|
521
|
-
useLocation:
|
|
522
|
-
useNavigationType:
|
|
519
|
+
matchRoutes: T,
|
|
520
|
+
useEffect: P,
|
|
521
|
+
useLocation: C,
|
|
522
|
+
useNavigationType: m
|
|
523
523
|
}),
|
|
524
524
|
...t || []
|
|
525
525
|
],
|
|
526
|
-
release:
|
|
526
|
+
release: p,
|
|
527
527
|
replaysOnErrorSampleRate: s || 1,
|
|
528
528
|
replaysSessionSampleRate: o || 0.1,
|
|
529
529
|
tracePropagationTargets: a,
|
|
530
|
-
tracesSampleRate:
|
|
530
|
+
tracesSampleRate: n || 1
|
|
531
531
|
}), null;
|
|
532
|
-
}, it = () => (
|
|
533
|
-
if (
|
|
532
|
+
}, it = () => (P(() => {
|
|
533
|
+
if (W)
|
|
534
534
|
return;
|
|
535
535
|
const e = (t) => {
|
|
536
536
|
try {
|
|
@@ -541,47 +541,47 @@ const Ze = ({ IMaskMixin: e, ...t }) => {
|
|
|
541
541
|
return window.addEventListener("vite:preloadError", e), () => {
|
|
542
542
|
window.removeEventListener("vite:preloadError", e);
|
|
543
543
|
};
|
|
544
|
-
}, []), null), he = /* @__PURE__ */ new WeakMap(),
|
|
545
|
-
const { libraries: a, localStorageKeys: c } =
|
|
544
|
+
}, []), null), he = /* @__PURE__ */ new WeakMap(), ke = "user", ct = ({ Fallback: e, isLogged: t, loginPath: n = "/login", redirect401Path: o = "/login", ...s }) => {
|
|
545
|
+
const { libraries: a, localStorageKeys: c } = O(x), l = s?.reactRouter || a?.reactRouter, u = s?.axios || a?.axios, p = s?.localStorageKey || c?.user || ke;
|
|
546
546
|
if (!l)
|
|
547
547
|
throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
548
|
-
const [i,
|
|
549
|
-
return
|
|
548
|
+
const [i, h] = L(null), { useLocation: g, Navigate: v, Outlet: j } = l, T = g(), C = typeof t == "function" ? t() : !!t, m = typeof C == "boolean" ? C : C?.isLogged;
|
|
549
|
+
return P(() => {
|
|
550
550
|
he.has(u) || (he.set(u, !0), u.interceptors.response.use(
|
|
551
551
|
(d) => d,
|
|
552
|
-
(d) => (typeof d == "object" && d && "response" in d && d.response && typeof d.response == "object" && "status" in d.response && d.response && typeof d.response == "object" && "status" in d.response && d?.response?.status === 401 && (typeof d == "object" && d && "config" in d && d.config && typeof d.config == "object" && "headers" in d.config && d.config.headers && typeof d.config.headers == "object" && "Authorization" in d.config.headers && d.config.headers.Authorization && (u.defaults.headers.common.Authorization = null, typeof window < "u" && window.localStorage && localStorage.removeItem(
|
|
552
|
+
(d) => (typeof d == "object" && d && "response" in d && d.response && typeof d.response == "object" && "status" in d.response && d.response && typeof d.response == "object" && "status" in d.response && d?.response?.status === 401 && (typeof d == "object" && d && "config" in d && d.config && typeof d.config == "object" && "headers" in d.config && d.config.headers && typeof d.config.headers == "object" && "Authorization" in d.config.headers && d.config.headers.Authorization && (u.defaults.headers.common.Authorization = null, typeof window < "u" && window.localStorage && localStorage.removeItem(p)), h(o)), Promise.reject(d))
|
|
553
553
|
));
|
|
554
|
-
}, [u,
|
|
555
|
-
},
|
|
554
|
+
}, [u, p, o]), m && !i ? /* @__PURE__ */ N.jsx(be, { fallback: e, children: T.state?.from?.state && T.state?.from?.pathname === n ? /* @__PURE__ */ N.jsx(v, { to: T.state.from.state.from.pathname + T.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ N.jsx(j, {}) }) : /* @__PURE__ */ N.jsx(v, { to: n + T.search, state: { from: T }, replace: !0 });
|
|
555
|
+
}, Pe = (e) => e.charAt(0).toUpperCase() + e.slice(1).toLowerCase(), Oe = (e) => {
|
|
556
556
|
const t = e.split(/[/\\]/).pop() || "";
|
|
557
557
|
return t.substring(0, t.lastIndexOf("."));
|
|
558
558
|
}, xe = (e) => {
|
|
559
559
|
const o = e.split("/").filter((s) => s.length > 0).map((s) => s.replace(/\${([^}]*)}/g, "$1").split(/[_-]/).map((u) => u.charAt(0).toUpperCase() + u.slice(1)).join("")).join("");
|
|
560
560
|
return o.charAt(0).toLowerCase() + o.slice(1);
|
|
561
|
-
}, Ie = (e) => (e.split("/").pop() || e).replace(/\.json$/, "").replace(/^openapi\./, ""), Ne = (e, t,
|
|
562
|
-
const s = xe(t), a =
|
|
561
|
+
}, Ie = (e) => (e.split("/").pop() || e).replace(/\.json$/, "").replace(/^openapi\./, ""), Ne = (e, t, n, o) => {
|
|
562
|
+
const s = xe(t), a = Pe(n), c = `${s}${a}`;
|
|
563
563
|
return e && typeof e == "object" && "operationId" in e && o?.includes(String(e.operationId)) ? `${c}AsQuery` : c;
|
|
564
564
|
}, Le = (e, t) => {
|
|
565
|
-
const
|
|
565
|
+
const n = {};
|
|
566
566
|
return e?.forEach((o) => {
|
|
567
|
-
|
|
567
|
+
n[o] = {
|
|
568
568
|
query: {
|
|
569
569
|
useInfinite: !0,
|
|
570
570
|
useInfiniteQueryParam: "offset",
|
|
571
571
|
useQuery: !0
|
|
572
572
|
}
|
|
573
573
|
};
|
|
574
|
-
}), t?.filter((o) => !
|
|
575
|
-
|
|
574
|
+
}), t?.filter((o) => !n[o]).forEach((o) => {
|
|
575
|
+
n[o] = {
|
|
576
576
|
query: {
|
|
577
577
|
useQuery: !0
|
|
578
578
|
}
|
|
579
579
|
};
|
|
580
|
-
}), Object.keys(
|
|
581
|
-
}, lt = (e) => (Array.isArray(e) ? e : [e]).reduce((
|
|
582
|
-
const { output: s, useInfiniteIds: a, useQueryIds: c, input: l = "./openapi.json", customAxiosInstancePath: u, overrideApiName:
|
|
580
|
+
}), Object.keys(n).length ? n : void 0;
|
|
581
|
+
}, lt = (e) => (Array.isArray(e) ? e : [e]).reduce((n, o) => {
|
|
582
|
+
const { output: s, useInfiniteIds: a, useQueryIds: c, input: l = "./openapi.json", customAxiosInstancePath: u, overrideApiName: p } = o || {}, i = p || Ie(l), h = u || "./node_modules/@tracktor/shared-module/dist/axiosCustomInstance.ts";
|
|
583
583
|
return {
|
|
584
|
-
...
|
|
584
|
+
...n,
|
|
585
585
|
[i]: {
|
|
586
586
|
input: l,
|
|
587
587
|
output: {
|
|
@@ -592,16 +592,16 @@ const Ze = ({ IMaskMixin: e, ...t }) => {
|
|
|
592
592
|
...(a?.length || c?.length) && {
|
|
593
593
|
operations: Le(a, c)
|
|
594
594
|
},
|
|
595
|
-
header: (
|
|
595
|
+
header: (g) => [
|
|
596
596
|
"Generated by orval 🍺",
|
|
597
|
-
...
|
|
598
|
-
...
|
|
597
|
+
...g.title ? [g.title] : [],
|
|
598
|
+
...g.description ? [g.description] : []
|
|
599
599
|
],
|
|
600
600
|
mutator: {
|
|
601
|
-
name: Oe(
|
|
602
|
-
path:
|
|
601
|
+
name: Oe(h),
|
|
602
|
+
path: h
|
|
603
603
|
},
|
|
604
|
-
operationName: (
|
|
604
|
+
operationName: (g, v, j) => Ne(g, v, j, c),
|
|
605
605
|
query: {
|
|
606
606
|
useQuery: !0
|
|
607
607
|
}
|
|
@@ -616,8 +616,8 @@ const Ze = ({ IMaskMixin: e, ...t }) => {
|
|
|
616
616
|
client: "/v2/threads/ws",
|
|
617
617
|
supplier: "/v1/threads/ws"
|
|
618
618
|
}, De = (e, t) => {
|
|
619
|
-
const
|
|
620
|
-
return `${
|
|
619
|
+
const n = e.startsWith("https") ? "wss" : "ws", o = e.replace(/^https?:\/\//, "");
|
|
620
|
+
return `${n}://${o}${t}`;
|
|
621
621
|
}, Ye = (e) => {
|
|
622
622
|
try {
|
|
623
623
|
const t = localStorage.getItem(e);
|
|
@@ -628,76 +628,82 @@ const Ze = ({ IMaskMixin: e, ...t }) => {
|
|
|
628
628
|
}, we = ve(null), ut = ({
|
|
629
629
|
children: e,
|
|
630
630
|
token: t,
|
|
631
|
-
url:
|
|
631
|
+
url: n,
|
|
632
632
|
wsPath: o,
|
|
633
633
|
reconnect: s = !0,
|
|
634
634
|
enabled: a = !0,
|
|
635
635
|
context: c = "client"
|
|
636
636
|
}) => {
|
|
637
|
-
const [l, u] =
|
|
638
|
-
|
|
639
|
-
if (!
|
|
637
|
+
const [l, u] = L(!1), [p, i] = L(!1), [h, g] = L(0), [v, j] = L(a), T = a && v, { apiURL: C, localStorageKeys: m } = O(x), d = m?.user || $e, y = oe(null), E = oe(/* @__PURE__ */ new Set());
|
|
638
|
+
P(() => {
|
|
639
|
+
if (!T)
|
|
640
640
|
return;
|
|
641
|
-
const
|
|
642
|
-
if (!
|
|
641
|
+
const w = o ?? Fe[c], k = n || (C ? De(C, w) : null);
|
|
642
|
+
if (!k)
|
|
643
643
|
return;
|
|
644
|
-
const Q = () => t ?? Ye(
|
|
645
|
-
|
|
646
|
-
for (const
|
|
647
|
-
|
|
648
|
-
},
|
|
649
|
-
const
|
|
644
|
+
const Q = () => t ?? Ye(d), J = (r) => {
|
|
645
|
+
r.type === "ready" && (i(!0), g(r.unreadCount ?? 0));
|
|
646
|
+
for (const f of E.current)
|
|
647
|
+
f(r);
|
|
648
|
+
}, G = setTimeout(() => {
|
|
649
|
+
const r = new Se({
|
|
650
650
|
getToken: Q,
|
|
651
|
-
onConnectionChange: (
|
|
652
|
-
u(
|
|
651
|
+
onConnectionChange: (f) => {
|
|
652
|
+
u(f), f || i(!1);
|
|
653
653
|
},
|
|
654
|
-
onEvent:
|
|
654
|
+
onEvent: J,
|
|
655
655
|
reconnect: s,
|
|
656
|
-
url:
|
|
656
|
+
url: k
|
|
657
657
|
});
|
|
658
|
-
|
|
658
|
+
y.current = r, r.connect();
|
|
659
659
|
}, 0);
|
|
660
660
|
return () => {
|
|
661
|
-
clearTimeout(
|
|
661
|
+
clearTimeout(G), y.current?.disconnect(), y.current = null;
|
|
662
662
|
};
|
|
663
|
-
}, [
|
|
664
|
-
const
|
|
665
|
-
|
|
666
|
-
}, []),
|
|
667
|
-
|
|
668
|
-
}, []),
|
|
669
|
-
|
|
670
|
-
}, []),
|
|
671
|
-
|
|
672
|
-
}, []),
|
|
673
|
-
|
|
674
|
-
}, []),
|
|
675
|
-
|
|
676
|
-
}, []),
|
|
677
|
-
|
|
678
|
-
}, []),
|
|
679
|
-
|
|
680
|
-
}
|
|
681
|
-
|
|
682
|
-
|
|
663
|
+
}, [T, n, o, c, t, s, C, d]);
|
|
664
|
+
const S = A((w) => {
|
|
665
|
+
y.current?.joinThread(w);
|
|
666
|
+
}, []), I = A((w) => {
|
|
667
|
+
y.current?.leaveThread(w);
|
|
668
|
+
}, []), q = A((w, k) => {
|
|
669
|
+
y.current?.sendMessage(w, k);
|
|
670
|
+
}, []), X = A((w) => {
|
|
671
|
+
y.current?.markRead(w);
|
|
672
|
+
}, []), F = A((w, k) => {
|
|
673
|
+
y.current?.listThreads(w, k);
|
|
674
|
+
}, []), Z = A((w = 1) => {
|
|
675
|
+
g((k) => k + w);
|
|
676
|
+
}, []), ee = A((w = 1) => {
|
|
677
|
+
g((k) => Math.max(0, k - w));
|
|
678
|
+
}, []), D = A(() => {
|
|
679
|
+
y.current?.disconnect(), y.current = null;
|
|
680
|
+
}, []), V = A((w) => {
|
|
681
|
+
j(w);
|
|
682
|
+
}, []), te = A((w) => (E.current.add(w), () => {
|
|
683
|
+
E.current.delete(w);
|
|
684
|
+
}), []), Y = {
|
|
685
|
+
decrementUnreadCount: ee,
|
|
686
|
+
disconnect: D,
|
|
687
|
+
incrementUnreadCount: Z,
|
|
683
688
|
isConnected: l,
|
|
684
|
-
isReady:
|
|
685
|
-
joinThread:
|
|
686
|
-
leaveThread:
|
|
687
|
-
listThreads:
|
|
688
|
-
markRead:
|
|
689
|
-
sendMessage:
|
|
690
|
-
|
|
691
|
-
|
|
689
|
+
isReady: p,
|
|
690
|
+
joinThread: S,
|
|
691
|
+
leaveThread: I,
|
|
692
|
+
listThreads: F,
|
|
693
|
+
markRead: X,
|
|
694
|
+
sendMessage: q,
|
|
695
|
+
setEnabled: V,
|
|
696
|
+
subscribe: te,
|
|
697
|
+
unreadCount: h
|
|
692
698
|
};
|
|
693
|
-
return /* @__PURE__ */ N.jsx(we.Provider, { value:
|
|
699
|
+
return /* @__PURE__ */ N.jsx(we.Provider, { value: Y, children: e });
|
|
694
700
|
}, Ue = (e) => e && typeof e == "function", Me = (e) => e && typeof e == "function", dt = ({
|
|
695
701
|
children: e,
|
|
696
702
|
defaultQueriesOptions: t,
|
|
697
|
-
defaultMutationsOptions:
|
|
703
|
+
defaultMutationsOptions: n,
|
|
698
704
|
...o
|
|
699
705
|
}) => {
|
|
700
|
-
const { libraries: s } =
|
|
706
|
+
const { libraries: s } = O(x), a = o?.QueryClient || s?.reactQuery?.QueryClient, c = o?.QueryClientProvider || s?.reactQuery?.QueryClientProvider;
|
|
701
707
|
if (!a)
|
|
702
708
|
throw new Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
703
709
|
if (!c)
|
|
@@ -709,10 +715,10 @@ const Ze = ({ IMaskMixin: e, ...t }) => {
|
|
|
709
715
|
const l = new a({
|
|
710
716
|
defaultOptions: {
|
|
711
717
|
mutations: {
|
|
712
|
-
...
|
|
718
|
+
...n
|
|
713
719
|
},
|
|
714
720
|
queries: {
|
|
715
|
-
getNextPageParam: (u,
|
|
721
|
+
getNextPageParam: (u, p, i) => u.length + (i || 0),
|
|
716
722
|
refetchOnWindowFocus: !1,
|
|
717
723
|
retry: 3,
|
|
718
724
|
...t
|
|
@@ -720,16 +726,16 @@ const Ze = ({ IMaskMixin: e, ...t }) => {
|
|
|
720
726
|
}
|
|
721
727
|
});
|
|
722
728
|
return /* @__PURE__ */ N.jsx(c, { client: l, children: e });
|
|
723
|
-
}, ze = ({ library: e, date: t, format:
|
|
724
|
-
const { fractionDigits:
|
|
725
|
-
return Number.isNaN(a) ? `0${c}${o}` : `${a.toFixed(
|
|
726
|
-
}, Ve = (e) => !e || typeof e != "string" ? "" : e.replace(/_/g, " ").toLowerCase().split(" ").map((
|
|
729
|
+
}, ze = ({ library: e, date: t, format: n = "ll" }) => e(t).format(n), We = (e, t) => {
|
|
730
|
+
const { fractionDigits: n = 0, metric: o = "km", spacingBetween: s = !0 } = t || {}, a = Number(e), c = s ? " " : "";
|
|
731
|
+
return Number.isNaN(a) ? `0${c}${o}` : `${a.toFixed(n)}${c}${o}`;
|
|
732
|
+
}, Ve = (e) => !e || typeof e != "string" ? "" : e.replace(/_/g, " ").toLowerCase().split(" ").map((n) => n.length > 0 ? n.charAt(0).toUpperCase() + n.slice(1) : n).join(" "), Qe = (e) => e?.startsWith("/") ? e?.startsWith("/files") ? e : `/files${e}` : e?.startsWith("files") ? `/${e}` : `/files/${e}`, Je = ({ path: e, size: t, apiURL: n }) => {
|
|
727
733
|
if (!e)
|
|
728
734
|
return "";
|
|
729
|
-
const o = Qe(e), s = `${
|
|
735
|
+
const o = Qe(e), s = `${n}${o}`, a = s.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/) !== null;
|
|
730
736
|
return typeof t == "number" && a ? `${s.replace("/files", `/thumbs/${t}`)}` : s;
|
|
731
737
|
}, ft = (e) => {
|
|
732
|
-
const { apiURL: t, libraries:
|
|
738
|
+
const { apiURL: t, libraries: n } = O(x), o = e?.dayjs || n?.dayjs;
|
|
733
739
|
return {
|
|
734
740
|
dateAdapter: (c, l) => {
|
|
735
741
|
if (!o)
|
|
@@ -755,10 +761,10 @@ const Ze = ({ IMaskMixin: e, ...t }) => {
|
|
|
755
761
|
worksiteNameAdapter: Ve
|
|
756
762
|
};
|
|
757
763
|
}, pt = (e) => {
|
|
758
|
-
const { libraries: t, localStorageKeys:
|
|
764
|
+
const { libraries: t, localStorageKeys: n } = O(x), o = e?.axios || t?.axios, s = e?.localStorageKey || n?.user || "user";
|
|
759
765
|
if (!o)
|
|
760
766
|
throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");
|
|
761
|
-
const a =
|
|
767
|
+
const a = A(
|
|
762
768
|
({ tokenType: l, accessToken: u }) => {
|
|
763
769
|
o.defaults.headers.common.Authorization = `${l} ${u}`;
|
|
764
770
|
},
|
|
@@ -766,14 +772,14 @@ const Ze = ({ IMaskMixin: e, ...t }) => {
|
|
|
766
772
|
), c = () => {
|
|
767
773
|
o.defaults.headers.common.Authorization = null;
|
|
768
774
|
};
|
|
769
|
-
return
|
|
770
|
-
if (
|
|
775
|
+
return P(() => {
|
|
776
|
+
if (W)
|
|
771
777
|
return;
|
|
772
|
-
const l = ({ newValue: u, key:
|
|
773
|
-
if (
|
|
778
|
+
const l = ({ newValue: u, key: p }) => {
|
|
779
|
+
if (p === s && u)
|
|
774
780
|
try {
|
|
775
|
-
const { accessToken: i, tokenType:
|
|
776
|
-
a({ accessToken: i, tokenType:
|
|
781
|
+
const { accessToken: i, tokenType: h } = JSON.parse(u);
|
|
782
|
+
a({ accessToken: i, tokenType: h });
|
|
777
783
|
} catch (i) {
|
|
778
784
|
console.error("Failed to parse newValue from localStorage:", i);
|
|
779
785
|
}
|
|
@@ -786,70 +792,72 @@ const Ze = ({ IMaskMixin: e, ...t }) => {
|
|
|
786
792
|
setAuthenticationToken: a
|
|
787
793
|
};
|
|
788
794
|
}, ht = (e) => {
|
|
789
|
-
const t =
|
|
795
|
+
const t = O(we);
|
|
790
796
|
if (!t)
|
|
791
797
|
throw new Error("useChat must be used within ChatProvider");
|
|
792
|
-
const { subscribe:
|
|
793
|
-
return
|
|
798
|
+
const { subscribe: n, setEnabled: o, ...s } = t, a = oe(e);
|
|
799
|
+
return a.current = e, P(() => {
|
|
800
|
+
e?.enabled !== void 0 && o(e.enabled);
|
|
801
|
+
}, [e?.enabled, o]), P(() => n((c) => {
|
|
794
802
|
const {
|
|
795
|
-
onReady:
|
|
796
|
-
onNewMessage:
|
|
797
|
-
onNewMessageNotification:
|
|
798
|
-
onPresence:
|
|
799
|
-
onError:
|
|
803
|
+
onReady: l,
|
|
804
|
+
onNewMessage: u,
|
|
805
|
+
onNewMessageNotification: p,
|
|
806
|
+
onPresence: i,
|
|
807
|
+
onError: h,
|
|
800
808
|
onJoinedThread: g,
|
|
801
|
-
onLeftThread:
|
|
802
|
-
onMarkedRead:
|
|
803
|
-
onThreadArchived:
|
|
809
|
+
onLeftThread: v,
|
|
810
|
+
onMarkedRead: j,
|
|
811
|
+
onThreadArchived: T,
|
|
804
812
|
onThreadsList: C
|
|
805
|
-
} =
|
|
806
|
-
switch (
|
|
813
|
+
} = a.current ?? {};
|
|
814
|
+
switch (c.type) {
|
|
807
815
|
case "ready":
|
|
808
|
-
|
|
816
|
+
l?.(c);
|
|
809
817
|
break;
|
|
810
818
|
case "new_message":
|
|
811
|
-
|
|
819
|
+
u?.(c);
|
|
812
820
|
break;
|
|
813
821
|
case "new_message_notification":
|
|
814
|
-
|
|
822
|
+
p?.(c);
|
|
815
823
|
break;
|
|
816
824
|
case "presence":
|
|
817
|
-
|
|
825
|
+
i?.(c);
|
|
818
826
|
break;
|
|
819
827
|
case "error":
|
|
820
|
-
|
|
828
|
+
h?.(c);
|
|
821
829
|
break;
|
|
822
830
|
case "joined_thread":
|
|
823
|
-
g?.(
|
|
831
|
+
g?.(c);
|
|
824
832
|
break;
|
|
825
833
|
case "left_thread":
|
|
826
|
-
|
|
834
|
+
v?.(c);
|
|
827
835
|
break;
|
|
828
836
|
case "marked_read":
|
|
829
|
-
|
|
837
|
+
j?.(c);
|
|
830
838
|
break;
|
|
831
839
|
case "thread_archived":
|
|
832
|
-
|
|
840
|
+
T?.(c);
|
|
833
841
|
break;
|
|
834
842
|
case "threads_list":
|
|
835
|
-
C?.(
|
|
843
|
+
C?.(c);
|
|
836
844
|
break;
|
|
837
845
|
}
|
|
838
|
-
}), [
|
|
839
|
-
},
|
|
840
|
-
const [
|
|
846
|
+
}), [n]), s;
|
|
847
|
+
}, K = (e, t) => t === "short" ? e.split("-")[0] : e, gt = (e, t = "full") => {
|
|
848
|
+
const [n, o] = L(() => {
|
|
841
849
|
const s = e?.language || navigator.language;
|
|
842
|
-
return e && "isInitialized" in e && e.isInitialized,
|
|
850
|
+
return e && "isInitialized" in e && e.isInitialized, K(s, t);
|
|
843
851
|
});
|
|
844
|
-
return
|
|
845
|
-
e && "isInitialized" in e && e.isInitialized && e.language && o(
|
|
852
|
+
return P(() => {
|
|
853
|
+
e && "isInitialized" in e && e.isInitialized && e.language && o(K(e.language, t));
|
|
846
854
|
const s = (a) => {
|
|
847
|
-
o(
|
|
855
|
+
o(K(a, t));
|
|
848
856
|
};
|
|
849
857
|
return e?.on?.("languageChanged", s), () => {
|
|
850
858
|
e?.off?.("languageChanged", s);
|
|
851
859
|
};
|
|
852
|
-
}, [e, t]),
|
|
860
|
+
}, [e, t]), n;
|
|
853
861
|
}, Ge = "tracktor.filter", He = {
|
|
854
862
|
getFilter: () => {
|
|
855
863
|
},
|
|
@@ -864,8 +872,8 @@ const Ze = ({ IMaskMixin: e, ...t }) => {
|
|
|
864
872
|
} catch {
|
|
865
873
|
return e;
|
|
866
874
|
}
|
|
867
|
-
}, me = (e, t,
|
|
868
|
-
const o = localStorage.getItem(
|
|
875
|
+
}, me = (e, t, n) => `${n}_${e}=>${t}`, Be = (e) => e.reduce((t, n) => {
|
|
876
|
+
const o = localStorage.getItem(n);
|
|
869
877
|
if (o)
|
|
870
878
|
try {
|
|
871
879
|
const s = JSON.parse(o), a = Object.keys(s)?.[0];
|
|
@@ -874,119 +882,119 @@ const Ze = ({ IMaskMixin: e, ...t }) => {
|
|
|
874
882
|
}
|
|
875
883
|
return t;
|
|
876
884
|
}, {}), mt = (e) => {
|
|
877
|
-
const { libraries: t, localStorageKeys:
|
|
878
|
-
}], [l, u] =
|
|
879
|
-
if (
|
|
885
|
+
const { libraries: t, localStorageKeys: n } = O(x), o = e?.reactRouter || t?.reactRouter, { pathname: s } = o?.useLocation?.() ?? { pathname: "/" }, [a, c] = o?.useSearchParams?.() ?? [new URLSearchParams(), () => {
|
|
886
|
+
}], [l, u] = L({}), p = n?.filter || Ge, i = e?.syncWithUrl === void 0 ? !0 : e?.syncWithUrl, h = e?.persistToLocalStorage === void 0 ? !0 : e?.persistToLocalStorage;
|
|
887
|
+
if (W)
|
|
880
888
|
return He;
|
|
881
889
|
if (!o)
|
|
882
890
|
throw new Error(
|
|
883
891
|
"React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of reactRouter."
|
|
884
892
|
);
|
|
885
|
-
const
|
|
886
|
-
(
|
|
887
|
-
),
|
|
888
|
-
const
|
|
893
|
+
const g = () => Object.keys(localStorage).filter(
|
|
894
|
+
(m) => m.startsWith(p) && m.endsWith(e?.pathname || s)
|
|
895
|
+
), v = (m, d, y = !0) => {
|
|
896
|
+
const E = me(m, e?.pathname || s, p);
|
|
889
897
|
if (!d || Array.isArray(d) && !d.length) {
|
|
890
|
-
i ? (a.delete(
|
|
891
|
-
const I = { ...
|
|
892
|
-
return delete I[
|
|
893
|
-
}),
|
|
898
|
+
i ? (a.delete(m), c(a)) : u((S) => {
|
|
899
|
+
const I = { ...S };
|
|
900
|
+
return delete I[m], I;
|
|
901
|
+
}), h && localStorage.removeItem(E);
|
|
894
902
|
return;
|
|
895
903
|
}
|
|
896
|
-
|
|
904
|
+
h && y && d && localStorage.setItem(E, JSON.stringify({ ...a, [m]: d })), i && d ? (a.set(m, JSON.stringify(d)), c(a)) : !i && d && u((S) => ({ ...S, [m]: d }));
|
|
897
905
|
};
|
|
898
906
|
return {
|
|
899
|
-
getFilter: (
|
|
907
|
+
getFilter: (m, d) => {
|
|
900
908
|
if (i) {
|
|
901
|
-
const
|
|
902
|
-
if (
|
|
903
|
-
return ge(
|
|
909
|
+
const y = a.get(m);
|
|
910
|
+
if (y)
|
|
911
|
+
return ge(y);
|
|
904
912
|
} else {
|
|
905
|
-
const
|
|
906
|
-
if (
|
|
907
|
-
return
|
|
913
|
+
const y = l[m];
|
|
914
|
+
if (y !== void 0)
|
|
915
|
+
return y;
|
|
908
916
|
}
|
|
909
|
-
if (
|
|
910
|
-
const
|
|
911
|
-
if (
|
|
917
|
+
if (h) {
|
|
918
|
+
const y = me(m, e?.pathname || s, p), E = localStorage.getItem(y);
|
|
919
|
+
if (E)
|
|
912
920
|
try {
|
|
913
|
-
const
|
|
914
|
-
return !i &&
|
|
921
|
+
const S = JSON.parse(E)[m];
|
|
922
|
+
return !i && S !== void 0 && u((I) => ({ ...I, [m]: S })), S;
|
|
915
923
|
} catch {
|
|
916
924
|
}
|
|
917
925
|
}
|
|
918
926
|
return d;
|
|
919
927
|
},
|
|
920
928
|
getFilters: () => {
|
|
921
|
-
const
|
|
929
|
+
const m = h ? Be(g()) : {};
|
|
922
930
|
if (i) {
|
|
923
|
-
const d = Array.from(a.entries()).reduce((
|
|
931
|
+
const d = Array.from(a.entries()).reduce((y, [E, S]) => (y[E] = ge(S), y), {});
|
|
924
932
|
return {
|
|
925
|
-
...
|
|
933
|
+
...m,
|
|
926
934
|
...d
|
|
927
935
|
};
|
|
928
936
|
}
|
|
929
937
|
return {
|
|
930
|
-
...
|
|
938
|
+
...m,
|
|
931
939
|
...l
|
|
932
940
|
};
|
|
933
941
|
},
|
|
934
|
-
handleFilter: (
|
|
935
|
-
if (
|
|
936
|
-
const
|
|
937
|
-
|
|
942
|
+
handleFilter: (m, d) => (y, E) => {
|
|
943
|
+
if (E || Array.isArray(E) && E.length === 0) {
|
|
944
|
+
const S = d || "value", I = typeof E == "object" && S in E ? E[S] : E;
|
|
945
|
+
v(m, I);
|
|
938
946
|
return;
|
|
939
947
|
}
|
|
940
|
-
|
|
948
|
+
v(m, void 0);
|
|
941
949
|
},
|
|
942
|
-
setFilter:
|
|
950
|
+
setFilter: v
|
|
943
951
|
};
|
|
944
|
-
}, ye = () => document.getElementById(
|
|
945
|
-
const [e, t] =
|
|
946
|
-
|
|
952
|
+
}, ye = () => document.getElementById(ie), yt = () => {
|
|
953
|
+
const [e, t] = L(() => !!window.HubSpotConversations);
|
|
954
|
+
P(() => {
|
|
947
955
|
if (window.HubSpotConversations) {
|
|
948
956
|
t(!0);
|
|
949
957
|
return;
|
|
950
958
|
}
|
|
951
959
|
window.hsConversationsOnReady = [() => t(!0)];
|
|
952
|
-
}, []),
|
|
960
|
+
}, []), P(() => {
|
|
953
961
|
e && window.HubSpotConversations?.on("widgetClosed", () => {
|
|
954
|
-
ye()?.classList.remove(
|
|
962
|
+
ye()?.classList.remove(z);
|
|
955
963
|
});
|
|
956
964
|
}, [e]);
|
|
957
|
-
const
|
|
965
|
+
const n = A(() => {
|
|
958
966
|
const o = window.HubSpotConversations, s = ye();
|
|
959
|
-
o && s && (s.classList.contains(
|
|
967
|
+
o && s && (s.classList.contains(z) ? (o.widget.close(), s.classList.remove(z)) : (s.classList.add(z), o.widget.open()));
|
|
960
968
|
}, []);
|
|
961
|
-
return { isAvailable: e, toggle:
|
|
969
|
+
return { isAvailable: e, toggle: n };
|
|
962
970
|
}, vt = ({
|
|
963
971
|
data: e,
|
|
964
972
|
fetchNextPage: t,
|
|
965
|
-
isFetchingNextPage:
|
|
973
|
+
isFetchingNextPage: n,
|
|
966
974
|
isInitialLoading: o,
|
|
967
975
|
isLoading: s,
|
|
968
976
|
enabled: a = !0
|
|
969
977
|
}) => {
|
|
970
|
-
const c =
|
|
978
|
+
const c = A(
|
|
971
979
|
async (u) => {
|
|
972
|
-
|
|
980
|
+
n || !a || await t({ pageParam: u?.pageParam || u.visibleRowsCount });
|
|
973
981
|
},
|
|
974
|
-
[a, t,
|
|
975
|
-
), l =
|
|
982
|
+
[a, t, n]
|
|
983
|
+
), l = ce(() => {
|
|
976
984
|
if (e)
|
|
977
|
-
return e.pages.reduce((u,
|
|
985
|
+
return e.pages.reduce((u, p) => [...u, ...p], []);
|
|
978
986
|
}, [e]);
|
|
979
987
|
return {
|
|
980
988
|
fetchNextPageOnRowsScrollEnd: c,
|
|
981
|
-
isLoading:
|
|
989
|
+
isLoading: n || s,
|
|
982
990
|
loadingVariant: o ? "skeleton" : "linear-progress",
|
|
983
991
|
rows: l
|
|
984
992
|
};
|
|
985
993
|
}, wt = (e) => {
|
|
986
|
-
const { libraries: t } =
|
|
987
|
-
(
|
|
988
|
-
if (
|
|
989
|
-
const { response: i } =
|
|
994
|
+
const { libraries: t } = O(x), n = e?.i18 || t?.i18, o = e?.i18?.translateFunction || t?.i18?.translateFunction, s = n?.i18next?.t || o || ((p) => p), { unknownErrorTranslationKey: a = "error.unknownError" } = e || {}, c = s(a), l = A(
|
|
995
|
+
(p) => {
|
|
996
|
+
if (p && typeof p == "object" && "response" in p) {
|
|
997
|
+
const { response: i } = p || {};
|
|
990
998
|
if (i && typeof i == "object" && "reason" in i && i.reason)
|
|
991
999
|
return String(i.reason);
|
|
992
1000
|
if (i && typeof i == "object" && "data" in i && i.data && typeof i.data == "object" && "reason" in i.data && i.data.reason)
|
|
@@ -994,20 +1002,20 @@ const Ze = ({ IMaskMixin: e, ...t }) => {
|
|
|
994
1002
|
if (i && typeof i == "object" && "data" in i && i.data && typeof i.data == "object" && "message" in i.data && i.data.message)
|
|
995
1003
|
return String(i.data.message);
|
|
996
1004
|
if (i && typeof i == "object" && "data" in i && i.data && typeof i.data == "object" && "detail" in i.data) {
|
|
997
|
-
const { detail:
|
|
998
|
-
if (Array.isArray(
|
|
999
|
-
const { msg:
|
|
1000
|
-
if (typeof
|
|
1001
|
-
return String(
|
|
1005
|
+
const { detail: h } = i.data;
|
|
1006
|
+
if (Array.isArray(h) && h.length > 0 && typeof h[0] == "object" && h[0] !== null && "msg" in h[0]) {
|
|
1007
|
+
const { msg: g } = h[0];
|
|
1008
|
+
if (typeof g == "string")
|
|
1009
|
+
return String(g);
|
|
1002
1010
|
}
|
|
1003
1011
|
}
|
|
1004
1012
|
}
|
|
1005
|
-
return
|
|
1013
|
+
return p instanceof Error ? p.message : c;
|
|
1006
1014
|
},
|
|
1007
1015
|
[c]
|
|
1008
1016
|
);
|
|
1009
|
-
return { getErrorCode:
|
|
1010
|
-
const { response: i } =
|
|
1017
|
+
return { getErrorCode: A((p) => {
|
|
1018
|
+
const { response: i } = p || {};
|
|
1011
1019
|
return i?.error_code ? String(i?.error_code) : i?.data?.error_code ? String(i?.data?.error_code) : i?.error_code ? String(i?.error_code) : i?.data?.error_code ? String(i.data.error_code) : "unknown_error_code";
|
|
1012
1020
|
}, []), printError: l };
|
|
1013
1021
|
};
|
|
@@ -1021,7 +1029,7 @@ export {
|
|
|
1021
1029
|
ot as InitializeHubSpot,
|
|
1022
1030
|
st as InitializeI18nConfig,
|
|
1023
1031
|
at as InitializeSentryConfig,
|
|
1024
|
-
|
|
1032
|
+
x as InjectDependenciesContext,
|
|
1025
1033
|
et as InjectDependenciesProvider,
|
|
1026
1034
|
Ze as MaskTextField,
|
|
1027
1035
|
it as PreloadErrorHandler,
|