@machinemetrics/mm-react-embeddable 2.0.1-0 → 2.0.1-2
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,7 +1,7 @@
|
|
|
1
|
-
import P, { createContext as ue, useContext as G, useState as
|
|
2
|
-
import
|
|
1
|
+
import P, { createContext as ue, useContext as G, useState as U, useRef as R, useCallback as b, useEffect as k, useMemo as fe } from "react";
|
|
2
|
+
import T from "prop-types";
|
|
3
3
|
import te from "styled-components";
|
|
4
|
-
const ee = ue(null),
|
|
4
|
+
const ee = ue(null), V = ue({
|
|
5
5
|
pending: [],
|
|
6
6
|
authorize: () => {
|
|
7
7
|
},
|
|
@@ -14,184 +14,185 @@ const ee = ue(null), J = ue({
|
|
|
14
14
|
originEpochs: {},
|
|
15
15
|
credentials: {},
|
|
16
16
|
unsupported: {}
|
|
17
|
-
}), pe = "access_token", ne = (
|
|
17
|
+
}), pe = "access_token", ne = (t) => t ? t.kind ? t : t.accessToken ? {
|
|
18
18
|
kind: pe,
|
|
19
|
-
accessToken:
|
|
20
|
-
expiresAt:
|
|
21
|
-
} : null : null,
|
|
19
|
+
accessToken: t.accessToken,
|
|
20
|
+
expiresAt: t.expiresAt || null
|
|
21
|
+
} : null : null, ge = 60, he = 120, me = /* @__PURE__ */ new Set([
|
|
22
22
|
"host_not_allowed",
|
|
23
23
|
"unbound_host_bound_guest",
|
|
24
24
|
"invalid_token",
|
|
25
25
|
"provider_unavailable"
|
|
26
|
-
]),
|
|
26
|
+
]), J = (t) => {
|
|
27
27
|
try {
|
|
28
|
-
return new URL(
|
|
28
|
+
return new URL(t).origin;
|
|
29
29
|
} catch {
|
|
30
30
|
return null;
|
|
31
31
|
}
|
|
32
|
-
},
|
|
33
|
-
const i =
|
|
34
|
-
return !i ||
|
|
35
|
-
},
|
|
36
|
-
if (!
|
|
37
|
-
return
|
|
38
|
-
const
|
|
39
|
-
return
|
|
40
|
-
}, ce = (
|
|
32
|
+
}, se = (t, s) => {
|
|
33
|
+
const i = s == null ? void 0 : s.origin;
|
|
34
|
+
return !i || J(t == null ? void 0 : t.authUrl) !== i ? null : i;
|
|
35
|
+
}, oe = (t) => {
|
|
36
|
+
if (!t || /^\d{1,3}(?:\.\d{1,3}){3}$/.test(t) || t.includes(":"))
|
|
37
|
+
return t;
|
|
38
|
+
const s = t.split(".");
|
|
39
|
+
return s.length <= 2 ? t : s.slice(-2).join(".");
|
|
40
|
+
}, ce = (t, s) => {
|
|
41
41
|
try {
|
|
42
|
-
const i = new URL(
|
|
43
|
-
return i.protocol !==
|
|
42
|
+
const i = new URL(t), l = new URL(s);
|
|
43
|
+
return i.protocol !== l.protocol ? !0 : oe(i.hostname) !== oe(l.hostname);
|
|
44
44
|
} catch {
|
|
45
45
|
return !0;
|
|
46
46
|
}
|
|
47
|
-
}, be = (
|
|
48
|
-
const
|
|
49
|
-
|
|
47
|
+
}, be = (t, { onBlocked: s, onClosed: i }) => {
|
|
48
|
+
const l = window.open(
|
|
49
|
+
t.authUrl,
|
|
50
50
|
"mm-embed-auth",
|
|
51
51
|
"popup,width=600,height=700"
|
|
52
52
|
);
|
|
53
|
-
if (!
|
|
54
|
-
return
|
|
53
|
+
if (!l)
|
|
54
|
+
return s(), () => {
|
|
55
55
|
};
|
|
56
|
-
const
|
|
57
|
-
|
|
56
|
+
const w = setInterval(() => {
|
|
57
|
+
l.closed && (clearInterval(w), i());
|
|
58
58
|
}, 1e3);
|
|
59
|
-
return () => clearInterval(
|
|
60
|
-
}, ae = ({ children:
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
const
|
|
68
|
-
const n =
|
|
59
|
+
return () => clearInterval(w);
|
|
60
|
+
}, ae = ({ children: t, launcher: s, broker: i }) => {
|
|
61
|
+
const l = G(ee), [w, I] = U({}), [v, D] = U({}), [j, K] = U({}), [y, E] = U({}), x = R(j);
|
|
62
|
+
x.current = j;
|
|
63
|
+
const Z = R(w);
|
|
64
|
+
Z.current = w;
|
|
65
|
+
const _ = R(null), $ = R({}), A = R({}), q = R(i);
|
|
66
|
+
q.current = i;
|
|
67
|
+
const F = b((e) => {
|
|
68
|
+
const n = $.current[e];
|
|
69
69
|
if (!n)
|
|
70
70
|
return;
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
}, []),
|
|
71
|
+
const r = (c) => !c[e] || c[e].clientId ? c : { ...c, [e]: { ...c[e], clientId: n } };
|
|
72
|
+
I(r), E(r);
|
|
73
|
+
}, []), B = b(
|
|
74
74
|
(e, n) => {
|
|
75
|
-
e && (
|
|
76
|
-
...
|
|
75
|
+
e && (E((r) => r[e] ? r : {
|
|
76
|
+
...r,
|
|
77
77
|
[e]: {
|
|
78
78
|
origin: e,
|
|
79
79
|
reason: n,
|
|
80
|
-
clientId:
|
|
80
|
+
clientId: $.current[e] || null
|
|
81
81
|
}
|
|
82
|
-
}),
|
|
82
|
+
}), F(e));
|
|
83
83
|
},
|
|
84
|
-
[
|
|
85
|
-
),
|
|
86
|
-
(e, { v2: n = !1, origin:
|
|
87
|
-
|
|
88
|
-
...
|
|
89
|
-
[
|
|
90
|
-
origin:
|
|
84
|
+
[F]
|
|
85
|
+
), z = b(
|
|
86
|
+
(e, { v2: n = !1, origin: r = null } = {}) => {
|
|
87
|
+
r && (n && x.current[r] || (I((c) => c[r] ? c : {
|
|
88
|
+
...c,
|
|
89
|
+
[r]: {
|
|
90
|
+
origin: r,
|
|
91
91
|
authUrl: e.authUrl,
|
|
92
|
-
status: n &&
|
|
92
|
+
status: n && q.current ? "broker" : "interactive",
|
|
93
93
|
v2: n,
|
|
94
94
|
scope: e.scope || null,
|
|
95
|
-
acceptsCredentials:
|
|
95
|
+
acceptsCredentials: A.current[r] || null,
|
|
96
96
|
consent: null,
|
|
97
97
|
error: null,
|
|
98
|
-
clientId: e.clientId ||
|
|
98
|
+
clientId: e.clientId || $.current[r] || null,
|
|
99
99
|
popupBlocked: !1
|
|
100
100
|
}
|
|
101
|
-
}),
|
|
101
|
+
}), F(r)));
|
|
102
102
|
},
|
|
103
|
-
[
|
|
104
|
-
),
|
|
105
|
-
|
|
106
|
-
}, []),
|
|
103
|
+
[F]
|
|
104
|
+
), M = R({}), W = b((e) => {
|
|
105
|
+
M.current[e] && (clearTimeout(M.current[e]), delete M.current[e]);
|
|
106
|
+
}, []), o = b(
|
|
107
107
|
(e) => {
|
|
108
|
-
|
|
108
|
+
W(e), I((n) => {
|
|
109
109
|
if (!n[e])
|
|
110
110
|
return n;
|
|
111
|
-
const
|
|
112
|
-
return delete
|
|
111
|
+
const r = { ...n };
|
|
112
|
+
return delete r[e], r;
|
|
113
113
|
});
|
|
114
114
|
},
|
|
115
|
-
[
|
|
116
|
-
),
|
|
115
|
+
[W]
|
|
116
|
+
), a = b(
|
|
117
117
|
(e) => {
|
|
118
|
-
e && (
|
|
118
|
+
e && (o(e), D((n) => ({
|
|
119
119
|
...n,
|
|
120
120
|
[e]: (n[e] || 0) + 1
|
|
121
121
|
})));
|
|
122
122
|
},
|
|
123
|
-
[
|
|
124
|
-
), u =
|
|
123
|
+
[o]
|
|
124
|
+
), u = b(
|
|
125
125
|
(e) => {
|
|
126
|
-
|
|
126
|
+
o(e.origin);
|
|
127
127
|
},
|
|
128
|
-
[
|
|
129
|
-
),
|
|
128
|
+
[o]
|
|
129
|
+
), f = b(
|
|
130
130
|
(e, n) => {
|
|
131
|
-
const
|
|
132
|
-
if (
|
|
133
|
-
if (ce(
|
|
134
|
-
|
|
131
|
+
const r = se(e, n);
|
|
132
|
+
if (r) {
|
|
133
|
+
if (ce(r, window.location.origin)) {
|
|
134
|
+
B(r, "cross-site-legacy");
|
|
135
135
|
return;
|
|
136
136
|
}
|
|
137
|
-
|
|
137
|
+
z(e, { origin: r });
|
|
138
138
|
}
|
|
139
139
|
},
|
|
140
|
-
[
|
|
140
|
+
[z, B]
|
|
141
141
|
);
|
|
142
|
-
|
|
143
|
-
if (!
|
|
142
|
+
k(() => {
|
|
143
|
+
if (!l)
|
|
144
144
|
return;
|
|
145
145
|
const e = [
|
|
146
|
-
|
|
147
|
-
|
|
146
|
+
l.addListener("*", "init", (n, r) => {
|
|
147
|
+
r != null && r.origin && (n != null && n.clientId) && ($.current[r.origin] = n.clientId, F(r.origin)), r != null && r.origin && Array.isArray(n == null ? void 0 : n.acceptsCredentials) ? A.current[r.origin] = n.acceptsCredentials : r != null && r.origin && ce(r.origin, window.location.origin) && B(r.origin, "cross-site-legacy");
|
|
148
148
|
}),
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
149
|
+
l.addListener("*", "authorize", f),
|
|
150
|
+
l.addListener("*", "login", f),
|
|
151
|
+
l.addListener(
|
|
152
152
|
"*",
|
|
153
153
|
"credential-request",
|
|
154
|
-
(n,
|
|
154
|
+
(n, r) => z(n, { v2: !0, origin: se(n, r) })
|
|
155
155
|
)
|
|
156
156
|
];
|
|
157
157
|
return () => e.forEach((n) => n());
|
|
158
|
-
}, [
|
|
158
|
+
}, [l, f, z, F, B]), k(() => {
|
|
159
159
|
const e = (n) => {
|
|
160
|
-
const
|
|
161
|
-
if (!
|
|
160
|
+
const r = n == null ? void 0 : n.data;
|
|
161
|
+
if (!r || r.type !== "authorized")
|
|
162
162
|
return;
|
|
163
|
-
const
|
|
164
|
-
if (!
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
163
|
+
const c = J(r.authUrl);
|
|
164
|
+
if (!c || n.origin !== c)
|
|
165
|
+
return;
|
|
166
|
+
const p = Z.current[c];
|
|
167
|
+
if (!(!p || p.status !== "interactive")) {
|
|
168
|
+
if (r.accessToken) {
|
|
169
|
+
K((O) => ({
|
|
170
|
+
...O,
|
|
171
|
+
[c]: ne({ accessToken: r.accessToken })
|
|
172
|
+
})), o(c);
|
|
172
173
|
return;
|
|
173
174
|
}
|
|
174
|
-
|
|
175
|
+
a(c);
|
|
175
176
|
}
|
|
176
177
|
};
|
|
177
178
|
return window.addEventListener("message", e), () => window.removeEventListener("message", e);
|
|
178
|
-
}, [
|
|
179
|
-
const
|
|
179
|
+
}, [o, a]);
|
|
180
|
+
const g = b(
|
|
180
181
|
(e, n) => {
|
|
181
|
-
const
|
|
182
|
-
!
|
|
182
|
+
const r = e == null ? void 0 : e.origin, c = ne(n);
|
|
183
|
+
!r || !c || (K((p) => ({ ...p, [r]: c })), o(r));
|
|
183
184
|
},
|
|
184
|
-
[
|
|
185
|
-
),
|
|
186
|
-
|
|
187
|
-
}, []),
|
|
185
|
+
[o]
|
|
186
|
+
), h = b((e, n) => {
|
|
187
|
+
I((r) => r[e] ? { ...r, [e]: { ...r[e], ...n } } : r);
|
|
188
|
+
}, []), m = R({}), C = b(
|
|
188
189
|
async (e, { approve: n } = {}) => {
|
|
189
|
-
const
|
|
190
|
-
let
|
|
190
|
+
const r = q.current, { origin: c } = e;
|
|
191
|
+
let p;
|
|
191
192
|
try {
|
|
192
|
-
|
|
193
|
+
p = await r(
|
|
193
194
|
{
|
|
194
|
-
origin:
|
|
195
|
+
origin: c,
|
|
195
196
|
clientId: e.clientId,
|
|
196
197
|
scope: e.scope,
|
|
197
198
|
authUrl: e.authUrl
|
|
@@ -199,106 +200,112 @@ const ee = ue(null), J = ue({
|
|
|
199
200
|
{ approve: n }
|
|
200
201
|
);
|
|
201
202
|
} catch {
|
|
202
|
-
n ?
|
|
203
|
+
n ? h(c, { error: { reason: "broker_unavailable" } }) : h(c, { status: "interactive" });
|
|
203
204
|
return;
|
|
204
205
|
}
|
|
205
|
-
const
|
|
206
|
-
if (
|
|
207
|
-
|
|
206
|
+
const O = p == null ? void 0 : p.status, d = (p == null ? void 0 : p.body) || {};
|
|
207
|
+
if (O === 200 && d.credential) {
|
|
208
|
+
g(e, d.credential);
|
|
208
209
|
return;
|
|
209
210
|
}
|
|
210
|
-
if (
|
|
211
|
-
|
|
211
|
+
if (O === 409 && d.consentRequired) {
|
|
212
|
+
h(c, {
|
|
212
213
|
status: "interactive",
|
|
213
214
|
consent: {
|
|
214
|
-
client:
|
|
215
|
-
stepUp: !!
|
|
216
|
-
scope:
|
|
215
|
+
client: d.client || null,
|
|
216
|
+
stepUp: !!d.stepUp,
|
|
217
|
+
scope: d.scope || e.scope
|
|
217
218
|
},
|
|
218
219
|
error: null
|
|
219
220
|
});
|
|
220
221
|
return;
|
|
221
222
|
}
|
|
222
|
-
const
|
|
223
|
-
if (!n && me.has(
|
|
224
|
-
|
|
223
|
+
const S = d.error || "broker_error";
|
|
224
|
+
if (!n && me.has(S)) {
|
|
225
|
+
h(c, { status: "interactive" });
|
|
225
226
|
return;
|
|
226
227
|
}
|
|
227
|
-
if (n &&
|
|
228
|
-
|
|
228
|
+
if (n && S === "consent_denied") {
|
|
229
|
+
h(c, { error: null });
|
|
229
230
|
return;
|
|
230
231
|
}
|
|
231
|
-
if (
|
|
232
|
+
if (S === "rate_limited" && !e.rateLimitRetried) {
|
|
232
233
|
const N = Math.min(
|
|
233
|
-
Number(
|
|
234
|
-
|
|
234
|
+
Number(d.retryAfter) > 0 ? Number(d.retryAfter) : ge,
|
|
235
|
+
he
|
|
235
236
|
), de = { ...e, rateLimitRetried: !0 };
|
|
236
|
-
|
|
237
|
-
delete
|
|
238
|
-
delete
|
|
237
|
+
W(c), M.current[c] = setTimeout(() => {
|
|
238
|
+
delete M.current[c], m.current[c] = !0, L.current(de, { approve: n }).finally(() => {
|
|
239
|
+
delete m.current[c];
|
|
239
240
|
});
|
|
240
|
-
}, N * 1e3),
|
|
241
|
+
}, N * 1e3), h(c, { rateLimitRetried: !0 });
|
|
241
242
|
return;
|
|
242
243
|
}
|
|
243
|
-
c
|
|
244
|
+
o(c), E((N) => ({
|
|
244
245
|
...N,
|
|
245
|
-
[
|
|
246
|
-
origin:
|
|
247
|
-
reason: `broker:${
|
|
248
|
-
detail:
|
|
249
|
-
clientId: e.clientId ||
|
|
246
|
+
[c]: {
|
|
247
|
+
origin: c,
|
|
248
|
+
reason: `broker:${S}`,
|
|
249
|
+
detail: { status: O != null ? O : null, reason: S },
|
|
250
|
+
clientId: e.clientId || $.current[c] || null
|
|
250
251
|
}
|
|
251
252
|
}));
|
|
252
253
|
},
|
|
253
|
-
[
|
|
254
|
-
),
|
|
255
|
-
|
|
256
|
-
Object.values(
|
|
257
|
-
e.status !== "broker" ||
|
|
258
|
-
delete
|
|
254
|
+
[g, h, o, W]
|
|
255
|
+
), L = R(C);
|
|
256
|
+
L.current = C, k(() => {
|
|
257
|
+
Object.values(w).forEach((e) => {
|
|
258
|
+
e.status !== "broker" || m.current[e.origin] || M.current[e.origin] || (m.current[e.origin] = !0, C(e).finally(() => {
|
|
259
|
+
delete m.current[e.origin];
|
|
259
260
|
}));
|
|
260
261
|
});
|
|
261
|
-
}, [
|
|
262
|
-
const
|
|
263
|
-
(e) => !
|
|
264
|
-
|
|
262
|
+
}, [w, C]);
|
|
263
|
+
const Q = b(
|
|
264
|
+
(e) => !q.current || !(e != null && e.consent) || m.current[e.origin] ? Promise.resolve() : (m.current[e.origin] = !0, C(e, { approve: !0 }).finally(() => {
|
|
265
|
+
delete m.current[e.origin];
|
|
266
|
+
})),
|
|
267
|
+
[C]
|
|
265
268
|
);
|
|
266
|
-
|
|
267
|
-
|
|
269
|
+
k(() => () => {
|
|
270
|
+
_.current && _.current(), Object.values(M.current).forEach(clearTimeout);
|
|
268
271
|
}, []);
|
|
269
|
-
const H =
|
|
272
|
+
const H = b(
|
|
270
273
|
(e) => {
|
|
271
|
-
|
|
272
|
-
const n =
|
|
273
|
-
|
|
274
|
+
_.current && (_.current(), _.current = null);
|
|
275
|
+
const n = s || be;
|
|
276
|
+
_.current = n(e, {
|
|
274
277
|
onBlocked: () => {
|
|
275
|
-
|
|
276
|
-
...
|
|
277
|
-
[e.origin]: { ...
|
|
278
|
-
} :
|
|
278
|
+
I((r) => r[e.origin] ? {
|
|
279
|
+
...r,
|
|
280
|
+
[e.origin]: { ...r[e.origin], popupBlocked: !0 }
|
|
281
|
+
} : r);
|
|
279
282
|
},
|
|
280
|
-
// A
|
|
281
|
-
|
|
283
|
+
// A completed login already removed the entry. A v2 entry stays pending so the prompt remains;
|
|
284
|
+
// a legacy guest is remounted because it only learns of a login by reloading.
|
|
285
|
+
onClosed: () => {
|
|
286
|
+
const r = Z.current[e.origin];
|
|
287
|
+
!r || r.v2 || a(e.origin);
|
|
288
|
+
}
|
|
282
289
|
});
|
|
283
290
|
},
|
|
284
|
-
[
|
|
285
|
-
),
|
|
286
|
-
pending: Object.values(
|
|
291
|
+
[s, a]
|
|
292
|
+
), Y = {
|
|
293
|
+
pending: Object.values(w).filter(
|
|
287
294
|
(e) => e.status === "interactive"
|
|
288
295
|
),
|
|
289
296
|
authorize: H,
|
|
290
|
-
approve:
|
|
291
|
-
complete:
|
|
297
|
+
approve: Q,
|
|
298
|
+
complete: g,
|
|
292
299
|
dismiss: u,
|
|
293
300
|
originEpochs: v,
|
|
294
|
-
credentials:
|
|
295
|
-
unsupported:
|
|
301
|
+
credentials: j,
|
|
302
|
+
unsupported: y
|
|
296
303
|
};
|
|
297
|
-
return /* @__PURE__ */ P.createElement(
|
|
304
|
+
return /* @__PURE__ */ P.createElement(V.Provider, { value: Y }, t);
|
|
298
305
|
};
|
|
299
306
|
ae.propTypes = {
|
|
300
|
-
children:
|
|
301
|
-
launcher:
|
|
307
|
+
children: T.node,
|
|
308
|
+
launcher: T.func,
|
|
302
309
|
/**
|
|
303
310
|
* `async (request, { approve }) => result` where request =
|
|
304
311
|
* `{ origin, clientId, scope, authUrl }` (origin is the zone-attested frame origin) and result
|
|
@@ -307,192 +314,197 @@ ae.propTypes = {
|
|
|
307
314
|
* on 200, `{ consentRequired: true, client: { name, hostname }, stepUp }` on 409, `{ error,
|
|
308
315
|
* … }` otherwise. Provided only by hosts that are themselves first-party clients.
|
|
309
316
|
*/
|
|
310
|
-
broker:
|
|
317
|
+
broker: T.func
|
|
311
318
|
};
|
|
312
|
-
const
|
|
313
|
-
const { originEpochs:
|
|
314
|
-
return i &&
|
|
315
|
-
}, Re = (
|
|
316
|
-
const { credentials:
|
|
317
|
-
return i &&
|
|
318
|
-
},
|
|
319
|
-
const { unsupported:
|
|
320
|
-
return i &&
|
|
321
|
-
}, ie = "MMEmbeddableZoneProvider requires a boolean `ready` prop (true once the host holds the bearer its credentialBroker needs). Embedded apps will not load until it is provided.",
|
|
322
|
-
children:
|
|
323
|
-
authorizationLauncher:
|
|
319
|
+
const $e = () => G(V), Ee = (t) => {
|
|
320
|
+
const { originEpochs: s } = G(V), i = J(t);
|
|
321
|
+
return i && s[i] || 0;
|
|
322
|
+
}, Re = (t) => {
|
|
323
|
+
const { credentials: s } = G(V), i = J(t);
|
|
324
|
+
return i && s[i] || null;
|
|
325
|
+
}, ke = (t) => {
|
|
326
|
+
const { unsupported: s } = G(V), i = J(t);
|
|
327
|
+
return i && s[i] || null;
|
|
328
|
+
}, ie = "MMEmbeddableZoneProvider requires a boolean `ready` prop (true once the host holds the bearer its credentialBroker needs). Embedded apps will not load until it is provided.", we = ({
|
|
329
|
+
children: t,
|
|
330
|
+
authorizationLauncher: s,
|
|
324
331
|
credentialBroker: i,
|
|
325
|
-
ready:
|
|
332
|
+
ready: l
|
|
326
333
|
}) => {
|
|
327
|
-
const
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
}, [
|
|
331
|
-
const [v,
|
|
334
|
+
const w = l === !0, I = R(!1);
|
|
335
|
+
k(() => {
|
|
336
|
+
l !== void 0 || I.current || (I.current = !0, console.error(ie), typeof window != "undefined" && typeof window.alert == "function" && window.alert(ie));
|
|
337
|
+
}, [l]);
|
|
338
|
+
const [v, D] = U({}), [j, K] = U({}), y = R({}), E = R({}), x = R({}), Z = b((o, a) => {
|
|
332
339
|
var u;
|
|
333
|
-
return !!((u =
|
|
334
|
-
}, []),
|
|
335
|
-
|
|
336
|
-
}, []),
|
|
337
|
-
|
|
338
|
-
const u = { ...
|
|
339
|
-
return delete u[
|
|
340
|
-
}),
|
|
341
|
-
const u = { ...
|
|
342
|
-
return delete u[
|
|
343
|
-
}), delete
|
|
340
|
+
return !!((u = x.current[o]) != null && u.has(a));
|
|
341
|
+
}, []), _ = b((o, a, u) => {
|
|
342
|
+
D((f) => ({ ...f, [o]: { origin: a, frameRef: u } }));
|
|
343
|
+
}, []), $ = b((o) => {
|
|
344
|
+
D((a) => {
|
|
345
|
+
const u = { ...a };
|
|
346
|
+
return delete u[o], u;
|
|
347
|
+
}), K((a) => {
|
|
348
|
+
const u = { ...a };
|
|
349
|
+
return delete u[o], u;
|
|
350
|
+
}), delete x.current[o], Object.keys(E.current).forEach((a) => {
|
|
351
|
+
E.current[a].instanceId === o && delete E.current[a];
|
|
352
|
+
});
|
|
344
353
|
}, []);
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
354
|
+
k(() => () => {
|
|
355
|
+
E.current = {};
|
|
356
|
+
}, []), k(() => {
|
|
357
|
+
const o = (u = [], f, g) => {
|
|
358
|
+
u.forEach((h) => h(f, g));
|
|
359
|
+
}, a = (u) => {
|
|
360
|
+
var Q, H, Y, e, n, r, c;
|
|
361
|
+
if (!((Q = u == null ? void 0 : u.data) != null && Q.instanceId))
|
|
351
362
|
return;
|
|
352
|
-
const { instanceId:
|
|
353
|
-
if (!
|
|
363
|
+
const { instanceId: f, type: g } = u.data, h = v[f], m = (Y = (H = h == null ? void 0 : h.frameRef) == null ? void 0 : H.current) == null ? void 0 : Y.contentWindow;
|
|
364
|
+
if (!m || u.source !== m || u.origin !== h.origin)
|
|
354
365
|
return;
|
|
355
|
-
const
|
|
356
|
-
if (
|
|
357
|
-
const { callbackId:
|
|
358
|
-
|
|
366
|
+
const C = { origin: u.origin }, L = y.current;
|
|
367
|
+
if (g === "response") {
|
|
368
|
+
const { callbackId: p, response: O, error: d } = u.data, S = E.current[p];
|
|
369
|
+
S && S.instanceId === f && (S.callback(O, d), delete E.current[p]);
|
|
359
370
|
return;
|
|
360
371
|
}
|
|
361
|
-
if (
|
|
362
|
-
const { requestType:
|
|
363
|
-
|
|
372
|
+
if (g === "mark-registered") {
|
|
373
|
+
const { requestType: p } = u.data;
|
|
374
|
+
x.current[f] || (x.current[f] = /* @__PURE__ */ new Set()), x.current[f].add(p);
|
|
364
375
|
return;
|
|
365
376
|
}
|
|
366
|
-
|
|
377
|
+
g === "ready" && K((p) => ({ ...p, [f]: !0 })), o((e = L[f]) == null ? void 0 : e[g], u.data, C), o((n = L["*"]) == null ? void 0 : n[g], u.data, C), o((r = L[f]) == null ? void 0 : r["*"], u.data, C), o((c = L["*"]) == null ? void 0 : c["*"], u.data, C);
|
|
367
378
|
};
|
|
368
|
-
return window.addEventListener("message",
|
|
369
|
-
window.removeEventListener("message",
|
|
379
|
+
return window.addEventListener("message", a), () => {
|
|
380
|
+
window.removeEventListener("message", a);
|
|
370
381
|
};
|
|
371
382
|
}, [v]);
|
|
372
|
-
const
|
|
373
|
-
(
|
|
374
|
-
var
|
|
375
|
-
const
|
|
376
|
-
if (!
|
|
377
|
-
console.warn(`Origin not set for id: ${
|
|
383
|
+
const A = b(
|
|
384
|
+
(o, a, u, f) => {
|
|
385
|
+
var h, m;
|
|
386
|
+
const g = v[o];
|
|
387
|
+
if (!g) {
|
|
388
|
+
console.warn(`Origin not set for id: ${o}. Unable to send message.`);
|
|
378
389
|
return;
|
|
379
390
|
}
|
|
380
|
-
(
|
|
381
|
-
{ type:
|
|
382
|
-
|
|
391
|
+
(m = (h = g == null ? void 0 : g.frameRef) == null ? void 0 : h.current) != null && m.contentWindow && g.frameRef.current.contentWindow.postMessage(
|
|
392
|
+
{ type: a, ...u, instanceId: o },
|
|
393
|
+
f || g.origin
|
|
383
394
|
);
|
|
384
395
|
},
|
|
385
396
|
[v]
|
|
386
|
-
),
|
|
387
|
-
async (
|
|
388
|
-
const
|
|
389
|
-
delete
|
|
397
|
+
), q = R(0), F = b(() => `${Date.now()}-${++q.current}`, []), B = b(
|
|
398
|
+
async (o, a, u = {}) => new Promise((f, g) => {
|
|
399
|
+
const h = F(), m = (C, L) => {
|
|
400
|
+
delete E.current[h], L ? g(L) : f(C);
|
|
390
401
|
};
|
|
391
|
-
|
|
402
|
+
E.current[h] = { instanceId: o, callback: m }, A(o, "request", { callbackId: h, requestType: a, data: u });
|
|
392
403
|
}),
|
|
393
|
-
[
|
|
394
|
-
),
|
|
395
|
-
(
|
|
396
|
-
|
|
404
|
+
[A]
|
|
405
|
+
), z = b(
|
|
406
|
+
(o, a) => {
|
|
407
|
+
A(o, "load-options", a);
|
|
397
408
|
},
|
|
398
|
-
[
|
|
399
|
-
),
|
|
400
|
-
(
|
|
401
|
-
|
|
409
|
+
[A]
|
|
410
|
+
), M = b(
|
|
411
|
+
(o, a) => {
|
|
412
|
+
A(o, "validate", a);
|
|
402
413
|
},
|
|
403
|
-
[
|
|
404
|
-
),
|
|
414
|
+
[A]
|
|
415
|
+
), W = fe(
|
|
405
416
|
() => ({
|
|
406
|
-
registerFrame:
|
|
407
|
-
unregisterFrame:
|
|
408
|
-
sendMessage:
|
|
409
|
-
sendRequest:
|
|
410
|
-
loadOptions:
|
|
411
|
-
validate:
|
|
412
|
-
hasHandler:
|
|
413
|
-
readyFrames:
|
|
414
|
-
ready:
|
|
415
|
-
addListener: (
|
|
416
|
-
|
|
417
|
+
registerFrame: _,
|
|
418
|
+
unregisterFrame: $,
|
|
419
|
+
sendMessage: A,
|
|
420
|
+
sendRequest: B,
|
|
421
|
+
loadOptions: z,
|
|
422
|
+
validate: M,
|
|
423
|
+
hasHandler: Z,
|
|
424
|
+
readyFrames: j,
|
|
425
|
+
ready: w,
|
|
426
|
+
addListener: (o, a, u) => (y.current[o] || (y.current[o] = {}), y.current[o][a] || (y.current[o][a] = []), y.current[o][a].push(u), () => {
|
|
427
|
+
y.current[o][a] = y.current[o][a].filter((f) => f !== u);
|
|
417
428
|
})
|
|
418
429
|
}),
|
|
419
430
|
[
|
|
420
|
-
U,
|
|
421
|
-
q,
|
|
422
|
-
I,
|
|
423
|
-
x,
|
|
424
|
-
M,
|
|
425
|
-
y,
|
|
426
431
|
_,
|
|
427
|
-
|
|
428
|
-
|
|
432
|
+
$,
|
|
433
|
+
A,
|
|
434
|
+
B,
|
|
435
|
+
z,
|
|
436
|
+
M,
|
|
437
|
+
Z,
|
|
438
|
+
j,
|
|
439
|
+
w
|
|
429
440
|
]
|
|
430
441
|
);
|
|
431
|
-
return /* @__PURE__ */ P.createElement(ee.Provider, { value:
|
|
442
|
+
return /* @__PURE__ */ P.createElement(ee.Provider, { value: W }, /* @__PURE__ */ P.createElement(
|
|
432
443
|
ae,
|
|
433
444
|
{
|
|
434
|
-
launcher:
|
|
445
|
+
launcher: s,
|
|
435
446
|
broker: i
|
|
436
447
|
},
|
|
437
|
-
|
|
448
|
+
t
|
|
438
449
|
));
|
|
439
|
-
}, X = (
|
|
440
|
-
const
|
|
441
|
-
if (
|
|
450
|
+
}, X = (t, s, i) => {
|
|
451
|
+
const l = G(ee);
|
|
452
|
+
if (l === null)
|
|
442
453
|
throw new Error(
|
|
443
454
|
"useEmbeddedEffect must be used within a MMEmbeddableZoneProvider"
|
|
444
455
|
);
|
|
445
|
-
const
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
}, [i]),
|
|
449
|
-
if (!(!
|
|
450
|
-
if (
|
|
451
|
-
const
|
|
452
|
-
return
|
|
453
|
-
|
|
454
|
-
`key-pressed:${
|
|
455
|
-
(...
|
|
456
|
+
const w = R(i);
|
|
457
|
+
k(() => {
|
|
458
|
+
w.current = i;
|
|
459
|
+
}, [i]), k(() => {
|
|
460
|
+
if (!(!t || !s)) {
|
|
461
|
+
if (s.startsWith("key:")) {
|
|
462
|
+
const I = s.substring(4);
|
|
463
|
+
return l.readyFrames[t] && l.sendMessage(t, "subscribe-key", { keyChord: I }), l.addListener(
|
|
464
|
+
t,
|
|
465
|
+
`key-pressed:${I}`,
|
|
466
|
+
(...D) => w.current(...D)
|
|
456
467
|
);
|
|
457
468
|
}
|
|
458
|
-
return
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
(...
|
|
469
|
+
return l.addListener(
|
|
470
|
+
t,
|
|
471
|
+
s,
|
|
472
|
+
(...I) => w.current(...I)
|
|
462
473
|
);
|
|
463
474
|
}
|
|
464
|
-
}, [
|
|
475
|
+
}, [l, t, s]);
|
|
465
476
|
};
|
|
466
|
-
|
|
467
|
-
children:
|
|
477
|
+
we.propTypes = {
|
|
478
|
+
children: T.node.isRequired,
|
|
468
479
|
/**
|
|
469
480
|
* Required. True once the host holds its bearer; zones mount no iframe until then. Missing =
|
|
470
481
|
* not ready, plus a one-time alert.
|
|
471
482
|
*/
|
|
472
|
-
ready:
|
|
483
|
+
ready: T.bool.isRequired,
|
|
473
484
|
/**
|
|
474
485
|
* Optional interactive-step launcher for embedded authorizations,
|
|
475
486
|
* `(entry, { onBlocked, onClosed }) => cleanup`. Defaults to a top-level
|
|
476
487
|
* popup. Hosts that cannot open windows (Android WebView shells) drive
|
|
477
488
|
* their own UI from useEmbeddedAuthorizations() instead.
|
|
478
489
|
*/
|
|
479
|
-
authorizationLauncher:
|
|
490
|
+
authorizationLauncher: T.func,
|
|
480
491
|
/**
|
|
481
492
|
* Optional credential broker for hosts that are first-party MachineMetrics clients
|
|
482
493
|
* (`async (request, { approve }) => result`, see EmbeddedAuthorizationManager). When present,
|
|
483
|
-
* v2 credential requests are brokered server-side
|
|
484
|
-
*
|
|
494
|
+
* v2 credential requests are brokered server-side and consent is rendered natively by the host
|
|
495
|
+
* from the broker's `client` identity; a broker answer the host may not act on falls back to the
|
|
496
|
+
* interactive entry and its popup.
|
|
485
497
|
*/
|
|
486
|
-
credentialBroker:
|
|
498
|
+
credentialBroker: T.func
|
|
487
499
|
};
|
|
488
|
-
const re = te.default || te, Te = 1e4, Ie = "credentials", _e = (
|
|
500
|
+
const re = te.default || te, Te = 1e4, Ie = "credentials", _e = (t, s) => `${t}/mm-embedded-interop?id=${encodeURIComponent(s)}&origin=${encodeURIComponent(
|
|
489
501
|
window.location.origin
|
|
490
502
|
)}&caps=${Ie}`, Me = re.iframe`
|
|
491
503
|
width: 100%;
|
|
492
504
|
height: 100%;
|
|
493
505
|
border: none;
|
|
494
|
-
visibility: ${(
|
|
495
|
-
`,
|
|
506
|
+
visibility: ${(t) => t.$isReady ? "visible" : "hidden"};
|
|
507
|
+
`, Ce = re.div`
|
|
496
508
|
width: 100%;
|
|
497
509
|
height: 100%;
|
|
498
510
|
display: flex;
|
|
@@ -505,44 +517,44 @@ const re = te.default || te, Te = 1e4, Ie = "credentials", _e = (r, o) => `${r}/
|
|
|
505
517
|
text-align: center;
|
|
506
518
|
color: #555;
|
|
507
519
|
font-size: 14px;
|
|
508
|
-
`,
|
|
509
|
-
const
|
|
520
|
+
`, ye = (t) => {
|
|
521
|
+
const s = t && t.origin || "This app", i = t && t.reason || "";
|
|
510
522
|
switch (i) {
|
|
511
523
|
case "broker:scope_above_ceiling":
|
|
512
524
|
return {
|
|
513
|
-
title: `${
|
|
525
|
+
title: `${s} can’t be authorized here`,
|
|
514
526
|
detail: "It asks for permissions your role doesn’t have."
|
|
515
527
|
};
|
|
516
528
|
case "broker:origin_mismatch":
|
|
517
529
|
case "broker:unknown_client":
|
|
518
530
|
return {
|
|
519
|
-
title: `${
|
|
531
|
+
title: `${s} can’t be authorized here`,
|
|
520
532
|
detail: "It isn’t registered to run at this address."
|
|
521
533
|
};
|
|
522
534
|
case "broker:cross_company_principal":
|
|
523
535
|
return {
|
|
524
|
-
title: `${
|
|
536
|
+
title: `${s} can’t be authorized here`,
|
|
525
537
|
detail: "It can’t be authorized for this account."
|
|
526
538
|
};
|
|
527
539
|
default:
|
|
528
540
|
return i.startsWith("broker:") ? {
|
|
529
|
-
title: `${
|
|
541
|
+
title: `${s} can’t be authorized here`,
|
|
530
542
|
detail: "Authorization was refused."
|
|
531
543
|
} : {
|
|
532
|
-
title: `${
|
|
544
|
+
title: `${s} can’t be embedded here`,
|
|
533
545
|
detail: "It needs an update to support embedding from a different domain."
|
|
534
546
|
};
|
|
535
547
|
}
|
|
536
|
-
}, le = ({ entry:
|
|
537
|
-
const
|
|
538
|
-
return /* @__PURE__ */ P.createElement(
|
|
548
|
+
}, le = ({ entry: t }) => {
|
|
549
|
+
const s = ye(t);
|
|
550
|
+
return /* @__PURE__ */ P.createElement(Ce, { "data-reason": t && t.reason || void 0 }, /* @__PURE__ */ P.createElement("div", { style: { fontWeight: 600 } }, s.title), /* @__PURE__ */ P.createElement("div", { style: { fontSize: 12, color: "#888" } }, s.detail));
|
|
539
551
|
};
|
|
540
552
|
le.propTypes = {
|
|
541
|
-
entry:
|
|
542
|
-
origin:
|
|
543
|
-
name:
|
|
544
|
-
reason:
|
|
545
|
-
detail:
|
|
553
|
+
entry: T.shape({
|
|
554
|
+
origin: T.string,
|
|
555
|
+
name: T.string,
|
|
556
|
+
reason: T.string,
|
|
557
|
+
detail: T.object
|
|
546
558
|
})
|
|
547
559
|
};
|
|
548
560
|
const Le = re.div`
|
|
@@ -552,139 +564,154 @@ const Le = re.div`
|
|
|
552
564
|
align-items: center;
|
|
553
565
|
justify-content: center;
|
|
554
566
|
`, Ae = () => /* @__PURE__ */ P.createElement(Le, null, /* @__PURE__ */ P.createElement("div", { style: { textAlign: "center" } }, "This app couldn’t be loaded as an embeddable widget.")), Ue = ({
|
|
555
|
-
id:
|
|
556
|
-
src:
|
|
567
|
+
id: t,
|
|
568
|
+
src: s,
|
|
557
569
|
path: i,
|
|
558
|
-
onInit:
|
|
570
|
+
onInit: l = () => {
|
|
559
571
|
},
|
|
560
|
-
onTimeout:
|
|
561
|
-
context:
|
|
572
|
+
onTimeout: w,
|
|
573
|
+
context: I = {},
|
|
562
574
|
params: v = {},
|
|
563
|
-
renderUnsupported:
|
|
564
|
-
renderTimeout:
|
|
565
|
-
...
|
|
575
|
+
renderUnsupported: D,
|
|
576
|
+
renderTimeout: j,
|
|
577
|
+
...K
|
|
566
578
|
}) => {
|
|
567
|
-
if ("isConfiguring" in
|
|
579
|
+
if ("isConfiguring" in K)
|
|
568
580
|
return console.error(
|
|
569
581
|
"isConfiguring must be passed via the params prop to MMEmbeddableZone"
|
|
570
582
|
), null;
|
|
571
|
-
if ("colorMode" in
|
|
583
|
+
if ("colorMode" in I)
|
|
572
584
|
return console.error(
|
|
573
585
|
"colorMode must be passed via the params prop to MMEmbeddableZone"
|
|
574
586
|
), null;
|
|
575
|
-
if ("isFullScreen" in
|
|
587
|
+
if ("isFullScreen" in I)
|
|
576
588
|
return console.error(
|
|
577
589
|
"isFullScreen must be passed via the params prop to MMEmbeddableZone"
|
|
578
590
|
), null;
|
|
579
|
-
const
|
|
591
|
+
const y = R(), E = J(s), [x, Z] = U(), [_, $] = U(0), [A, q] = U(!1), [F, B] = U(!1), z = Ee(s), M = Re(s), W = ke(s), [o, a] = U(0), [u, f] = U(null), { registerFrame: g, unregisterFrame: h, sendMessage: m, ready: C } = G(
|
|
580
592
|
ee
|
|
581
|
-
), [
|
|
582
|
-
|
|
593
|
+
), [L, Q] = U(), H = R(), Y = R(w), e = R(l), n = R(!1), r = R(), c = b(() => {
|
|
594
|
+
n.current = !1, clearTimeout(H.current), clearTimeout(r.current), $(0), q(!1), B(!1), f(null);
|
|
583
595
|
}, []);
|
|
584
|
-
|
|
585
|
-
(
|
|
586
|
-
}, [
|
|
587
|
-
|
|
588
|
-
}, [
|
|
589
|
-
|
|
590
|
-
}, [
|
|
591
|
-
_ &&
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
596
|
+
k(() => {
|
|
597
|
+
(z > 0 || o > 0) && c();
|
|
598
|
+
}, [z, o, c]), k(() => {
|
|
599
|
+
Y.current = w;
|
|
600
|
+
}, [w]), k(() => {
|
|
601
|
+
e.current = l;
|
|
602
|
+
}, [l]), k(() => {
|
|
603
|
+
_ && m(
|
|
604
|
+
t,
|
|
605
|
+
"set-context",
|
|
606
|
+
{
|
|
607
|
+
context: {
|
|
608
|
+
...I
|
|
609
|
+
}
|
|
610
|
+
},
|
|
611
|
+
E
|
|
612
|
+
);
|
|
613
|
+
}, [I, t, _, E]), k(() => {
|
|
614
|
+
_ && m(t, "set-params", { params: v }, E);
|
|
615
|
+
}, [v, t, _, E]), k(() => {
|
|
616
|
+
i !== void 0 && Q((i == null ? void 0 : i.indexOf("/")) === 0 ? i : `/${i}`);
|
|
617
|
+
}, [i]), k(() => {
|
|
618
|
+
L === void 0 || !_ || m(t, "navigate", { path: L }, E);
|
|
619
|
+
}, [L, _, t, m, E]), k(() => {
|
|
620
|
+
if (!s || !t || !y)
|
|
604
621
|
return;
|
|
605
622
|
if (!C) {
|
|
606
|
-
|
|
623
|
+
c(), Z(void 0);
|
|
607
624
|
return;
|
|
608
625
|
}
|
|
609
|
-
|
|
610
|
-
const
|
|
611
|
-
return
|
|
612
|
-
|
|
626
|
+
c();
|
|
627
|
+
const d = new URL(s);
|
|
628
|
+
return g(t, d.origin, y), e.current(), Z(_e(d.origin, t)), () => {
|
|
629
|
+
h(t);
|
|
613
630
|
};
|
|
614
|
-
}, [
|
|
615
|
-
if (!(!
|
|
616
|
-
return
|
|
617
|
-
|
|
618
|
-
}, Te), () => clearTimeout(
|
|
619
|
-
}, [
|
|
620
|
-
const
|
|
621
|
-
|
|
631
|
+
}, [s, t, C, g, y, c]), k(() => {
|
|
632
|
+
if (!(!x || n.current))
|
|
633
|
+
return H.current = setTimeout(() => {
|
|
634
|
+
q(!0), Y.current && Y.current();
|
|
635
|
+
}, Te), () => clearTimeout(H.current);
|
|
636
|
+
}, [x, s, z, o]);
|
|
637
|
+
const p = b(() => {
|
|
638
|
+
n.current = !0, clearTimeout(H.current), q(!1);
|
|
622
639
|
}, []);
|
|
623
|
-
X(
|
|
624
|
-
|
|
625
|
-
}), X(
|
|
626
|
-
|
|
627
|
-
}),
|
|
628
|
-
if (!
|
|
640
|
+
if (X(t, "init", (d) => {
|
|
641
|
+
p(), Array.isArray(d == null ? void 0 : d.acceptsCredentials) && f(d.acceptsCredentials);
|
|
642
|
+
}), X(t, "authorize", p), X(t, "login", p), X(t, "credential-request", () => {
|
|
643
|
+
p(), B(!0);
|
|
644
|
+
}), k(() => {
|
|
645
|
+
if (!F || !M)
|
|
629
646
|
return;
|
|
630
|
-
const
|
|
631
|
-
if (Array.isArray(
|
|
647
|
+
const d = u;
|
|
648
|
+
if (Array.isArray(d) && !d.includes(M.kind))
|
|
632
649
|
return;
|
|
633
|
-
const
|
|
634
|
-
|
|
635
|
-
}, [
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
650
|
+
const S = M.kind === "access_token" ? { accessToken: M.accessToken } : {};
|
|
651
|
+
m(t, "credential", { ...S, credential: M }, E);
|
|
652
|
+
}, [
|
|
653
|
+
F,
|
|
654
|
+
M,
|
|
655
|
+
u,
|
|
656
|
+
t,
|
|
657
|
+
m,
|
|
658
|
+
E
|
|
659
|
+
]), X(t, "ready", () => {
|
|
660
|
+
p(), $((d) => d + 1);
|
|
661
|
+
}), X(t, "heartbeat", () => {
|
|
662
|
+
r.current && clearTimeout(r.current), r.current = setTimeout(() => {
|
|
663
|
+
a((d) => d + 1);
|
|
642
664
|
}, 6e3);
|
|
643
|
-
}),
|
|
644
|
-
|
|
645
|
-
}, []),
|
|
665
|
+
}), k(() => () => {
|
|
666
|
+
r.current && clearTimeout(r.current);
|
|
667
|
+
}, []), W)
|
|
668
|
+
return D ? D(W) : /* @__PURE__ */ P.createElement(le, { entry: W });
|
|
669
|
+
if (A && !_)
|
|
670
|
+
return j ? j() : /* @__PURE__ */ P.createElement(Ae, null);
|
|
671
|
+
const O = { ...K };
|
|
672
|
+
return delete O.skipManifestCheck, /* @__PURE__ */ P.createElement(
|
|
646
673
|
Me,
|
|
647
674
|
{
|
|
648
|
-
key: `auth-epoch-${
|
|
675
|
+
key: `auth-epoch-${z}-frame-${o}`,
|
|
649
676
|
$isReady: _,
|
|
650
|
-
ref:
|
|
651
|
-
src:
|
|
652
|
-
...
|
|
677
|
+
ref: y,
|
|
678
|
+
src: x,
|
|
679
|
+
...O
|
|
653
680
|
}
|
|
654
681
|
);
|
|
655
682
|
};
|
|
656
683
|
Ue.propTypes = {
|
|
657
|
-
id:
|
|
658
|
-
src:
|
|
659
|
-
path:
|
|
660
|
-
onInit:
|
|
661
|
-
onTimeout:
|
|
684
|
+
id: T.string,
|
|
685
|
+
src: T.string.isRequired,
|
|
686
|
+
path: T.string,
|
|
687
|
+
onInit: T.func,
|
|
688
|
+
onTimeout: T.func,
|
|
662
689
|
/**
|
|
663
690
|
* Optional host-styled renderer for the structurally-unsupported embed
|
|
664
691
|
* state (legacy app on a cross-site origin), `(entry) => ReactNode`. Falls
|
|
665
692
|
* back to a minimal built-in placeholder.
|
|
666
693
|
*/
|
|
667
|
-
renderUnsupported:
|
|
694
|
+
renderUnsupported: T.func,
|
|
668
695
|
/**
|
|
669
696
|
* Optional host-styled renderer for the handshake-timeout failure state
|
|
670
697
|
* (the app is not embeddable / could not load), `() => ReactNode`. Falls
|
|
671
698
|
* back to a minimal centered message.
|
|
672
699
|
*/
|
|
673
|
-
renderTimeout:
|
|
700
|
+
renderTimeout: T.func
|
|
674
701
|
};
|
|
675
702
|
export {
|
|
676
703
|
pe as CREDENTIAL_KIND_ACCESS_TOKEN,
|
|
677
|
-
|
|
704
|
+
V as EmbeddedAuthorizationContext,
|
|
678
705
|
Ue as MMEmbeddableZone,
|
|
679
706
|
ee as MMEmbeddableZoneContext,
|
|
680
|
-
|
|
707
|
+
we as MMEmbeddableZoneProvider,
|
|
681
708
|
ce as isCrossSite,
|
|
682
709
|
ne as normalizeCredential,
|
|
683
710
|
be as popupAuthorizationLauncher,
|
|
684
|
-
|
|
685
|
-
|
|
711
|
+
ye as unsupportedCopy,
|
|
712
|
+
$e as useEmbeddedAuthorizations,
|
|
686
713
|
Re as useEmbeddedCredential,
|
|
687
714
|
X as useEmbeddedEffect,
|
|
688
715
|
Ee as useEmbeddedOriginEpoch,
|
|
689
|
-
|
|
716
|
+
ke as useEmbeddedUnsupported
|
|
690
717
|
};
|