@burdenoff/fe-libs 2026.904.1 → 2026.904.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.
Files changed (33) hide show
  1. package/dist/shared/assistant/index.d.ts +3 -0
  2. package/dist/shared/assistant/index.d.ts.map +1 -1
  3. package/dist/shared/assistant/voice/replyLanguage.d.ts +53 -0
  4. package/dist/shared/assistant/voice/replyLanguage.d.ts.map +1 -0
  5. package/dist/shared/assistant/voice/replyLanguage.js +112 -0
  6. package/dist/shared/assistant/voice/speechLabels.d.ts +12 -0
  7. package/dist/shared/assistant/voice/speechLabels.d.ts.map +1 -0
  8. package/dist/shared/assistant/voice/speechLabels.js +75 -0
  9. package/dist/shared/assistant/voice/speechPlayback.d.ts +67 -0
  10. package/dist/shared/assistant/voice/speechPlayback.d.ts.map +1 -0
  11. package/dist/shared/assistant/voice/speechPlayback.js +28 -0
  12. package/dist/shared/config/authBridgeUrls.d.ts.map +1 -1
  13. package/dist/shared/config/authBridgeUrls.js +16 -15
  14. package/dist/shared/config/gatewayUrls.d.ts +29 -0
  15. package/dist/shared/config/gatewayUrls.d.ts.map +1 -1
  16. package/dist/shared/config/gatewayUrls.js +44 -20
  17. package/dist/shared/config/index.d.ts.map +1 -1
  18. package/dist/shared/native/capacitor.d.ts +49 -0
  19. package/dist/shared/native/capacitor.d.ts.map +1 -0
  20. package/dist/shared/native/capacitor.js +31 -0
  21. package/dist/shared/native/index.d.ts +2 -0
  22. package/dist/shared/native/index.d.ts.map +1 -1
  23. package/dist/shared/providers/shell/MultiGatewayProvider.d.ts.map +1 -1
  24. package/dist/shared/providers/shell/MultiGatewayProvider.js +101 -100
  25. package/dist/shared/utils/authCookie.d.ts.map +1 -1
  26. package/dist/shared/utils/authCookie.js +35 -34
  27. package/dist/shared/utils/gatewayFetchRewrite.d.ts.map +1 -1
  28. package/dist/shared/utils/gatewayFetchRewrite.js +95 -87
  29. package/dist/shared-assistant.js +4 -1
  30. package/dist/shared-config.js +9 -1
  31. package/dist/shared-native.js +23 -22
  32. package/dist/shared.js +124 -123
  33. package/package.json +2 -2
@@ -0,0 +1,31 @@
1
+ //#region src/shared/native/capacitor.ts
2
+ function e() {
3
+ if (typeof window > "u") return null;
4
+ let e = window.Capacitor;
5
+ return typeof e != "object" || !e ? null : e;
6
+ }
7
+ function t(e) {
8
+ try {
9
+ let t = e.getPlatform?.();
10
+ if (typeof t == "string" && t) return t;
11
+ } catch {}
12
+ return typeof e.platform == "string" && e.platform ? e.platform : null;
13
+ }
14
+ function n() {
15
+ let n = e();
16
+ if (!n) return null;
17
+ let r = t(n);
18
+ return r === "ios" || r === "android" ? r : null;
19
+ }
20
+ function r() {
21
+ let t = e();
22
+ if (t) {
23
+ try {
24
+ if (t.isNativePlatform?.() === !0) return !0;
25
+ } catch {}
26
+ if (n() !== null) return !0;
27
+ }
28
+ return typeof window < "u" && window.location?.protocol === "capacitor:";
29
+ }
30
+ //#endregion
31
+ export { n as getCapacitorPlatform, r as isCapacitorNative };
@@ -1,5 +1,7 @@
1
1
  export type { ActionSheetButton, ActionSheetButtonStyle, ActionSheetOptions, AppState, AppStateEventDetail, BurdenoffDesktopBridge, BurdenoffNativeBridge, BurdenoffNativePlatform, ConfirmOptions, DesktopEnvironment, DesktopNotification, DesktopPlatform, DesktopQuickAction, DesktopRuntimeConfig, DesktopThemeOptions, DesktopTitlebarMode, DesktopUpdateState, DesktopUpdateStatus, DesktopWindowState, DeviceInfo, HapticImpactStyle, HapticNotificationType, KeyboardEventDetail, NativePreviewMode, NetworkStatusEventDetail, PushTokenEventDetail, SafeAreaInsets, ShareOptions, StatusBarTheme, StatusBarThemeEventDetail, ToastDuration, } from './types';
2
2
  export { getNativeBridge } from './bridge';
3
+ export { isCapacitorNative, getCapacitorPlatform } from './capacitor';
4
+ export type { CapacitorNativePlatform } from './capacitor';
3
5
  export { getPlatform, isAndroid, isIOS, isNative, isWeb, isElectron, isStandalonePWA, isInstalledApp, isWebBrowser, } from './platform';
4
6
  export { nativeConfirm, nativeCopyText, nativeImpact, nativeNotify, nativeOpenUrl, nativeShare, nativeToast, } from './consumers';
5
7
  export { SafeAreaView, type SafeAreaViewProps } from './SafeAreaView';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/native/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EAClB,QAAQ,EACR,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,UAAU,EACV,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACpB,cAAc,EACd,YAAY,EACZ,cAAc,EACd,yBAAyB,EACzB,aAAa,GACd,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EACL,WAAW,EACX,SAAS,EACT,KAAK,EACL,QAAQ,EACR,KAAK,EACL,UAAU,EACV,eAAe,EACf,cAAc,EACd,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,aAAa,EACb,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,WAAW,EACX,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACtE,cAAc,SAAS,CAAC;AACxB,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,EACtB,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,GACxB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACxE,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEjE,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,SAAS,EACT,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACnB,aAAa,EACb,oBAAoB,EACpB,eAAe,EACf,0BAA0B,EAC1B,gBAAgB,EAChB,qBAAqB,EACrB,6BAA6B,EAC7B,6BAA6B,EAC7B,wBAAwB,EACxB,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACnG,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,KAAK,mBAAmB,EACxB,KAAK,cAAc,GACpB,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/native/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EAClB,QAAQ,EACR,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,UAAU,EACV,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,wBAAwB,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,EACxB,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACnG,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,KAAK,mBAAmB,EACxB,KAAK,cAAc,GACpB,MAAM,cAAc,CAAC"}
@@ -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;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,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,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,WAAW,EACX,cAA4B,EAC5B,KAAa,EACb,mBAA2B,EAC3B,WAAW,EACX,cAAc,EACd,cAAc,GACf,EAAE,yBAAyB,2CA+R3B"}
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;AAMzE,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,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,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,WAAW,EACX,cAA4B,EAC5B,KAAa,EACb,mBAA2B,EAC3B,WAAW,EACX,cAAc,EACd,cAAc,GACf,EAAE,yBAAyB,2CAoS3B"}
@@ -1,33 +1,34 @@
1
- import { readActiveContextValueWithUrlPrecedence as e } from "./ActiveContextStorage.js";
2
- import { createGraphQLClient as t } from "../../graphql/client.js";
3
- import { GatewayProvider as n } from "../../graphql/GatewayContext.js";
4
- import { useAuthToken as r } from "./AuthTokenProvider.js";
5
- import { useCallback as i, useEffect as a, useMemo as o, useRef as s } from "react";
6
- import { jsx as c } from "react/jsx-runtime";
7
- import { ApolloProvider as l } from "@apollo/client/react";
1
+ import { isCapacitorNative as e } from "../../native/capacitor.js";
2
+ import { readActiveContextValueWithUrlPrecedence as t } from "./ActiveContextStorage.js";
3
+ import { createGraphQLClient as n } from "../../graphql/client.js";
4
+ import { GatewayProvider as r } from "../../graphql/GatewayContext.js";
5
+ import { useAuthToken as i } from "./AuthTokenProvider.js";
6
+ import { useCallback as a, useEffect as o, useMemo as s, useRef as c } from "react";
7
+ import { jsx as l } from "react/jsx-runtime";
8
+ import { ApolloProvider as u } from "@apollo/client/react";
8
9
  //#region src/shared/providers/shell/MultiGatewayProvider.tsx
9
- function u({ children: u, workspaceBaseUrl: d, globalBaseUrl: f, organizationId: p, productSlug: m, defaultGateway: h = "workspace", debug: g = !1, enableSubscriptions: _ = !1, onAuthError: v, onNetworkError: y, onRefreshToken: b }) {
10
- let { getAccessToken: x, getWorkspaceToken: S, accessToken: C, workspaceToken: w } = r(), T = s({
10
+ function d({ children: d, workspaceBaseUrl: f, globalBaseUrl: p, organizationId: m, productSlug: h, defaultGateway: g = "workspace", debug: _ = !1, enableSubscriptions: v = !1, onAuthError: y, onNetworkError: b, onRefreshToken: x }) {
11
+ let { getAccessToken: S, getWorkspaceToken: C, accessToken: w, workspaceToken: T } = i(), E = c({
11
12
  workspaceClient: null,
12
13
  globalClient: null
13
- }), E = s(null), D = i(() => {
14
- E.current ||= setTimeout(() => {
15
- E.current = null;
16
- let e = T.current, t = [];
14
+ }), D = c(null), O = a(() => {
15
+ D.current ||= setTimeout(() => {
16
+ D.current = null;
17
+ let e = E.current, t = [];
17
18
  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 (!g) return;
19
+ if (!_) return;
19
20
  let t = e.filter((e) => e.status === "rejected");
20
21
  t.length > 0 && console.warn("[MultiGatewayProvider] Active query refresh failed after mutation", t);
21
22
  });
22
23
  }, 0);
23
- }, [g]), O = i(() => {
24
+ }, [_]), k = a(() => {
24
25
  let e = sessionStorage.getItem("bf-active-profile");
25
26
  if (e) {
26
27
  let t = localStorage.getItem(`bf-p-${e}-locale`);
27
28
  if (t) return t;
28
29
  }
29
30
  return localStorage.getItem("burdenoff-locale") || "en";
30
- }, []), k = i(() => {
31
+ }, []), A = a(() => {
31
32
  let e = sessionStorage.getItem("bf-active-profile");
32
33
  if (e) {
33
34
  let t = localStorage.getItem(`bf-p-${e}-geography`);
@@ -40,143 +41,143 @@ function u({ children: u, workspaceBaseUrl: d, globalBaseUrl: f, organizationId:
40
41
  return JSON.parse(t);
41
42
  } catch {}
42
43
  return null;
43
- }, []), A = i(() => e("workspace"), []), j = i(() => e("project"), []), M = o(() => t({
44
+ }, []), j = a(() => t("workspace"), []), M = a(() => t("project"), []), N = s(() => n({
44
45
  gateway: "workspace",
45
- baseUrl: d,
46
- authToken: x,
47
- workspaceToken: S,
48
- workspaceId: A,
49
- projectId: j,
50
- organizationId: p,
51
- productSlug: m,
52
- locale: O,
53
- geography: k,
54
- enableSubscriptions: _,
55
- debug: g,
56
- onAuthError: v,
57
- onRefreshToken: b,
58
- onNetworkError: y,
59
- onMutationSuccess: D
46
+ baseUrl: f,
47
+ authToken: S,
48
+ workspaceToken: C,
49
+ workspaceId: j,
50
+ projectId: M,
51
+ organizationId: m,
52
+ productSlug: h,
53
+ locale: k,
54
+ geography: A,
55
+ enableSubscriptions: v,
56
+ debug: _,
57
+ onAuthError: y,
58
+ onRefreshToken: x,
59
+ onNetworkError: b,
60
+ onMutationSuccess: O
60
61
  }), [
61
- d,
62
- x,
62
+ f,
63
63
  S,
64
- A,
64
+ C,
65
65
  j,
66
- p,
66
+ M,
67
67
  m,
68
- O,
68
+ h,
69
69
  k,
70
- _,
71
- g,
70
+ A,
72
71
  v,
73
- b,
72
+ _,
74
73
  y,
75
- D
76
- ]), N = o(() => t({
74
+ x,
75
+ b,
76
+ O
77
+ ]), P = s(() => n({
77
78
  gateway: "global",
78
- baseUrl: f,
79
- authToken: x,
80
- organizationId: p,
81
- productSlug: m,
82
- locale: O,
83
- geography: k,
84
- enableSubscriptions: _,
85
- debug: g,
86
- onAuthError: v,
87
- onRefreshToken: b,
88
- onNetworkError: y,
89
- onMutationSuccess: D
79
+ baseUrl: p,
80
+ authToken: S,
81
+ organizationId: m,
82
+ productSlug: h,
83
+ locale: k,
84
+ geography: A,
85
+ enableSubscriptions: v,
86
+ debug: _,
87
+ onAuthError: y,
88
+ onRefreshToken: x,
89
+ onNetworkError: b,
90
+ onMutationSuccess: O
90
91
  }), [
91
- f,
92
- x,
93
92
  p,
93
+ S,
94
94
  m,
95
- O,
95
+ h,
96
96
  k,
97
- _,
98
- g,
97
+ A,
99
98
  v,
100
- b,
99
+ _,
101
100
  y,
102
- D
101
+ x,
102
+ b,
103
+ O
103
104
  ]);
104
- a(() => {
105
- T.current = {
106
- workspaceClient: M,
107
- globalClient: N
105
+ o(() => {
106
+ E.current = {
107
+ workspaceClient: N,
108
+ globalClient: P
108
109
  };
109
- }, [M, N]), a(() => {
110
- let e = E;
110
+ }, [N, P]), o(() => {
111
+ let e = D;
111
112
  return () => {
112
113
  e.current &&= (clearTimeout(e.current), null);
113
114
  };
114
115
  }, []);
115
- let P = i((e) => e === "workspace" ? T.current.workspaceClient ?? M : T.current.globalClient ?? N, [M, N]);
116
- return a(() => {
117
- g && console.log("[MultiGatewayProvider] Tokens updated:", {
118
- hasAccessToken: !!C,
119
- hasWorkspaceToken: !!w
116
+ let F = a((e) => e === "workspace" ? E.current.workspaceClient ?? N : E.current.globalClient ?? P, [N, P]);
117
+ return o(() => {
118
+ _ && console.log("[MultiGatewayProvider] Tokens updated:", {
119
+ hasAccessToken: !!w,
120
+ hasWorkspaceToken: !!T
120
121
  });
121
122
  }, [
122
- C,
123
123
  w,
124
- g
125
- ]), a(() => {
124
+ T,
125
+ _
126
+ ]), o(() => {
126
127
  if (typeof window > "u") return;
127
128
  let e = async (e) => {
128
- g && console.log("[MultiGatewayProvider] Context changed; evicting cache + refetching", e);
129
- try {
130
- M.cache.evict({ id: "ROOT_QUERY" }), M.cache.gc();
131
- } catch {}
129
+ _ && console.log("[MultiGatewayProvider] Context changed; evicting cache + refetching", e);
132
130
  try {
133
131
  N.cache.evict({ id: "ROOT_QUERY" }), N.cache.gc();
134
132
  } catch {}
135
133
  try {
136
- await M.refetchQueries({ include: "active" });
134
+ P.cache.evict({ id: "ROOT_QUERY" }), P.cache.gc();
137
135
  } catch {}
138
136
  try {
139
137
  await N.refetchQueries({ include: "active" });
140
138
  } catch {}
139
+ try {
140
+ await P.refetchQueries({ include: "active" });
141
+ } catch {}
141
142
  };
142
143
  return window.addEventListener("burdenoff:workspace-changed", e), window.addEventListener("burdenoff:organization-changed", e), window.addEventListener("burdenoff:project-changed", e), () => {
143
144
  window.removeEventListener("burdenoff:workspace-changed", e), window.removeEventListener("burdenoff:organization-changed", e), window.removeEventListener("burdenoff:project-changed", e);
144
145
  };
145
146
  }, [
146
- M,
147
147
  N,
148
- g
149
- ]), a(() => {
150
- let e = M, t = N;
148
+ P,
149
+ _
150
+ ]), o(() => {
151
+ let t = N, n = P;
151
152
  return () => {
152
- if (g && 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")))) {
153
+ if (_ && console.log("[MultiGatewayProvider] Cleaning up Apollo clients"), !(typeof window < "u" && !e() && (window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" || window.location.hostname.endsWith(".local.burdenoff.com")))) {
153
154
  try {
154
- e.stop();
155
+ t.stop();
155
156
  } catch {}
156
157
  try {
157
- t.stop();
158
+ n.stop();
158
159
  } catch {}
159
160
  }
160
161
  };
161
162
  }, [
162
- M,
163
163
  N,
164
- g
165
- ]), /* @__PURE__ */ c(n, {
166
- value: o(() => ({
167
- workspaceClient: M,
168
- globalClient: N,
169
- getClient: P
164
+ P,
165
+ _
166
+ ]), /* @__PURE__ */ l(r, {
167
+ value: s(() => ({
168
+ workspaceClient: N,
169
+ globalClient: P,
170
+ getClient: F
170
171
  }), [
171
- M,
172
172
  N,
173
- P
173
+ P,
174
+ F
174
175
  ]),
175
- children: /* @__PURE__ */ c(l, {
176
- client: h === "workspace" ? M : N,
177
- children: u
176
+ children: /* @__PURE__ */ l(u, {
177
+ client: g === "workspace" ? N : P,
178
+ children: d
178
179
  })
179
180
  });
180
181
  }
181
182
  //#endregion
182
- export { u as MultiGatewayProvider };
183
+ export { d as MultiGatewayProvider };
@@ -1 +1 @@
1
- {"version":3,"file":"authCookie.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/authCookie.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAOH,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AA4DD,wBAAgB,uBAAuB,IAAI,OAAO,CAQjD;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,SAA2B,GAAG,OAAO,CAU9E;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAqC7E;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,SAAyB,GAAG,IAAI,CAU3F;AAED,wBAAgB,kBAAkB,IAAI,kBAAkB,GAAG,IAAI,CAS9D;AAED,wBAAgB,oBAAoB,IAAI,IAAI,CAQ3C;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAEpD;AAED;;;GAGG;AACH,wBAAgB,YAAY,IAAI,MAAM,GAAG,IAAI,CAI5C;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAErC"}
1
+ {"version":3,"file":"authCookie.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/authCookie.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAQH,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AA4DD,wBAAgB,uBAAuB,IAAI,OAAO,CAejD;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,SAA2B,GAAG,OAAO,CAU9E;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAqC7E;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,SAAyB,GAAG,IAAI,CAU3F;AAED,wBAAgB,kBAAkB,IAAI,kBAAkB,GAAG,IAAI,CAS9D;AAED,wBAAgB,oBAAoB,IAAI,IAAI,CAQ3C;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAEpD;AAED;;;GAGG;AACH,wBAAgB,YAAY,IAAI,MAAM,GAAG,IAAI,CAI5C;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAErC"}
@@ -1,13 +1,14 @@
1
- import { ALL_PRODUCT_DOMAINS as e } from "../config/gatewayUrls.js";
1
+ import { isCapacitorNative as e } from "../native/capacitor.js";
2
+ import { ALL_PRODUCT_DOMAINS as t } from "../config/gatewayUrls.js";
2
3
  //#region src/shared/utils/authCookie.ts
3
- var t = ["bf-sso", "bf-sso-profile"], n = "bf-sso-profile";
4
- function r(e, t = window.location.origin) {
4
+ var n = ["bf-sso", "bf-sso-profile"], r = "bf-sso-profile";
5
+ function i(e, t = window.location.origin) {
5
6
  return encodeURIComponent(JSON.stringify({
6
7
  id: e,
7
8
  origin: t
8
9
  }));
9
10
  }
10
- function i(e) {
11
+ function a(e) {
11
12
  try {
12
13
  let t = JSON.parse(decodeURIComponent(e));
13
14
  return typeof t == "string" ? {
@@ -24,66 +25,66 @@ function i(e) {
24
25
  };
25
26
  }
26
27
  }
27
- function a() {
28
+ function o() {
28
29
  return typeof window > "u" ? null : window.location.hostname.endsWith(".local.burdenoff.com") ? ".local.burdenoff.com" : null;
29
30
  }
30
- function o() {
31
+ function s() {
31
32
  if (typeof window > "u") return [];
32
- let e = window.location.hostname, t = [], n = a();
33
+ let e = window.location.hostname, t = [], n = o();
33
34
  return n && t.push(n), e && !["localhost", "127.0.0.1"].includes(e) && t.push(e), Array.from(new Set(t));
34
35
  }
35
- function s() {
36
- if (typeof window > "u") return !1;
37
- let e = window.location.hostname;
38
- return e.endsWith(".local.burdenoff.com") || e === "localhost" || e === "127.0.0.1";
36
+ function c() {
37
+ if (typeof window > "u" || e()) return !1;
38
+ let t = window.location.hostname;
39
+ return t.endsWith(".local.burdenoff.com") || t === "localhost" || t === "127.0.0.1";
39
40
  }
40
- function c(e = window.location.hostname) {
41
+ function l(e = window.location.hostname) {
41
42
  return e === "localhost" || e === "127.0.0.1" || e === "0.0.0.0" || e === "[::1]" || e === "::1" || e.endsWith(".localhost") || e.endsWith(".local.burdenoff.com");
42
43
  }
43
- function l(t) {
44
- if (!t) return !1;
44
+ function u(e) {
45
+ if (!e) return !1;
45
46
  try {
46
- let n = new URL(t);
47
+ let n = new URL(e);
47
48
  if (!["https:", "http:"].includes(n.protocol) || n.protocol === "http:" && !["localhost", "127.0.0.1"].includes(n.hostname)) return !1;
48
49
  if (n.hostname === "localhost" || n.hostname === "127.0.0.1" || n.hostname.endsWith(".local.burdenoff.com")) return !0;
49
- for (let t of e) if (n.hostname === t || n.hostname === `app.${t}` || n.hostname === `alphaapp.${t}` || n.hostname === `admin.${t}` || n.hostname === `alphaadmin.${t}` || n.hostname === `www.${t}`) return !0;
50
+ for (let e of t) if (n.hostname === e || n.hostname === `app.${e}` || n.hostname === `alphaapp.${e}` || n.hostname === `admin.${e}` || n.hostname === `alphaadmin.${e}` || n.hostname === `www.${e}`) return !0;
50
51
  return !1;
51
52
  } catch {
52
53
  return !1;
53
54
  }
54
55
  }
55
- function u(e, n = window.location.origin) {
56
+ function d(e, t = window.location.origin) {
56
57
  if (typeof document > "u") return;
57
- f();
58
- let i = a(), o = i ? `; domain=${i}` : "", s = window.location.protocol === "https:" ? "; secure" : "", c = r(e, n);
59
- for (let e of t) document.cookie = `${e}=${c}${o}; path=/; samesite=lax${s}; max-age=86400`;
58
+ p();
59
+ let r = o(), a = r ? `; domain=${r}` : "", s = window.location.protocol === "https:" ? "; secure" : "", c = i(e, t);
60
+ for (let e of n) document.cookie = `${e}=${c}${a}; path=/; samesite=lax${s}; max-age=86400`;
60
61
  }
61
- function d() {
62
+ function f() {
62
63
  if (typeof document > "u") return null;
63
- for (let e of t) {
64
+ for (let e of n) {
64
65
  let t = document.cookie.match(RegExp(`(?:^|;\\s*)${e}=([^;]*)`));
65
66
  if (!t) continue;
66
- let n = i(t[1]);
67
+ let n = a(t[1]);
67
68
  if (n?.id) return n;
68
69
  }
69
70
  return null;
70
71
  }
71
- function f() {
72
- if (!(typeof document > "u")) for (let e of t) {
72
+ function p() {
73
+ if (!(typeof document > "u")) for (let e of n) {
73
74
  document.cookie = `${e}=; path=/; max-age=0`;
74
- for (let t of o()) document.cookie = `${e}=; path=/; domain=${t}; max-age=0`;
75
+ for (let t of s()) document.cookie = `${e}=; path=/; domain=${t}; max-age=0`;
75
76
  }
76
77
  }
77
- function p(e) {
78
- u(e);
78
+ function m(e) {
79
+ d(e);
79
80
  }
80
- function m() {
81
+ function h() {
81
82
  if (typeof document > "u") return null;
82
- let e = document.cookie.match(RegExp(`(?:^|;\\s*)${n}=([^;]*)`));
83
- return e ? i(e[1])?.id ?? null : null;
83
+ let e = document.cookie.match(RegExp(`(?:^|;\\s*)${r}=([^;]*)`));
84
+ return e ? a(e[1])?.id ?? null : null;
84
85
  }
85
- function h() {
86
- f();
86
+ function g() {
87
+ p();
87
88
  }
88
89
  //#endregion
89
- export { h as clearSSoCookie, f as clearShellSsoCookies, m as getSSoCookie, c as isLocalDevSsoHost, s as isSharedSsoCookieDomain, l as isTrustedSsoOrigin, d as readShellSsoCookie, p as setSSoCookie, u as setShellSsoCookies };
90
+ export { g as clearSSoCookie, p as clearShellSsoCookies, h as getSSoCookie, l as isLocalDevSsoHost, c as isSharedSsoCookieDomain, u as isTrustedSsoOrigin, f as readShellSsoCookie, m as setSSoCookie, d as setShellSsoCookies };
@@ -1 +1 @@
1
- {"version":3,"file":"gatewayFetchRewrite.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/gatewayFetchRewrite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC,2BAA2B;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,sCAAsC;IACtC,KAAK,EAAE,YAAY,CAAC;CACrB;AA0GD,wBAAgB,gCAAgC,IAAI,IAAI,CAEvD;AAkPD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,aAAa,CAAC,EAAE,kBAAkB,EAAE,EACpC,aAAa,CAAC,EAAE,YAAY,GAC3B,YAAY,CAmBd;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,OAAO,EAChB,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,EACpC,SAAS,CAAC,EAAE,MAAM,EAClB,aAAa,CAAC,EAAE,MAAM,GACrB,OAAO,CAET;AAED;;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GASG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,YAAY,EACnB,QAAQ,CAAC,EAAE,0BAA0B,GACpC,IAAI,CA6HN;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,SAAyB,GAAG,IAAI,CAQtE"}