@burdenoff/fe-libs 2026.531.3 → 2026.531.5
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeographySwitcher.d.ts","sourceRoot":"","sources":["../../src/chrome/GeographySwitcher.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GeographySwitcher.d.ts","sourceRoot":"","sources":["../../src/chrome/GeographySwitcher.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAEjE,MAAM,WAAW,sBAAsB;IACrC,8BAA8B;IAC9B,SAAS,EAAE,WAAW,EAAE,CAAC;IACzB,sCAAsC;IACtC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,oCAAoC;IACpC,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IACjD,4CAA4C;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;GAOG;AAEH,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAAoB,CAAC"}
|
|
@@ -1,162 +1,4 @@
|
|
|
1
|
-
import { useEffect as e, useMemo as t, useRef as n, useState as r } from "react";
|
|
2
|
-
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
3
1
|
//#region src/chrome/GeographySwitcher.tsx
|
|
4
|
-
var
|
|
5
|
-
"Africa",
|
|
6
|
-
"Americas",
|
|
7
|
-
"Asia",
|
|
8
|
-
"Europe",
|
|
9
|
-
"Oceania"
|
|
10
|
-
], c = ({ countries: c, currentCountryCode: l, onCountryChange: u, compact: d = !1 }) => {
|
|
11
|
-
let [f, p] = r(!1), [m, h] = r(""), g = n(null), _ = n(null), v = c.find((e) => e.code === l) || null;
|
|
12
|
-
e(() => {
|
|
13
|
-
let e = (e) => {
|
|
14
|
-
g.current && !g.current.contains(e.target) && p(!1);
|
|
15
|
-
};
|
|
16
|
-
if (f) return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
17
|
-
}, [f]), e(() => {
|
|
18
|
-
let e = (e) => {
|
|
19
|
-
e.key === "Escape" && p(!1);
|
|
20
|
-
};
|
|
21
|
-
if (f) return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
22
|
-
}, [f]), e(() => {
|
|
23
|
-
f ? _.current?.focus() : h("");
|
|
24
|
-
}, [f]);
|
|
25
|
-
let y = t(() => {
|
|
26
|
-
let e = m.trim().toLowerCase(), t = e ? c.filter((t) => t.name.toLowerCase().includes(e) || t.code.toLowerCase().includes(e)) : c, n = {};
|
|
27
|
-
for (let e of t) n[e.region] || (n[e.region] = []), n[e.region].push(e);
|
|
28
|
-
return s.filter((e) => n[e] && n[e].length > 0).map((e) => ({
|
|
29
|
-
region: e,
|
|
30
|
-
countries: n[e]
|
|
31
|
-
}));
|
|
32
|
-
}, [c, m]), b = (e) => {
|
|
33
|
-
u && u(e), p(!1);
|
|
34
|
-
}, x = y.length > 0;
|
|
35
|
-
return /* @__PURE__ */ o("div", {
|
|
36
|
-
className: "relative",
|
|
37
|
-
ref: g,
|
|
38
|
-
children: [/* @__PURE__ */ a("button", {
|
|
39
|
-
onClick: () => p(!f),
|
|
40
|
-
className: `flex items-center gap-2 px-3 py-2 rounded-button hover:bg-action-ghost-bg-hover transition-colors ${f ? "bg-action-ghost-bg-hover" : ""}`,
|
|
41
|
-
"aria-label": "Change country",
|
|
42
|
-
"aria-expanded": f,
|
|
43
|
-
children: d ? /* @__PURE__ */ a("svg", {
|
|
44
|
-
className: "size-5 text-text-primary",
|
|
45
|
-
fill: "none",
|
|
46
|
-
stroke: "currentColor",
|
|
47
|
-
viewBox: "0 0 24 24",
|
|
48
|
-
children: /* @__PURE__ */ a("path", {
|
|
49
|
-
strokeLinecap: "round",
|
|
50
|
-
strokeLinejoin: "round",
|
|
51
|
-
strokeWidth: 2,
|
|
52
|
-
d: "M3 5h12M9 3v2m1.048 9.5A18.022 18.022 0 016.412 9m6.088 9h7M11 21l5-10 5 10M12.751 5C11.783 10.77 8.07 15.61 3 18.129"
|
|
53
|
-
})
|
|
54
|
-
}) : /* @__PURE__ */ o(i, { children: [
|
|
55
|
-
v && /* @__PURE__ */ a("span", {
|
|
56
|
-
className: "text-xl flex-shrink-0",
|
|
57
|
-
children: v.flag
|
|
58
|
-
}),
|
|
59
|
-
/* @__PURE__ */ a("span", {
|
|
60
|
-
className: "text-body-sm font-medium text-text-primary uppercase",
|
|
61
|
-
children: v?.code ?? "—"
|
|
62
|
-
}),
|
|
63
|
-
/* @__PURE__ */ a("svg", {
|
|
64
|
-
className: `w-4 h-4 text-text-secondary transition-transform ${f ? "rotate-180" : ""}`,
|
|
65
|
-
fill: "none",
|
|
66
|
-
stroke: "currentColor",
|
|
67
|
-
viewBox: "0 0 24 24",
|
|
68
|
-
children: /* @__PURE__ */ a("path", {
|
|
69
|
-
strokeLinecap: "round",
|
|
70
|
-
strokeLinejoin: "round",
|
|
71
|
-
strokeWidth: 2,
|
|
72
|
-
d: "M19 9l-7 7-7-7"
|
|
73
|
-
})
|
|
74
|
-
})
|
|
75
|
-
] })
|
|
76
|
-
}), f && /* @__PURE__ */ o("div", {
|
|
77
|
-
className: "absolute right-0 mt-2 w-[calc(100vw-1.5rem)] sm:w-72 max-w-72 bg-bg-elevated border border-border-default rounded-lg shadow-lg z-50 py-2",
|
|
78
|
-
children: [
|
|
79
|
-
/* @__PURE__ */ a("div", {
|
|
80
|
-
className: "px-4 py-2 border-b border-border-subtle",
|
|
81
|
-
children: /* @__PURE__ */ a("p", {
|
|
82
|
-
className: "text-body-xs font-semibold text-text-secondary uppercase",
|
|
83
|
-
children: "Select Region"
|
|
84
|
-
})
|
|
85
|
-
}),
|
|
86
|
-
/* @__PURE__ */ a("div", {
|
|
87
|
-
className: "px-3 py-2 border-b border-border-subtle",
|
|
88
|
-
children: /* @__PURE__ */ o("div", {
|
|
89
|
-
className: "relative",
|
|
90
|
-
children: [/* @__PURE__ */ a("svg", {
|
|
91
|
-
className: "absolute left-2.5 top-1/2 -translate-y-1/2 size-4 text-text-secondary pointer-events-none",
|
|
92
|
-
fill: "none",
|
|
93
|
-
stroke: "currentColor",
|
|
94
|
-
viewBox: "0 0 24 24",
|
|
95
|
-
children: /* @__PURE__ */ a("path", {
|
|
96
|
-
strokeLinecap: "round",
|
|
97
|
-
strokeLinejoin: "round",
|
|
98
|
-
strokeWidth: 2,
|
|
99
|
-
d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
|
|
100
|
-
})
|
|
101
|
-
}), /* @__PURE__ */ a("input", {
|
|
102
|
-
ref: _,
|
|
103
|
-
type: "text",
|
|
104
|
-
value: m,
|
|
105
|
-
onChange: (e) => h(e.target.value),
|
|
106
|
-
placeholder: "Search countries...",
|
|
107
|
-
className: "w-full pl-8 pr-3 py-1.5 text-body-sm bg-bg-surface border border-border-default rounded-md text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-1 focus:ring-action-primary-bg"
|
|
108
|
-
})]
|
|
109
|
-
})
|
|
110
|
-
}),
|
|
111
|
-
/* @__PURE__ */ a("div", {
|
|
112
|
-
className: "py-1 max-h-80 overflow-y-auto",
|
|
113
|
-
children: x ? y.map(({ region: e, countries: t }) => /* @__PURE__ */ o("div", { children: [/* @__PURE__ */ a("div", {
|
|
114
|
-
className: "px-4 py-1.5",
|
|
115
|
-
children: /* @__PURE__ */ a("p", {
|
|
116
|
-
className: "text-body-xs font-semibold text-text-secondary uppercase tracking-wide",
|
|
117
|
-
children: e
|
|
118
|
-
})
|
|
119
|
-
}), t.map((e) => /* @__PURE__ */ o("button", {
|
|
120
|
-
onClick: () => b(e),
|
|
121
|
-
className: `w-full flex items-center gap-3 px-4 py-2.5 text-body-sm transition-colors ${e.code === l ? "bg-action-ghost-bg-hover text-text-primary font-medium" : "text-text-primary hover:bg-action-ghost-bg-hover"}`,
|
|
122
|
-
children: [
|
|
123
|
-
/* @__PURE__ */ a("span", {
|
|
124
|
-
className: "text-xl flex-shrink-0",
|
|
125
|
-
children: e.flag
|
|
126
|
-
}),
|
|
127
|
-
/* @__PURE__ */ a("div", {
|
|
128
|
-
className: "flex-1 text-left min-w-0",
|
|
129
|
-
children: /* @__PURE__ */ a("p", {
|
|
130
|
-
className: "font-medium truncate",
|
|
131
|
-
children: e.name
|
|
132
|
-
})
|
|
133
|
-
}),
|
|
134
|
-
/* @__PURE__ */ a("span", {
|
|
135
|
-
className: "text-xs text-text-secondary flex-shrink-0",
|
|
136
|
-
children: e.code
|
|
137
|
-
}),
|
|
138
|
-
e.code === l && /* @__PURE__ */ a("svg", {
|
|
139
|
-
className: "size-5 text-action-primary-bg flex-shrink-0",
|
|
140
|
-
fill: "currentColor",
|
|
141
|
-
viewBox: "0 0 20 20",
|
|
142
|
-
children: /* @__PURE__ */ a("path", {
|
|
143
|
-
fillRule: "evenodd",
|
|
144
|
-
d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
|
|
145
|
-
clipRule: "evenodd"
|
|
146
|
-
})
|
|
147
|
-
})
|
|
148
|
-
]
|
|
149
|
-
}, e.code))] }, e)) : /* @__PURE__ */ a("div", {
|
|
150
|
-
className: "px-4 py-6 text-center",
|
|
151
|
-
children: /* @__PURE__ */ a("p", {
|
|
152
|
-
className: "text-body-sm text-text-secondary",
|
|
153
|
-
children: "No countries found"
|
|
154
|
-
})
|
|
155
|
-
})
|
|
156
|
-
})
|
|
157
|
-
]
|
|
158
|
-
})]
|
|
159
|
-
});
|
|
160
|
-
};
|
|
2
|
+
var e = (e) => null;
|
|
161
3
|
//#endregion
|
|
162
|
-
export {
|
|
4
|
+
export { e as GeographySwitcher };
|
|
@@ -25,15 +25,22 @@ export interface UseActorProfilesOptions {
|
|
|
25
25
|
apiGatewayUrl?: string;
|
|
26
26
|
authToken?: string;
|
|
27
27
|
orgId?: string;
|
|
28
|
+
workspaceId?: string;
|
|
28
29
|
}
|
|
29
30
|
export declare function buildActorFallback(actor: ActorInput): ActorProfile;
|
|
30
31
|
/**
|
|
31
32
|
* Resolves a list of actor IDs to human-friendly profiles (displayName + email
|
|
32
|
-
* + avatar), with a 5-minute in-memory cache and
|
|
33
|
+
* + avatar), with a 5-minute in-memory cache and scope-aware batch lookups.
|
|
33
34
|
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
35
|
+
* Resolution order for user actors:
|
|
36
|
+
* 1. workspace-scoped batch lookup when workspaceId is available
|
|
37
|
+
* 2. organization-scoped batch lookup when orgId is available
|
|
38
|
+
* 3. global batch lookup for super/tenant admins
|
|
39
|
+
* 4. local fallback
|
|
40
|
+
*
|
|
41
|
+
* Non-user actor types resolve locally to a humanized fallback. Network
|
|
42
|
+
* failures return the fallback rather than throwing — UI always has *something*
|
|
43
|
+
* to render.
|
|
37
44
|
*
|
|
38
45
|
* Pair with the {@link ActorIdentity} component for consistent UUID hygiene:
|
|
39
46
|
* displayName + email in the primary slot, UUID hidden in a drill-down.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useActorProfiles.d.ts","sourceRoot":"","sources":["../../../src/shared/actors/useActorProfiles.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;CACnB;
|
|
1
|
+
{"version":3,"file":"useActorProfiles.d.ts","sourceRoot":"","sources":["../../../src/shared/actors/useActorProfiles.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAOD,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;AAE3D,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,uBAAuB;IACtC;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAwFD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,UAAU,GAAG,YAAY,CAWlE;AAgID;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,UAAU,EAAE,EACpB,OAAO,GAAE,uBAA4B,GACpC,eAAe,CA0NjB"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { resolveGatewayUrls as e } from "../config/gatewayUrls.js";
|
|
2
|
-
import {
|
|
3
|
-
import { useEffect as
|
|
2
|
+
import { getStoredAuthToken as t, graphqlFetch as n } from "../graphql/fetch.js";
|
|
3
|
+
import { useEffect as r, useMemo as i, useState as a } from "react";
|
|
4
4
|
//#region src/shared/actors/useActorProfiles.ts
|
|
5
|
-
var o = "\n query
|
|
6
|
-
function
|
|
5
|
+
var o = "\n query ActorProfilesUsersByIds($ids: [ID!]!) {\n usersByIds(ids: $ids) {\n id\n email\n firstName\n lastName\n name\n username\n avatar\n }\n }\n", s = "\n query ActorProfilesWorkspaceMemberIdentities($userIds: [ID!]!, $workspaceId: ID) {\n workspaceMemberIdentities(userIds: $userIds, workspaceId: $workspaceId) {\n userId\n displayName\n email\n avatar\n }\n }\n", c = "\n query ActorProfilesOrganizationMemberIdentities($userIds: [ID!]!, $organizationId: String!) {\n organizationMemberIdentities(userIds: $userIds, organizationId: $organizationId) {\n userId\n displayName\n email\n avatar\n }\n }\n";
|
|
6
|
+
function l(e) {
|
|
7
7
|
return e.length <= 12 ? e : `${e.slice(0, 8)}…${e.slice(-4)}`;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function u(e) {
|
|
10
10
|
switch (e.toLowerCase()) {
|
|
11
11
|
case "user": return "User";
|
|
12
12
|
case "app": return "App";
|
|
@@ -15,104 +15,217 @@ function c(e) {
|
|
|
15
15
|
default: return e.split("_").map((e) => e.charAt(0) + e.slice(1).toLowerCase()).join(" ");
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function d(e) {
|
|
19
19
|
return {
|
|
20
20
|
actorId: e.actorId,
|
|
21
21
|
actorType: e.actorType,
|
|
22
|
-
displayName: e.actorType.toLowerCase() === "user" ? `User ${
|
|
23
|
-
secondaryLabel:
|
|
22
|
+
displayName: e.actorType.toLowerCase() === "user" ? `User ${l(e.actorId)}` : u(e.actorType),
|
|
23
|
+
secondaryLabel: l(e.actorId),
|
|
24
24
|
resolved: !1
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
var
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
var f = /* @__PURE__ */ new Map(), p = 300 * 1e3, m = /* @__PURE__ */ new Map(), h = 50;
|
|
28
|
+
function g(e, t) {
|
|
29
|
+
if (e.length === 0) return [];
|
|
30
|
+
let n = [];
|
|
31
|
+
for (let r = 0; r < e.length; r += t) n.push(e.slice(r, r + t));
|
|
32
|
+
return n;
|
|
33
|
+
}
|
|
34
|
+
function _(e) {
|
|
35
|
+
return e.workspaceId ? `workspace:${e.workspaceId}` : e.orgId ? `org:${e.orgId}` : "global";
|
|
36
|
+
}
|
|
37
|
+
function v(e, t) {
|
|
38
|
+
let n = e.actorType.toLowerCase();
|
|
39
|
+
return n === "user" ? `${n}:${e.actorId}:${_(t)}` : `${n}:${e.actorId}`;
|
|
40
|
+
}
|
|
41
|
+
function y(e, t) {
|
|
42
|
+
let n = v(e, t), r = m.get(n);
|
|
43
|
+
if (!r || r < Date.now()) {
|
|
44
|
+
f.delete(n), m.delete(n);
|
|
32
45
|
return;
|
|
33
46
|
}
|
|
34
|
-
return
|
|
47
|
+
return f.get(n);
|
|
48
|
+
}
|
|
49
|
+
function b(e, t) {
|
|
50
|
+
let n = v({
|
|
51
|
+
actorId: e.actorId,
|
|
52
|
+
actorType: e.actorType
|
|
53
|
+
}, t);
|
|
54
|
+
f.set(n, e), m.set(n, Date.now() + p);
|
|
55
|
+
}
|
|
56
|
+
function x(e) {
|
|
57
|
+
try {
|
|
58
|
+
let [, t] = e.split(".");
|
|
59
|
+
if (!t || typeof atob != "function") return null;
|
|
60
|
+
let n = t.replace(/-/g, "+").replace(/_/g, "/"), r = n.padEnd(n.length + (4 - n.length % 4) % 4, "=");
|
|
61
|
+
return JSON.parse(atob(r));
|
|
62
|
+
} catch {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
35
65
|
}
|
|
36
|
-
function
|
|
37
|
-
|
|
66
|
+
function S(e) {
|
|
67
|
+
if (!e) return !1;
|
|
68
|
+
let t = x(e), n = typeof t?.role == "string" ? t.role : void 0, r = typeof t?.actor_type == "string" ? t.actor_type : void 0;
|
|
69
|
+
return n === "SUPER_ADMIN" || n === "TENANT_ADMIN" || r === "super_admin";
|
|
38
70
|
}
|
|
39
|
-
function
|
|
40
|
-
|
|
41
|
-
|
|
71
|
+
function C(e) {
|
|
72
|
+
return {
|
|
73
|
+
actorId: e.userId,
|
|
74
|
+
actorType: "user",
|
|
75
|
+
displayName: e.displayName,
|
|
76
|
+
secondaryLabel: e.email ?? l(e.userId),
|
|
77
|
+
email: e.email ?? void 0,
|
|
78
|
+
avatarUrl: e.avatar ?? void 0,
|
|
79
|
+
resolved: !0
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
function w(e) {
|
|
83
|
+
let t = e.name?.trim() || [e.firstName, e.lastName].filter(Boolean).join(" ").trim() || e.username?.trim() || e.email?.trim() || `User ${l(e.id)}`;
|
|
84
|
+
return {
|
|
85
|
+
actorId: e.id,
|
|
86
|
+
actorType: "user",
|
|
87
|
+
displayName: t,
|
|
88
|
+
secondaryLabel: e.email ?? l(e.id),
|
|
89
|
+
email: e.email ?? void 0,
|
|
90
|
+
avatarUrl: e.avatar ?? void 0,
|
|
91
|
+
resolved: !0
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function T(l, u = {}) {
|
|
95
|
+
let { apiGatewayUrl: f, authToken: p, orgId: m, workspaceId: _ } = u, v = p ?? t() ?? void 0, x = i(() => ({
|
|
96
|
+
workspaceId: _,
|
|
97
|
+
orgId: m
|
|
98
|
+
}), [m, _]), T = (e) => /(?:gw-wspace|graphqlworkspaces|workspaces\.)/.test(e), { resolvedGlobalBaseUrl: E, resolvedWorkspaceBaseUrl: D } = i(() => {
|
|
42
99
|
try {
|
|
43
|
-
|
|
100
|
+
let t = e();
|
|
101
|
+
return f ? T(f) ? {
|
|
102
|
+
resolvedGlobalBaseUrl: t.globalBaseUrl,
|
|
103
|
+
resolvedWorkspaceBaseUrl: f
|
|
104
|
+
} : {
|
|
105
|
+
resolvedGlobalBaseUrl: f,
|
|
106
|
+
resolvedWorkspaceBaseUrl: t.workspaceBaseUrl
|
|
107
|
+
} : {
|
|
108
|
+
resolvedGlobalBaseUrl: t.globalBaseUrl,
|
|
109
|
+
resolvedWorkspaceBaseUrl: t.workspaceBaseUrl
|
|
110
|
+
};
|
|
44
111
|
} catch {
|
|
45
|
-
return
|
|
112
|
+
return {
|
|
113
|
+
resolvedGlobalBaseUrl: void 0,
|
|
114
|
+
resolvedWorkspaceBaseUrl: void 0
|
|
115
|
+
};
|
|
46
116
|
}
|
|
47
|
-
}, [f]), [
|
|
117
|
+
}, [f]), [O, k] = a(() => {
|
|
48
118
|
let e = {};
|
|
49
|
-
for (let t of
|
|
50
|
-
let n =
|
|
51
|
-
e[t.actorId] = n ??
|
|
119
|
+
for (let t of l) {
|
|
120
|
+
let n = y(t, x);
|
|
121
|
+
e[t.actorId] = n ?? d(t);
|
|
52
122
|
}
|
|
53
123
|
return e;
|
|
54
|
-
})
|
|
55
|
-
return
|
|
124
|
+
});
|
|
125
|
+
return r(() => {
|
|
56
126
|
let e = !1;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
let
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
127
|
+
async function t() {
|
|
128
|
+
let t = {};
|
|
129
|
+
for (let e of l) t[e.actorId] = y(e, x) ?? d(e);
|
|
130
|
+
e || k((e) => ({
|
|
131
|
+
...e,
|
|
132
|
+
...t
|
|
133
|
+
}));
|
|
134
|
+
let r = l.filter((e) => e.actorType.toLowerCase() === "user" ? !y(e, x)?.resolved : !1), i = [...new Set(r.map((e) => e.actorId))];
|
|
135
|
+
if (i.length === 0) return;
|
|
136
|
+
let a = /* @__PURE__ */ new Map(), u = i;
|
|
137
|
+
if (_ && D && u.length > 0) try {
|
|
138
|
+
for (let t of g(u, h)) {
|
|
139
|
+
if (e) return;
|
|
140
|
+
let r = await n({
|
|
141
|
+
gateway: "workspace",
|
|
142
|
+
baseUrl: D,
|
|
143
|
+
authToken: v,
|
|
144
|
+
workspaceId: _,
|
|
145
|
+
organizationId: m,
|
|
146
|
+
workspaceToken: !0,
|
|
147
|
+
query: s,
|
|
148
|
+
variables: {
|
|
149
|
+
userIds: t,
|
|
150
|
+
workspaceId: _
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
for (let e of r.data?.workspaceMemberIdentities ?? []) {
|
|
154
|
+
let t = C(e);
|
|
155
|
+
b(t, x), a.set(e.userId, t);
|
|
156
|
+
}
|
|
157
|
+
u = u.filter((e) => !a.has(e));
|
|
158
|
+
}
|
|
159
|
+
} catch {
|
|
160
|
+
u = u.filter((e) => !a.has(e));
|
|
64
161
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
let n = await t({
|
|
162
|
+
if (m && E && u.length > 0) try {
|
|
163
|
+
for (let t of g(u, h)) {
|
|
164
|
+
if (e) return;
|
|
165
|
+
let r = await n({
|
|
70
166
|
gateway: "global",
|
|
71
|
-
baseUrl:
|
|
72
|
-
authToken:
|
|
73
|
-
organizationId:
|
|
167
|
+
baseUrl: E,
|
|
168
|
+
authToken: v,
|
|
169
|
+
organizationId: m,
|
|
170
|
+
query: c,
|
|
171
|
+
variables: {
|
|
172
|
+
userIds: t,
|
|
173
|
+
organizationId: m
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
for (let e of r.data?.organizationMemberIdentities ?? []) {
|
|
177
|
+
let t = C(e);
|
|
178
|
+
b(t, x), a.set(e.userId, t);
|
|
179
|
+
}
|
|
180
|
+
u = u.filter((e) => !a.has(e));
|
|
181
|
+
}
|
|
182
|
+
} catch {
|
|
183
|
+
u = u.filter((e) => !a.has(e));
|
|
184
|
+
}
|
|
185
|
+
if (E && u.length > 0 && S(v)) try {
|
|
186
|
+
for (let t of g(u, h)) {
|
|
187
|
+
if (e) return;
|
|
188
|
+
let r = await n({
|
|
189
|
+
gateway: "global",
|
|
190
|
+
baseUrl: E,
|
|
191
|
+
authToken: v,
|
|
192
|
+
organizationId: m,
|
|
74
193
|
query: o,
|
|
75
|
-
variables: {
|
|
194
|
+
variables: { ids: t }
|
|
76
195
|
});
|
|
77
|
-
|
|
78
|
-
let t =
|
|
79
|
-
|
|
196
|
+
for (let e of r.data?.usersByIds ?? []) {
|
|
197
|
+
let t = w(e);
|
|
198
|
+
b(t, x), a.set(e.id, t);
|
|
80
199
|
}
|
|
81
|
-
|
|
82
|
-
actorId: e.actorId,
|
|
83
|
-
actorType: e.actorType,
|
|
84
|
-
displayName: i,
|
|
85
|
-
secondaryLabel: r.email ?? s(e.actorId),
|
|
86
|
-
email: r.email ?? void 0,
|
|
87
|
-
avatarUrl: r.avatar ?? void 0,
|
|
88
|
-
resolved: !0
|
|
89
|
-
};
|
|
90
|
-
return h(a), a;
|
|
91
|
-
} catch {
|
|
92
|
-
return l(e);
|
|
93
|
-
} finally {
|
|
94
|
-
d.delete(r);
|
|
200
|
+
u = u.filter((e) => !a.has(e));
|
|
95
201
|
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
let
|
|
103
|
-
|
|
104
|
-
|
|
202
|
+
} catch {}
|
|
203
|
+
let f = l.map((e) => {
|
|
204
|
+
let t = a.get(e.actorId);
|
|
205
|
+
if (t) return t;
|
|
206
|
+
let n = y(e, x);
|
|
207
|
+
if (n) return n;
|
|
208
|
+
let r = d(e);
|
|
209
|
+
return b(r, x), r;
|
|
210
|
+
});
|
|
211
|
+
e || k((e) => {
|
|
212
|
+
let t = { ...e };
|
|
213
|
+
for (let e of f) t[e.actorId] = e;
|
|
214
|
+
return t;
|
|
105
215
|
});
|
|
106
216
|
}
|
|
107
|
-
return
|
|
217
|
+
return t(), () => {
|
|
108
218
|
e = !0;
|
|
109
219
|
};
|
|
110
220
|
}, [
|
|
111
|
-
|
|
112
|
-
p,
|
|
221
|
+
i(() => l.map((e) => `${e.actorId}|${e.actorType}`).sort().join(","), [l]),
|
|
113
222
|
v,
|
|
114
|
-
|
|
115
|
-
|
|
223
|
+
m,
|
|
224
|
+
E,
|
|
225
|
+
D,
|
|
226
|
+
x,
|
|
227
|
+
_
|
|
228
|
+
]), O;
|
|
116
229
|
}
|
|
117
230
|
//#endregion
|
|
118
|
-
export {
|
|
231
|
+
export { d as buildActorFallback, T as useActorProfiles };
|