@burdenoff/fe-libs 2026.1114.6 → 2026.1114.7
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.
|
@@ -4,7 +4,10 @@ import { TURN_OUTCOME_COPY as t } from "./turnOutcomeCopy.js";
|
|
|
4
4
|
var n = "assistant.errors.assistantProvisioningNotPermitted", r = /* @__PURE__ */ new Set([
|
|
5
5
|
"UNAUTHENTICATED_ACTOR",
|
|
6
6
|
"WORKSPACE_SESSION_UNRESOLVED",
|
|
7
|
-
"WORKSPACE_CONTEXT_MISSING"
|
|
7
|
+
"WORKSPACE_CONTEXT_MISSING",
|
|
8
|
+
"CREDENTIAL_EXPIRED",
|
|
9
|
+
"CREDENTIAL_REVOKED",
|
|
10
|
+
"CREDENTIAL_INVALID"
|
|
8
11
|
]);
|
|
9
12
|
function i(t) {
|
|
10
13
|
let n = !1, i = !1, a = null;
|
|
@@ -17,7 +20,7 @@ function i(t) {
|
|
|
17
20
|
return !n && !i && !a ? null : a && r.has(a) ? {
|
|
18
21
|
refusal: "session",
|
|
19
22
|
authFailure: a
|
|
20
|
-
} : {
|
|
23
|
+
} : a && !i ? null : {
|
|
21
24
|
refusal: i ? "provisioning-gated" : "denied",
|
|
22
25
|
authFailure: a
|
|
23
26
|
};
|
|
@@ -7,57 +7,58 @@ import { MultiGatewayProvider as c } from "./shell/MultiGatewayProvider.js";
|
|
|
7
7
|
import { useIdentityQueryReset as l } from "./shell/identityQueryReset.js";
|
|
8
8
|
import { IdentityScopedQueryReset as u } from "./shell/identityScopedQueryReset.js";
|
|
9
9
|
import { WorkspaceWriteRefusedToastListener as d } from "./shell/WorkspaceWriteRefusedToastListener.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
10
|
+
import { useShellLabel as f } from "./shell/useShellLabel.js";
|
|
11
|
+
import { ActiveContextProvider as p } from "./shell/ActiveContextProvider.js";
|
|
12
|
+
import { TourPermissionsBoundary as m } from "../tours/TourPermissionsBoundary.js";
|
|
13
|
+
import { ContextManagerProvider as h } from "./shell/ContextManagerProvider.js";
|
|
14
|
+
import { ThemeProvider as g } from "./shell/ThemeProvider.js";
|
|
15
|
+
import { ProfileI18nBridge as _ } from "./shell/ProfileI18nBridge.js";
|
|
15
16
|
import { resolveBrowserDirectionMode as ee } from "./shell/directionMode.js";
|
|
16
|
-
import { ProfileGeographyBridge as
|
|
17
|
-
import { FeatureFlagsProvider as
|
|
18
|
-
import { GlobalUiProvider as
|
|
19
|
-
import { ShellUiProvider as
|
|
20
|
-
import { FeatureFlagProvider as
|
|
21
|
-
import { TourInitializer as
|
|
22
|
-
import { TourPlayerProvider as
|
|
23
|
-
import { ToursProvider as
|
|
24
|
-
import { tourRouteBootstrap as
|
|
25
|
-
import { BUILDMYIQ_RYBBIT_EVENTS as
|
|
26
|
-
import { GGNOMAD_RYBBIT_EVENTS as
|
|
17
|
+
import { ProfileGeographyBridge as v } from "./shell/ProfileGeographyBridge.js";
|
|
18
|
+
import { FeatureFlagsProvider as y } from "./shell/FeatureFlagsProvider.js";
|
|
19
|
+
import { GlobalUiProvider as b } from "./shell/GlobalUiProvider.js";
|
|
20
|
+
import { ShellUiProvider as te } from "./shell/ShellUiProvider.js";
|
|
21
|
+
import { FeatureFlagProvider as x } from "../feature-flags/FeatureFlagProvider.js";
|
|
22
|
+
import { TourInitializer as S } from "../tours/TourInitializer.js";
|
|
23
|
+
import { TourPlayerProvider as C } from "../tours/TourPlayerProvider.js";
|
|
24
|
+
import { ToursProvider as ne, useToursContext as w } from "../tours/ToursContext.js";
|
|
25
|
+
import { tourRouteBootstrap as T } from "../tours/routeBootstrap.js";
|
|
26
|
+
import { BUILDMYIQ_RYBBIT_EVENTS as E } from "../events/buildmyiq.js";
|
|
27
|
+
import { GGNOMAD_RYBBIT_EVENTS as re } from "../events/ggnomad.js";
|
|
27
28
|
import { ErrorFallback as ie } from "../components/ErrorFallback.js";
|
|
28
|
-
import { TIMECAMPUS_RYBBIT_EVENTS as
|
|
29
|
-
import { THECULTUREPOST_RYBBIT_EVENTS as
|
|
30
|
-
import { FLUIDGRIDS_RYBBIT_EVENTS as
|
|
29
|
+
import { TIMECAMPUS_RYBBIT_EVENTS as ae } from "../events/timecampus.js";
|
|
30
|
+
import { THECULTUREPOST_RYBBIT_EVENTS as D } from "../events/theculturepost.js";
|
|
31
|
+
import { FLUIDGRIDS_RYBBIT_EVENTS as oe } from "../events/fluidgrids.js";
|
|
31
32
|
import { DevtoolsSink as O } from "../events/sinks/DevtoolsSink.js";
|
|
32
33
|
import { BroadcastChannelSink as k } from "../events/sinks/BroadcastChannelSink.js";
|
|
33
34
|
import { BackendAuditSink as A } from "../events/sinks/BackendAuditSink.js";
|
|
34
|
-
import { OtelBrowserSink as
|
|
35
|
-
import { emitProductSlug as se, legacyProductSlug as
|
|
35
|
+
import { OtelBrowserSink as j } from "../events/sinks/OtelBrowserSink.js";
|
|
36
|
+
import { emitProductSlug as se, legacyProductSlug as M } from "../config/productSlug.js";
|
|
36
37
|
import { setAssistantProductId as ce } from "../assistant/productContext.js";
|
|
37
|
-
import { PWAInstallBanner as
|
|
38
|
-
import { DesktopUpdateToast as
|
|
39
|
-
import { EventBusProvider as
|
|
40
|
-
import { AnalyticsConsentBanner as
|
|
41
|
-
import { SEMANTICFED_ANALYTICS_ROUTES as
|
|
42
|
-
import { COMRADECIRCLE_ANALYTICS_ROUTES as
|
|
38
|
+
import { PWAInstallBanner as le } from "../components/PWAInstallBanner.js";
|
|
39
|
+
import { DesktopUpdateToast as ue } from "../components/DesktopUpdateToast.js";
|
|
40
|
+
import { EventBusProvider as de, useEventBus as fe } from "../../shared-events.js";
|
|
41
|
+
import { AnalyticsConsentBanner as pe, DEFAULT_RYBBIT_ALLOWLIST as me, RybbitSink as he } from "../events/sinks/RybbitSink.js";
|
|
42
|
+
import { SEMANTICFED_ANALYTICS_ROUTES as N, SEMANTICFED_RYBBIT_EVENTS as ge } from "../events/semanticfed.js";
|
|
43
|
+
import { COMRADECIRCLE_ANALYTICS_ROUTES as P, COMRADECIRCLE_RYBBIT_EVENTS as F } from "../events/comradecircle.js";
|
|
43
44
|
import { ATHELETEBRIDGE_ANALYTICS_ROUTES as I, ATHELETEBRIDGE_RYBBIT_EVENTS as L } from "../events/atheletebridge.js";
|
|
44
|
-
import { attemptTokenRefresh as
|
|
45
|
-
import { SESSION_EXPIRED_EVENT as R, graphqlFetch as
|
|
46
|
-
import { AppShellContextProvider as
|
|
45
|
+
import { attemptTokenRefresh as _e, clearAuthSessionStorage as ve, getSharedTokenRefreshRefs as ye, isAuthNetworkError as be } from "../utils/authErrorHandling.js";
|
|
46
|
+
import { SESSION_EXPIRED_EVENT as R, graphqlFetch as xe } from "../graphql/fetch.js";
|
|
47
|
+
import { AppShellContextProvider as Se } from "./shell/AppShellContext.js";
|
|
47
48
|
import { useReferralAttribution as z } from "../hooks/useReferralAttribution.js";
|
|
48
|
-
import { ConsoleTransport as
|
|
49
|
-
import { LogManager as
|
|
49
|
+
import { ConsoleTransport as Ce } from "../logger/ConsoleTransport.js";
|
|
50
|
+
import { LogManager as we } from "../logger/LogManager.js";
|
|
50
51
|
import { isShellLessRoute as B } from "../config/shellRoutes.js";
|
|
51
|
-
import { useRegisterTourRouteCatalog as
|
|
52
|
-
import { BACKEND_ERROR_EVENT as V, CONNECTION_STATUS_EVENT as H, dispatchBackendErrorEvent as
|
|
53
|
-
import { usePushDeviceRegistration as
|
|
54
|
-
import { Suspense as
|
|
55
|
-
import { Fragment as
|
|
56
|
-
import { BrowserRouter as
|
|
57
|
-
import { Toaster as
|
|
58
|
-
import { MutationCache as
|
|
52
|
+
import { useRegisterTourRouteCatalog as Te } from "../tours/useTourRouteCatalog.js";
|
|
53
|
+
import { BACKEND_ERROR_EVENT as V, CONNECTION_STATUS_EVENT as H, dispatchBackendErrorEvent as Ee, getBackendErrorToastDedupe as De, isBackendErrorDisplay as Oe, shouldToastBackendError as U } from "../utils/backendErrors.js";
|
|
54
|
+
import { usePushDeviceRegistration as W } from "../hooks/usePushDeviceRegistration.js";
|
|
55
|
+
import { Suspense as ke, useCallback as G, useEffect as K, useMemo as q, useRef as J, useState as Ae } from "react";
|
|
56
|
+
import { Fragment as je, jsx as Y, jsxs as X } from "react/jsx-runtime";
|
|
57
|
+
import { BrowserRouter as Me, useLocation as Z } from "react-router";
|
|
58
|
+
import { Toaster as Ne, toast as Q } from "sonner";
|
|
59
|
+
import { MutationCache as Pe, QueryCache as Fe, QueryClient as Ie, QueryClientProvider as Le } from "@tanstack/react-query";
|
|
59
60
|
// src/shared/providers/AppShellProvider.tsx
|
|
60
|
-
var
|
|
61
|
+
var Re = {
|
|
61
62
|
artistrybase: { prod: "cfbecacb6002" },
|
|
62
63
|
atheletebridge: { prod: "c34c6ead7aa8" },
|
|
63
64
|
adaptercloud: {},
|
|
@@ -86,7 +87,7 @@ var Le = {
|
|
|
86
87
|
subscriberbot: {},
|
|
87
88
|
intelwatchtower: {},
|
|
88
89
|
kadaikodi: {}
|
|
89
|
-
},
|
|
90
|
+
}, ze = [
|
|
90
91
|
"nav.route.changed",
|
|
91
92
|
"auth.signed_in",
|
|
92
93
|
"auth.signed_out",
|
|
@@ -129,10 +130,10 @@ var Le = {
|
|
|
129
130
|
"coolandlovely.wardrobe.item_added",
|
|
130
131
|
"coolandlovely.search.performed",
|
|
131
132
|
"vibecontrols.agent.registered",
|
|
133
|
+
...oe,
|
|
134
|
+
...E,
|
|
132
135
|
...D,
|
|
133
|
-
...
|
|
134
|
-
...ae,
|
|
135
|
-
...T,
|
|
136
|
+
...re,
|
|
136
137
|
...L,
|
|
137
138
|
"vibecontrols.agent.gateway_auth_setup",
|
|
138
139
|
"vibecontrols.session.created",
|
|
@@ -309,7 +310,7 @@ var Le = {
|
|
|
309
310
|
"labsofscience.pipeline.run_started",
|
|
310
311
|
"hookmovies.page.viewed",
|
|
311
312
|
"headshotmarketing.page.viewed",
|
|
312
|
-
...
|
|
313
|
+
...ae,
|
|
313
314
|
"kadaikodi.page.viewed",
|
|
314
315
|
"kadaikodi.discover.viewed",
|
|
315
316
|
"kadaikodi.discover.searched",
|
|
@@ -329,7 +330,7 @@ var Le = {
|
|
|
329
330
|
"project.created",
|
|
330
331
|
"workspace-member.added",
|
|
331
332
|
"project-member.added"
|
|
332
|
-
],
|
|
333
|
+
], Be = {
|
|
333
334
|
"--success-bg": "var(--color-status-success-bgSubtle)",
|
|
334
335
|
"--success-border": "var(--color-status-success-border)",
|
|
335
336
|
"--success-text": "var(--color-status-success-text)",
|
|
@@ -343,7 +344,7 @@ var Le = {
|
|
|
343
344
|
"--error-border": "var(--color-status-error-border)",
|
|
344
345
|
"--error-text": "var(--color-status-error-text)"
|
|
345
346
|
};
|
|
346
|
-
function
|
|
347
|
+
function Ve(e) {
|
|
347
348
|
let t = e.technicalMessage ?? e.extensions?.technicalMessage, n = {
|
|
348
349
|
code: e.code,
|
|
349
350
|
operationName: e.operationName,
|
|
@@ -355,13 +356,13 @@ function Be(e) {
|
|
|
355
356
|
};
|
|
356
357
|
console.error("[Burdenoff backend error]", e.message, n);
|
|
357
358
|
}
|
|
358
|
-
function
|
|
359
|
+
function He(e) {
|
|
359
360
|
return e === "prod" || e === "production" ? "prod" : e === "alpha" || e === "staging" ? "alpha" : "dev";
|
|
360
361
|
}
|
|
361
|
-
function
|
|
362
|
+
function Ue(e, t) {
|
|
362
363
|
return e.VITE_DISABLE_ANALYTICS === "true" ? !1 : e.VITE_ENABLE_ANALYTICS === "true" || e.PROD || t !== "dev" ? !0 : e.VITE_ENABLE_ANALYTICS !== "false";
|
|
363
364
|
}
|
|
364
|
-
function
|
|
365
|
+
function We() {
|
|
365
366
|
return {
|
|
366
367
|
BASE_URL: "/",
|
|
367
368
|
DEV: !1,
|
|
@@ -370,9 +371,9 @@ function Ue() {
|
|
|
370
371
|
SSR: !1
|
|
371
372
|
};
|
|
372
373
|
}
|
|
373
|
-
function
|
|
374
|
+
function Ge(e, t) {
|
|
374
375
|
if (!t || t.length === 0 || !e.rybbit) return e;
|
|
375
|
-
let n = e.rybbit.allowlist ??
|
|
376
|
+
let n = e.rybbit.allowlist ?? me, r = [.../* @__PURE__ */ new Set([...n, ...t])];
|
|
376
377
|
return {
|
|
377
378
|
...e,
|
|
378
379
|
rybbit: {
|
|
@@ -381,22 +382,22 @@ function We(e, t) {
|
|
|
381
382
|
}
|
|
382
383
|
};
|
|
383
384
|
}
|
|
384
|
-
var
|
|
385
|
+
var Ke = {
|
|
385
386
|
comradecircle: {
|
|
386
|
-
routes:
|
|
387
|
+
routes: P,
|
|
387
388
|
events: F
|
|
388
389
|
},
|
|
389
390
|
semanticfed: {
|
|
390
|
-
routes:
|
|
391
|
-
events:
|
|
391
|
+
routes: N,
|
|
392
|
+
events: ge
|
|
392
393
|
},
|
|
393
394
|
atheletebridge: {
|
|
394
395
|
routes: I,
|
|
395
396
|
events: L
|
|
396
397
|
}
|
|
397
398
|
};
|
|
398
|
-
function
|
|
399
|
-
let n =
|
|
399
|
+
function qe(e, t) {
|
|
400
|
+
let n = He(t.VITE_DEPLOY_ENV ?? t.MODE), r = Ue(t, n), i = Re[e] ?? Re[M(e)], a = n === "prod" ? i?.prod : i?.nonProd, o = t.VITE_RYBBIT_SITE_ID || a, s = Ke[e], c = t.VITE_BACKEND_AUDIT_ENDPOINT || (t.PROD ? "/api/fe-events" : void 0);
|
|
400
401
|
return {
|
|
401
402
|
enabled: r,
|
|
402
403
|
appVersion: t.VITE_APP_VERSION || "0.0.0",
|
|
@@ -409,7 +410,7 @@ function Ke(e, t) {
|
|
|
409
410
|
scriptUrl: t.VITE_RYBBIT_SCRIPT_URL,
|
|
410
411
|
eventEndpoint: s ? "https://app.rybbit.io/api/track" : void 0,
|
|
411
412
|
routeTemplates: s?.routes,
|
|
412
|
-
allowlist: s ? [...s.events] :
|
|
413
|
+
allowlist: s ? [...s.events] : ze,
|
|
413
414
|
identifyOn: "auth.signed_in",
|
|
414
415
|
rename: { "nav.route.changed": "pageview" }
|
|
415
416
|
},
|
|
@@ -424,8 +425,8 @@ function Ke(e, t) {
|
|
|
424
425
|
}
|
|
425
426
|
};
|
|
426
427
|
}
|
|
427
|
-
function
|
|
428
|
-
let { trackProgress: a, recordStepCompletion: o, trackEvent: s, progressScopeKey: c } =
|
|
428
|
+
function Je({ children: e, enablePWA: t, toasterPosition: n, productName: r, brandInitial: i }) {
|
|
429
|
+
let { trackProgress: a, recordStepCompletion: o, trackEvent: s, progressScopeKey: c } = w(), l = G((e, t) => e.steps?.[t], []), u = G((e) => {
|
|
429
430
|
a(e.id, "started"), s("TOUR_STARTED", e.id);
|
|
430
431
|
}, [s, a]), f = G((e) => {
|
|
431
432
|
a(e.id, "completed"), s("TOUR_COMPLETED", e.id);
|
|
@@ -456,7 +457,7 @@ function qe({ children: e, enablePWA: t, toasterPosition: n, productName: r, bra
|
|
|
456
457
|
o,
|
|
457
458
|
s
|
|
458
459
|
]);
|
|
459
|
-
return /* @__PURE__ */ X(
|
|
460
|
+
return /* @__PURE__ */ X(C, {
|
|
460
461
|
scopeKey: c,
|
|
461
462
|
onTourStart: u,
|
|
462
463
|
onTourComplete: f,
|
|
@@ -464,21 +465,21 @@ function qe({ children: e, enablePWA: t, toasterPosition: n, productName: r, bra
|
|
|
464
465
|
onStepChange: m,
|
|
465
466
|
onStepComplete: h,
|
|
466
467
|
children: [
|
|
467
|
-
/* @__PURE__ */ Y(
|
|
468
|
+
/* @__PURE__ */ Y(S, {}),
|
|
468
469
|
e,
|
|
469
|
-
/* @__PURE__ */ Y(
|
|
470
|
+
/* @__PURE__ */ Y(Ye, {}),
|
|
470
471
|
/* @__PURE__ */ Y(d, {}),
|
|
471
|
-
/* @__PURE__ */ Y(
|
|
472
|
-
/* @__PURE__ */ Y(
|
|
472
|
+
/* @__PURE__ */ Y(Ze, {}),
|
|
473
|
+
/* @__PURE__ */ Y(Ne, {
|
|
473
474
|
position: n,
|
|
474
475
|
richColors: !0,
|
|
475
476
|
closeButton: !0,
|
|
476
|
-
style:
|
|
477
|
+
style: Be
|
|
477
478
|
}),
|
|
478
|
-
/* @__PURE__ */ Y(
|
|
479
|
-
t && /* @__PURE__ */ Y(
|
|
479
|
+
/* @__PURE__ */ Y(ue, {}),
|
|
480
|
+
t && /* @__PURE__ */ Y(ke, {
|
|
480
481
|
fallback: null,
|
|
481
|
-
children: /* @__PURE__ */ Y(
|
|
482
|
+
children: /* @__PURE__ */ Y(le, {
|
|
482
483
|
productName: r,
|
|
483
484
|
brandInitial: i
|
|
484
485
|
})
|
|
@@ -486,24 +487,27 @@ function qe({ children: e, enablePWA: t, toasterPosition: n, productName: r, bra
|
|
|
486
487
|
]
|
|
487
488
|
});
|
|
488
489
|
}
|
|
489
|
-
function
|
|
490
|
-
let e = J(null);
|
|
490
|
+
function Ye() {
|
|
491
|
+
let e = J(null), t = f();
|
|
491
492
|
return K(() => {
|
|
492
|
-
let
|
|
493
|
-
let
|
|
494
|
-
if (!
|
|
495
|
-
|
|
496
|
-
let { key:
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
493
|
+
let n = (n) => {
|
|
494
|
+
let r = n instanceof CustomEvent && Oe(n.detail) ? n.detail : null;
|
|
495
|
+
if (!U(r)) return;
|
|
496
|
+
Ve(r);
|
|
497
|
+
let { key: i, windowMs: a } = De(r), o = Date.now(), s = e.current;
|
|
498
|
+
if (s?.key === i && o - s.shownAt < a) return;
|
|
499
|
+
e.current = {
|
|
500
|
+
key: i,
|
|
501
|
+
shownAt: o
|
|
502
|
+
};
|
|
503
|
+
let c = r.messageKey ? t(r.messageKey, r.message) : r.message;
|
|
504
|
+
Q.error(c, { duration: 7e3 });
|
|
501
505
|
};
|
|
502
|
-
return window.addEventListener(V,
|
|
503
|
-
}, []), null;
|
|
506
|
+
return window.addEventListener(V, n), () => window.removeEventListener(V, n);
|
|
507
|
+
}, [t]), null;
|
|
504
508
|
}
|
|
505
|
-
var $ = "burdenoff-connection-status",
|
|
506
|
-
function
|
|
509
|
+
var $ = "burdenoff-connection-status", Xe = 1500;
|
|
510
|
+
function Ze() {
|
|
507
511
|
let e = J(null), t = J(!1);
|
|
508
512
|
return K(() => {
|
|
509
513
|
let n = () => {
|
|
@@ -514,7 +518,7 @@ function Xe() {
|
|
|
514
518
|
}, r = () => {
|
|
515
519
|
t.current || e.current || (e.current = setTimeout(() => {
|
|
516
520
|
e.current = null, n();
|
|
517
|
-
},
|
|
521
|
+
}, Xe));
|
|
518
522
|
}, i = (n) => {
|
|
519
523
|
e.current &&= (clearTimeout(e.current), null), t.current ? (t.current = !1, n ? Q.success("Back online", {
|
|
520
524
|
id: $,
|
|
@@ -532,51 +536,51 @@ function Xe() {
|
|
|
532
536
|
};
|
|
533
537
|
}, []), null;
|
|
534
538
|
}
|
|
535
|
-
function
|
|
536
|
-
return
|
|
539
|
+
function Qe() {
|
|
540
|
+
return W(), null;
|
|
537
541
|
}
|
|
538
|
-
function
|
|
542
|
+
function $e({ children: t, i18nProductId: n, platformI18nProductId: r, directionMode: i, fallbackTranslations: a, defaultBrand: o, defaultMode: s, defaultDensity: c, defaultTypography: l, defaultGlass: u, productName: d, brandInitial: f, enablePWA: p, toasterPosition: h, tourPageIdFromPath: ee, enableWorkspaceTourPermissions: S }) {
|
|
539
543
|
let C = Z();
|
|
540
544
|
z();
|
|
541
|
-
let w =
|
|
545
|
+
let w = T(C.pathname, !!S), E = /* @__PURE__ */ Y(v, { children: /* @__PURE__ */ Y(y, { children: /* @__PURE__ */ Y(x, {
|
|
542
546
|
workspaceId: null,
|
|
543
547
|
gateway: "global",
|
|
544
548
|
defaultEnabled: !0,
|
|
545
|
-
children: /* @__PURE__ */ Y(
|
|
549
|
+
children: /* @__PURE__ */ Y(b, { children: /* @__PURE__ */ Y(te, { children: /* @__PURE__ */ Y(e, {
|
|
546
550
|
fallback: null,
|
|
547
|
-
children: /* @__PURE__ */ Y(
|
|
551
|
+
children: /* @__PURE__ */ Y(m, {
|
|
548
552
|
enabled: w.workspacePermissions,
|
|
549
|
-
children: /* @__PURE__ */ Y(
|
|
553
|
+
children: /* @__PURE__ */ Y(ne, {
|
|
550
554
|
requireWorkspace: w.requireWorkspace,
|
|
551
555
|
disabled: w.toursDisabled,
|
|
552
|
-
getPageIdFromPath:
|
|
553
|
-
children: /* @__PURE__ */ X(
|
|
554
|
-
enablePWA:
|
|
555
|
-
toasterPosition:
|
|
556
|
+
getPageIdFromPath: ee,
|
|
557
|
+
children: /* @__PURE__ */ X(Je, {
|
|
558
|
+
enablePWA: p,
|
|
559
|
+
toasterPosition: h,
|
|
556
560
|
productName: d,
|
|
557
561
|
brandInitial: f,
|
|
558
|
-
children: [/* @__PURE__ */ Y(
|
|
562
|
+
children: [/* @__PURE__ */ Y(Qe, {}), t]
|
|
559
563
|
})
|
|
560
564
|
})
|
|
561
565
|
})
|
|
562
566
|
}) }) })
|
|
563
567
|
}) }) });
|
|
564
|
-
return /* @__PURE__ */ X(
|
|
568
|
+
return /* @__PURE__ */ X(g, {
|
|
565
569
|
defaultBrand: o,
|
|
566
570
|
defaultMode: s,
|
|
567
571
|
defaultDensity: c,
|
|
568
572
|
defaultTypography: l,
|
|
569
573
|
defaultGlass: u,
|
|
570
|
-
children: [/* @__PURE__ */ Y(
|
|
574
|
+
children: [/* @__PURE__ */ Y(et, {}), /* @__PURE__ */ Y(_, {
|
|
571
575
|
i18nProductId: n,
|
|
572
576
|
platformI18nProductId: r,
|
|
573
577
|
directionMode: i,
|
|
574
578
|
fallbackTranslations: a,
|
|
575
|
-
children:
|
|
579
|
+
children: E
|
|
576
580
|
})]
|
|
577
581
|
});
|
|
578
582
|
}
|
|
579
|
-
function
|
|
583
|
+
function et() {
|
|
580
584
|
let e = Z();
|
|
581
585
|
return K(() => {
|
|
582
586
|
e.hash || requestAnimationFrame(() => {
|
|
@@ -596,7 +600,7 @@ function $e() {
|
|
|
596
600
|
e.hash
|
|
597
601
|
]), null;
|
|
598
602
|
}
|
|
599
|
-
function
|
|
603
|
+
function tt(e) {
|
|
600
604
|
if (e instanceof Error) return e.message;
|
|
601
605
|
if (typeof e == "string") return e;
|
|
602
606
|
try {
|
|
@@ -605,8 +609,8 @@ function et(e) {
|
|
|
605
609
|
return String(e);
|
|
606
610
|
}
|
|
607
611
|
}
|
|
608
|
-
function
|
|
609
|
-
let e =
|
|
612
|
+
function nt() {
|
|
613
|
+
let e = fe(), a = Z(), o = J(void 0), s = J(void 0), c = J(null);
|
|
610
614
|
return K(() => {
|
|
611
615
|
let t = `${a.pathname}${a.search}${a.hash}`;
|
|
612
616
|
if (s.current !== t) return c.current && clearTimeout(c.current), c.current = setTimeout(() => {
|
|
@@ -637,7 +641,7 @@ function tt() {
|
|
|
637
641
|
errorName: t.error instanceof Error ? t.error.name : void 0
|
|
638
642
|
});
|
|
639
643
|
}, n = (t) => {
|
|
640
|
-
e.emit("error.unhandledrejection", { reason:
|
|
644
|
+
e.emit("error.unhandledrejection", { reason: tt(t.reason) });
|
|
641
645
|
};
|
|
642
646
|
return window.addEventListener("error", t), window.addEventListener("unhandledrejection", n), () => {
|
|
643
647
|
window.removeEventListener("error", t), window.removeEventListener("unhandledrejection", n);
|
|
@@ -674,19 +678,19 @@ function tt() {
|
|
|
674
678
|
});
|
|
675
679
|
}, [e]), null;
|
|
676
680
|
}
|
|
677
|
-
function
|
|
681
|
+
function rt({ config: e, productSlug: t, productName: n, privacyConsent: r, privacyConsentReopen: i, consentRouteDenylist: a, rybbitSkipRoutes: o }) {
|
|
678
682
|
let { pathname: s } = Z(), c = B(s) || a?.(s) === !0;
|
|
679
|
-
return /* @__PURE__ */ X(
|
|
680
|
-
/* @__PURE__ */ Y(
|
|
681
|
-
r && !c ? /* @__PURE__ */ Y(
|
|
683
|
+
return /* @__PURE__ */ X(je, { children: [
|
|
684
|
+
/* @__PURE__ */ Y(nt, {}),
|
|
685
|
+
r && !c ? /* @__PURE__ */ Y(pe, {
|
|
682
686
|
productName: n,
|
|
683
687
|
reopenable: i
|
|
684
688
|
}) : null,
|
|
685
|
-
e.enabled === !1 ? null : /* @__PURE__ */ X(
|
|
689
|
+
e.enabled === !1 ? null : /* @__PURE__ */ X(je, { children: [
|
|
686
690
|
e.devtools ? /* @__PURE__ */ Y(O, { enabled: !0 }) : null,
|
|
687
691
|
e.broadcast === !1 ? null : /* @__PURE__ */ Y(k, {}),
|
|
688
692
|
e.backendAudit?.enabled && e.backendAudit.endpoint ? /* @__PURE__ */ Y(A, { endpoint: e.backendAudit.endpoint }) : null,
|
|
689
|
-
e.rybbit?.enabled && e.rybbit.siteId ? /* @__PURE__ */ Y(
|
|
693
|
+
e.rybbit?.enabled && e.rybbit.siteId ? /* @__PURE__ */ Y(he, {
|
|
690
694
|
siteId: e.rybbit.siteId,
|
|
691
695
|
scriptUrl: e.rybbit.scriptUrl,
|
|
692
696
|
eventEndpoint: e.rybbit.eventEndpoint,
|
|
@@ -697,7 +701,7 @@ function nt({ config: e, productSlug: t, productName: n, privacyConsent: r, priv
|
|
|
697
701
|
skipRoutes: o,
|
|
698
702
|
pathname: s
|
|
699
703
|
}) : null,
|
|
700
|
-
e.otel?.enabled && e.otel.endpoint ? /* @__PURE__ */ Y(
|
|
704
|
+
e.otel?.enabled && e.otel.endpoint ? /* @__PURE__ */ Y(j, {
|
|
701
705
|
endpoint: e.otel.endpoint,
|
|
702
706
|
serviceName: e.otel.serviceName ?? `${t}-app`,
|
|
703
707
|
flushInterval: e.otel.flushInterval
|
|
@@ -705,29 +709,29 @@ function nt({ config: e, productSlug: t, productName: n, privacyConsent: r, priv
|
|
|
705
709
|
] })
|
|
706
710
|
] });
|
|
707
711
|
}
|
|
708
|
-
function
|
|
709
|
-
let { productName: i, productSlug: d = i.toLowerCase().replace(/\s+/g, ""), tagline:
|
|
710
|
-
|
|
711
|
-
let [
|
|
712
|
-
enabled:
|
|
713
|
-
allowPreview:
|
|
714
|
-
})),
|
|
715
|
-
|
|
712
|
+
function it({ config: t, children: n, clearAuthStore: r }) {
|
|
713
|
+
let { productName: i, productSlug: d = i.toLowerCase().replace(/\s+/g, ""), tagline: f = "", domain: m, i18nProductId: g, platformI18nProductId: _, rtl: v, gatewayUrls: y, authBridge: b, defaultBrand: te = "default", defaultMode: x, defaultDensity: S, defaultTypography: C, defaultGlass: ne, enablePWA: w = !0, brandInitial: T = i.charAt(0), defaultGateway: E = "workspace", enableSubscriptions: re = !0, fallbackTranslations: ae, queryClientOptions: D, toasterPosition: oe = "bottom-right", observability: O, privacyConsent: k = !1, privacyConsentReopen: A = !1, consentRouteDenylist: j, rybbitEvents: M, rybbitSkipRoutes: le, tourPageIdFromPath: ue, tourRouteCatalog: fe, enableWorkspaceTourPermissions: pe = !1, workspaceOperationGuard: me = "off" } = t;
|
|
714
|
+
Te(d, fe), K(() => ce(se(d)), [d]);
|
|
715
|
+
let [he] = Ae(() => ee({
|
|
716
|
+
enabled: v?.enabled,
|
|
717
|
+
allowPreview: v?.preview
|
|
718
|
+
})), N = q(() => Ge(O ?? qe(d, We()), M), [
|
|
719
|
+
O,
|
|
716
720
|
d,
|
|
717
721
|
M
|
|
718
|
-
]),
|
|
722
|
+
]), ge = q(() => ({
|
|
719
723
|
productName: i,
|
|
720
724
|
productSlug: d,
|
|
721
|
-
brandInitial:
|
|
722
|
-
tagline:
|
|
723
|
-
domain:
|
|
725
|
+
brandInitial: T,
|
|
726
|
+
tagline: f,
|
|
727
|
+
domain: m
|
|
724
728
|
}), [
|
|
725
729
|
i,
|
|
726
730
|
d,
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
]),
|
|
731
|
+
T,
|
|
732
|
+
f,
|
|
733
|
+
m
|
|
734
|
+
]), P = J(!1), F = J(!!b?.url), I = G((e) => {
|
|
731
735
|
if (!e?.force && (() => {
|
|
732
736
|
try {
|
|
733
737
|
let e = sessionStorage.getItem("bf-active-profile");
|
|
@@ -737,21 +741,21 @@ function rt({ config: t, children: n, clearAuthStore: r }) {
|
|
|
737
741
|
} catch {
|
|
738
742
|
return !1;
|
|
739
743
|
}
|
|
740
|
-
})() ||
|
|
741
|
-
|
|
744
|
+
})() || F.current || P.current) return;
|
|
745
|
+
P.current = !0, ve(r);
|
|
742
746
|
let t = `${window.location.pathname}${window.location.search}`, n = `/auth/login?reason=session-expired&returnTo=${encodeURIComponent(t)}`, i = /^\/vibecontrols\/(share|deck)\//.test(window.location.pathname);
|
|
743
|
-
window.location.pathname.startsWith("/auth/") || B(window.location.pathname) || i ?
|
|
744
|
-
}, [r]),
|
|
745
|
-
globalBaseUrl:
|
|
746
|
-
...
|
|
747
|
-
}), [
|
|
748
|
-
window.location.pathname.startsWith("/auth/") || await
|
|
749
|
-
}, [
|
|
750
|
-
|
|
751
|
-
}, [
|
|
752
|
-
let t = await
|
|
747
|
+
window.location.pathname.startsWith("/auth/") || B(window.location.pathname) || i ? P.current = !1 : window.location.replace(n);
|
|
748
|
+
}, [r]), L = q(() => ({
|
|
749
|
+
globalBaseUrl: y.globalBaseUrl,
|
|
750
|
+
...ye()
|
|
751
|
+
}), [y.globalBaseUrl]), z = G(async () => _e(L), [L]), V = G(async () => {
|
|
752
|
+
window.location.pathname.startsWith("/auth/") || await z() || I({ force: !0 });
|
|
753
|
+
}, [z, I]), H = G(async (e) => {
|
|
754
|
+
be(e) ? await z() || I({ force: !0 }) : console.error("[Network] Backend unreachable:", e.message);
|
|
755
|
+
}, [z, I]), De = G(async (e) => {
|
|
756
|
+
let t = await xe({
|
|
753
757
|
gateway: "global",
|
|
754
|
-
baseUrl:
|
|
758
|
+
baseUrl: y.globalBaseUrl,
|
|
755
759
|
authToken: "",
|
|
756
760
|
query: "mutation RefreshToken($token: String!) {\n refreshToken(token: $token) {\n accessToken\n refreshToken\n expiresIn\n }\n }",
|
|
757
761
|
variables: { token: e }
|
|
@@ -763,17 +767,17 @@ function rt({ config: t, children: n, clearAuthStore: r }) {
|
|
|
763
767
|
refreshToken: n.refreshToken,
|
|
764
768
|
expiresAt: n.expiresIn ? Date.now() + n.expiresIn * 1e3 : void 0
|
|
765
769
|
};
|
|
766
|
-
}, [
|
|
767
|
-
let e = new
|
|
768
|
-
queryCache: new
|
|
769
|
-
|
|
770
|
+
}, [y.globalBaseUrl]), Oe = G(() => s("organization"), []), U = q(() => {
|
|
771
|
+
let e = new Ie({
|
|
772
|
+
queryCache: new Fe({ onError: (e) => {
|
|
773
|
+
Ee(e);
|
|
770
774
|
} }),
|
|
771
|
-
mutationCache: new
|
|
775
|
+
mutationCache: new Pe({
|
|
772
776
|
onSuccess: () => {
|
|
773
777
|
e.invalidateQueries();
|
|
774
778
|
},
|
|
775
779
|
onError: (e) => {
|
|
776
|
-
|
|
780
|
+
Ee(e);
|
|
777
781
|
}
|
|
778
782
|
}),
|
|
779
783
|
defaultOptions: { queries: {
|
|
@@ -786,77 +790,77 @@ function rt({ config: t, children: n, clearAuthStore: r }) {
|
|
|
786
790
|
}, [D]), W = l(U);
|
|
787
791
|
return K(() => {
|
|
788
792
|
let e = () => {
|
|
789
|
-
|
|
793
|
+
I({ force: !0 });
|
|
790
794
|
};
|
|
791
795
|
return window.addEventListener(R, e), () => {
|
|
792
796
|
window.removeEventListener(R, e);
|
|
793
797
|
};
|
|
794
|
-
}, [
|
|
795
|
-
let e =
|
|
796
|
-
e.getLogger("shell") || e.getLogger("shell").addTransport(new
|
|
797
|
-
}, []), /* @__PURE__ */ Y(
|
|
798
|
-
value:
|
|
799
|
-
children: /* @__PURE__ */ Y(
|
|
798
|
+
}, [I]), K(() => {
|
|
799
|
+
let e = we.getInstance();
|
|
800
|
+
e.getLogger("shell") || e.getLogger("shell").addTransport(new Ce());
|
|
801
|
+
}, []), /* @__PURE__ */ Y(Se, {
|
|
802
|
+
value: ge,
|
|
803
|
+
children: /* @__PURE__ */ Y(de, {
|
|
800
804
|
appName: d,
|
|
801
|
-
appVersion:
|
|
802
|
-
appEnv:
|
|
805
|
+
appVersion: N.appVersion,
|
|
806
|
+
appEnv: N.appEnv,
|
|
803
807
|
sourceMfe: d,
|
|
804
808
|
children: /* @__PURE__ */ Y(e, {
|
|
805
809
|
FallbackComponent: ie,
|
|
806
|
-
children: /* @__PURE__ */ X(
|
|
807
|
-
config:
|
|
810
|
+
children: /* @__PURE__ */ X(Me, { children: [/* @__PURE__ */ Y(rt, {
|
|
811
|
+
config: N,
|
|
808
812
|
productSlug: d,
|
|
809
813
|
productName: i,
|
|
810
|
-
privacyConsent:
|
|
811
|
-
privacyConsentReopen:
|
|
814
|
+
privacyConsent: k,
|
|
815
|
+
privacyConsentReopen: A,
|
|
812
816
|
consentRouteDenylist: j,
|
|
813
|
-
rybbitSkipRoutes:
|
|
814
|
-
}), /* @__PURE__ */ Y(
|
|
817
|
+
rybbitSkipRoutes: le
|
|
818
|
+
}), /* @__PURE__ */ Y(Le, {
|
|
815
819
|
client: U,
|
|
816
820
|
children: /* @__PURE__ */ Y(o, { children: /* @__PURE__ */ Y(c, {
|
|
817
|
-
workspaceBaseUrl:
|
|
818
|
-
globalBaseUrl:
|
|
821
|
+
workspaceBaseUrl: y.workspaceBaseUrl,
|
|
822
|
+
globalBaseUrl: y.globalBaseUrl,
|
|
819
823
|
organizationId: Oe,
|
|
820
824
|
productSlug: d,
|
|
821
|
-
defaultGateway:
|
|
822
|
-
enableSubscriptions:
|
|
823
|
-
onAuthError:
|
|
824
|
-
onNetworkError:
|
|
825
|
-
onRefreshToken:
|
|
826
|
-
workspaceOperationGuard:
|
|
825
|
+
defaultGateway: E,
|
|
826
|
+
enableSubscriptions: re,
|
|
827
|
+
onAuthError: V,
|
|
828
|
+
onNetworkError: H,
|
|
829
|
+
onRefreshToken: z,
|
|
830
|
+
workspaceOperationGuard: me,
|
|
827
831
|
children: /* @__PURE__ */ X(a, {
|
|
828
|
-
bridgeUrl:
|
|
829
|
-
bridgeAllowedOrigins:
|
|
830
|
-
bridgeDebug:
|
|
832
|
+
bridgeUrl: b?.url,
|
|
833
|
+
bridgeAllowedOrigins: b?.allowedOrigins,
|
|
834
|
+
bridgeDebug: b?.debug,
|
|
831
835
|
onRefreshToken: De,
|
|
832
836
|
onBridgeReady: () => {
|
|
833
|
-
|
|
837
|
+
F.current = !1;
|
|
834
838
|
},
|
|
835
839
|
onSessionExpiringSoon: () => {
|
|
836
840
|
console.warn("[Auth] Session will expire in 5 minutes");
|
|
837
841
|
},
|
|
838
842
|
onTokenExpired: () => {
|
|
839
|
-
|
|
843
|
+
I();
|
|
840
844
|
},
|
|
841
845
|
onBeforeIdentityChange: W.onBeforeIdentityChange,
|
|
842
|
-
children: [/* @__PURE__ */ Y(u, { announcementsRef: W.announcementsRef }), /* @__PURE__ */ Y(
|
|
846
|
+
children: [/* @__PURE__ */ Y(u, { announcementsRef: W.announcementsRef }), /* @__PURE__ */ Y(p, {
|
|
843
847
|
syncToUrl: !0,
|
|
844
|
-
children: /* @__PURE__ */ Y(
|
|
848
|
+
children: /* @__PURE__ */ Y(h, { children: /* @__PURE__ */ Y($e, {
|
|
845
849
|
i18nProductId: g,
|
|
846
|
-
platformI18nProductId:
|
|
847
|
-
directionMode:
|
|
850
|
+
platformI18nProductId: _,
|
|
851
|
+
directionMode: he,
|
|
848
852
|
fallbackTranslations: ae,
|
|
849
|
-
defaultBrand:
|
|
850
|
-
defaultMode:
|
|
851
|
-
defaultDensity:
|
|
852
|
-
defaultTypography:
|
|
853
|
-
defaultGlass:
|
|
853
|
+
defaultBrand: te,
|
|
854
|
+
defaultMode: x,
|
|
855
|
+
defaultDensity: S,
|
|
856
|
+
defaultTypography: C,
|
|
857
|
+
defaultGlass: ne,
|
|
854
858
|
productName: i,
|
|
855
|
-
brandInitial:
|
|
856
|
-
enablePWA:
|
|
857
|
-
toasterPosition:
|
|
859
|
+
brandInitial: T,
|
|
860
|
+
enablePWA: w,
|
|
861
|
+
toasterPosition: oe,
|
|
858
862
|
tourPageIdFromPath: ue,
|
|
859
|
-
enableWorkspaceTourPermissions:
|
|
863
|
+
enableWorkspaceTourPermissions: pe,
|
|
860
864
|
children: n
|
|
861
865
|
}) })
|
|
862
866
|
})]
|
|
@@ -867,4 +871,4 @@ function rt({ config: t, children: n, clearAuthStore: r }) {
|
|
|
867
871
|
})
|
|
868
872
|
});
|
|
869
873
|
}
|
|
870
|
-
export {
|
|
874
|
+
export { it as AppShellProvider, Be as RICH_TOAST_TOKEN_STYLE, qe as resolveAppShellObservabilityConfig, Ge as withShellRybbitEvents };
|
|
@@ -26,6 +26,12 @@ export interface GraphQLBackendErrorLike {
|
|
|
26
26
|
}
|
|
27
27
|
export interface BackendErrorDisplay {
|
|
28
28
|
message: string;
|
|
29
|
+
/**
|
|
30
|
+
* i18n key for `message`, when the message came from fe-libs' own copy (the
|
|
31
|
+
* gateway auth-failure table below). The toast resolves it through the shell
|
|
32
|
+
* dictionary and falls back to `message`, the English (BOFF-10107).
|
|
33
|
+
*/
|
|
34
|
+
messageKey?: string;
|
|
29
35
|
subtitle?: string;
|
|
30
36
|
technicalMessage?: string;
|
|
31
37
|
code?: string;
|
|
@@ -39,6 +45,18 @@ export interface ExtractBackendErrorOptions {
|
|
|
39
45
|
operationName?: string;
|
|
40
46
|
fallbackMessage?: string;
|
|
41
47
|
}
|
|
48
|
+
/** A message fe-libs owns: an i18n key and its English. */
|
|
49
|
+
export interface BackendErrorCopy {
|
|
50
|
+
readonly key: string;
|
|
51
|
+
readonly english: string;
|
|
52
|
+
}
|
|
53
|
+
export declare const AUTH_FAILURE_COPY: Readonly<Record<string, BackendErrorCopy>>;
|
|
54
|
+
/** Every message key the backend-error toast can resolve, for the shell label seed. */
|
|
55
|
+
export declare const BACKEND_ERROR_COPY: readonly BackendErrorCopy[];
|
|
56
|
+
/** True when fe-libs knows what this gateway `authFailure` class means. */
|
|
57
|
+
export declare function isKnownAuthFailure(value: string): boolean;
|
|
58
|
+
/** Test hook: forget which unmapped classes were already reported. */
|
|
59
|
+
export declare function resetUnmappedAuthFailureReportsForTests(): void;
|
|
42
60
|
/** AbortError in either form — a user/navigation cancellation, never surfaced. */
|
|
43
61
|
export declare function isAbortError(input: unknown): boolean;
|
|
44
62
|
/**
|
|
@@ -23,15 +23,58 @@ var e = "burdenoff:backend-error", t = "burdenoff:connection-status", n = "Somet
|
|
|
23
23
|
RBAC_SERVICE_UNAVAILABLE: "We couldn't verify your access just now. Please try again in a moment.",
|
|
24
24
|
DOWNSTREAM_SERVICE_ERROR: "A service is temporarily unavailable. Please try again in a moment."
|
|
25
25
|
}, i = {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
key: "backendErrors.generic",
|
|
27
|
+
english: n
|
|
28
|
+
}, a = Object.freeze({
|
|
29
|
+
UNAUTHENTICATED_ACTOR: {
|
|
30
|
+
key: "backendErrors.sessionExpired",
|
|
31
|
+
english: "Your session has expired. Please sign in again."
|
|
32
|
+
},
|
|
33
|
+
WORKSPACE_SESSION_UNRESOLVED: {
|
|
34
|
+
key: "backendErrors.workspaceSessionExpired",
|
|
35
|
+
english: "Your workspace session has expired. Refresh the page to continue."
|
|
36
|
+
},
|
|
37
|
+
WORKSPACE_CONTEXT_MISSING: {
|
|
38
|
+
key: "backendErrors.chooseWorkspace",
|
|
39
|
+
english: "Please choose a workspace and try again."
|
|
40
|
+
},
|
|
41
|
+
CREDENTIAL_EXPIRED: {
|
|
42
|
+
key: "backendErrors.sessionExpired",
|
|
43
|
+
english: "Your session has expired. Please sign in again."
|
|
44
|
+
},
|
|
45
|
+
CREDENTIAL_REVOKED: {
|
|
46
|
+
key: "backendErrors.signedOut",
|
|
47
|
+
english: "You were signed out. Please sign in again."
|
|
48
|
+
},
|
|
49
|
+
CREDENTIAL_INVALID: {
|
|
50
|
+
key: "backendErrors.sessionInvalid",
|
|
51
|
+
english: "Your session is no longer valid. Please sign in again."
|
|
52
|
+
},
|
|
53
|
+
AUTH_SERVICE_UNAVAILABLE: {
|
|
54
|
+
key: "backendErrors.accessCheckUnavailable",
|
|
55
|
+
english: "We couldn't verify your access just now. Please try again in a moment."
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
Object.freeze([i, ...Object.values(a).filter((e, t, n) => n.findIndex((t) => t.key === e.key) === t)]);
|
|
59
|
+
function o(e) {
|
|
60
|
+
return Object.prototype.hasOwnProperty.call(a, e);
|
|
61
|
+
}
|
|
62
|
+
var s = /* @__PURE__ */ new Set(), c = class extends Error {
|
|
63
|
+
constructor(e) {
|
|
64
|
+
super(`Unmapped gateway authFailure: ${e}`), this.name = "UnmappedAuthFailureError";
|
|
65
|
+
}
|
|
29
66
|
};
|
|
30
|
-
function
|
|
67
|
+
function l(e) {
|
|
68
|
+
if (s.has(e)) return;
|
|
69
|
+
s.add(e), console.warn("[Burdenoff backend error] The gateway sent an authFailure class this app does not know; showing the neutral message. Add it to AUTH_FAILURE_COPY in fe-libs backendErrors.ts.", { authFailure: e });
|
|
70
|
+
let t = new c(e);
|
|
71
|
+
import("../providers/shell/crashReporting.js").then(({ reportError: e }) => e(t)).catch(() => void 0);
|
|
72
|
+
}
|
|
73
|
+
function u(e) {
|
|
31
74
|
let t = e?.authFailure;
|
|
32
|
-
if (typeof t == "string") return
|
|
75
|
+
if (typeof t == "string" && t.trim().length !== 0) return o(t) ? a[t] : (l(t), i);
|
|
33
76
|
}
|
|
34
|
-
var
|
|
77
|
+
var d = [
|
|
35
78
|
/^Syntax Error:/i,
|
|
36
79
|
/^Cannot query field\b/i,
|
|
37
80
|
/^Cannot return null for non-nullable field\b/i,
|
|
@@ -43,124 +86,124 @@ var o = [
|
|
|
43
86
|
/^Fragment "[^"]+" cannot be spread here/i,
|
|
44
87
|
/^There can be only one/i,
|
|
45
88
|
/Did you mean /i
|
|
46
|
-
],
|
|
89
|
+
], f = /* @__PURE__ */ new Set([
|
|
47
90
|
"UNAUTHENTICATED",
|
|
48
91
|
"TOKEN_EXPIRED",
|
|
49
92
|
"RESOURCE_CAP_EXCEEDED",
|
|
50
93
|
"STORAGE_QUOTA_EXCEEDED",
|
|
51
94
|
"QUOTA_EXHAUSTED"
|
|
52
|
-
]),
|
|
95
|
+
]), p = /* @__PURE__ */ new Set([
|
|
53
96
|
"ExportTranslations",
|
|
54
97
|
"exportTranslations",
|
|
55
98
|
"AdminEntityCounts",
|
|
56
99
|
"GetTenants",
|
|
57
100
|
"NodeManifest"
|
|
58
|
-
]),
|
|
101
|
+
]), m = ["exportTranslations"], h = ["No translation keys found for the specified criteria"], g = [
|
|
59
102
|
/failed to fetch/i,
|
|
60
103
|
/networkerror when attempting to fetch/i,
|
|
61
104
|
/network request failed/i,
|
|
62
105
|
/the network connection was lost/i,
|
|
63
106
|
/\bECONNREFUSED\b|\bECONNRESET\b|\bETIMEDOUT\b|\bENOTFOUND\b|\bEAI_AGAIN\b|\bEHOSTUNREACH\b|\bENETUNREACH\b/i,
|
|
64
107
|
/network circuit breaker is open/i
|
|
65
|
-
],
|
|
108
|
+
], _ = [
|
|
66
109
|
"We could not reach the server. Please check your connection and try again.",
|
|
67
110
|
"The server is having trouble right now. Please try again in a moment.",
|
|
68
111
|
"The server took too long to respond. Please try again."
|
|
69
|
-
],
|
|
112
|
+
], v = [
|
|
70
113
|
/\bunauthori[sz]ed\b|\bunauthenticated\b|\btoken[\s_-]?expired\b|\b401\b|\b403\b/i,
|
|
71
114
|
/invalid email or password/i,
|
|
72
115
|
/you do not have permission/i
|
|
73
116
|
];
|
|
74
|
-
function
|
|
117
|
+
function y(e) {
|
|
75
118
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
76
119
|
}
|
|
77
|
-
function
|
|
120
|
+
function b(e) {
|
|
78
121
|
if (!e) return !1;
|
|
79
122
|
let t = e.trim();
|
|
80
|
-
return t.length === 0 ||
|
|
123
|
+
return t.length === 0 || v.some((e) => e.test(t)) ? !1 : _.includes(t) || t.toLowerCase() === "load failed" ? !0 : g.some((e) => e.test(t));
|
|
81
124
|
}
|
|
82
|
-
function
|
|
83
|
-
return !!(e instanceof DOMException && e.name === "AbortError" || e instanceof Error && e.name === "AbortError" ||
|
|
125
|
+
function x(e) {
|
|
126
|
+
return !!(e instanceof DOMException && e.name === "AbortError" || e instanceof Error && e.name === "AbortError" || y(e) && e.name === "AbortError");
|
|
84
127
|
}
|
|
85
|
-
function
|
|
128
|
+
function S(e) {
|
|
86
129
|
if (typeof e == "string") return e;
|
|
87
130
|
if (e instanceof Error) return e.message;
|
|
88
|
-
if (
|
|
89
|
-
let t =
|
|
131
|
+
if (y(e)) {
|
|
132
|
+
let t = A(e, "message");
|
|
90
133
|
if (t) return t;
|
|
91
|
-
let n =
|
|
134
|
+
let n = M(e);
|
|
92
135
|
if (n && n.length > 0 && typeof n[0]?.message == "string") return n[0].message ?? void 0;
|
|
93
136
|
let r = e.networkError;
|
|
94
|
-
if (
|
|
137
|
+
if (y(r)) return A(r, "message");
|
|
95
138
|
}
|
|
96
139
|
}
|
|
97
|
-
function
|
|
98
|
-
if (!
|
|
140
|
+
function C(e) {
|
|
141
|
+
if (!y(e)) return;
|
|
99
142
|
let t = e.statusCode ?? e.status;
|
|
100
143
|
if (typeof t == "number") return t;
|
|
101
144
|
let n = e.networkError;
|
|
102
|
-
if (
|
|
145
|
+
if (y(n)) {
|
|
103
146
|
let e = n.statusCode ?? n.status;
|
|
104
147
|
if (typeof e == "number") return e;
|
|
105
148
|
}
|
|
106
149
|
}
|
|
107
|
-
function
|
|
108
|
-
if (e == null ||
|
|
109
|
-
let t =
|
|
110
|
-
if (
|
|
111
|
-
let n =
|
|
112
|
-
return n === 401 || n === 403 ? !1 : typeof navigator < "u" && navigator.onLine === !1 || e instanceof TypeError &&
|
|
113
|
-
}
|
|
114
|
-
var
|
|
115
|
-
function
|
|
116
|
-
let r = Date.now(), i =
|
|
117
|
-
r -
|
|
150
|
+
function w(e) {
|
|
151
|
+
if (e == null || x(e)) return !1;
|
|
152
|
+
let t = N(e);
|
|
153
|
+
if (j(t?.extensions?.code ?? t?.extensions?.errorCode)) return !1;
|
|
154
|
+
let n = C(e);
|
|
155
|
+
return n === 401 || n === 403 ? !1 : typeof navigator < "u" && navigator.onLine === !1 || e instanceof TypeError && b(e.message) ? !0 : b(S(e));
|
|
156
|
+
}
|
|
157
|
+
var T = 1e4, E = 0, D = !1;
|
|
158
|
+
function O(e, n) {
|
|
159
|
+
let r = Date.now(), i = S(e) ?? "Network request failed", a = typeof navigator > "u" || navigator.onLine;
|
|
160
|
+
r - E > T && (E = r, console.warn("[Burdenoff network] request could not reach the server", {
|
|
118
161
|
message: i,
|
|
119
162
|
operationName: n.operationName,
|
|
120
163
|
online: a
|
|
121
|
-
})), typeof window < "u" && !
|
|
164
|
+
})), typeof window < "u" && !D && (D = !0, window.dispatchEvent(new CustomEvent(t, { detail: {
|
|
122
165
|
online: !1,
|
|
123
166
|
since: r
|
|
124
167
|
} })));
|
|
125
168
|
}
|
|
126
|
-
function
|
|
127
|
-
typeof window < "u" && (
|
|
169
|
+
function k() {
|
|
170
|
+
typeof window < "u" && (D && (D = !1, E = 0), window.dispatchEvent(new CustomEvent(t, { detail: {
|
|
128
171
|
online: !0,
|
|
129
172
|
since: Date.now()
|
|
130
173
|
} })));
|
|
131
174
|
}
|
|
132
|
-
function
|
|
175
|
+
function A(e, t) {
|
|
133
176
|
let n = e[t];
|
|
134
177
|
return typeof n == "string" && n.trim().length > 0 ? n : void 0;
|
|
135
178
|
}
|
|
136
|
-
function
|
|
179
|
+
function j(e) {
|
|
137
180
|
if (typeof e == "string" && e.trim().length !== 0) return e.trim().replace(/[\s-]+/g, "_").toUpperCase();
|
|
138
181
|
}
|
|
139
|
-
function
|
|
140
|
-
if (!
|
|
182
|
+
function M(e) {
|
|
183
|
+
if (!y(e)) return;
|
|
141
184
|
let t = e.errors;
|
|
142
185
|
if (Array.isArray(t)) return t;
|
|
143
186
|
let n = e.graphQLErrors;
|
|
144
187
|
if (Array.isArray(n)) return n;
|
|
145
188
|
let r = e.networkError;
|
|
146
|
-
if (
|
|
189
|
+
if (y(r)) {
|
|
147
190
|
let e = r.result;
|
|
148
|
-
if (
|
|
191
|
+
if (y(e) && Array.isArray(e.errors)) return e.errors;
|
|
149
192
|
}
|
|
150
193
|
}
|
|
151
|
-
function
|
|
152
|
-
let t =
|
|
194
|
+
function N(e) {
|
|
195
|
+
let t = M(e);
|
|
153
196
|
if (t && t.length > 0) return t[0];
|
|
154
|
-
if (
|
|
197
|
+
if (y(e) && ("message" in e || "extensions" in e)) return e;
|
|
155
198
|
}
|
|
156
|
-
function
|
|
199
|
+
function P(e) {
|
|
157
200
|
if (e) return e.userMessage ?? e.humanMessage ?? e.displayMessage;
|
|
158
201
|
}
|
|
159
|
-
function
|
|
160
|
-
return e.length > 220 || e.includes("\n") ||
|
|
202
|
+
function F(e) {
|
|
203
|
+
return e.length > 220 || e.includes("\n") || d.some((t) => t.test(e)) || /\b(prisma|sql|constraint|undefined|null|ECONN[A-Z_]*|ETIMEDOUT|ENOTFOUND)\b/i.test(e) || /failed to fetch|network error|graphql fetch failed/i.test(e) || /socket connection was closed|pass `?verbose: true`?/i.test(e) || /^HTTP error!?\s*(status)?:?\s*\d{3}\b/i.test(e) || /Cannot (read|set|find|access|query)/i.test(e);
|
|
161
204
|
}
|
|
162
|
-
function
|
|
163
|
-
if (
|
|
205
|
+
function I(e) {
|
|
206
|
+
if (d.some((t) => t.test(e))) return "BAD_USER_INPUT";
|
|
164
207
|
let t = e.toLowerCase();
|
|
165
208
|
if (t.includes("unauthenticated") || t.includes("unauthorized")) return "UNAUTHENTICATED";
|
|
166
209
|
if (t.includes("workspace context")) return "WORKSPACE_REQUIRED";
|
|
@@ -169,25 +212,29 @@ function j(e) {
|
|
|
169
212
|
if (t.includes("quota") || t.includes("limit reached")) return "QUOTA_EXCEEDED";
|
|
170
213
|
if (t.includes("required") || t.includes("invalid") || t.includes("missing")) return "BAD_USER_INPUT";
|
|
171
214
|
}
|
|
172
|
-
function
|
|
173
|
-
let
|
|
174
|
-
if (
|
|
175
|
-
let
|
|
176
|
-
if (
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
215
|
+
function L(e, t, i, a) {
|
|
216
|
+
let o = P(e?.extensions ?? void 0);
|
|
217
|
+
if (o) return { message: o };
|
|
218
|
+
let s = u(e?.extensions ?? void 0);
|
|
219
|
+
if (s) return {
|
|
220
|
+
message: s.english,
|
|
221
|
+
messageKey: s.key
|
|
222
|
+
};
|
|
223
|
+
if (t && r[t]) return { message: r[t] };
|
|
224
|
+
if (i) return { message: i };
|
|
225
|
+
let c = e ? void 0 : a;
|
|
226
|
+
return c && !F(c) ? { message: c } : e?.message && !F(e.message) ? { message: e.message } : { message: n };
|
|
181
227
|
}
|
|
182
|
-
function
|
|
228
|
+
function R(e) {
|
|
183
229
|
if (e && e.length !== 0) return e.map((e) => String(e)).join(".");
|
|
184
230
|
}
|
|
185
|
-
function
|
|
231
|
+
function z(e, t = {}) {
|
|
186
232
|
if (e == null) return null;
|
|
187
|
-
let n =
|
|
233
|
+
let n = N(e), r = n?.extensions ?? void 0, i = e instanceof Error ? e.message : y(e) ? A(e, "message") : void 0, a = j(r?.code ?? r?.errorCode) ?? I(i ?? n?.message ?? ""), o = r?.serviceName, s = R(n?.path), c = r?.requestId ?? r?.correlationId ?? r?.traceId, { message: l, messageKey: u } = L(n, a, t.fallbackMessage, i), d = r?.technicalMessage ?? (n?.message && n.message !== l ? n.message : void 0) ?? (i && i !== l ? i : void 0);
|
|
188
234
|
return {
|
|
189
235
|
message: l,
|
|
190
|
-
|
|
236
|
+
...u ? { messageKey: u } : {},
|
|
237
|
+
technicalMessage: d,
|
|
191
238
|
code: a,
|
|
192
239
|
operationName: t.operationName,
|
|
193
240
|
serviceName: o,
|
|
@@ -196,30 +243,30 @@ function P(e, t = {}) {
|
|
|
196
243
|
extensions: r
|
|
197
244
|
};
|
|
198
245
|
}
|
|
199
|
-
function
|
|
200
|
-
return
|
|
246
|
+
function B(e) {
|
|
247
|
+
return y(e) && typeof e.message == "string";
|
|
201
248
|
}
|
|
202
|
-
var
|
|
203
|
-
function
|
|
249
|
+
var V = /* @__PURE__ */ new Set(["RBAC_SERVICE_UNAVAILABLE", "AUTH_SERVICE_UNAVAILABLE"]), H = 4e3, U = 3e4;
|
|
250
|
+
function W(e) {
|
|
204
251
|
let t = e.code ?? "";
|
|
205
|
-
return
|
|
252
|
+
return V.has(t) ? {
|
|
206
253
|
key: t,
|
|
207
|
-
windowMs:
|
|
254
|
+
windowMs: U
|
|
208
255
|
} : {
|
|
209
256
|
key: `${t}|${e.message}`,
|
|
210
|
-
windowMs:
|
|
257
|
+
windowMs: H
|
|
211
258
|
};
|
|
212
259
|
}
|
|
213
|
-
function
|
|
214
|
-
return !e || e.code &&
|
|
260
|
+
function G(e) {
|
|
261
|
+
return !e || e.code && f.has(e.code) || e.operationName && p.has(e.operationName) || e.path && m.some((t) => e.path === t || e.path?.startsWith(`${t}.`)) || e.technicalMessage && h.some((t) => e.technicalMessage.includes(t)) || !e.code && b(e.technicalMessage ?? e.message) ? !1 : e.message.trim().length > 0;
|
|
215
262
|
}
|
|
216
|
-
function
|
|
217
|
-
if (typeof window > "u" ||
|
|
218
|
-
if (
|
|
219
|
-
|
|
263
|
+
function K(t, n = {}) {
|
|
264
|
+
if (typeof window > "u" || x(t)) return;
|
|
265
|
+
if (w(t)) {
|
|
266
|
+
O(t, n);
|
|
220
267
|
return;
|
|
221
268
|
}
|
|
222
|
-
let r =
|
|
223
|
-
|
|
269
|
+
let r = B(t) ? t : z(t, n);
|
|
270
|
+
G(r) && window.dispatchEvent(new CustomEvent(e, { detail: r }));
|
|
224
271
|
}
|
|
225
|
-
export { e as BACKEND_ERROR_EVENT, t as CONNECTION_STATUS_EVENT,
|
|
272
|
+
export { a as AUTH_FAILURE_COPY, e as BACKEND_ERROR_EVENT, t as CONNECTION_STATUS_EVENT, K as dispatchBackendErrorEvent, z as extractBackendError, W as getBackendErrorToastDedupe, x as isAbortError, B as isBackendErrorDisplay, o as isKnownAuthFailure, w as isTransportError, k as markConnectionHealthy, G as shouldToastBackendError };
|