@module-federation/bridge-vue3 2.4.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.cjs +7 -7
  2. package/dist/index.js +1834 -1329
  3. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -1,99 +1,99 @@
1
- import * as Ft from "vue";
2
- import { defineComponent as Ht, ref as ge, useAttrs as Gt, watch as xt, onMounted as Ut, onBeforeUnmount as Bt, createVNode as Vt, mergeProps as Wt, defineAsyncComponent as jt, h as qt } from "vue";
3
- import * as ie from "vue-router";
4
- import { useRoute as Ke } from "vue-router";
5
- const Kt = ".json", zt = "FEDERATION_DEBUG", Jt = ":";
6
- let we = /* @__PURE__ */ function(e) {
1
+ import * as jt from "vue";
2
+ import { defineComponent as qt, ref as _e, useAttrs as Kt, watch as zt, onMounted as Jt, onBeforeUnmount as Xt, createVNode as Yt, mergeProps as Zt, defineAsyncComponent as Qt, h as er } from "vue";
3
+ import * as le from "vue-router";
4
+ import { useRoute as Ze } from "vue-router";
5
+ const tr = ".json", rr = "FEDERATION_DEBUG", or = ":";
6
+ let Ne = /* @__PURE__ */ function(e) {
7
7
  return e[e.UNKNOWN = 1] = "UNKNOWN", e[e.CALCULATED = 2] = "CALCULATED", e[e.NO_USE = 0] = "NO_USE", e;
8
8
  }({});
9
- const F = typeof ENV_TARGET < "u" ? ENV_TARGET === "web" : typeof window < "u" && typeof window.document < "u";
10
- function ze() {
11
- return F;
9
+ const D = typeof ENV_TARGET < "u" ? ENV_TARGET === "web" : typeof window < "u" && typeof window.document < "u";
10
+ function Qe() {
11
+ return D;
12
12
  }
13
- function Je() {
13
+ function et() {
14
14
  return typeof navigator < "u" && (navigator == null ? void 0 : navigator.product) === "ReactNative";
15
15
  }
16
- function Xt() {
16
+ function nr() {
17
17
  try {
18
- if (ze() && window.localStorage) return !!localStorage.getItem(zt);
18
+ if (Qe() && window.localStorage) return !!localStorage.getItem(rr);
19
19
  } catch {
20
20
  return !1;
21
21
  }
22
22
  return !1;
23
23
  }
24
- function Ne() {
25
- return typeof process < "u" && process.env && process.env.FEDERATION_DEBUG ? !!process.env.FEDERATION_DEBUG : typeof FEDERATION_DEBUG < "u" && FEDERATION_DEBUG ? !0 : Xt();
24
+ function Te() {
25
+ return typeof process < "u" && process.env && process.env.FEDERATION_DEBUG ? !!process.env.FEDERATION_DEBUG : typeof FEDERATION_DEBUG < "u" && FEDERATION_DEBUG ? !0 : nr();
26
26
  }
27
- const Yt = "[ Federation Runtime ]", Xe = function(...e) {
28
- return e.length ? e.reduce((t, r) => r ? t ? `${t}${Jt}${r}` : r : t, "") : "";
29
- }, Te = (e, t) => {
27
+ const sr = "[ Federation Runtime ]", tt = function(...e) {
28
+ return e.length ? e.reduce((t, r) => r ? t ? `${t}${or}${r}` : r : t, "") : "";
29
+ }, ve = (e, t) => {
30
30
  if ("getPublicPath" in e) {
31
31
  let r;
32
32
  return e.getPublicPath.startsWith("function") ? r = new Function("return " + e.getPublicPath)()() : r = new Function(e.getPublicPath)(), `${r}${t}`;
33
- } else return "publicPath" in e ? !ze() && !Je() && "ssrPublicPath" in e && typeof e.ssrPublicPath == "string" ? `${e.ssrPublicPath}${t}` : `${e.publicPath}${t}` : (console.warn("Cannot get resource URL. If in debug mode, please ignore.", e, t), "");
34
- }, Ye = (e) => {
35
- console.warn(`${Yt}: ${e}`);
33
+ } else return "publicPath" in e ? !Qe() && !et() && "ssrPublicPath" in e && typeof e.ssrPublicPath == "string" ? `${e.ssrPublicPath}${t}` : `${e.publicPath}${t}` : (console.warn("Cannot get resource URL. If in debug mode, please ignore.", e, t), "");
34
+ }, rt = (e) => {
35
+ console.warn(`${sr}: ${e}`);
36
36
  };
37
- function Ze(e) {
37
+ function ot(e) {
38
38
  try {
39
39
  return JSON.stringify(e, null, 2);
40
40
  } catch {
41
41
  return "";
42
42
  }
43
43
  }
44
- const Ee = (e, t) => {
44
+ const Re = (e, t) => {
45
45
  if (!e) return t;
46
- const n = ((o) => {
47
- if (o === ".") return "";
48
- if (o.startsWith("./")) return o.replace("./", "");
49
- if (o.startsWith("/")) {
50
- const s = o.slice(1);
46
+ const o = ((n) => {
47
+ if (n === ".") return "";
48
+ if (n.startsWith("./")) return n.replace("./", "");
49
+ if (n.startsWith("/")) {
50
+ const s = n.slice(1);
51
51
  return s.endsWith("/") ? s.slice(0, -1) : s;
52
52
  }
53
- return o;
53
+ return n;
54
54
  })(e);
55
- return n ? n.endsWith("/") ? `${n}${t}` : `${n}/${t}` : t;
55
+ return o ? o.endsWith("/") ? `${o}${t}` : `${o}/${t}` : t;
56
56
  };
57
- function Zt(e) {
57
+ function ir(e) {
58
58
  return e.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
59
59
  }
60
- function Qt(e, t = {}) {
60
+ function ar(e, t = {}) {
61
61
  var _;
62
- const { remotes: r = {}, overrides: n = {}, version: o } = t;
62
+ const { remotes: r = {}, overrides: o = {}, version: n } = t;
63
63
  let s;
64
- const i = () => "publicPath" in e.metaData ? (e.metaData.publicPath === "auto" || e.metaData.publicPath === "") && o ? Zt(o) : e.metaData.publicPath : e.metaData.getPublicPath, a = Object.keys(n);
65
- let l = {};
66
- Object.keys(r).length || (l = ((_ = e.remotes) == null ? void 0 : _.reduce((y, b) => {
67
- let S;
68
- const $ = b.federationContainerName;
69
- return a.includes($) ? S = n[$] : "version" in b ? S = b.version : S = b.entry, y[$] = { matchedVersion: S }, y;
70
- }, {})) || {}), Object.keys(r).forEach((y) => l[y] = { matchedVersion: a.includes(y) ? n[y] : r[y] });
71
- const { remoteEntry: { path: c, name: u, type: d }, types: h = {
64
+ const i = () => "publicPath" in e.metaData ? (e.metaData.publicPath === "auto" || e.metaData.publicPath === "") && n ? ir(n) : e.metaData.publicPath : e.metaData.getPublicPath, c = Object.keys(o);
65
+ let a = {};
66
+ Object.keys(r).length || (a = ((_ = e.remotes) == null ? void 0 : _.reduce((g, R) => {
67
+ let w;
68
+ const $ = R.federationContainerName;
69
+ return c.includes($) ? w = o[$] : "version" in R ? w = R.version : w = R.entry, g[$] = { matchedVersion: w }, g;
70
+ }, {})) || {}), Object.keys(r).forEach((g) => a[g] = { matchedVersion: c.includes(g) ? o[g] : r[g] });
71
+ const { remoteEntry: { path: l, name: u, type: f }, types: d = {
72
72
  path: "",
73
73
  name: "",
74
74
  zip: "",
75
75
  api: ""
76
- }, buildInfo: { buildVersion: f }, globalName: p, ssrRemoteEntry: m } = e.metaData, { exposes: g } = e;
76
+ }, buildInfo: { buildVersion: h }, globalName: m, ssrRemoteEntry: p } = e.metaData, { exposes: y } = e;
77
77
  let E = {
78
- version: o || "",
79
- buildVersion: f,
80
- globalName: p,
81
- remoteEntry: Ee(c, u),
82
- remoteEntryType: d,
83
- remoteTypes: Ee(h.path, h.name),
84
- remoteTypesZip: h.zip || "",
85
- remoteTypesAPI: h.api || "",
86
- remotesInfo: l,
87
- shared: e == null ? void 0 : e.shared.map((y) => ({
88
- assets: y.assets,
89
- sharedName: y.name,
90
- version: y.version,
91
- usedExports: y.referenceExports || []
78
+ version: n || "",
79
+ buildVersion: h,
80
+ globalName: m,
81
+ remoteEntry: Re(l, u),
82
+ remoteEntryType: f,
83
+ remoteTypes: Re(d.path, d.name),
84
+ remoteTypesZip: d.zip || "",
85
+ remoteTypesAPI: d.api || "",
86
+ remotesInfo: a,
87
+ shared: e == null ? void 0 : e.shared.map((g) => ({
88
+ assets: g.assets,
89
+ sharedName: g.name,
90
+ version: g.version,
91
+ usedExports: g.referenceExports || []
92
92
  })),
93
- modules: g == null ? void 0 : g.map((y) => ({
94
- moduleName: y.name,
95
- modulePath: y.path,
96
- assets: y.assets
93
+ modules: y == null ? void 0 : y.map((g) => ({
94
+ moduleName: g.name,
95
+ modulePath: g.path,
96
+ assets: g.assets
97
97
  }))
98
98
  };
99
99
  if ("publicPath" in e.metaData ? (s = {
@@ -102,16 +102,16 @@ function Qt(e, t = {}) {
102
102
  }, typeof e.metaData.ssrPublicPath == "string" && (s.ssrPublicPath = e.metaData.ssrPublicPath)) : s = {
103
103
  ...E,
104
104
  getPublicPath: i()
105
- }, m) {
106
- const y = Ee(m.path, m.name);
107
- s.ssrRemoteEntry = y, s.ssrRemoteEntryType = m.type || "commonjs-module";
105
+ }, p) {
106
+ const g = Re(p.path, p.name);
107
+ s.ssrRemoteEntry = g, s.ssrRemoteEntryType = p.type || "commonjs-module";
108
108
  }
109
109
  return s;
110
110
  }
111
- function Qe(e) {
112
- return !!("remoteEntry" in e && e.remoteEntry.includes(Kt));
111
+ function nt(e) {
112
+ return !!("remoteEntry" in e && e.remoteEntry.includes(tr));
113
113
  }
114
- const er = "[ Module Federation ]", J = console, tr = [
114
+ const cr = "[ Module Federation ]", Y = console, lr = [
115
115
  "logger.ts",
116
116
  "logger.js",
117
117
  "captureStackTrace",
@@ -122,12 +122,12 @@ const er = "[ Module Federation ]", J = console, tr = [
122
122
  "Logger.error",
123
123
  "Logger.debug"
124
124
  ];
125
- function rr() {
125
+ function ur() {
126
126
  try {
127
127
  const e = (/* @__PURE__ */ new Error()).stack;
128
128
  if (!e) return;
129
129
  const [, ...t] = e.split(`
130
- `), r = t.filter((n) => !tr.some((o) => n.includes(o)));
130
+ `), r = t.filter((o) => !lr.some((n) => o.includes(n)));
131
131
  return r.length ? `Stack trace:
132
132
  ${r.slice(0, 5).join(`
133
133
  `)}` : void 0;
@@ -135,18 +135,18 @@ ${r.slice(0, 5).join(`
135
135
  return;
136
136
  }
137
137
  }
138
- var et = class {
139
- constructor(e, t = J) {
140
- this.prefix = e, this.delegate = t ?? J;
138
+ var st = class {
139
+ constructor(e, t = Y) {
140
+ this.prefix = e, this.delegate = t ?? Y;
141
141
  }
142
142
  setPrefix(e) {
143
143
  this.prefix = e;
144
144
  }
145
145
  setDelegate(e) {
146
- this.delegate = e ?? J;
146
+ this.delegate = e ?? Y;
147
147
  }
148
148
  emit(e, t) {
149
- const r = this.delegate, n = Ne() ? rr() : void 0, o = n ? [...t, n] : t, s = (() => {
149
+ const r = this.delegate, o = Te() ? ur() : void 0, n = o ? [...t, o] : t, s = (() => {
150
150
  switch (e) {
151
151
  case "log":
152
152
  return ["log", "info"];
@@ -169,16 +169,16 @@ var et = class {
169
169
  }
170
170
  })();
171
171
  for (const i of s) {
172
- const a = r[i];
173
- if (typeof a == "function") {
174
- a.call(r, this.prefix, ...o);
172
+ const c = r[i];
173
+ if (typeof c == "function") {
174
+ c.call(r, this.prefix, ...n);
175
175
  return;
176
176
  }
177
177
  }
178
178
  for (const i of s) {
179
- const a = J[i];
180
- if (typeof a == "function") {
181
- a.call(J, this.prefix, ...o);
179
+ const c = Y[i];
180
+ if (typeof c == "function") {
181
+ c.call(Y, this.prefix, ...n);
182
182
  return;
183
183
  }
184
184
  }
@@ -202,283 +202,299 @@ var et = class {
202
202
  this.emit("info", e);
203
203
  }
204
204
  debug(...e) {
205
- Ne() && this.emit("debug", e);
205
+ Te() && this.emit("debug", e);
206
206
  }
207
207
  };
208
- function tt(e) {
209
- return new et(e);
208
+ function it(e) {
209
+ return new st(e);
210
210
  }
211
- function nr(e) {
212
- const t = new et(e);
211
+ function fr(e) {
212
+ const t = new st(e);
213
213
  return Object.defineProperty(t, "__mf_infrastructure_logger__", {
214
214
  value: !0,
215
215
  enumerable: !1,
216
216
  configurable: !1
217
217
  }), t;
218
218
  }
219
- nr(er);
220
- async function rt(e, t) {
219
+ fr(cr);
220
+ async function at(e, t) {
221
221
  try {
222
222
  return await e();
223
223
  } catch (r) {
224
- Ye(r);
224
+ rt(r);
225
225
  return;
226
226
  }
227
227
  }
228
- function Ie(e, t) {
228
+ function Ae(e, t) {
229
229
  const r = /^(https?:)?\/\//i;
230
230
  return e.replace(r, "").replace(/\/$/, "") === t.replace(r, "").replace(/\/$/, "");
231
231
  }
232
- function nt(e) {
233
- let t = null, r = !0, n = 2e4, o;
232
+ function ct(e) {
233
+ let t = null, r = !0, o = 2e4, n;
234
234
  const s = document.getElementsByTagName("script");
235
- for (let c = 0; c < s.length; c++) {
236
- const u = s[c], d = u.getAttribute("src");
237
- if (d && Ie(d, e.url)) {
235
+ for (let l = 0; l < s.length; l++) {
236
+ const u = s[l], f = u.getAttribute("src");
237
+ if (f && Ae(f, e.url)) {
238
238
  t = u, r = !1;
239
239
  break;
240
240
  }
241
241
  }
242
242
  if (!t) {
243
- const c = e.attrs;
244
- t = document.createElement("script"), t.type = (c == null ? void 0 : c.type) === "module" ? "module" : "text/javascript";
243
+ const l = e.attrs;
244
+ t = document.createElement("script"), t.type = (l == null ? void 0 : l.type) === "module" ? "module" : "text/javascript";
245
245
  let u;
246
- e.createScriptHook && (u = e.createScriptHook(e.url, e.attrs), u instanceof HTMLScriptElement ? t = u : typeof u == "object" && ("script" in u && u.script && (t = u.script), "timeout" in u && u.timeout && (n = u.timeout))), t.src || (t.src = e.url), c && !u && Object.keys(c).forEach((d) => {
247
- t && (d === "async" || d === "defer" ? t[d] = c[d] : t.getAttribute(d) || t.setAttribute(d, c[d]));
246
+ e.createScriptHook && (u = e.createScriptHook(e.url, e.attrs), u instanceof HTMLScriptElement ? t = u : typeof u == "object" && ("script" in u && u.script && (t = u.script), "timeout" in u && u.timeout && (o = u.timeout))), t.src || (t.src = e.url), l && !u && Object.keys(l).forEach((f) => {
247
+ t && (f === "async" || f === "defer" ? t[f] = l[f] : t.getAttribute(f) || t.setAttribute(f, l[f]));
248
248
  });
249
249
  }
250
250
  let i = null;
251
- const a = typeof window < "u" ? (c) => {
252
- if (c.filename && Ie(c.filename, e.url)) {
253
- const u = /* @__PURE__ */ new Error(`ScriptExecutionError: Script "${e.url}" loaded but threw a runtime error during execution: ${c.message} (${c.filename}:${c.lineno}:${c.colno})`);
251
+ const c = typeof window < "u" ? (l) => {
252
+ if (l.filename && Ae(l.filename, e.url)) {
253
+ const u = /* @__PURE__ */ new Error(`ScriptExecutionError: Script "${e.url}" loaded but threw a runtime error during execution: ${l.message} (${l.filename}:${l.lineno}:${l.colno})`);
254
254
  u.name = "ScriptExecutionError", i = u;
255
255
  }
256
256
  } : null;
257
- a && window.addEventListener("error", a);
258
- const l = async (c, u) => {
259
- clearTimeout(o), a && window.removeEventListener("error", a);
260
- const d = () => {
257
+ c && window.addEventListener("error", c);
258
+ const a = async (l, u) => {
259
+ clearTimeout(n), c && window.removeEventListener("error", c);
260
+ const f = () => {
261
261
  if ((u == null ? void 0 : u.type) === "error") {
262
- const h = /* @__PURE__ */ new Error(u != null && u.isTimeout ? `ScriptNetworkError: Script "${e.url}" timed out.` : `ScriptNetworkError: Failed to load script "${e.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);
263
- h.name = "ScriptNetworkError", e != null && e.onErrorCallback && (e == null || e.onErrorCallback(h));
262
+ const d = /* @__PURE__ */ new Error(u != null && u.isTimeout ? `ScriptNetworkError: Script "${e.url}" timed out.` : `ScriptNetworkError: Failed to load script "${e.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);
263
+ d.name = "ScriptNetworkError", e != null && e.onErrorCallback && (e == null || e.onErrorCallback(d));
264
264
  } else i ? e != null && e.onErrorCallback && (e == null || e.onErrorCallback(i)) : e != null && e.cb && (e == null || e.cb());
265
265
  };
266
- if (t && (t.onerror = null, t.onload = null, rt(() => {
267
- const { needDeleteScript: h = !0 } = e;
268
- h && t != null && t.parentNode && t.parentNode.removeChild(t);
269
- }), c && typeof c == "function")) {
270
- const h = c(u);
271
- if (h instanceof Promise) {
272
- const f = await h;
273
- return d(), f;
266
+ if (t && (t.onerror = null, t.onload = null, at(() => {
267
+ const { needDeleteScript: d = !0 } = e;
268
+ d && t != null && t.parentNode && t.parentNode.removeChild(t);
269
+ }), l && typeof l == "function")) {
270
+ const d = l(u);
271
+ if (d instanceof Promise) {
272
+ const h = await d;
273
+ return f(), h;
274
274
  }
275
- return d(), h;
275
+ return f(), d;
276
276
  }
277
- d();
277
+ f();
278
278
  };
279
- return t.onerror = l.bind(null, t.onerror), t.onload = l.bind(null, t.onload), o = setTimeout(() => {
280
- l(null, {
279
+ return t.onerror = a.bind(null, t.onerror), t.onload = a.bind(null, t.onload), n = setTimeout(() => {
280
+ a(null, {
281
281
  type: "error",
282
282
  isTimeout: !0
283
283
  });
284
- }, n), {
284
+ }, o), {
285
285
  script: t,
286
286
  needAttach: r
287
287
  };
288
288
  }
289
- function _e(e) {
290
- let t = null, r = !0;
291
- const n = document.getElementsByTagName("link");
292
- for (let s = 0; s < n.length; s++) {
293
- const i = n[s], a = i.getAttribute("href"), l = i.getAttribute("rel");
294
- if (a && Ie(a, e.url) && l === e.attrs.rel) {
295
- t = i, r = !1;
289
+ function hr(e) {
290
+ let t = null, r = !0, o = 2e4, n;
291
+ const s = document.getElementsByTagName("link");
292
+ for (let c = 0; c < s.length; c++) {
293
+ const a = s[c], l = a.getAttribute("href"), u = a.getAttribute("rel");
294
+ if (l && Ae(l, e.url) && u === e.attrs.rel) {
295
+ t = a, r = !1;
296
296
  break;
297
297
  }
298
298
  }
299
299
  if (!t) {
300
300
  t = document.createElement("link"), t.setAttribute("href", e.url);
301
- let s;
302
- const i = e.attrs;
303
- e.createLinkHook && (s = e.createLinkHook(e.url, i), s instanceof HTMLLinkElement && (t = s)), i && !s && Object.keys(i).forEach((a) => {
304
- t && !t.getAttribute(a) && t.setAttribute(a, i[a]);
301
+ let c, a = !0;
302
+ const l = e.attrs;
303
+ e.createLinkHook && (c = e.createLinkHook(e.url, l), c instanceof HTMLLinkElement ? (t = c, a = !1) : typeof c == "object" && ("link" in c && c.link && (t = c.link, a = !1), "timeout" in c && c.timeout && (o = c.timeout))), l && a && Object.keys(l).forEach((u) => {
304
+ t && !t.getAttribute(u) && t.setAttribute(u, l[u]);
305
305
  });
306
306
  }
307
- const o = (s, i) => {
308
- const a = () => {
309
- (i == null ? void 0 : i.type) === "error" ? e != null && e.onErrorCallback && (e == null || e.onErrorCallback(i)) : e != null && e.cb && (e == null || e.cb());
307
+ if (!r)
308
+ return Promise.resolve().then(() => {
309
+ e != null && e.cb && (e == null || e.cb());
310
+ }), {
311
+ link: t,
312
+ needAttach: r
313
+ };
314
+ const i = (c, a) => {
315
+ n && clearTimeout(n);
316
+ const l = () => {
317
+ if ((a == null ? void 0 : a.type) === "error") {
318
+ const u = /* @__PURE__ */ new Error(a != null && a.isTimeout ? `LinkNetworkError: Link "${e.url}" timed out.` : `LinkNetworkError: Failed to load link "${e.url}" - the URL is unreachable or the server returned an error.`);
319
+ u.name = "LinkNetworkError", e != null && e.onErrorCallback && (e == null || e.onErrorCallback(u));
320
+ } else e != null && e.cb && (e == null || e.cb());
310
321
  };
311
- if (t && (t.onerror = null, t.onload = null, rt(() => {
312
- const { needDeleteLink: l = !0 } = e;
313
- l && t != null && t.parentNode && t.parentNode.removeChild(t);
314
- }), s)) {
315
- const l = s(i);
316
- return a(), l;
322
+ if (t && (t.onerror = null, t.onload = null, at(() => {
323
+ const { needDeleteLink: u = !0 } = e;
324
+ u && t != null && t.parentNode && t.parentNode.removeChild(t);
325
+ }), c)) {
326
+ const u = c(a);
327
+ return l(), u;
317
328
  }
318
- a();
329
+ l();
319
330
  };
320
- return t.onerror = o.bind(null, t.onerror), t.onload = o.bind(null, t.onload), {
331
+ return t.onerror = i.bind(null, t.onerror), t.onload = i.bind(null, t.onload), n = setTimeout(() => {
332
+ i(null, {
333
+ type: "error",
334
+ isTimeout: !0
335
+ });
336
+ }, o), {
321
337
  link: t,
322
338
  needAttach: r
323
339
  };
324
340
  }
325
- function or(e, t) {
326
- const { attrs: r = {}, createScriptHook: n } = t;
327
- return new Promise((o, s) => {
328
- const { script: i, needAttach: a } = nt({
341
+ function dr(e, t) {
342
+ const { attrs: r = {}, createScriptHook: o } = t;
343
+ return new Promise((n, s) => {
344
+ const { script: i, needAttach: c } = ct({
329
345
  url: e,
330
- cb: o,
346
+ cb: n,
331
347
  onErrorCallback: s,
332
348
  attrs: {
333
349
  fetchpriority: "high",
334
350
  ...r
335
351
  },
336
- createScriptHook: n,
352
+ createScriptHook: o,
337
353
  needDeleteScript: !0
338
354
  });
339
- a && document.head.appendChild(i);
355
+ c && document.head.appendChild(i);
340
356
  });
341
357
  }
342
- const ne = /* @__PURE__ */ new Map();
343
- function B(e) {
358
+ const ie = /* @__PURE__ */ new Map();
359
+ function W(e) {
344
360
  if (!e) throw new Error("import specifier is required");
345
- if (ne.has(e)) return ne.get(e);
361
+ if (ie.has(e)) return ie.get(e);
346
362
  const t = new Function("name", "return import(name)")(e).then((r) => r).catch((r) => {
347
- throw console.error(`Error importing module ${e}:`, r), ne.delete(e), r;
363
+ throw console.error(`Error importing module ${e}:`, r), ie.delete(e), r;
348
364
  });
349
- return ne.set(e, t), t;
365
+ return ie.set(e, t), t;
350
366
  }
351
- const ot = async () => {
352
- const e = await B("node-fetch");
367
+ const lt = async () => {
368
+ const e = await W("node-fetch");
353
369
  return e.default || e;
354
- }, sr = async (e, t, r) => {
355
- const o = await ((s, i) => r.lifecycle.fetch.emit(s, i))(e, t || {});
356
- return !o || !(o instanceof Response) ? (typeof fetch > "u" ? await ot() : fetch)(e, t || {}) : o;
357
- }, ir = typeof ENV_TARGET > "u" || ENV_TARGET !== "web" ? (e, t, r, n) => {
358
- if (n != null && n.createScriptHook) {
359
- const a = n.createScriptHook(e);
360
- a && typeof a == "object" && "url" in a && (e = a.url);
361
- }
362
- let o;
370
+ }, mr = async (e, t, r) => {
371
+ const n = await ((s, i) => r.lifecycle.fetch.emit(s, i))(e, t || {});
372
+ return !n || !(n instanceof Response) ? (typeof fetch > "u" ? await lt() : fetch)(e, t || {}) : n;
373
+ }, pr = typeof ENV_TARGET > "u" || ENV_TARGET !== "web" ? (e, t, r, o) => {
374
+ if (o != null && o.createScriptHook) {
375
+ const c = o.createScriptHook(e);
376
+ c && typeof c == "object" && "url" in c && (e = c.url);
377
+ }
378
+ let n;
363
379
  try {
364
- o = new URL(e);
365
- } catch (a) {
366
- console.error("Error constructing URL:", a), t(/* @__PURE__ */ new Error(`Invalid URL: ${a}`));
380
+ n = new URL(e);
381
+ } catch (c) {
382
+ console.error("Error constructing URL:", c), t(/* @__PURE__ */ new Error(`Invalid URL: ${c}`));
367
383
  return;
368
384
  }
369
- const s = async () => n != null && n.fetch ? (a, l) => sr(a, l, n) : typeof fetch > "u" ? ot() : fetch, i = async (a, l) => {
370
- var c;
385
+ const s = async () => o != null && o.fetch ? (c, a) => mr(c, a, o) : typeof fetch > "u" ? lt() : fetch, i = async (c, a) => {
386
+ var l;
371
387
  try {
372
- const d = await (await a(l.href)).text(), [h, f] = await Promise.all([B("path"), B("vm")]), p = {
388
+ const f = await (await c(a.href)).text(), [d, h] = await Promise.all([W("path"), W("vm")]), m = {
373
389
  exports: {},
374
390
  module: { exports: {} }
375
- }, m = l.pathname.split("/").slice(0, -1).join("/"), g = h.basename(l.pathname), E = new f.Script(`(function(exports, module, require, __dirname, __filename) {${d}
391
+ }, p = a.pathname.split("/").slice(0, -1).join("/"), y = d.basename(a.pathname), E = new h.Script(`(function(exports, module, require, __dirname, __filename) {${f}
376
392
  })`, {
377
- filename: g,
378
- importModuleDynamically: ((c = f.constants) == null ? void 0 : c.USE_MAIN_CONTEXT_DEFAULT_LOADER) ?? B
393
+ filename: y,
394
+ importModuleDynamically: ((l = h.constants) == null ? void 0 : l.USE_MAIN_CONTEXT_DEFAULT_LOADER) ?? W
379
395
  });
380
396
  let _;
381
- _ = (await B("node:module")).createRequire(l.protocol === "file:" || l.protocol === "node:" ? l.href : h.join(process.cwd(), "__mf_require_base__.js")), E.runInThisContext()(p.exports, p.module, _, m, g);
382
- const y = p.module.exports || p.exports;
383
- if (r && y && r.globalName) {
384
- t(void 0, y[r.globalName] || y);
397
+ _ = (await W("node:module")).createRequire(a.protocol === "file:" || a.protocol === "node:" ? a.href : d.join(process.cwd(), "__mf_require_base__.js")), E.runInThisContext()(m.exports, m.module, _, p, y);
398
+ const g = m.module.exports || m.exports;
399
+ if (r && g && r.globalName) {
400
+ t(void 0, g[r.globalName] || g);
385
401
  return;
386
402
  }
387
- t(void 0, y);
403
+ t(void 0, g);
388
404
  } catch (u) {
389
405
  t(u instanceof Error ? u : /* @__PURE__ */ new Error(`Script execution error: ${u}`));
390
406
  }
391
407
  };
392
- s().then(async (a) => {
393
- if ((r == null ? void 0 : r.type) === "esm" || (r == null ? void 0 : r.type) === "module") return ve(o.href, {
394
- fetch: a,
395
- vm: await B("vm")
396
- }).then(async (l) => {
397
- await l.evaluate(), t(void 0, l.namespace);
398
- }).catch((l) => {
399
- t(l instanceof Error ? l : /* @__PURE__ */ new Error(`Script execution error: ${l}`));
408
+ s().then(async (c) => {
409
+ if ((r == null ? void 0 : r.type) === "esm" || (r == null ? void 0 : r.type) === "module") return ke(n.href, {
410
+ fetch: c,
411
+ vm: await W("vm")
412
+ }).then(async (a) => {
413
+ await a.evaluate(), t(void 0, a.namespace);
414
+ }).catch((a) => {
415
+ t(a instanceof Error ? a : /* @__PURE__ */ new Error(`Script execution error: ${a}`));
400
416
  });
401
- i(a, o);
402
- }).catch((a) => {
403
- t(a);
417
+ i(c, n);
418
+ }).catch((c) => {
419
+ t(c);
404
420
  });
405
- } : (e, t, r, n) => {
421
+ } : (e, t, r, o) => {
406
422
  t(/* @__PURE__ */ new Error("createScriptNode is disabled in non-Node.js environment"));
407
- }, ar = typeof ENV_TARGET > "u" || ENV_TARGET !== "web" ? (e, t) => new Promise((r, n) => {
408
- ir(e, (o, s) => {
409
- var i, a;
410
- if (o) n(o);
423
+ }, yr = typeof ENV_TARGET > "u" || ENV_TARGET !== "web" ? (e, t) => new Promise((r, o) => {
424
+ pr(e, (n, s) => {
425
+ var i, c;
426
+ if (n) o(n);
411
427
  else {
412
- const l = ((i = t == null ? void 0 : t.attrs) == null ? void 0 : i.globalName) || `__FEDERATION_${(a = t == null ? void 0 : t.attrs) == null ? void 0 : a.name}:custom__`;
413
- r(globalThis[l] = s);
428
+ const a = ((i = t == null ? void 0 : t.attrs) == null ? void 0 : i.globalName) || `__FEDERATION_${(c = t == null ? void 0 : t.attrs) == null ? void 0 : c.name}:custom__`;
429
+ r(globalThis[a] = s);
414
430
  }
415
431
  }, t.attrs, t.loaderHook);
416
432
  }) : (e, t) => {
417
433
  throw new Error("loadScriptNode is disabled in non-Node.js environment");
418
434
  }, be = /* @__PURE__ */ new Map();
419
- async function ve(e, t) {
435
+ async function ke(e, t) {
420
436
  if (be.has(e)) return be.get(e);
421
- const { fetch: r, vm: n } = t, o = await (await r(e)).text(), s = new n.SourceTextModule(o, { importModuleDynamically: async (i, a) => {
422
- const l = new URL(i, e).href;
423
- return ve(l, t);
437
+ const { fetch: r, vm: o } = t, n = await (await r(e)).text(), s = new o.SourceTextModule(n, { importModuleDynamically: async (i, c) => {
438
+ const a = new URL(i, e).href;
439
+ return ke(a, t);
424
440
  } });
425
441
  return be.set(e, s), await s.link(async (i) => {
426
- const a = new URL(i, e).href;
427
- return await ve(a, t);
442
+ const c = new URL(i, e).href;
443
+ return await ke(c, t);
428
444
  }), s;
429
445
  }
430
- const C = tt("[ Module Federation Bridge Vue3 ]"), cr = (e) => `View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split("-")[0].toLowerCase()}#${e.toLowerCase()}`, st = (e, t, r, n) => {
431
- const o = [`${[t[e]]} #${e}`];
432
- return r && o.push(`args: ${JSON.stringify(r)}`), o.push(cr(e)), n && o.push(`Original Error Message:
433
- ${n}`), o.join(`
446
+ const C = it("[ Module Federation Bridge Vue3 ]"), Er = (e) => `View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split("-")[0].toLowerCase()}#${e.toLowerCase()}`, ut = (e, t, r, o) => {
447
+ const n = [`${[t[e]]} #${e}`];
448
+ return r && n.push(`args: ${JSON.stringify(r)}`), n.push(Er(e)), o && n.push(`Original Error Message:
449
+ ${o}`), n.join(`
434
450
  `);
435
451
  };
436
- function lr(e, t, r, n, o, s) {
437
- return n(st(e, t, r, o));
452
+ function gr(e, t, r, o, n, s) {
453
+ return o(ut(e, t, r, n));
438
454
  }
439
- const H = "[ Federation Runtime ]", Ae = tt(H);
440
- function P(e, t, r, n, o) {
441
- e || R(t);
455
+ const x = "[ Federation Runtime ]", Pe = it(x);
456
+ function O(e, t, r, o, n) {
457
+ e || b(t);
442
458
  }
443
- function R(e, t, r, n, o) {
444
- if (t !== void 0) return lr(e, t, r ?? {}, (i) => {
445
- throw new Error(`${H}: ${i}`);
446
- }, n);
459
+ function b(e, t, r, o, n) {
460
+ if (t !== void 0) return gr(e, t, r ?? {}, (i) => {
461
+ throw new Error(`${x}: ${i}`);
462
+ }, o);
447
463
  const s = e;
448
- throw s instanceof Error ? (s.message.startsWith(H) || (s.message = `${H}: ${s.message}`), s) : new Error(`${H}: ${s}`);
464
+ throw s instanceof Error ? (s.message.startsWith(x) || (s.message = `${x}: ${s.message}`), s) : new Error(`${x}: ${s}`);
449
465
  }
450
- function Oe(e) {
451
- e instanceof Error && (e.message.startsWith(H) || (e.message = `${H}: ${e.message}`)), Ae.warn(e);
466
+ function te(e) {
467
+ e instanceof Error && (e.message.startsWith(x) || (e.message = `${x}: ${e.message}`)), Pe.warn(e);
452
468
  }
453
- function ur(e, t) {
469
+ function _r(e, t) {
454
470
  return e.findIndex((r) => r === t) === -1 && e.push(t), e;
455
471
  }
456
- function Z(e) {
472
+ function ye(e) {
457
473
  return "version" in e && e.version ? `${e.name}:${e.version}` : "entry" in e && e.entry ? `${e.name}:${e.entry}` : `${e.name}`;
458
474
  }
459
- function Le(e) {
475
+ function Oe(e) {
460
476
  return typeof e.entry < "u";
461
477
  }
462
- function it(e) {
478
+ function ft(e) {
463
479
  return !e.entry.includes(".json");
464
480
  }
465
- function Me(e) {
481
+ function Ce(e) {
466
482
  return e && typeof e == "object";
467
483
  }
468
- const fr = Object.prototype.toString;
469
- function hr(e) {
470
- return fr.call(e) === "[object Object]";
484
+ const Rr = Object.prototype.toString;
485
+ function br(e) {
486
+ return Rr.call(e) === "[object Object]";
471
487
  }
472
- function at(e) {
488
+ function ht(e) {
473
489
  return Array.isArray(e) ? e : [e];
474
490
  }
475
- function ct(e) {
491
+ function dt(e) {
476
492
  const t = {
477
493
  url: "",
478
494
  type: "global",
479
495
  globalName: ""
480
496
  };
481
- return F || Je() || !("ssrRemoteEntry" in e) ? "remoteEntry" in e ? {
497
+ return D || et() || !("ssrRemoteEntry" in e) ? "remoteEntry" in e ? {
482
498
  url: e.remoteEntry,
483
499
  type: e.remoteEntryType,
484
500
  globalName: e.globalName
@@ -488,45 +504,45 @@ function ct(e) {
488
504
  globalName: e.globalName
489
505
  } : t;
490
506
  }
491
- const dr = (e, t) => {
507
+ const Sr = (e, t) => {
492
508
  let r;
493
509
  return e.endsWith("/") ? r = e.slice(0, -1) : r = e, t.startsWith(".") && (t = t.slice(1)), r = r + t, r;
494
- }, N = typeof globalThis == "object" ? globalThis : window, k = (() => {
510
+ }, N = typeof globalThis == "object" ? globalThis : window, P = (() => {
495
511
  try {
496
512
  return document.defaultView;
497
513
  } catch {
498
514
  return N;
499
515
  }
500
- })(), Q = k;
501
- function ae(e, t, r) {
516
+ })(), re = P;
517
+ function ue(e, t, r) {
502
518
  Object.defineProperty(e, t, {
503
519
  value: r,
504
520
  configurable: !1,
505
521
  writable: !0
506
522
  });
507
523
  }
508
- function ce(e, t) {
524
+ function fe(e, t) {
509
525
  return Object.hasOwnProperty.call(e, t);
510
526
  }
511
- ce(N, "__GLOBAL_LOADING_REMOTE_ENTRY__") || ae(N, "__GLOBAL_LOADING_REMOTE_ENTRY__", {});
512
- const V = N.__GLOBAL_LOADING_REMOTE_ENTRY__;
513
- function lt(e) {
514
- var t, r, n, o, s, i;
515
- ce(e, "__VMOK__") && !ce(e, "__FEDERATION__") && ae(e, "__FEDERATION__", e.__VMOK__), ce(e, "__FEDERATION__") || (ae(e, "__FEDERATION__", {
527
+ fe(N, "__GLOBAL_LOADING_REMOTE_ENTRY__") || ue(N, "__GLOBAL_LOADING_REMOTE_ENTRY__", {});
528
+ const j = N.__GLOBAL_LOADING_REMOTE_ENTRY__;
529
+ function mt(e) {
530
+ var t, r, o, n, s, i;
531
+ fe(e, "__VMOK__") && !fe(e, "__FEDERATION__") && ue(e, "__FEDERATION__", e.__VMOK__), fe(e, "__FEDERATION__") || (ue(e, "__FEDERATION__", {
516
532
  __GLOBAL_PLUGIN__: [],
517
533
  __INSTANCES__: [],
518
534
  moduleInfo: {},
519
535
  __SHARE__: {},
520
536
  __MANIFEST_LOADING__: {},
521
537
  __PRELOADED_MAP__: /* @__PURE__ */ new Map()
522
- }), ae(e, "__VMOK__", e.__FEDERATION__)), (t = e.__FEDERATION__).__GLOBAL_PLUGIN__ ?? (t.__GLOBAL_PLUGIN__ = []), (r = e.__FEDERATION__).__INSTANCES__ ?? (r.__INSTANCES__ = []), (n = e.__FEDERATION__).moduleInfo ?? (n.moduleInfo = {}), (o = e.__FEDERATION__).__SHARE__ ?? (o.__SHARE__ = {}), (s = e.__FEDERATION__).__MANIFEST_LOADING__ ?? (s.__MANIFEST_LOADING__ = {}), (i = e.__FEDERATION__).__PRELOADED_MAP__ ?? (i.__PRELOADED_MAP__ = /* @__PURE__ */ new Map());
538
+ }), ue(e, "__VMOK__", e.__FEDERATION__)), (t = e.__FEDERATION__).__GLOBAL_PLUGIN__ ?? (t.__GLOBAL_PLUGIN__ = []), (r = e.__FEDERATION__).__INSTANCES__ ?? (r.__INSTANCES__ = []), (o = e.__FEDERATION__).moduleInfo ?? (o.moduleInfo = {}), (n = e.__FEDERATION__).__SHARE__ ?? (n.__SHARE__ = {}), (s = e.__FEDERATION__).__MANIFEST_LOADING__ ?? (s.__MANIFEST_LOADING__ = {}), (i = e.__FEDERATION__).__PRELOADED_MAP__ ?? (i.__PRELOADED_MAP__ = /* @__PURE__ */ new Map());
523
539
  }
524
- lt(N);
525
- lt(k);
526
- function pr(e, t = Ne()) {
527
- t && (N.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = e, N.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "2.4.0");
540
+ mt(N);
541
+ mt(P);
542
+ function wr(e, t = Te()) {
543
+ t && (N.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = e, N.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "2.5.0");
528
544
  }
529
- function q(e, t) {
545
+ function J(e, t) {
530
546
  if (typeof t == "string") {
531
547
  if (e[t]) return {
532
548
  value: e[t],
@@ -534,10 +550,10 @@ function q(e, t) {
534
550
  };
535
551
  {
536
552
  const r = Object.keys(e);
537
- for (const n of r) {
538
- const [o, s] = n.split(":"), i = `${o}:${t}`, a = e[i];
539
- if (a) return {
540
- value: a,
553
+ for (const o of r) {
554
+ const [n, s] = o.split(":"), i = `${n}:${t}`, c = e[i];
555
+ if (c) return {
556
+ value: c,
541
557
  key: i
542
558
  };
543
559
  }
@@ -546,180 +562,180 @@ function q(e, t) {
546
562
  key: t
547
563
  };
548
564
  }
549
- } else R(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`);
565
+ } else b(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`);
550
566
  }
551
- const Ge = () => k.__FEDERATION__.moduleInfo, mr = (e, t) => {
552
- const r = q(t, Z(e)).value;
567
+ const Ve = () => P.__FEDERATION__.moduleInfo, $r = (e, t) => {
568
+ const r = J(t, ye(e)).value;
553
569
  if (r && !r.version && "version" in e && e.version && (r.version = e.version), r) return r;
554
570
  if ("version" in e && e.version) {
555
- const { version: n, ...o } = e, s = Z(o), i = q(k.__FEDERATION__.moduleInfo, s).value;
556
- if ((i == null ? void 0 : i.version) === n) return i;
557
- }
558
- }, le = (e) => mr(e, k.__FEDERATION__.moduleInfo), xe = (e, t) => {
559
- const r = Z(e);
560
- return k.__FEDERATION__.moduleInfo[r] = t, k.__FEDERATION__.moduleInfo;
561
- }, yr = (e) => (k.__FEDERATION__.moduleInfo = {
562
- ...k.__FEDERATION__.moduleInfo,
571
+ const { version: o, ...n } = e, s = ye(n), i = J(P.__FEDERATION__.moduleInfo, s).value;
572
+ if ((i == null ? void 0 : i.version) === o) return i;
573
+ }
574
+ }, he = (e) => $r(e, P.__FEDERATION__.moduleInfo), We = (e, t) => {
575
+ const r = ye(e);
576
+ return P.__FEDERATION__.moduleInfo[r] = t, P.__FEDERATION__.moduleInfo;
577
+ }, Ir = (e) => (P.__FEDERATION__.moduleInfo = {
578
+ ...P.__FEDERATION__.moduleInfo,
563
579
  ...e
564
580
  }, () => {
565
581
  const t = Object.keys(e);
566
- for (const r of t) delete k.__FEDERATION__.moduleInfo[r];
567
- }), Ce = (e, t) => {
582
+ for (const r of t) delete P.__FEDERATION__.moduleInfo[r];
583
+ }), Fe = (e, t) => {
568
584
  const r = t || `__FEDERATION_${e}:custom__`;
569
585
  return {
570
586
  remoteEntryKey: r,
571
587
  entryExports: N[r]
572
588
  };
573
- }, gr = () => k.__FEDERATION__.__GLOBAL_PLUGIN__, Er = (e) => N.__FEDERATION__.__PRELOADED_MAP__.get(e), _r = (e) => N.__FEDERATION__.__PRELOADED_MAP__.set(e, !0), Ue = "[0-9A-Za-z-]+", De = `(?:\\+(${Ue}(?:\\.${Ue})*))`, Y = "0|[1-9]\\d*", ue = "[0-9]+", ut = "\\d*[a-zA-Z-][a-zA-Z0-9-]*", Be = `(?:${ue}|${ut})`, br = `(?:-?(${Be}(?:\\.${Be})*))`, Ve = `(?:${Y}|${ut})`, ft = `(?:-(${Ve}(?:\\.${Ve})*))`, Re = `${Y}|x|X|\\*`, K = `[v=\\s]*(${Re})(?:\\.(${Re})(?:\\.(${Re})(?:${ft})?${De}?)?)?`, Rr = `^\\s*(${K})\\s+-\\s+(${K})\\s*$`, Sr = `[v=\\s]*${`(${ue})\\.(${ue})\\.(${ue})`}${br}?${De}?`, Fe = "((?:<|>)?=?)", $r = `(\\s*)${Fe}\\s*(${Sr}|${K})`, ht = "(?:~>?)", wr = `(\\s*)${ht}\\s+`, dt = "(?:\\^)", Nr = `(\\s*)${dt}\\s+`, Tr = "(<|>)?=?\\s*\\*", Ir = `^${dt}${K}$`, vr = `v?${`(${Y})\\.(${Y})\\.(${Y})`}${ft}?${De}?`, Ar = `^${ht}${K}$`, Pr = `^${Fe}\\s*${K}$`, kr = `^${Fe}\\s*(${vr})$|^$`, Or = "^\\s*>=\\s*0.0.0\\s*$";
589
+ }, Nr = () => P.__FEDERATION__.__GLOBAL_PLUGIN__, Tr = (e) => N.__FEDERATION__.__PRELOADED_MAP__.get(e), vr = (e) => N.__FEDERATION__.__PRELOADED_MAP__.set(e, !0), je = "[0-9A-Za-z-]+", He = `(?:\\+(${je}(?:\\.${je})*))`, ee = "0|[1-9]\\d*", de = "[0-9]+", pt = "\\d*[a-zA-Z-][a-zA-Z0-9-]*", qe = `(?:${de}|${pt})`, Ar = `(?:-?(${qe}(?:\\.${qe})*))`, Ke = `(?:${ee}|${pt})`, yt = `(?:-(${Ke}(?:\\.${Ke})*))`, Se = `${ee}|x|X|\\*`, X = `[v=\\s]*(${Se})(?:\\.(${Se})(?:\\.(${Se})(?:${yt})?${He}?)?)?`, kr = `^\\s*(${X})\\s+-\\s+(${X})\\s*$`, Pr = `[v=\\s]*${`(${de})\\.(${de})\\.(${de})`}${Ar}?${He}?`, De = "((?:<|>)?=?)", Lr = `(\\s*)${De}\\s*(${Pr}|${X})`, Et = "(?:~>?)", Mr = `(\\s*)${Et}\\s+`, gt = "(?:\\^)", Or = `(\\s*)${gt}\\s+`, Cr = "(<|>)?=?\\s*\\*", Fr = `^${gt}${X}$`, Hr = `v?${`(${ee})\\.(${ee})\\.(${ee})`}${yt}?${He}?`, Dr = `^${Et}${X}$`, xr = `^${De}\\s*${X}$`, Gr = `^${De}\\s*(${Hr})$|^$`, Ur = "^\\s*>=\\s*0.0.0\\s*$";
574
590
  function M(e) {
575
591
  return new RegExp(e);
576
592
  }
577
593
  function T(e) {
578
594
  return !e || e.toLowerCase() === "x" || e === "*";
579
595
  }
580
- function pt(...e) {
581
- return (t) => e.reduce((r, n) => n(r), t);
596
+ function _t(...e) {
597
+ return (t) => e.reduce((r, o) => o(r), t);
582
598
  }
583
- function We(e) {
584
- return e.match(M(kr));
599
+ function ze(e) {
600
+ return e.match(M(Gr));
585
601
  }
586
- function je(e, t, r, n) {
587
- const o = `${e}.${t}.${r}`;
588
- return n ? `${o}-${n}` : o;
602
+ function Je(e, t, r, o) {
603
+ const n = `${e}.${t}.${r}`;
604
+ return o ? `${n}-${o}` : n;
589
605
  }
590
- function Lr(e) {
591
- return e.replace(M(Rr), (t, r, n, o, s, i, a, l, c, u, d, h) => (T(n) ? r = "" : T(o) ? r = `>=${n}.0.0` : T(s) ? r = `>=${n}.${o}.0` : r = `>=${r}`, T(c) ? l = "" : T(u) ? l = `<${Number(c) + 1}.0.0-0` : T(d) ? l = `<${c}.${Number(u) + 1}.0-0` : h ? l = `<=${c}.${u}.${d}-${h}` : l = `<=${l}`, `${r} ${l}`.trim()));
606
+ function Br(e) {
607
+ return e.replace(M(kr), (t, r, o, n, s, i, c, a, l, u, f, d) => (T(o) ? r = "" : T(n) ? r = `>=${o}.0.0` : T(s) ? r = `>=${o}.${n}.0` : r = `>=${r}`, T(l) ? a = "" : T(u) ? a = `<${Number(l) + 1}.0.0-0` : T(f) ? a = `<${l}.${Number(u) + 1}.0-0` : d ? a = `<=${l}.${u}.${f}-${d}` : a = `<=${a}`, `${r} ${a}`.trim()));
592
608
  }
593
- function Mr(e) {
594
- return e.replace(M($r), "$1$2$3");
609
+ function Vr(e) {
610
+ return e.replace(M(Lr), "$1$2$3");
595
611
  }
596
- function Cr(e) {
597
- return e.replace(M(wr), "$1~");
612
+ function Wr(e) {
613
+ return e.replace(M(Mr), "$1~");
598
614
  }
599
- function Dr(e) {
600
- return e.replace(M(Nr), "$1^");
615
+ function jr(e) {
616
+ return e.replace(M(Or), "$1^");
601
617
  }
602
- function Fr(e) {
603
- return e.trim().split(/\s+/).map((t) => t.replace(M(Ir), (r, n, o, s, i) => T(n) ? "" : T(o) ? `>=${n}.0.0 <${Number(n) + 1}.0.0-0` : T(s) ? n === "0" ? `>=${n}.${o}.0 <${n}.${Number(o) + 1}.0-0` : `>=${n}.${o}.0 <${Number(n) + 1}.0.0-0` : i ? n === "0" ? o === "0" ? `>=${n}.${o}.${s}-${i} <${n}.${o}.${Number(s) + 1}-0` : `>=${n}.${o}.${s}-${i} <${n}.${Number(o) + 1}.0-0` : `>=${n}.${o}.${s}-${i} <${Number(n) + 1}.0.0-0` : n === "0" ? o === "0" ? `>=${n}.${o}.${s} <${n}.${o}.${Number(s) + 1}-0` : `>=${n}.${o}.${s} <${n}.${Number(o) + 1}.0-0` : `>=${n}.${o}.${s} <${Number(n) + 1}.0.0-0`)).join(" ");
618
+ function qr(e) {
619
+ return e.trim().split(/\s+/).map((t) => t.replace(M(Fr), (r, o, n, s, i) => T(o) ? "" : T(n) ? `>=${o}.0.0 <${Number(o) + 1}.0.0-0` : T(s) ? o === "0" ? `>=${o}.${n}.0 <${o}.${Number(n) + 1}.0-0` : `>=${o}.${n}.0 <${Number(o) + 1}.0.0-0` : i ? o === "0" ? n === "0" ? `>=${o}.${n}.${s}-${i} <${o}.${n}.${Number(s) + 1}-0` : `>=${o}.${n}.${s}-${i} <${o}.${Number(n) + 1}.0-0` : `>=${o}.${n}.${s}-${i} <${Number(o) + 1}.0.0-0` : o === "0" ? n === "0" ? `>=${o}.${n}.${s} <${o}.${n}.${Number(s) + 1}-0` : `>=${o}.${n}.${s} <${o}.${Number(n) + 1}.0-0` : `>=${o}.${n}.${s} <${Number(o) + 1}.0.0-0`)).join(" ");
604
620
  }
605
- function Hr(e) {
606
- return e.trim().split(/\s+/).map((t) => t.replace(M(Ar), (r, n, o, s, i) => T(n) ? "" : T(o) ? `>=${n}.0.0 <${Number(n) + 1}.0.0-0` : T(s) ? `>=${n}.${o}.0 <${n}.${Number(o) + 1}.0-0` : i ? `>=${n}.${o}.${s}-${i} <${n}.${Number(o) + 1}.0-0` : `>=${n}.${o}.${s} <${n}.${Number(o) + 1}.0-0`)).join(" ");
621
+ function Kr(e) {
622
+ return e.trim().split(/\s+/).map((t) => t.replace(M(Dr), (r, o, n, s, i) => T(o) ? "" : T(n) ? `>=${o}.0.0 <${Number(o) + 1}.0.0-0` : T(s) ? `>=${o}.${n}.0 <${o}.${Number(n) + 1}.0-0` : i ? `>=${o}.${n}.${s}-${i} <${o}.${Number(n) + 1}.0-0` : `>=${o}.${n}.${s} <${o}.${Number(n) + 1}.0-0`)).join(" ");
607
623
  }
608
- function Gr(e) {
609
- return e.split(/\s+/).map((t) => t.trim().replace(M(Pr), (r, n, o, s, i, a) => {
610
- const l = T(o), c = l || T(s), u = c || T(i);
611
- return n === "=" && u && (n = ""), a = "", l ? n === ">" || n === "<" ? "<0.0.0-0" : "*" : n && u ? (c && (s = 0), i = 0, n === ">" ? (n = ">=", c ? (o = Number(o) + 1, s = 0, i = 0) : (s = Number(s) + 1, i = 0)) : n === "<=" && (n = "<", c ? o = Number(o) + 1 : s = Number(s) + 1), n === "<" && (a = "-0"), `${n + o}.${s}.${i}${a}`) : c ? `>=${o}.0.0${a} <${Number(o) + 1}.0.0-0` : u ? `>=${o}.${s}.0${a} <${o}.${Number(s) + 1}.0-0` : r;
624
+ function zr(e) {
625
+ return e.split(/\s+/).map((t) => t.trim().replace(M(xr), (r, o, n, s, i, c) => {
626
+ const a = T(n), l = a || T(s), u = l || T(i);
627
+ return o === "=" && u && (o = ""), c = "", a ? o === ">" || o === "<" ? "<0.0.0-0" : "*" : o && u ? (l && (s = 0), i = 0, o === ">" ? (o = ">=", l ? (n = Number(n) + 1, s = 0, i = 0) : (s = Number(s) + 1, i = 0)) : o === "<=" && (o = "<", l ? n = Number(n) + 1 : s = Number(s) + 1), o === "<" && (c = "-0"), `${o + n}.${s}.${i}${c}`) : l ? `>=${n}.0.0${c} <${Number(n) + 1}.0.0-0` : u ? `>=${n}.${s}.0${c} <${n}.${Number(s) + 1}.0-0` : r;
612
628
  })).join(" ");
613
629
  }
614
- function xr(e) {
615
- return e.trim().replace(M(Tr), "");
630
+ function Jr(e) {
631
+ return e.trim().replace(M(Cr), "");
616
632
  }
617
- function Ur(e) {
618
- return e.trim().replace(M(Or), "");
633
+ function Xr(e) {
634
+ return e.trim().replace(M(Ur), "");
619
635
  }
620
- function fe(e, t) {
636
+ function me(e, t) {
621
637
  return e = Number(e) || e, t = Number(t) || t, e > t ? 1 : e === t ? 0 : -1;
622
638
  }
623
- function Br(e, t) {
624
- const { preRelease: r } = e, { preRelease: n } = t;
625
- if (r === void 0 && n) return 1;
626
- if (r && n === void 0) return -1;
627
- if (r === void 0 && n === void 0) return 0;
628
- for (let o = 0, s = r.length; o <= s; o++) {
629
- const i = r[o], a = n[o];
630
- if (i !== a)
631
- return i === void 0 && a === void 0 ? 0 : i ? a ? fe(i, a) : -1 : 1;
639
+ function Yr(e, t) {
640
+ const { preRelease: r } = e, { preRelease: o } = t;
641
+ if (r === void 0 && o) return 1;
642
+ if (r && o === void 0) return -1;
643
+ if (r === void 0 && o === void 0) return 0;
644
+ for (let n = 0, s = r.length; n <= s; n++) {
645
+ const i = r[n], c = o[n];
646
+ if (i !== c)
647
+ return i === void 0 && c === void 0 ? 0 : i ? c ? me(i, c) : -1 : 1;
632
648
  }
633
649
  return 0;
634
650
  }
635
- function oe(e, t) {
636
- return fe(e.major, t.major) || fe(e.minor, t.minor) || fe(e.patch, t.patch) || Br(e, t);
651
+ function ae(e, t) {
652
+ return me(e.major, t.major) || me(e.minor, t.minor) || me(e.patch, t.patch) || Yr(e, t);
637
653
  }
638
- function Se(e, t) {
654
+ function we(e, t) {
639
655
  return e.version === t.version;
640
656
  }
641
- function Vr(e, t) {
657
+ function Zr(e, t) {
642
658
  switch (e.operator) {
643
659
  case "":
644
660
  case "=":
645
- return Se(e, t);
661
+ return we(e, t);
646
662
  case ">":
647
- return oe(e, t) < 0;
663
+ return ae(e, t) < 0;
648
664
  case ">=":
649
- return Se(e, t) || oe(e, t) < 0;
665
+ return we(e, t) || ae(e, t) < 0;
650
666
  case "<":
651
- return oe(e, t) > 0;
667
+ return ae(e, t) > 0;
652
668
  case "<=":
653
- return Se(e, t) || oe(e, t) > 0;
669
+ return we(e, t) || ae(e, t) > 0;
654
670
  case void 0:
655
671
  return !0;
656
672
  default:
657
673
  return !1;
658
674
  }
659
675
  }
660
- function Wr(e) {
661
- return pt(Fr, Hr, Gr, xr)(e);
676
+ function Qr(e) {
677
+ return _t(qr, Kr, zr, Jr)(e);
662
678
  }
663
- function jr(e) {
664
- return pt(Lr, Mr, Cr, Dr)(e.trim()).split(/\s+/).join(" ");
679
+ function eo(e) {
680
+ return _t(Br, Vr, Wr, jr)(e.trim()).split(/\s+/).join(" ");
665
681
  }
666
- function X(e, t) {
682
+ function Q(e, t) {
667
683
  if (!e) return !1;
668
- const r = We(e);
684
+ const r = ze(e);
669
685
  if (!r) return !1;
670
- const [, n, , o, s, i, a] = r, l = {
671
- operator: n,
672
- version: je(o, s, i, a),
673
- major: o,
686
+ const [, o, , n, s, i, c] = r, a = {
687
+ operator: o,
688
+ version: Je(n, s, i, c),
689
+ major: n,
674
690
  minor: s,
675
691
  patch: i,
676
- preRelease: a == null ? void 0 : a.split(".")
677
- }, c = t.split("||");
678
- for (const u of c) {
679
- const d = u.trim();
680
- if (!d || d === "*" || d === "x") return !0;
692
+ preRelease: c == null ? void 0 : c.split(".")
693
+ }, l = t.split("||");
694
+ for (const u of l) {
695
+ const f = u.trim();
696
+ if (!f || f === "*" || f === "x") return !0;
681
697
  try {
682
- const h = jr(d);
698
+ const d = eo(f);
699
+ if (!d.trim()) return !0;
700
+ const h = d.split(" ").map((y) => Qr(y)).join(" ");
683
701
  if (!h.trim()) return !0;
684
- const f = h.split(" ").map((g) => Wr(g)).join(" ");
685
- if (!f.trim()) return !0;
686
- const p = f.split(/\s+/).map((g) => Ur(g)).filter(Boolean);
687
- if (p.length === 0) continue;
688
- let m = !0;
689
- for (const g of p) {
690
- const E = We(g);
702
+ const m = h.split(/\s+/).map((y) => Xr(y)).filter(Boolean);
703
+ if (m.length === 0) continue;
704
+ let p = !0;
705
+ for (const y of m) {
706
+ const E = ze(y);
691
707
  if (!E) {
692
- m = !1;
708
+ p = !1;
693
709
  break;
694
710
  }
695
- const [, _, , y, b, S, $] = E;
696
- if (!Vr({
711
+ const [, _, , g, R, w, $] = E;
712
+ if (!Zr({
697
713
  operator: _,
698
- version: je(y, b, S, $),
699
- major: y,
700
- minor: b,
701
- patch: S,
714
+ version: Je(g, R, w, $),
715
+ major: g,
716
+ minor: R,
717
+ patch: w,
702
718
  preRelease: $ == null ? void 0 : $.split(".")
703
- }, l)) {
704
- m = !1;
719
+ }, a)) {
720
+ p = !1;
705
721
  break;
706
722
  }
707
723
  }
708
- if (m) return !0;
709
- } catch (h) {
710
- console.error(`[semver] Error processing range part "${d}":`, h);
724
+ if (p) return !0;
725
+ } catch (d) {
726
+ console.error(`[semver] Error processing range part "${f}":`, d);
711
727
  continue;
712
728
  }
713
729
  }
714
730
  return !1;
715
731
  }
716
- const re = "default", mt = "global";
717
- function qr(e, t, r, n) {
732
+ const se = "default", Rt = "global";
733
+ function to(e, t, r, o) {
718
734
  var s, i;
719
- let o;
720
- return "get" in e ? o = e.get : "lib" in e ? o = () => Promise.resolve(e.lib) : o = () => Promise.resolve(() => {
721
- R(`Cannot get shared "${r}" from "${t}": neither "get" nor "lib" is provided in the share config.`);
722
- }), (s = e.shareConfig) != null && s.eager && ((i = e.treeShaking) != null && i.mode) && R(`Invalid shared config for "${r}" from "${t}": cannot use both "eager: true" and "treeShaking.mode" simultaneously. Choose one strategy.`), {
735
+ let n;
736
+ return "get" in e ? n = e.get : "lib" in e ? n = () => Promise.resolve(e.lib) : n = () => Promise.resolve(() => {
737
+ b(`Cannot get shared "${r}" from "${t}": neither "get" nor "lib" is provided in the share config.`);
738
+ }), (s = e.shareConfig) != null && s.eager && ((i = e.treeShaking) != null && i.mode) && b(`Invalid shared config for "${r}" from "${t}": cannot use both "eager: true" and "treeShaking.mode" simultaneously. Choose one strategy.`), {
723
739
  deps: [],
724
740
  useIn: [],
725
741
  from: t,
@@ -732,201 +748,204 @@ function qr(e, t, r, n) {
732
748
  strictVersion: !1,
733
749
  ...e.shareConfig
734
750
  },
735
- get: o,
751
+ get: n,
736
752
  loaded: e != null && e.loaded || "lib" in e ? !0 : void 0,
737
753
  version: e.version ?? "0",
738
754
  scope: Array.isArray(e.scope) ? e.scope : [e.scope ?? "default"],
739
- strategy: (e.strategy ?? n) || "version-first",
755
+ strategy: (e.strategy ?? o) || "version-first",
740
756
  treeShaking: e.treeShaking ? {
741
757
  ...e.treeShaking,
742
758
  mode: e.treeShaking.mode ?? "server-calc",
743
- status: e.treeShaking.status ?? we.UNKNOWN,
759
+ status: e.treeShaking.status ?? Ne.UNKNOWN,
744
760
  useIn: []
745
761
  } : void 0
746
762
  };
747
763
  }
748
- function yt(e, t) {
749
- const r = t.shared || {}, n = t.name, o = Object.keys(r).reduce((i, a) => {
750
- const l = at(r[a]);
751
- return i[a] = i[a] || [], l.forEach((c) => {
752
- i[a].push(qr(c, n, a, t.shareStrategy));
764
+ function bt(e, t) {
765
+ const r = t.shared || {}, o = t.name, n = Object.keys(r).reduce((i, c) => {
766
+ const a = ht(r[c]);
767
+ return i[c] = i[c] || [], a.forEach((l) => {
768
+ i[c].push(to(l, o, c, t.shareStrategy));
753
769
  }), i;
754
770
  }, {}), s = { ...e.shared };
755
- return Object.keys(o).forEach((i) => {
756
- s[i] ? o[i].forEach((a) => {
757
- s[i].find((l) => l.version === a.version) || s[i].push(a);
758
- }) : s[i] = o[i];
771
+ return Object.keys(n).forEach((i) => {
772
+ s[i] ? n[i].forEach((c) => {
773
+ s[i].find((a) => a.version === c.version) || s[i].push(c);
774
+ }) : s[i] = n[i];
759
775
  }), {
760
776
  allShareInfos: s,
761
- newShareInfos: o
777
+ newShareInfos: n
762
778
  };
763
779
  }
764
- function ee(e, t) {
780
+ function oe(e, t) {
765
781
  if (!e) return !1;
766
- const { status: r, mode: n } = e;
767
- return r === we.NO_USE ? !1 : r === we.CALCULATED ? !0 : n === "runtime-infer" ? t ? zr(e, t) : !0 : !1;
782
+ const { status: r, mode: o } = e;
783
+ return r === Ne.NO_USE ? !1 : r === Ne.CALCULATED ? !0 : o === "runtime-infer" ? t ? oo(e, t) : !0 : !1;
768
784
  }
769
785
  function G(e, t) {
770
- const r = (n) => {
771
- if (!Number.isNaN(Number(n))) {
772
- const o = n.split(".");
773
- let s = n;
774
- for (let i = 0; i < 3 - o.length; i++) s += ".0";
786
+ const r = (o) => {
787
+ if (!Number.isNaN(Number(o))) {
788
+ const n = o.split(".");
789
+ let s = o;
790
+ for (let i = 0; i < 3 - n.length; i++) s += ".0";
775
791
  return s;
776
792
  }
777
- return n;
793
+ return o;
778
794
  };
779
- return !!X(r(e), `<=${r(t)}`);
795
+ return !!Q(r(e), `<=${r(t)}`);
780
796
  }
781
- const te = (e, t) => {
782
- const r = t || function(n, o) {
783
- return G(n, o);
797
+ const ne = (e, t) => {
798
+ const r = t || function(o, n) {
799
+ return G(o, n);
784
800
  };
785
- return Object.keys(e).reduce((n, o) => !n || r(n, o) || n === "0" ? o : n, 0);
786
- }, de = (e) => !!e.loaded || typeof e.lib == "function", Kr = (e) => !!e.loading, zr = (e, t) => {
801
+ return Object.keys(e).reduce((o, n) => !o || r(o, n) || o === "0" ? n : o, 0);
802
+ }, Ee = (e) => !!e.loaded || typeof e.lib == "function", ro = (e) => !!e.loading, oo = (e, t) => {
787
803
  if (!e || !t) return !1;
788
804
  const { usedExports: r } = e;
789
- return r ? !!t.every((n) => r.includes(n)) : !1;
805
+ return r ? !!t.every((o) => r.includes(o)) : !1;
790
806
  };
791
- function Jr(e, t, r, n) {
792
- const o = e[t][r];
793
- let s = "", i = ee(n);
794
- const a = function(l, c) {
795
- return i ? o[l].treeShaking ? o[c].treeShaking ? !de(o[l].treeShaking) && G(l, c) : !1 : !0 : !de(o[l]) && G(l, c);
807
+ function no(e, t, r, o) {
808
+ const n = e[t][r];
809
+ let s = "", i = oe(o);
810
+ const c = function(a, l) {
811
+ return i ? n[a].treeShaking ? n[l].treeShaking ? !Ee(n[a].treeShaking) && G(a, l) : !1 : !0 : !Ee(n[a]) && G(a, l);
796
812
  };
797
813
  if (i) {
798
- if (s = te(e[t][r], a), s) return {
814
+ if (s = ne(e[t][r], c), s) return {
799
815
  version: s,
800
816
  useTreesShaking: i
801
817
  };
802
818
  i = !1;
803
819
  }
804
820
  return {
805
- version: te(e[t][r], a),
821
+ version: ne(e[t][r], c),
806
822
  useTreesShaking: i
807
823
  };
808
824
  }
809
- const x = (e) => de(e) || Kr(e);
810
- function Xr(e, t, r, n) {
811
- const o = e[t][r];
812
- let s = "", i = ee(n);
813
- const a = function(l, c) {
825
+ const B = (e) => Ee(e) || ro(e);
826
+ function so(e, t, r, o) {
827
+ const n = e[t][r];
828
+ let s = "", i = oe(o);
829
+ const c = function(a, l) {
814
830
  if (i) {
815
- if (!o[l].treeShaking) return !0;
816
- if (!o[c].treeShaking) return !1;
817
- if (x(o[c].treeShaking)) return x(o[l].treeShaking) ? !!G(l, c) : !0;
818
- if (x(o[l].treeShaking)) return !1;
831
+ if (!n[a].treeShaking) return !0;
832
+ if (!n[l].treeShaking) return !1;
833
+ if (B(n[l].treeShaking)) return B(n[a].treeShaking) ? !!G(a, l) : !0;
834
+ if (B(n[a].treeShaking)) return !1;
819
835
  }
820
- return x(o[c]) ? x(o[l]) ? !!G(l, c) : !0 : x(o[l]) ? !1 : G(l, c);
836
+ return B(n[l]) ? B(n[a]) ? !!G(a, l) : !0 : B(n[a]) ? !1 : G(a, l);
821
837
  };
822
838
  if (i) {
823
- if (s = te(e[t][r], a), s) return {
839
+ if (s = ne(e[t][r], c), s) return {
824
840
  version: s,
825
841
  useTreesShaking: i
826
842
  };
827
843
  i = !1;
828
844
  }
829
845
  return {
830
- version: te(e[t][r], a),
846
+ version: ne(e[t][r], c),
831
847
  useTreesShaking: i
832
848
  };
833
849
  }
834
- function Yr(e) {
835
- return e === "loaded-first" ? Xr : Jr;
850
+ function io(e) {
851
+ return e === "loaded-first" ? so : no;
836
852
  }
837
- function he(e, t, r, n) {
853
+ function pe(e, t, r, o) {
838
854
  if (!e) return;
839
- const { shareConfig: o, scope: s = re, strategy: i, treeShaking: a } = r, l = Array.isArray(s) ? s : [s];
840
- for (const c of l) if (o && e[c] && e[c][t]) {
841
- const { requiredVersion: u } = o, { version: d, useTreesShaking: h } = Yr(i)(e, c, t, a), f = () => {
842
- const m = e[c][t][d];
843
- if (o.singleton) {
844
- if (typeof u == "string" && !X(d, u)) {
845
- const g = `Version ${d} from ${d && m.from} of shared singleton module ${t} does not satisfy the requirement of ${r.from} which needs ${u})`;
846
- o.strictVersion ? R(g) : Oe(g);
855
+ const { shareConfig: n, scope: s = se, strategy: i, treeShaking: c } = r, a = Array.isArray(s) ? s : [s];
856
+ for (const l of a) if (n && e[l] && e[l][t]) {
857
+ const { requiredVersion: u } = n, { version: f, useTreesShaking: d } = io(i)(e, l, t, c), h = () => {
858
+ const p = e[l][t][f];
859
+ if (n.singleton) {
860
+ if (typeof u == "string" && !Q(f, u)) {
861
+ const y = `Version ${f} from ${f && p.from} of shared singleton module ${t} does not satisfy the requirement of ${r.from} which needs ${u})`;
862
+ n.strictVersion ? b(y) : te(y);
847
863
  }
848
864
  return {
849
- shared: m,
850
- useTreesShaking: h
865
+ shared: p,
866
+ useTreesShaking: d
851
867
  };
852
868
  } else {
853
869
  if (u === !1 || u === "*") return {
854
- shared: m,
855
- useTreesShaking: h
870
+ shared: p,
871
+ useTreesShaking: d
856
872
  };
857
- if (X(d, u)) return {
858
- shared: m,
859
- useTreesShaking: h
873
+ if (Q(f, u)) return {
874
+ shared: p,
875
+ useTreesShaking: d
860
876
  };
861
- const g = ee(a);
862
- if (g) {
863
- for (const [E, _] of Object.entries(e[c][t]))
864
- if (ee(_.treeShaking, a == null ? void 0 : a.usedExports) && X(E, u))
877
+ const y = oe(c);
878
+ if (y) {
879
+ for (const [E, _] of Object.entries(e[l][t]))
880
+ if (oe(_.treeShaking, c == null ? void 0 : c.usedExports) && Q(E, u))
865
881
  return {
866
882
  shared: _,
867
- useTreesShaking: g
883
+ useTreesShaking: y
868
884
  };
869
885
  }
870
- for (const [E, _] of Object.entries(e[c][t])) if (X(E, u)) return {
886
+ for (const [E, _] of Object.entries(e[l][t])) if (Q(E, u)) return {
871
887
  shared: _,
872
888
  useTreesShaking: !1
873
889
  };
874
890
  }
875
- }, p = {
891
+ }, m = {
876
892
  shareScopeMap: e,
877
- scope: c,
893
+ scope: l,
878
894
  pkgName: t,
879
- version: d,
880
- GlobalFederation: Q.__FEDERATION__,
895
+ version: f,
896
+ GlobalFederation: re.__FEDERATION__,
881
897
  shareInfo: r,
882
- resolver: f
898
+ resolver: h
883
899
  };
884
- return (n.emit(p) || p).resolver();
900
+ return (o.emit(m) || m).resolver();
885
901
  }
886
902
  }
887
- function gt() {
888
- return Q.__FEDERATION__.__SHARE__;
903
+ function St() {
904
+ return re.__FEDERATION__.__SHARE__;
889
905
  }
890
- function qe(e) {
891
- const { pkgName: t, extraOptions: r, shareInfos: n } = e, o = (l) => {
892
- if (!l) return;
893
- const c = {};
894
- return l.forEach((d) => {
895
- c[d.version] = d;
896
- }), c[te(c, function(d, h) {
897
- return !de(c[d]) && G(d, h);
906
+ function Xe(e) {
907
+ const { pkgName: t, extraOptions: r, shareInfos: o } = e, n = (a) => {
908
+ if (!a) return;
909
+ const l = {};
910
+ return a.forEach((f) => {
911
+ l[f.version] = f;
912
+ }), l[ne(l, function(f, d) {
913
+ return !Ee(l[f]) && G(f, d);
898
914
  })];
899
- }, s = (r == null ? void 0 : r.resolver) ?? o, i = (l) => l !== null && typeof l == "object" && !Array.isArray(l), a = (...l) => {
900
- const c = {};
901
- for (const u of l)
915
+ }, s = (r == null ? void 0 : r.resolver) ?? n, i = (a) => a !== null && typeof a == "object" && !Array.isArray(a), c = (...a) => {
916
+ const l = {};
917
+ for (const u of a)
902
918
  if (u)
903
- for (const [d, h] of Object.entries(u)) {
904
- const f = c[d];
905
- i(f) && i(h) ? c[d] = a(f, h) : h !== void 0 && (c[d] = h);
919
+ for (const [f, d] of Object.entries(u)) {
920
+ const h = l[f];
921
+ i(h) && i(d) ? l[f] = c(h, d) : d !== void 0 && (l[f] = d);
906
922
  }
907
- return c;
923
+ return l;
908
924
  };
909
- return a(s(n[t]), r == null ? void 0 : r.customShareInfo);
925
+ return c(s(o[t]), r == null ? void 0 : r.customShareInfo);
910
926
  }
911
- const U = (e, t) => {
912
- e.useIn || (e.useIn = []), ur(e.useIn, t);
927
+ const V = (e, t) => {
928
+ e.useIn || (e.useIn = []), _r(e.useIn, t);
913
929
  };
914
- function se(e, t) {
930
+ function ce(e, t) {
915
931
  return t && e.treeShaking ? e.treeShaking : e;
916
932
  }
917
- function Zr(e, t) {
933
+ function xe(e, t) {
934
+ return !t || t === "." ? e : `${e}/${t.replace(/^\.\//, "")}`;
935
+ }
936
+ function Ye(e, t) {
918
937
  for (const r of e) {
919
- const n = t.startsWith(r.name);
920
- let o = t.replace(r.name, "");
921
- if (n) {
922
- if (o.startsWith("/")) {
923
- const a = r.name;
924
- return o = `.${o}`, {
925
- pkgNameOrAlias: a,
926
- expose: o,
938
+ const o = t.startsWith(r.name);
939
+ let n = t.replace(r.name, "");
940
+ if (o) {
941
+ if (n.startsWith("/")) {
942
+ const c = r.name;
943
+ return n = `.${n}`, {
944
+ pkgNameOrAlias: c,
945
+ expose: n,
927
946
  remote: r
928
947
  };
929
- } else if (o === "") return {
948
+ } else if (n === "") return {
930
949
  pkgNameOrAlias: r.name,
931
950
  expose: ".",
932
951
  remote: r
@@ -936,9 +955,9 @@ function Zr(e, t) {
936
955
  let i = r.alias && t.replace(r.alias, "");
937
956
  if (r.alias && s) {
938
957
  if (i && i.startsWith("/")) {
939
- const a = r.alias;
958
+ const c = r.alias;
940
959
  return i = `.${i}`, {
941
- pkgNameOrAlias: a,
960
+ pkgNameOrAlias: c,
942
961
  expose: i,
943
962
  remote: r
944
963
  };
@@ -950,183 +969,212 @@ function Zr(e, t) {
950
969
  }
951
970
  }
952
971
  }
953
- function Qr(e, t) {
972
+ function ao(e, t) {
954
973
  for (const r of e)
955
974
  if (t === r.name || r.alias && t === r.alias) return r;
956
975
  }
957
- const Et = "RUNTIME-001", _t = "RUNTIME-002", bt = "RUNTIME-003", Rt = "RUNTIME-004", St = "RUNTIME-005", Pe = "RUNTIME-006", $t = "RUNTIME-007", He = "RUNTIME-008", en = "RUNTIME-009", wt = "RUNTIME-010", Nt = "RUNTIME-011", tn = "RUNTIME-012", O = {
958
- [Et]: "Failed to get remoteEntry exports.",
959
- [_t]: 'The remote entry interface does not contain "init"',
960
- [bt]: "Failed to get manifest.",
961
- [Rt]: "Failed to locate remote.",
962
- [St]: "Invalid loadShareSync function call from bundler runtime",
963
- [Pe]: "Invalid loadShareSync function call from runtime",
964
- [$t]: "Failed to get remote snapshot.",
965
- [He]: "Failed to load script resources.",
966
- [en]: "Please call createInstance first.",
967
- [wt]: 'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.',
968
- [Nt]: "The remoteEntry URL is missing from the remote snapshot.",
969
- [tn]: 'The getter for the shared module is not a function. This may be caused by setting "shared.import: false" without the host providing the corresponding lib.'
976
+ const wt = "RUNTIME-001", $t = "RUNTIME-002", It = "RUNTIME-003", Nt = "RUNTIME-004", Tt = "RUNTIME-005", Le = "RUNTIME-006", vt = "RUNTIME-007", Ge = "RUNTIME-008", co = "RUNTIME-009", At = "RUNTIME-010", kt = "RUNTIME-011", lo = "RUNTIME-012", Pt = "RUNTIME-013", Lt = "RUNTIME-014", Mt = "RUNTIME-015", k = {
977
+ [wt]: "Failed to get remoteEntry exports.",
978
+ [$t]: 'The remote entry interface does not contain "init"',
979
+ [It]: "Failed to get manifest.",
980
+ [Nt]: "Failed to locate remote.",
981
+ [Tt]: "Invalid loadShareSync function call from bundler runtime",
982
+ [Le]: "Invalid loadShareSync function call from runtime",
983
+ [vt]: "Failed to get remote snapshot.",
984
+ [Ge]: "Failed to load script resources.",
985
+ [co]: "Please call createInstance first.",
986
+ [At]: 'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.',
987
+ [kt]: "The remoteEntry URL is missing from the remote snapshot.",
988
+ [lo]: 'The getter for the shared module is not a function. This may be caused by setting "shared.import: false" without the host providing the corresponding lib.',
989
+ [Pt]: "The manifest is not a valid Module Federation manifest.",
990
+ [Lt]: "The remote does not expose the requested module.",
991
+ [Mt]: "Remote container initialization failed."
970
992
  };
971
993
  ({
972
- ...O
994
+ ...k
973
995
  });
974
- const Tt = ".then(callbacks[0]).catch(callbacks[1])";
975
- async function rn({ entry: e, remoteEntryExports: t }) {
976
- return new Promise((r, n) => {
996
+ const Ot = ".then(callbacks[0]).catch(callbacks[1])";
997
+ async function uo({ entry: e, remoteEntryExports: t }) {
998
+ return new Promise((r, o) => {
977
999
  try {
978
- t ? r(t) : typeof FEDERATION_ALLOW_NEW_FUNCTION < "u" ? new Function("callbacks", `import("${e}")${Tt}`)([r, n]) : import(
1000
+ t ? r(t) : typeof FEDERATION_ALLOW_NEW_FUNCTION < "u" ? new Function("callbacks", `import("${e}")${Ot}`)([r, o]) : import(
979
1001
  /* webpackIgnore: true */
980
1002
  /* @vite-ignore */
981
1003
  e
982
- ).then(r).catch(n);
983
- } catch (o) {
984
- R(`Failed to load ESM entry from "${e}". ${o instanceof Error ? o.message : String(o)}`);
1004
+ ).then(r).catch(o);
1005
+ } catch (n) {
1006
+ b(`Failed to load ESM entry from "${e}". ${n instanceof Error ? n.message : String(n)}`);
985
1007
  }
986
1008
  });
987
1009
  }
988
- async function nn({ entry: e, remoteEntryExports: t }) {
989
- return new Promise((r, n) => {
1010
+ async function fo({ entry: e, remoteEntryExports: t }) {
1011
+ return new Promise((r, o) => {
990
1012
  try {
991
- t ? r(t) : typeof __system_context__ > "u" ? System.import(e).then(r).catch(n) : new Function("callbacks", `System.import("${e}")${Tt}`)([r, n]);
992
- } catch (o) {
993
- R(`Failed to load SystemJS entry from "${e}". ${o instanceof Error ? o.message : String(o)}`);
1013
+ t ? r(t) : typeof __system_context__ > "u" ? System.import(e).then(r).catch(o) : new Function("callbacks", `System.import("${e}")${Ot}`)([r, o]);
1014
+ } catch (n) {
1015
+ b(`Failed to load SystemJS entry from "${e}". ${n instanceof Error ? n.message : String(n)}`);
994
1016
  }
995
1017
  });
996
1018
  }
997
- function It(e, t, r) {
998
- const { remoteEntryKey: n, entryExports: o } = Ce(e, t);
999
- return o || R(Et, O, {
1019
+ function Ct(e, t, r) {
1020
+ const { remoteEntryKey: o, entryExports: n } = Fe(e, t);
1021
+ return n || b(wt, k, {
1000
1022
  remoteName: e,
1001
1023
  remoteEntryUrl: r,
1002
- remoteEntryKey: n
1003
- }), o;
1024
+ remoteEntryKey: o
1025
+ }), n;
1004
1026
  }
1005
- async function on({ name: e, globalName: t, entry: r, remoteInfo: n, loaderHook: o, getEntryUrl: s }) {
1006
- const { entryExports: i } = Ce(e, t);
1007
- if (i) return i;
1027
+ async function ho({ name: e, globalName: t, entry: r, remoteInfo: o, loaderHook: n, getEntryUrl: s, resourceContext: i }) {
1028
+ const { entryExports: c } = Fe(e, t);
1029
+ if (c) return c;
1008
1030
  const a = s ? s(r) : r;
1009
- return or(a, {
1031
+ return dr(a, {
1010
1032
  attrs: {},
1011
- createScriptHook: (l, c) => {
1012
- const u = o.lifecycle.createScript.emit({
1033
+ createScriptHook: (l, u) => {
1034
+ const f = n.lifecycle.createScript.emit({
1013
1035
  url: l,
1014
- attrs: c,
1015
- remoteInfo: n
1036
+ attrs: u,
1037
+ remoteInfo: o,
1038
+ resourceContext: i ? {
1039
+ ...i,
1040
+ url: l
1041
+ } : void 0
1016
1042
  });
1017
- if (u && (u instanceof HTMLScriptElement || "script" in u || "timeout" in u))
1018
- return u;
1043
+ if (f && (f instanceof HTMLScriptElement || "script" in f || "timeout" in f))
1044
+ return f;
1019
1045
  }
1020
- }).then(() => It(e, t, r), (l) => {
1021
- const c = l instanceof Error ? l.message : String(l);
1022
- R(He, O, {
1046
+ }).then(() => Ct(e, t, r), (l) => {
1047
+ const u = l instanceof Error ? l.message : String(l);
1048
+ b(Ge, k, {
1023
1049
  remoteName: e,
1024
1050
  resourceUrl: a
1025
- }, c);
1051
+ }, u);
1026
1052
  });
1027
1053
  }
1028
- async function sn({ remoteInfo: e, remoteEntryExports: t, loaderHook: r, getEntryUrl: n }) {
1029
- const { entry: o, entryGlobalName: s, name: i, type: a } = e;
1054
+ async function mo({ remoteInfo: e, remoteEntryExports: t, loaderHook: r, getEntryUrl: o, resourceContext: n }) {
1055
+ const { entry: s, entryGlobalName: i, name: c, type: a } = e;
1030
1056
  switch (a) {
1031
1057
  case "esm":
1032
1058
  case "module":
1033
- return rn({
1034
- entry: o,
1059
+ return uo({
1060
+ entry: s,
1035
1061
  remoteEntryExports: t
1036
1062
  });
1037
1063
  case "system":
1038
- return nn({
1039
- entry: o,
1064
+ return fo({
1065
+ entry: s,
1040
1066
  remoteEntryExports: t
1041
1067
  });
1042
1068
  default:
1043
- return on({
1044
- entry: o,
1045
- globalName: s,
1046
- name: i,
1069
+ return ho({
1070
+ entry: s,
1071
+ globalName: i,
1072
+ name: c,
1047
1073
  remoteInfo: e,
1048
1074
  loaderHook: r,
1049
- getEntryUrl: n
1075
+ getEntryUrl: o,
1076
+ resourceContext: n
1050
1077
  });
1051
1078
  }
1052
1079
  }
1053
- async function an({ remoteInfo: e, loaderHook: t }) {
1054
- const { entry: r, entryGlobalName: n, name: o, type: s } = e, { entryExports: i } = Ce(o, n);
1055
- return i || ar(r, {
1080
+ async function po({ remoteInfo: e, loaderHook: t, resourceContext: r }) {
1081
+ const { entry: o, entryGlobalName: n, name: s, type: i } = e, { entryExports: c } = Fe(s, n);
1082
+ return c || yr(o, {
1056
1083
  attrs: {
1057
- name: o,
1084
+ name: s,
1058
1085
  globalName: n,
1059
- type: s
1086
+ type: i
1060
1087
  },
1061
1088
  loaderHook: { createScriptHook: (a, l = {}) => {
1062
- const c = t.lifecycle.createScript.emit({
1089
+ const u = t.lifecycle.createScript.emit({
1063
1090
  url: a,
1064
1091
  attrs: l,
1065
- remoteInfo: e
1092
+ remoteInfo: e,
1093
+ resourceContext: r ? {
1094
+ ...r,
1095
+ url: a
1096
+ } : void 0
1066
1097
  });
1067
- if (c && "url" in c)
1068
- return c;
1098
+ if (u && "url" in u)
1099
+ return u;
1069
1100
  } }
1070
- }).then(() => It(o, n, r)).catch((a) => {
1071
- R(`Failed to load Node.js entry for remote "${o}" from "${r}". ${a instanceof Error ? a.message : String(a)}`);
1101
+ }).then(() => Ct(s, n, o)).catch((a) => {
1102
+ b(`Failed to load Node.js entry for remote "${s}" from "${o}". ${a instanceof Error ? a.message : String(a)}`);
1072
1103
  });
1073
1104
  }
1074
- function ke(e) {
1105
+ function Me(e) {
1075
1106
  const { entry: t, name: r } = e;
1076
- return Xe(r, t);
1107
+ return tt(r, t);
1077
1108
  }
1078
- async function pe(e) {
1079
- const { origin: t, remoteEntryExports: r, remoteInfo: n, getEntryUrl: o, _inErrorHandling: s = !1 } = e, i = ke(n);
1109
+ async function Ue(e) {
1110
+ const { origin: t, remoteEntryExports: r, remoteInfo: o, getEntryUrl: n, resourceContext: s, _inErrorHandling: i = !1 } = e, c = Me(o);
1080
1111
  if (r) return r;
1081
- if (!V[i]) {
1112
+ if (!j[c]) {
1082
1113
  const a = t.remoteHandler.hooks.lifecycle.loadEntry, l = t.loaderHook;
1083
- V[i] = a.emit({
1114
+ j[c] = a.emit({
1115
+ origin: t,
1084
1116
  loaderHook: l,
1085
- remoteInfo: n,
1117
+ remoteInfo: o,
1086
1118
  remoteEntryExports: r
1087
- }).then((c) => c || ((typeof ENV_TARGET < "u" ? ENV_TARGET === "web" : F) ? sn({
1088
- remoteInfo: n,
1119
+ }).then((u) => u || ((typeof ENV_TARGET < "u" ? ENV_TARGET === "web" : D) ? mo({
1120
+ remoteInfo: o,
1089
1121
  remoteEntryExports: r,
1090
1122
  loaderHook: l,
1091
- getEntryUrl: o
1092
- }) : an({
1093
- remoteInfo: n,
1094
- loaderHook: l
1095
- }))).catch(async (c) => {
1096
- const u = ke(n), d = c instanceof Error && c.message.includes("ScriptExecutionError");
1097
- if (c instanceof Error && c.message.includes(He) && !d && !s) {
1098
- const h = (p) => pe({
1123
+ getEntryUrl: n,
1124
+ resourceContext: s
1125
+ }) : po({
1126
+ remoteInfo: o,
1127
+ loaderHook: l,
1128
+ resourceContext: s
1129
+ }))).then(async (u) => (await t.loaderHook.lifecycle.afterLoadEntry.emit({
1130
+ origin: t,
1131
+ remoteInfo: o,
1132
+ remoteEntryExports: u
1133
+ }), u)).catch(async (u) => {
1134
+ const f = Me(o), d = u instanceof Error && u.message.includes("ScriptExecutionError");
1135
+ if (u instanceof Error && u.message.includes(Ge) && !d && !i) {
1136
+ const h = (p) => Ue({
1099
1137
  ...p,
1100
1138
  _inErrorHandling: !0
1101
- }), f = await t.loaderHook.lifecycle.loadEntryError.emit({
1139
+ }), m = await t.loaderHook.lifecycle.loadEntryError.emit({
1102
1140
  getRemoteEntry: h,
1103
1141
  origin: t,
1104
- remoteInfo: n,
1142
+ remoteInfo: o,
1105
1143
  remoteEntryExports: r,
1106
- globalLoading: V,
1107
- uniqueKey: u
1144
+ globalLoading: j,
1145
+ uniqueKey: f
1108
1146
  });
1109
- if (f) return f;
1147
+ if (m)
1148
+ return await t.loaderHook.lifecycle.afterLoadEntry.emit({
1149
+ origin: t,
1150
+ remoteInfo: o,
1151
+ remoteEntryExports: m,
1152
+ recovered: !0
1153
+ }), m;
1110
1154
  }
1111
- throw c;
1155
+ throw await t.loaderHook.lifecycle.afterLoadEntry.emit({
1156
+ origin: t,
1157
+ remoteInfo: o,
1158
+ error: u
1159
+ }), u;
1112
1160
  });
1113
1161
  }
1114
- return V[i];
1162
+ return j[c];
1115
1163
  }
1116
- function me(e) {
1164
+ function q(e) {
1117
1165
  return {
1118
1166
  ...e,
1119
1167
  entry: "entry" in e ? e.entry : "",
1120
- type: e.type || mt,
1168
+ type: e.type || Rt,
1121
1169
  entryGlobalName: e.entryGlobalName || e.name,
1122
- shareScope: e.shareScope || re
1170
+ shareScope: e.shareScope || se
1123
1171
  };
1124
1172
  }
1125
- function cn() {
1173
+ function yo() {
1126
1174
  return typeof FEDERATION_BUILD_IDENTIFIER < "u" ? FEDERATION_BUILD_IDENTIFIER : "";
1127
1175
  }
1128
- function ln(e, t) {
1129
- const r = gr(), n = [
1176
+ function Eo(e, t) {
1177
+ const r = Nr(), o = [
1130
1178
  t.hooks,
1131
1179
  t.remoteHandler.hooks,
1132
1180
  t.sharedHandler.hooks,
@@ -1134,15 +1182,15 @@ function ln(e, t) {
1134
1182
  t.loaderHook,
1135
1183
  t.bridgeHook
1136
1184
  ];
1137
- return r.length > 0 && r.forEach((o) => {
1138
- e != null && e.find((s) => s.name !== o.name) && e.push(o);
1139
- }), e && e.length > 0 && e.forEach((o) => {
1140
- n.forEach((s) => {
1141
- s.applyPlugin(o, t);
1185
+ return r.length > 0 && r.forEach((n) => {
1186
+ e != null && e.find((s) => s.name !== n.name) && e.push(n);
1187
+ }), e && e.length > 0 && e.forEach((n) => {
1188
+ o.forEach((s) => {
1189
+ s.applyPlugin(n, t);
1142
1190
  });
1143
1191
  }), e;
1144
1192
  }
1145
- function un(e) {
1193
+ function go(e) {
1146
1194
  return {
1147
1195
  name: e.name,
1148
1196
  alias: e.alias,
@@ -1153,15 +1201,15 @@ function un(e) {
1153
1201
  shareScope: e.shareScope
1154
1202
  };
1155
1203
  }
1156
- function z(e) {
1157
- var r, n, o, s, i, a;
1204
+ function F(e) {
1205
+ var r, o, n, s, i, c;
1158
1206
  const t = {};
1159
- for (const [l, c] of Object.entries(e.shared)) {
1160
- const u = c[0];
1161
- u && (t[l] = {
1207
+ for (const [a, l] of Object.entries(e.shared)) {
1208
+ const u = l[0];
1209
+ u && (t[a] = {
1162
1210
  version: u.version,
1163
1211
  singleton: (r = u.shareConfig) == null ? void 0 : r.singleton,
1164
- requiredVersion: ((n = u.shareConfig) == null ? void 0 : n.requiredVersion) === !1 ? !1 : (o = u.shareConfig) == null ? void 0 : o.requiredVersion,
1212
+ requiredVersion: ((o = u.shareConfig) == null ? void 0 : o.requiredVersion) === !1 ? !1 : (n = u.shareConfig) == null ? void 0 : n.requiredVersion,
1165
1213
  eager: u.eager,
1166
1214
  strictVersion: (s = u.shareConfig) == null ? void 0 : s.strictVersion
1167
1215
  });
@@ -1173,12 +1221,12 @@ function z(e) {
1173
1221
  },
1174
1222
  mfConfig: {
1175
1223
  name: e.name,
1176
- remotes: ((a = e.remotes) == null ? void 0 : a.map(un)) ?? [],
1224
+ remotes: ((c = e.remotes) == null ? void 0 : c.map(go)) ?? [],
1177
1225
  shared: t
1178
1226
  }
1179
1227
  };
1180
1228
  }
1181
- function vt(e) {
1229
+ function Ft(e) {
1182
1230
  return {
1183
1231
  resourceCategory: "sync",
1184
1232
  share: !0,
@@ -1186,180 +1234,293 @@ function vt(e) {
1186
1234
  ...e
1187
1235
  };
1188
1236
  }
1189
- function fn(e, t) {
1237
+ function _o(e, t) {
1190
1238
  return t.map((r) => {
1191
- const n = Qr(e, r.nameOrAlias);
1192
- return P(n, `Unable to preload ${r.nameOrAlias} as it is not included in ${!n && Ze({
1193
- remoteInfo: n,
1239
+ const o = ao(e, r.nameOrAlias);
1240
+ return O(o, `Unable to preload ${r.nameOrAlias} as it is not included in ${!o && ot({
1241
+ remoteInfo: o,
1194
1242
  remotes: e
1195
1243
  })}`), {
1196
- remote: n,
1197
- preloadConfig: vt(r)
1244
+ remote: o,
1245
+ preloadConfig: Ft(r)
1198
1246
  };
1199
1247
  });
1200
1248
  }
1201
- function hn(e) {
1249
+ function Ro(e) {
1202
1250
  return e ? e.map((t) => t === "." ? t : t.startsWith("./") ? t.replace("./", "") : t) : [];
1203
1251
  }
1204
- function At(e, t, r, n = !0) {
1205
- const { cssAssets: o, jsAssetsWithoutEntry: s, entryAssets: i } = r;
1252
+ function Be(e) {
1253
+ return e instanceof Error ? e.message.includes("timed out") || e.name.includes("Timeout") : !1;
1254
+ }
1255
+ function U(e, t, r, o) {
1256
+ return {
1257
+ url: t,
1258
+ status: r,
1259
+ resourceType: e.resourceType,
1260
+ initiator: e.initiator,
1261
+ id: e.id,
1262
+ error: o
1263
+ };
1264
+ }
1265
+ async function bo(e, t, r, o) {
1266
+ const n = e.moduleCache.get(r.name), s = r.entry;
1267
+ if (n != null && n.remoteEntryExports) return U(o, s, "cached");
1268
+ try {
1269
+ if (!await Ue({
1270
+ origin: e,
1271
+ remoteInfo: r,
1272
+ remoteEntryExports: n == null ? void 0 : n.remoteEntryExports,
1273
+ resourceContext: {
1274
+ ...o,
1275
+ url: s
1276
+ }
1277
+ })) throw new Error(`Failed to load remoteEntry "${s}".`);
1278
+ return U(o, s, "success");
1279
+ } catch (i) {
1280
+ return U(o, s, Be(i) ? "timeout" : "error", i);
1281
+ }
1282
+ }
1283
+ function $e({ host: e, remoteInfo: t, url: r, attrs: o, context: n, needDeleteLink: s }) {
1284
+ return new Promise((i) => {
1285
+ const { link: c, needAttach: a } = hr({
1286
+ url: r,
1287
+ cb: () => {
1288
+ i(U(n, r, a ? "success" : "cached"));
1289
+ },
1290
+ onErrorCallback: (l) => {
1291
+ i(U(n, r, Be(l) ? "timeout" : "error", l));
1292
+ },
1293
+ attrs: o,
1294
+ createLinkHook: (l, u) => {
1295
+ const f = e.loaderHook.lifecycle.createLink.emit({
1296
+ url: l,
1297
+ attrs: u,
1298
+ remoteInfo: t,
1299
+ resourceContext: {
1300
+ ...n,
1301
+ url: l
1302
+ }
1303
+ });
1304
+ return f instanceof HTMLLinkElement, f;
1305
+ },
1306
+ needDeleteLink: s
1307
+ });
1308
+ a && document.head.appendChild(c);
1309
+ });
1310
+ }
1311
+ function So({ host: e, remoteInfo: t, url: r, attrs: o, context: n }) {
1312
+ return new Promise((s) => {
1313
+ const { script: i, needAttach: c } = ct({
1314
+ url: r,
1315
+ cb: () => {
1316
+ s(U(n, r, c ? "success" : "cached"));
1317
+ },
1318
+ onErrorCallback: (a) => {
1319
+ s(U(n, r, Be(a) ? "timeout" : "error", a));
1320
+ },
1321
+ attrs: o,
1322
+ createScriptHook: (a, l) => {
1323
+ const u = e.loaderHook.lifecycle.createScript.emit({
1324
+ url: a,
1325
+ attrs: l,
1326
+ remoteInfo: t,
1327
+ resourceContext: {
1328
+ ...n,
1329
+ url: a
1330
+ }
1331
+ });
1332
+ return u instanceof HTMLScriptElement, u;
1333
+ },
1334
+ needDeleteScript: !0
1335
+ });
1336
+ c && document.head.appendChild(i);
1337
+ });
1338
+ }
1339
+ function Z(e, t) {
1340
+ return {
1341
+ ...e,
1342
+ resourceType: t
1343
+ };
1344
+ }
1345
+ function Ht(e, t, r, o = !0, n = {
1346
+ initiator: "preloadRemote",
1347
+ id: e.name
1348
+ }) {
1349
+ const { cssAssets: s, jsAssetsWithoutEntry: i, entryAssets: c } = r, a = [];
1206
1350
  if (t.options.inBrowser) {
1207
- if (i.forEach((a) => {
1208
- const { moduleInfo: l } = a, c = t.moduleCache.get(e.name);
1209
- pe(c ? {
1210
- origin: t,
1211
- remoteInfo: l,
1212
- remoteEntryExports: c.remoteEntryExports
1213
- } : {
1214
- origin: t,
1215
- remoteInfo: l,
1216
- remoteEntryExports: void 0
1217
- });
1218
- }), n) {
1219
- const a = {
1351
+ if (c.forEach((l) => {
1352
+ const { moduleInfo: u } = l;
1353
+ a.push(bo(t, e, u, Z(n, "remoteEntry")));
1354
+ }), o) {
1355
+ const l = {
1220
1356
  rel: "preload",
1221
1357
  as: "style"
1222
1358
  };
1223
- o.forEach((l) => {
1224
- const { link: c, needAttach: u } = _e({
1225
- url: l,
1226
- cb: () => {
1227
- },
1228
- attrs: a,
1229
- createLinkHook: (d, h) => {
1230
- const f = t.loaderHook.lifecycle.createLink.emit({
1231
- url: d,
1232
- attrs: h,
1233
- remoteInfo: e
1234
- });
1235
- if (f instanceof HTMLLinkElement) return f;
1236
- }
1237
- });
1238
- u && document.head.appendChild(c);
1359
+ s.forEach((u) => {
1360
+ a.push($e({
1361
+ host: t,
1362
+ remoteInfo: e,
1363
+ url: u,
1364
+ attrs: l,
1365
+ context: Z(n, "css")
1366
+ }));
1239
1367
  });
1240
1368
  } else {
1241
- const a = {
1369
+ const l = {
1242
1370
  rel: "stylesheet",
1243
1371
  type: "text/css"
1244
1372
  };
1245
- o.forEach((l) => {
1246
- const { link: c, needAttach: u } = _e({
1247
- url: l,
1248
- cb: () => {
1249
- },
1250
- attrs: a,
1251
- createLinkHook: (d, h) => {
1252
- const f = t.loaderHook.lifecycle.createLink.emit({
1253
- url: d,
1254
- attrs: h,
1255
- remoteInfo: e
1256
- });
1257
- if (f instanceof HTMLLinkElement) return f;
1258
- },
1259
- needDeleteLink: !1
1260
- });
1261
- u && document.head.appendChild(c);
1373
+ s.forEach((u) => {
1374
+ a.push($e({
1375
+ host: t,
1376
+ remoteInfo: e,
1377
+ url: u,
1378
+ attrs: l,
1379
+ needDeleteLink: !1,
1380
+ context: Z(n, "css")
1381
+ }));
1262
1382
  });
1263
1383
  }
1264
- if (n) {
1265
- const a = {
1384
+ if (o) {
1385
+ const l = {
1266
1386
  rel: "preload",
1267
1387
  as: "script"
1268
1388
  };
1269
- s.forEach((l) => {
1270
- const { link: c, needAttach: u } = _e({
1271
- url: l,
1272
- cb: () => {
1273
- },
1274
- attrs: a,
1275
- createLinkHook: (d, h) => {
1276
- const f = t.loaderHook.lifecycle.createLink.emit({
1277
- url: d,
1278
- attrs: h,
1279
- remoteInfo: e
1280
- });
1281
- if (f instanceof HTMLLinkElement) return f;
1282
- }
1283
- });
1284
- u && document.head.appendChild(c);
1389
+ i.forEach((u) => {
1390
+ a.push($e({
1391
+ host: t,
1392
+ remoteInfo: e,
1393
+ url: u,
1394
+ attrs: l,
1395
+ context: Z(n, "js")
1396
+ }));
1285
1397
  });
1286
1398
  } else {
1287
- const a = {
1399
+ const l = {
1288
1400
  fetchpriority: "high",
1289
1401
  type: (e == null ? void 0 : e.type) === "module" ? "module" : "text/javascript"
1290
1402
  };
1291
- s.forEach((l) => {
1292
- const { script: c, needAttach: u } = nt({
1293
- url: l,
1294
- cb: () => {
1295
- },
1296
- attrs: a,
1297
- createScriptHook: (d, h) => {
1298
- const f = t.loaderHook.lifecycle.createScript.emit({
1299
- url: d,
1300
- attrs: h,
1301
- remoteInfo: e
1302
- });
1303
- if (f instanceof HTMLScriptElement) return f;
1304
- },
1305
- needDeleteScript: !0
1306
- });
1307
- u && document.head.appendChild(c);
1403
+ i.forEach((u) => {
1404
+ a.push(So({
1405
+ host: t,
1406
+ remoteInfo: e,
1407
+ url: u,
1408
+ attrs: l,
1409
+ context: Z(n, "js")
1410
+ }));
1308
1411
  });
1309
1412
  }
1310
1413
  }
1414
+ return Promise.all(a);
1415
+ }
1416
+ function wo(e) {
1417
+ if (!e || !("modules" in e) || !Array.isArray(e.modules)) return;
1418
+ const t = e.modules.map((r) => r.moduleName).filter(Boolean);
1419
+ return t.length ? t.join(",") : void 0;
1311
1420
  }
1312
- function dn(e, t, r) {
1313
- const n = t, o = Array.isArray(e.shareScope) ? e.shareScope : [e.shareScope];
1314
- o.length || o.push("default"), o.forEach((i) => {
1315
- n[i] || (n[i] = {});
1421
+ function $o(e, t, r) {
1422
+ const o = t, n = Array.isArray(e.shareScope) ? e.shareScope : [e.shareScope];
1423
+ n.length || n.push("default"), n.forEach((i) => {
1424
+ o[i] || (o[i] = {});
1316
1425
  });
1317
1426
  const s = {
1318
1427
  version: e.version || "",
1319
- shareScopeKeys: Array.isArray(e.shareScope) ? o : e.shareScope || "default"
1428
+ shareScopeKeys: Array.isArray(e.shareScope) ? n : e.shareScope || "default"
1320
1429
  };
1321
1430
  return Object.defineProperty(s, "shareScopeMap", {
1322
- value: n,
1431
+ value: o,
1323
1432
  enumerable: !1
1324
1433
  }), {
1325
1434
  remoteEntryInitOptions: s,
1326
- shareScope: n[o[0]],
1435
+ shareScope: o[n[0]],
1327
1436
  initScope: r ?? []
1328
1437
  };
1329
1438
  }
1330
- var Pt = class {
1439
+ var Dt = class {
1331
1440
  constructor({ remoteInfo: e, host: t }) {
1332
1441
  this.inited = !1, this.initing = !1, this.lib = void 0, this.remoteInfo = e, this.host = t;
1333
1442
  }
1334
- async getEntry() {
1443
+ async getEntry(e) {
1335
1444
  if (this.remoteEntryExports) return this.remoteEntryExports;
1336
- const e = await pe({
1445
+ const t = await Ue({
1337
1446
  origin: this.host,
1338
1447
  remoteInfo: this.remoteInfo,
1339
- remoteEntryExports: this.remoteEntryExports
1448
+ remoteEntryExports: this.remoteEntryExports,
1449
+ resourceContext: {
1450
+ initiator: "loadRemote",
1451
+ id: xe(this.remoteInfo.name, e),
1452
+ resourceType: "remoteEntry"
1453
+ }
1340
1454
  });
1341
- return P(e, `remoteEntryExports is undefined
1342
- ${Ze(this.remoteInfo)}`), this.remoteEntryExports = e, this.remoteEntryExports;
1343
- }
1344
- async init(e, t, r) {
1345
- const n = await this.getEntry();
1346
- if (this.inited) return n;
1347
- if (this.initPromise)
1348
- return await this.initPromise, n;
1455
+ return O(t, `remoteEntryExports is undefined
1456
+ ${ot(this.remoteInfo)}`), this.remoteEntryExports = t, this.remoteEntryExports;
1457
+ }
1458
+ async init(e, t, r, o) {
1459
+ const n = await this.getEntry(o);
1460
+ if (this.inited)
1461
+ return await this.host.loaderHook.lifecycle.afterInitRemote.emit({
1462
+ id: e,
1463
+ remoteInfo: this.remoteInfo,
1464
+ remoteSnapshot: t,
1465
+ remoteEntryExports: n,
1466
+ cached: !0,
1467
+ origin: this.host
1468
+ }), n;
1469
+ if (this.initPromise) {
1470
+ try {
1471
+ await this.initPromise, await this.host.loaderHook.lifecycle.afterInitRemote.emit({
1472
+ id: e,
1473
+ remoteInfo: this.remoteInfo,
1474
+ remoteSnapshot: t,
1475
+ remoteEntryExports: n,
1476
+ cached: !0,
1477
+ origin: this.host
1478
+ });
1479
+ } catch (s) {
1480
+ throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({
1481
+ id: e,
1482
+ remoteInfo: this.remoteInfo,
1483
+ remoteSnapshot: t,
1484
+ remoteEntryExports: n,
1485
+ error: s,
1486
+ cached: !0,
1487
+ origin: this.host
1488
+ }), s;
1489
+ }
1490
+ return n;
1491
+ }
1349
1492
  this.initing = !0, this.initPromise = (async () => {
1350
- const { remoteEntryInitOptions: o, shareScope: s, initScope: i } = dn(this.remoteInfo, this.host.shareScopeMap, r), a = await this.host.hooks.lifecycle.beforeInitContainer.emit({
1351
- shareScope: s,
1352
- remoteEntryInitOptions: o,
1353
- initScope: i,
1493
+ await this.host.loaderHook.lifecycle.beforeInitRemote.emit({
1494
+ id: e,
1495
+ remoteInfo: this.remoteInfo,
1496
+ remoteSnapshot: t,
1497
+ origin: this.host
1498
+ });
1499
+ const { remoteEntryInitOptions: s, shareScope: i, initScope: c } = $o(this.remoteInfo, this.host.shareScopeMap, r), a = await this.host.hooks.lifecycle.beforeInitContainer.emit({
1500
+ shareScope: i,
1501
+ remoteEntryInitOptions: s,
1502
+ initScope: c,
1354
1503
  remoteInfo: this.remoteInfo,
1355
1504
  origin: this.host
1356
1505
  });
1357
- typeof (n == null ? void 0 : n.init) > "u" && R(_t, O, {
1506
+ typeof (n == null ? void 0 : n.init) > "u" && b($t, k, {
1358
1507
  hostName: this.host.name,
1359
1508
  remoteName: this.remoteInfo.name,
1360
1509
  remoteEntryUrl: this.remoteInfo.entry,
1361
1510
  remoteEntryKey: this.remoteInfo.entryGlobalName
1362
- }, void 0, z(this.host.options)), await n.init(a.shareScope, a.initScope, a.remoteEntryInitOptions), await this.host.hooks.lifecycle.initContainer.emit({
1511
+ }, void 0, F(this.host.options));
1512
+ try {
1513
+ await n.init(a.shareScope, a.initScope, a.remoteEntryInitOptions);
1514
+ } catch (l) {
1515
+ b(Mt, k, {
1516
+ hostName: this.host.name,
1517
+ remoteName: this.remoteInfo.name,
1518
+ remoteEntryUrl: this.remoteInfo.entry,
1519
+ remoteEntryKey: this.remoteInfo.entryGlobalName,
1520
+ shareScope: this.remoteInfo.shareScope
1521
+ }, `${l}`, F(this.host.options));
1522
+ }
1523
+ await this.host.hooks.lifecycle.initContainer.emit({
1363
1524
  ...a,
1364
1525
  id: e,
1365
1526
  remoteSnapshot: t,
@@ -1367,40 +1528,111 @@ var Pt = class {
1367
1528
  }), this.inited = !0;
1368
1529
  })();
1369
1530
  try {
1370
- await this.initPromise;
1531
+ await this.initPromise, await this.host.loaderHook.lifecycle.afterInitRemote.emit({
1532
+ id: e,
1533
+ remoteInfo: this.remoteInfo,
1534
+ remoteSnapshot: t,
1535
+ remoteEntryExports: n,
1536
+ origin: this.host
1537
+ });
1538
+ } catch (s) {
1539
+ throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({
1540
+ id: e,
1541
+ remoteInfo: this.remoteInfo,
1542
+ remoteSnapshot: t,
1543
+ remoteEntryExports: n,
1544
+ error: s,
1545
+ origin: this.host
1546
+ }), s;
1371
1547
  } finally {
1372
1548
  this.initing = !1, this.initPromise = void 0;
1373
1549
  }
1374
1550
  return n;
1375
1551
  }
1376
- async get(e, t, r, n) {
1377
- const { loadFactory: o = !0 } = r || { loadFactory: !0 }, s = await this.init(e, n);
1378
- this.lib = s;
1379
- let i;
1380
- i = await this.host.loaderHook.lifecycle.getModuleFactory.emit({
1552
+ async get(e, t, r, o) {
1553
+ const { loadFactory: n = !0 } = r || { loadFactory: !0 }, s = await this.init(e, o, void 0, t);
1554
+ this.lib = s, await this.host.loaderHook.lifecycle.beforeGetExpose.emit({
1555
+ id: e,
1556
+ expose: t,
1557
+ moduleInfo: this.remoteInfo,
1381
1558
  remoteEntryExports: s,
1559
+ origin: this.host
1560
+ });
1561
+ let i;
1562
+ try {
1563
+ const l = await this.host.loaderHook.lifecycle.getModuleFactory.emit({
1564
+ remoteEntryExports: s,
1565
+ expose: t,
1566
+ moduleInfo: this.remoteInfo
1567
+ });
1568
+ i = typeof l == "function" ? l : void 0, i || (i = await s.get(t)), i || b(Lt, k, {
1569
+ hostName: this.host.name,
1570
+ remoteName: this.remoteInfo.name,
1571
+ remoteEntryUrl: this.remoteInfo.entry,
1572
+ expose: t,
1573
+ requestId: e,
1574
+ availableExposes: wo(o)
1575
+ }, void 0, F(this.host.options)), await this.host.loaderHook.lifecycle.afterGetExpose.emit({
1576
+ id: e,
1577
+ expose: t,
1578
+ moduleInfo: this.remoteInfo,
1579
+ remoteEntryExports: s,
1580
+ moduleFactory: i,
1581
+ origin: this.host
1582
+ });
1583
+ } catch (l) {
1584
+ throw await this.host.loaderHook.lifecycle.afterGetExpose.emit({
1585
+ id: e,
1586
+ expose: t,
1587
+ moduleInfo: this.remoteInfo,
1588
+ remoteEntryExports: s,
1589
+ error: l,
1590
+ origin: this.host
1591
+ }), l;
1592
+ }
1593
+ const c = Sr(this.remoteInfo.name, t), a = this.wraperFactory(i, c);
1594
+ if (!n) return a;
1595
+ await this.host.loaderHook.lifecycle.beforeExecuteFactory.emit({
1596
+ id: e,
1382
1597
  expose: t,
1383
- moduleInfo: this.remoteInfo
1384
- }), i || (i = await s.get(t)), P(i, `${Z(this.remoteInfo)} remote don't export ${t}.`);
1385
- const a = dr(this.remoteInfo.name, t), l = this.wraperFactory(i, a);
1386
- return o ? await l() : l;
1598
+ moduleInfo: this.remoteInfo,
1599
+ loadFactory: n,
1600
+ origin: this.host
1601
+ });
1602
+ try {
1603
+ const l = await a();
1604
+ return await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({
1605
+ id: e,
1606
+ expose: t,
1607
+ moduleInfo: this.remoteInfo,
1608
+ loadFactory: n,
1609
+ exposeModule: l,
1610
+ origin: this.host
1611
+ }), l;
1612
+ } catch (l) {
1613
+ throw await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({
1614
+ id: e,
1615
+ expose: t,
1616
+ moduleInfo: this.remoteInfo,
1617
+ loadFactory: n,
1618
+ error: l,
1619
+ origin: this.host
1620
+ }), l;
1621
+ }
1387
1622
  }
1388
1623
  wraperFactory(e, t) {
1389
- function r(n, o) {
1390
- n && typeof n == "object" && Object.isExtensible(n) && !Object.getOwnPropertyDescriptor(n, Symbol.for("mf_module_id")) && Object.defineProperty(n, Symbol.for("mf_module_id"), {
1391
- value: o,
1624
+ function r(o, n) {
1625
+ o && typeof o == "object" && Object.isExtensible(o) && !Object.getOwnPropertyDescriptor(o, Symbol.for("mf_module_id")) && Object.defineProperty(o, Symbol.for("mf_module_id"), {
1626
+ value: n,
1392
1627
  enumerable: !1
1393
1628
  });
1394
1629
  }
1395
- return e instanceof Promise ? async () => {
1396
- const n = await e();
1397
- return r(n, t), n;
1398
- } : () => {
1399
- const n = e();
1400
- return r(n, t), n;
1630
+ return () => {
1631
+ const o = e();
1632
+ return o instanceof Promise ? o.then((n) => (r(n, t), n)) : (r(o, t), o);
1401
1633
  };
1402
1634
  }
1403
- }, v = class {
1635
+ }, A = class {
1404
1636
  constructor(e) {
1405
1637
  this.type = "", this.listeners = /* @__PURE__ */ new Set(), e && (this.type = e);
1406
1638
  }
@@ -1409,14 +1641,15 @@ var Pt = class {
1409
1641
  }
1410
1642
  once(e) {
1411
1643
  const t = this;
1412
- this.on(function r(...n) {
1413
- return t.remove(r), e.apply(null, n);
1644
+ this.on(function r(...o) {
1645
+ return t.remove(r), e.apply(null, o);
1414
1646
  });
1415
1647
  }
1416
1648
  emit(...e) {
1417
1649
  let t;
1418
1650
  return this.listeners.size > 0 && this.listeners.forEach((r) => {
1419
- t = r(...e);
1651
+ const o = r(...e);
1652
+ o !== void 0 && (t = o);
1420
1653
  }), t;
1421
1654
  }
1422
1655
  remove(e) {
@@ -1425,131 +1658,137 @@ var Pt = class {
1425
1658
  removeAll() {
1426
1659
  this.listeners.clear();
1427
1660
  }
1428
- }, A = class extends v {
1661
+ }, I = class extends A {
1429
1662
  emit(...e) {
1430
1663
  let t;
1431
1664
  const r = Array.from(this.listeners);
1432
1665
  if (r.length > 0) {
1433
- let n = 0;
1434
- const o = (s) => s === !1 ? !1 : n < r.length ? Promise.resolve(r[n++].apply(null, e)).then(o) : s;
1435
- t = o();
1666
+ let o = 0;
1667
+ const n = (s) => s === !1 ? !1 : o < r.length ? Promise.resolve(r[o++].apply(null, e)).then((i) => i === void 0 || e.length === 1 && i === e[0] ? n(s) : n(i)) : s;
1668
+ t = n();
1436
1669
  }
1437
1670
  return Promise.resolve(t);
1438
1671
  }
1439
1672
  };
1440
- function kt(e, t) {
1441
- if (!Me(t)) return !1;
1673
+ function xt(e, t) {
1674
+ if (!Ce(t)) return !1;
1442
1675
  if (e !== t) {
1443
1676
  for (const r in e) if (!(r in t)) return !1;
1444
1677
  }
1445
1678
  return !0;
1446
1679
  }
1447
- var W = class extends v {
1680
+ var K = class extends A {
1448
1681
  constructor(e) {
1449
- super(), this.onerror = R, this.type = e;
1682
+ super(), this.onerror = b, this.type = e;
1450
1683
  }
1451
1684
  emit(e) {
1452
- Me(e) || R(`The data for the "${this.type}" hook should be an object.`);
1685
+ Ce(e) || b(`The data for the "${this.type}" hook should be an object.`);
1453
1686
  for (const t of this.listeners) try {
1454
1687
  const r = t(e);
1455
- if (kt(e, r)) e = r;
1688
+ if (r === void 0) continue;
1689
+ if (xt(e, r)) e = r;
1456
1690
  else {
1457
1691
  this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);
1458
1692
  break;
1459
1693
  }
1460
1694
  } catch (r) {
1461
- Oe(r), this.onerror(r);
1695
+ te(r), this.onerror(r);
1462
1696
  }
1463
1697
  return e;
1464
1698
  }
1465
- }, D = class extends v {
1699
+ }, H = class extends A {
1466
1700
  constructor(e) {
1467
- super(), this.onerror = R, this.type = e;
1701
+ super(), this.onerror = b, this.type = e;
1468
1702
  }
1469
1703
  emit(e) {
1470
- Me(e) || R(`The response data for the "${this.type}" hook must be an object.`);
1704
+ Ce(e) || b(`The response data for the "${this.type}" hook must be an object.`);
1471
1705
  const t = Array.from(this.listeners);
1472
1706
  if (t.length > 0) {
1473
1707
  let r = 0;
1474
- const n = (s) => (Oe(s), this.onerror(s), e), o = (s) => {
1475
- if (kt(e, s)) {
1476
- if (e = s, r < t.length) try {
1477
- return Promise.resolve(t[r++](e)).then(o, n);
1478
- } catch (i) {
1479
- return n(i);
1480
- }
1481
- } else this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`);
1708
+ const o = (s) => (te(s), this.onerror(s), e), n = (s) => {
1709
+ if (s !== void 0 && xt(e, s)) e = s;
1710
+ else if (s !== void 0)
1711
+ return this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`), e;
1712
+ if (r < t.length) try {
1713
+ return Promise.resolve(t[r++](e)).then(n, o);
1714
+ } catch (i) {
1715
+ return o(i);
1716
+ }
1482
1717
  return e;
1483
1718
  };
1484
- return Promise.resolve(o(e));
1719
+ return Promise.resolve(n(e));
1485
1720
  }
1486
1721
  return Promise.resolve(e);
1487
1722
  }
1488
- }, j = class {
1723
+ }, z = class {
1489
1724
  constructor(e) {
1490
1725
  this.registerPlugins = {}, this.lifecycle = e, this.lifecycleKeys = Object.keys(e);
1491
1726
  }
1492
1727
  applyPlugin(e, t) {
1493
- var n;
1494
- P(hr(e), "Plugin configuration is invalid.");
1728
+ var o;
1729
+ O(br(e), "Plugin configuration is invalid.");
1495
1730
  const r = e.name;
1496
- P(r, "A name must be provided by the plugin."), this.registerPlugins[r] || (this.registerPlugins[r] = e, (n = e.apply) == null || n.call(e, t), Object.keys(this.lifecycle).forEach((o) => {
1497
- const s = e[o];
1498
- s && this.lifecycle[o].on(s);
1731
+ O(r, "A name must be provided by the plugin."), this.registerPlugins[r] || (this.registerPlugins[r] = e, (o = e.apply) == null || o.call(e, t), Object.keys(this.lifecycle).forEach((n) => {
1732
+ const s = e[n];
1733
+ s && this.lifecycle[n].on(s);
1499
1734
  }));
1500
1735
  }
1501
1736
  removePlugin(e) {
1502
- P(e, "A name is required.");
1737
+ O(e, "A name is required.");
1503
1738
  const t = this.registerPlugins[e];
1504
- P(t, `The plugin "${e}" is not registered.`), Object.keys(t).forEach((r) => {
1739
+ O(t, `The plugin "${e}" is not registered.`), Object.keys(t).forEach((r) => {
1505
1740
  r !== "name" && this.lifecycle[r].remove(t[r]);
1506
1741
  });
1507
1742
  }
1508
1743
  };
1509
- function Ot(e, t) {
1510
- const r = ct(t);
1511
- r.url || R(Nt, O, { remoteName: e.name });
1512
- let n = Te(t, r.url);
1513
- !F && !n.startsWith("http") && (n = `https:${n}`), e.type = r.type, e.entryGlobalName = r.globalName, e.entry = n, e.version = t.version, e.buildVersion = t.buildVersion;
1744
+ function Gt(e, t) {
1745
+ const r = dt(t);
1746
+ r.url || b(kt, k, { remoteName: e.name });
1747
+ let o = ve(t, r.url);
1748
+ !D && !o.startsWith("http") && (o = `https:${o}`), e.type = r.type, e.entryGlobalName = r.globalName, e.entry = o, e.version = t.version, e.buildVersion = t.buildVersion;
1514
1749
  }
1515
- function pn() {
1750
+ function Io() {
1516
1751
  return {
1517
1752
  name: "snapshot-plugin",
1518
1753
  async afterResolve(e) {
1519
- const { remote: t, pkgNameOrAlias: r, expose: n, origin: o, remoteInfo: s, id: i } = e;
1520
- if (!Le(t) || !it(t)) {
1521
- const { remoteSnapshot: a, globalSnapshot: l } = await o.snapshotHandler.loadRemoteSnapshotInfo({
1754
+ const { remote: t, pkgNameOrAlias: r, expose: o, origin: n, remoteInfo: s, id: i } = e;
1755
+ if (!Oe(t) || !ft(t)) {
1756
+ const { remoteSnapshot: c, globalSnapshot: a } = await n.snapshotHandler.loadRemoteSnapshotInfo({
1522
1757
  moduleInfo: t,
1523
- id: i
1758
+ id: xe(t.name, o)
1524
1759
  });
1525
- Ot(s, a);
1526
- const c = {
1760
+ Gt(s, c);
1761
+ const l = {
1527
1762
  remote: t,
1528
1763
  preloadConfig: {
1529
1764
  nameOrAlias: r,
1530
- exposes: [n],
1765
+ exposes: [o],
1531
1766
  resourceCategory: "sync",
1532
1767
  share: !1,
1533
1768
  depsRemote: !1
1534
1769
  }
1535
- }, u = await o.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({
1536
- origin: o,
1537
- preloadOptions: c,
1770
+ }, u = await n.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({
1771
+ origin: n,
1772
+ preloadOptions: l,
1538
1773
  remoteInfo: s,
1539
1774
  remote: t,
1540
- remoteSnapshot: a,
1541
- globalSnapshot: l
1775
+ remoteSnapshot: c,
1776
+ globalSnapshot: a
1542
1777
  });
1543
- return u && At(s, o, u, !1), {
1778
+ return u && Ht(s, n, u, !1, {
1779
+ initiator: "loadRemote",
1780
+ id: i
1781
+ }).catch(() => {
1782
+ }), {
1544
1783
  ...e,
1545
- remoteSnapshot: a
1784
+ remoteSnapshot: c
1546
1785
  };
1547
1786
  }
1548
1787
  return e;
1549
1788
  }
1550
1789
  };
1551
1790
  }
1552
- function mn(e) {
1791
+ function No(e) {
1553
1792
  const t = e.split(":");
1554
1793
  return t.length === 1 ? {
1555
1794
  name: t[0],
@@ -1562,114 +1801,114 @@ function mn(e) {
1562
1801
  version: t[2]
1563
1802
  };
1564
1803
  }
1565
- function Lt(e, t, r, n, o = {}, s) {
1566
- const { value: i } = q(e, Z(t)), a = s || i;
1567
- if (a && !Qe(a) && (r(a, t, n), a.remotesInfo)) {
1568
- const l = Object.keys(a.remotesInfo);
1569
- for (const c of l) {
1570
- if (o[c]) continue;
1571
- o[c] = !0;
1572
- const u = mn(c), d = a.remotesInfo[c];
1573
- Lt(e, {
1804
+ function Ut(e, t, r, o, n = {}, s) {
1805
+ const { value: i } = J(e, ye(t)), c = s || i;
1806
+ if (c && !nt(c) && (r(c, t, o), c.remotesInfo)) {
1807
+ const a = Object.keys(c.remotesInfo);
1808
+ for (const l of a) {
1809
+ if (n[l]) continue;
1810
+ n[l] = !0;
1811
+ const u = No(l), f = c.remotesInfo[l];
1812
+ Ut(e, {
1574
1813
  name: u.name,
1575
- version: d.matchedVersion
1576
- }, r, !1, o, void 0);
1814
+ version: f.matchedVersion
1815
+ }, r, !1, n, void 0);
1577
1816
  }
1578
1817
  }
1579
1818
  }
1580
- const $e = (e, t) => document.querySelector(`${e}[${e === "link" ? "href" : "src"}="${t}"]`);
1581
- function yn(e, t, r, n, o) {
1582
- const s = [], i = [], a = [], l = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set(), { options: u } = e, { preloadConfig: d } = t, { depsRemote: h } = d;
1583
- if (Lt(n, r, (p, m, g) => {
1819
+ const Ie = (e, t) => document.querySelector(`${e}[${e === "link" ? "href" : "src"}="${t}"]`);
1820
+ function To(e, t, r, o, n) {
1821
+ const s = [], i = [], c = [], a = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(), { options: u } = e, { preloadConfig: f } = t, { depsRemote: d } = f;
1822
+ if (Ut(o, r, (m, p, y) => {
1584
1823
  var $;
1585
1824
  let E;
1586
- if (g) E = d;
1587
- else if (Array.isArray(h)) {
1588
- const w = h.find((I) => I.nameOrAlias === m.name || I.nameOrAlias === m.alias);
1589
- if (!w) return;
1590
- E = vt(w);
1591
- } else if (h === !0) E = d;
1825
+ if (y) E = f;
1826
+ else if (Array.isArray(d)) {
1827
+ const S = d.find((v) => v.nameOrAlias === p.name || v.nameOrAlias === p.alias);
1828
+ if (!S) return;
1829
+ E = Ft(S);
1830
+ } else if (d === !0) E = f;
1592
1831
  else return;
1593
- const _ = Te(p, ct(p).url);
1594
- _ && a.push({
1595
- name: m.name,
1832
+ const _ = ve(m, dt(m).url);
1833
+ _ && c.push({
1834
+ name: p.name,
1596
1835
  moduleInfo: {
1597
- name: m.name,
1836
+ name: p.name,
1598
1837
  entry: _,
1599
- type: "remoteEntryType" in p ? p.remoteEntryType : "global",
1600
- entryGlobalName: "globalName" in p ? p.globalName : m.name,
1838
+ type: "remoteEntryType" in m ? m.remoteEntryType : "global",
1839
+ entryGlobalName: "globalName" in m ? m.globalName : p.name,
1601
1840
  shareScope: "",
1602
- version: "version" in p ? p.version : void 0
1841
+ version: "version" in m ? m.version : void 0
1603
1842
  },
1604
1843
  url: _
1605
1844
  });
1606
- let y = "modules" in p ? p.modules : [];
1607
- const b = hn(E.exposes);
1608
- b.length && "modules" in p && (y = ($ = p == null ? void 0 : p.modules) == null ? void 0 : $.reduce((w, I) => ((b == null ? void 0 : b.indexOf(I.moduleName)) !== -1 && w.push(I), w), []));
1609
- function S(w) {
1610
- const I = w.map((L) => Te(p, L));
1611
- return E.filter ? I.filter(E.filter) : I;
1845
+ let g = "modules" in m ? m.modules : [];
1846
+ const R = Ro(E.exposes);
1847
+ R.length && "modules" in m && (g = ($ = m == null ? void 0 : m.modules) == null ? void 0 : $.reduce((S, v) => ((R == null ? void 0 : R.indexOf(v.moduleName)) !== -1 && S.push(v), S), []));
1848
+ function w(S) {
1849
+ const v = S.map((L) => ve(m, L));
1850
+ return E.filter ? v.filter(E.filter) : v;
1612
1851
  }
1613
- if (y) {
1614
- const w = y.length;
1615
- for (let I = 0; I < w; I++) {
1616
- const L = y[I], ye = `${m.name}/${L.moduleName}`;
1852
+ if (g) {
1853
+ const S = g.length;
1854
+ for (let v = 0; v < S; v++) {
1855
+ const L = g[v], ge = `${p.name}/${L.moduleName}`;
1617
1856
  e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({
1618
- id: L.moduleName === "." ? m.name : ye,
1619
- name: m.name,
1620
- remoteSnapshot: p,
1857
+ id: L.moduleName === "." ? p.name : ge,
1858
+ name: p.name,
1859
+ remoteSnapshot: m,
1621
1860
  preloadConfig: E,
1622
- remote: m,
1861
+ remote: p,
1623
1862
  origin: e
1624
- }), !Er(ye) && (E.resourceCategory === "all" ? (s.push(...S(L.assets.css.async)), s.push(...S(L.assets.css.sync)), i.push(...S(L.assets.js.async)), i.push(...S(L.assets.js.sync))) : E.resourceCategory === "sync" && (s.push(...S(L.assets.css.sync)), i.push(...S(L.assets.js.sync))), _r(ye));
1863
+ }), !Tr(ge) && (E.resourceCategory === "all" ? (s.push(...w(L.assets.css.async)), s.push(...w(L.assets.css.sync)), i.push(...w(L.assets.js.async)), i.push(...w(L.assets.js.sync))) : E.resourceCategory === "sync" && (s.push(...w(L.assets.css.sync)), i.push(...w(L.assets.js.sync))), vr(ge));
1625
1864
  }
1626
1865
  }
1627
- }, !0, {}, o), o.shared && o.shared.length > 0) {
1628
- const p = (m, g) => {
1629
- const { shared: E } = he(e.shareScopeMap, g.sharedName, m, e.sharedHandler.hooks.lifecycle.resolveShare) || {};
1630
- E && typeof E.lib == "function" && (g.assets.js.sync.forEach((_) => {
1866
+ }, !0, {}, n), n.shared && n.shared.length > 0) {
1867
+ const m = (p, y) => {
1868
+ const { shared: E } = pe(e.shareScopeMap, y.sharedName, p, e.sharedHandler.hooks.lifecycle.resolveShare) || {};
1869
+ E && typeof E.lib == "function" && (y.assets.js.sync.forEach((_) => {
1870
+ a.add(_);
1871
+ }), y.assets.css.sync.forEach((_) => {
1631
1872
  l.add(_);
1632
- }), g.assets.css.sync.forEach((_) => {
1633
- c.add(_);
1634
1873
  }));
1635
1874
  };
1636
- o.shared.forEach((m) => {
1875
+ n.shared.forEach((p) => {
1637
1876
  var _;
1638
- const g = (_ = u.shared) == null ? void 0 : _[m.sharedName];
1639
- if (!g) return;
1640
- const E = m.version ? g.find((y) => y.version === m.version) : g;
1641
- E && at(E).forEach((y) => {
1642
- p(y, m);
1877
+ const y = (_ = u.shared) == null ? void 0 : _[p.sharedName];
1878
+ if (!y) return;
1879
+ const E = p.version ? y.find((g) => g.version === p.version) : y;
1880
+ E && ht(E).forEach((g) => {
1881
+ m(g, p);
1643
1882
  });
1644
1883
  });
1645
1884
  }
1646
- const f = i.filter((p) => !l.has(p) && !$e("script", p));
1885
+ const h = i.filter((m) => !a.has(m) && !Ie("script", m));
1647
1886
  return {
1648
- cssAssets: s.filter((p) => !c.has(p) && !$e("link", p)),
1649
- jsAssetsWithoutEntry: f,
1650
- entryAssets: a.filter((p) => !$e("script", p.url))
1887
+ cssAssets: s.filter((m) => !l.has(m) && !Ie("link", m)),
1888
+ jsAssetsWithoutEntry: h,
1889
+ entryAssets: c.filter((m) => !Ie("script", m.url))
1651
1890
  };
1652
1891
  }
1653
- const gn = function() {
1892
+ const vo = function() {
1654
1893
  return {
1655
1894
  name: "generate-preload-assets-plugin",
1656
1895
  async generatePreloadAssets(e) {
1657
- const { origin: t, preloadOptions: r, remoteInfo: n, remote: o, globalSnapshot: s, remoteSnapshot: i } = e;
1658
- return F ? Le(o) && it(o) ? {
1896
+ const { origin: t, preloadOptions: r, remoteInfo: o, remote: n, globalSnapshot: s, remoteSnapshot: i } = e;
1897
+ return D ? Oe(n) && ft(n) ? {
1659
1898
  cssAssets: [],
1660
1899
  jsAssetsWithoutEntry: [],
1661
1900
  entryAssets: [{
1662
- name: o.name,
1663
- url: o.entry,
1901
+ name: n.name,
1902
+ url: n.entry,
1664
1903
  moduleInfo: {
1665
- name: n.name,
1666
- entry: o.entry,
1667
- type: n.type || "global",
1904
+ name: o.name,
1905
+ entry: n.entry,
1906
+ type: o.type || "global",
1668
1907
  entryGlobalName: "",
1669
1908
  shareScope: ""
1670
1909
  }
1671
1910
  }]
1672
- } : (Ot(n, i), yn(t, r, n, s, i)) : {
1911
+ } : (Gt(o, i), To(t, r, o, s, i)) : {
1673
1912
  cssAssets: [],
1674
1913
  jsAssetsWithoutEntry: [],
1675
1914
  entryAssets: []
@@ -1677,132 +1916,156 @@ const gn = function() {
1677
1916
  }
1678
1917
  };
1679
1918
  };
1680
- function Mt(e, t) {
1681
- const r = le({
1919
+ function Bt(e, t) {
1920
+ const r = he({
1682
1921
  name: t.name,
1683
1922
  version: t.options.version
1684
- }), n = r && "remotesInfo" in r && r.remotesInfo && q(r.remotesInfo, e.name).value;
1685
- return n && n.matchedVersion ? {
1923
+ }), o = r && "remotesInfo" in r && r.remotesInfo && J(r.remotesInfo, e.name).value;
1924
+ return o && o.matchedVersion ? {
1686
1925
  hostGlobalSnapshot: r,
1687
- globalSnapshot: Ge(),
1688
- remoteSnapshot: le({
1926
+ globalSnapshot: Ve(),
1927
+ remoteSnapshot: he({
1689
1928
  name: e.name,
1690
- version: n.matchedVersion
1929
+ version: o.matchedVersion
1691
1930
  })
1692
1931
  } : {
1693
1932
  hostGlobalSnapshot: void 0,
1694
- globalSnapshot: Ge(),
1695
- remoteSnapshot: le({
1933
+ globalSnapshot: Ve(),
1934
+ remoteSnapshot: he({
1696
1935
  name: e.name,
1697
1936
  version: "version" in e ? e.version : void 0
1698
1937
  })
1699
1938
  };
1700
1939
  }
1701
- var En = class {
1940
+ var Ao = class {
1702
1941
  constructor(e) {
1703
- this.loadingHostSnapshot = null, this.manifestCache = /* @__PURE__ */ new Map(), this.hooks = new j({
1704
- beforeLoadRemoteSnapshot: new A("beforeLoadRemoteSnapshot"),
1705
- loadSnapshot: new D("loadGlobalSnapshot"),
1706
- loadRemoteSnapshot: new D("loadRemoteSnapshot"),
1707
- afterLoadSnapshot: new D("afterLoadSnapshot")
1708
- }), this.manifestLoading = Q.__FEDERATION__.__MANIFEST_LOADING__, this.HostInstance = e, this.loaderHook = e.loaderHook;
1709
- }
1710
- async loadRemoteSnapshotInfo({ moduleInfo: e, id: t, expose: r }) {
1711
- const { options: n } = this.HostInstance;
1942
+ this.loadingHostSnapshot = null, this.manifestCache = /* @__PURE__ */ new Map(), this.hooks = new z({
1943
+ beforeLoadRemoteSnapshot: new I("beforeLoadRemoteSnapshot"),
1944
+ loadSnapshot: new H("loadGlobalSnapshot"),
1945
+ loadRemoteSnapshot: new H("loadRemoteSnapshot"),
1946
+ afterLoadSnapshot: new H("afterLoadSnapshot")
1947
+ }), this.manifestLoading = re.__FEDERATION__.__MANIFEST_LOADING__, this.HostInstance = e, this.loaderHook = e.loaderHook;
1948
+ }
1949
+ async loadRemoteSnapshotInfo({ moduleInfo: e, id: t, initiator: r = "loadRemote" }) {
1950
+ const { options: o } = this.HostInstance;
1712
1951
  await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({
1713
- options: n,
1714
- moduleInfo: e
1952
+ options: o,
1953
+ moduleInfo: e,
1954
+ origin: this.HostInstance
1715
1955
  });
1716
- let o = le({
1956
+ let n = he({
1717
1957
  name: this.HostInstance.options.name,
1718
1958
  version: this.HostInstance.options.version
1719
1959
  });
1720
- o || (o = {
1960
+ n || (n = {
1721
1961
  version: this.HostInstance.options.version || "",
1722
1962
  remoteEntry: "",
1723
1963
  remotesInfo: {}
1724
- }, yr({ [this.HostInstance.options.name]: o })), o && "remotesInfo" in o && !q(o.remotesInfo, e.name).value && ("version" in e || "entry" in e) && (o.remotesInfo = {
1725
- ...o == null ? void 0 : o.remotesInfo,
1964
+ }, Ir({ [this.HostInstance.options.name]: n })), n && "remotesInfo" in n && !J(n.remotesInfo, e.name).value && ("version" in e || "entry" in e) && (n.remotesInfo = {
1965
+ ...n == null ? void 0 : n.remotesInfo,
1726
1966
  [e.name]: { matchedVersion: "version" in e ? e.version : e.entry }
1727
1967
  });
1728
- const { hostGlobalSnapshot: s, remoteSnapshot: i, globalSnapshot: a } = this.getGlobalRemoteInfo(e), { remoteSnapshot: l, globalSnapshot: c } = await this.hooks.lifecycle.loadSnapshot.emit({
1729
- options: n,
1968
+ const { hostGlobalSnapshot: s, remoteSnapshot: i, globalSnapshot: c } = this.getGlobalRemoteInfo(e), { remoteSnapshot: a, globalSnapshot: l } = await this.hooks.lifecycle.loadSnapshot.emit({
1969
+ options: o,
1730
1970
  moduleInfo: e,
1731
1971
  hostGlobalSnapshot: s,
1732
1972
  remoteSnapshot: i,
1733
- globalSnapshot: a
1973
+ globalSnapshot: c
1734
1974
  });
1735
- let u, d;
1736
- if (l) if (Qe(l)) {
1737
- const h = F ? l.remoteEntry : l.ssrRemoteEntry || l.remoteEntry || "", f = await this.getManifestJson(h, e, {}), p = xe({
1975
+ let u, f;
1976
+ if (a) if (nt(a)) {
1977
+ const d = D ? a.remoteEntry : a.ssrRemoteEntry || a.remoteEntry || "", h = await this.loadManifestSnapshot(d, e, {}, {
1978
+ initiator: r,
1979
+ id: t || e.name
1980
+ }), m = We({
1738
1981
  ...e,
1739
- entry: h
1740
- }, f);
1741
- u = f, d = p;
1982
+ entry: d
1983
+ }, h);
1984
+ u = h, f = m;
1742
1985
  } else {
1743
- const { remoteSnapshot: h } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1986
+ const { remoteSnapshot: d } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1744
1987
  options: this.HostInstance.options,
1745
1988
  moduleInfo: e,
1746
- remoteSnapshot: l,
1989
+ remoteSnapshot: a,
1747
1990
  from: "global"
1748
1991
  });
1749
- u = h, d = c;
1992
+ u = d, f = l;
1750
1993
  }
1751
- else if (Le(e)) {
1752
- const h = await this.getManifestJson(e.entry, e, {}), f = xe(e, h), { remoteSnapshot: p } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1753
- options: this.HostInstance.options,
1754
- moduleInfo: e,
1755
- remoteSnapshot: h,
1756
- from: "global"
1757
- });
1758
- u = p, d = f;
1759
- } else R($t, O, {
1994
+ else if (Oe(e)) {
1995
+ const d = await this.loadManifestSnapshot(e.entry, e, {}, {
1996
+ initiator: r,
1997
+ id: t || e.name
1998
+ }), h = We(e, d);
1999
+ u = d, f = h;
2000
+ } else b(vt, k, {
1760
2001
  remoteName: e.name,
1761
2002
  remoteVersion: e.version,
1762
2003
  hostName: this.HostInstance.options.name,
1763
- globalSnapshot: JSON.stringify(c)
1764
- }, void 0, z(this.HostInstance.options));
2004
+ globalSnapshot: JSON.stringify(l)
2005
+ }, void 0, F(this.HostInstance.options));
1765
2006
  return await this.hooks.lifecycle.afterLoadSnapshot.emit({
1766
2007
  id: t,
1767
2008
  host: this.HostInstance,
1768
- options: n,
2009
+ options: o,
1769
2010
  moduleInfo: e,
1770
2011
  remoteSnapshot: u
1771
2012
  }), {
1772
2013
  remoteSnapshot: u,
1773
- globalSnapshot: d
2014
+ globalSnapshot: f
1774
2015
  };
1775
2016
  }
1776
2017
  getGlobalRemoteInfo(e) {
1777
- return Mt(e, this.HostInstance);
2018
+ return Bt(e, this.HostInstance);
1778
2019
  }
1779
- async getManifestJson(e, t, r) {
1780
- const n = async () => {
1781
- let s = this.manifestCache.get(e);
1782
- if (s) return s;
2020
+ async getManifestJson(e, t, r, o) {
2021
+ return (async () => {
2022
+ const s = q(t);
2023
+ let i = this.manifestCache.get(e);
2024
+ if (i) return i;
1783
2025
  try {
1784
- let i = await this.loaderHook.lifecycle.fetch.emit(e, {}, me(t));
1785
- (!i || !(i instanceof Response)) && (i = await fetch(e, {})), s = await i.json();
1786
- } catch (i) {
1787
- s = await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
2026
+ let a = await this.loaderHook.lifecycle.fetch.emit(e, {}, s, o ? {
2027
+ ...o,
2028
+ url: e,
2029
+ resourceType: "manifest"
2030
+ } : void 0);
2031
+ (!a || !(a instanceof Response)) && (a = await fetch(e, {})), i = await a.json();
2032
+ } catch (a) {
2033
+ i = await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
1788
2034
  id: e,
1789
- error: i,
2035
+ error: a,
1790
2036
  from: "runtime",
1791
2037
  lifecycle: "afterResolve",
2038
+ remote: s,
1792
2039
  origin: this.HostInstance
1793
- }), s || (delete this.manifestLoading[e], R(bt, O, {
2040
+ }), i || (delete this.manifestLoading[e], b(It, k, {
1794
2041
  manifestUrl: e,
1795
2042
  moduleName: t.name,
1796
2043
  hostName: this.HostInstance.options.name
1797
- }, `${i}`, z(this.HostInstance.options)));
2044
+ }, `${a}`, F(this.HostInstance.options)));
1798
2045
  }
1799
- return P(s.metaData && s.exposes && s.shared, `"${e}" is not a valid federation manifest for remote "${t.name}". Missing required fields: ${[
1800
- !s.metaData && "metaData",
1801
- !s.exposes && "exposes",
1802
- !s.shared && "shared"
1803
- ].filter(Boolean).join(", ")}.`), this.manifestCache.set(e, s), s;
1804
- }, o = async () => {
1805
- const s = await n(), i = Qt(s, { version: e }), { remoteSnapshot: a } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
2046
+ const c = [
2047
+ !i.metaData && "metaData",
2048
+ !i.exposes && "exposes",
2049
+ !i.shared && "shared"
2050
+ ].filter(Boolean);
2051
+ return c.length > 0 && await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
2052
+ id: e,
2053
+ error: /* @__PURE__ */ new Error(`"${e}" is not a valid federation manifest for remote "${t.name}". Missing required fields: ${c.join(", ")}.`),
2054
+ from: "runtime",
2055
+ lifecycle: "afterResolve",
2056
+ remote: s,
2057
+ origin: this.HostInstance
2058
+ }), c.length > 0 && b(Pt, k, {
2059
+ manifestUrl: e,
2060
+ moduleName: t.name,
2061
+ hostName: this.HostInstance.options.name,
2062
+ missingFields: c.join(",")
2063
+ }, void 0, F(this.HostInstance.options)), this.manifestCache.set(e, i), i;
2064
+ })();
2065
+ }
2066
+ async loadManifestSnapshot(e, t, r, o) {
2067
+ const n = async () => {
2068
+ const s = await this.getManifestJson(e, t, r, o), i = ar(s, { version: e }), { remoteSnapshot: c } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1806
2069
  options: this.HostInstance.options,
1807
2070
  moduleInfo: t,
1808
2071
  manifestJson: s,
@@ -1810,33 +2073,66 @@ var En = class {
1810
2073
  manifestUrl: e,
1811
2074
  from: "manifest"
1812
2075
  });
1813
- return a;
2076
+ return c;
1814
2077
  };
1815
- return this.manifestLoading[e] || (this.manifestLoading[e] = o().then((s) => s)), this.manifestLoading[e];
2078
+ return this.manifestLoading[e] || (this.manifestLoading[e] = n().then((s) => s)), this.manifestLoading[e];
1816
2079
  }
1817
- }, _n = class {
2080
+ }, ko = class {
1818
2081
  constructor(e) {
1819
- this.hooks = new j({
1820
- beforeRegisterShare: new W("beforeRegisterShare"),
1821
- afterResolve: new D("afterResolve"),
1822
- beforeLoadShare: new D("beforeLoadShare"),
1823
- loadShare: new A(),
1824
- resolveShare: new W("resolveShare"),
1825
- initContainerShareScopeMap: new W("initContainerShareScopeMap")
2082
+ this.hooks = new z({
2083
+ beforeRegisterShare: new K("beforeRegisterShare"),
2084
+ afterResolve: new H("afterResolve"),
2085
+ beforeLoadShare: new H("beforeLoadShare"),
2086
+ loadShare: new I(),
2087
+ afterLoadShare: new A("afterLoadShare"),
2088
+ errorLoadShare: new A("errorLoadShare"),
2089
+ resolveShare: new K("resolveShare"),
2090
+ initContainerShareScopeMap: new K("initContainerShareScopeMap")
1826
2091
  }), this.host = e, this.shareScopeMap = {}, this.initTokens = {}, this._setGlobalShareScopeMap(e.options);
1827
2092
  }
2093
+ emitAfterLoadShare({ lifecycle: e, pkgName: t, shareInfo: r, selectedShared: o }) {
2094
+ try {
2095
+ this.hooks.lifecycle.afterLoadShare.emit({
2096
+ pkgName: t,
2097
+ shareInfo: r,
2098
+ selectedShared: o,
2099
+ shared: this.host.options.shared,
2100
+ shareScopeMap: this.shareScopeMap,
2101
+ lifecycle: e,
2102
+ origin: this.host
2103
+ });
2104
+ } catch (n) {
2105
+ te(n);
2106
+ }
2107
+ }
2108
+ emitErrorLoadShare({ lifecycle: e, pkgName: t, shareInfo: r, error: o, recovered: n }) {
2109
+ try {
2110
+ this.hooks.lifecycle.errorLoadShare.emit({
2111
+ pkgName: t,
2112
+ shareInfo: r,
2113
+ shared: this.host.options.shared,
2114
+ shareScopeMap: this.shareScopeMap,
2115
+ lifecycle: e,
2116
+ origin: this.host,
2117
+ error: o,
2118
+ recovered: n
2119
+ });
2120
+ } catch (s) {
2121
+ te(s);
2122
+ }
2123
+ }
1828
2124
  registerShared(e, t) {
1829
- const { newShareInfos: r, allShareInfos: n } = yt(e, t);
1830
- return Object.keys(r).forEach((o) => {
1831
- r[o].forEach((s) => {
2125
+ const { newShareInfos: r, allShareInfos: o } = bt(e, t);
2126
+ return Object.keys(r).forEach((n) => {
2127
+ r[n].forEach((s) => {
1832
2128
  s.scope.forEach((i) => {
1833
- var a;
2129
+ var c;
1834
2130
  this.hooks.lifecycle.beforeRegisterShare.emit({
1835
2131
  origin: this.host,
1836
- pkgName: o,
2132
+ pkgName: n,
1837
2133
  shared: s
1838
- }), (a = this.shareScopeMap[i]) != null && a[o] || this.setShared({
1839
- pkgName: o,
2134
+ }), (c = this.shareScopeMap[i]) != null && c[n] || this.setShared({
2135
+ pkgName: n,
1840
2136
  lib: s.lib,
1841
2137
  get: s.get,
1842
2138
  loaded: s.loaded || !!s.lib,
@@ -1847,69 +2143,107 @@ var En = class {
1847
2143
  });
1848
2144
  }), {
1849
2145
  newShareInfos: r,
1850
- allShareInfos: n
2146
+ allShareInfos: o
1851
2147
  };
1852
2148
  }
1853
2149
  async loadShare(e, t) {
1854
- const { host: r } = this, n = qe({
2150
+ const { host: r } = this, o = Xe({
1855
2151
  pkgName: e,
1856
2152
  extraOptions: t,
1857
2153
  shareInfos: r.options.shared
1858
2154
  });
1859
- n != null && n.scope && await Promise.all(n.scope.map(async (a) => {
1860
- await Promise.all(this.initializeSharing(a, { strategy: n.strategy }));
1861
- }));
1862
- const { shareInfo: o } = await this.hooks.lifecycle.beforeLoadShare.emit({
1863
- pkgName: e,
1864
- shareInfo: n,
1865
- shared: r.options.shared,
1866
- origin: r
1867
- });
1868
- P(o, `Cannot find shared "${e}" in host "${r.options.name}". Ensure the shared config for "${e}" is declared in the federation plugin options and the host has been initialized before loading shares.`);
1869
- const { shared: s, useTreesShaking: i } = he(this.shareScopeMap, e, o, this.hooks.lifecycle.resolveShare) || {};
1870
- if (s) {
1871
- const a = se(s, i);
1872
- if (a.lib)
1873
- return U(a, r.options.name), a.lib;
1874
- if (a.loading && !a.loaded) {
1875
- const l = await a.loading;
1876
- return a.loaded = !0, a.lib || (a.lib = l), U(a, r.options.name), l;
2155
+ let n = o;
2156
+ try {
2157
+ o != null && o.scope && await Promise.all(o.scope.map(async (a) => {
2158
+ await Promise.all(this.initializeSharing(a, { strategy: o.strategy }));
2159
+ })), n = (await this.hooks.lifecycle.beforeLoadShare.emit({
2160
+ pkgName: e,
2161
+ shareInfo: o,
2162
+ shared: r.options.shared,
2163
+ origin: r
2164
+ })).shareInfo, O(n, `Cannot find shared "${e}" in host "${r.options.name}". Ensure the shared config for "${e}" is declared in the federation plugin options and the host has been initialized before loading shares.`);
2165
+ const s = n, { shared: i, useTreesShaking: c } = pe(this.shareScopeMap, e, n, this.hooks.lifecycle.resolveShare) || {};
2166
+ if (i) {
2167
+ const a = ce(i, c);
2168
+ if (a.lib)
2169
+ return V(a, r.options.name), this.emitAfterLoadShare({
2170
+ lifecycle: "loadShare",
2171
+ pkgName: e,
2172
+ shareInfo: s,
2173
+ selectedShared: i
2174
+ }), a.lib;
2175
+ if (a.loading && !a.loaded) {
2176
+ const l = await a.loading;
2177
+ return a.loaded = !0, a.lib || (a.lib = l), V(a, r.options.name), this.emitAfterLoadShare({
2178
+ lifecycle: "loadShare",
2179
+ pkgName: e,
2180
+ shareInfo: s,
2181
+ selectedShared: i
2182
+ }), l;
2183
+ } else {
2184
+ const u = (async () => {
2185
+ const d = await a.get();
2186
+ return V(a, r.options.name), a.loaded = !0, a.lib = d, d;
2187
+ })();
2188
+ this.setShared({
2189
+ pkgName: e,
2190
+ loaded: !1,
2191
+ shared: i,
2192
+ from: r.options.name,
2193
+ lib: null,
2194
+ loading: u,
2195
+ treeShaking: c ? a : void 0
2196
+ });
2197
+ const f = await u;
2198
+ return this.emitAfterLoadShare({
2199
+ lifecycle: "loadShare",
2200
+ pkgName: e,
2201
+ shareInfo: s,
2202
+ selectedShared: i
2203
+ }), f;
2204
+ }
1877
2205
  } else {
1878
- const c = (async () => {
1879
- const u = await a.get();
1880
- return U(a, r.options.name), a.loaded = !0, a.lib = u, u;
2206
+ if (t != null && t.customShareInfo)
2207
+ return this.emitErrorLoadShare({
2208
+ lifecycle: "loadShare",
2209
+ pkgName: e,
2210
+ shareInfo: s,
2211
+ recovered: !0
2212
+ }), !1;
2213
+ const a = oe(s.treeShaking), l = ce(s, a), f = (async () => {
2214
+ const h = await l.get();
2215
+ l.lib = h, l.loaded = !0, V(l, r.options.name);
2216
+ const { shared: m, useTreesShaking: p } = pe(this.shareScopeMap, e, s, this.hooks.lifecycle.resolveShare) || {};
2217
+ if (m) {
2218
+ const y = ce(m, p);
2219
+ y.lib = h, y.loaded = !0, m.from = s.from;
2220
+ }
2221
+ return h;
1881
2222
  })();
1882
- return this.setShared({
2223
+ this.setShared({
1883
2224
  pkgName: e,
1884
2225
  loaded: !1,
1885
2226
  shared: s,
1886
2227
  from: r.options.name,
1887
2228
  lib: null,
1888
- loading: c,
1889
- treeShaking: i ? a : void 0
1890
- }), c;
2229
+ loading: f,
2230
+ treeShaking: a ? l : void 0
2231
+ });
2232
+ const d = await f;
2233
+ return this.emitAfterLoadShare({
2234
+ lifecycle: "loadShare",
2235
+ pkgName: e,
2236
+ shareInfo: s,
2237
+ selectedShared: s
2238
+ }), d;
1891
2239
  }
1892
- } else {
1893
- if (t != null && t.customShareInfo) return !1;
1894
- const a = ee(o.treeShaking), l = se(o, a), u = (async () => {
1895
- const d = await l.get();
1896
- l.lib = d, l.loaded = !0, U(l, r.options.name);
1897
- const { shared: h, useTreesShaking: f } = he(this.shareScopeMap, e, o, this.hooks.lifecycle.resolveShare) || {};
1898
- if (h) {
1899
- const p = se(h, f);
1900
- p.lib = d, p.loaded = !0, h.from = o.from;
1901
- }
1902
- return d;
1903
- })();
1904
- return this.setShared({
2240
+ } catch (s) {
2241
+ throw this.emitErrorLoadShare({
2242
+ lifecycle: "loadShare",
1905
2243
  pkgName: e,
1906
- loaded: !1,
1907
- shared: o,
1908
- from: r.options.name,
1909
- lib: null,
1910
- loading: u,
1911
- treeShaking: a ? l : void 0
1912
- }), u;
2244
+ shareInfo: n,
2245
+ error: s
2246
+ }), s;
1913
2247
  }
1914
2248
  }
1915
2249
  /**
@@ -1917,382 +2251,540 @@ var En = class {
1917
2251
  * It accepts one argument, the name of the share scope.
1918
2252
  * If the share scope does not exist, it creates one.
1919
2253
  */
1920
- initializeSharing(e = re, t) {
1921
- const { host: r } = this, n = t == null ? void 0 : t.from, o = t == null ? void 0 : t.strategy;
2254
+ initializeSharing(e = se, t) {
2255
+ const { host: r } = this, o = t == null ? void 0 : t.from, n = t == null ? void 0 : t.strategy;
1922
2256
  let s = t == null ? void 0 : t.initScope;
1923
2257
  const i = [];
1924
- if (n !== "build") {
1925
- const { initTokens: h } = this;
2258
+ if (o !== "build") {
2259
+ const { initTokens: d } = this;
1926
2260
  s || (s = []);
1927
- let f = h[e];
1928
- if (f || (f = h[e] = { from: this.host.name }), s.indexOf(f) >= 0) return i;
1929
- s.push(f);
2261
+ let h = d[e];
2262
+ if (h || (h = d[e] = { from: this.host.name }), s.indexOf(h) >= 0) return i;
2263
+ s.push(h);
1930
2264
  }
1931
- const a = this.shareScopeMap, l = r.options.name;
1932
- a[e] || (a[e] = {});
1933
- const c = a[e], u = (h, f) => {
1934
- var y;
1935
- const { version: p, eager: m } = f;
1936
- c[h] = c[h] || {};
1937
- const g = c[h], E = g[p] && se(g[p]), _ = !!(E && ("eager" in E && E.eager || "shareConfig" in E && ((y = E.shareConfig) != null && y.eager)));
1938
- (!E || E.strategy !== "loaded-first" && !E.loaded && (!m != !_ ? m : l > g[p].from)) && (g[p] = f);
1939
- }, d = async (h) => {
1940
- const { module: f } = await r.remoteHandler.getRemoteModuleAndOptions({ id: h });
1941
- let p;
2265
+ const c = this.shareScopeMap, a = r.options.name;
2266
+ c[e] || (c[e] = {});
2267
+ const l = c[e], u = (d, h) => {
2268
+ var g;
2269
+ const { version: m, eager: p } = h;
2270
+ l[d] = l[d] || {};
2271
+ const y = l[d], E = y[m] && ce(y[m]), _ = !!(E && ("eager" in E && E.eager || "shareConfig" in E && ((g = E.shareConfig) != null && g.eager)));
2272
+ (!E || E.strategy !== "loaded-first" && !E.loaded && (!p != !_ ? p : a > y[m].from)) && (y[m] = h);
2273
+ }, f = async (d) => {
2274
+ const { module: h } = await r.remoteHandler.getRemoteModuleAndOptions({ id: d });
2275
+ let m;
1942
2276
  try {
1943
- p = await f.getEntry();
1944
- } catch (m) {
1945
- if (p = await r.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
1946
- id: h,
1947
- error: m,
2277
+ m = await h.getEntry();
2278
+ } catch (p) {
2279
+ if (m = await r.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
2280
+ id: d,
2281
+ error: p,
1948
2282
  from: "runtime",
1949
2283
  lifecycle: "beforeLoadShare",
2284
+ remote: h.remoteInfo,
1950
2285
  origin: r
1951
- }), !p) return;
2286
+ }), !m) return;
1952
2287
  } finally {
1953
- p != null && p.init && !f.initing && (f.remoteEntryExports = p, await f.init(void 0, void 0, s));
2288
+ m != null && m.init && !h.initing && (h.remoteEntryExports = m, await h.init(void 0, void 0, s));
1954
2289
  }
1955
2290
  };
1956
- return Object.keys(r.options.shared).forEach((h) => {
1957
- r.options.shared[h].forEach((f) => {
1958
- f.scope.includes(e) && u(h, f);
2291
+ return Object.keys(r.options.shared).forEach((d) => {
2292
+ r.options.shared[d].forEach((h) => {
2293
+ h.scope.includes(e) && u(d, h);
1959
2294
  });
1960
- }), (r.options.shareStrategy === "version-first" || o === "version-first") && r.options.remotes.forEach((h) => {
1961
- h.shareScope === e && i.push(d(h.name));
2295
+ }), (r.options.shareStrategy === "version-first" || n === "version-first") && r.options.remotes.forEach((d) => {
2296
+ d.shareScope === e && i.push(f(d.name));
1962
2297
  }), i;
1963
2298
  }
1964
2299
  loadShareSync(e, t) {
1965
- const { host: r } = this, n = qe({
2300
+ const { host: r } = this, o = Xe({
1966
2301
  pkgName: e,
1967
2302
  extraOptions: t,
1968
2303
  shareInfos: r.options.shared
1969
2304
  });
1970
- n != null && n.scope && n.scope.forEach((i) => {
1971
- this.initializeSharing(i, { strategy: n.strategy });
1972
- });
1973
- const { shared: o, useTreesShaking: s } = he(this.shareScopeMap, e, n, this.hooks.lifecycle.resolveShare) || {};
1974
- if (o) {
1975
- if (typeof o.lib == "function")
1976
- return U(o, r.options.name), o.loaded || (o.loaded = !0, o.from === r.options.name && (n.loaded = !0)), o.lib;
1977
- if (typeof o.get == "function") {
1978
- const i = o.get();
1979
- if (!(i instanceof Promise))
1980
- return U(o, r.options.name), this.setShared({
2305
+ try {
2306
+ o != null && o.scope && o.scope.forEach((s) => {
2307
+ this.initializeSharing(s, { strategy: o.strategy });
2308
+ });
2309
+ const { shared: n } = pe(this.shareScopeMap, e, o, this.hooks.lifecycle.resolveShare) || {};
2310
+ if (n) {
2311
+ if (typeof n.lib == "function")
2312
+ return V(n, r.options.name), n.loaded || (n.loaded = !0, n.from === r.options.name && (o.loaded = !0)), this.emitAfterLoadShare({
2313
+ lifecycle: "loadShareSync",
1981
2314
  pkgName: e,
1982
- loaded: !0,
1983
- from: r.options.name,
1984
- lib: i,
1985
- shared: o
1986
- }), i;
2315
+ shareInfo: o,
2316
+ selectedShared: n
2317
+ }), n.lib;
2318
+ if (typeof n.get == "function") {
2319
+ const s = n.get();
2320
+ if (!(s instanceof Promise))
2321
+ return V(n, r.options.name), this.setShared({
2322
+ pkgName: e,
2323
+ loaded: !0,
2324
+ from: r.options.name,
2325
+ lib: s,
2326
+ shared: n
2327
+ }), this.emitAfterLoadShare({
2328
+ lifecycle: "loadShareSync",
2329
+ pkgName: e,
2330
+ shareInfo: o,
2331
+ selectedShared: n
2332
+ }), s;
2333
+ }
1987
2334
  }
1988
- }
1989
- if (n.lib)
1990
- return n.loaded || (n.loaded = !0), n.lib;
1991
- if (n.get) {
1992
- const i = n.get();
1993
- return i instanceof Promise && R((t == null ? void 0 : t.from) === "build" ? St : Pe, O, {
2335
+ if (o.lib)
2336
+ return o.loaded || (o.loaded = !0), this.emitAfterLoadShare({
2337
+ lifecycle: "loadShareSync",
2338
+ pkgName: e,
2339
+ shareInfo: o,
2340
+ selectedShared: o
2341
+ }), o.lib;
2342
+ if (o.get) {
2343
+ const s = o.get();
2344
+ return s instanceof Promise && b((t == null ? void 0 : t.from) === "build" ? Tt : Le, k, {
2345
+ hostName: r.options.name,
2346
+ sharedPkgName: e
2347
+ }, void 0, F(r.options)), o.lib = s, this.setShared({
2348
+ pkgName: e,
2349
+ loaded: !0,
2350
+ from: r.options.name,
2351
+ lib: o.lib,
2352
+ shared: o
2353
+ }), this.emitAfterLoadShare({
2354
+ lifecycle: "loadShareSync",
2355
+ pkgName: e,
2356
+ shareInfo: o,
2357
+ selectedShared: o
2358
+ }), o.lib;
2359
+ }
2360
+ b(Le, k, {
1994
2361
  hostName: r.options.name,
1995
2362
  sharedPkgName: e
1996
- }, void 0, z(r.options)), n.lib = i, this.setShared({
2363
+ }, void 0, F(r.options));
2364
+ } catch (n) {
2365
+ throw this.emitErrorLoadShare({
2366
+ lifecycle: "loadShareSync",
1997
2367
  pkgName: e,
1998
- loaded: !0,
1999
- from: r.options.name,
2000
- lib: n.lib,
2001
- shared: n
2002
- }), n.lib;
2368
+ shareInfo: o,
2369
+ error: n
2370
+ }), n;
2003
2371
  }
2004
- R(Pe, O, {
2005
- hostName: r.options.name,
2006
- sharedPkgName: e
2007
- }, void 0, z(r.options));
2008
2372
  }
2009
2373
  initShareScopeMap(e, t, r = {}) {
2010
- const { host: n } = this;
2374
+ const { host: o } = this;
2011
2375
  this.shareScopeMap[e] = t, this.hooks.lifecycle.initContainerShareScopeMap.emit({
2012
2376
  shareScope: t,
2013
- options: n.options,
2014
- origin: n,
2377
+ options: o.options,
2378
+ origin: o,
2015
2379
  scopeName: e,
2016
2380
  hostShareScopeMap: r.hostShareScopeMap
2017
2381
  });
2018
2382
  }
2019
- setShared({ pkgName: e, shared: t, from: r, lib: n, loading: o, loaded: s, get: i, treeShaking: a }) {
2020
- const { version: l, scope: c = "default", ...u } = t, d = Array.isArray(c) ? c : [c], h = (f) => {
2021
- const p = (g, E, _) => {
2022
- _ && !g[E] && (g[E] = _);
2023
- }, m = a ? f.treeShaking : f;
2024
- p(m, "loaded", s), p(m, "loading", o), p(m, "get", i);
2383
+ setShared({ pkgName: e, shared: t, from: r, lib: o, loading: n, loaded: s, get: i, treeShaking: c }) {
2384
+ const { version: a, scope: l = "default", ...u } = t, f = Array.isArray(l) ? l : [l], d = (h) => {
2385
+ const m = (y, E, _) => {
2386
+ _ && !y[E] && (y[E] = _);
2387
+ }, p = c ? h.treeShaking : h;
2388
+ m(p, "loaded", s), m(p, "loading", n), m(p, "get", i);
2025
2389
  };
2026
- d.forEach((f) => {
2027
- this.shareScopeMap[f] || (this.shareScopeMap[f] = {}), this.shareScopeMap[f][e] || (this.shareScopeMap[f][e] = {}), this.shareScopeMap[f][e][l] || (this.shareScopeMap[f][e][l] = {
2028
- version: l,
2029
- scope: [f],
2390
+ f.forEach((h) => {
2391
+ this.shareScopeMap[h] || (this.shareScopeMap[h] = {}), this.shareScopeMap[h][e] || (this.shareScopeMap[h][e] = {}), this.shareScopeMap[h][e][a] || (this.shareScopeMap[h][e][a] = {
2392
+ version: a,
2393
+ scope: [h],
2030
2394
  ...u,
2031
- lib: n
2395
+ lib: o
2032
2396
  });
2033
- const p = this.shareScopeMap[f][e][l];
2034
- h(p), r && p.from !== r && (p.from = r);
2397
+ const m = this.shareScopeMap[h][e][a];
2398
+ d(m), r && m.from !== r && (m.from = r);
2035
2399
  });
2036
2400
  }
2037
2401
  _setGlobalShareScopeMap(e) {
2038
- const t = gt(), r = e.id || e.name;
2402
+ const t = St(), r = e.id || e.name;
2039
2403
  r && !t[r] && (t[r] = this.shareScopeMap);
2040
2404
  }
2041
- }, bn = class {
2405
+ }, Po = class {
2042
2406
  constructor(e) {
2043
- this.hooks = new j({
2044
- beforeRegisterRemote: new W("beforeRegisterRemote"),
2045
- registerRemote: new W("registerRemote"),
2046
- beforeRequest: new D("beforeRequest"),
2047
- onLoad: new A("onLoad"),
2048
- handlePreloadModule: new v("handlePreloadModule"),
2049
- errorLoadRemote: new A("errorLoadRemote"),
2050
- beforePreloadRemote: new A("beforePreloadRemote"),
2051
- generatePreloadAssets: new A("generatePreloadAssets"),
2052
- afterPreloadRemote: new A(),
2053
- loadEntry: new A()
2407
+ this.hooks = new z({
2408
+ beforeRegisterRemote: new K("beforeRegisterRemote"),
2409
+ registerRemote: new K("registerRemote"),
2410
+ beforeRequest: new H("beforeRequest"),
2411
+ afterMatchRemote: new I("afterMatchRemote"),
2412
+ onLoad: new I("onLoad"),
2413
+ afterLoadRemote: new I("afterLoadRemote"),
2414
+ handlePreloadModule: new A("handlePreloadModule"),
2415
+ errorLoadRemote: new I("errorLoadRemote"),
2416
+ beforePreloadRemote: new I("beforePreloadRemote"),
2417
+ generatePreloadAssets: new I("generatePreloadAssets"),
2418
+ afterPreloadRemote: new I("afterPreloadRemote"),
2419
+ loadEntry: new I()
2054
2420
  }), this.host = e, this.idToRemoteMap = {};
2055
2421
  }
2056
2422
  formatAndRegisterRemote(e, t) {
2057
- return (t.remotes || []).reduce((r, n) => (this.registerRemote(n, r, { force: !1 }), r), e.remotes);
2423
+ return (t.remotes || []).reduce((r, o) => (this.registerRemote(o, r, { force: !1 }), r), e.remotes);
2058
2424
  }
2059
2425
  setIdToRemoteMap(e, t) {
2060
- const { remote: r, expose: n } = t, { name: o, alias: s } = r;
2426
+ const { remote: r, expose: o } = t, { name: n, alias: s } = r;
2061
2427
  if (this.idToRemoteMap[e] = {
2062
2428
  name: r.name,
2063
- expose: n
2064
- }, s && e.startsWith(o)) {
2065
- const i = e.replace(o, s);
2429
+ expose: o
2430
+ }, s && e.startsWith(n)) {
2431
+ const i = e.replace(n, s);
2066
2432
  this.idToRemoteMap[i] = {
2067
2433
  name: r.name,
2068
- expose: n
2434
+ expose: o
2069
2435
  };
2070
2436
  return;
2071
2437
  }
2072
2438
  if (s && e.startsWith(s)) {
2073
- const i = e.replace(s, o);
2439
+ const i = e.replace(s, n);
2074
2440
  this.idToRemoteMap[i] = {
2075
2441
  name: r.name,
2076
- expose: n
2442
+ expose: o
2077
2443
  };
2078
2444
  }
2079
2445
  }
2080
2446
  async loadRemote(e, t) {
2081
- const { host: r } = this;
2447
+ const { host: r } = this, o = Ye(r.options.remotes, e);
2448
+ let n = e, s = o == null ? void 0 : o.expose, i = o ? q(o.remote) : void 0, c;
2082
2449
  try {
2083
- const { loadFactory: n = !0 } = t || { loadFactory: !0 }, { module: o, moduleOptions: s, remoteMatchInfo: i } = await this.getRemoteModuleAndOptions({ id: e }), { pkgNameOrAlias: a, remote: l, expose: c, id: u, remoteSnapshot: d } = i, h = await o.get(u, c, t, d), f = await this.hooks.lifecycle.onLoad.emit({
2084
- id: u,
2085
- pkgNameOrAlias: a,
2086
- expose: c,
2087
- exposeModule: n ? h : void 0,
2088
- exposeModuleFactory: n ? void 0 : h,
2089
- remote: l,
2090
- options: s,
2091
- moduleInstance: o,
2450
+ const { loadFactory: a = !0 } = t || { loadFactory: !0 }, { module: l, moduleOptions: u, remoteMatchInfo: f } = await this.getRemoteModuleAndOptions({ id: e }), { pkgNameOrAlias: d, remote: h, expose: m, id: p, remoteSnapshot: y } = f;
2451
+ n = p, s = m, i = q(h);
2452
+ const E = await l.get(p, m, t, y), _ = await this.hooks.lifecycle.onLoad.emit({
2453
+ id: p,
2454
+ pkgNameOrAlias: d,
2455
+ expose: m,
2456
+ exposeModule: a ? E : void 0,
2457
+ exposeModuleFactory: a ? void 0 : E,
2458
+ remote: h,
2459
+ options: u,
2460
+ moduleInstance: l,
2092
2461
  origin: r
2093
2462
  });
2094
- return this.setIdToRemoteMap(e, i), typeof f == "function" ? f : h;
2095
- } catch (n) {
2096
- const { from: o = "runtime" } = t || { from: "runtime" }, s = await this.hooks.lifecycle.errorLoadRemote.emit({
2097
- id: e,
2098
- error: n,
2099
- from: o,
2100
- lifecycle: "onLoad",
2463
+ return this.setIdToRemoteMap(e, f), c = {
2464
+ id: n,
2465
+ expose: s,
2466
+ remote: i,
2467
+ options: t,
2101
2468
  origin: r
2102
- });
2103
- if (!s) throw n;
2104
- return s;
2469
+ }, typeof _ == "function" ? _ : E;
2470
+ } catch (a) {
2471
+ const { from: l = "runtime" } = t || { from: "runtime" };
2472
+ let u;
2473
+ try {
2474
+ u = await this.hooks.lifecycle.errorLoadRemote.emit({
2475
+ id: e,
2476
+ error: a,
2477
+ from: l,
2478
+ lifecycle: "onLoad",
2479
+ expose: s,
2480
+ remote: i,
2481
+ origin: r
2482
+ });
2483
+ } catch (f) {
2484
+ throw c = {
2485
+ id: n,
2486
+ expose: s,
2487
+ remote: i,
2488
+ options: t,
2489
+ error: f,
2490
+ origin: r
2491
+ }, f;
2492
+ }
2493
+ if (!u)
2494
+ throw c = {
2495
+ id: n,
2496
+ expose: s,
2497
+ remote: i,
2498
+ options: t,
2499
+ error: a,
2500
+ origin: r
2501
+ }, a;
2502
+ return c = {
2503
+ id: n,
2504
+ expose: s,
2505
+ remote: i,
2506
+ options: t,
2507
+ error: a,
2508
+ origin: r,
2509
+ recovered: !0
2510
+ }, u;
2511
+ } finally {
2512
+ c && await this.hooks.lifecycle.afterLoadRemote.emit(c);
2105
2513
  }
2106
2514
  }
2107
2515
  async preloadRemote(e) {
2108
- const { host: t } = this;
2516
+ const { host: t } = this, r = [];
2109
2517
  await this.hooks.lifecycle.beforePreloadRemote.emit({
2110
2518
  preloadOps: e,
2111
2519
  options: t.options,
2112
2520
  origin: t
2113
2521
  });
2114
- const r = fn(t.options.remotes, e);
2115
- await Promise.all(r.map(async (n) => {
2116
- const { remote: o } = n, s = me(o), { globalSnapshot: i, remoteSnapshot: a } = await t.snapshotHandler.loadRemoteSnapshotInfo({ moduleInfo: o }), l = await this.hooks.lifecycle.generatePreloadAssets.emit({
2117
- origin: t,
2118
- preloadOptions: n,
2119
- remote: o,
2120
- remoteInfo: s,
2121
- globalSnapshot: i,
2122
- remoteSnapshot: a
2123
- });
2124
- l && At(s, t, l);
2522
+ const o = _o(t.options.remotes, e), n = (c) => {
2523
+ const { preloadConfig: a, remote: l } = c, u = a.exposes || [];
2524
+ return u.length ? u.map((f) => ({
2525
+ ops: {
2526
+ ...c,
2527
+ preloadConfig: {
2528
+ ...a,
2529
+ exposes: [f]
2530
+ }
2531
+ },
2532
+ id: xe(l.name, f)
2533
+ })) : [{
2534
+ ops: c,
2535
+ id: `${l.name}/*`
2536
+ }];
2537
+ };
2538
+ let s;
2539
+ await Promise.all(o.flatMap(n).map(async (c) => {
2540
+ const { ops: a, id: l } = c, { remote: u, preloadConfig: f } = a, d = q(u);
2541
+ try {
2542
+ const { globalSnapshot: h, remoteSnapshot: m } = await t.snapshotHandler.loadRemoteSnapshotInfo({
2543
+ moduleInfo: u,
2544
+ id: l,
2545
+ initiator: "preloadRemote"
2546
+ }), p = await this.hooks.lifecycle.generatePreloadAssets.emit({
2547
+ origin: t,
2548
+ preloadOptions: a,
2549
+ remote: u,
2550
+ remoteInfo: d,
2551
+ globalSnapshot: h,
2552
+ remoteSnapshot: m
2553
+ });
2554
+ if (!p) return;
2555
+ const y = await Ht(d, t, p, !0, {
2556
+ initiator: "preloadRemote",
2557
+ id: l
2558
+ });
2559
+ r.push({
2560
+ remote: u,
2561
+ remoteInfo: d,
2562
+ preloadConfig: f,
2563
+ id: l,
2564
+ results: y
2565
+ });
2566
+ } catch (h) {
2567
+ r.push({
2568
+ remote: u,
2569
+ remoteInfo: d,
2570
+ preloadConfig: f,
2571
+ id: l,
2572
+ results: [{
2573
+ url: d.entry,
2574
+ status: "error",
2575
+ resourceType: /\.json(?:$|[?#])/i.test(d.entry) ? "manifest" : "remoteEntry",
2576
+ initiator: "preloadRemote",
2577
+ id: l,
2578
+ error: h
2579
+ }]
2580
+ });
2581
+ }
2125
2582
  }));
2583
+ const i = r.flatMap((c) => c.results.filter((a) => a.status === "error" || a.status === "timeout"));
2584
+ if (i.length > 0 && (s = /* @__PURE__ */ new Error(`preloadRemote failed to load ${i.length} resource(s).`), Object.assign(s, {
2585
+ results: r,
2586
+ failedResults: i
2587
+ })), await this.hooks.lifecycle.afterPreloadRemote.emit({
2588
+ preloadOps: e,
2589
+ options: t.options,
2590
+ origin: t,
2591
+ results: r,
2592
+ error: s
2593
+ }), s) throw s;
2126
2594
  }
2127
2595
  registerRemotes(e, t) {
2128
2596
  const { host: r } = this;
2129
- e.forEach((n) => {
2130
- this.registerRemote(n, r.options.remotes, { force: t == null ? void 0 : t.force });
2597
+ e.forEach((o) => {
2598
+ this.registerRemote(o, r.options.remotes, { force: t == null ? void 0 : t.force });
2131
2599
  });
2132
2600
  }
2133
2601
  async getRemoteModuleAndOptions(e) {
2134
2602
  const { host: t } = this, { id: r } = e;
2135
- let n;
2603
+ let o;
2136
2604
  try {
2137
- n = await this.hooks.lifecycle.beforeRequest.emit({
2605
+ o = await this.hooks.lifecycle.beforeRequest.emit({
2138
2606
  id: r,
2139
2607
  options: t.options,
2140
2608
  origin: t
2141
2609
  });
2142
- } catch (f) {
2143
- if (n = await this.hooks.lifecycle.errorLoadRemote.emit({
2610
+ } catch (h) {
2611
+ if (o = await this.hooks.lifecycle.errorLoadRemote.emit({
2144
2612
  id: r,
2145
2613
  options: t.options,
2146
2614
  origin: t,
2147
2615
  from: "runtime",
2148
- error: f,
2616
+ error: h,
2149
2617
  lifecycle: "beforeRequest"
2150
- }), !n) throw f;
2618
+ }), !o) throw h;
2151
2619
  }
2152
- const { id: o } = n, s = Zr(t.options.remotes, o);
2153
- s || R(Rt, O, {
2154
- hostName: t.options.name,
2155
- requestId: o
2156
- }, void 0, z(t.options));
2157
- const { remote: i } = s, a = me(i), l = await t.sharedHandler.hooks.lifecycle.afterResolve.emit({
2158
- id: o,
2620
+ const { id: n } = o, s = Ye(t.options.remotes, n);
2621
+ if (!s) try {
2622
+ b(Nt, k, {
2623
+ hostName: t.options.name,
2624
+ requestId: n
2625
+ }, void 0, F(t.options));
2626
+ } catch (h) {
2627
+ throw await this.hooks.lifecycle.afterMatchRemote.emit({
2628
+ id: n,
2629
+ options: t.options,
2630
+ error: h,
2631
+ origin: t
2632
+ }), h;
2633
+ }
2634
+ const { remote: i } = s, c = q(i);
2635
+ await this.hooks.lifecycle.afterMatchRemote.emit({
2636
+ id: n,
2637
+ ...s,
2638
+ options: t.options,
2639
+ remoteInfo: c,
2640
+ origin: t
2641
+ });
2642
+ const a = await t.sharedHandler.hooks.lifecycle.afterResolve.emit({
2643
+ id: n,
2159
2644
  ...s,
2160
2645
  options: t.options,
2161
2646
  origin: t,
2162
- remoteInfo: a
2163
- }), { remote: c, expose: u } = l;
2164
- P(c && u, `The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${o}.`);
2165
- let d = t.moduleCache.get(c.name);
2166
- const h = {
2647
+ remoteInfo: c
2648
+ }), { remote: l, expose: u } = a;
2649
+ O(l && u, `The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${n}.`);
2650
+ let f = t.moduleCache.get(l.name);
2651
+ const d = {
2167
2652
  host: t,
2168
- remoteInfo: a
2653
+ remoteInfo: c
2169
2654
  };
2170
- return d || (d = new Pt(h), t.moduleCache.set(c.name, d)), {
2171
- module: d,
2172
- moduleOptions: h,
2173
- remoteMatchInfo: l
2655
+ return f || (f = new Dt(d), t.moduleCache.set(l.name, f)), {
2656
+ module: f,
2657
+ moduleOptions: d,
2658
+ remoteMatchInfo: a
2174
2659
  };
2175
2660
  }
2176
2661
  registerRemote(e, t, r) {
2177
- const { host: n } = this, o = () => {
2662
+ const { host: o } = this, n = () => {
2178
2663
  if (e.alias) {
2179
- const i = t.find((a) => {
2180
- var l;
2181
- return e.alias && (a.name.startsWith(e.alias) || ((l = a.alias) == null ? void 0 : l.startsWith(e.alias)));
2664
+ const i = t.find((c) => {
2665
+ var a;
2666
+ return e.alias && (c.name.startsWith(e.alias) || ((a = c.alias) == null ? void 0 : a.startsWith(e.alias)));
2182
2667
  });
2183
- P(!i, `The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${i && i.name} name or alias`);
2668
+ O(!i, `The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${i && i.name} name or alias`);
2184
2669
  }
2185
- "entry" in e && F && typeof window < "u" && !e.entry.startsWith("http") && (e.entry = new URL(e.entry, window.location.origin).href), e.shareScope || (e.shareScope = re), e.type || (e.type = mt);
2670
+ "entry" in e && D && typeof window < "u" && !e.entry.startsWith("http") && (e.entry = new URL(e.entry, window.location.origin).href), e.shareScope || (e.shareScope = se), e.type || (e.type = Rt);
2186
2671
  };
2187
2672
  this.hooks.lifecycle.beforeRegisterRemote.emit({
2188
2673
  remote: e,
2189
- origin: n
2674
+ origin: o
2190
2675
  });
2191
2676
  const s = t.find((i) => i.name === e.name);
2192
2677
  if (!s)
2193
- o(), t.push(e), this.hooks.lifecycle.registerRemote.emit({
2678
+ n(), t.push(e), this.hooks.lifecycle.registerRemote.emit({
2194
2679
  remote: e,
2195
- origin: n
2680
+ origin: o
2196
2681
  });
2197
2682
  else {
2198
2683
  const i = [`The remote "${e.name}" is already registered.`, "Please note that overriding it may cause unexpected errors."];
2199
- r != null && r.force && (this.removeRemote(s), o(), t.push(e), this.hooks.lifecycle.registerRemote.emit({
2684
+ r != null && r.force && (this.removeRemote(s), n(), t.push(e), this.hooks.lifecycle.registerRemote.emit({
2200
2685
  remote: e,
2201
- origin: n
2202
- }), Ye(i.join(" ")));
2686
+ origin: o
2687
+ }), rt(i.join(" ")));
2203
2688
  }
2204
2689
  }
2205
2690
  removeRemote(e) {
2206
2691
  var t;
2207
2692
  try {
2208
- const { host: r } = this, { name: n } = e, o = r.options.remotes.findIndex((i) => i.name === n);
2209
- o !== -1 && r.options.remotes.splice(o, 1);
2693
+ const { host: r } = this, { name: o } = e, n = r.options.remotes.findIndex((i) => i.name === o);
2694
+ n !== -1 && r.options.remotes.splice(n, 1);
2210
2695
  const s = r.moduleCache.get(e.name);
2211
2696
  if (s) {
2212
- const i = s.remoteInfo, a = i.entryGlobalName;
2213
- N[a] && ((t = Object.getOwnPropertyDescriptor(N, a)) != null && t.configurable ? delete N[a] : N[a] = void 0);
2214
- const l = ke(s.remoteInfo);
2215
- V[l] && delete V[l], r.snapshotHandler.manifestCache.delete(i.entry);
2216
- let c = i.buildVersion ? Xe(i.name, i.buildVersion) : i.name;
2217
- const u = N.__FEDERATION__.__INSTANCES__.findIndex((h) => i.buildVersion ? h.options.id === c : h.name === c);
2697
+ const i = s.remoteInfo, c = i.entryGlobalName;
2698
+ N[c] && ((t = Object.getOwnPropertyDescriptor(N, c)) != null && t.configurable ? delete N[c] : N[c] = void 0);
2699
+ const a = Me(s.remoteInfo);
2700
+ j[a] && delete j[a], r.snapshotHandler.manifestCache.delete(i.entry);
2701
+ let l = i.buildVersion ? tt(i.name, i.buildVersion) : i.name;
2702
+ const u = N.__FEDERATION__.__INSTANCES__.findIndex((d) => i.buildVersion ? d.options.id === l : d.name === l);
2218
2703
  if (u !== -1) {
2219
- const h = N.__FEDERATION__.__INSTANCES__[u];
2220
- c = h.options.id || c;
2221
- const f = gt();
2222
- let p = !0;
2223
- const m = [];
2224
- Object.keys(f).forEach((g) => {
2225
- const E = f[g];
2704
+ const d = N.__FEDERATION__.__INSTANCES__[u];
2705
+ l = d.options.id || l;
2706
+ const h = St();
2707
+ let m = !0;
2708
+ const p = [];
2709
+ Object.keys(h).forEach((y) => {
2710
+ const E = h[y];
2226
2711
  E && Object.keys(E).forEach((_) => {
2227
- const y = E[_];
2228
- y && Object.keys(y).forEach((b) => {
2229
- const S = y[b];
2230
- S && Object.keys(S).forEach(($) => {
2231
- const w = S[$];
2232
- w && typeof w == "object" && w.from === i.name && (w.loaded || w.loading ? (w.useIn = w.useIn.filter((I) => I !== i.name), w.useIn.length ? p = !1 : m.push([
2233
- g,
2712
+ const g = E[_];
2713
+ g && Object.keys(g).forEach((R) => {
2714
+ const w = g[R];
2715
+ w && Object.keys(w).forEach(($) => {
2716
+ const S = w[$];
2717
+ S && typeof S == "object" && S.from === i.name && (S.loaded || S.loading ? (S.useIn = S.useIn.filter((v) => v !== i.name), S.useIn.length ? m = !1 : p.push([
2718
+ y,
2234
2719
  _,
2235
- b,
2720
+ R,
2236
2721
  $
2237
- ])) : m.push([
2238
- g,
2722
+ ])) : p.push([
2723
+ y,
2239
2724
  _,
2240
- b,
2725
+ R,
2241
2726
  $
2242
2727
  ]));
2243
2728
  });
2244
2729
  });
2245
2730
  });
2246
- }), p && (h.shareScopeMap = {}, delete f[c]), m.forEach(([g, E, _, y]) => {
2247
- var b, S, $;
2248
- ($ = (S = (b = f[g]) == null ? void 0 : b[E]) == null ? void 0 : S[_]) == null || delete $[y];
2731
+ }), m && (d.shareScopeMap = {}, delete h[l]), p.forEach(([y, E, _, g]) => {
2732
+ var R, w, $;
2733
+ ($ = (w = (R = h[y]) == null ? void 0 : R[E]) == null ? void 0 : w[_]) == null || delete $[g];
2249
2734
  }), N.__FEDERATION__.__INSTANCES__.splice(u, 1);
2250
2735
  }
2251
- const { hostGlobalSnapshot: d } = Mt(e, r);
2252
- if (d) {
2253
- const h = d && "remotesInfo" in d && d.remotesInfo && q(d.remotesInfo, e.name).key;
2254
- h && (delete d.remotesInfo[h], Q.__FEDERATION__.__MANIFEST_LOADING__[h] && delete Q.__FEDERATION__.__MANIFEST_LOADING__[h]);
2736
+ const { hostGlobalSnapshot: f } = Bt(e, r);
2737
+ if (f) {
2738
+ const d = f && "remotesInfo" in f && f.remotesInfo && J(f.remotesInfo, e.name).key;
2739
+ d && (delete f.remotesInfo[d], re.__FEDERATION__.__MANIFEST_LOADING__[d] && delete re.__FEDERATION__.__MANIFEST_LOADING__[d]);
2255
2740
  }
2256
2741
  r.moduleCache.delete(e.name);
2257
2742
  }
2258
2743
  } catch (r) {
2259
- Ae.error(`removeRemote failed: ${r instanceof Error ? r.message : String(r)}`);
2744
+ Pe.error(`removeRemote failed: ${r instanceof Error ? r.message : String(r)}`);
2260
2745
  }
2261
2746
  }
2262
2747
  };
2263
- const Rn = typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN == "boolean" ? !FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN : !0;
2264
- var Sn = class {
2748
+ const Lo = typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN == "boolean" ? !FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN : !0;
2749
+ var Mo = class {
2265
2750
  constructor(e) {
2266
- this.hooks = new j({
2267
- beforeInit: new W("beforeInit"),
2268
- init: new v(),
2269
- beforeInitContainer: new D("beforeInitContainer"),
2270
- initContainer: new D("initContainer")
2271
- }), this.version = "2.4.0", this.moduleCache = /* @__PURE__ */ new Map(), this.loaderHook = new j({
2272
- getModuleInfo: new v(),
2273
- createScript: new v(),
2274
- createLink: new v(),
2275
- fetch: new A(),
2276
- loadEntryError: new A(),
2277
- getModuleFactory: new A()
2278
- }), this.bridgeHook = new j({
2279
- beforeBridgeRender: new v(),
2280
- afterBridgeRender: new v(),
2281
- beforeBridgeDestroy: new v(),
2282
- afterBridgeDestroy: new v()
2751
+ this.hooks = new z({
2752
+ beforeInit: new K("beforeInit"),
2753
+ init: new A(),
2754
+ beforeInitContainer: new H("beforeInitContainer"),
2755
+ initContainer: new H("initContainer")
2756
+ }), this.version = "2.5.0", this.moduleCache = /* @__PURE__ */ new Map(), this.loaderHook = new z({
2757
+ getModuleInfo: new A(),
2758
+ createScript: new A(),
2759
+ createLink: new A(),
2760
+ fetch: new I(),
2761
+ loadEntryError: new I(),
2762
+ afterLoadEntry: new I("afterLoadEntry"),
2763
+ beforeInitRemote: new I("beforeInitRemote"),
2764
+ afterInitRemote: new I("afterInitRemote"),
2765
+ beforeGetExpose: new I("beforeGetExpose"),
2766
+ afterGetExpose: new I("afterGetExpose"),
2767
+ beforeExecuteFactory: new I("beforeExecuteFactory"),
2768
+ afterExecuteFactory: new I("afterExecuteFactory"),
2769
+ getModuleFactory: new I()
2770
+ }), this.bridgeHook = new z({
2771
+ beforeBridgeRender: new A(),
2772
+ afterBridgeRender: new A(),
2773
+ beforeBridgeDestroy: new A(),
2774
+ afterBridgeDestroy: new A()
2283
2775
  });
2284
- const t = Rn ? [pn(), gn()] : [], r = {
2285
- id: cn(),
2776
+ const t = Lo ? [Io(), vo()] : [], r = {
2777
+ id: yo(),
2286
2778
  name: e.name,
2287
2779
  plugins: t,
2288
2780
  remotes: [],
2289
2781
  shared: {},
2290
- inBrowser: F
2782
+ inBrowser: D
2291
2783
  };
2292
- this.name = e.name, this.options = r, this.snapshotHandler = new En(this), this.sharedHandler = new _n(this), this.remoteHandler = new bn(this), this.shareScopeMap = this.sharedHandler.shareScopeMap, this.registerPlugins([...r.plugins, ...e.plugins || []]), this.options = this.formatOptions(r, e);
2784
+ this.name = e.name, this.options = r, this.snapshotHandler = new Ao(this), this.sharedHandler = new ko(this), this.remoteHandler = new Po(this), this.shareScopeMap = this.sharedHandler.shareScopeMap, this.registerPlugins([...r.plugins, ...e.plugins || []]), this.options = this.formatOptions(r, e);
2293
2785
  }
2294
2786
  initOptions(e) {
2295
- e.name && e.name !== this.options.name && R(st(wt, O)), this.registerPlugins(e.plugins);
2787
+ e.name && e.name !== this.options.name && b(ut(At, k)), this.registerPlugins(e.plugins);
2296
2788
  const t = this.formatOptions(this.options, e);
2297
2789
  return this.options = t, t;
2298
2790
  }
@@ -2302,18 +2794,18 @@ var Sn = class {
2302
2794
  loadShareSync(e, t) {
2303
2795
  return this.sharedHandler.loadShareSync(e, t);
2304
2796
  }
2305
- initializeSharing(e = re, t) {
2797
+ initializeSharing(e = se, t) {
2306
2798
  return this.sharedHandler.initializeSharing(e, t);
2307
2799
  }
2308
2800
  initRawContainer(e, t, r) {
2309
- const n = me({
2801
+ const o = q({
2310
2802
  name: e,
2311
2803
  entry: t
2312
- }), o = new Pt({
2804
+ }), n = new Dt({
2313
2805
  host: this,
2314
- remoteInfo: n
2806
+ remoteInfo: o
2315
2807
  });
2316
- return o.remoteEntryExports = r, this.moduleCache.set(e, o), o;
2808
+ return n.remoteEntryExports = r, this.moduleCache.set(e, n), n;
2317
2809
  }
2318
2810
  async loadRemote(e, t) {
2319
2811
  return this.remoteHandler.loadRemote(e, t);
@@ -2325,31 +2817,31 @@ var Sn = class {
2325
2817
  this.sharedHandler.initShareScopeMap(e, t, r);
2326
2818
  }
2327
2819
  formatOptions(e, t) {
2328
- const { allShareInfos: r } = yt(e, t), { userOptions: n, options: o } = this.hooks.lifecycle.beforeInit.emit({
2820
+ const { allShareInfos: r } = bt(e, t), { userOptions: o, options: n } = this.hooks.lifecycle.beforeInit.emit({
2329
2821
  origin: this,
2330
2822
  userOptions: t,
2331
2823
  options: e,
2332
2824
  shareInfo: r
2333
- }), s = this.remoteHandler.formatAndRegisterRemote(o, n), { allShareInfos: i } = this.sharedHandler.registerShared(o, n), a = [...o.plugins];
2334
- n.plugins && n.plugins.forEach((c) => {
2335
- a.includes(c) || a.push(c);
2825
+ }), s = this.remoteHandler.formatAndRegisterRemote(n, o), { allShareInfos: i } = this.sharedHandler.registerShared(n, o), c = [...n.plugins];
2826
+ o.plugins && o.plugins.forEach((l) => {
2827
+ c.includes(l) || c.push(l);
2336
2828
  });
2337
- const l = {
2829
+ const a = {
2338
2830
  ...e,
2339
2831
  ...t,
2340
- plugins: a,
2832
+ plugins: c,
2341
2833
  remotes: s,
2342
2834
  shared: i,
2343
- id: n.id || e.id
2835
+ id: o.id || e.id
2344
2836
  };
2345
2837
  return this.hooks.lifecycle.init.emit({
2346
2838
  origin: this,
2347
- options: l
2348
- }), l;
2839
+ options: a
2840
+ }), a;
2349
2841
  }
2350
2842
  registerPlugins(e) {
2351
- const t = ln(e, this);
2352
- this.options.plugins = this.options.plugins.reduce((r, n) => (n && r && !r.find((o) => o.name === n.name) && r.push(n), r), t || []);
2843
+ const t = Eo(e, this);
2844
+ this.options.plugins = this.options.plugins.reduce((r, o) => (o && r && !r.find((n) => n.name === o.name) && r.push(o), r), t || []);
2353
2845
  }
2354
2846
  registerRemotes(e, t) {
2355
2847
  return this.remoteHandler.registerRemotes(e, t);
@@ -2361,127 +2853,128 @@ var Sn = class {
2361
2853
  });
2362
2854
  }
2363
2855
  };
2364
- let $n = null;
2365
- function Ct() {
2366
- return $n;
2367
- }
2368
- pr(Sn);
2369
- function Dt(e, t) {
2370
- const r = (n) => {
2371
- if (!n.startsWith("/")) return n;
2372
- const o = n.length > 1 && n.endsWith("/"), s = `${t}/${n}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/";
2373
- return o ? `${s}/` : s;
2856
+ let Oo = null;
2857
+ function Vt(e) {
2858
+ return Oo;
2859
+ }
2860
+ wr(Mo);
2861
+ function Wt(e, t) {
2862
+ const r = (o) => {
2863
+ if (!o.startsWith("/")) return o;
2864
+ const n = o.length > 1 && o.endsWith("/"), s = `${t}/${o}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/";
2865
+ return n ? `${s}/` : s;
2374
2866
  };
2375
- return e.map((n) => {
2376
- const o = {
2377
- ...n,
2378
- path: r(n.path)
2867
+ return e.map((o) => {
2868
+ const n = {
2869
+ ...o,
2870
+ path: r(o.path)
2379
2871
  };
2380
- return typeof n.redirect == "string" ? o.redirect = r(n.redirect) : n.redirect && typeof n.redirect == "object" && "path" in n.redirect && typeof n.redirect.path == "string" && (o.redirect = {
2381
- ...n.redirect,
2382
- path: r(n.redirect.path)
2383
- }), n.children && n.children.length > 0 && (o.children = Dt(
2384
- n.children,
2872
+ return typeof o.redirect == "string" ? n.redirect = r(o.redirect) : o.redirect && typeof o.redirect == "object" && "path" in o.redirect && typeof o.redirect.path == "string" && (n.redirect = {
2873
+ ...o.redirect,
2874
+ path: r(o.redirect.path)
2875
+ }), o.children && o.children.length > 0 && (n.children = Wt(
2876
+ o.children,
2385
2877
  t
2386
- )), o;
2878
+ )), n;
2387
2879
  });
2388
2880
  }
2389
- function wn(e) {
2390
- const t = e.replace(/\/+$/, ""), r = (s) => s.startsWith("/") && s !== t && !s.startsWith(t + "/"), n = (s) => `${t}${s}`.replace(/\/+/g, "/"), o = (s) => typeof s == "string" ? r(s) ? n(s) : s : "path" in s && typeof s.path == "string" && r(s.path) ? { ...s, path: n(s.path) } : s;
2881
+ function Co(e) {
2882
+ const t = e.replace(/\/+$/, ""), r = (s) => s.startsWith("/") && s !== t && !s.startsWith(t + "/"), o = (s) => `${t}${s}`.replace(/\/+/g, "/"), n = (s) => typeof s == "string" ? r(s) ? o(s) : s : "path" in s && typeof s.path == "string" && r(s.path) ? { ...s, path: o(s.path) } : s;
2391
2883
  return (s) => {
2392
- const i = s.push.bind(s), a = s.replace.bind(s), l = s.resolve.bind(s);
2393
- s.push = (c) => i(o(c)), s.replace = (c) => a(o(c)), s.resolve = (c, ...u) => l(o(c), ...u);
2884
+ const i = s.push.bind(s), c = s.replace.bind(s), a = s.resolve.bind(s);
2885
+ s.push = (l) => i(n(l)), s.replace = (l) => c(n(l)), s.resolve = (l, ...u) => a(n(l), ...u);
2394
2886
  };
2395
2887
  }
2396
- function Nn(e) {
2397
- const { router: t, basename: r, memoryRoute: n, hashRoute: o } = e, s = t.getRoutes().sort(
2398
- (f, p) => f.path.split("/").filter((m) => m).length - p.path.split("/").filter((m) => m).length
2399
- ), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set();
2400
- s.forEach((f) => {
2401
- const p = i.get(f.path) || [];
2402
- p.push(f), i.set(f.path, p);
2888
+ function Fo(e) {
2889
+ const { router: t, basename: r, memoryRoute: o, hashRoute: n } = e, s = t.getRoutes().sort(
2890
+ (h, m) => h.path.split("/").filter((p) => p).length - m.path.split("/").filter((p) => p).length
2891
+ ), i = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Set();
2892
+ s.forEach((h) => {
2893
+ const m = i.get(h.path) || [];
2894
+ m.push(h), i.set(h.path, m);
2403
2895
  });
2404
- const l = (f, p) => `${f}/${p}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/", c = (f, p = "") => {
2405
- if (!f.children || f.children.length === 0)
2406
- return f;
2407
- for (let m = 0; m < f.children.length; m++) {
2408
- const g = f.children[m], E = l(p, g.path), y = (i.get(E) || []).find(
2409
- (b) => !a.has(b) && b !== f && (g.name == null || b.name === g.name)
2896
+ const a = (h, m) => `${h}/${m}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/", l = (h, m = "") => {
2897
+ if (!h.children || h.children.length === 0)
2898
+ return h;
2899
+ for (let p = 0; p < h.children.length; p++) {
2900
+ const y = h.children[p], E = a(m, y.path), g = (i.get(E) || []).find(
2901
+ (R) => !c.has(R) && R !== h && (y.name == null || R.name === y.name)
2410
2902
  );
2411
- if (y) {
2412
- const b = {
2413
- ...y,
2414
- path: g.path
2903
+ if (g) {
2904
+ const R = {
2905
+ ...g,
2906
+ path: y.path
2415
2907
  // Keep the original relative path from static route
2416
2908
  };
2417
- f.children[m] = b, a.add(y), c(b, E);
2909
+ h.children[p] = R, c.add(g), l(R, E);
2418
2910
  }
2419
2911
  }
2420
- return f;
2912
+ return h;
2421
2913
  };
2422
2914
  let u = [];
2423
- for (const f of s)
2424
- if (!a.has(f)) {
2425
- const p = c(f, f.path);
2426
- a.add(f), u.push(p);
2915
+ for (const h of s)
2916
+ if (!c.has(h)) {
2917
+ const m = l(h, h.path);
2918
+ c.add(h), u.push(m);
2427
2919
  }
2428
- let d, h;
2429
- return n ? d = ie.createMemoryHistory(r) : o ? (d = ie.createWebHashHistory(), r && (u = Dt(u, r), h = wn(r))) : d = ie.createWebHistory(r), { history: d, routes: u, patchRouter: h };
2920
+ let f, d;
2921
+ return o ? f = le.createMemoryHistory(r) : n ? (f = le.createWebHashHistory(), r && (u = Wt(u, r), d = Co(r))) : f = le.createWebHistory(r), { history: f, routes: u, patchRouter: d };
2430
2922
  }
2431
- function kn(e) {
2432
- const t = /* @__PURE__ */ new Map(), r = Ct();
2923
+ function Bo(e) {
2924
+ const t = /* @__PURE__ */ new Map(), r = Vt();
2433
2925
  return () => ({
2434
- __APP_VERSION__: "2.4.0",
2435
- async render(n) {
2436
- var p, m, g;
2437
- C.debug("createBridgeComponent render Info", n);
2926
+ __APP_VERSION__: "2.5.0",
2927
+ async render(o) {
2928
+ var m, p, y, E, _, g;
2929
+ C.debug("createBridgeComponent render Info", o);
2438
2930
  const {
2439
- moduleName: o,
2931
+ moduleName: n,
2440
2932
  dom: s,
2441
2933
  basename: i,
2442
- memoryRoute: a,
2443
- hashRoute: l,
2444
- ...c
2445
- } = n, u = Ft.createApp(e.rootComponent, c);
2934
+ memoryRoute: c,
2935
+ hashRoute: a,
2936
+ ...l
2937
+ } = o, u = jt.createApp(e.rootComponent, l);
2446
2938
  t.set(s, u);
2447
- const d = await ((g = (m = (p = r == null ? void 0 : r.bridgeHook) == null ? void 0 : p.lifecycle) == null ? void 0 : m.beforeBridgeRender) == null ? void 0 : g.emit(n)), h = d && typeof d == "object" && (d != null && d.extraProps) ? d == null ? void 0 : d.extraProps : {}, f = e.appOptions({
2939
+ const f = await ((y = (p = (m = r == null ? void 0 : r.bridgeHook) == null ? void 0 : m.lifecycle) == null ? void 0 : p.beforeBridgeRender) == null ? void 0 : y.emit(o)), d = f && typeof f == "object" && (f != null && f.extraProps) ? f == null ? void 0 : f.extraProps : {}, h = e.appOptions({
2448
2940
  app: u,
2449
2941
  basename: i,
2450
- memoryRoute: a,
2451
- hashRoute: l,
2452
- ...c,
2453
- ...h
2942
+ memoryRoute: c,
2943
+ hashRoute: a,
2944
+ ...l,
2945
+ ...d
2454
2946
  });
2455
- if (f != null && f.router) {
2456
- const { history: E, routes: _, patchRouter: y } = Nn({
2457
- router: f.router,
2458
- basename: n.basename,
2459
- memoryRoute: n.memoryRoute,
2460
- hashRoute: n.hashRoute
2461
- }), b = ie.createRouter({
2462
- ...f.router.options,
2463
- history: E,
2464
- routes: _
2947
+ if (h != null && h.router) {
2948
+ const { history: R, routes: w, patchRouter: $ } = Fo({
2949
+ router: h.router,
2950
+ basename: o.basename,
2951
+ memoryRoute: o.memoryRoute,
2952
+ hashRoute: o.hashRoute
2953
+ }), S = le.createRouter({
2954
+ ...h.router.options,
2955
+ history: R,
2956
+ routes: w
2465
2957
  });
2466
- y && y(b), f.afterRouterCreate && f.afterRouterCreate(b), C.debug("createBridgeComponent render router info>>>", {
2467
- moduleName: o,
2468
- router: b
2469
- }), a && await b.push(a.entryPath), u.use(b);
2958
+ $ && $(S), h.afterRouterCreate && h.afterRouterCreate(S), C.debug("createBridgeComponent render router info>>>", {
2959
+ moduleName: n,
2960
+ router: S
2961
+ }), c && await S.push(c.entryPath), u.use(S);
2470
2962
  }
2471
- u.mount(s);
2963
+ u.mount(s), (g = (_ = (E = r == null ? void 0 : r.bridgeHook) == null ? void 0 : E.lifecycle) == null ? void 0 : _.afterBridgeRender) == null || g.emit(o);
2472
2964
  },
2473
- destroy(n) {
2474
- C.debug("createBridgeComponent destroy Info", n);
2475
- const o = t.get(n == null ? void 0 : n.dom);
2476
- o == null || o.unmount();
2965
+ destroy(o) {
2966
+ var s, i, c, a, l, u;
2967
+ C.debug("createBridgeComponent destroy Info", o);
2968
+ const n = t.get(o == null ? void 0 : o.dom);
2969
+ (c = (i = (s = r == null ? void 0 : r.bridgeHook) == null ? void 0 : s.lifecycle) == null ? void 0 : i.beforeBridgeDestroy) == null || c.emit(o), n == null || n.unmount(), (u = (l = (a = r == null ? void 0 : r.bridgeHook) == null ? void 0 : a.lifecycle) == null ? void 0 : l.afterBridgeDestroy) == null || u.emit(o);
2477
2970
  }
2478
2971
  });
2479
2972
  }
2480
- function Tn() {
2973
+ function Ho() {
2481
2974
  const e = new PopStateEvent("popstate", { state: window.history.state });
2482
2975
  window.dispatchEvent(e);
2483
2976
  }
2484
- const In = /* @__PURE__ */ Ht({
2977
+ const Do = /* @__PURE__ */ qt({
2485
2978
  name: "RemoteApp",
2486
2979
  props: {
2487
2980
  moduleName: String,
@@ -2493,10 +2986,10 @@ const In = /* @__PURE__ */ Ht({
2493
2986
  },
2494
2987
  inheritAttrs: !1,
2495
2988
  setup(e) {
2496
- const t = ge(null), r = ge(null), n = ge(""), o = Ke(), s = Ct(), i = Gt(), a = async () => {
2497
- var h, f, p, m;
2498
- const c = (h = e.providerInfo) == null ? void 0 : h.call(e);
2499
- r.value = c;
2989
+ const t = _e(null), r = _e(null), o = _e(""), n = Ze(), s = Vt(), i = Kt(), c = async () => {
2990
+ var d, h, m, p, y, E, _;
2991
+ const l = (d = e.providerInfo) == null ? void 0 : d.call(e);
2992
+ r.value = l;
2500
2993
  let u = {
2501
2994
  ...i,
2502
2995
  moduleName: e.moduleName,
@@ -2506,43 +2999,55 @@ const In = /* @__PURE__ */ Ht({
2506
2999
  hashRoute: e.hashRoute
2507
3000
  };
2508
3001
  C.debug("createRemoteAppComponent LazyComponent render >>>", u);
2509
- const d = await ((m = (p = (f = s == null ? void 0 : s.bridgeHook) == null ? void 0 : f.lifecycle) == null ? void 0 : p.beforeBridgeRender) == null ? void 0 : m.emit(u)) || {};
3002
+ const f = await ((p = (m = (h = s == null ? void 0 : s.bridgeHook) == null ? void 0 : h.lifecycle) == null ? void 0 : m.beforeBridgeRender) == null ? void 0 : p.emit(u)) || {};
2510
3003
  u = {
2511
3004
  ...u,
2512
- ...d.extraProps
2513
- }, c.render(u);
2514
- }, l = xt(() => o == null ? void 0 : o.path, (c) => {
2515
- c !== o.path && a(), n.value !== "" && n.value !== c && (C.debug("createRemoteAppComponent dispatchPopstateEnv >>>", {
3005
+ ...f.extraProps
3006
+ }, l.render(u), (_ = (E = (y = s == null ? void 0 : s.bridgeHook) == null ? void 0 : y.lifecycle) == null ? void 0 : E.afterBridgeRender) == null || _.emit(u);
3007
+ }, a = zt(() => n == null ? void 0 : n.path, (l) => {
3008
+ l !== n.path && c(), o.value !== "" && o.value !== l && (C.debug("createRemoteAppComponent dispatchPopstateEnv >>>", {
2516
3009
  ...e,
2517
- pathname: o.path
2518
- }), Tn()), n.value = c;
3010
+ pathname: n.path
3011
+ }), Ho()), o.value = l;
2519
3012
  });
2520
- return Ut(() => {
2521
- a();
2522
- }), Bt(() => {
2523
- var c;
3013
+ return Jt(() => {
3014
+ c();
3015
+ }), Xt(() => {
3016
+ var l, u, f, d, h, m, p;
2524
3017
  C.debug("createRemoteAppComponent LazyComponent destroy >>>", {
2525
3018
  ...e
2526
- }), l(), (c = r.value) == null || c.destroy({
3019
+ }), a(), (f = (u = (l = s == null ? void 0 : s.bridgeHook) == null ? void 0 : l.lifecycle) == null ? void 0 : u.beforeBridgeDestroy) == null || f.emit({
3020
+ name: e.moduleName,
3021
+ dom: t.value,
3022
+ basename: e.basename,
3023
+ memoryRoute: e.memoryRoute,
3024
+ hashRoute: e.hashRoute
3025
+ }), (d = r.value) == null || d.destroy({
2527
3026
  dom: t.value
3027
+ }), (p = (m = (h = s == null ? void 0 : s.bridgeHook) == null ? void 0 : h.lifecycle) == null ? void 0 : m.afterBridgeDestroy) == null || p.emit({
3028
+ name: e.moduleName,
3029
+ dom: t.value,
3030
+ basename: e.basename,
3031
+ memoryRoute: e.memoryRoute,
3032
+ hashRoute: e.hashRoute
2528
3033
  });
2529
- }), () => Vt("div", Wt(e.rootAttrs || {}, {
3034
+ }), () => Yt("div", Zt(e.rootAttrs || {}, {
2530
3035
  ref: t
2531
3036
  }), null);
2532
3037
  }
2533
3038
  });
2534
- function vn(e) {
2535
- return jt({
2536
- __APP_VERSION__: "2.4.0",
3039
+ function xo(e) {
3040
+ return Qt({
3041
+ __APP_VERSION__: "2.5.0",
2537
3042
  ...e.asyncComponentOptions,
2538
3043
  //@ts-ignore
2539
3044
  loader: async () => {
2540
- var l, c;
2541
- const t = Ke();
3045
+ var a, l;
3046
+ const t = Ze();
2542
3047
  let r = "/";
2543
- const n = (c = (l = t == null ? void 0 : t.matched) == null ? void 0 : l[0]) == null ? void 0 : c.path;
2544
- n && (n.endsWith("/:pathMatch(.*)*") ? r = n.replace("/:pathMatch(.*)*", "") : r = t.matched[0].path);
2545
- const o = (e == null ? void 0 : e.export) || "default";
3048
+ const o = (l = (a = t == null ? void 0 : t.matched) == null ? void 0 : a[0]) == null ? void 0 : l.path;
3049
+ o && (o.endsWith("/:pathMatch(.*)*") ? r = o.replace("/:pathMatch(.*)*", "") : r = t.matched[0].path);
3050
+ const n = (e == null ? void 0 : e.export) || "default";
2546
3051
  C.debug(
2547
3052
  "createRemoteAppComponent LazyComponent create >>>",
2548
3053
  {
@@ -2550,16 +3055,16 @@ function vn(e) {
2550
3055
  info: e
2551
3056
  }
2552
3057
  );
2553
- const s = await e.loader(), i = s && s[Symbol.for("mf_module_id")], a = s[o];
3058
+ const s = await e.loader(), i = s && s[Symbol.for("mf_module_id")], c = s[n];
2554
3059
  if (C.debug(
2555
3060
  "createRemoteAppComponent LazyComponent loadRemote info >>>",
2556
- { moduleName: i, module: s, exportName: o, basename: r, route: t }
2557
- ), o in s && typeof a == "function")
3061
+ { moduleName: i, module: s, exportName: n, basename: r, route: t }
3062
+ ), n in s && typeof c == "function")
2558
3063
  return {
2559
3064
  render() {
2560
- return qt(In, {
3065
+ return er(Do, {
2561
3066
  moduleName: i,
2562
- providerInfo: a,
3067
+ providerInfo: c,
2563
3068
  basename: r,
2564
3069
  rootAttrs: e.rootAttrs,
2565
3070
  memoryRoute: e.memoryRoute,
@@ -2571,13 +3076,13 @@ function vn(e) {
2571
3076
  }
2572
3077
  });
2573
3078
  }
2574
- function On(e) {
3079
+ function Vo(e) {
2575
3080
  return C.warn(
2576
3081
  "createRemoteComponent is deprecated, please use createRemoteAppComponent instead!"
2577
- ), vn(e);
3082
+ ), xo(e);
2578
3083
  }
2579
3084
  export {
2580
- kn as createBridgeComponent,
2581
- vn as createRemoteAppComponent,
2582
- On as createRemoteComponent
3085
+ Bo as createBridgeComponent,
3086
+ xo as createRemoteAppComponent,
3087
+ Vo as createRemoteComponent
2583
3088
  };