@machinemetrics/mm-react-embeddable 2.0.2 → 2.0.3-1

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