@getsoren/shared-module 2.67.0 → 2.68.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/main.js +99 -99
- package/dist/utils/operator/operator.d.ts +7 -0
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -335,12 +335,12 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
335
335
|
}), o.on("languageChanged", (e) => {
|
|
336
336
|
document.documentElement.setAttribute("lang", e);
|
|
337
337
|
}), null);
|
|
338
|
-
}, ce = { replay: "keep" }, le = (e) => e.tags?.replay === ce.replay,
|
|
338
|
+
}, ce = { replay: "keep" }, le = (e) => e.tags?.replay === ce.replay, ue = [/^https:\/\/(api|events)\.mapbox\.com\//], z = (e, t) => t.some((t) => typeof t == "string" ? e.includes(t) : t.test(e)), de = ({ dsn: e, integrations: t, tracesSampleRate: n, tracePropagationTargets: r, ignoreErrors: i, ignoreRequestUrls: s, debug: c, environment: l, release: u, replaysSessionSampleRate: d = 0, replaysOnErrorSampleRate: f = 1, replayBeforeErrorSampling: p = le, ...m }) => {
|
|
339
339
|
let { libraries: h } = a(y), g = m?.sentry || h?.sentry, _ = m?.reactRouter || h?.reactRouter;
|
|
340
340
|
if (!g) throw Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
341
341
|
if (!_) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
342
342
|
if (g.isInitialized()) return null;
|
|
343
|
-
let { createRoutesFromChildren: v, matchRoutes: b, useLocation: x, useNavigationType: S } = _, C = d > 0 || f > 0, w = [...s || [], ...
|
|
343
|
+
let { createRoutesFromChildren: v, matchRoutes: b, useLocation: x, useNavigationType: S } = _, C = d > 0 || f > 0, w = [...s || [], ...ue];
|
|
344
344
|
return (c || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") && g.init({
|
|
345
345
|
debug: c,
|
|
346
346
|
dsn: e,
|
|
@@ -358,7 +358,7 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
358
358
|
g.reactRouterV6BrowserTracingIntegration({
|
|
359
359
|
createRoutesFromChildren: v,
|
|
360
360
|
matchRoutes: b,
|
|
361
|
-
shouldCreateSpanForRequest: (e) => !
|
|
361
|
+
shouldCreateSpanForRequest: (e) => !z(e, w),
|
|
362
362
|
useEffect: o,
|
|
363
363
|
useLocation: x,
|
|
364
364
|
useNavigationType: S
|
|
@@ -372,12 +372,12 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
372
372
|
tracePropagationTargets: r,
|
|
373
373
|
tracesSampleRate: n ?? 1
|
|
374
374
|
}), null;
|
|
375
|
-
},
|
|
376
|
-
let { libraries: c, localStorageKeys: l } = a(y), f = s?.reactRouter || c?.reactRouter, p = s?.axios || c?.axios, m = s?.localStorageKey || l?.user ||
|
|
375
|
+
}, B = /* @__PURE__ */ new WeakMap(), fe = "user", pe = ({ Fallback: e, isLogged: n, loginPath: r = "/login", redirect401Path: i = "/login", ...s }) => {
|
|
376
|
+
let { libraries: c, localStorageKeys: l } = a(y), f = s?.reactRouter || c?.reactRouter, p = s?.axios || c?.axios, m = s?.localStorageKey || l?.user || fe;
|
|
377
377
|
if (!f) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
378
378
|
let [h, g] = u(null), { useLocation: _, Navigate: v, Outlet: b } = f, x = _(), S = typeof n == "function" ? n() : !!n, C = typeof S == "boolean" ? S : S?.isLogged;
|
|
379
379
|
return o(() => {
|
|
380
|
-
p && (
|
|
380
|
+
p && (B.has(p) || (B.set(p, !0), p.interceptors.response.use((e) => e, (e) => (typeof e == "object" && e && "response" in e && e.response && typeof e.response == "object" && "status" in e.response && e.response && typeof e.response == "object" && "status" in e.response && e?.response?.status === 401 && (typeof e == "object" && e && "config" in e && e.config && typeof e.config == "object" && "headers" in e.config && e.config.headers && typeof e.config.headers == "object" && "Authorization" in e.config.headers && e.config.headers.Authorization && (p.defaults.headers.common.Authorization = null, typeof window < "u" && window.localStorage && localStorage.removeItem(m)), g(i)), Promise.reject(e)))));
|
|
381
381
|
}, [
|
|
382
382
|
p,
|
|
383
383
|
m,
|
|
@@ -393,28 +393,28 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
393
393
|
state: { from: x },
|
|
394
394
|
replace: !0
|
|
395
395
|
});
|
|
396
|
-
},
|
|
396
|
+
}, V = /* @__PURE__ */ new Set(), me = () => (o(() => {
|
|
397
397
|
let e = Symbol();
|
|
398
|
-
return
|
|
399
|
-
|
|
398
|
+
return V.add(e), document.documentElement.removeAttribute(R), () => {
|
|
399
|
+
V.delete(e), V.size === 0 && document.documentElement.setAttribute(R, "");
|
|
400
400
|
};
|
|
401
|
-
}, []), null),
|
|
401
|
+
}, []), null), he = "user", ge = {
|
|
402
402
|
client: "/v2/threads/ws",
|
|
403
403
|
supplier: "/v1/threads/ws"
|
|
404
|
-
},
|
|
404
|
+
}, _e = (e, t) => `${e.startsWith("https") ? "wss" : "ws"}://${e.replace(/^https?:\/\//, "")}${t}`, ve = (e) => {
|
|
405
405
|
try {
|
|
406
406
|
let t = localStorage.getItem(e);
|
|
407
407
|
return t ? JSON.parse(t)?.accessToken ?? null : null;
|
|
408
408
|
} catch {
|
|
409
409
|
return null;
|
|
410
410
|
}
|
|
411
|
-
},
|
|
412
|
-
let [g, v] = u(!1), [b, x] = u(!1), [S, C] = u(0), [w, T] = u(m), E = m && w, { apiURL: D, localStorageKeys: O } = a(y), k = O?.user ||
|
|
411
|
+
}, H = n(null), ye = ({ children: e, token: t, url: n, wsPath: r, maxReconnectAttempts: s, reconnectBaseDelay: c, maxMessageBodyLength: f = 1e4, reconnect: p = !0, enabled: m = !0, context: h = "client" }) => {
|
|
412
|
+
let [g, v] = u(!1), [b, x] = u(!1), [S, C] = u(0), [w, T] = u(m), E = m && w, { apiURL: D, localStorageKeys: O } = a(y), k = O?.user || he, A = l(null), j = l(/* @__PURE__ */ new Set());
|
|
413
413
|
o(() => {
|
|
414
414
|
if (!E) return;
|
|
415
|
-
let e = r ??
|
|
415
|
+
let e = r ?? ge[h], i = n || (D ? _e(D, e) : null);
|
|
416
416
|
if (!i) return;
|
|
417
|
-
let a = () => t ??
|
|
417
|
+
let a = () => t ?? ve(k), o = (e) => {
|
|
418
418
|
switch (e.type) {
|
|
419
419
|
case "ready":
|
|
420
420
|
x(!0), C(e.unreadCount ?? 0);
|
|
@@ -487,27 +487,27 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
487
487
|
}), []),
|
|
488
488
|
unreadCount: S
|
|
489
489
|
};
|
|
490
|
-
return /* @__PURE__ */ d(
|
|
490
|
+
return /* @__PURE__ */ d(H.Provider, {
|
|
491
491
|
value: F,
|
|
492
492
|
children: e
|
|
493
493
|
});
|
|
494
|
-
},
|
|
494
|
+
}, be = 3, xe = new Set([
|
|
495
495
|
400,
|
|
496
496
|
401,
|
|
497
497
|
403,
|
|
498
498
|
404
|
|
499
|
-
]),
|
|
500
|
-
let n =
|
|
501
|
-
return e <
|
|
502
|
-
},
|
|
499
|
+
]), Se = (e) => e?.response?.status, U = (e, t) => {
|
|
500
|
+
let n = Se(t);
|
|
501
|
+
return e < be && !(n !== void 0 && xe.has(n));
|
|
502
|
+
}, Ce = (e, t, n) => (Array.isArray(e) ? e.length : 0) + (typeof n == "number" ? n : 0), we = ({ children: e, defaultQueriesOptions: t, defaultMutationsOptions: n, ...r }) => {
|
|
503
503
|
let { libraries: i } = a(y), o = r.QueryClient || i?.reactQuery?.QueryClient, s = r.QueryClientProvider || i?.reactQuery?.QueryClientProvider;
|
|
504
504
|
if (!o) throw Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
505
505
|
if (!s) throw Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
506
506
|
let [c] = u(() => new o({ defaultOptions: {
|
|
507
507
|
mutations: n,
|
|
508
508
|
queries: {
|
|
509
|
-
getNextPageParam:
|
|
510
|
-
retry:
|
|
509
|
+
getNextPageParam: Ce,
|
|
510
|
+
retry: U,
|
|
511
511
|
...t
|
|
512
512
|
}
|
|
513
513
|
} }));
|
|
@@ -515,17 +515,17 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
515
515
|
client: c,
|
|
516
516
|
children: e
|
|
517
517
|
});
|
|
518
|
-
},
|
|
518
|
+
}, W = ({ library: e, date: t, format: n = "ll" }) => e(t).format(n), G = (e, t) => {
|
|
519
519
|
let { fractionDigits: n = 0, metric: r = "km", spacingBetween: i = !0 } = t || {}, a = Number(e), o = i ? " " : "";
|
|
520
520
|
return Number.isNaN(a) ? `0${o}${r}` : `${a.toFixed(n)}${o}${r}`;
|
|
521
|
-
},
|
|
521
|
+
}, K = (e) => !e || typeof e != "string" ? "" : e.replace(/_/g, " ").toLowerCase().split(" ").map((e) => e.length > 0 ? e.charAt(0).toUpperCase() + e.slice(1) : e).join(" "), Te = (e) => e?.startsWith("/") ? e?.startsWith("/files") ? e : `/files${e}` : e?.startsWith("files") ? `/${e}` : `/files/${e}`, Ee = ({ path: e, size: t, apiURL: n }) => {
|
|
522
522
|
if (!e) return "";
|
|
523
|
-
let r = `${n}${
|
|
523
|
+
let r = `${n}${Te(e)}`, i = r.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/) !== null;
|
|
524
524
|
return typeof t == "number" && i ? `${r.replace("/files", `/thumbs/${t}`)}` : r;
|
|
525
|
-
},
|
|
525
|
+
}, De = (e) => {
|
|
526
526
|
let { apiURL: t, libraries: n } = a(y), r = e?.dayjs || n?.dayjs, o = i((e, n) => {
|
|
527
527
|
if (!t) throw Error("API URL is not provided. You can provide it with InjectDependenciesProvider or directly in props to filePathAdapter.");
|
|
528
|
-
return typeof e == "string" && /^https?:\/\//.test(e) ? e :
|
|
528
|
+
return typeof e == "string" && /^https?:\/\//.test(e) ? e : Ee({
|
|
529
529
|
apiURL: t,
|
|
530
530
|
path: e,
|
|
531
531
|
size: n
|
|
@@ -534,17 +534,17 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
534
534
|
return {
|
|
535
535
|
dateAdapter: i((e, t) => {
|
|
536
536
|
if (!r) throw Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
537
|
-
return
|
|
537
|
+
return W({
|
|
538
538
|
date: e,
|
|
539
539
|
format: t,
|
|
540
540
|
library: r
|
|
541
541
|
});
|
|
542
542
|
}, [r]),
|
|
543
|
-
distanceAdapter:
|
|
543
|
+
distanceAdapter: G,
|
|
544
544
|
filePathAdapter: o,
|
|
545
|
-
worksiteNameAdapter:
|
|
545
|
+
worksiteNameAdapter: K
|
|
546
546
|
};
|
|
547
|
-
},
|
|
547
|
+
}, Oe = () => {
|
|
548
548
|
let { libraries: e } = a(y), t = e?.amplitude?.analytics, n = i((e, n) => {
|
|
549
549
|
if (!t || (t.setUserId(e), !n)) return;
|
|
550
550
|
let r = new t.Identify();
|
|
@@ -568,7 +568,7 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
568
568
|
setGroup: r,
|
|
569
569
|
track: o
|
|
570
570
|
};
|
|
571
|
-
},
|
|
571
|
+
}, ke = (e) => {
|
|
572
572
|
let { libraries: t, localStorageKeys: n } = a(y), r = e?.axios || t?.axios, s = e?.localStorageKey || n?.user || "user";
|
|
573
573
|
if (!r) throw Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");
|
|
574
574
|
let c = i(({ tokenType: e, accessToken: t }) => {
|
|
@@ -604,9 +604,9 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
604
604
|
clearAuthenticationToken: l,
|
|
605
605
|
setAuthenticationToken: c
|
|
606
606
|
};
|
|
607
|
-
},
|
|
607
|
+
}, Ae = "New message", je = (e, t) => {
|
|
608
608
|
if (!("Notification" in window) || typeof Notification != "function" || Notification.permission !== "granted" || !document.hidden) return;
|
|
609
|
-
let n = new Notification(t.title ??
|
|
609
|
+
let n = new Notification(t.title ?? Ae, {
|
|
610
610
|
badge: t?.badge,
|
|
611
611
|
body: t?.body || e.bodyPreview,
|
|
612
612
|
data: t?.data,
|
|
@@ -621,8 +621,8 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
621
621
|
let { onClick: r } = t;
|
|
622
622
|
n.onclick = () => r(e);
|
|
623
623
|
}
|
|
624
|
-
},
|
|
625
|
-
let t = a(
|
|
624
|
+
}, Me = (e) => {
|
|
625
|
+
let t = a(H);
|
|
626
626
|
if (!t) throw Error("useChat must be used within ChatProvider");
|
|
627
627
|
let { subscribe: n, setEnabled: r, ...i } = t, s = l(e);
|
|
628
628
|
return s.current = e, o(() => {
|
|
@@ -639,7 +639,7 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
639
639
|
r?.(e);
|
|
640
640
|
break;
|
|
641
641
|
case "new_message_notification":
|
|
642
|
-
i?.(e), t && t.enabled !== !1 &&
|
|
642
|
+
i?.(e), t && t.enabled !== !1 && je(e, t);
|
|
643
643
|
break;
|
|
644
644
|
case "presence":
|
|
645
645
|
a?.(e);
|
|
@@ -664,44 +664,44 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
664
664
|
break;
|
|
665
665
|
}
|
|
666
666
|
}), [n]), i;
|
|
667
|
-
},
|
|
667
|
+
}, q = (e, t = "full") => {
|
|
668
668
|
let n = e || navigator.language;
|
|
669
669
|
return t === "short" ? n.split("-")[0] : n;
|
|
670
|
-
},
|
|
671
|
-
let [n, r] = u(() =>
|
|
670
|
+
}, Ne = (e, t = "full") => {
|
|
671
|
+
let [n, r] = u(() => q(e?.language, t));
|
|
672
672
|
return o(() => {
|
|
673
|
-
e && "isInitialized" in e && e.isInitialized && e.language && r(
|
|
673
|
+
e && "isInitialized" in e && e.isInitialized && e.language && r(q(e.language, t));
|
|
674
674
|
let n = (e) => {
|
|
675
|
-
r(
|
|
675
|
+
r(q(e, t));
|
|
676
676
|
};
|
|
677
677
|
return e?.on?.("languageChanged", n), () => {
|
|
678
678
|
e?.off?.("languageChanged", n);
|
|
679
679
|
};
|
|
680
680
|
}, [e, t]), n;
|
|
681
|
-
},
|
|
681
|
+
}, Pe = "tracktor.filter", Fe = {
|
|
682
682
|
getFilter: () => void 0,
|
|
683
683
|
getFilters: () => ({}),
|
|
684
684
|
handleFilter: () => () => {},
|
|
685
685
|
setFilter: () => {}
|
|
686
|
-
},
|
|
686
|
+
}, Ie = (e) => {
|
|
687
687
|
try {
|
|
688
688
|
return JSON.parse(e);
|
|
689
689
|
} catch {
|
|
690
690
|
return e;
|
|
691
691
|
}
|
|
692
|
-
},
|
|
692
|
+
}, Le = (e, t, n) => `${n}_${e}=>${t}`, Re = (e) => e.reduce((e, t) => {
|
|
693
693
|
let n = localStorage.getItem(t);
|
|
694
694
|
if (n) try {
|
|
695
695
|
let t = JSON.parse(n), r = Object.keys(t)?.[0];
|
|
696
696
|
r && (e[r] = Object.values(t)?.[0]);
|
|
697
697
|
} catch {}
|
|
698
698
|
return e;
|
|
699
|
-
}, {}),
|
|
700
|
-
let { libraries: t, localStorageKeys: n } = a(y), r = e?.reactRouter || t?.reactRouter, { pathname: i } = r?.useLocation?.() ?? { pathname: "/" }, [o, s] = r?.useSearchParams?.() ?? [new URLSearchParams(), () => {}], [c, l] = u({}), d = n?.filter ||
|
|
701
|
-
if (N) return
|
|
699
|
+
}, {}), ze = (e) => {
|
|
700
|
+
let { libraries: t, localStorageKeys: n } = a(y), r = e?.reactRouter || t?.reactRouter, { pathname: i } = r?.useLocation?.() ?? { pathname: "/" }, [o, s] = r?.useSearchParams?.() ?? [new URLSearchParams(), () => {}], [c, l] = u({}), d = n?.filter || Pe, f = e?.syncWithUrl === void 0 ? !0 : e?.syncWithUrl, p = e?.persistToLocalStorage === void 0 ? !0 : e?.persistToLocalStorage;
|
|
701
|
+
if (N) return Fe;
|
|
702
702
|
if (!r) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of reactRouter.");
|
|
703
703
|
let m = () => Object.keys(localStorage).filter((t) => t.startsWith(d) && t.endsWith(e?.pathname || i)), h = (t, n, r = !0) => {
|
|
704
|
-
let a =
|
|
704
|
+
let a = Le(t, e?.pathname || i, d);
|
|
705
705
|
if (!n || Array.isArray(n) && !n.length) {
|
|
706
706
|
f ? (o.delete(t), s(o)) : l((e) => {
|
|
707
707
|
let n = { ...e };
|
|
@@ -721,13 +721,13 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
721
721
|
getFilter: (t, n) => {
|
|
722
722
|
if (f) {
|
|
723
723
|
let e = o.get(t);
|
|
724
|
-
if (e) return
|
|
724
|
+
if (e) return Ie(e);
|
|
725
725
|
} else {
|
|
726
726
|
let e = c[t];
|
|
727
727
|
if (e !== void 0) return e;
|
|
728
728
|
}
|
|
729
729
|
if (p) {
|
|
730
|
-
let n =
|
|
730
|
+
let n = Le(t, e?.pathname || i, d), r = localStorage.getItem(n);
|
|
731
731
|
if (r) try {
|
|
732
732
|
let e = JSON.parse(r)[t];
|
|
733
733
|
return !f && e !== void 0 && l((n) => ({
|
|
@@ -739,9 +739,9 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
739
739
|
return n;
|
|
740
740
|
},
|
|
741
741
|
getFilters: () => {
|
|
742
|
-
let e = p ?
|
|
742
|
+
let e = p ? Re(m()) : {};
|
|
743
743
|
if (f) {
|
|
744
|
-
let t = Array.from(o.entries()).reduce((e, [t, n]) => (e[t] =
|
|
744
|
+
let t = Array.from(o.entries()).reduce((e, [t, n]) => (e[t] = Ie(n), e), {});
|
|
745
745
|
return {
|
|
746
746
|
...e,
|
|
747
747
|
...t
|
|
@@ -762,7 +762,7 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
762
762
|
},
|
|
763
763
|
setFilter: h
|
|
764
764
|
};
|
|
765
|
-
},
|
|
765
|
+
}, Be = () => document.getElementById(I), Ve = () => {
|
|
766
766
|
let [e, t] = u(() => !!window.HubSpotConversations);
|
|
767
767
|
return o(() => {
|
|
768
768
|
if (window.HubSpotConversations) {
|
|
@@ -772,16 +772,16 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
772
772
|
window.hsConversationsOnReady = [() => t(!0)];
|
|
773
773
|
}, []), o(() => {
|
|
774
774
|
e && window.HubSpotConversations?.on("widgetClosed", () => {
|
|
775
|
-
|
|
775
|
+
Be()?.classList.remove(L);
|
|
776
776
|
});
|
|
777
777
|
}, [e]), {
|
|
778
778
|
isAvailable: e,
|
|
779
779
|
toggle: i(() => {
|
|
780
|
-
let e = window.HubSpotConversations, t =
|
|
780
|
+
let e = window.HubSpotConversations, t = Be();
|
|
781
781
|
e && t && (t.classList.contains("hs-show") ? (e.widget.close(), t.classList.remove(L)) : (t.classList.add(L), e.widget.open()));
|
|
782
782
|
}, [])
|
|
783
783
|
};
|
|
784
|
-
},
|
|
784
|
+
}, He = ({ data: e, fetchNextPage: t, isFetchingNextPage: n, isInitialLoading: r, isLoading: a, enabled: o = !0 }) => {
|
|
785
785
|
let s = i(async (e) => {
|
|
786
786
|
n || !o || await t({ pageParam: e?.pageParam || e.visibleRowsCount });
|
|
787
787
|
}, [
|
|
@@ -797,7 +797,7 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
797
797
|
loadingVariant: r ? "skeleton" : "linear-progress",
|
|
798
798
|
rows: l
|
|
799
799
|
};
|
|
800
|
-
},
|
|
800
|
+
}, Ue = (e) => {
|
|
801
801
|
let { libraries: t } = a(y), n = e?.i18 || t?.i18, r = e?.i18?.translateFunction || t?.i18?.translateFunction, o = n?.i18next?.t || r || ((e) => e), { unknownErrorTranslationKey: s = "error.unknownError" } = e || {}, c = o(s), l = i((e) => {
|
|
802
802
|
if (e && typeof e == "object" && "response" in e) {
|
|
803
803
|
let { response: t } = e || {};
|
|
@@ -821,10 +821,10 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
821
821
|
}, []),
|
|
822
822
|
printError: l
|
|
823
823
|
};
|
|
824
|
-
},
|
|
824
|
+
}, We = String.raw`(?:chauffeur|conducteur|op[ée]rateur|machiniste|driver|operator)`, Ge = String.raw`(?:(?:avec|with|incl(?:\.|uding|us)?|y\s+compris)\s+|\+\s*)(?:(?:un|une|le|la|son|sa|an?|the|its)\s+)?`, Ke = String.raw`(?:\s+(?:inclus|compris|included))?`, qe = String.raw`(?:(?:(?:à\s+la|par|per|by\s+the|tarif)\s+)?(jours?|journ[ée]es?|journalier|days?)|(?:(?:à\s+l['’]\s*|(?:par|per|by\s+the|tarif)\s+))?(heures?|horaire|hours?))`, Je = String.raw`(?:\s*[-–—,/·:]?\s*${qe}|\s*\(\s*${qe}\s*\))?`, Ye = String.raw`(?:(?:location|rental|rented)\s+)?(?:${Ge}${We}${Ke}|${We}\s+(?:inclus|compris|included))${Je}`, Xe = new RegExp(String.raw`\s*[[(]\s*${Ye}\s*[\])]`, "giu"), Ze = new RegExp(String.raw`(?:^|[\s,;:/|–—-])\s*${Ye}\s*$`, "iu"), Qe = /[\s,;:/|–—-]+$/u, $e = ([e]) => {
|
|
825
825
|
let t = e.replace(/^[\s,;:/|–—-]+/u, "").trim(), n = (/^[[(]/u.test(t) ? t.slice(1, -1) : t).trim().replace(/\s+/g, " ");
|
|
826
826
|
return n.charAt(0).toLocaleUpperCase() + n.slice(1);
|
|
827
|
-
},
|
|
827
|
+
}, et = (e) => e[1] || e[3] ? "days" : e[2] || e[4] ? "hours" : void 0, tt = (e, { readDriver: t = !0 } = {}) => {
|
|
828
828
|
if (typeof e != "string") return {
|
|
829
829
|
label: "",
|
|
830
830
|
withDriver: !1
|
|
@@ -833,12 +833,12 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
833
833
|
label: e.trim(),
|
|
834
834
|
withDriver: !1
|
|
835
835
|
};
|
|
836
|
-
let n = e.normalize("NFC"), r = [...n.matchAll(
|
|
836
|
+
let n = e.normalize("NFC"), r = [...n.matchAll(Xe)], i = n.replace(Xe, ""), a = i.match(Ze), o = a ? i.slice(0, a.index) : i;
|
|
837
837
|
if (o === n) return {
|
|
838
838
|
label: e.trim(),
|
|
839
839
|
withDriver: !1
|
|
840
840
|
};
|
|
841
|
-
let s = o.replace(
|
|
841
|
+
let s = o.replace(Qe, "").replace(/\s{2,}/g, " ").trim(), c = [...r, ...a ? [a] : []], l = c.map(et).find(Boolean), u = $e(c[0]);
|
|
842
842
|
return s ? l ? {
|
|
843
843
|
driverMention: u,
|
|
844
844
|
driverUnit: l,
|
|
@@ -852,38 +852,38 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
852
852
|
label: e.trim(),
|
|
853
853
|
withDriver: !1
|
|
854
854
|
};
|
|
855
|
-
},
|
|
855
|
+
}, nt = "chunk-reload-timestamp", J = "chunk-reload", rt = 1e4, Y = 2, it = !1;
|
|
856
856
|
if (!N && typeof window < "u") {
|
|
857
857
|
try {
|
|
858
858
|
let e = new URL(window.location.href);
|
|
859
|
-
e.searchParams.has(
|
|
859
|
+
e.searchParams.has(J) && (it = !0, e.searchParams.delete(J), window.history.replaceState(null, "", e.toString()));
|
|
860
860
|
} catch {}
|
|
861
861
|
window.addEventListener("vite:preloadError", (e) => {
|
|
862
862
|
e.preventDefault();
|
|
863
863
|
});
|
|
864
864
|
}
|
|
865
|
-
var
|
|
865
|
+
var at = (e) => {
|
|
866
866
|
if (!(e instanceof Error)) return !1;
|
|
867
867
|
let t = e.message.toLowerCase();
|
|
868
868
|
return t.includes("dynamically imported module") || t.includes("importing a module script failed") || t.includes("loading chunk") || t.includes("loading css chunk") || t.includes("unable to preload css") || t.includes("failed to fetch") || t.includes("error loading dynamically imported module") || t.includes("load failed") || t.includes("without a valid default export") || e.name === "ChunkLoadError";
|
|
869
|
-
},
|
|
869
|
+
}, ot = /import\s*\(\s*(['"])((\w+:(\/?\/?))?[^\s,]+)\1/, st = (e) => e.toString().match(ot)?.[2] ?? null, ct = (e) => {
|
|
870
870
|
try {
|
|
871
871
|
return sessionStorage.getItem(e);
|
|
872
872
|
} catch {
|
|
873
873
|
return null;
|
|
874
874
|
}
|
|
875
|
-
},
|
|
875
|
+
}, lt = (e, t) => {
|
|
876
876
|
try {
|
|
877
877
|
sessionStorage.setItem(e, t);
|
|
878
878
|
} catch {}
|
|
879
|
-
},
|
|
880
|
-
for (let t = 0; t <
|
|
881
|
-
return await
|
|
879
|
+
}, ut = (e) => Function("url", "return import(url)")(e), dt = async (e) => {
|
|
880
|
+
for (let t = 0; t < Y; t++) try {
|
|
881
|
+
return await ut(`${e}?t=${Date.now()}`);
|
|
882
882
|
} catch {
|
|
883
|
-
t <
|
|
883
|
+
t < Y - 1 && await new Promise((e) => setTimeout(e, 500 * 2 ** t));
|
|
884
884
|
}
|
|
885
|
-
throw Error(`Failed to import ${e} after ${
|
|
886
|
-
},
|
|
885
|
+
throw Error(`Failed to import ${e} after ${Y} retries`);
|
|
886
|
+
}, ft = async () => {
|
|
887
887
|
try {
|
|
888
888
|
if (typeof navigator < "u" && "serviceWorker" in navigator) {
|
|
889
889
|
let e = await navigator.serviceWorker.getRegistrations();
|
|
@@ -894,34 +894,34 @@ var it = (e) => {
|
|
|
894
894
|
await Promise.all(e.map((e) => caches.delete(e)));
|
|
895
895
|
}
|
|
896
896
|
} catch {}
|
|
897
|
-
},
|
|
898
|
-
await
|
|
897
|
+
}, pt = async () => {
|
|
898
|
+
await ft();
|
|
899
899
|
let e = new URL(window.location.href);
|
|
900
|
-
e.searchParams.set(
|
|
901
|
-
},
|
|
900
|
+
e.searchParams.set(J, String(Date.now())), window.location.replace(e.toString());
|
|
901
|
+
}, mt = (e) => e != null && e.default !== void 0, ht = (e) => r(async () => {
|
|
902
902
|
let t;
|
|
903
903
|
try {
|
|
904
904
|
let n = await e();
|
|
905
|
-
if (
|
|
905
|
+
if (mt(n)) return n;
|
|
906
906
|
t = /* @__PURE__ */ Error("Module resolved without a valid default export");
|
|
907
907
|
} catch (e) {
|
|
908
908
|
t = e;
|
|
909
909
|
}
|
|
910
|
-
if (N || !
|
|
911
|
-
let n =
|
|
910
|
+
if (N || !at(t)) throw t;
|
|
911
|
+
let n = st(e);
|
|
912
912
|
if (n) try {
|
|
913
|
-
let e = await
|
|
914
|
-
if (
|
|
913
|
+
let e = await dt(n);
|
|
914
|
+
if (mt(e)) return e;
|
|
915
915
|
} catch {}
|
|
916
|
-
let r = Number(
|
|
917
|
-
return Date.now() - r <
|
|
918
|
-
}),
|
|
916
|
+
let r = Number(ct(nt) || "0");
|
|
917
|
+
return Date.now() - r < rt || it || (lt(nt, String(Date.now())), await pt()), { default: () => null };
|
|
918
|
+
}), gt = "machine+operator", _t = "HOURS", vt = 8, yt = 24, X = (e) => e?.withOperator ?? e?.type === gt, bt = (e) => X(e) && tt(e?.name).driverUnit !== "days", Z = (e = []) => e.find((e) => Q(e) || X(e.article)), Q = ({ qtyUnit: e }) => e === _t, xt = ({ qtyUnit: e, quantity: t }) => Q({ qtyUnit: e }) ? 1 : t || 1, St = (e) => {
|
|
919
919
|
let t = Z(e?.items);
|
|
920
920
|
return t && Q(t) && t.quantity ? t.quantity : void 0;
|
|
921
|
-
},
|
|
921
|
+
}, Ct = (e) => {
|
|
922
922
|
let t = Z(e?.items);
|
|
923
923
|
return !!t && Q(t) && t.unitPrice == null;
|
|
924
|
-
},
|
|
924
|
+
}, wt = "Page Left", Tt = 1800 * 1e3, Et = 1e3, Dt = (e, t = !0) => {
|
|
925
925
|
let n = 0, r = t ? e : null, i = !1, a = (e) => {
|
|
926
926
|
r !== null && (n += Math.max(0, e - r), r = null);
|
|
927
927
|
};
|
|
@@ -932,39 +932,39 @@ var it = (e) => {
|
|
|
932
932
|
resume: (e) => {
|
|
933
933
|
!i && r === null && (r = e);
|
|
934
934
|
},
|
|
935
|
-
stop: (e) => (i ||= (a(e), !0), Math.min(
|
|
935
|
+
stop: (e) => (i ||= (a(e), !0), Math.min(Tt, Math.round(n)))
|
|
936
936
|
};
|
|
937
|
-
},
|
|
937
|
+
}, Ot = (e, t) => t < 1e3 ? null : {
|
|
938
938
|
duration_ms: Math.round(t),
|
|
939
939
|
page_path: e
|
|
940
|
-
},
|
|
940
|
+
}, kt = (e) => {
|
|
941
941
|
if (typeof e != "object" || !e) return !1;
|
|
942
942
|
let { exp: t, sub: n, entity_id: r, scope: i } = e;
|
|
943
943
|
return typeof t == "number" && typeof n == "string" && typeof r == "number" && Array.isArray(i) && i.every((e) => typeof e == "string");
|
|
944
|
-
},
|
|
944
|
+
}, At = (e) => {
|
|
945
945
|
let t = e.replace(/-/g, "+").replace(/_/g, "/"), n = t + "=".repeat((4 - t.length % 4) % 4);
|
|
946
946
|
return decodeURIComponent(Array.from(atob(n), (e) => `%${e.charCodeAt(0).toString(16).padStart(2, "0")}`).join(""));
|
|
947
|
-
},
|
|
947
|
+
}, jt = (e) => {
|
|
948
948
|
let t = e?.split(".")[1];
|
|
949
949
|
if (!t) return null;
|
|
950
950
|
try {
|
|
951
|
-
let e = JSON.parse(
|
|
952
|
-
return
|
|
951
|
+
let e = JSON.parse(At(t));
|
|
952
|
+
return kt(e) ? e : null;
|
|
953
953
|
} catch {
|
|
954
954
|
return null;
|
|
955
955
|
}
|
|
956
|
-
}, $ = (e) => btoa(e).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, ""),
|
|
956
|
+
}, $ = (e) => btoa(e).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, ""), Mt = async (e, t) => {
|
|
957
957
|
let n = new TextEncoder(), r = await crypto.subtle.importKey("raw", n.encode(e), {
|
|
958
958
|
hash: "SHA-256",
|
|
959
959
|
name: "HMAC"
|
|
960
960
|
}, !1, ["sign"]), i = await crypto.subtle.sign("HMAC", r, n.encode(t));
|
|
961
961
|
return $(String.fromCharCode(...new Uint8Array(i)));
|
|
962
|
-
},
|
|
962
|
+
}, Nt = async (e, t) => {
|
|
963
963
|
let n = `${$(JSON.stringify({
|
|
964
964
|
alg: "HS256",
|
|
965
965
|
typ: "JWT"
|
|
966
966
|
}))}.${$(JSON.stringify(e))}`;
|
|
967
|
-
return `${n}.${await
|
|
967
|
+
return `${n}.${await Mt(t, n)}`;
|
|
968
968
|
};
|
|
969
969
|
//#endregion
|
|
970
|
-
export { A as AMPLITUDE_FEATURE_SELECTOR, O as AutoReloadOnNewVersion, _ as ChatClient,
|
|
970
|
+
export { A as AMPLITUDE_FEATURE_SELECTOR, O as AutoReloadOnNewVersion, _ as ChatClient, H as ChatContext, ye as ChatProvider, vt as DEFAULT_OPERATOR_HOURS_PER_DAY, k as GTMSendPageView, M as InitializeAmplitude, F as InitializeAxiosConfig, ae as InitializeDaysJSConfig, oe as InitializeHubSpot, se as InitializeI18nConfig, de as InitializeSentryConfig, y as InjectDependenciesContext, b as InjectDependenciesProvider, yt as MAX_OPERATOR_HOURS_PER_DAY, v as MaskTextField, Tt as PAGE_DURATION_CAP_MS, Et as PAGE_DURATION_MIN_MS, wt as PAGE_LEFT_EVENT, we as QueryProvider, pe as RequireAuth, ue as SENTRY_IGNORED_REQUEST_URLS, ce as SENTRY_KEEP_REPLAY, re as SUPPORTED_LANGUAGE, me as ShowHubSpotBubble, tt as articleNameAdapter, Dt as createVisibleStopwatch, W as dateAdapter, jt as decodeToken, G as distanceAdapter, Nt as encodeToken, Z as findOperatorItem, q as getCurrentLanguage, St as getOperatorHoursPerDay, e as getOrvalConfig, xt as getUnitCount, Q as isHourlyLine, X as isOperatorArticle, Ct as isOperatorRateMissing, bt as isOrderedByTheHour, le as isReplayKeptForError, ht as lazyWithRetry, z as matchesRequestUrl, Ot as pageLeftProperties, U as shouldRetryQuery, De as useAdapter, Oe as useAmplitude, ke as useAuth, Me as useChat, Ne as useCurrentLanguage, ze as useFilters, Ve as useHubSpot, He as useInfiniteDataGrid, Ue as useResponseError, K as worksiteNameAdapter };
|
|
@@ -29,6 +29,13 @@ export interface OperatorLine {
|
|
|
29
29
|
* Whether an article is rented with its driver: the catalog says so, or the article's type where the catalog says nothing
|
|
30
30
|
*/
|
|
31
31
|
export declare const isOperatorArticle: (article?: OperatorArticle | null) => boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Whether an article rented with its driver is ordered by the hour, for the driver's hours per day: unless its catalog
|
|
34
|
+
* name says it is billed by the day ("[Avec opérateur Jours]"), as a client's catalog does for its day rates
|
|
35
|
+
*/
|
|
36
|
+
export declare const isOrderedByTheHour: (article?: (OperatorArticle & {
|
|
37
|
+
name?: string | null;
|
|
38
|
+
}) | null) => boolean;
|
|
32
39
|
/**
|
|
33
40
|
* The line of an order rented with its driver, the one its hour sheets are about: the line ordered by the hour (a
|
|
34
41
|
* machine asked with its driver is, whatever its article), or one whose article comes with its driver, ordered by the day
|