@burdenoff/fe-libs 2026.601.1 → 2026.601.3
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/chrome/ProductSideNav.d.ts.map +1 -1
- package/dist/chrome/ProductSideNav.js +2 -1
- package/dist/chrome/SideNavigation.d.ts +7 -0
- package/dist/chrome/SideNavigation.d.ts.map +1 -1
- package/dist/chrome/SideNavigation.js +16 -14
- package/dist/chrome/sideNavigation/NavItemRenderer.d.ts +8 -0
- package/dist/chrome/sideNavigation/NavItemRenderer.d.ts.map +1 -1
- package/dist/chrome/sideNavigation/NavItemRenderer.js +61 -59
- package/dist/shared/components/PWAInstallBanner.d.ts.map +1 -1
- package/dist/shared/components/PWAInstallBanner.js +17 -8
- package/dist/shared/config/gatewayUrls.d.ts.map +1 -1
- package/dist/shared/config/gatewayUrls.js +1 -1
- package/dist/shared/graphql/client.d.ts +6 -0
- package/dist/shared/graphql/client.d.ts.map +1 -1
- package/dist/shared/graphql/client.js +152 -103
- package/dist/shared/providers/AppShellProvider.d.ts.map +1 -1
- package/dist/shared/providers/AppShellProvider.js +21 -13
- package/dist/shared/providers/shell/MultiGatewayProvider.d.ts.map +1 -1
- package/dist/shared/providers/shell/MultiGatewayProvider.js +64 -45
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductSideNav.d.ts","sourceRoot":"","sources":["../../src/chrome/ProductSideNav.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAW,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAQpD,MAAM,WAAW,mBAAmB;IAClC,mFAAmF;IACnF,IAAI,EAAE,SAAS,CAAC;IAChB,sDAAsD;IACtD,OAAO,EAAE,MAAM,CAAC;IAChB,yBAAyB;IACzB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,+BAA+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AC3B,EAAE,mBAAmB,2CAwErB"}
|
|
@@ -30,6 +30,13 @@ export interface SideNavigationProps {
|
|
|
30
30
|
groupLabels?: Record<string, string>;
|
|
31
31
|
/** Maximum visual depth for nested items (default: 4) */
|
|
32
32
|
maxDepth?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Active context (org/workspace/project/tenant) as URLSearchParams, merged
|
|
35
|
+
* into each nav anchor's href so links carry context (prevents the
|
|
36
|
+
* post-navigation context re-sync that reads as a full page reload, and
|
|
37
|
+
* makes Ctrl/Cmd/middle-click open the right context).
|
|
38
|
+
*/
|
|
39
|
+
contextSearchParams?: URLSearchParams;
|
|
33
40
|
}
|
|
34
41
|
/**
|
|
35
42
|
* SideNavigation Component
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideNavigation.d.ts","sourceRoot":"","sources":["../../src/chrome/SideNavigation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"SideNavigation.d.ts","sourceRoot":"","sources":["../../src/chrome/SideNavigation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAOpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAOtD,YAAY,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,kCAAkC;IAClC,KAAK,EAAE,OAAO,EAAE,CAAC;IAEjB,0BAA0B;IAC1B,WAAW,EAAE,MAAM,CAAC;IAEpB,mCAAmC;IACnC,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,yBAAyB;IACzB,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAEpC,8BAA8B;IAC9B,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAE9B,4BAA4B;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB,6CAA6C;IAC7C,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB,sEAAsE;IACtE,aAAa,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAEnC,+CAA+C;IAC/C,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAEtB,gDAAgD;IAChD,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAErC,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,eAAe,CAAC;CACvC;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAiOlD,CAAC"}
|
|
@@ -6,20 +6,20 @@ import { CollapseToggle as s } from "./sideNavigation/CollapseToggle.js";
|
|
|
6
6
|
import { useSideNavigationState as c } from "./sideNavigation/useSideNavigationState.js";
|
|
7
7
|
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
8
8
|
//#region src/chrome/SideNavigation.tsx
|
|
9
|
-
var f = ({ items: f, currentPath: p, collapsed: m = !1, onItemClick: h, onToggleCollapse: g, collapseLabel: _ = "Collapse", header: v, footer: y, mobileActions: b, groupOrder: x, groupLabels: S, maxDepth: C = 4 }) => {
|
|
10
|
-
let { expandedItems:
|
|
9
|
+
var f = ({ items: f, currentPath: p, collapsed: m = !1, onItemClick: h, onToggleCollapse: g, collapseLabel: _ = "Collapse", header: v, footer: y, mobileActions: b, groupOrder: x, groupLabels: S, maxDepth: C = 4, contextSearchParams: w }) => {
|
|
10
|
+
let { expandedItems: T, toggleExpand: E, collapseAll: D } = c({
|
|
11
11
|
items: f,
|
|
12
12
|
currentPath: p,
|
|
13
13
|
collapsed: m,
|
|
14
14
|
onToggleCollapse: g
|
|
15
|
-
}),
|
|
15
|
+
}), O = f.filter((e) => e.visible !== !1), k = (() => {
|
|
16
16
|
if (m) return [{
|
|
17
17
|
id: "__all__",
|
|
18
18
|
label: null,
|
|
19
|
-
items:
|
|
19
|
+
items: O
|
|
20
20
|
}];
|
|
21
21
|
let e = /* @__PURE__ */ new Map();
|
|
22
|
-
for (let t of
|
|
22
|
+
for (let t of O) {
|
|
23
23
|
let n = t.group ?? "__default__", r = e.get(n);
|
|
24
24
|
r ? r.push(t) : e.set(n, [t]);
|
|
25
25
|
}
|
|
@@ -80,8 +80,8 @@ var f = ({ items: f, currentPath: p, collapsed: m = !1, onItemClick: h, onToggle
|
|
|
80
80
|
v && /* @__PURE__ */ u(a, {
|
|
81
81
|
header: v,
|
|
82
82
|
collapsed: m,
|
|
83
|
-
expandedCount:
|
|
84
|
-
onCollapseAll:
|
|
83
|
+
expandedCount: T.size,
|
|
84
|
+
onCollapseAll: D
|
|
85
85
|
}),
|
|
86
86
|
/* @__PURE__ */ u("nav", {
|
|
87
87
|
className: "flex-1 min-h-0 py-card-padding overflow-y-auto overflow-x-hidden",
|
|
@@ -89,7 +89,7 @@ var f = ({ items: f, currentPath: p, collapsed: m = !1, onItemClick: h, onToggle
|
|
|
89
89
|
delayDuration: 300,
|
|
90
90
|
children: /* @__PURE__ */ u("ul", {
|
|
91
91
|
className: "space-y-list-gap",
|
|
92
|
-
children:
|
|
92
|
+
children: k.map((n, a) => /* @__PURE__ */ d("li", {
|
|
93
93
|
className: "list-none",
|
|
94
94
|
children: [
|
|
95
95
|
a > 0 && !m && /* @__PURE__ */ u("div", { className: "my-2 border-t border-border-subtle" }),
|
|
@@ -106,11 +106,12 @@ var f = ({ items: f, currentPath: p, collapsed: m = !1, onItemClick: h, onToggle
|
|
|
106
106
|
depth: 0,
|
|
107
107
|
maxDepth: C,
|
|
108
108
|
currentPath: p,
|
|
109
|
-
expandedItems:
|
|
110
|
-
toggleExpand:
|
|
109
|
+
expandedItems: T,
|
|
110
|
+
toggleExpand: E,
|
|
111
111
|
onItemClick: h,
|
|
112
112
|
onToggleCollapse: g,
|
|
113
|
-
collapsed: m
|
|
113
|
+
collapsed: m,
|
|
114
|
+
contextSearchParams: w
|
|
114
115
|
})
|
|
115
116
|
}), /* @__PURE__ */ d(t, {
|
|
116
117
|
side: "right",
|
|
@@ -123,11 +124,12 @@ var f = ({ items: f, currentPath: p, collapsed: m = !1, onItemClick: h, onToggle
|
|
|
123
124
|
depth: 0,
|
|
124
125
|
maxDepth: C,
|
|
125
126
|
currentPath: p,
|
|
126
|
-
expandedItems:
|
|
127
|
-
toggleExpand:
|
|
127
|
+
expandedItems: T,
|
|
128
|
+
toggleExpand: E,
|
|
128
129
|
onItemClick: h,
|
|
129
130
|
onToggleCollapse: g,
|
|
130
|
-
collapsed: m
|
|
131
|
+
collapsed: m,
|
|
132
|
+
contextSearchParams: w
|
|
131
133
|
}, n.id))
|
|
132
134
|
})
|
|
133
135
|
]
|
|
@@ -10,6 +10,14 @@ interface NavItemRendererProps {
|
|
|
10
10
|
onItemClick: (path: string) => void;
|
|
11
11
|
onToggleCollapse?: () => void;
|
|
12
12
|
collapsed: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Active context (org/workspace/project/tenant) as URLSearchParams. When
|
|
15
|
+
* provided, it's merged into the anchor `href` so the link already carries
|
|
16
|
+
* context — Ctrl/Cmd/middle-click open the destination with the right
|
|
17
|
+
* context instead of a bare path, and the destination never has to re-sync
|
|
18
|
+
* context after mount (the second navigation that "feels like a reload").
|
|
19
|
+
*/
|
|
20
|
+
contextSearchParams?: URLSearchParams;
|
|
13
21
|
}
|
|
14
22
|
export declare const NavItemRenderer: FC<NavItemRendererProps>;
|
|
15
23
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavItemRenderer.d.ts","sourceRoot":"","sources":["../../../src/chrome/sideNavigation/NavItemRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAiC,MAAM,OAAO,CAAC;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"NavItemRenderer.d.ts","sourceRoot":"","sources":["../../../src/chrome/sideNavigation/NavItemRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAiC,MAAM,OAAO,CAAC;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAIvC,UAAU,oBAAoB;IAC5B,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3B,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,SAAS,EAAE,OAAO,CAAC;IACnB;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,eAAe,CAAC;CACvC;AAWD,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAmOpD,CAAC"}
|
|
@@ -1,61 +1,62 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { appendContextToPath as e } from "../../shared/hooks/useCurrentContextSearchParams.js";
|
|
2
|
+
import { isItemDirectlyActive as t, isItemOrChildActive as n } from "./helpers.js";
|
|
3
|
+
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
3
4
|
//#region src/chrome/sideNavigation/NavItemRenderer.tsx
|
|
4
|
-
function
|
|
5
|
+
function o(e) {
|
|
5
6
|
return e.metaKey || e.ctrlKey || e.shiftKey || e.button !== 0;
|
|
6
7
|
}
|
|
7
|
-
var
|
|
8
|
-
let
|
|
9
|
-
w-full flex items-center gap-icon-gap ${
|
|
8
|
+
var s = ({ item: c, depth: l, maxDepth: u, currentPath: d, expandedItems: f, toggleExpand: p, onItemClick: m, onToggleCollapse: h, collapsed: g, contextSearchParams: _ }) => {
|
|
9
|
+
let v = c.children && c.children.length > 0 && l < u, y = f.has(c.id), b = n(c, d), x = t(c, d), S = l === 0 ? "w-icon-md h-icon-md" : "w-4 h-4", C = l === 0 ? "py-2" : "py-1.5", w = v ? g && l === 0 ? c.homePath || c.children?.[0]?.path || c.path : c.homePath || c.path : c.path, T = w && _ ? e(w, _) : w, E = `
|
|
10
|
+
w-full flex items-center gap-icon-gap ${C} rounded-button
|
|
10
11
|
transition-colors duration-200 ease-out
|
|
11
12
|
active:scale-[0.98]
|
|
12
|
-
${
|
|
13
|
-
${
|
|
14
|
-
`,
|
|
13
|
+
${g && l === 0 ? "md:px-2 md:justify-center" : "px-card-padding"}
|
|
14
|
+
${x && !v || x && v ? "bg-action-primary-bg text-action-primary-text shadow-sm" : b && !y && !v ? "bg-action-ghost-bg-hover text-text-primary" : b && v ? "text-text-primary" : "text-text-secondary hover:bg-action-ghost-bg-hover hover:text-text-primary"}
|
|
15
|
+
`, D = (e) => {
|
|
15
16
|
let t = e.closest("nav"), n = t?.scrollTop;
|
|
16
17
|
return () => {
|
|
17
18
|
t && n !== void 0 && (t.scrollTop = n);
|
|
18
19
|
};
|
|
19
|
-
},
|
|
20
|
-
if (
|
|
21
|
-
let t =
|
|
22
|
-
if (e.preventDefault(),
|
|
23
|
-
|
|
20
|
+
}, O = (e) => {
|
|
21
|
+
if (o(e)) return;
|
|
22
|
+
let t = D(e.currentTarget);
|
|
23
|
+
if (e.preventDefault(), g && l === 0 && v) {
|
|
24
|
+
m(c.homePath || c.children?.[0]?.path || c.path), requestAnimationFrame(t);
|
|
24
25
|
return;
|
|
25
26
|
}
|
|
26
|
-
|
|
27
|
-
},
|
|
27
|
+
v ? (p(c.id), requestAnimationFrame(t)) : (m(c.path), window.innerWidth < 768 && h && !g && h(), requestAnimationFrame(t));
|
|
28
|
+
}, k = (e) => {
|
|
28
29
|
e.button === 0 && !e.ctrlKey && !e.metaKey && !e.shiftKey && e.preventDefault();
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
className: `${
|
|
32
|
-
children: typeof
|
|
30
|
+
}, A = /* @__PURE__ */ a(r, { children: [
|
|
31
|
+
c.icon && /* @__PURE__ */ i("div", {
|
|
32
|
+
className: `${S} flex-shrink-0 flex items-center justify-center [&>svg]:w-full [&>svg]:h-full [&>svg]:stroke-[1.75]`,
|
|
33
|
+
children: typeof c.icon == "string" ? /* @__PURE__ */ i("svg", {
|
|
33
34
|
className: "w-full h-full",
|
|
34
35
|
fill: "none",
|
|
35
36
|
stroke: "currentColor",
|
|
36
37
|
viewBox: "0 0 24 24",
|
|
37
|
-
children: /* @__PURE__ */
|
|
38
|
+
children: /* @__PURE__ */ i("path", {
|
|
38
39
|
strokeLinecap: "round",
|
|
39
40
|
strokeLinejoin: "round",
|
|
40
41
|
strokeWidth: 2,
|
|
41
|
-
d:
|
|
42
|
+
d: c.icon
|
|
42
43
|
})
|
|
43
|
-
}) :
|
|
44
|
+
}) : c.icon
|
|
44
45
|
}),
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
className: `text-body-sm font-medium flex-1 text-left ${
|
|
47
|
-
children:
|
|
46
|
+
/* @__PURE__ */ i("span", {
|
|
47
|
+
className: `text-body-sm font-medium flex-1 text-left ${g && l === 0 ? "md:hidden" : ""}`,
|
|
48
|
+
children: c.label
|
|
48
49
|
}),
|
|
49
|
-
|
|
50
|
-
className: `text-xs bg-status-error-bg text-status-error-text px-2 py-0.5 rounded-pill ${
|
|
51
|
-
children:
|
|
50
|
+
c.badge !== void 0 && c.badge > 0 && /* @__PURE__ */ i("span", {
|
|
51
|
+
className: `text-xs bg-status-error-bg text-status-error-text px-2 py-0.5 rounded-pill ${g && l === 0 ? "md:hidden" : ""}`,
|
|
52
|
+
children: c.badge
|
|
52
53
|
}),
|
|
53
|
-
|
|
54
|
-
className: `w-4 h-4 transition-transform ${
|
|
54
|
+
v && !(g && l === 0) && /* @__PURE__ */ i("svg", {
|
|
55
|
+
className: `w-4 h-4 transition-transform ${y ? "rotate-90" : ""}`,
|
|
55
56
|
fill: "none",
|
|
56
57
|
stroke: "currentColor",
|
|
57
58
|
viewBox: "0 0 24 24",
|
|
58
|
-
children: /* @__PURE__ */
|
|
59
|
+
children: /* @__PURE__ */ i("path", {
|
|
59
60
|
strokeLinecap: "round",
|
|
60
61
|
strokeLinejoin: "round",
|
|
61
62
|
strokeWidth: 2,
|
|
@@ -63,39 +64,40 @@ var o = ({ item: s, depth: c, maxDepth: l, currentPath: u, expandedItems: d, tog
|
|
|
63
64
|
})
|
|
64
65
|
})
|
|
65
66
|
] });
|
|
66
|
-
return /* @__PURE__ */
|
|
67
|
+
return /* @__PURE__ */ a("li", { children: [/* @__PURE__ */ i("div", {
|
|
67
68
|
className: "relative",
|
|
68
|
-
children:
|
|
69
|
-
href:
|
|
70
|
-
onClick:
|
|
71
|
-
onMouseDown:
|
|
72
|
-
className:
|
|
73
|
-
"aria-label":
|
|
74
|
-
"aria-expanded":
|
|
75
|
-
children:
|
|
76
|
-
}) : /* @__PURE__ */
|
|
69
|
+
children: w ? /* @__PURE__ */ i("a", {
|
|
70
|
+
href: T,
|
|
71
|
+
onClick: O,
|
|
72
|
+
onMouseDown: k,
|
|
73
|
+
className: E,
|
|
74
|
+
"aria-label": c.label,
|
|
75
|
+
"aria-expanded": v ? y : void 0,
|
|
76
|
+
children: A
|
|
77
|
+
}) : /* @__PURE__ */ i("button", {
|
|
77
78
|
type: "button",
|
|
78
|
-
onClick:
|
|
79
|
-
onMouseDown:
|
|
80
|
-
className:
|
|
81
|
-
"aria-label":
|
|
82
|
-
"aria-expanded":
|
|
83
|
-
children:
|
|
79
|
+
onClick: O,
|
|
80
|
+
onMouseDown: k,
|
|
81
|
+
className: E,
|
|
82
|
+
"aria-label": c.label,
|
|
83
|
+
"aria-expanded": v ? y : void 0,
|
|
84
|
+
children: A
|
|
84
85
|
})
|
|
85
|
-
}),
|
|
86
|
+
}), v && y && !g && /* @__PURE__ */ i("ul", {
|
|
86
87
|
className: "mt-1 ml-6 space-y-1 border-l border-border-subtle pl-3 animate-in fade-in-0 slide-in-from-top-2 duration-200",
|
|
87
|
-
children:
|
|
88
|
+
children: c.children.map((e) => /* @__PURE__ */ i(s, {
|
|
88
89
|
item: e,
|
|
89
|
-
depth:
|
|
90
|
-
maxDepth:
|
|
91
|
-
currentPath:
|
|
92
|
-
expandedItems:
|
|
93
|
-
toggleExpand:
|
|
94
|
-
onItemClick:
|
|
95
|
-
onToggleCollapse:
|
|
96
|
-
collapsed:
|
|
90
|
+
depth: l + 1,
|
|
91
|
+
maxDepth: u,
|
|
92
|
+
currentPath: d,
|
|
93
|
+
expandedItems: f,
|
|
94
|
+
toggleExpand: p,
|
|
95
|
+
onItemClick: m,
|
|
96
|
+
onToggleCollapse: h,
|
|
97
|
+
collapsed: g,
|
|
98
|
+
contextSearchParams: _
|
|
97
99
|
}, e.id))
|
|
98
100
|
})] });
|
|
99
101
|
};
|
|
100
102
|
//#endregion
|
|
101
|
-
export {
|
|
103
|
+
export { s as NavItemRenderer };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PWAInstallBanner.d.ts","sourceRoot":"","sources":["../../../src/shared/components/PWAInstallBanner.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,qBAAqB;IACpC,6DAA6D;IAC7D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uDAAuD;IACvD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,WAAmB,EACnB,YAAkB,GACnB,EAAE,qBAAqB,
|
|
1
|
+
{"version":3,"file":"PWAInstallBanner.d.ts","sourceRoot":"","sources":["../../../src/shared/components/PWAInstallBanner.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,qBAAqB;IACpC,6DAA6D;IAC7D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uDAAuD;IACvD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,WAAmB,EACnB,YAAkB,GACnB,EAAE,qBAAqB,kDA+JvB"}
|
|
@@ -10,16 +10,25 @@ function c({ productName: c = "App", brandInitial: l = "B" }) {
|
|
|
10
10
|
let e = setTimeout(() => _(!1), 0);
|
|
11
11
|
return () => clearTimeout(e);
|
|
12
12
|
}
|
|
13
|
-
let e = localStorage.getItem("pwa-install-dismissed");
|
|
14
|
-
if (e)
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
let e = 336 * 60 * 60 * 1e3, t = Date.now(), n = localStorage.getItem("pwa-install-dismissed");
|
|
14
|
+
if (n && t - parseInt(n, 10) < e) return;
|
|
15
|
+
let r = localStorage.getItem("pwa-install-last-shown");
|
|
16
|
+
if (r && t - parseInt(r, 10) < e) return;
|
|
17
|
+
let i = setTimeout(() => {
|
|
18
|
+
_(!0);
|
|
19
|
+
try {
|
|
20
|
+
localStorage.setItem("pwa-install-last-shown", String(Date.now()));
|
|
21
|
+
} catch {}
|
|
22
|
+
}, 3e3);
|
|
23
|
+
return () => clearTimeout(i);
|
|
20
24
|
}, [u, d]);
|
|
21
25
|
let v = async () => {
|
|
22
|
-
await p()
|
|
26
|
+
if (await p()) {
|
|
27
|
+
_(!1);
|
|
28
|
+
try {
|
|
29
|
+
localStorage.setItem("pwa-install-dismissed", String(Date.now()));
|
|
30
|
+
} catch {}
|
|
31
|
+
}
|
|
23
32
|
}, y = () => {
|
|
24
33
|
h(), _(!1);
|
|
25
34
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gatewayUrls.d.ts","sourceRoot":"","sources":["../../../src/shared/config/gatewayUrls.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,kBAAkB;IACjC,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAoBD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,UAkC/B,CAAC;AAEF,eAAO,MAAM,UAAU,aAGrB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"gatewayUrls.d.ts","sourceRoot":"","sources":["../../../src/shared/config/gatewayUrls.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,kBAAkB;IACjC,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAoBD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,UAkC/B,CAAC;AAEF,eAAO,MAAM,UAAU,aAGrB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,WAAW,aAOtB,CAAC;AAEH,wBAAgB,kBAAkB,IAAI,MAAM,CAG3C;AA8BD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,kBAAkB,IAAI,kBAAkB,CA6BvD"}
|
|
@@ -11,7 +11,7 @@ var e = {
|
|
|
11
11
|
workspaceBaseUrl: "https://gw-wspace.local.burdenoff.com",
|
|
12
12
|
globalBaseUrl: "https://gw-global.local.burdenoff.com",
|
|
13
13
|
publicStoreBaseUrl: "https://gw-global.local.burdenoff.com"
|
|
14
|
-
}, r = /* @__PURE__ */ "burdenoff.com,vibecontrols.com,fluidgrids.com,botlit.ai,bigconsole.com,gethealthybowl.com,headshotmarketing.com,timecampus.com,ggnomad.com,movethewheels.com,crewfoundry.com,planmagnet.com,eventfullymanaged.com,kadaikodi.com,assethandler.com,technospam.com,semanticfed.com,manufacturedops.com,theglobalfuel.com,housingvista.com,proserviceworld.com,mybodyshield.com,artistrybase.com,collabkin.com,brainyrich.com,theculturepost.com,comradecircle.com,cosmicintersection.com,govcitizenhub.com,intelwatchtower.com,ecoimpacthub.com,buildmyiq.com,fluidgrids.ai".split(","), i = new Set([...r.map((e) => `app.${e}`), "admin.burdenoff.com"]), a = new Set(r.map((e) => `alphaapp.${e}`));
|
|
14
|
+
}, r = /* @__PURE__ */ "burdenoff.com,vibecontrols.com,fluidgrids.com,botlit.ai,bigconsole.com,gethealthybowl.com,headshotmarketing.com,timecampus.com,ggnomad.com,movethewheels.com,crewfoundry.com,planmagnet.com,eventfullymanaged.com,kadaikodi.com,assethandler.com,technospam.com,semanticfed.com,manufacturedops.com,theglobalfuel.com,housingvista.com,proserviceworld.com,mybodyshield.com,artistrybase.com,collabkin.com,brainyrich.com,theculturepost.com,comradecircle.com,cosmicintersection.com,govcitizenhub.com,intelwatchtower.com,ecoimpacthub.com,buildmyiq.com,fluidgrids.ai".split(","), i = new Set([...r.map((e) => `app.${e}`), "admin.burdenoff.com"]), a = new Set([...r.map((e) => `alphaapp.${e}`), "alphaadmin.burdenoff.com"]);
|
|
15
15
|
function o() {
|
|
16
16
|
return typeof window > "u" ? "" : window.location.hostname.toLowerCase();
|
|
17
17
|
}
|
|
@@ -53,6 +53,8 @@ export interface CreateClientOptions {
|
|
|
53
53
|
onNetworkError?: (error: Error) => void;
|
|
54
54
|
/** Callback when network status changes (circuit breaker open/closed) */
|
|
55
55
|
onNetworkStatusChange?: (isOffline: boolean) => void;
|
|
56
|
+
/** Callback after a successful mutation response. Used by shells to refresh active UI data. */
|
|
57
|
+
onMutationSuccess?: (event: MutationSuccessEvent) => void | Promise<void>;
|
|
56
58
|
/** Maximum retry attempts for failed requests (default: 3) */
|
|
57
59
|
maxRetryAttempts?: number;
|
|
58
60
|
/**
|
|
@@ -68,6 +70,10 @@ export interface CreateClientOptions {
|
|
|
68
70
|
/** Enable debug logging */
|
|
69
71
|
debug?: boolean;
|
|
70
72
|
}
|
|
73
|
+
export interface MutationSuccessEvent {
|
|
74
|
+
gateway: Gateway;
|
|
75
|
+
operationName: string;
|
|
76
|
+
}
|
|
71
77
|
/**
|
|
72
78
|
* Creates an Apollo Client configured for a Burdenoff gateway
|
|
73
79
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/shared/graphql/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAGZ,aAAa,EAId,MAAM,qBAAqB,CAAC;AAO7B,OAAO,EAAiB,KAAK,OAAO,EAAY,MAAM,WAAW,CAAC;AAmDlE;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C;AAiBD,YAAY,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,WAAW,mBAAmB;IAClC,4CAA4C;IAC5C,OAAO,EAAE,OAAO,CAAC;IACjB,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC;IAC3C,8FAA8F;IAC9F,cAAc,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC;IAChD,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC;IACxC,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,GAAG,IAAI,CAAC;IACT,8EAA8E;IAC9E,cAAc,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC;IAChD,0FAA0F;IAC1F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AAgB,oBAAoB,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CA0BlE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,YAAY,CAKjD;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,YAAY,CAK9C;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAStC"}
|
|
@@ -7,8 +7,8 @@ import { SSELink as o } from "./links/sse-link.js";
|
|
|
7
7
|
import { onError as s } from "@apollo/client/link/error";
|
|
8
8
|
import { RetryLink as c } from "@apollo/client/link/retry";
|
|
9
9
|
import { setContext as l } from "@apollo/client/link/context";
|
|
10
|
-
import { ApolloClient as u, ApolloLink as d, InMemoryCache as
|
|
11
|
-
import { getMainDefinition as
|
|
10
|
+
import { ApolloClient as u, ApolloLink as d, InMemoryCache as ee, Observable as f, from as p, split as te } from "@apollo/client/core";
|
|
11
|
+
import { getMainDefinition as m } from "@apollo/client/utilities";
|
|
12
12
|
import { print as h } from "graphql";
|
|
13
13
|
//#region src/shared/graphql/client.ts
|
|
14
14
|
var g = {
|
|
@@ -16,40 +16,48 @@ var g = {
|
|
|
16
16
|
lastFailureTime: 0,
|
|
17
17
|
isOpen: !1
|
|
18
18
|
}, _ = 5, v = 3e4;
|
|
19
|
-
function
|
|
19
|
+
function ne() {
|
|
20
20
|
return g.consecutiveFailures++, g.lastFailureTime = Date.now(), g.consecutiveFailures >= _ && (g.isOpen = !0), g.isOpen;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function y() {
|
|
23
23
|
g.consecutiveFailures = 0, g.isOpen = !1;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function re() {
|
|
26
26
|
return g.isOpen ? Date.now() - g.lastFailureTime > v ? (g.isOpen = !1, g.consecutiveFailures = 0, !1) : !0 : !1;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function ie(e) {
|
|
29
29
|
if (!e || typeof e != "object") return null;
|
|
30
30
|
let t = e.workspaceId;
|
|
31
31
|
return typeof t == "string" && t.trim() ? t : null;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function ae(e) {
|
|
34
34
|
if (!e || typeof e != "object") return null;
|
|
35
35
|
let t = e.projectId;
|
|
36
36
|
return typeof t == "string" && t.trim() ? t : null;
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function oe(e) {
|
|
39
|
+
let t = m(e);
|
|
40
|
+
return t.kind === "OperationDefinition" && t.operation === "mutation";
|
|
41
|
+
}
|
|
42
|
+
function se(e) {
|
|
43
|
+
let t = e.errors;
|
|
44
|
+
return Array.isArray(t) && t.length > 0;
|
|
45
|
+
}
|
|
46
|
+
function b(e) {
|
|
39
47
|
let t = e.headers;
|
|
40
48
|
if (!t || typeof t != "object" || Array.isArray(t)) return {};
|
|
41
49
|
let n = {};
|
|
42
50
|
for (let [e, r] of Object.entries(t)) typeof r == "string" && (n[e] = r);
|
|
43
51
|
return n;
|
|
44
52
|
}
|
|
45
|
-
function
|
|
53
|
+
function x(e) {
|
|
46
54
|
let t = e.fetchOptions;
|
|
47
55
|
if (!t || typeof t != "object" || !("signal" in t)) return;
|
|
48
56
|
let n = t.signal;
|
|
49
57
|
return n instanceof AbortSignal ? n : void 0;
|
|
50
58
|
}
|
|
51
|
-
function
|
|
52
|
-
return new d((r) => new
|
|
59
|
+
function ce({ uri: e, batchMax: t, batchInterval: n }) {
|
|
60
|
+
return new d((r) => new f((i) => {
|
|
53
61
|
let o = r.getContext(), s = { query: h(r.query) };
|
|
54
62
|
r.operationName && (s.operationName = r.operationName);
|
|
55
63
|
let c = r.variables ?? {}, l = r.extensions ?? {};
|
|
@@ -57,8 +65,8 @@ function ie({ uri: e, batchMax: t, batchInterval: n }) {
|
|
|
57
65
|
let u = !1;
|
|
58
66
|
return a(e, {
|
|
59
67
|
"content-type": "application/json",
|
|
60
|
-
...
|
|
61
|
-
}, s,
|
|
68
|
+
...b(o)
|
|
69
|
+
}, s, x(o), {
|
|
62
70
|
batchMax: t,
|
|
63
71
|
batchInterval: n
|
|
64
72
|
}).then((e) => {
|
|
@@ -70,98 +78,108 @@ function ie({ uri: e, batchMax: t, batchInterval: n }) {
|
|
|
70
78
|
};
|
|
71
79
|
}));
|
|
72
80
|
}
|
|
73
|
-
function
|
|
74
|
-
let { gateway: h, baseUrl: _, authToken: v, workspaceToken:
|
|
81
|
+
function S(a) {
|
|
82
|
+
let { gateway: h, baseUrl: _, authToken: v, workspaceToken: b, locale: x, geography: S, organizationId: C, productId: w, workspaceId: T, projectId: E, tenantId: D, cache: O, enableSubscriptions: le = !1, sseUrl: ue, onAuthError: k, onRefreshToken: A, onNetworkError: j, onNetworkStatusChange: M, onMutationSuccess: N, maxRetryAttempts: de = 3, batchMax: fe = 10, batchInterval: pe, debug: P = !1 } = a, F = null, I = null, me = (e) => {
|
|
83
|
+
I ||= setTimeout(() => {
|
|
84
|
+
I = null, F && F.refetchQueries({ include: "active" }).catch((t) => {
|
|
85
|
+
P && console.warn("[GraphQL] Active query refresh failed after mutation:", {
|
|
86
|
+
gateway: h,
|
|
87
|
+
operationName: e,
|
|
88
|
+
error: t
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
}, 0);
|
|
92
|
+
}, L = e[h], R = ce({
|
|
75
93
|
uri: n(t(_, h)),
|
|
76
|
-
batchMax:
|
|
77
|
-
batchInterval:
|
|
78
|
-
}),
|
|
94
|
+
batchMax: fe,
|
|
95
|
+
batchInterval: pe
|
|
96
|
+
}), z = l((e, t) => {
|
|
79
97
|
let n = t.headers ?? {}, r = typeof v == "function" ? v() : v;
|
|
80
98
|
return { headers: {
|
|
81
99
|
...n,
|
|
82
100
|
...r ? { authorization: `Bearer ${r}` } : {}
|
|
83
101
|
} };
|
|
84
|
-
}),
|
|
85
|
-
let n = t.headers ?? {}, r = typeof
|
|
102
|
+
}), B = l((e, t) => {
|
|
103
|
+
let n = t.headers ?? {}, r = typeof x == "function" ? x() : x;
|
|
86
104
|
return { headers: {
|
|
87
105
|
...n,
|
|
88
106
|
...r ? { "accept-language": r } : {}
|
|
89
107
|
} };
|
|
90
|
-
}),
|
|
91
|
-
let n = t.headers ?? {}, r = typeof
|
|
108
|
+
}), V = l((e, t) => {
|
|
109
|
+
let n = t.headers ?? {}, r = typeof S == "function" ? S() : null;
|
|
92
110
|
return { headers: {
|
|
93
111
|
...n,
|
|
94
112
|
...r?.country ? { "x-geo-country": r.country } : {},
|
|
95
113
|
...r?.currency ? { "x-geo-currency": r.currency } : {},
|
|
96
114
|
...r?.timezone ? { "x-geo-timezone": r.timezone } : {}
|
|
97
115
|
} };
|
|
98
|
-
}),
|
|
99
|
-
let n = t.headers ?? {}, r = typeof
|
|
116
|
+
}), H = l((e, t) => {
|
|
117
|
+
let n = t.headers ?? {}, r = typeof C == "function" ? C() : C;
|
|
100
118
|
return { headers: {
|
|
101
119
|
...n,
|
|
102
120
|
...r ? { "x-org-id": r } : {}
|
|
103
121
|
} };
|
|
104
|
-
}),
|
|
105
|
-
let n = t.headers ?? {}, r = typeof
|
|
122
|
+
}), U = l((e, t) => {
|
|
123
|
+
let n = t.headers ?? {}, r = typeof w == "function" ? w() : w;
|
|
106
124
|
return { headers: {
|
|
107
125
|
...n,
|
|
108
126
|
...r ? { "x-product-id": r } : {}
|
|
109
127
|
} };
|
|
110
|
-
}),
|
|
111
|
-
let n = t.headers ?? {}, r = (typeof
|
|
128
|
+
}), W = l((e, t) => {
|
|
129
|
+
let n = t.headers ?? {}, r = (typeof T == "function" ? T() : T) || ie(e.variables);
|
|
112
130
|
return { headers: {
|
|
113
131
|
...n,
|
|
114
132
|
...r ? { "x-workspace-id": r } : {}
|
|
115
133
|
} };
|
|
116
|
-
}),
|
|
117
|
-
let n = t.headers ?? {}, r = (typeof
|
|
134
|
+
}), G = l((e, t) => {
|
|
135
|
+
let n = t.headers ?? {}, r = (typeof E == "function" ? E() : E) || ae(e.variables);
|
|
118
136
|
return { headers: {
|
|
119
137
|
...n,
|
|
120
138
|
...r ? { "x-project-id": r } : {}
|
|
121
139
|
} };
|
|
122
|
-
}),
|
|
123
|
-
let n = t.headers ?? {}, r = typeof
|
|
140
|
+
}), K = l((e, t) => {
|
|
141
|
+
let n = t.headers ?? {}, r = typeof D == "function" ? D() : D;
|
|
124
142
|
return { headers: {
|
|
125
143
|
...n,
|
|
126
144
|
...r ? { "x-tenant-id": r } : {}
|
|
127
145
|
} };
|
|
128
|
-
}),
|
|
129
|
-
let n = t.headers ?? {}, i = typeof
|
|
130
|
-
workspaceId: typeof
|
|
131
|
-
organizationId: typeof
|
|
132
|
-
tenantId: typeof
|
|
133
|
-
projectId: typeof
|
|
146
|
+
}), q = l((e, t) => {
|
|
147
|
+
let n = t.headers ?? {}, i = typeof b == "function" ? b() : b, a = r(i, {
|
|
148
|
+
workspaceId: typeof T == "function" ? T() : T,
|
|
149
|
+
organizationId: typeof C == "function" ? C() : C,
|
|
150
|
+
tenantId: typeof D == "function" ? D() : D,
|
|
151
|
+
projectId: typeof E == "function" ? E() : E
|
|
134
152
|
}) ? i : null;
|
|
135
153
|
return { headers: {
|
|
136
154
|
...n,
|
|
137
155
|
...a ? { "x-workspace-authorization": `Bearer ${a}` } : {}
|
|
138
156
|
} };
|
|
139
|
-
}),
|
|
157
|
+
}), J = new c({
|
|
140
158
|
delay: {
|
|
141
159
|
initial: 1e3,
|
|
142
160
|
max: 8e3,
|
|
143
161
|
jitter: !0
|
|
144
162
|
},
|
|
145
163
|
attempts: {
|
|
146
|
-
max:
|
|
164
|
+
max: de,
|
|
147
165
|
retryIf: (e) => {
|
|
148
|
-
if (
|
|
166
|
+
if (re() || !e) return !1;
|
|
149
167
|
let t = e.message?.toLowerCase?.() ?? "";
|
|
150
168
|
return !(t.includes("401") || t.includes("403") || t.includes("unauthorized") || t.includes("forbidden") || t.includes("unauthenticated"));
|
|
151
169
|
}
|
|
152
170
|
}
|
|
153
|
-
}),
|
|
154
|
-
if (
|
|
155
|
-
|
|
171
|
+
}), Y = new d((e, t) => {
|
|
172
|
+
if (re()) {
|
|
173
|
+
P && console.warn("[CircuitBreaker] Circuit is open, blocking request:", e.operationName);
|
|
156
174
|
let t = /* @__PURE__ */ Error("Network circuit breaker is open — backend appears unreachable. Retrying in 30 seconds.");
|
|
157
|
-
return
|
|
175
|
+
return j?.(t), new f((e) => {
|
|
158
176
|
e.error(t);
|
|
159
177
|
});
|
|
160
178
|
}
|
|
161
|
-
return new
|
|
179
|
+
return new f((n) => {
|
|
162
180
|
let r = t(e).subscribe({
|
|
163
181
|
next: (e) => {
|
|
164
|
-
|
|
182
|
+
y(), g.consecutiveFailures === 0 && M?.(!1), n.next(e);
|
|
165
183
|
},
|
|
166
184
|
error: (e) => {
|
|
167
185
|
n.error(e);
|
|
@@ -174,15 +192,15 @@ function w(a) {
|
|
|
174
192
|
r.unsubscribe();
|
|
175
193
|
};
|
|
176
194
|
});
|
|
177
|
-
}),
|
|
178
|
-
function
|
|
179
|
-
|
|
195
|
+
}), X = !1, Z = [];
|
|
196
|
+
function Q(e) {
|
|
197
|
+
Z.forEach(({ resolve: t }) => t(e)), Z = [];
|
|
180
198
|
}
|
|
181
|
-
let
|
|
199
|
+
let he = s(({ error: e, operation: t, forward: n }) => {
|
|
182
200
|
let r = e.errors;
|
|
183
201
|
if (r) {
|
|
184
202
|
let a = r.some((e) => e.extensions?.code === "UNAUTHENTICATED" || e.message.includes("Unauthorized") || e.message.includes("Unauthenticated"));
|
|
185
|
-
for (let e of r)
|
|
203
|
+
for (let e of r) P && console.error("[GraphQL Error]:", e.message);
|
|
186
204
|
i({ errors: r }, { operationName: t.operationName });
|
|
187
205
|
let o = new Set(["STORAGE_QUOTA_EXCEEDED", "RESOURCE_CAP_EXCEEDED"]);
|
|
188
206
|
for (let e of r) {
|
|
@@ -192,80 +210,111 @@ function w(a) {
|
|
|
192
210
|
break;
|
|
193
211
|
}
|
|
194
212
|
}
|
|
195
|
-
if (a &&
|
|
213
|
+
if (a && A) return new f((r) => {
|
|
196
214
|
(async () => {
|
|
197
|
-
if (
|
|
198
|
-
|
|
215
|
+
if (X) if (await new Promise((e) => {
|
|
216
|
+
Z.push({ resolve: e });
|
|
199
217
|
})) {
|
|
200
218
|
let e = n(t).subscribe(r);
|
|
201
219
|
return () => e.unsubscribe();
|
|
202
|
-
} else return
|
|
203
|
-
|
|
220
|
+
} else return k?.(), r.error(e), () => {};
|
|
221
|
+
X = !0;
|
|
204
222
|
try {
|
|
205
|
-
let i = await
|
|
206
|
-
if (
|
|
207
|
-
|
|
223
|
+
let i = await A();
|
|
224
|
+
if (X = !1, i) {
|
|
225
|
+
Q(!0);
|
|
208
226
|
let e = n(t).subscribe(r);
|
|
209
227
|
return () => e.unsubscribe();
|
|
210
|
-
} else return
|
|
228
|
+
} else return Q(!1), k?.(), r.error(e), () => {};
|
|
211
229
|
} catch {
|
|
212
|
-
return
|
|
230
|
+
return X = !1, Q(!1), k?.(), r.error(e), () => {};
|
|
213
231
|
}
|
|
214
232
|
})();
|
|
215
233
|
});
|
|
216
|
-
a &&
|
|
217
|
-
} else if (
|
|
234
|
+
a && k?.(), y();
|
|
235
|
+
} else if (P && console.error("[Network Error]:", e), ne() && M?.(!0), e instanceof Error) j?.(e), i(e, {
|
|
218
236
|
operationName: t.operationName,
|
|
219
237
|
fallbackMessage: "We could not reach the server. Please check your connection and try again."
|
|
220
238
|
});
|
|
221
239
|
else {
|
|
222
240
|
let n = Error(String(e));
|
|
223
|
-
|
|
241
|
+
j?.(n), i(n, {
|
|
224
242
|
operationName: t.operationName,
|
|
225
243
|
fallbackMessage: "We could not reach the server. Please check your connection and try again."
|
|
226
244
|
});
|
|
227
245
|
}
|
|
228
|
-
}),
|
|
229
|
-
|
|
246
|
+
}), ge = new d((e, t) => {
|
|
247
|
+
let n = oe(e.query) && e.getContext().autoRefreshAfterMutation !== !1 && e.getContext().skipMutationAutoRefresh !== !0;
|
|
248
|
+
return new f((r) => {
|
|
249
|
+
let i = t(e).subscribe({
|
|
250
|
+
next: (t) => {
|
|
251
|
+
if (r.next(t), !n || se(t)) return;
|
|
252
|
+
let i = e.operationName || "anonymous mutation";
|
|
253
|
+
N ? Promise.resolve(N({
|
|
254
|
+
gateway: h,
|
|
255
|
+
operationName: i
|
|
256
|
+
})).catch((e) => {
|
|
257
|
+
P && console.warn("[GraphQL] Mutation refresh callback failed:", {
|
|
258
|
+
gateway: h,
|
|
259
|
+
operationName: i,
|
|
260
|
+
error: e
|
|
261
|
+
});
|
|
262
|
+
}) : me(i);
|
|
263
|
+
},
|
|
264
|
+
error: (e) => {
|
|
265
|
+
r.error(e);
|
|
266
|
+
},
|
|
267
|
+
complete: () => {
|
|
268
|
+
r.complete();
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
return () => {
|
|
272
|
+
i.unsubscribe();
|
|
273
|
+
};
|
|
274
|
+
});
|
|
275
|
+
}), $ = p([
|
|
230
276
|
J,
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
277
|
+
Y,
|
|
278
|
+
he,
|
|
279
|
+
ge,
|
|
280
|
+
z,
|
|
281
|
+
q,
|
|
235
282
|
H,
|
|
236
283
|
U,
|
|
237
284
|
W,
|
|
238
285
|
G,
|
|
239
|
-
|
|
286
|
+
K,
|
|
240
287
|
B,
|
|
241
|
-
|
|
288
|
+
V,
|
|
289
|
+
R
|
|
242
290
|
]);
|
|
243
|
-
if (
|
|
244
|
-
let e =
|
|
245
|
-
e && ($ =
|
|
246
|
-
q,
|
|
291
|
+
if (le) {
|
|
292
|
+
let e = ue || n(_ || L.defaultBaseUrl) + L.sse;
|
|
293
|
+
e && ($ = p([
|
|
247
294
|
J,
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
295
|
+
Y,
|
|
296
|
+
he,
|
|
297
|
+
ge,
|
|
298
|
+
z,
|
|
299
|
+
q,
|
|
252
300
|
H,
|
|
253
301
|
U,
|
|
254
302
|
W,
|
|
255
303
|
G,
|
|
256
|
-
|
|
304
|
+
K,
|
|
257
305
|
B,
|
|
258
|
-
|
|
259
|
-
|
|
306
|
+
V,
|
|
307
|
+
te(({ query: e }) => {
|
|
308
|
+
let t = m(e);
|
|
260
309
|
return t.kind === "OperationDefinition" && t.operation === "subscription";
|
|
261
310
|
}, new o({
|
|
262
311
|
url: e,
|
|
263
312
|
headers: {},
|
|
264
|
-
debug:
|
|
265
|
-
}),
|
|
313
|
+
debug: P
|
|
314
|
+
}), R)
|
|
266
315
|
]));
|
|
267
316
|
}
|
|
268
|
-
let
|
|
317
|
+
let _e = new ee({ typePolicies: {
|
|
269
318
|
File: { keyFields: ["id"] },
|
|
270
319
|
Folder: { keyFields: ["id"] },
|
|
271
320
|
Tag: { keyFields: ["id"] },
|
|
@@ -297,9 +346,9 @@ function w(a) {
|
|
|
297
346
|
Session: { keyFields: ["id"] },
|
|
298
347
|
DeveloperOrganization: { keyFields: ["id"] }
|
|
299
348
|
} });
|
|
300
|
-
return new u({
|
|
349
|
+
return F = new u({
|
|
301
350
|
link: $,
|
|
302
|
-
cache:
|
|
351
|
+
cache: O ?? _e,
|
|
303
352
|
defaultOptions: {
|
|
304
353
|
watchQuery: {
|
|
305
354
|
fetchPolicy: "cache-and-network",
|
|
@@ -311,19 +360,19 @@ function w(a) {
|
|
|
311
360
|
},
|
|
312
361
|
mutate: { errorPolicy: "all" }
|
|
313
362
|
}
|
|
314
|
-
});
|
|
363
|
+
}), F;
|
|
315
364
|
}
|
|
316
|
-
var
|
|
317
|
-
function
|
|
365
|
+
var C = null, w = null;
|
|
366
|
+
function T(e) {
|
|
318
367
|
let { workspaceBaseUrl: t, globalBaseUrl: n, authToken: r, enableSubscriptions: i = !1, onAuthError: a, debug: o = !1 } = e;
|
|
319
|
-
|
|
368
|
+
C = S({
|
|
320
369
|
gateway: "workspace",
|
|
321
370
|
baseUrl: t,
|
|
322
371
|
authToken: r,
|
|
323
372
|
enableSubscriptions: i,
|
|
324
373
|
onAuthError: a,
|
|
325
374
|
debug: o
|
|
326
|
-
}),
|
|
375
|
+
}), w = S({
|
|
327
376
|
gateway: "global",
|
|
328
377
|
baseUrl: n,
|
|
329
378
|
authToken: r,
|
|
@@ -331,16 +380,16 @@ function D(e) {
|
|
|
331
380
|
debug: o
|
|
332
381
|
});
|
|
333
382
|
}
|
|
334
|
-
function
|
|
335
|
-
if (!
|
|
336
|
-
return
|
|
383
|
+
function E() {
|
|
384
|
+
if (!C) throw Error("Workspace client not initialized. Call initializeAppClients first.");
|
|
385
|
+
return C;
|
|
337
386
|
}
|
|
338
|
-
function
|
|
339
|
-
if (!
|
|
340
|
-
return
|
|
387
|
+
function D() {
|
|
388
|
+
if (!w) throw Error("Global client not initialized. Call initializeAppClients first.");
|
|
389
|
+
return w;
|
|
341
390
|
}
|
|
342
|
-
function
|
|
343
|
-
|
|
391
|
+
function O() {
|
|
392
|
+
C &&= (C.clearStore(), null), w &&= (w.clearStore(), null);
|
|
344
393
|
}
|
|
345
394
|
//#endregion
|
|
346
|
-
export {
|
|
395
|
+
export { S as createGraphQLClient, D as getGlobalClient, E as getWorkspaceClient, T as initializeAppClients, O as resetAppClients };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShellProvider.d.ts","sourceRoot":"","sources":["../../../src/shared/providers/AppShellProvider.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAqD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAa1F,OAAO,EAAiB,KAAK,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAYlE,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAQL,KAAK,kBAAkB,EACxB,MAAM,WAAW,CAAC;AAuBnB,MAAM,WAAW,cAAc;IAC7B,gEAAgE;IAChE,WAAW,EAAE,MAAM,CAAC;IAEpB,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,sBAAsB;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,g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AAC;QAClB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,YAAY,CAAC,EAAE;QACb,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AAED,MAAM,WAAW,wBAAwB;IACvC,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,2BAA2B,CAAC,EAAE,MAAM,CAAC;CACtC;AAwED,wBAAgB,kCAAkC,CAChD,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,wBAAwB,GAC5B,2BAA2B,CAiC7B;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,cAAc,CAAC;IACvB,QAAQ,EAAE,SAAS,CAAC;IACpB,2FAA2F;IAC3F,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CAC7B;AA8WD,wBAAgB,gBAAgB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,EAAE,qBAAqB,2CAoS3F"}
|
|
@@ -388,19 +388,27 @@ function be({ config: n, children: i, clearAuthStore: a }) {
|
|
|
388
388
|
refreshToken: n.refreshToken,
|
|
389
389
|
expiresAt: n.expiresIn ? Date.now() + n.expiresIn * 1e3 : void 0
|
|
390
390
|
};
|
|
391
|
-
}, [y.globalBaseUrl]), Z = z(() => t("organization"), []), Q = V(() =>
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
391
|
+
}, [y.globalBaseUrl]), Z = z(() => t("organization"), []), Q = V(() => {
|
|
392
|
+
let e = new se({
|
|
393
|
+
queryCache: new oe({ onError: (e) => {
|
|
394
|
+
r(e);
|
|
395
|
+
} }),
|
|
396
|
+
mutationCache: new ae({
|
|
397
|
+
onSuccess: () => {
|
|
398
|
+
e.invalidateQueries();
|
|
399
|
+
},
|
|
400
|
+
onError: (e) => {
|
|
401
|
+
r(e);
|
|
402
|
+
}
|
|
403
|
+
}),
|
|
404
|
+
defaultOptions: { queries: {
|
|
405
|
+
staleTime: O?.staleTime ?? 300 * 1e3,
|
|
406
|
+
retry: O?.retry ?? 1,
|
|
407
|
+
refetchOnWindowFocus: O?.refetchOnWindowFocus ?? !1
|
|
408
|
+
} }
|
|
409
|
+
});
|
|
410
|
+
return e;
|
|
411
|
+
}, [O]);
|
|
404
412
|
return B(() => {
|
|
405
413
|
let e = te.getInstance();
|
|
406
414
|
e.getLogger("shell") || e.getLogger("shell").addTransport(new d());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiGatewayProvider.d.ts","sourceRoot":"","sources":["../../../../src/shared/providers/shell/MultiGatewayProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAA2C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"MultiGatewayProvider.d.ts","sourceRoot":"","sources":["../../../../src/shared/providers/shell/MultiGatewayProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAA2C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIhF,OAAO,EAAuB,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAKzE,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,SAAS,CAAC;IACpB,qCAAqC;IACrC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kCAAkC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kEAAkE;IAClE,cAAc,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IACrC,qEAAqE;IACrE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2BAA2B;IAC3B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,gDAAgD;IAChD,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,yCAAyC;IACzC,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACxC,+CAA+C;IAC/C,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;CACzC;AAED,wBAAgB,oBAAoB,CAAC,EACnC,QAAQ,EACR,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,cAA4B,EAC5B,KAAa,EACb,mBAA2B,EAC3B,WAAW,EACX,cAAc,EACd,cAAc,GACf,EAAE,yBAAyB,2CAiR3B"}
|
|
@@ -7,14 +7,27 @@ import { jsx as c } from "react/jsx-runtime";
|
|
|
7
7
|
import { ApolloProvider as l } from "@apollo/client/react";
|
|
8
8
|
//#region src/shared/providers/shell/MultiGatewayProvider.tsx
|
|
9
9
|
function u({ children: u, workspaceBaseUrl: d, globalBaseUrl: f, organizationId: p, defaultGateway: m = "workspace", debug: h = !1, enableSubscriptions: g = !1, onAuthError: _, onNetworkError: v, onRefreshToken: y }) {
|
|
10
|
-
let { getAccessToken: b, getWorkspaceToken: x, accessToken: S, workspaceToken: C } = r(), w =
|
|
10
|
+
let { getAccessToken: b, getWorkspaceToken: x, accessToken: S, workspaceToken: C } = r(), w = s({
|
|
11
|
+
workspaceClient: null,
|
|
12
|
+
globalClient: null
|
|
13
|
+
}), T = s(null), E = i(() => {
|
|
14
|
+
T.current ||= setTimeout(() => {
|
|
15
|
+
T.current = null;
|
|
16
|
+
let e = w.current, t = [];
|
|
17
|
+
e.workspaceClient && t.push(e.workspaceClient.refetchQueries({ include: "active" })), e.globalClient && t.push(e.globalClient.refetchQueries({ include: "active" })), t.length !== 0 && Promise.allSettled(t).then((e) => {
|
|
18
|
+
if (!h) return;
|
|
19
|
+
let t = e.filter((e) => e.status === "rejected");
|
|
20
|
+
t.length > 0 && console.warn("[MultiGatewayProvider] Active query refresh failed after mutation", t);
|
|
21
|
+
});
|
|
22
|
+
}, 0);
|
|
23
|
+
}, [h]), D = i(() => {
|
|
11
24
|
let e = sessionStorage.getItem("bf-active-profile");
|
|
12
25
|
if (e) {
|
|
13
26
|
let t = localStorage.getItem(`bf-p-${e}-locale`);
|
|
14
27
|
if (t) return t;
|
|
15
28
|
}
|
|
16
29
|
return localStorage.getItem("burdenoff-locale") || "en";
|
|
17
|
-
}, []),
|
|
30
|
+
}, []), O = i(() => {
|
|
18
31
|
let e = sessionStorage.getItem("bf-active-profile");
|
|
19
32
|
if (e) {
|
|
20
33
|
let t = localStorage.getItem(`bf-p-${e}-geography`);
|
|
@@ -27,67 +40,73 @@ function u({ children: u, workspaceBaseUrl: d, globalBaseUrl: f, organizationId:
|
|
|
27
40
|
return JSON.parse(t);
|
|
28
41
|
} catch {}
|
|
29
42
|
return null;
|
|
30
|
-
}, []),
|
|
43
|
+
}, []), k = i(() => e("workspace"), []), A = i(() => e("project"), []), j = o(() => t({
|
|
31
44
|
gateway: "workspace",
|
|
32
45
|
baseUrl: d,
|
|
33
46
|
authToken: b,
|
|
34
47
|
workspaceToken: x,
|
|
35
|
-
workspaceId:
|
|
36
|
-
projectId:
|
|
48
|
+
workspaceId: k,
|
|
49
|
+
projectId: A,
|
|
37
50
|
organizationId: p,
|
|
38
|
-
locale:
|
|
39
|
-
geography:
|
|
51
|
+
locale: D,
|
|
52
|
+
geography: O,
|
|
40
53
|
enableSubscriptions: g,
|
|
41
54
|
debug: h,
|
|
42
55
|
onAuthError: _,
|
|
43
56
|
onRefreshToken: y,
|
|
44
|
-
onNetworkError: v
|
|
57
|
+
onNetworkError: v,
|
|
58
|
+
onMutationSuccess: E
|
|
45
59
|
}), [
|
|
46
60
|
d,
|
|
47
61
|
b,
|
|
48
62
|
x,
|
|
49
|
-
|
|
50
|
-
|
|
63
|
+
k,
|
|
64
|
+
A,
|
|
51
65
|
p,
|
|
52
|
-
|
|
53
|
-
|
|
66
|
+
D,
|
|
67
|
+
O,
|
|
54
68
|
g,
|
|
55
69
|
h,
|
|
56
70
|
_,
|
|
57
71
|
y,
|
|
58
|
-
v
|
|
59
|
-
|
|
72
|
+
v,
|
|
73
|
+
E
|
|
74
|
+
]), M = o(() => t({
|
|
60
75
|
gateway: "global",
|
|
61
76
|
baseUrl: f,
|
|
62
77
|
authToken: b,
|
|
63
78
|
organizationId: p,
|
|
64
|
-
locale:
|
|
65
|
-
geography:
|
|
79
|
+
locale: D,
|
|
80
|
+
geography: O,
|
|
66
81
|
debug: h,
|
|
67
82
|
onAuthError: _,
|
|
68
83
|
onRefreshToken: y,
|
|
69
|
-
onNetworkError: v
|
|
84
|
+
onNetworkError: v,
|
|
85
|
+
onMutationSuccess: E
|
|
70
86
|
}), [
|
|
71
87
|
f,
|
|
72
88
|
b,
|
|
73
89
|
p,
|
|
74
|
-
|
|
75
|
-
|
|
90
|
+
D,
|
|
91
|
+
O,
|
|
76
92
|
h,
|
|
77
93
|
_,
|
|
78
94
|
y,
|
|
79
|
-
v
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
globalClient: k
|
|
83
|
-
});
|
|
95
|
+
v,
|
|
96
|
+
E
|
|
97
|
+
]);
|
|
84
98
|
a(() => {
|
|
85
|
-
|
|
86
|
-
workspaceClient:
|
|
87
|
-
globalClient:
|
|
99
|
+
w.current = {
|
|
100
|
+
workspaceClient: j,
|
|
101
|
+
globalClient: M
|
|
88
102
|
};
|
|
89
|
-
}, [
|
|
90
|
-
|
|
103
|
+
}, [j, M]), a(() => {
|
|
104
|
+
let e = T;
|
|
105
|
+
return () => {
|
|
106
|
+
e.current &&= (clearTimeout(e.current), null);
|
|
107
|
+
};
|
|
108
|
+
}, []);
|
|
109
|
+
let N = i((e) => e === "workspace" ? w.current.workspaceClient ?? j : w.current.globalClient ?? M, [j, M]);
|
|
91
110
|
return a(() => {
|
|
92
111
|
h && console.log("[MultiGatewayProvider] Tokens updated:", {
|
|
93
112
|
hasAccessToken: !!S,
|
|
@@ -102,27 +121,27 @@ function u({ children: u, workspaceBaseUrl: d, globalBaseUrl: f, organizationId:
|
|
|
102
121
|
let e = async (e) => {
|
|
103
122
|
h && console.log("[MultiGatewayProvider] Context changed; evicting cache + refetching", e);
|
|
104
123
|
try {
|
|
105
|
-
|
|
124
|
+
j.cache.evict({ id: "ROOT_QUERY" }), j.cache.gc();
|
|
106
125
|
} catch {}
|
|
107
126
|
try {
|
|
108
|
-
|
|
127
|
+
M.cache.evict({ id: "ROOT_QUERY" }), M.cache.gc();
|
|
109
128
|
} catch {}
|
|
110
129
|
try {
|
|
111
|
-
await
|
|
130
|
+
await j.refetchQueries({ include: "active" });
|
|
112
131
|
} catch {}
|
|
113
132
|
try {
|
|
114
|
-
await
|
|
133
|
+
await M.refetchQueries({ include: "active" });
|
|
115
134
|
} catch {}
|
|
116
135
|
};
|
|
117
136
|
return window.addEventListener("burdenoff:workspace-changed", e), window.addEventListener("burdenoff:organization-changed", e), window.addEventListener("burdenoff:project-changed", e), () => {
|
|
118
137
|
window.removeEventListener("burdenoff:workspace-changed", e), window.removeEventListener("burdenoff:organization-changed", e), window.removeEventListener("burdenoff:project-changed", e);
|
|
119
138
|
};
|
|
120
139
|
}, [
|
|
121
|
-
|
|
122
|
-
|
|
140
|
+
j,
|
|
141
|
+
M,
|
|
123
142
|
h
|
|
124
143
|
]), a(() => {
|
|
125
|
-
let e =
|
|
144
|
+
let e = j, t = M;
|
|
126
145
|
return () => {
|
|
127
146
|
if (h && console.log("[MultiGatewayProvider] Cleaning up Apollo clients"), !(typeof window < "u" && (window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" || window.location.hostname.endsWith(".local.burdenoff.com")))) {
|
|
128
147
|
try {
|
|
@@ -134,21 +153,21 @@ function u({ children: u, workspaceBaseUrl: d, globalBaseUrl: f, organizationId:
|
|
|
134
153
|
}
|
|
135
154
|
};
|
|
136
155
|
}, [
|
|
137
|
-
|
|
138
|
-
|
|
156
|
+
j,
|
|
157
|
+
M,
|
|
139
158
|
h
|
|
140
159
|
]), /* @__PURE__ */ c(n, {
|
|
141
160
|
value: o(() => ({
|
|
142
|
-
workspaceClient:
|
|
143
|
-
globalClient:
|
|
144
|
-
getClient:
|
|
161
|
+
workspaceClient: j,
|
|
162
|
+
globalClient: M,
|
|
163
|
+
getClient: N
|
|
145
164
|
}), [
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
165
|
+
j,
|
|
166
|
+
M,
|
|
167
|
+
N
|
|
149
168
|
]),
|
|
150
169
|
children: /* @__PURE__ */ c(l, {
|
|
151
|
-
client: m === "workspace" ?
|
|
170
|
+
client: m === "workspace" ? j : M,
|
|
152
171
|
children: u
|
|
153
172
|
})
|
|
154
173
|
});
|