@module-federation/bridge-vue3 2.1.0 → 2.2.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.
package/dist/index.js CHANGED
@@ -1,39 +1,40 @@
1
- import * as Mt from "vue";
2
- import { defineComponent as Ct, ref as Ee, useAttrs as Dt, watch as Ft, onMounted as Ht, onBeforeUnmount as Gt, createVNode as Ut, mergeProps as xt, defineAsyncComponent as Bt, h as Vt } from "vue";
1
+ import * as Ft from "vue";
2
+ import { defineComponent as Ht, ref as Ee, useAttrs as Gt, watch as xt, onMounted as Ut, onBeforeUnmount as Vt, createVNode as Bt, mergeProps as Wt, defineAsyncComponent as jt, h as qt } from "vue";
3
3
  import * as ae from "vue-router";
4
4
  import { useRoute as Ke } from "vue-router";
5
- const Wt = ".json", jt = "FEDERATION_DEBUG", Kt = ":";
5
+ const Kt = ".json", zt = "FEDERATION_DEBUG", Jt = ":";
6
6
  let $e = /* @__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
- function F() {
10
- return typeof window < "u" && typeof window.document < "u";
9
+ const F = typeof ENV_TARGET < "u" ? ENV_TARGET === "web" : typeof window < "u" && typeof window.document < "u";
10
+ function ze() {
11
+ return F;
11
12
  }
12
- function qe() {
13
+ function Je() {
13
14
  return typeof navigator < "u" && (navigator == null ? void 0 : navigator.product) === "ReactNative";
14
15
  }
15
- function qt() {
16
+ function Xt() {
16
17
  try {
17
- if (F() && window.localStorage) return !!localStorage.getItem(jt);
18
+ if (ze() && window.localStorage) return !!localStorage.getItem(zt);
18
19
  } catch {
19
20
  return !1;
20
21
  }
21
22
  return !1;
22
23
  }
23
24
  function we() {
24
- return typeof process < "u" && process.env && process.env.FEDERATION_DEBUG ? !!process.env.FEDERATION_DEBUG : typeof FEDERATION_DEBUG < "u" && FEDERATION_DEBUG ? !0 : qt();
25
+ return typeof process < "u" && process.env && process.env.FEDERATION_DEBUG ? !!process.env.FEDERATION_DEBUG : typeof FEDERATION_DEBUG < "u" && FEDERATION_DEBUG ? !0 : Xt();
25
26
  }
26
- const zt = "[ Federation Runtime ]", ze = function(...e) {
27
- return e.length ? e.reduce((t, r) => r ? t ? `${t}${Kt}${r}` : r : t, "") : "";
28
- }, Ie = (e, t) => {
27
+ const Yt = "[ Federation Runtime ]", Xe = function(...e) {
28
+ return e.length ? e.reduce((t, r) => r ? t ? `${t}${Jt}${r}` : r : t, "") : "";
29
+ }, Ne = (e, t) => {
29
30
  if ("getPublicPath" in e) {
30
31
  let r;
31
32
  return e.getPublicPath.startsWith("function") ? r = new Function("return " + e.getPublicPath)()() : r = new Function(e.getPublicPath)(), `${r}${t}`;
32
- } else return "publicPath" in e ? !F() && !qe() && "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), "");
33
- }, Je = (e) => {
34
- console.warn(`${zt}: ${e}`);
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}`);
35
36
  };
36
- function Xe(e) {
37
+ function Ze(e) {
37
38
  try {
38
39
  return JSON.stringify(e, null, 2);
39
40
  } catch {
@@ -53,36 +54,36 @@ const ne = (e, t) => {
53
54
  })(e);
54
55
  return n ? n.endsWith("/") ? `${n}${t}` : `${n}/${t}` : t;
55
56
  };
56
- function Jt(e) {
57
+ function Zt(e) {
57
58
  return e.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
58
59
  }
59
- function Xt(e, t = {}) {
60
- var g, b, w;
60
+ function Qt(e, t = {}) {
61
+ var g, b, N;
61
62
  const { remotes: r = {}, overrides: n = {}, version: o } = t;
62
63
  let s;
63
- const i = () => "publicPath" in e.metaData ? (e.metaData.publicPath === "auto" || e.metaData.publicPath === "") && o ? Jt(o) : e.metaData.publicPath : e.metaData.getPublicPath, a = Object.keys(n);
64
- let c = {};
65
- Object.keys(r).length || (c = ((g = e.remotes) == null ? void 0 : g.reduce((_, 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 = ((g = e.remotes) == null ? void 0 : g.reduce((_, $) => {
66
67
  let R;
67
- const $ = S.federationContainerName;
68
- return a.includes($) ? R = n[$] : "version" in S ? R = S.version : R = S.entry, _[$] = { matchedVersion: R }, _;
69
- }, {})) || {}), Object.keys(r).forEach((_) => c[_] = { matchedVersion: a.includes(_) ? n[_] : r[_] });
70
- const { remoteEntry: { path: l, name: f, type: d }, types: u = {
68
+ const w = $.federationContainerName;
69
+ return a.includes(w) ? R = n[w] : "version" in $ ? R = $.version : R = $.entry, _[w] = { matchedVersion: R }, _;
70
+ }, {})) || {}), Object.keys(r).forEach((_) => l[_] = { matchedVersion: a.includes(_) ? n[_] : r[_] });
71
+ const { remoteEntry: { path: c, name: f, type: h }, types: u = {
71
72
  path: "",
72
73
  name: "",
73
74
  zip: "",
74
75
  api: ""
75
- }, buildInfo: { buildVersion: h }, globalName: p, ssrRemoteEntry: y } = e.metaData, { exposes: E } = e;
76
- let m = {
76
+ }, buildInfo: { buildVersion: d }, globalName: m, ssrRemoteEntry: y } = e.metaData, { exposes: E } = e;
77
+ let p = {
77
78
  version: o || "",
78
- buildVersion: h,
79
- globalName: p,
80
- remoteEntry: ne(l, f),
81
- remoteEntryType: d,
79
+ buildVersion: d,
80
+ globalName: m,
81
+ remoteEntry: ne(c, f),
82
+ remoteEntryType: h,
82
83
  remoteTypes: ne(u.path, u.name),
83
84
  remoteTypesZip: u.zip || "",
84
85
  remoteTypesAPI: u.api || "",
85
- remotesInfo: c,
86
+ remotesInfo: l,
86
87
  shared: e == null ? void 0 : e.shared.map((_) => ({
87
88
  assets: _.assets,
88
89
  sharedName: _.name,
@@ -97,24 +98,24 @@ function Xt(e, t = {}) {
97
98
  };
98
99
  if ((b = e.metaData) != null && b.prefetchInterface) {
99
100
  const _ = e.metaData.prefetchInterface;
100
- m = {
101
- ...m,
101
+ p = {
102
+ ...p,
102
103
  prefetchInterface: _
103
104
  };
104
105
  }
105
- if ((w = e.metaData) != null && w.prefetchEntry) {
106
- const { path: _, name: S, type: R } = e.metaData.prefetchEntry;
107
- m = {
108
- ...m,
109
- prefetchEntry: ne(_, S),
106
+ if ((N = e.metaData) != null && N.prefetchEntry) {
107
+ const { path: _, name: $, type: R } = e.metaData.prefetchEntry;
108
+ p = {
109
+ ...p,
110
+ prefetchEntry: ne(_, $),
110
111
  prefetchEntryType: R
111
112
  };
112
113
  }
113
114
  if ("publicPath" in e.metaData ? (s = {
114
- ...m,
115
+ ...p,
115
116
  publicPath: i()
116
117
  }, typeof e.metaData.ssrPublicPath == "string" && (s.ssrPublicPath = e.metaData.ssrPublicPath)) : s = {
117
- ...m,
118
+ ...p,
118
119
  getPublicPath: i()
119
120
  }, y) {
120
121
  const _ = ne(y.path, y.name);
@@ -122,10 +123,10 @@ function Xt(e, t = {}) {
122
123
  }
123
124
  return s;
124
125
  }
125
- function Ye(e) {
126
- return !!("remoteEntry" in e && e.remoteEntry.includes(Wt));
126
+ function Qe(e) {
127
+ return !!("remoteEntry" in e && e.remoteEntry.includes(Kt));
127
128
  }
128
- const Yt = "[ Module Federation ]", J = console, Zt = [
129
+ const er = "[ Module Federation ]", J = console, tr = [
129
130
  "logger.ts",
130
131
  "logger.js",
131
132
  "captureStackTrace",
@@ -136,12 +137,12 @@ const Yt = "[ Module Federation ]", J = console, Zt = [
136
137
  "Logger.error",
137
138
  "Logger.debug"
138
139
  ];
139
- function Qt() {
140
+ function rr() {
140
141
  try {
141
142
  const e = (/* @__PURE__ */ new Error()).stack;
142
143
  if (!e) return;
143
144
  const [, ...t] = e.split(`
144
- `), r = t.filter((n) => !Zt.some((o) => n.includes(o)));
145
+ `), r = t.filter((n) => !tr.some((o) => n.includes(o)));
145
146
  return r.length ? `Stack trace:
146
147
  ${r.slice(0, 5).join(`
147
148
  `)}` : void 0;
@@ -149,7 +150,7 @@ ${r.slice(0, 5).join(`
149
150
  return;
150
151
  }
151
152
  }
152
- var Ze = class {
153
+ var et = class {
153
154
  constructor(e, t = J) {
154
155
  this.prefix = e, this.delegate = t ?? J;
155
156
  }
@@ -160,7 +161,7 @@ var Ze = class {
160
161
  this.delegate = e ?? J;
161
162
  }
162
163
  emit(e, t) {
163
- const r = this.delegate, n = we() ? Qt() : void 0, o = n ? [...t, n] : t, s = (() => {
164
+ const r = this.delegate, n = we() ? rr() : void 0, o = n ? [...t, n] : t, s = (() => {
164
165
  switch (e) {
165
166
  case "log":
166
167
  return ["log", "info"];
@@ -219,68 +220,79 @@ var Ze = class {
219
220
  we() && this.emit("debug", e);
220
221
  }
221
222
  };
222
- function Qe(e) {
223
- return new Ze(e);
223
+ function tt(e) {
224
+ return new et(e);
224
225
  }
225
- function er(e) {
226
- const t = new Ze(e);
226
+ function nr(e) {
227
+ const t = new et(e);
227
228
  return Object.defineProperty(t, "__mf_infrastructure_logger__", {
228
229
  value: !0,
229
230
  enumerable: !1,
230
231
  configurable: !1
231
232
  }), t;
232
233
  }
233
- er(Yt);
234
- async function et(e, t) {
234
+ nr(er);
235
+ async function rt(e, t) {
235
236
  try {
236
237
  return await e();
237
238
  } catch (r) {
238
- Je(r);
239
+ Ye(r);
239
240
  return;
240
241
  }
241
242
  }
242
- function tt(e, t) {
243
+ function Ie(e, t) {
243
244
  const r = /^(https?:)?\/\//i;
244
245
  return e.replace(r, "").replace(/\/$/, "") === t.replace(r, "").replace(/\/$/, "");
245
246
  }
246
- function rt(e) {
247
+ function nt(e) {
247
248
  let t = null, r = !0, n = 2e4, o;
248
249
  const s = document.getElementsByTagName("script");
249
- for (let a = 0; a < s.length; a++) {
250
- const c = s[a], l = c.getAttribute("src");
251
- if (l && tt(l, e.url)) {
252
- t = c, r = !1;
250
+ for (let c = 0; c < s.length; c++) {
251
+ const f = s[c], h = f.getAttribute("src");
252
+ if (h && Ie(h, e.url)) {
253
+ t = f, r = !1;
253
254
  break;
254
255
  }
255
256
  }
256
257
  if (!t) {
257
- const a = e.attrs;
258
- t = document.createElement("script"), t.type = (a == null ? void 0 : a.type) === "module" ? "module" : "text/javascript";
259
- let c;
260
- e.createScriptHook && (c = e.createScriptHook(e.url, e.attrs), c instanceof HTMLScriptElement ? t = c : typeof c == "object" && ("script" in c && c.script && (t = c.script), "timeout" in c && c.timeout && (n = c.timeout))), t.src || (t.src = e.url), a && !c && Object.keys(a).forEach((l) => {
261
- t && (l === "async" || l === "defer" ? t[l] = a[l] : t.getAttribute(l) || t.setAttribute(l, a[l]));
258
+ const c = e.attrs;
259
+ t = document.createElement("script"), t.type = (c == null ? void 0 : c.type) === "module" ? "module" : "text/javascript";
260
+ let f;
261
+ e.createScriptHook && (f = e.createScriptHook(e.url, e.attrs), f instanceof HTMLScriptElement ? t = f : typeof f == "object" && ("script" in f && f.script && (t = f.script), "timeout" in f && f.timeout && (n = f.timeout))), t.src || (t.src = e.url), c && !f && Object.keys(c).forEach((h) => {
262
+ t && (h === "async" || h === "defer" ? t[h] = c[h] : t.getAttribute(h) || t.setAttribute(h, c[h]));
262
263
  });
263
264
  }
264
- const i = async (a, c) => {
265
- clearTimeout(o);
266
- const l = () => {
267
- (c == null ? void 0 : c.type) === "error" ? e != null && e.onErrorCallback && (e == null || e.onErrorCallback(c)) : e != null && e.cb && (e == null || e.cb());
265
+ let i = null;
266
+ const a = typeof window < "u" ? (c) => {
267
+ if (c.filename && Ie(c.filename, e.url)) {
268
+ const f = /* @__PURE__ */ new Error(`ScriptExecutionError: Script "${e.url}" loaded but threw a runtime error during execution: ${c.message} (${c.filename}:${c.lineno}:${c.colno})`);
269
+ f.name = "ScriptExecutionError", i = f;
270
+ }
271
+ } : null;
272
+ a && window.addEventListener("error", a);
273
+ const l = async (c, f) => {
274
+ clearTimeout(o), a && window.removeEventListener("error", a);
275
+ const h = () => {
276
+ if ((f == null ? void 0 : f.type) === "error") {
277
+ const u = /* @__PURE__ */ new Error(`ScriptNetworkError: Failed to load script "${e.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);
278
+ u.name = "ScriptNetworkError", e != null && e.onErrorCallback && (e == null || e.onErrorCallback(u));
279
+ } else i ? e != null && e.onErrorCallback && (e == null || e.onErrorCallback(i)) : e != null && e.cb && (e == null || e.cb());
268
280
  };
269
- if (t && (t.onerror = null, t.onload = null, et(() => {
270
- const { needDeleteScript: f = !0 } = e;
271
- f && t != null && t.parentNode && t.parentNode.removeChild(t);
272
- }), a && typeof a == "function")) {
273
- const f = a(c);
274
- if (f instanceof Promise) {
275
- const d = await f;
276
- return l(), d;
281
+ if (t && (t.onerror = null, t.onload = null, rt(() => {
282
+ const { needDeleteScript: u = !0 } = e;
283
+ u && t != null && t.parentNode && t.parentNode.removeChild(t);
284
+ }), c && typeof c == "function")) {
285
+ const u = c(f);
286
+ if (u instanceof Promise) {
287
+ const d = await u;
288
+ return h(), d;
277
289
  }
278
- return l(), f;
290
+ return h(), u;
279
291
  }
280
- l();
292
+ h();
281
293
  };
282
- return t.onerror = i.bind(null, t.onerror), t.onload = i.bind(null, t.onload), o = setTimeout(() => {
283
- i(null, /* @__PURE__ */ new Error(`Remote script "${e.url}" time-outed.`));
294
+ return t.onerror = l.bind(null, t.onerror), t.onload = l.bind(null, t.onload), o = setTimeout(() => {
295
+ l(null, /* @__PURE__ */ new Error(`Remote script "${e.url}" time-outed.`));
284
296
  }, n), {
285
297
  script: t,
286
298
  needAttach: r
@@ -290,8 +302,8 @@ function ge(e) {
290
302
  let t = null, r = !0;
291
303
  const n = document.getElementsByTagName("link");
292
304
  for (let s = 0; s < n.length; s++) {
293
- const i = n[s], a = i.getAttribute("href"), c = i.getAttribute("rel");
294
- if (a && tt(a, e.url) && c === e.attrs.rel) {
305
+ const i = n[s], a = i.getAttribute("href"), l = i.getAttribute("rel");
306
+ if (a && Ie(a, e.url) && l === e.attrs.rel) {
295
307
  t = i, r = !1;
296
308
  break;
297
309
  }
@@ -308,12 +320,12 @@ function ge(e) {
308
320
  const a = () => {
309
321
  (i == null ? void 0 : i.type) === "error" ? e != null && e.onErrorCallback && (e == null || e.onErrorCallback(i)) : e != null && e.cb && (e == null || e.cb());
310
322
  };
311
- if (t && (t.onerror = null, t.onload = null, et(() => {
312
- const { needDeleteLink: c = !0 } = e;
313
- c && t != null && t.parentNode && t.parentNode.removeChild(t);
323
+ if (t && (t.onerror = null, t.onload = null, rt(() => {
324
+ const { needDeleteLink: l = !0 } = e;
325
+ l && t != null && t.parentNode && t.parentNode.removeChild(t);
314
326
  }), s)) {
315
- const c = s(i);
316
- return a(), c;
327
+ const l = s(i);
328
+ return a(), l;
317
329
  }
318
330
  a();
319
331
  };
@@ -322,10 +334,10 @@ function ge(e) {
322
334
  needAttach: r
323
335
  };
324
336
  }
325
- function tr(e, t) {
337
+ function or(e, t) {
326
338
  const { attrs: r = {}, createScriptHook: n } = t;
327
339
  return new Promise((o, s) => {
328
- const { script: i, needAttach: a } = rt({
340
+ const { script: i, needAttach: a } = nt({
329
341
  url: e,
330
342
  cb: o,
331
343
  onErrorCallback: s,
@@ -340,7 +352,7 @@ function tr(e, t) {
340
352
  });
341
353
  }
342
354
  const oe = /* @__PURE__ */ new Map();
343
- function B(e) {
355
+ function V(e) {
344
356
  if (!e) throw new Error("import specifier is required");
345
357
  if (oe.has(e)) return oe.get(e);
346
358
  const t = new Function("name", "return import(name)")(e).then((r) => r).catch((r) => {
@@ -348,13 +360,13 @@ function B(e) {
348
360
  });
349
361
  return oe.set(e, t), t;
350
362
  }
351
- const nt = async () => {
352
- const e = await B("node-fetch");
363
+ const ot = async () => {
364
+ const e = await V("node-fetch");
353
365
  return e.default || e;
354
- }, rr = async (e, t, r) => {
366
+ }, sr = async (e, t, r) => {
355
367
  const o = await ((s, i) => r.lifecycle.fetch.emit(s, i))(e, t || {});
356
- return !o || !(o instanceof Response) ? (typeof fetch > "u" ? await nt() : fetch)(e, t || {}) : o;
357
- }, nr = typeof ENV_TARGET > "u" || ENV_TARGET !== "web" ? (e, t, r, n) => {
368
+ return !o || !(o instanceof Response) ? (typeof fetch > "u" ? await ot() : fetch)(e, t || {}) : o;
369
+ }, ir = typeof ENV_TARGET > "u" || ENV_TARGET !== "web" ? (e, t, r, n) => {
358
370
  if (n != null && n.createScriptHook) {
359
371
  const a = n.createScriptHook(e);
360
372
  a && typeof a == "object" && "url" in a && (e = a.url);
@@ -366,20 +378,20 @@ const nt = async () => {
366
378
  console.error("Error constructing URL:", a), t(/* @__PURE__ */ new Error(`Invalid URL: ${a}`));
367
379
  return;
368
380
  }
369
- const s = async () => n != null && n.fetch ? (a, c) => rr(a, c, n) : typeof fetch > "u" ? nt() : fetch, i = async (a, c) => {
370
- var l;
381
+ const s = async () => n != null && n.fetch ? (a, l) => sr(a, l, n) : typeof fetch > "u" ? ot() : fetch, i = async (a, l) => {
382
+ var c;
371
383
  try {
372
- const d = await (await a(c.href)).text(), [u, h] = await Promise.all([B("path"), B("vm")]), p = {
384
+ const h = await (await a(l.href)).text(), [u, d] = await Promise.all([V("path"), V("vm")]), m = {
373
385
  exports: {},
374
386
  module: { exports: {} }
375
- }, y = c.pathname.split("/").slice(0, -1).join("/"), E = u.basename(c.pathname), m = new h.Script(`(function(exports, module, require, __dirname, __filename) {${d}
387
+ }, y = l.pathname.split("/").slice(0, -1).join("/"), E = u.basename(l.pathname), p = new d.Script(`(function(exports, module, require, __dirname, __filename) {${h}
376
388
  })`, {
377
389
  filename: E,
378
- importModuleDynamically: ((l = h.constants) == null ? void 0 : l.USE_MAIN_CONTEXT_DEFAULT_LOADER) ?? B
390
+ importModuleDynamically: ((c = d.constants) == null ? void 0 : c.USE_MAIN_CONTEXT_DEFAULT_LOADER) ?? V
379
391
  });
380
392
  let g;
381
- g = (await B("node:module")).createRequire(c.protocol === "file:" || c.protocol === "node:" ? c.href : u.join(process.cwd(), "__mf_require_base__.js")), m.runInThisContext()(p.exports, p.module, g, y, E);
382
- const b = p.module.exports || p.exports;
393
+ g = (await V("node:module")).createRequire(l.protocol === "file:" || l.protocol === "node:" ? l.href : u.join(process.cwd(), "__mf_require_base__.js")), p.runInThisContext()(m.exports, m.module, g, y, E);
394
+ const b = m.module.exports || m.exports;
383
395
  if (r && b && r.globalName) {
384
396
  t(void 0, b[r.globalName] || b);
385
397
  return;
@@ -390,13 +402,13 @@ const nt = async () => {
390
402
  }
391
403
  };
392
404
  s().then(async (a) => {
393
- if ((r == null ? void 0 : r.type) === "esm" || (r == null ? void 0 : r.type) === "module") return Ne(o.href, {
405
+ if ((r == null ? void 0 : r.type) === "esm" || (r == null ? void 0 : r.type) === "module") return Te(o.href, {
394
406
  fetch: a,
395
- vm: await B("vm")
396
- }).then(async (c) => {
397
- await c.evaluate(), t(void 0, c.namespace);
398
- }).catch((c) => {
399
- t(c instanceof Error ? c : /* @__PURE__ */ new Error(`Script execution error: ${c}`));
407
+ vm: await V("vm")
408
+ }).then(async (l) => {
409
+ await l.evaluate(), t(void 0, l.namespace);
410
+ }).catch((l) => {
411
+ t(l instanceof Error ? l : /* @__PURE__ */ new Error(`Script execution error: ${l}`));
400
412
  });
401
413
  i(a, o);
402
414
  }).catch((a) => {
@@ -404,68 +416,81 @@ const nt = async () => {
404
416
  });
405
417
  } : (e, t, r, n) => {
406
418
  t(/* @__PURE__ */ new Error("createScriptNode is disabled in non-Node.js environment"));
407
- }, or = typeof ENV_TARGET > "u" || ENV_TARGET !== "web" ? (e, t) => new Promise((r, n) => {
408
- nr(e, (o, s) => {
419
+ }, ar = typeof ENV_TARGET > "u" || ENV_TARGET !== "web" ? (e, t) => new Promise((r, n) => {
420
+ ir(e, (o, s) => {
409
421
  var i, a;
410
422
  if (o) n(o);
411
423
  else {
412
- const c = ((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[c] = s);
424
+ 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__`;
425
+ r(globalThis[l] = s);
414
426
  }
415
427
  }, t.attrs, t.loaderHook);
416
428
  }) : (e, t) => {
417
429
  throw new Error("loadScriptNode is disabled in non-Node.js environment");
418
430
  }, _e = /* @__PURE__ */ new Map();
419
- async function Ne(e, t) {
431
+ async function Te(e, t) {
420
432
  if (_e.has(e)) return _e.get(e);
421
433
  const { fetch: r, vm: n } = t, o = await (await r(e)).text(), s = new n.SourceTextModule(o, { importModuleDynamically: async (i, a) => {
422
- const c = new URL(i, e).href;
423
- return Ne(c, t);
434
+ const l = new URL(i, e).href;
435
+ return Te(l, t);
424
436
  } });
425
437
  return _e.set(e, s), await s.link(async (i) => {
426
438
  const a = new URL(i, e).href;
427
- return await Ne(a, t);
439
+ return await Te(a, t);
428
440
  }), s;
429
441
  }
430
- const C = Qe("[ Module Federation Bridge Vue3 ]"), W = "[ Federation Runtime ]", Te = Qe(W);
431
- function T(e, t) {
432
- e || k(t);
442
+ 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) => {
443
+ const o = [`${[t[e]]} #${e}`];
444
+ return r && o.push(`args: ${JSON.stringify(r)}`), o.push(cr(e)), n && o.push(`Original Error Message:
445
+ ${n}`), o.join(`
446
+ `);
447
+ };
448
+ function lr(e, t, r, n, o, s) {
449
+ return n(st(e, t, r, o));
433
450
  }
434
- function k(e) {
435
- throw e instanceof Error ? (e.message.startsWith(W) || (e.message = `${W}: ${e.message}`), e) : new Error(`${W}: ${e}`);
451
+ const H = "[ Federation Runtime ]", ve = tt(H);
452
+ function P(e, t, r, n, o) {
453
+ e || S(t);
436
454
  }
437
- function ke(e) {
438
- e instanceof Error && (e.message.startsWith(W) || (e.message = `${W}: ${e.message}`)), Te.warn(e);
455
+ function S(e, t, r, n, o) {
456
+ if (t !== void 0) return lr(e, t, r ?? {}, (i) => {
457
+ throw new Error(`${H}: ${i}`);
458
+ }, n);
459
+ const s = e;
460
+ throw s instanceof Error ? (s.message.startsWith(H) || (s.message = `${H}: ${s.message}`), s) : new Error(`${H}: ${s}`);
439
461
  }
440
- function sr(e, t) {
462
+ function Oe(e) {
463
+ e instanceof Error && (e.message.startsWith(H) || (e.message = `${H}: ${e.message}`)), ve.warn(e);
464
+ }
465
+ function ur(e, t) {
441
466
  return e.findIndex((r) => r === t) === -1 && e.push(t), e;
442
467
  }
443
468
  function Z(e) {
444
469
  return "version" in e && e.version ? `${e.name}:${e.version}` : "entry" in e && e.entry ? `${e.name}:${e.entry}` : `${e.name}`;
445
470
  }
446
- function Oe(e) {
471
+ function Le(e) {
447
472
  return typeof e.entry < "u";
448
473
  }
449
- function ot(e) {
474
+ function it(e) {
450
475
  return !e.entry.includes(".json");
451
476
  }
452
- function Le(e) {
477
+ function Me(e) {
453
478
  return e && typeof e == "object";
454
479
  }
455
- const ir = Object.prototype.toString;
456
- function ar(e) {
457
- return ir.call(e) === "[object Object]";
480
+ const fr = Object.prototype.toString;
481
+ function hr(e) {
482
+ return fr.call(e) === "[object Object]";
458
483
  }
459
- function st(e) {
484
+ function at(e) {
460
485
  return Array.isArray(e) ? e : [e];
461
486
  }
462
- function it(e) {
487
+ function ct(e) {
463
488
  const t = {
464
489
  url: "",
465
490
  type: "global",
466
491
  globalName: ""
467
492
  };
468
- return F() || qe() || !("ssrRemoteEntry" in e) ? "remoteEntry" in e ? {
493
+ return F || Je() || !("ssrRemoteEntry" in e) ? "remoteEntry" in e ? {
469
494
  url: e.remoteEntry,
470
495
  type: e.remoteEntryType,
471
496
  globalName: e.globalName
@@ -475,16 +500,16 @@ function it(e) {
475
500
  globalName: e.globalName
476
501
  } : t;
477
502
  }
478
- const cr = (e, t) => {
503
+ const dr = (e, t) => {
479
504
  let r;
480
505
  return e.endsWith("/") ? r = e.slice(0, -1) : r = e, t.startsWith(".") && (t = t.slice(1)), r = r + t, r;
481
- }, I = typeof globalThis == "object" ? globalThis : window, P = (() => {
506
+ }, I = typeof globalThis == "object" ? globalThis : window, k = (() => {
482
507
  try {
483
508
  return document.defaultView;
484
509
  } catch {
485
510
  return I;
486
511
  }
487
- })(), Q = P;
512
+ })(), Q = k;
488
513
  function ce(e, t, r) {
489
514
  Object.defineProperty(e, t, {
490
515
  value: r,
@@ -496,8 +521,8 @@ function le(e, t) {
496
521
  return Object.hasOwnProperty.call(e, t);
497
522
  }
498
523
  le(I, "__GLOBAL_LOADING_REMOTE_ENTRY__") || ce(I, "__GLOBAL_LOADING_REMOTE_ENTRY__", {});
499
- const V = I.__GLOBAL_LOADING_REMOTE_ENTRY__;
500
- function at(e) {
524
+ const B = I.__GLOBAL_LOADING_REMOTE_ENTRY__;
525
+ function lt(e) {
501
526
  var t, r, n, o, s, i;
502
527
  le(e, "__VMOK__") && !le(e, "__FEDERATION__") && ce(e, "__FEDERATION__", e.__VMOK__), le(e, "__FEDERATION__") || (ce(e, "__FEDERATION__", {
503
528
  __GLOBAL_PLUGIN__: [],
@@ -508,10 +533,10 @@ function at(e) {
508
533
  __PRELOADED_MAP__: /* @__PURE__ */ new Map()
509
534
  }), ce(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());
510
535
  }
511
- at(I);
512
- at(P);
513
- function lr(e, t = we()) {
514
- t && (I.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = e, I.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "2.1.0");
536
+ lt(I);
537
+ lt(k);
538
+ function mr(e, t = we()) {
539
+ t && (I.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = e, I.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "2.2.0");
515
540
  }
516
541
  function q(e, t) {
517
542
  if (typeof t == "string") {
@@ -533,81 +558,81 @@ function q(e, t) {
533
558
  key: t
534
559
  };
535
560
  }
536
- } else throw new Error("key must be string");
561
+ } else S(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`);
537
562
  }
538
- const He = () => P.__FEDERATION__.moduleInfo, ur = (e, t) => {
563
+ const Ge = () => k.__FEDERATION__.moduleInfo, pr = (e, t) => {
539
564
  const r = q(t, Z(e)).value;
540
565
  if (r && !r.version && "version" in e && e.version && (r.version = e.version), r) return r;
541
566
  if ("version" in e && e.version) {
542
- const { version: n, ...o } = e, s = Z(o), i = q(P.__FEDERATION__.moduleInfo, s).value;
567
+ const { version: n, ...o } = e, s = Z(o), i = q(k.__FEDERATION__.moduleInfo, s).value;
543
568
  if ((i == null ? void 0 : i.version) === n) return i;
544
569
  }
545
- }, ue = (e) => ur(e, P.__FEDERATION__.moduleInfo), Ge = (e, t) => {
570
+ }, ue = (e) => pr(e, k.__FEDERATION__.moduleInfo), xe = (e, t) => {
546
571
  const r = Z(e);
547
- return P.__FEDERATION__.moduleInfo[r] = t, P.__FEDERATION__.moduleInfo;
548
- }, fr = (e) => (P.__FEDERATION__.moduleInfo = {
549
- ...P.__FEDERATION__.moduleInfo,
572
+ return k.__FEDERATION__.moduleInfo[r] = t, k.__FEDERATION__.moduleInfo;
573
+ }, yr = (e) => (k.__FEDERATION__.moduleInfo = {
574
+ ...k.__FEDERATION__.moduleInfo,
550
575
  ...e
551
576
  }, () => {
552
577
  const t = Object.keys(e);
553
- for (const r of t) delete P.__FEDERATION__.moduleInfo[r];
554
- }), Me = (e, t) => {
578
+ for (const r of t) delete k.__FEDERATION__.moduleInfo[r];
579
+ }), Ce = (e, t) => {
555
580
  const r = t || `__FEDERATION_${e}:custom__`;
556
581
  return {
557
582
  remoteEntryKey: r,
558
583
  entryExports: I[r]
559
584
  };
560
- }, hr = () => P.__FEDERATION__.__GLOBAL_PLUGIN__, dr = (e) => I.__FEDERATION__.__PRELOADED_MAP__.get(e), pr = (e) => I.__FEDERATION__.__PRELOADED_MAP__.set(e, !0), Ue = "[0-9A-Za-z-]+", Ce = `(?:\\+(${Ue}(?:\\.${Ue})*))`, Y = "0|[1-9]\\d*", fe = "[0-9]+", ct = "\\d*[a-zA-Z-][a-zA-Z0-9-]*", xe = `(?:${fe}|${ct})`, mr = `(?:-?(${xe}(?:\\.${xe})*))`, Be = `(?:${Y}|${ct})`, lt = `(?:-(${Be}(?:\\.${Be})*))`, be = `${Y}|x|X|\\*`, z = `[v=\\s]*(${be})(?:\\.(${be})(?:\\.(${be})(?:${lt})?${Ce}?)?)?`, yr = `^\\s*(${z})\\s+-\\s+(${z})\\s*$`, Er = `[v=\\s]*${`(${fe})\\.(${fe})\\.(${fe})`}${mr}?${Ce}?`, De = "((?:<|>)?=?)", gr = `(\\s*)${De}\\s*(${Er}|${z})`, ut = "(?:~>?)", _r = `(\\s*)${ut}\\s+`, ft = "(?:\\^)", br = `(\\s*)${ft}\\s+`, Rr = "(<|>)?=?\\s*\\*", Sr = `^${ft}${z}$`, $r = `v?${`(${Y})\\.(${Y})\\.(${Y})`}${lt}?${Ce}?`, wr = `^${ut}${z}$`, Ir = `^${De}\\s*${z}$`, Nr = `^${De}\\s*(${$r})$|^$`, Tr = "^\\s*>=\\s*0.0.0\\s*$";
585
+ }, Er = () => k.__FEDERATION__.__GLOBAL_PLUGIN__, gr = (e) => I.__FEDERATION__.__PRELOADED_MAP__.get(e), _r = (e) => I.__FEDERATION__.__PRELOADED_MAP__.set(e, !0), Ue = "[0-9A-Za-z-]+", De = `(?:\\+(${Ue}(?:\\.${Ue})*))`, Y = "0|[1-9]\\d*", fe = "[0-9]+", ut = "\\d*[a-zA-Z-][a-zA-Z0-9-]*", Ve = `(?:${fe}|${ut})`, br = `(?:-?(${Ve}(?:\\.${Ve})*))`, Be = `(?:${Y}|${ut})`, ft = `(?:-(${Be}(?:\\.${Be})*))`, be = `${Y}|x|X|\\*`, K = `[v=\\s]*(${be})(?:\\.(${be})(?:\\.(${be})(?:${ft})?${De}?)?)?`, Rr = `^\\s*(${K})\\s+-\\s+(${K})\\s*$`, Sr = `[v=\\s]*${`(${fe})\\.(${fe})\\.(${fe})`}${br}?${De}?`, Fe = "((?:<|>)?=?)", $r = `(\\s*)${Fe}\\s*(${Sr}|${K})`, ht = "(?:~>?)", wr = `(\\s*)${ht}\\s+`, dt = "(?:\\^)", Nr = `(\\s*)${dt}\\s+`, Ir = "(<|>)?=?\\s*\\*", Tr = `^${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*$";
561
586
  function M(e) {
562
587
  return new RegExp(e);
563
588
  }
564
- function N(e) {
589
+ function T(e) {
565
590
  return !e || e.toLowerCase() === "x" || e === "*";
566
591
  }
567
- function ht(...e) {
592
+ function mt(...e) {
568
593
  return (t) => e.reduce((r, n) => n(r), t);
569
594
  }
570
- function Ve(e) {
571
- return e.match(M(Nr));
595
+ function We(e) {
596
+ return e.match(M(kr));
572
597
  }
573
- function We(e, t, r, n) {
598
+ function je(e, t, r, n) {
574
599
  const o = `${e}.${t}.${r}`;
575
600
  return n ? `${o}-${n}` : o;
576
601
  }
577
- function Ar(e) {
578
- return e.replace(M(yr), (t, r, n, o, s, i, a, c, l, f, d, u) => (N(n) ? r = "" : N(o) ? r = `>=${n}.0.0` : N(s) ? r = `>=${n}.${o}.0` : r = `>=${r}`, N(l) ? c = "" : N(f) ? c = `<${Number(l) + 1}.0.0-0` : N(d) ? c = `<${l}.${Number(f) + 1}.0-0` : u ? c = `<=${l}.${f}.${d}-${u}` : c = `<=${c}`, `${r} ${c}`.trim()));
602
+ function Lr(e) {
603
+ return e.replace(M(Rr), (t, r, n, o, s, i, a, l, c, f, h, u) => (T(n) ? r = "" : T(o) ? r = `>=${n}.0.0` : T(s) ? r = `>=${n}.${o}.0` : r = `>=${r}`, T(c) ? l = "" : T(f) ? l = `<${Number(c) + 1}.0.0-0` : T(h) ? l = `<${c}.${Number(f) + 1}.0-0` : u ? l = `<=${c}.${f}.${h}-${u}` : l = `<=${l}`, `${r} ${l}`.trim()));
579
604
  }
580
- function vr(e) {
581
- return e.replace(M(gr), "$1$2$3");
605
+ function Mr(e) {
606
+ return e.replace(M($r), "$1$2$3");
582
607
  }
583
- function Pr(e) {
584
- return e.replace(M(_r), "$1~");
608
+ function Cr(e) {
609
+ return e.replace(M(wr), "$1~");
585
610
  }
586
- function kr(e) {
587
- return e.replace(M(br), "$1^");
611
+ function Dr(e) {
612
+ return e.replace(M(Nr), "$1^");
588
613
  }
589
- function Or(e) {
590
- return e.trim().split(/\s+/).map((t) => t.replace(M(Sr), (r, n, o, s, i) => N(n) ? "" : N(o) ? `>=${n}.0.0 <${Number(n) + 1}.0.0-0` : N(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(" ");
614
+ function Fr(e) {
615
+ return e.trim().split(/\s+/).map((t) => t.replace(M(Tr), (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(" ");
591
616
  }
592
- function Lr(e) {
593
- return e.trim().split(/\s+/).map((t) => t.replace(M(wr), (r, n, o, s, i) => N(n) ? "" : N(o) ? `>=${n}.0.0 <${Number(n) + 1}.0.0-0` : N(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(" ");
617
+ function Hr(e) {
618
+ 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(" ");
594
619
  }
595
- function Mr(e) {
596
- return e.split(/\s+/).map((t) => t.trim().replace(M(Ir), (r, n, o, s, i, a) => {
597
- const c = N(o), l = c || N(s), f = l || N(i);
598
- return n === "=" && f && (n = ""), a = "", c ? n === ">" || n === "<" ? "<0.0.0-0" : "*" : n && f ? (l && (s = 0), i = 0, n === ">" ? (n = ">=", l ? (o = Number(o) + 1, s = 0, i = 0) : (s = Number(s) + 1, i = 0)) : n === "<=" && (n = "<", l ? o = Number(o) + 1 : s = Number(s) + 1), n === "<" && (a = "-0"), `${n + o}.${s}.${i}${a}`) : l ? `>=${o}.0.0${a} <${Number(o) + 1}.0.0-0` : f ? `>=${o}.${s}.0${a} <${o}.${Number(s) + 1}.0-0` : r;
620
+ function Gr(e) {
621
+ return e.split(/\s+/).map((t) => t.trim().replace(M(Pr), (r, n, o, s, i, a) => {
622
+ const l = T(o), c = l || T(s), f = c || T(i);
623
+ return n === "=" && f && (n = ""), a = "", l ? n === ">" || n === "<" ? "<0.0.0-0" : "*" : n && f ? (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` : f ? `>=${o}.${s}.0${a} <${o}.${Number(s) + 1}.0-0` : r;
599
624
  })).join(" ");
600
625
  }
601
- function Cr(e) {
602
- return e.trim().replace(M(Rr), "");
626
+ function xr(e) {
627
+ return e.trim().replace(M(Ir), "");
603
628
  }
604
- function Dr(e) {
605
- return e.trim().replace(M(Tr), "");
629
+ function Ur(e) {
630
+ return e.trim().replace(M(Or), "");
606
631
  }
607
632
  function he(e, t) {
608
633
  return e = Number(e) || e, t = Number(t) || t, e > t ? 1 : e === t ? 0 : -1;
609
634
  }
610
- function Fr(e, t) {
635
+ function Vr(e, t) {
611
636
  const { preRelease: r } = e, { preRelease: n } = t;
612
637
  if (r === void 0 && n) return 1;
613
638
  if (r && n === void 0) return -1;
@@ -620,12 +645,12 @@ function Fr(e, t) {
620
645
  return 0;
621
646
  }
622
647
  function se(e, t) {
623
- return he(e.major, t.major) || he(e.minor, t.minor) || he(e.patch, t.patch) || Fr(e, t);
648
+ return he(e.major, t.major) || he(e.minor, t.minor) || he(e.patch, t.patch) || Vr(e, t);
624
649
  }
625
650
  function Re(e, t) {
626
651
  return e.version === t.version;
627
652
  }
628
- function Hr(e, t) {
653
+ function Br(e, t) {
629
654
  switch (e.operator) {
630
655
  case "":
631
656
  case "=":
@@ -644,70 +669,69 @@ function Hr(e, t) {
644
669
  return !1;
645
670
  }
646
671
  }
647
- function Gr(e) {
648
- return ht(Or, Lr, Mr, Cr)(e);
672
+ function Wr(e) {
673
+ return mt(Fr, Hr, Gr, xr)(e);
649
674
  }
650
- function Ur(e) {
651
- return ht(Ar, vr, Pr, kr)(e.trim()).split(/\s+/).join(" ");
675
+ function jr(e) {
676
+ return mt(Lr, Mr, Cr, Dr)(e.trim()).split(/\s+/).join(" ");
652
677
  }
653
678
  function X(e, t) {
654
679
  if (!e) return !1;
655
- const r = Ve(e);
680
+ const r = We(e);
656
681
  if (!r) return !1;
657
- const [, n, , o, s, i, a] = r, c = {
682
+ const [, n, , o, s, i, a] = r, l = {
658
683
  operator: n,
659
- version: We(o, s, i, a),
684
+ version: je(o, s, i, a),
660
685
  major: o,
661
686
  minor: s,
662
687
  patch: i,
663
688
  preRelease: a == null ? void 0 : a.split(".")
664
- }, l = t.split("||");
665
- for (const f of l) {
666
- const d = f.trim();
667
- if (!d || d === "*" || d === "x") return !0;
689
+ }, c = t.split("||");
690
+ for (const f of c) {
691
+ const h = f.trim();
692
+ if (!h || h === "*" || h === "x") return !0;
668
693
  try {
669
- const u = Ur(d);
694
+ const u = jr(h);
670
695
  if (!u.trim()) return !0;
671
- const h = u.split(" ").map((E) => Gr(E)).join(" ");
672
- if (!h.trim()) return !0;
673
- const p = h.split(/\s+/).map((E) => Dr(E)).filter(Boolean);
674
- if (p.length === 0) continue;
696
+ const d = u.split(" ").map((E) => Wr(E)).join(" ");
697
+ if (!d.trim()) return !0;
698
+ const m = d.split(/\s+/).map((E) => Ur(E)).filter(Boolean);
699
+ if (m.length === 0) continue;
675
700
  let y = !0;
676
- for (const E of p) {
677
- const m = Ve(E);
678
- if (!m) {
701
+ for (const E of m) {
702
+ const p = We(E);
703
+ if (!p) {
679
704
  y = !1;
680
705
  break;
681
706
  }
682
- const [, g, , b, w, _, S] = m;
683
- if (!Hr({
707
+ const [, g, , b, N, _, $] = p;
708
+ if (!Br({
684
709
  operator: g,
685
- version: We(b, w, _, S),
710
+ version: je(b, N, _, $),
686
711
  major: b,
687
- minor: w,
712
+ minor: N,
688
713
  patch: _,
689
- preRelease: S == null ? void 0 : S.split(".")
690
- }, c)) {
714
+ preRelease: $ == null ? void 0 : $.split(".")
715
+ }, l)) {
691
716
  y = !1;
692
717
  break;
693
718
  }
694
719
  }
695
720
  if (y) return !0;
696
721
  } catch (u) {
697
- console.error(`[semver] Error processing range part "${d}":`, u);
722
+ console.error(`[semver] Error processing range part "${h}":`, u);
698
723
  continue;
699
724
  }
700
725
  }
701
726
  return !1;
702
727
  }
703
- const re = "default", dt = "global";
704
- function xr(e, t, r, n) {
728
+ const re = "default", pt = "global";
729
+ function qr(e, t, r, n) {
705
730
  var s, i;
706
731
  let o;
707
- if ("get" in e ? o = e.get : "lib" in e ? o = () => Promise.resolve(e.lib) : o = () => Promise.resolve(() => {
708
- throw new Error(`Can not get shared '${r}'!`);
709
- }), (s = e.shareConfig) != null && s.eager && ((i = e.treeShaking) != null && i.mode)) throw new Error('Can not set "eager:true" and "treeShaking" at the same time!');
710
- return {
732
+ return "get" in e ? o = e.get : "lib" in e ? o = () => Promise.resolve(e.lib) : o = () => Promise.resolve(() => {
733
+ S(`Cannot get shared "${r}" from "${t}": neither "get" nor "lib" is provided in the share config.`);
734
+ }), (s = e.shareConfig) != null && s.eager && ((i = e.treeShaking) != null && i.mode) && S(`Invalid shared config for "${r}" from "${t}": cannot use both "eager: true" and "treeShaking.mode" simultaneously. Choose one strategy.`), {
711
735
  deps: [],
712
736
  useIn: [],
713
737
  from: t,
@@ -733,16 +757,16 @@ function xr(e, t, r, n) {
733
757
  } : void 0
734
758
  };
735
759
  }
736
- function pt(e, t) {
760
+ function yt(e, t) {
737
761
  const r = t.shared || {}, n = t.name, o = Object.keys(r).reduce((i, a) => {
738
- const c = st(r[a]);
739
- return i[a] = i[a] || [], c.forEach((l) => {
740
- i[a].push(xr(l, n, a, t.shareStrategy));
762
+ const l = at(r[a]);
763
+ return i[a] = i[a] || [], l.forEach((c) => {
764
+ i[a].push(qr(c, n, a, t.shareStrategy));
741
765
  }), i;
742
766
  }, {}), s = { ...e.shared };
743
767
  return Object.keys(o).forEach((i) => {
744
768
  s[i] ? o[i].forEach((a) => {
745
- s[i].find((c) => c.version === a.version) || s[i].push(a);
769
+ s[i].find((l) => l.version === a.version) || s[i].push(a);
746
770
  }) : s[i] = o[i];
747
771
  }), {
748
772
  allShareInfos: s,
@@ -752,7 +776,7 @@ function pt(e, t) {
752
776
  function ee(e, t) {
753
777
  if (!e) return !1;
754
778
  const { status: r, mode: n } = e;
755
- return r === $e.NO_USE ? !1 : r === $e.CALCULATED ? !0 : n === "runtime-infer" ? t ? Vr(e, t) : !0 : !1;
779
+ return r === $e.NO_USE ? !1 : r === $e.CALCULATED ? !0 : n === "runtime-infer" ? t ? zr(e, t) : !0 : !1;
756
780
  }
757
781
  function G(e, t) {
758
782
  const r = (n) => {
@@ -771,16 +795,16 @@ const te = (e, t) => {
771
795
  return G(n, o);
772
796
  };
773
797
  return Object.keys(e).reduce((n, o) => !n || r(n, o) || n === "0" ? o : n, 0);
774
- }, pe = (e) => !!e.loaded || typeof e.lib == "function", Br = (e) => !!e.loading, Vr = (e, t) => {
798
+ }, me = (e) => !!e.loaded || typeof e.lib == "function", Kr = (e) => !!e.loading, zr = (e, t) => {
775
799
  if (!e || !t) return !1;
776
800
  const { usedExports: r } = e;
777
801
  return r ? !!t.every((n) => r.includes(n)) : !1;
778
802
  };
779
- function Wr(e, t, r, n) {
803
+ function Jr(e, t, r, n) {
780
804
  const o = e[t][r];
781
805
  let s = "", i = ee(n);
782
- const a = function(c, l) {
783
- return i ? o[c].treeShaking ? o[l].treeShaking ? !pe(o[c].treeShaking) && G(c, l) : !1 : !0 : !pe(o[c]) && G(c, l);
806
+ const a = function(l, c) {
807
+ return i ? o[l].treeShaking ? o[c].treeShaking ? !me(o[l].treeShaking) && G(l, c) : !1 : !0 : !me(o[l]) && G(l, c);
784
808
  };
785
809
  if (i) {
786
810
  if (s = te(e[t][r], a), s) return {
@@ -794,18 +818,18 @@ function Wr(e, t, r, n) {
794
818
  useTreesShaking: i
795
819
  };
796
820
  }
797
- const U = (e) => pe(e) || Br(e);
798
- function jr(e, t, r, n) {
821
+ const x = (e) => me(e) || Kr(e);
822
+ function Xr(e, t, r, n) {
799
823
  const o = e[t][r];
800
824
  let s = "", i = ee(n);
801
- const a = function(c, l) {
825
+ const a = function(l, c) {
802
826
  if (i) {
803
- if (!o[c].treeShaking) return !0;
804
- if (!o[l].treeShaking) return !1;
805
- if (U(o[l].treeShaking)) return U(o[c].treeShaking) ? !!G(c, l) : !0;
806
- if (U(o[c].treeShaking)) return !1;
827
+ if (!o[l].treeShaking) return !0;
828
+ if (!o[c].treeShaking) return !1;
829
+ if (x(o[c].treeShaking)) return x(o[l].treeShaking) ? !!G(l, c) : !0;
830
+ if (x(o[l].treeShaking)) return !1;
807
831
  }
808
- return U(o[l]) ? U(o[c]) ? !!G(c, l) : !0 : U(o[c]) ? !1 : G(c, l);
832
+ return x(o[c]) ? x(o[l]) ? !!G(l, c) : !0 : x(o[l]) ? !1 : G(l, c);
809
833
  };
810
834
  if (i) {
811
835
  if (s = te(e[t][r], a), s) return {
@@ -819,19 +843,19 @@ function jr(e, t, r, n) {
819
843
  useTreesShaking: i
820
844
  };
821
845
  }
822
- function Kr(e) {
823
- return e === "loaded-first" ? jr : Wr;
846
+ function Yr(e) {
847
+ return e === "loaded-first" ? Xr : Jr;
824
848
  }
825
849
  function de(e, t, r, n) {
826
850
  if (!e) return;
827
- const { shareConfig: o, scope: s = re, strategy: i, treeShaking: a } = r, c = Array.isArray(s) ? s : [s];
828
- for (const l of c) if (o && e[l] && e[l][t]) {
829
- const { requiredVersion: f } = o, { version: d, useTreesShaking: u } = Kr(i)(e, l, t, a), h = () => {
830
- const y = e[l][t][d];
851
+ const { shareConfig: o, scope: s = re, strategy: i, treeShaking: a } = r, l = Array.isArray(s) ? s : [s];
852
+ for (const c of l) if (o && e[c] && e[c][t]) {
853
+ const { requiredVersion: f } = o, { version: h, useTreesShaking: u } = Yr(i)(e, c, t, a), d = () => {
854
+ const y = e[c][t][h];
831
855
  if (o.singleton) {
832
- if (typeof f == "string" && !X(d, f)) {
833
- const E = `Version ${d} from ${d && y.from} of shared singleton module ${t} does not satisfy the requirement of ${r.from} which needs ${f})`;
834
- o.strictVersion ? k(E) : ke(E);
856
+ if (typeof f == "string" && !X(h, f)) {
857
+ const E = `Version ${h} from ${h && y.from} of shared singleton module ${t} does not satisfy the requirement of ${r.from} which needs ${f})`;
858
+ o.strictVersion ? S(E) : Oe(E);
835
859
  }
836
860
  return {
837
861
  shared: y,
@@ -842,67 +866,67 @@ function de(e, t, r, n) {
842
866
  shared: y,
843
867
  useTreesShaking: u
844
868
  };
845
- if (X(d, f)) return {
869
+ if (X(h, f)) return {
846
870
  shared: y,
847
871
  useTreesShaking: u
848
872
  };
849
873
  const E = ee(a);
850
874
  if (E) {
851
- for (const [m, g] of Object.entries(e[l][t]))
852
- if (ee(g.treeShaking, a == null ? void 0 : a.usedExports) && X(m, f))
875
+ for (const [p, g] of Object.entries(e[c][t]))
876
+ if (ee(g.treeShaking, a == null ? void 0 : a.usedExports) && X(p, f))
853
877
  return {
854
878
  shared: g,
855
879
  useTreesShaking: E
856
880
  };
857
881
  }
858
- for (const [m, g] of Object.entries(e[l][t])) if (X(m, f)) return {
882
+ for (const [p, g] of Object.entries(e[c][t])) if (X(p, f)) return {
859
883
  shared: g,
860
884
  useTreesShaking: !1
861
885
  };
862
886
  }
863
- }, p = {
887
+ }, m = {
864
888
  shareScopeMap: e,
865
- scope: l,
889
+ scope: c,
866
890
  pkgName: t,
867
- version: d,
891
+ version: h,
868
892
  GlobalFederation: Q.__FEDERATION__,
869
893
  shareInfo: r,
870
- resolver: h
894
+ resolver: d
871
895
  };
872
- return (n.emit(p) || p).resolver();
896
+ return (n.emit(m) || m).resolver();
873
897
  }
874
898
  }
875
- function mt() {
899
+ function Et() {
876
900
  return Q.__FEDERATION__.__SHARE__;
877
901
  }
878
- function je(e) {
879
- const { pkgName: t, extraOptions: r, shareInfos: n } = e, o = (c) => {
880
- if (!c) return;
881
- const l = {};
882
- return c.forEach((d) => {
883
- l[d.version] = d;
884
- }), l[te(l, function(d, u) {
885
- return !pe(l[d]) && G(d, u);
902
+ function qe(e) {
903
+ const { pkgName: t, extraOptions: r, shareInfos: n } = e, o = (l) => {
904
+ if (!l) return;
905
+ const c = {};
906
+ return l.forEach((h) => {
907
+ c[h.version] = h;
908
+ }), c[te(c, function(h, u) {
909
+ return !me(c[h]) && G(h, u);
886
910
  })];
887
- }, s = (r == null ? void 0 : r.resolver) ?? o, i = (c) => c !== null && typeof c == "object" && !Array.isArray(c), a = (...c) => {
888
- const l = {};
889
- for (const f of c)
911
+ }, s = (r == null ? void 0 : r.resolver) ?? o, i = (l) => l !== null && typeof l == "object" && !Array.isArray(l), a = (...l) => {
912
+ const c = {};
913
+ for (const f of l)
890
914
  if (f)
891
- for (const [d, u] of Object.entries(f)) {
892
- const h = l[d];
893
- i(h) && i(u) ? l[d] = a(h, u) : u !== void 0 && (l[d] = u);
915
+ for (const [h, u] of Object.entries(f)) {
916
+ const d = c[h];
917
+ i(d) && i(u) ? c[h] = a(d, u) : u !== void 0 && (c[h] = u);
894
918
  }
895
- return l;
919
+ return c;
896
920
  };
897
921
  return a(s(n[t]), r == null ? void 0 : r.customShareInfo);
898
922
  }
899
- const x = (e, t) => {
900
- e.useIn || (e.useIn = []), sr(e.useIn, t);
923
+ const U = (e, t) => {
924
+ e.useIn || (e.useIn = []), ur(e.useIn, t);
901
925
  };
902
926
  function ie(e, t) {
903
927
  return t && e.treeShaking ? e.treeShaking : e;
904
928
  }
905
- function qr(e, t) {
929
+ function Zr(e, t) {
906
930
  for (const r of e) {
907
931
  const n = t.startsWith(r.name);
908
932
  let o = t.replace(r.name, "");
@@ -938,96 +962,95 @@ function qr(e, t) {
938
962
  }
939
963
  }
940
964
  }
941
- function zr(e, t) {
965
+ function Qr(e, t) {
942
966
  for (const r of e)
943
967
  if (t === r.name || r.alias && t === r.alias) return r;
944
968
  }
945
- const yt = "RUNTIME-001", Et = "RUNTIME-002", gt = "RUNTIME-003", _t = "RUNTIME-004", bt = "RUNTIME-005", Ae = "RUNTIME-006", Rt = "RUNTIME-007", Fe = "RUNTIME-008", Jr = "RUNTIME-009", St = "RUNTIME-010", Xr = (e) => `View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split("-")[0].toLowerCase()}#${e.toLowerCase()}`, D = (e, t, r, n) => {
946
- const o = [`${[t[e]]} #${e}`];
947
- return r && o.push(`args: ${JSON.stringify(r)}`), o.push(Xr(e)), n && o.push(`Original Error Message:
948
- ${n}`), o.join(`
949
- `);
950
- }, L = {
951
- [yt]: "Failed to get remoteEntry exports.",
952
- [Et]: 'The remote entry interface does not contain "init"',
953
- [gt]: "Failed to get manifest.",
954
- [_t]: "Failed to locate remote.",
955
- [bt]: "Invalid loadShareSync function call from bundler runtime",
969
+ const gt = "RUNTIME-001", _t = "RUNTIME-002", bt = "RUNTIME-003", Rt = "RUNTIME-004", St = "RUNTIME-005", Ae = "RUNTIME-006", $t = "RUNTIME-007", He = "RUNTIME-008", en = "RUNTIME-009", wt = "RUNTIME-010", Nt = "RUNTIME-011", O = {
970
+ [gt]: "Failed to get remoteEntry exports.",
971
+ [_t]: 'The remote entry interface does not contain "init"',
972
+ [bt]: "Failed to get manifest.",
973
+ [Rt]: "Failed to locate remote.",
974
+ [St]: "Invalid loadShareSync function call from bundler runtime",
956
975
  [Ae]: "Invalid loadShareSync function call from runtime",
957
- [Rt]: "Failed to get remote snapshot.",
958
- [Fe]: "Failed to load script resources.",
959
- [Jr]: "Please call createInstance first.",
960
- [St]: 'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.'
976
+ [$t]: "Failed to get remote snapshot.",
977
+ [He]: "Failed to load script resources.",
978
+ [en]: "Please call createInstance first.",
979
+ [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.',
980
+ [Nt]: "The remoteEntry URL is missing from the remote snapshot."
961
981
  };
962
982
  ({
963
- ...L
983
+ ...O
964
984
  });
965
- const $t = ".then(callbacks[0]).catch(callbacks[1])";
966
- async function Yr({ entry: e, remoteEntryExports: t }) {
985
+ const It = ".then(callbacks[0]).catch(callbacks[1])";
986
+ async function tn({ entry: e, remoteEntryExports: t }) {
967
987
  return new Promise((r, n) => {
968
988
  try {
969
- t ? r(t) : typeof FEDERATION_ALLOW_NEW_FUNCTION < "u" ? new Function("callbacks", `import("${e}")${$t}`)([r, n]) : import(
989
+ t ? r(t) : typeof FEDERATION_ALLOW_NEW_FUNCTION < "u" ? new Function("callbacks", `import("${e}")${It}`)([r, n]) : import(
970
990
  /* webpackIgnore: true */
971
991
  /* @vite-ignore */
972
992
  e
973
993
  ).then(r).catch(n);
974
994
  } catch (o) {
975
- n(o);
995
+ S(`Failed to load ESM entry from "${e}". ${o instanceof Error ? o.message : String(o)}`);
976
996
  }
977
997
  });
978
998
  }
979
- async function Zr({ entry: e, remoteEntryExports: t }) {
999
+ async function rn({ entry: e, remoteEntryExports: t }) {
980
1000
  return new Promise((r, n) => {
981
1001
  try {
982
- t ? r(t) : typeof __system_context__ > "u" ? System.import(e).then(r).catch(n) : new Function("callbacks", `System.import("${e}")${$t}`)([r, n]);
1002
+ t ? r(t) : typeof __system_context__ > "u" ? System.import(e).then(r).catch(n) : new Function("callbacks", `System.import("${e}")${It}`)([r, n]);
983
1003
  } catch (o) {
984
- n(o);
1004
+ S(`Failed to load SystemJS entry from "${e}". ${o instanceof Error ? o.message : String(o)}`);
985
1005
  }
986
1006
  });
987
1007
  }
988
- function wt(e, t, r) {
989
- const { remoteEntryKey: n, entryExports: o } = Me(e, t);
990
- return T(o, D(yt, L, {
1008
+ function Tt(e, t, r) {
1009
+ const { remoteEntryKey: n, entryExports: o } = Ce(e, t);
1010
+ return o || S(gt, O, {
991
1011
  remoteName: e,
992
1012
  remoteEntryUrl: r,
993
1013
  remoteEntryKey: n
994
- })), o;
1014
+ }), o;
995
1015
  }
996
- async function Qr({ name: e, globalName: t, entry: r, loaderHook: n, getEntryUrl: o }) {
997
- const { entryExports: s } = Me(e, t);
998
- return s || tr(o ? o(r) : r, {
1016
+ async function nn({ name: e, globalName: t, entry: r, loaderHook: n, getEntryUrl: o }) {
1017
+ const { entryExports: s } = Ce(e, t);
1018
+ if (s) return s;
1019
+ const i = o ? o(r) : r;
1020
+ return or(i, {
999
1021
  attrs: {},
1000
- createScriptHook: (i, a) => {
1022
+ createScriptHook: (a, l) => {
1001
1023
  const c = n.lifecycle.createScript.emit({
1002
- url: i,
1003
- attrs: a
1024
+ url: a,
1025
+ attrs: l
1004
1026
  });
1005
1027
  if (c && (c instanceof HTMLScriptElement || "script" in c || "timeout" in c))
1006
1028
  return c;
1007
1029
  }
1008
- }).then(() => wt(e, t, r)).catch((i) => {
1009
- throw T(void 0, D(Fe, L, {
1030
+ }).then(() => Tt(e, t, r), (a) => {
1031
+ const l = a instanceof Error ? a.message : String(a);
1032
+ S(He, O, {
1010
1033
  remoteName: e,
1011
- resourceUrl: r
1012
- })), i;
1034
+ resourceUrl: i
1035
+ }, l);
1013
1036
  });
1014
1037
  }
1015
- async function en({ remoteInfo: e, remoteEntryExports: t, loaderHook: r, getEntryUrl: n }) {
1038
+ async function on({ remoteInfo: e, remoteEntryExports: t, loaderHook: r, getEntryUrl: n }) {
1016
1039
  const { entry: o, entryGlobalName: s, name: i, type: a } = e;
1017
1040
  switch (a) {
1018
1041
  case "esm":
1019
1042
  case "module":
1020
- return Yr({
1043
+ return tn({
1021
1044
  entry: o,
1022
1045
  remoteEntryExports: t
1023
1046
  });
1024
1047
  case "system":
1025
- return Zr({
1048
+ return rn({
1026
1049
  entry: o,
1027
1050
  remoteEntryExports: t
1028
1051
  });
1029
1052
  default:
1030
- return Qr({
1053
+ return nn({
1031
1054
  entry: o,
1032
1055
  globalName: s,
1033
1056
  name: i,
@@ -1036,82 +1059,82 @@ async function en({ remoteInfo: e, remoteEntryExports: t, loaderHook: r, getEntr
1036
1059
  });
1037
1060
  }
1038
1061
  }
1039
- async function tn({ remoteInfo: e, loaderHook: t }) {
1040
- const { entry: r, entryGlobalName: n, name: o, type: s } = e, { entryExports: i } = Me(o, n);
1041
- return i || or(r, {
1062
+ async function sn({ remoteInfo: e, loaderHook: t }) {
1063
+ const { entry: r, entryGlobalName: n, name: o, type: s } = e, { entryExports: i } = Ce(o, n);
1064
+ return i || ar(r, {
1042
1065
  attrs: {
1043
1066
  name: o,
1044
1067
  globalName: n,
1045
1068
  type: s
1046
1069
  },
1047
- loaderHook: { createScriptHook: (a, c = {}) => {
1048
- const l = t.lifecycle.createScript.emit({
1070
+ loaderHook: { createScriptHook: (a, l = {}) => {
1071
+ const c = t.lifecycle.createScript.emit({
1049
1072
  url: a,
1050
- attrs: c
1073
+ attrs: l
1051
1074
  });
1052
- if (l && "url" in l)
1053
- return l;
1075
+ if (c && "url" in c)
1076
+ return c;
1054
1077
  } }
1055
- }).then(() => wt(o, n, r)).catch((a) => {
1056
- throw a;
1078
+ }).then(() => Tt(o, n, r)).catch((a) => {
1079
+ S(`Failed to load Node.js entry for remote "${o}" from "${r}". ${a instanceof Error ? a.message : String(a)}`);
1057
1080
  });
1058
1081
  }
1059
- function ve(e) {
1082
+ function Pe(e) {
1060
1083
  const { entry: t, name: r } = e;
1061
- return ze(r, t);
1084
+ return Xe(r, t);
1062
1085
  }
1063
- async function me(e) {
1064
- const { origin: t, remoteEntryExports: r, remoteInfo: n, getEntryUrl: o, _inErrorHandling: s = !1 } = e, i = ve(n);
1086
+ async function pe(e) {
1087
+ const { origin: t, remoteEntryExports: r, remoteInfo: n, getEntryUrl: o, _inErrorHandling: s = !1 } = e, i = Pe(n);
1065
1088
  if (r) return r;
1066
- if (!V[i]) {
1067
- const a = t.remoteHandler.hooks.lifecycle.loadEntry, c = t.loaderHook;
1068
- V[i] = a.emit({
1069
- loaderHook: c,
1089
+ if (!B[i]) {
1090
+ const a = t.remoteHandler.hooks.lifecycle.loadEntry, l = t.loaderHook;
1091
+ B[i] = a.emit({
1092
+ loaderHook: l,
1070
1093
  remoteInfo: n,
1071
1094
  remoteEntryExports: r
1072
- }).then((l) => l || ((typeof ENV_TARGET < "u" ? ENV_TARGET === "web" : F()) ? en({
1095
+ }).then((c) => c || ((typeof ENV_TARGET < "u" ? ENV_TARGET === "web" : F) ? on({
1073
1096
  remoteInfo: n,
1074
1097
  remoteEntryExports: r,
1075
- loaderHook: c,
1098
+ loaderHook: l,
1076
1099
  getEntryUrl: o
1077
- }) : tn({
1100
+ }) : sn({
1078
1101
  remoteInfo: n,
1079
- loaderHook: c
1080
- }))).catch(async (l) => {
1081
- const f = ve(n);
1082
- if (l instanceof Error && l.message.includes(Fe) && !s) {
1083
- const d = (h) => me({
1084
- ...h,
1102
+ loaderHook: l
1103
+ }))).catch(async (c) => {
1104
+ const f = Pe(n), h = c instanceof Error && c.message.includes("ScriptExecutionError");
1105
+ if (c instanceof Error && c.message.includes(He) && !h && !s) {
1106
+ const u = (m) => pe({
1107
+ ...m,
1085
1108
  _inErrorHandling: !0
1086
- }), u = await t.loaderHook.lifecycle.loadEntryError.emit({
1087
- getRemoteEntry: d,
1109
+ }), d = await t.loaderHook.lifecycle.loadEntryError.emit({
1110
+ getRemoteEntry: u,
1088
1111
  origin: t,
1089
1112
  remoteInfo: n,
1090
1113
  remoteEntryExports: r,
1091
- globalLoading: V,
1114
+ globalLoading: B,
1092
1115
  uniqueKey: f
1093
1116
  });
1094
- if (u) return u;
1117
+ if (d) return d;
1095
1118
  }
1096
- throw l;
1119
+ throw c;
1097
1120
  });
1098
1121
  }
1099
- return V[i];
1122
+ return B[i];
1100
1123
  }
1101
- function Pe(e) {
1124
+ function ke(e) {
1102
1125
  return {
1103
1126
  ...e,
1104
1127
  entry: "entry" in e ? e.entry : "",
1105
- type: e.type || dt,
1128
+ type: e.type || pt,
1106
1129
  entryGlobalName: e.entryGlobalName || e.name,
1107
1130
  shareScope: e.shareScope || re
1108
1131
  };
1109
1132
  }
1110
- function rn() {
1133
+ function an() {
1111
1134
  return typeof FEDERATION_BUILD_IDENTIFIER < "u" ? FEDERATION_BUILD_IDENTIFIER : "";
1112
1135
  }
1113
- function nn(e, t) {
1114
- const r = hr(), n = [
1136
+ function cn(e, t) {
1137
+ const r = Er(), n = [
1115
1138
  t.hooks,
1116
1139
  t.remoteHandler.hooks,
1117
1140
  t.sharedHandler.hooks,
@@ -1127,7 +1150,43 @@ function nn(e, t) {
1127
1150
  });
1128
1151
  }), e;
1129
1152
  }
1130
- function It(e) {
1153
+ function ln(e) {
1154
+ return {
1155
+ name: e.name,
1156
+ alias: e.alias,
1157
+ entry: "entry" in e ? e.entry : void 0,
1158
+ version: "version" in e ? e.version : void 0,
1159
+ type: e.type,
1160
+ entryGlobalName: e.entryGlobalName,
1161
+ shareScope: e.shareScope
1162
+ };
1163
+ }
1164
+ function z(e) {
1165
+ var r, n, o, s, i, a;
1166
+ const t = {};
1167
+ for (const [l, c] of Object.entries(e.shared)) {
1168
+ const f = c[0];
1169
+ f && (t[l] = {
1170
+ version: f.version,
1171
+ singleton: (r = f.shareConfig) == null ? void 0 : r.singleton,
1172
+ requiredVersion: ((n = f.shareConfig) == null ? void 0 : n.requiredVersion) === !1 ? !1 : (o = f.shareConfig) == null ? void 0 : o.requiredVersion,
1173
+ eager: f.eager,
1174
+ strictVersion: (s = f.shareConfig) == null ? void 0 : s.strictVersion
1175
+ });
1176
+ }
1177
+ return {
1178
+ project: {
1179
+ name: e.name,
1180
+ mfRole: ((i = e.remotes) == null ? void 0 : i.length) > 0 ? "host" : "unknown"
1181
+ },
1182
+ mfConfig: {
1183
+ name: e.name,
1184
+ remotes: ((a = e.remotes) == null ? void 0 : a.map(ln)) ?? [],
1185
+ shared: t
1186
+ }
1187
+ };
1188
+ }
1189
+ function vt(e) {
1131
1190
  return {
1132
1191
  resourceCategory: "sync",
1133
1192
  share: !0,
@@ -1136,33 +1195,33 @@ function It(e) {
1136
1195
  ...e
1137
1196
  };
1138
1197
  }
1139
- function on(e, t) {
1198
+ function un(e, t) {
1140
1199
  return t.map((r) => {
1141
- const n = zr(e, r.nameOrAlias);
1142
- return T(n, `Unable to preload ${r.nameOrAlias} as it is not included in ${!n && Xe({
1200
+ const n = Qr(e, r.nameOrAlias);
1201
+ return P(n, `Unable to preload ${r.nameOrAlias} as it is not included in ${!n && Ze({
1143
1202
  remoteInfo: n,
1144
1203
  remotes: e
1145
1204
  })}`), {
1146
1205
  remote: n,
1147
- preloadConfig: It(r)
1206
+ preloadConfig: vt(r)
1148
1207
  };
1149
1208
  });
1150
1209
  }
1151
- function sn(e) {
1210
+ function fn(e) {
1152
1211
  return e ? e.map((t) => t === "." ? t : t.startsWith("./") ? t.replace("./", "") : t) : [];
1153
1212
  }
1154
- function Nt(e, t, r, n = !0) {
1213
+ function At(e, t, r, n = !0) {
1155
1214
  const { cssAssets: o, jsAssetsWithoutEntry: s, entryAssets: i } = r;
1156
1215
  if (t.options.inBrowser) {
1157
1216
  if (i.forEach((a) => {
1158
- const { moduleInfo: c } = a, l = t.moduleCache.get(e.name);
1159
- me(l ? {
1217
+ const { moduleInfo: l } = a, c = t.moduleCache.get(e.name);
1218
+ pe(c ? {
1160
1219
  origin: t,
1161
- remoteInfo: c,
1162
- remoteEntryExports: l.remoteEntryExports
1220
+ remoteInfo: l,
1221
+ remoteEntryExports: c.remoteEntryExports
1163
1222
  } : {
1164
1223
  origin: t,
1165
- remoteInfo: c,
1224
+ remoteInfo: l,
1166
1225
  remoteEntryExports: void 0
1167
1226
  });
1168
1227
  }), n) {
@@ -1170,43 +1229,43 @@ function Nt(e, t, r, n = !0) {
1170
1229
  rel: "preload",
1171
1230
  as: "style"
1172
1231
  };
1173
- o.forEach((c) => {
1174
- const { link: l, needAttach: f } = ge({
1175
- url: c,
1232
+ o.forEach((l) => {
1233
+ const { link: c, needAttach: f } = ge({
1234
+ url: l,
1176
1235
  cb: () => {
1177
1236
  },
1178
1237
  attrs: a,
1179
- createLinkHook: (d, u) => {
1180
- const h = t.loaderHook.lifecycle.createLink.emit({
1181
- url: d,
1238
+ createLinkHook: (h, u) => {
1239
+ const d = t.loaderHook.lifecycle.createLink.emit({
1240
+ url: h,
1182
1241
  attrs: u
1183
1242
  });
1184
- if (h instanceof HTMLLinkElement) return h;
1243
+ if (d instanceof HTMLLinkElement) return d;
1185
1244
  }
1186
1245
  });
1187
- f && document.head.appendChild(l);
1246
+ f && document.head.appendChild(c);
1188
1247
  });
1189
1248
  } else {
1190
1249
  const a = {
1191
1250
  rel: "stylesheet",
1192
1251
  type: "text/css"
1193
1252
  };
1194
- o.forEach((c) => {
1195
- const { link: l, needAttach: f } = ge({
1196
- url: c,
1253
+ o.forEach((l) => {
1254
+ const { link: c, needAttach: f } = ge({
1255
+ url: l,
1197
1256
  cb: () => {
1198
1257
  },
1199
1258
  attrs: a,
1200
- createLinkHook: (d, u) => {
1201
- const h = t.loaderHook.lifecycle.createLink.emit({
1202
- url: d,
1259
+ createLinkHook: (h, u) => {
1260
+ const d = t.loaderHook.lifecycle.createLink.emit({
1261
+ url: h,
1203
1262
  attrs: u
1204
1263
  });
1205
- if (h instanceof HTMLLinkElement) return h;
1264
+ if (d instanceof HTMLLinkElement) return d;
1206
1265
  },
1207
1266
  needDeleteLink: !1
1208
1267
  });
1209
- f && document.head.appendChild(l);
1268
+ f && document.head.appendChild(c);
1210
1269
  });
1211
1270
  }
1212
1271
  if (n) {
@@ -1214,48 +1273,48 @@ function Nt(e, t, r, n = !0) {
1214
1273
  rel: "preload",
1215
1274
  as: "script"
1216
1275
  };
1217
- s.forEach((c) => {
1218
- const { link: l, needAttach: f } = ge({
1219
- url: c,
1276
+ s.forEach((l) => {
1277
+ const { link: c, needAttach: f } = ge({
1278
+ url: l,
1220
1279
  cb: () => {
1221
1280
  },
1222
1281
  attrs: a,
1223
- createLinkHook: (d, u) => {
1224
- const h = t.loaderHook.lifecycle.createLink.emit({
1225
- url: d,
1282
+ createLinkHook: (h, u) => {
1283
+ const d = t.loaderHook.lifecycle.createLink.emit({
1284
+ url: h,
1226
1285
  attrs: u
1227
1286
  });
1228
- if (h instanceof HTMLLinkElement) return h;
1287
+ if (d instanceof HTMLLinkElement) return d;
1229
1288
  }
1230
1289
  });
1231
- f && document.head.appendChild(l);
1290
+ f && document.head.appendChild(c);
1232
1291
  });
1233
1292
  } else {
1234
1293
  const a = {
1235
1294
  fetchpriority: "high",
1236
1295
  type: (e == null ? void 0 : e.type) === "module" ? "module" : "text/javascript"
1237
1296
  };
1238
- s.forEach((c) => {
1239
- const { script: l, needAttach: f } = rt({
1240
- url: c,
1297
+ s.forEach((l) => {
1298
+ const { script: c, needAttach: f } = nt({
1299
+ url: l,
1241
1300
  cb: () => {
1242
1301
  },
1243
1302
  attrs: a,
1244
- createScriptHook: (d, u) => {
1245
- const h = t.loaderHook.lifecycle.createScript.emit({
1246
- url: d,
1303
+ createScriptHook: (h, u) => {
1304
+ const d = t.loaderHook.lifecycle.createScript.emit({
1305
+ url: h,
1247
1306
  attrs: u
1248
1307
  });
1249
- if (h instanceof HTMLScriptElement) return h;
1308
+ if (d instanceof HTMLScriptElement) return d;
1250
1309
  },
1251
1310
  needDeleteScript: !0
1252
1311
  });
1253
- f && document.head.appendChild(l);
1312
+ f && document.head.appendChild(c);
1254
1313
  });
1255
1314
  }
1256
1315
  }
1257
1316
  }
1258
- function an(e, t, r) {
1317
+ function hn(e, t, r) {
1259
1318
  const n = t, o = Array.isArray(e.shareScope) ? e.shareScope : [e.shareScope];
1260
1319
  o.length || o.push("default"), o.forEach((i) => {
1261
1320
  n[i] || (n[i] = {});
@@ -1273,19 +1332,19 @@ function an(e, t, r) {
1273
1332
  initScope: r ?? []
1274
1333
  };
1275
1334
  }
1276
- var Tt = class {
1335
+ var Pt = class {
1277
1336
  constructor({ remoteInfo: e, host: t }) {
1278
1337
  this.inited = !1, this.initing = !1, this.lib = void 0, this.remoteInfo = e, this.host = t;
1279
1338
  }
1280
1339
  async getEntry() {
1281
1340
  if (this.remoteEntryExports) return this.remoteEntryExports;
1282
- const e = await me({
1341
+ const e = await pe({
1283
1342
  origin: this.host,
1284
1343
  remoteInfo: this.remoteInfo,
1285
1344
  remoteEntryExports: this.remoteEntryExports
1286
1345
  });
1287
- return T(e, `remoteEntryExports is undefined
1288
- ${Xe(this.remoteInfo)}`), this.remoteEntryExports = e, this.remoteEntryExports;
1346
+ return P(e, `remoteEntryExports is undefined
1347
+ ${Ze(this.remoteInfo)}`), this.remoteEntryExports = e, this.remoteEntryExports;
1289
1348
  }
1290
1349
  async init(e, t, r) {
1291
1350
  const n = await this.getEntry();
@@ -1293,19 +1352,19 @@ var Tt = class {
1293
1352
  if (this.initPromise)
1294
1353
  return await this.initPromise, n;
1295
1354
  this.initing = !0, this.initPromise = (async () => {
1296
- const { remoteEntryInitOptions: o, shareScope: s, initScope: i } = an(this.remoteInfo, this.host.shareScopeMap, r), a = await this.host.hooks.lifecycle.beforeInitContainer.emit({
1355
+ const { remoteEntryInitOptions: o, shareScope: s, initScope: i } = hn(this.remoteInfo, this.host.shareScopeMap, r), a = await this.host.hooks.lifecycle.beforeInitContainer.emit({
1297
1356
  shareScope: s,
1298
1357
  remoteEntryInitOptions: o,
1299
1358
  initScope: i,
1300
1359
  remoteInfo: this.remoteInfo,
1301
1360
  origin: this.host
1302
1361
  });
1303
- typeof (n == null ? void 0 : n.init) > "u" && k(D(Et, L, {
1362
+ typeof (n == null ? void 0 : n.init) > "u" && S(_t, O, {
1304
1363
  hostName: this.host.name,
1305
1364
  remoteName: this.remoteInfo.name,
1306
1365
  remoteEntryUrl: this.remoteInfo.entry,
1307
1366
  remoteEntryKey: this.remoteInfo.entryGlobalName
1308
- })), await n.init(a.shareScope, a.initScope, a.remoteEntryInitOptions), await this.host.hooks.lifecycle.initContainer.emit({
1367
+ }, void 0, z(this.host.options)), await n.init(a.shareScope, a.initScope, a.remoteEntryInitOptions), await this.host.hooks.lifecycle.initContainer.emit({
1309
1368
  ...a,
1310
1369
  id: e,
1311
1370
  remoteSnapshot: t,
@@ -1327,9 +1386,9 @@ var Tt = class {
1327
1386
  remoteEntryExports: s,
1328
1387
  expose: t,
1329
1388
  moduleInfo: this.remoteInfo
1330
- }), i || (i = await s.get(t)), T(i, `${Z(this.remoteInfo)} remote don't export ${t}.`);
1331
- const a = cr(this.remoteInfo.name, t), c = this.wraperFactory(i, a);
1332
- return o ? await c() : c;
1389
+ }), i || (i = await s.get(t)), P(i, `${Z(this.remoteInfo)} remote don't export ${t}.`);
1390
+ const a = dr(this.remoteInfo.name, t), l = this.wraperFactory(i, a);
1391
+ return o ? await l() : l;
1333
1392
  }
1334
1393
  wraperFactory(e, t) {
1335
1394
  function r(n, o) {
@@ -1346,7 +1405,7 @@ var Tt = class {
1346
1405
  return r(n, t), n;
1347
1406
  };
1348
1407
  }
1349
- }, A = class {
1408
+ }, v = class {
1350
1409
  constructor(e) {
1351
1410
  this.type = "", this.listeners = /* @__PURE__ */ new Set(), e && (this.type = e);
1352
1411
  }
@@ -1371,7 +1430,7 @@ var Tt = class {
1371
1430
  removeAll() {
1372
1431
  this.listeners.clear();
1373
1432
  }
1374
- }, v = class extends A {
1433
+ }, A = class extends v {
1375
1434
  emit(...e) {
1376
1435
  let t;
1377
1436
  const r = Array.from(this.listeners);
@@ -1383,42 +1442,42 @@ var Tt = class {
1383
1442
  return Promise.resolve(t);
1384
1443
  }
1385
1444
  };
1386
- function At(e, t) {
1387
- if (!Le(t)) return !1;
1445
+ function kt(e, t) {
1446
+ if (!Me(t)) return !1;
1388
1447
  if (e !== t) {
1389
1448
  for (const r in e) if (!(r in t)) return !1;
1390
1449
  }
1391
1450
  return !0;
1392
1451
  }
1393
- var j = class extends A {
1452
+ var W = class extends v {
1394
1453
  constructor(e) {
1395
- super(), this.onerror = k, this.type = e;
1454
+ super(), this.onerror = S, this.type = e;
1396
1455
  }
1397
1456
  emit(e) {
1398
- Le(e) || k(`The data for the "${this.type}" hook should be an object.`);
1457
+ Me(e) || S(`The data for the "${this.type}" hook should be an object.`);
1399
1458
  for (const t of this.listeners) try {
1400
1459
  const r = t(e);
1401
- if (At(e, r)) e = r;
1460
+ if (kt(e, r)) e = r;
1402
1461
  else {
1403
1462
  this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);
1404
1463
  break;
1405
1464
  }
1406
1465
  } catch (r) {
1407
- ke(r), this.onerror(r);
1466
+ Oe(r), this.onerror(r);
1408
1467
  }
1409
1468
  return e;
1410
1469
  }
1411
- }, H = class extends A {
1470
+ }, D = class extends v {
1412
1471
  constructor(e) {
1413
- super(), this.onerror = k, this.type = e;
1472
+ super(), this.onerror = S, this.type = e;
1414
1473
  }
1415
1474
  emit(e) {
1416
- Le(e) || k(`The response data for the "${this.type}" hook must be an object.`);
1475
+ Me(e) || S(`The response data for the "${this.type}" hook must be an object.`);
1417
1476
  const t = Array.from(this.listeners);
1418
1477
  if (t.length > 0) {
1419
1478
  let r = 0;
1420
- const n = (s) => (ke(s), this.onerror(s), e), o = (s) => {
1421
- if (At(e, s)) {
1479
+ const n = (s) => (Oe(s), this.onerror(s), e), o = (s) => {
1480
+ if (kt(e, s)) {
1422
1481
  if (e = s, r < t.length) try {
1423
1482
  return Promise.resolve(t[r++](e)).then(o, n);
1424
1483
  } catch (i) {
@@ -1431,45 +1490,45 @@ var j = class extends A {
1431
1490
  }
1432
1491
  return Promise.resolve(e);
1433
1492
  }
1434
- }, K = class {
1493
+ }, j = class {
1435
1494
  constructor(e) {
1436
1495
  this.registerPlugins = {}, this.lifecycle = e, this.lifecycleKeys = Object.keys(e);
1437
1496
  }
1438
1497
  applyPlugin(e, t) {
1439
1498
  var n;
1440
- T(ar(e), "Plugin configuration is invalid.");
1499
+ P(hr(e), "Plugin configuration is invalid.");
1441
1500
  const r = e.name;
1442
- T(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) => {
1501
+ 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) => {
1443
1502
  const s = e[o];
1444
1503
  s && this.lifecycle[o].on(s);
1445
1504
  }));
1446
1505
  }
1447
1506
  removePlugin(e) {
1448
- T(e, "A name is required.");
1507
+ P(e, "A name is required.");
1449
1508
  const t = this.registerPlugins[e];
1450
- T(t, `The plugin "${e}" is not registered.`), Object.keys(t).forEach((r) => {
1509
+ P(t, `The plugin "${e}" is not registered.`), Object.keys(t).forEach((r) => {
1451
1510
  r !== "name" && this.lifecycle[r].remove(t[r]);
1452
1511
  });
1453
1512
  }
1454
1513
  };
1455
- function vt(e, t) {
1456
- const r = it(t);
1457
- r.url || k(`The attribute remoteEntry of ${e.name} must not be undefined.`);
1458
- let n = Ie(t, r.url);
1459
- !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;
1514
+ function Ot(e, t) {
1515
+ const r = ct(t);
1516
+ r.url || S(Nt, O, { remoteName: e.name });
1517
+ let n = Ne(t, r.url);
1518
+ !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;
1460
1519
  }
1461
- function cn() {
1520
+ function dn() {
1462
1521
  return {
1463
1522
  name: "snapshot-plugin",
1464
1523
  async afterResolve(e) {
1465
1524
  const { remote: t, pkgNameOrAlias: r, expose: n, origin: o, remoteInfo: s, id: i } = e;
1466
- if (!Oe(t) || !ot(t)) {
1467
- const { remoteSnapshot: a, globalSnapshot: c } = await o.snapshotHandler.loadRemoteSnapshotInfo({
1525
+ if (!Le(t) || !it(t)) {
1526
+ const { remoteSnapshot: a, globalSnapshot: l } = await o.snapshotHandler.loadRemoteSnapshotInfo({
1468
1527
  moduleInfo: t,
1469
1528
  id: i
1470
1529
  });
1471
- vt(s, a);
1472
- const l = {
1530
+ Ot(s, a);
1531
+ const c = {
1473
1532
  remote: t,
1474
1533
  preloadConfig: {
1475
1534
  nameOrAlias: r,
@@ -1480,13 +1539,13 @@ function cn() {
1480
1539
  }
1481
1540
  }, f = await o.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({
1482
1541
  origin: o,
1483
- preloadOptions: l,
1542
+ preloadOptions: c,
1484
1543
  remoteInfo: s,
1485
1544
  remote: t,
1486
1545
  remoteSnapshot: a,
1487
- globalSnapshot: c
1546
+ globalSnapshot: l
1488
1547
  });
1489
- return f && Nt(s, o, f, !1), {
1548
+ return f && At(s, o, f, !1), {
1490
1549
  ...e,
1491
1550
  remoteSnapshot: a
1492
1551
  };
@@ -1495,7 +1554,7 @@ function cn() {
1495
1554
  }
1496
1555
  };
1497
1556
  }
1498
- function ln(e) {
1557
+ function mn(e) {
1499
1558
  const t = e.split(":");
1500
1559
  return t.length === 1 ? {
1501
1560
  name: t[0],
@@ -1508,100 +1567,100 @@ function ln(e) {
1508
1567
  version: t[2]
1509
1568
  };
1510
1569
  }
1511
- function Pt(e, t, r, n, o = {}, s) {
1570
+ function Lt(e, t, r, n, o = {}, s) {
1512
1571
  const { value: i } = q(e, Z(t)), a = s || i;
1513
- if (a && !Ye(a) && (r(a, t, n), a.remotesInfo)) {
1514
- const c = Object.keys(a.remotesInfo);
1515
- for (const l of c) {
1516
- if (o[l]) continue;
1517
- o[l] = !0;
1518
- const f = ln(l), d = a.remotesInfo[l];
1519
- Pt(e, {
1572
+ if (a && !Qe(a) && (r(a, t, n), a.remotesInfo)) {
1573
+ const l = Object.keys(a.remotesInfo);
1574
+ for (const c of l) {
1575
+ if (o[c]) continue;
1576
+ o[c] = !0;
1577
+ const f = mn(c), h = a.remotesInfo[c];
1578
+ Lt(e, {
1520
1579
  name: f.name,
1521
- version: d.matchedVersion
1580
+ version: h.matchedVersion
1522
1581
  }, r, !1, o, void 0);
1523
1582
  }
1524
1583
  }
1525
1584
  }
1526
1585
  const Se = (e, t) => document.querySelector(`${e}[${e === "link" ? "href" : "src"}="${t}"]`);
1527
- function un(e, t, r, n, o) {
1528
- const s = [], i = [], a = [], c = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(), { options: f } = e, { preloadConfig: d } = t, { depsRemote: u } = d;
1529
- if (Pt(n, r, (p, y, E) => {
1530
- var S;
1531
- let m;
1532
- if (E) m = d;
1586
+ function pn(e, t, r, n, o) {
1587
+ const s = [], i = [], a = [], l = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set(), { options: f } = e, { preloadConfig: h } = t, { depsRemote: u } = h;
1588
+ if (Lt(n, r, (m, y, E) => {
1589
+ var $;
1590
+ let p;
1591
+ if (E) p = h;
1533
1592
  else if (Array.isArray(u)) {
1534
- const R = u.find(($) => $.nameOrAlias === y.name || $.nameOrAlias === y.alias);
1593
+ const R = u.find((w) => w.nameOrAlias === y.name || w.nameOrAlias === y.alias);
1535
1594
  if (!R) return;
1536
- m = It(R);
1537
- } else if (u === !0) m = d;
1595
+ p = vt(R);
1596
+ } else if (u === !0) p = h;
1538
1597
  else return;
1539
- const g = Ie(p, it(p).url);
1598
+ const g = Ne(m, ct(m).url);
1540
1599
  g && a.push({
1541
1600
  name: y.name,
1542
1601
  moduleInfo: {
1543
1602
  name: y.name,
1544
1603
  entry: g,
1545
- type: "remoteEntryType" in p ? p.remoteEntryType : "global",
1546
- entryGlobalName: "globalName" in p ? p.globalName : y.name,
1604
+ type: "remoteEntryType" in m ? m.remoteEntryType : "global",
1605
+ entryGlobalName: "globalName" in m ? m.globalName : y.name,
1547
1606
  shareScope: "",
1548
- version: "version" in p ? p.version : void 0
1607
+ version: "version" in m ? m.version : void 0
1549
1608
  },
1550
1609
  url: g
1551
1610
  });
1552
- let b = "modules" in p ? p.modules : [];
1553
- const w = sn(m.exposes);
1554
- w.length && "modules" in p && (b = (S = p == null ? void 0 : p.modules) == null ? void 0 : S.reduce((R, $) => ((w == null ? void 0 : w.indexOf($.moduleName)) !== -1 && R.push($), R), []));
1611
+ let b = "modules" in m ? m.modules : [];
1612
+ const N = fn(p.exposes);
1613
+ N.length && "modules" in m && (b = ($ = m == null ? void 0 : m.modules) == null ? void 0 : $.reduce((R, w) => ((N == null ? void 0 : N.indexOf(w.moduleName)) !== -1 && R.push(w), R), []));
1555
1614
  function _(R) {
1556
- const $ = R.map((O) => Ie(p, O));
1557
- return m.filter ? $.filter(m.filter) : $;
1615
+ const w = R.map((L) => Ne(m, L));
1616
+ return p.filter ? w.filter(p.filter) : w;
1558
1617
  }
1559
1618
  if (b) {
1560
1619
  const R = b.length;
1561
- for (let $ = 0; $ < R; $++) {
1562
- const O = b[$], ye = `${y.name}/${O.moduleName}`;
1620
+ for (let w = 0; w < R; w++) {
1621
+ const L = b[w], ye = `${y.name}/${L.moduleName}`;
1563
1622
  e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({
1564
- id: O.moduleName === "." ? y.name : ye,
1623
+ id: L.moduleName === "." ? y.name : ye,
1565
1624
  name: y.name,
1566
- remoteSnapshot: p,
1567
- preloadConfig: m,
1625
+ remoteSnapshot: m,
1626
+ preloadConfig: p,
1568
1627
  remote: y,
1569
1628
  origin: e
1570
- }), !dr(ye) && (m.resourceCategory === "all" ? (s.push(..._(O.assets.css.async)), s.push(..._(O.assets.css.sync)), i.push(..._(O.assets.js.async)), i.push(..._(O.assets.js.sync))) : (m.resourceCategory = "sync") && (s.push(..._(O.assets.css.sync)), i.push(..._(O.assets.js.sync))), pr(ye));
1629
+ }), !gr(ye) && (p.resourceCategory === "all" ? (s.push(..._(L.assets.css.async)), s.push(..._(L.assets.css.sync)), i.push(..._(L.assets.js.async)), i.push(..._(L.assets.js.sync))) : p.resourceCategory === "sync" && (s.push(..._(L.assets.css.sync)), i.push(..._(L.assets.js.sync))), _r(ye));
1571
1630
  }
1572
1631
  }
1573
1632
  }, !0, {}, o), o.shared && o.shared.length > 0) {
1574
- const p = (y, E) => {
1575
- const { shared: m } = de(e.shareScopeMap, E.sharedName, y, e.sharedHandler.hooks.lifecycle.resolveShare) || {};
1576
- m && typeof m.lib == "function" && (E.assets.js.sync.forEach((g) => {
1577
- c.add(g);
1578
- }), E.assets.css.sync.forEach((g) => {
1633
+ const m = (y, E) => {
1634
+ const { shared: p } = de(e.shareScopeMap, E.sharedName, y, e.sharedHandler.hooks.lifecycle.resolveShare) || {};
1635
+ p && typeof p.lib == "function" && (E.assets.js.sync.forEach((g) => {
1579
1636
  l.add(g);
1637
+ }), E.assets.css.sync.forEach((g) => {
1638
+ c.add(g);
1580
1639
  }));
1581
1640
  };
1582
1641
  o.shared.forEach((y) => {
1583
1642
  var g;
1584
1643
  const E = (g = f.shared) == null ? void 0 : g[y.sharedName];
1585
1644
  if (!E) return;
1586
- const m = y.version ? E.find((b) => b.version === y.version) : E;
1587
- m && st(m).forEach((b) => {
1588
- p(b, y);
1645
+ const p = y.version ? E.find((b) => b.version === y.version) : E;
1646
+ p && at(p).forEach((b) => {
1647
+ m(b, y);
1589
1648
  });
1590
1649
  });
1591
1650
  }
1592
- const h = i.filter((p) => !c.has(p) && !Se("script", p));
1651
+ const d = i.filter((m) => !l.has(m) && !Se("script", m));
1593
1652
  return {
1594
- cssAssets: s.filter((p) => !l.has(p) && !Se("link", p)),
1595
- jsAssetsWithoutEntry: h,
1596
- entryAssets: a.filter((p) => !Se("script", p.url))
1653
+ cssAssets: s.filter((m) => !c.has(m) && !Se("link", m)),
1654
+ jsAssetsWithoutEntry: d,
1655
+ entryAssets: a.filter((m) => !Se("script", m.url))
1597
1656
  };
1598
1657
  }
1599
- const fn = function() {
1658
+ const yn = function() {
1600
1659
  return {
1601
1660
  name: "generate-preload-assets-plugin",
1602
1661
  async generatePreloadAssets(e) {
1603
1662
  const { origin: t, preloadOptions: r, remoteInfo: n, remote: o, globalSnapshot: s, remoteSnapshot: i } = e;
1604
- return F() ? Oe(o) && ot(o) ? {
1663
+ return F ? Le(o) && it(o) ? {
1605
1664
  cssAssets: [],
1606
1665
  jsAssetsWithoutEntry: [],
1607
1666
  entryAssets: [{
@@ -1615,7 +1674,7 @@ const fn = function() {
1615
1674
  shareScope: ""
1616
1675
  }
1617
1676
  }]
1618
- } : (vt(n, i), un(t, r, n, s, i)) : {
1677
+ } : (Ot(n, i), pn(t, r, n, s, i)) : {
1619
1678
  cssAssets: [],
1620
1679
  jsAssetsWithoutEntry: [],
1621
1680
  entryAssets: []
@@ -1623,34 +1682,34 @@ const fn = function() {
1623
1682
  }
1624
1683
  };
1625
1684
  };
1626
- function kt(e, t) {
1685
+ function Mt(e, t) {
1627
1686
  const r = ue({
1628
1687
  name: t.name,
1629
1688
  version: t.options.version
1630
1689
  }), n = r && "remotesInfo" in r && r.remotesInfo && q(r.remotesInfo, e.name).value;
1631
1690
  return n && n.matchedVersion ? {
1632
1691
  hostGlobalSnapshot: r,
1633
- globalSnapshot: He(),
1692
+ globalSnapshot: Ge(),
1634
1693
  remoteSnapshot: ue({
1635
1694
  name: e.name,
1636
1695
  version: n.matchedVersion
1637
1696
  })
1638
1697
  } : {
1639
1698
  hostGlobalSnapshot: void 0,
1640
- globalSnapshot: He(),
1699
+ globalSnapshot: Ge(),
1641
1700
  remoteSnapshot: ue({
1642
1701
  name: e.name,
1643
1702
  version: "version" in e ? e.version : void 0
1644
1703
  })
1645
1704
  };
1646
1705
  }
1647
- var hn = class {
1706
+ var En = class {
1648
1707
  constructor(e) {
1649
- this.loadingHostSnapshot = null, this.manifestCache = /* @__PURE__ */ new Map(), this.hooks = new K({
1650
- beforeLoadRemoteSnapshot: new v("beforeLoadRemoteSnapshot"),
1651
- loadSnapshot: new H("loadGlobalSnapshot"),
1652
- loadRemoteSnapshot: new H("loadRemoteSnapshot"),
1653
- afterLoadSnapshot: new H("afterLoadSnapshot")
1708
+ this.loadingHostSnapshot = null, this.manifestCache = /* @__PURE__ */ new Map(), this.hooks = new j({
1709
+ beforeLoadRemoteSnapshot: new A("beforeLoadRemoteSnapshot"),
1710
+ loadSnapshot: new D("loadGlobalSnapshot"),
1711
+ loadRemoteSnapshot: new D("loadRemoteSnapshot"),
1712
+ afterLoadSnapshot: new D("afterLoadSnapshot")
1654
1713
  }), this.manifestLoading = Q.__FEDERATION__.__MANIFEST_LOADING__, this.HostInstance = e, this.loaderHook = e.loaderHook;
1655
1714
  }
1656
1715
  async loadRemoteSnapshotInfo({ moduleInfo: e, id: t, expose: r }) {
@@ -1667,46 +1726,47 @@ var hn = class {
1667
1726
  version: this.HostInstance.options.version || "",
1668
1727
  remoteEntry: "",
1669
1728
  remotesInfo: {}
1670
- }, fr({ [this.HostInstance.options.name]: o })), o && "remotesInfo" in o && !q(o.remotesInfo, e.name).value && ("version" in e || "entry" in e) && (o.remotesInfo = {
1729
+ }, yr({ [this.HostInstance.options.name]: o })), o && "remotesInfo" in o && !q(o.remotesInfo, e.name).value && ("version" in e || "entry" in e) && (o.remotesInfo = {
1671
1730
  ...o == null ? void 0 : o.remotesInfo,
1672
1731
  [e.name]: { matchedVersion: "version" in e ? e.version : e.entry }
1673
1732
  });
1674
- const { hostGlobalSnapshot: s, remoteSnapshot: i, globalSnapshot: a } = this.getGlobalRemoteInfo(e), { remoteSnapshot: c, globalSnapshot: l } = await this.hooks.lifecycle.loadSnapshot.emit({
1733
+ const { hostGlobalSnapshot: s, remoteSnapshot: i, globalSnapshot: a } = this.getGlobalRemoteInfo(e), { remoteSnapshot: l, globalSnapshot: c } = await this.hooks.lifecycle.loadSnapshot.emit({
1675
1734
  options: n,
1676
1735
  moduleInfo: e,
1677
1736
  hostGlobalSnapshot: s,
1678
1737
  remoteSnapshot: i,
1679
1738
  globalSnapshot: a
1680
1739
  });
1681
- let f, d;
1682
- if (c) if (Ye(c)) {
1683
- const u = F() ? c.remoteEntry : c.ssrRemoteEntry || c.remoteEntry || "", h = await this.getManifestJson(u, e, {}), p = Ge({
1740
+ let f, h;
1741
+ if (l) if (Qe(l)) {
1742
+ const u = F ? l.remoteEntry : l.ssrRemoteEntry || l.remoteEntry || "", d = await this.getManifestJson(u, e, {}), m = xe({
1684
1743
  ...e,
1685
1744
  entry: u
1686
- }, h);
1687
- f = h, d = p;
1745
+ }, d);
1746
+ f = d, h = m;
1688
1747
  } else {
1689
1748
  const { remoteSnapshot: u } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1690
1749
  options: this.HostInstance.options,
1691
1750
  moduleInfo: e,
1692
- remoteSnapshot: c,
1751
+ remoteSnapshot: l,
1693
1752
  from: "global"
1694
1753
  });
1695
- f = u, d = l;
1754
+ f = u, h = c;
1696
1755
  }
1697
- else if (Oe(e)) {
1698
- const u = await this.getManifestJson(e.entry, e, {}), h = Ge(e, u), { remoteSnapshot: p } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1756
+ else if (Le(e)) {
1757
+ const u = await this.getManifestJson(e.entry, e, {}), d = xe(e, u), { remoteSnapshot: m } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1699
1758
  options: this.HostInstance.options,
1700
1759
  moduleInfo: e,
1701
1760
  remoteSnapshot: u,
1702
1761
  from: "global"
1703
1762
  });
1704
- f = p, d = h;
1705
- } else k(D(Rt, L, {
1706
- hostName: e.name,
1707
- hostVersion: e.version,
1708
- globalSnapshot: JSON.stringify(l)
1709
- }));
1763
+ f = m, h = d;
1764
+ } else S($t, O, {
1765
+ remoteName: e.name,
1766
+ remoteVersion: e.version,
1767
+ hostName: this.HostInstance.options.name,
1768
+ globalSnapshot: JSON.stringify(c)
1769
+ }, void 0, z(this.HostInstance.options));
1710
1770
  return await this.hooks.lifecycle.afterLoadSnapshot.emit({
1711
1771
  id: t,
1712
1772
  host: this.HostInstance,
@@ -1715,11 +1775,11 @@ var hn = class {
1715
1775
  remoteSnapshot: f
1716
1776
  }), {
1717
1777
  remoteSnapshot: f,
1718
- globalSnapshot: d
1778
+ globalSnapshot: h
1719
1779
  };
1720
1780
  }
1721
1781
  getGlobalRemoteInfo(e) {
1722
- return kt(e, this.HostInstance);
1782
+ return Mt(e, this.HostInstance);
1723
1783
  }
1724
1784
  async getManifestJson(e, t, r) {
1725
1785
  const n = async () => {
@@ -1735,15 +1795,19 @@ var hn = class {
1735
1795
  from: "runtime",
1736
1796
  lifecycle: "afterResolve",
1737
1797
  origin: this.HostInstance
1738
- }), s || (delete this.manifestLoading[e], k(D(gt, L, {
1798
+ }), s || (delete this.manifestLoading[e], S(bt, O, {
1739
1799
  manifestUrl: e,
1740
1800
  moduleName: t.name,
1741
1801
  hostName: this.HostInstance.options.name
1742
- }, `${i}`)));
1802
+ }, `${i}`, z(this.HostInstance.options)));
1743
1803
  }
1744
- return T(s.metaData && s.exposes && s.shared, `${e} is not a federation manifest`), this.manifestCache.set(e, s), s;
1804
+ return P(s.metaData && s.exposes && s.shared, `"${e}" is not a valid federation manifest for remote "${t.name}". Missing required fields: ${[
1805
+ !s.metaData && "metaData",
1806
+ !s.exposes && "exposes",
1807
+ !s.shared && "shared"
1808
+ ].filter(Boolean).join(", ")}.`), this.manifestCache.set(e, s), s;
1745
1809
  }, o = async () => {
1746
- const s = await n(), i = Xt(s, { version: e }), { remoteSnapshot: a } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1810
+ const s = await n(), i = Qt(s, { version: e }), { remoteSnapshot: a } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1747
1811
  options: this.HostInstance.options,
1748
1812
  moduleInfo: t,
1749
1813
  manifestJson: s,
@@ -1755,19 +1819,19 @@ var hn = class {
1755
1819
  };
1756
1820
  return this.manifestLoading[e] || (this.manifestLoading[e] = o().then((s) => s)), this.manifestLoading[e];
1757
1821
  }
1758
- }, dn = class {
1822
+ }, gn = class {
1759
1823
  constructor(e) {
1760
- this.hooks = new K({
1761
- beforeRegisterShare: new j("beforeRegisterShare"),
1762
- afterResolve: new H("afterResolve"),
1763
- beforeLoadShare: new H("beforeLoadShare"),
1764
- loadShare: new v(),
1765
- resolveShare: new j("resolveShare"),
1766
- initContainerShareScopeMap: new j("initContainerShareScopeMap")
1824
+ this.hooks = new j({
1825
+ beforeRegisterShare: new W("beforeRegisterShare"),
1826
+ afterResolve: new D("afterResolve"),
1827
+ beforeLoadShare: new D("beforeLoadShare"),
1828
+ loadShare: new A(),
1829
+ resolveShare: new W("resolveShare"),
1830
+ initContainerShareScopeMap: new W("initContainerShareScopeMap")
1767
1831
  }), this.host = e, this.shareScopeMap = {}, this.initTokens = {}, this._setGlobalShareScopeMap(e.options);
1768
1832
  }
1769
1833
  registerShared(e, t) {
1770
- const { newShareInfos: r, allShareInfos: n } = pt(e, t);
1834
+ const { newShareInfos: r, allShareInfos: n } = yt(e, t);
1771
1835
  return Object.keys(r).forEach((o) => {
1772
1836
  r[o].forEach((s) => {
1773
1837
  s.scope.forEach((i) => {
@@ -1792,7 +1856,7 @@ var hn = class {
1792
1856
  };
1793
1857
  }
1794
1858
  async loadShare(e, t) {
1795
- const { host: r } = this, n = je({
1859
+ const { host: r } = this, n = qe({
1796
1860
  pkgName: e,
1797
1861
  extraOptions: t,
1798
1862
  shareInfos: r.options.shared
@@ -1806,19 +1870,19 @@ var hn = class {
1806
1870
  shared: r.options.shared,
1807
1871
  origin: r
1808
1872
  });
1809
- T(o, `Cannot find ${e} Share in the ${r.options.name}. Please ensure that the ${e} Share parameters have been injected`);
1873
+ 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.`);
1810
1874
  const { shared: s, useTreesShaking: i } = de(this.shareScopeMap, e, o, this.hooks.lifecycle.resolveShare) || {};
1811
1875
  if (s) {
1812
1876
  const a = ie(s, i);
1813
1877
  if (a.lib)
1814
- return x(a, r.options.name), a.lib;
1878
+ return U(a, r.options.name), a.lib;
1815
1879
  if (a.loading && !a.loaded) {
1816
- const c = await a.loading;
1817
- return a.loaded = !0, a.lib || (a.lib = c), x(a, r.options.name), c;
1880
+ const l = await a.loading;
1881
+ return a.loaded = !0, a.lib || (a.lib = l), U(a, r.options.name), l;
1818
1882
  } else {
1819
- const l = (async () => {
1883
+ const c = (async () => {
1820
1884
  const f = await a.get();
1821
- return x(a, r.options.name), a.loaded = !0, a.lib = f, f;
1885
+ return U(a, r.options.name), a.loaded = !0, a.lib = f, f;
1822
1886
  })();
1823
1887
  return this.setShared({
1824
1888
  pkgName: e,
@@ -1826,21 +1890,21 @@ var hn = class {
1826
1890
  shared: s,
1827
1891
  from: r.options.name,
1828
1892
  lib: null,
1829
- loading: l,
1893
+ loading: c,
1830
1894
  treeShaking: i ? a : void 0
1831
- }), l;
1895
+ }), c;
1832
1896
  }
1833
1897
  } else {
1834
1898
  if (t != null && t.customShareInfo) return !1;
1835
- const a = ee(o.treeShaking), c = ie(o, a), f = (async () => {
1836
- const d = await c.get();
1837
- c.lib = d, c.loaded = !0, x(c, r.options.name);
1838
- const { shared: u, useTreesShaking: h } = de(this.shareScopeMap, e, o, this.hooks.lifecycle.resolveShare) || {};
1899
+ const a = ee(o.treeShaking), l = ie(o, a), f = (async () => {
1900
+ const h = await l.get();
1901
+ l.lib = h, l.loaded = !0, U(l, r.options.name);
1902
+ const { shared: u, useTreesShaking: d } = de(this.shareScopeMap, e, o, this.hooks.lifecycle.resolveShare) || {};
1839
1903
  if (u) {
1840
- const p = ie(u, h);
1841
- p.lib = d, p.loaded = !0, u.from = o.from;
1904
+ const m = ie(u, d);
1905
+ m.lib = h, m.loaded = !0, u.from = o.from;
1842
1906
  }
1843
- return d;
1907
+ return h;
1844
1908
  })();
1845
1909
  return this.setShared({
1846
1910
  pkgName: e,
@@ -1849,7 +1913,7 @@ var hn = class {
1849
1913
  from: r.options.name,
1850
1914
  lib: null,
1851
1915
  loading: f,
1852
- treeShaking: a ? c : void 0
1916
+ treeShaking: a ? l : void 0
1853
1917
  }), f;
1854
1918
  }
1855
1919
  }
@@ -1865,45 +1929,45 @@ var hn = class {
1865
1929
  if (n !== "build") {
1866
1930
  const { initTokens: u } = this;
1867
1931
  s || (s = []);
1868
- let h = u[e];
1869
- if (h || (h = u[e] = { from: this.host.name }), s.indexOf(h) >= 0) return i;
1870
- s.push(h);
1932
+ let d = u[e];
1933
+ if (d || (d = u[e] = { from: this.host.name }), s.indexOf(d) >= 0) return i;
1934
+ s.push(d);
1871
1935
  }
1872
- const a = this.shareScopeMap, c = r.options.name;
1936
+ const a = this.shareScopeMap, l = r.options.name;
1873
1937
  a[e] || (a[e] = {});
1874
- const l = a[e], f = (u, h) => {
1938
+ const c = a[e], f = (u, d) => {
1875
1939
  var b;
1876
- const { version: p, eager: y } = h;
1877
- l[u] = l[u] || {};
1878
- const E = l[u], m = E[p] && ie(E[p]), g = !!(m && ("eager" in m && m.eager || "shareConfig" in m && ((b = m.shareConfig) != null && b.eager)));
1879
- (!m || m.strategy !== "loaded-first" && !m.loaded && (!y != !g ? y : c > E[p].from)) && (E[p] = h);
1880
- }, d = async (u) => {
1881
- const { module: h } = await r.remoteHandler.getRemoteModuleAndOptions({ id: u });
1882
- let p;
1940
+ const { version: m, eager: y } = d;
1941
+ c[u] = c[u] || {};
1942
+ const E = c[u], p = E[m] && ie(E[m]), g = !!(p && ("eager" in p && p.eager || "shareConfig" in p && ((b = p.shareConfig) != null && b.eager)));
1943
+ (!p || p.strategy !== "loaded-first" && !p.loaded && (!y != !g ? y : l > E[m].from)) && (E[m] = d);
1944
+ }, h = async (u) => {
1945
+ const { module: d } = await r.remoteHandler.getRemoteModuleAndOptions({ id: u });
1946
+ let m;
1883
1947
  try {
1884
- p = await h.getEntry();
1948
+ m = await d.getEntry();
1885
1949
  } catch (y) {
1886
- p = await r.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
1950
+ if (m = await r.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
1887
1951
  id: u,
1888
1952
  error: y,
1889
1953
  from: "runtime",
1890
1954
  lifecycle: "beforeLoadShare",
1891
1955
  origin: r
1892
- });
1956
+ }), !m) return;
1893
1957
  } finally {
1894
- p != null && p.init && !h.initing && (h.remoteEntryExports = p, await h.init(void 0, void 0, s));
1958
+ m != null && m.init && !d.initing && (d.remoteEntryExports = m, await d.init(void 0, void 0, s));
1895
1959
  }
1896
1960
  };
1897
1961
  return Object.keys(r.options.shared).forEach((u) => {
1898
- r.options.shared[u].forEach((h) => {
1899
- h.scope.includes(e) && f(u, h);
1962
+ r.options.shared[u].forEach((d) => {
1963
+ d.scope.includes(e) && f(u, d);
1900
1964
  });
1901
1965
  }), (r.options.shareStrategy === "version-first" || o === "version-first") && r.options.remotes.forEach((u) => {
1902
- u.shareScope === e && i.push(d(u.name));
1966
+ u.shareScope === e && i.push(h(u.name));
1903
1967
  }), i;
1904
1968
  }
1905
1969
  loadShareSync(e, t) {
1906
- const { host: r } = this, n = je({
1970
+ const { host: r } = this, n = qe({
1907
1971
  pkgName: e,
1908
1972
  extraOptions: t,
1909
1973
  shareInfos: r.options.shared
@@ -1914,11 +1978,11 @@ var hn = class {
1914
1978
  const { shared: o, useTreesShaking: s } = de(this.shareScopeMap, e, n, this.hooks.lifecycle.resolveShare) || {};
1915
1979
  if (o) {
1916
1980
  if (typeof o.lib == "function")
1917
- return x(o, r.options.name), o.loaded || (o.loaded = !0, o.from === r.options.name && (n.loaded = !0)), o.lib;
1981
+ return U(o, r.options.name), o.loaded || (o.loaded = !0, o.from === r.options.name && (n.loaded = !0)), o.lib;
1918
1982
  if (typeof o.get == "function") {
1919
1983
  const i = o.get();
1920
1984
  if (!(i instanceof Promise))
1921
- return x(o, r.options.name), this.setShared({
1985
+ return U(o, r.options.name), this.setShared({
1922
1986
  pkgName: e,
1923
1987
  loaded: !0,
1924
1988
  from: r.options.name,
@@ -1931,14 +1995,10 @@ var hn = class {
1931
1995
  return n.loaded || (n.loaded = !0), n.lib;
1932
1996
  if (n.get) {
1933
1997
  const i = n.get();
1934
- if (i instanceof Promise) {
1935
- const a = (t == null ? void 0 : t.from) === "build" ? bt : Ae;
1936
- throw new Error(D(a, L, {
1937
- hostName: r.options.name,
1938
- sharedPkgName: e
1939
- }));
1940
- }
1941
- return n.lib = i, this.setShared({
1998
+ return i instanceof Promise && S((t == null ? void 0 : t.from) === "build" ? St : Ae, O, {
1999
+ hostName: r.options.name,
2000
+ sharedPkgName: e
2001
+ }, void 0, z(r.options)), n.lib = i, this.setShared({
1942
2002
  pkgName: e,
1943
2003
  loaded: !0,
1944
2004
  from: r.options.name,
@@ -1946,10 +2006,10 @@ var hn = class {
1946
2006
  shared: n
1947
2007
  }), n.lib;
1948
2008
  }
1949
- throw new Error(D(Ae, L, {
2009
+ S(Ae, O, {
1950
2010
  hostName: r.options.name,
1951
2011
  sharedPkgName: e
1952
- }));
2012
+ }, void 0, z(r.options));
1953
2013
  }
1954
2014
  initShareScopeMap(e, t, r = {}) {
1955
2015
  const { host: n } = this;
@@ -1962,40 +2022,40 @@ var hn = class {
1962
2022
  });
1963
2023
  }
1964
2024
  setShared({ pkgName: e, shared: t, from: r, lib: n, loading: o, loaded: s, get: i, treeShaking: a }) {
1965
- const { version: c, scope: l = "default", ...f } = t, d = Array.isArray(l) ? l : [l], u = (h) => {
1966
- const p = (E, m, g) => {
1967
- g && !E[m] && (E[m] = g);
1968
- }, y = a ? h.treeShaking : h;
1969
- p(y, "loaded", s), p(y, "loading", o), p(y, "get", i);
2025
+ const { version: l, scope: c = "default", ...f } = t, h = Array.isArray(c) ? c : [c], u = (d) => {
2026
+ const m = (E, p, g) => {
2027
+ g && !E[p] && (E[p] = g);
2028
+ }, y = a ? d.treeShaking : d;
2029
+ m(y, "loaded", s), m(y, "loading", o), m(y, "get", i);
1970
2030
  };
1971
- d.forEach((h) => {
1972
- this.shareScopeMap[h] || (this.shareScopeMap[h] = {}), this.shareScopeMap[h][e] || (this.shareScopeMap[h][e] = {}), this.shareScopeMap[h][e][c] || (this.shareScopeMap[h][e][c] = {
1973
- version: c,
1974
- scope: [h],
2031
+ h.forEach((d) => {
2032
+ this.shareScopeMap[d] || (this.shareScopeMap[d] = {}), this.shareScopeMap[d][e] || (this.shareScopeMap[d][e] = {}), this.shareScopeMap[d][e][l] || (this.shareScopeMap[d][e][l] = {
2033
+ version: l,
2034
+ scope: [d],
1975
2035
  ...f,
1976
2036
  lib: n
1977
2037
  });
1978
- const p = this.shareScopeMap[h][e][c];
1979
- u(p), r && p.from !== r && (p.from = r);
2038
+ const m = this.shareScopeMap[d][e][l];
2039
+ u(m), r && m.from !== r && (m.from = r);
1980
2040
  });
1981
2041
  }
1982
2042
  _setGlobalShareScopeMap(e) {
1983
- const t = mt(), r = e.id || e.name;
2043
+ const t = Et(), r = e.id || e.name;
1984
2044
  r && !t[r] && (t[r] = this.shareScopeMap);
1985
2045
  }
1986
- }, pn = class {
2046
+ }, _n = class {
1987
2047
  constructor(e) {
1988
- this.hooks = new K({
1989
- beforeRegisterRemote: new j("beforeRegisterRemote"),
1990
- registerRemote: new j("registerRemote"),
1991
- beforeRequest: new H("beforeRequest"),
1992
- onLoad: new v("onLoad"),
1993
- handlePreloadModule: new A("handlePreloadModule"),
1994
- errorLoadRemote: new v("errorLoadRemote"),
1995
- beforePreloadRemote: new v("beforePreloadRemote"),
1996
- generatePreloadAssets: new v("generatePreloadAssets"),
1997
- afterPreloadRemote: new v(),
1998
- loadEntry: new v()
2048
+ this.hooks = new j({
2049
+ beforeRegisterRemote: new W("beforeRegisterRemote"),
2050
+ registerRemote: new W("registerRemote"),
2051
+ beforeRequest: new D("beforeRequest"),
2052
+ onLoad: new A("onLoad"),
2053
+ handlePreloadModule: new v("handlePreloadModule"),
2054
+ errorLoadRemote: new A("errorLoadRemote"),
2055
+ beforePreloadRemote: new A("beforePreloadRemote"),
2056
+ generatePreloadAssets: new A("generatePreloadAssets"),
2057
+ afterPreloadRemote: new A(),
2058
+ loadEntry: new A()
1999
2059
  }), this.host = e, this.idToRemoteMap = {};
2000
2060
  }
2001
2061
  formatAndRegisterRemote(e, t) {
@@ -2025,18 +2085,18 @@ var hn = class {
2025
2085
  async loadRemote(e, t) {
2026
2086
  const { host: r } = this;
2027
2087
  try {
2028
- const { loadFactory: n = !0 } = t || { loadFactory: !0 }, { module: o, moduleOptions: s, remoteMatchInfo: i } = await this.getRemoteModuleAndOptions({ id: e }), { pkgNameOrAlias: a, remote: c, expose: l, id: f, remoteSnapshot: d } = i, u = await o.get(f, l, t, d), h = await this.hooks.lifecycle.onLoad.emit({
2088
+ 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: f, remoteSnapshot: h } = i, u = await o.get(f, c, t, h), d = await this.hooks.lifecycle.onLoad.emit({
2029
2089
  id: f,
2030
2090
  pkgNameOrAlias: a,
2031
- expose: l,
2091
+ expose: c,
2032
2092
  exposeModule: n ? u : void 0,
2033
2093
  exposeModuleFactory: n ? void 0 : u,
2034
- remote: c,
2094
+ remote: l,
2035
2095
  options: s,
2036
2096
  moduleInstance: o,
2037
2097
  origin: r
2038
2098
  });
2039
- return this.setIdToRemoteMap(e, i), typeof h == "function" ? h : u;
2099
+ return this.setIdToRemoteMap(e, i), typeof d == "function" ? d : u;
2040
2100
  } catch (n) {
2041
2101
  const { from: o = "runtime" } = t || { from: "runtime" }, s = await this.hooks.lifecycle.errorLoadRemote.emit({
2042
2102
  id: e,
@@ -2056,9 +2116,9 @@ var hn = class {
2056
2116
  options: t.options,
2057
2117
  origin: t
2058
2118
  });
2059
- const r = on(t.options.remotes, e);
2119
+ const r = un(t.options.remotes, e);
2060
2120
  await Promise.all(r.map(async (n) => {
2061
- const { remote: o } = n, s = Pe(o), { globalSnapshot: i, remoteSnapshot: a } = await t.snapshotHandler.loadRemoteSnapshotInfo({ moduleInfo: o }), c = await this.hooks.lifecycle.generatePreloadAssets.emit({
2121
+ const { remote: o } = n, s = ke(o), { globalSnapshot: i, remoteSnapshot: a } = await t.snapshotHandler.loadRemoteSnapshotInfo({ moduleInfo: o }), l = await this.hooks.lifecycle.generatePreloadAssets.emit({
2062
2122
  origin: t,
2063
2123
  preloadOptions: n,
2064
2124
  remote: o,
@@ -2066,7 +2126,7 @@ var hn = class {
2066
2126
  globalSnapshot: i,
2067
2127
  remoteSnapshot: a
2068
2128
  });
2069
- c && Nt(s, t, c);
2129
+ l && At(s, t, l);
2070
2130
  }));
2071
2131
  }
2072
2132
  registerRemotes(e, t) {
@@ -2084,50 +2144,50 @@ var hn = class {
2084
2144
  options: t.options,
2085
2145
  origin: t
2086
2146
  });
2087
- } catch (h) {
2147
+ } catch (d) {
2088
2148
  if (n = await this.hooks.lifecycle.errorLoadRemote.emit({
2089
2149
  id: r,
2090
2150
  options: t.options,
2091
2151
  origin: t,
2092
2152
  from: "runtime",
2093
- error: h,
2153
+ error: d,
2094
2154
  lifecycle: "beforeRequest"
2095
- }), !n) throw h;
2155
+ }), !n) throw d;
2096
2156
  }
2097
- const { id: o } = n, s = qr(t.options.remotes, o);
2098
- T(s, D(_t, L, {
2157
+ const { id: o } = n, s = Zr(t.options.remotes, o);
2158
+ s || S(Rt, O, {
2099
2159
  hostName: t.options.name,
2100
2160
  requestId: o
2101
- }));
2102
- const { remote: i } = s, a = Pe(i), c = await t.sharedHandler.hooks.lifecycle.afterResolve.emit({
2161
+ }, void 0, z(t.options));
2162
+ const { remote: i } = s, a = ke(i), l = await t.sharedHandler.hooks.lifecycle.afterResolve.emit({
2103
2163
  id: o,
2104
2164
  ...s,
2105
2165
  options: t.options,
2106
2166
  origin: t,
2107
2167
  remoteInfo: a
2108
- }), { remote: l, expose: f } = c;
2109
- T(l && f, `The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${o}.`);
2110
- let d = t.moduleCache.get(l.name);
2168
+ }), { remote: c, expose: f } = l;
2169
+ P(c && f, `The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${o}.`);
2170
+ let h = t.moduleCache.get(c.name);
2111
2171
  const u = {
2112
2172
  host: t,
2113
2173
  remoteInfo: a
2114
2174
  };
2115
- return d || (d = new Tt(u), t.moduleCache.set(l.name, d)), {
2116
- module: d,
2175
+ return h || (h = new Pt(u), t.moduleCache.set(c.name, h)), {
2176
+ module: h,
2117
2177
  moduleOptions: u,
2118
- remoteMatchInfo: c
2178
+ remoteMatchInfo: l
2119
2179
  };
2120
2180
  }
2121
2181
  registerRemote(e, t, r) {
2122
2182
  const { host: n } = this, o = () => {
2123
2183
  if (e.alias) {
2124
2184
  const i = t.find((a) => {
2125
- var c;
2126
- return e.alias && (a.name.startsWith(e.alias) || ((c = a.alias) == null ? void 0 : c.startsWith(e.alias)));
2185
+ var l;
2186
+ return e.alias && (a.name.startsWith(e.alias) || ((l = a.alias) == null ? void 0 : l.startsWith(e.alias)));
2127
2187
  });
2128
- T(!i, `The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${i && i.name} name or alias`);
2188
+ P(!i, `The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${i && i.name} name or alias`);
2129
2189
  }
2130
- "entry" in e && F() && !e.entry.startsWith("http") && (e.entry = new URL(e.entry, window.location.origin).href), e.shareScope || (e.shareScope = re), e.type || (e.type = dt);
2190
+ "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 = pt);
2131
2191
  };
2132
2192
  this.hooks.lifecycle.beforeRegisterRemote.emit({
2133
2193
  remote: e,
@@ -2144,7 +2204,7 @@ var hn = class {
2144
2204
  r != null && r.force && (this.removeRemote(s), o(), t.push(e), this.hooks.lifecycle.registerRemote.emit({
2145
2205
  remote: e,
2146
2206
  origin: n
2147
- }), Je(i.join(" ")));
2207
+ }), Ye(i.join(" ")));
2148
2208
  }
2149
2209
  }
2150
2210
  removeRemote(e) {
@@ -2156,88 +2216,88 @@ var hn = class {
2156
2216
  if (s) {
2157
2217
  const i = s.remoteInfo, a = i.entryGlobalName;
2158
2218
  I[a] && ((t = Object.getOwnPropertyDescriptor(I, a)) != null && t.configurable ? delete I[a] : I[a] = void 0);
2159
- const c = ve(s.remoteInfo);
2160
- V[c] && delete V[c], r.snapshotHandler.manifestCache.delete(i.entry);
2161
- let l = i.buildVersion ? ze(i.name, i.buildVersion) : i.name;
2162
- const f = I.__FEDERATION__.__INSTANCES__.findIndex((u) => i.buildVersion ? u.options.id === l : u.name === l);
2219
+ const l = Pe(s.remoteInfo);
2220
+ B[l] && delete B[l], r.snapshotHandler.manifestCache.delete(i.entry);
2221
+ let c = i.buildVersion ? Xe(i.name, i.buildVersion) : i.name;
2222
+ const f = I.__FEDERATION__.__INSTANCES__.findIndex((u) => i.buildVersion ? u.options.id === c : u.name === c);
2163
2223
  if (f !== -1) {
2164
2224
  const u = I.__FEDERATION__.__INSTANCES__[f];
2165
- l = u.options.id || l;
2166
- const h = mt();
2167
- let p = !0;
2225
+ c = u.options.id || c;
2226
+ const d = Et();
2227
+ let m = !0;
2168
2228
  const y = [];
2169
- Object.keys(h).forEach((E) => {
2170
- const m = h[E];
2171
- m && Object.keys(m).forEach((g) => {
2172
- const b = m[g];
2173
- b && Object.keys(b).forEach((w) => {
2174
- const _ = b[w];
2175
- _ && Object.keys(_).forEach((S) => {
2176
- const R = _[S];
2177
- R && typeof R == "object" && R.from === i.name && (R.loaded || R.loading ? (R.useIn = R.useIn.filter(($) => $ !== i.name), R.useIn.length ? p = !1 : y.push([
2229
+ Object.keys(d).forEach((E) => {
2230
+ const p = d[E];
2231
+ p && Object.keys(p).forEach((g) => {
2232
+ const b = p[g];
2233
+ b && Object.keys(b).forEach((N) => {
2234
+ const _ = b[N];
2235
+ _ && Object.keys(_).forEach(($) => {
2236
+ const R = _[$];
2237
+ R && typeof R == "object" && R.from === i.name && (R.loaded || R.loading ? (R.useIn = R.useIn.filter((w) => w !== i.name), R.useIn.length ? m = !1 : y.push([
2178
2238
  E,
2179
2239
  g,
2180
- w,
2181
- S
2240
+ N,
2241
+ $
2182
2242
  ])) : y.push([
2183
2243
  E,
2184
2244
  g,
2185
- w,
2186
- S
2245
+ N,
2246
+ $
2187
2247
  ]));
2188
2248
  });
2189
2249
  });
2190
2250
  });
2191
- }), p && (u.shareScopeMap = {}, delete h[l]), y.forEach(([E, m, g, b]) => {
2192
- var w, _, S;
2193
- (S = (_ = (w = h[E]) == null ? void 0 : w[m]) == null ? void 0 : _[g]) == null || delete S[b];
2251
+ }), m && (u.shareScopeMap = {}, delete d[c]), y.forEach(([E, p, g, b]) => {
2252
+ var N, _, $;
2253
+ ($ = (_ = (N = d[E]) == null ? void 0 : N[p]) == null ? void 0 : _[g]) == null || delete $[b];
2194
2254
  }), I.__FEDERATION__.__INSTANCES__.splice(f, 1);
2195
2255
  }
2196
- const { hostGlobalSnapshot: d } = kt(e, r);
2197
- if (d) {
2198
- const u = d && "remotesInfo" in d && d.remotesInfo && q(d.remotesInfo, e.name).key;
2199
- u && (delete d.remotesInfo[u], Q.__FEDERATION__.__MANIFEST_LOADING__[u] && delete Q.__FEDERATION__.__MANIFEST_LOADING__[u]);
2256
+ const { hostGlobalSnapshot: h } = Mt(e, r);
2257
+ if (h) {
2258
+ const u = h && "remotesInfo" in h && h.remotesInfo && q(h.remotesInfo, e.name).key;
2259
+ u && (delete h.remotesInfo[u], Q.__FEDERATION__.__MANIFEST_LOADING__[u] && delete Q.__FEDERATION__.__MANIFEST_LOADING__[u]);
2200
2260
  }
2201
2261
  r.moduleCache.delete(e.name);
2202
2262
  }
2203
2263
  } catch (r) {
2204
- Te.log("removeRemote fail: ", r);
2264
+ ve.error(`removeRemote failed: ${r instanceof Error ? r.message : String(r)}`);
2205
2265
  }
2206
2266
  }
2207
2267
  };
2208
- const mn = typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN == "boolean" ? !FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN : !0;
2209
- var yn = class {
2268
+ const bn = typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN == "boolean" ? !FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN : !0;
2269
+ var Rn = class {
2210
2270
  constructor(e) {
2211
- this.hooks = new K({
2212
- beforeInit: new j("beforeInit"),
2213
- init: new A(),
2214
- beforeInitContainer: new H("beforeInitContainer"),
2215
- initContainer: new H("initContainer")
2216
- }), this.version = "2.1.0", this.moduleCache = /* @__PURE__ */ new Map(), this.loaderHook = new K({
2217
- getModuleInfo: new A(),
2218
- createScript: new A(),
2219
- createLink: new A(),
2220
- fetch: new v(),
2221
- loadEntryError: new v(),
2222
- getModuleFactory: new v()
2223
- }), this.bridgeHook = new K({
2224
- beforeBridgeRender: new A(),
2225
- afterBridgeRender: new A(),
2226
- beforeBridgeDestroy: new A(),
2227
- afterBridgeDestroy: new A()
2271
+ this.hooks = new j({
2272
+ beforeInit: new W("beforeInit"),
2273
+ init: new v(),
2274
+ beforeInitContainer: new D("beforeInitContainer"),
2275
+ initContainer: new D("initContainer")
2276
+ }), this.version = "2.2.0", this.moduleCache = /* @__PURE__ */ new Map(), this.loaderHook = new j({
2277
+ getModuleInfo: new v(),
2278
+ createScript: new v(),
2279
+ createLink: new v(),
2280
+ fetch: new A(),
2281
+ loadEntryError: new A(),
2282
+ getModuleFactory: new A()
2283
+ }), this.bridgeHook = new j({
2284
+ beforeBridgeRender: new v(),
2285
+ afterBridgeRender: new v(),
2286
+ beforeBridgeDestroy: new v(),
2287
+ afterBridgeDestroy: new v()
2228
2288
  });
2229
- const t = mn ? [cn(), fn()] : [], r = {
2230
- id: rn(),
2289
+ const t = bn ? [dn(), yn()] : [], r = {
2290
+ id: an(),
2231
2291
  name: e.name,
2232
2292
  plugins: t,
2233
2293
  remotes: [],
2234
2294
  shared: {},
2235
- inBrowser: F()
2295
+ inBrowser: F
2236
2296
  };
2237
- this.name = e.name, this.options = r, this.snapshotHandler = new hn(this), this.sharedHandler = new dn(this), this.remoteHandler = new pn(this), this.shareScopeMap = this.sharedHandler.shareScopeMap, this.registerPlugins([...r.plugins, ...e.plugins || []]), this.options = this.formatOptions(r, e);
2297
+ this.name = e.name, this.options = r, this.snapshotHandler = new En(this), this.sharedHandler = new gn(this), this.remoteHandler = new _n(this), this.shareScopeMap = this.sharedHandler.shareScopeMap, this.registerPlugins([...r.plugins, ...e.plugins || []]), this.options = this.formatOptions(r, e);
2238
2298
  }
2239
2299
  initOptions(e) {
2240
- e.name && e.name !== this.options.name && k(D(St, L)), this.registerPlugins(e.plugins);
2300
+ e.name && e.name !== this.options.name && S(st(wt, O)), this.registerPlugins(e.plugins);
2241
2301
  const t = this.formatOptions(this.options, e);
2242
2302
  return this.options = t, t;
2243
2303
  }
@@ -2251,10 +2311,10 @@ var yn = class {
2251
2311
  return this.sharedHandler.initializeSharing(e, t);
2252
2312
  }
2253
2313
  initRawContainer(e, t, r) {
2254
- const n = Pe({
2314
+ const n = ke({
2255
2315
  name: e,
2256
2316
  entry: t
2257
- }), o = new Tt({
2317
+ }), o = new Pt({
2258
2318
  host: this,
2259
2319
  remoteInfo: n
2260
2320
  });
@@ -2270,16 +2330,16 @@ var yn = class {
2270
2330
  this.sharedHandler.initShareScopeMap(e, t, r);
2271
2331
  }
2272
2332
  formatOptions(e, t) {
2273
- const { allShareInfos: r } = pt(e, t), { userOptions: n, options: o } = this.hooks.lifecycle.beforeInit.emit({
2333
+ const { allShareInfos: r } = yt(e, t), { userOptions: n, options: o } = this.hooks.lifecycle.beforeInit.emit({
2274
2334
  origin: this,
2275
2335
  userOptions: t,
2276
2336
  options: e,
2277
2337
  shareInfo: r
2278
2338
  }), s = this.remoteHandler.formatAndRegisterRemote(o, n), { allShareInfos: i } = this.sharedHandler.registerShared(o, n), a = [...o.plugins];
2279
- n.plugins && n.plugins.forEach((l) => {
2280
- a.includes(l) || a.push(l);
2339
+ n.plugins && n.plugins.forEach((c) => {
2340
+ a.includes(c) || a.push(c);
2281
2341
  });
2282
- const c = {
2342
+ const l = {
2283
2343
  ...e,
2284
2344
  ...t,
2285
2345
  plugins: a,
@@ -2288,11 +2348,11 @@ var yn = class {
2288
2348
  };
2289
2349
  return this.hooks.lifecycle.init.emit({
2290
2350
  origin: this,
2291
- options: c
2292
- }), c;
2351
+ options: l
2352
+ }), l;
2293
2353
  }
2294
2354
  registerPlugins(e) {
2295
- const t = nn(e, this);
2355
+ const t = cn(e, this);
2296
2356
  this.options.plugins = this.options.plugins.reduce((r, n) => (n && r && !r.find((o) => o.name === n.name) && r.push(n), r), t || []);
2297
2357
  }
2298
2358
  registerRemotes(e, t) {
@@ -2305,42 +2365,42 @@ var yn = class {
2305
2365
  });
2306
2366
  }
2307
2367
  };
2308
- let En = null;
2309
- function Ot() {
2310
- return En;
2368
+ let Sn = null;
2369
+ function Ct() {
2370
+ return Sn;
2311
2371
  }
2312
- lr(yn);
2313
- function Lt(e, t) {
2372
+ mr(Rn);
2373
+ function Dt(e, t) {
2314
2374
  return e.map((r) => {
2315
2375
  const n = {
2316
2376
  ...r,
2317
2377
  path: t + r.path
2318
2378
  };
2319
- return r.children && r.children.length > 0 && (n.children = Lt(
2379
+ return r.children && r.children.length > 0 && (n.children = Dt(
2320
2380
  r.children,
2321
2381
  t
2322
2382
  )), n;
2323
2383
  });
2324
2384
  }
2325
- function gn(e) {
2385
+ function $n(e) {
2326
2386
  const { router: t, basename: r, memoryRoute: n, hashRoute: o } = e, s = t.getRoutes().sort(
2327
- (u, h) => u.path.split("/").filter((p) => p).length - h.path.split("/").filter((p) => p).length
2387
+ (u, d) => u.path.split("/").filter((m) => m).length - d.path.split("/").filter((m) => m).length
2328
2388
  ), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set();
2329
2389
  s.forEach((u) => {
2330
2390
  i.set(u.path, u);
2331
2391
  });
2332
- const c = (u, h) => `${u}/${h}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/", l = (u, h = "") => {
2392
+ const l = (u, d) => `${u}/${d}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/", c = (u, d = "") => {
2333
2393
  if (!u.children || u.children.length === 0)
2334
2394
  return u;
2335
- for (let p = 0; p < u.children.length; p++) {
2336
- const y = u.children[p], E = c(h, y.path), m = i.get(E);
2337
- if (m && !a.has(m)) {
2395
+ for (let m = 0; m < u.children.length; m++) {
2396
+ const y = u.children[m], E = l(d, y.path), p = i.get(E);
2397
+ if (p && !a.has(p)) {
2338
2398
  const g = {
2339
- ...m,
2399
+ ...p,
2340
2400
  path: y.path
2341
2401
  // Keep the original relative path from static route
2342
2402
  };
2343
- u.children[p] = g, a.add(m), l(g, E);
2403
+ u.children[m] = g, a.add(p), c(g, E);
2344
2404
  }
2345
2405
  }
2346
2406
  return u;
@@ -2348,48 +2408,48 @@ function gn(e) {
2348
2408
  let f = [];
2349
2409
  for (const u of s)
2350
2410
  if (!a.has(u)) {
2351
- const h = l(u, u.path);
2352
- a.add(u), f.push(h);
2411
+ const d = c(u, u.path);
2412
+ a.add(u), f.push(d);
2353
2413
  }
2354
- let d;
2355
- return n ? d = ae.createMemoryHistory(r) : o ? (d = ae.createWebHashHistory(), r && (f = Lt(f, r))) : d = ae.createWebHistory(r), {
2356
- history: d,
2414
+ let h;
2415
+ return n ? h = ae.createMemoryHistory(r) : o ? (h = ae.createWebHashHistory(), r && (f = Dt(f, r))) : h = ae.createWebHistory(r), {
2416
+ history: h,
2357
2417
  routes: f
2358
2418
  };
2359
2419
  }
2360
- function wn(e) {
2361
- const t = /* @__PURE__ */ new Map(), r = Ot();
2420
+ function An(e) {
2421
+ const t = /* @__PURE__ */ new Map(), r = Ct();
2362
2422
  return () => ({
2363
- __APP_VERSION__: "2.1.0",
2423
+ __APP_VERSION__: "2.2.0",
2364
2424
  async render(n) {
2365
- var p, y, E;
2425
+ var m, y, E;
2366
2426
  C.debug("createBridgeComponent render Info", n);
2367
2427
  const {
2368
2428
  moduleName: o,
2369
2429
  dom: s,
2370
2430
  basename: i,
2371
2431
  memoryRoute: a,
2372
- hashRoute: c,
2373
- ...l
2374
- } = n, f = Mt.createApp(e.rootComponent, l);
2432
+ hashRoute: l,
2433
+ ...c
2434
+ } = n, f = Ft.createApp(e.rootComponent, c);
2375
2435
  t.set(s, f);
2376
- const d = await ((E = (y = (p = r == null ? void 0 : r.bridgeHook) == null ? void 0 : p.lifecycle) == null ? void 0 : y.beforeBridgeRender) == null ? void 0 : E.emit(n)), u = d && typeof d == "object" && (d != null && d.extraProps) ? d == null ? void 0 : d.extraProps : {}, h = e.appOptions({
2436
+ const h = await ((E = (y = (m = r == null ? void 0 : r.bridgeHook) == null ? void 0 : m.lifecycle) == null ? void 0 : y.beforeBridgeRender) == null ? void 0 : E.emit(n)), u = h && typeof h == "object" && (h != null && h.extraProps) ? h == null ? void 0 : h.extraProps : {}, d = e.appOptions({
2377
2437
  app: f,
2378
2438
  basename: i,
2379
2439
  memoryRoute: a,
2380
- hashRoute: c,
2381
- ...l,
2440
+ hashRoute: l,
2441
+ ...c,
2382
2442
  ...u
2383
2443
  });
2384
- if (h != null && h.router) {
2385
- const { history: m, routes: g } = gn({
2386
- router: h.router,
2444
+ if (d != null && d.router) {
2445
+ const { history: p, routes: g } = $n({
2446
+ router: d.router,
2387
2447
  basename: n.basename,
2388
2448
  memoryRoute: n.memoryRoute,
2389
2449
  hashRoute: n.hashRoute
2390
2450
  }), b = ae.createRouter({
2391
- ...h.router.options,
2392
- history: m,
2451
+ ...d.router.options,
2452
+ history: p,
2393
2453
  routes: g
2394
2454
  });
2395
2455
  C.debug("createBridgeComponent render router info>>>", {
@@ -2406,11 +2466,11 @@ function wn(e) {
2406
2466
  }
2407
2467
  });
2408
2468
  }
2409
- function _n() {
2469
+ function wn() {
2410
2470
  const e = new PopStateEvent("popstate", { state: window.history.state });
2411
2471
  window.dispatchEvent(e);
2412
2472
  }
2413
- const bn = /* @__PURE__ */ Ct({
2473
+ const Nn = /* @__PURE__ */ Ht({
2414
2474
  name: "RemoteApp",
2415
2475
  props: {
2416
2476
  moduleName: String,
@@ -2422,10 +2482,10 @@ const bn = /* @__PURE__ */ Ct({
2422
2482
  },
2423
2483
  inheritAttrs: !1,
2424
2484
  setup(e) {
2425
- const t = Ee(null), r = Ee(null), n = Ee(""), o = Ke(), s = Ot(), i = Dt(), a = async () => {
2426
- var u, h, p, y;
2427
- const l = (u = e.providerInfo) == null ? void 0 : u.call(e);
2428
- r.value = l;
2485
+ const t = Ee(null), r = Ee(null), n = Ee(""), o = Ke(), s = Ct(), i = Gt(), a = async () => {
2486
+ var u, d, m, y;
2487
+ const c = (u = e.providerInfo) == null ? void 0 : u.call(e);
2488
+ r.value = c;
2429
2489
  let f = {
2430
2490
  ...i,
2431
2491
  moduleName: e.moduleName,
@@ -2435,41 +2495,41 @@ const bn = /* @__PURE__ */ Ct({
2435
2495
  hashRoute: e.hashRoute
2436
2496
  };
2437
2497
  C.debug("createRemoteAppComponent LazyComponent render >>>", f);
2438
- const d = await ((y = (p = (h = s == null ? void 0 : s.bridgeHook) == null ? void 0 : h.lifecycle) == null ? void 0 : p.beforeBridgeRender) == null ? void 0 : y.emit(f)) || {};
2498
+ const h = await ((y = (m = (d = s == null ? void 0 : s.bridgeHook) == null ? void 0 : d.lifecycle) == null ? void 0 : m.beforeBridgeRender) == null ? void 0 : y.emit(f)) || {};
2439
2499
  f = {
2440
2500
  ...f,
2441
- ...d.extraProps
2442
- }, l.render(f);
2443
- }, c = Ft(() => o == null ? void 0 : o.path, (l) => {
2444
- l !== o.path && a(), n.value !== "" && n.value !== l && (C.debug("createRemoteAppComponent dispatchPopstateEnv >>>", {
2501
+ ...h.extraProps
2502
+ }, c.render(f);
2503
+ }, l = xt(() => o == null ? void 0 : o.path, (c) => {
2504
+ c !== o.path && a(), n.value !== "" && n.value !== c && (C.debug("createRemoteAppComponent dispatchPopstateEnv >>>", {
2445
2505
  ...e,
2446
2506
  pathname: o.path
2447
- }), _n()), n.value = l;
2507
+ }), wn()), n.value = c;
2448
2508
  });
2449
- return Ht(() => {
2509
+ return Ut(() => {
2450
2510
  a();
2451
- }), Gt(() => {
2452
- var l;
2511
+ }), Vt(() => {
2512
+ var c;
2453
2513
  C.debug("createRemoteAppComponent LazyComponent destroy >>>", {
2454
2514
  ...e
2455
- }), c(), (l = r.value) == null || l.destroy({
2515
+ }), l(), (c = r.value) == null || c.destroy({
2456
2516
  dom: t.value
2457
2517
  });
2458
- }), () => Ut("div", xt(e.rootAttrs || {}, {
2518
+ }), () => Bt("div", Wt(e.rootAttrs || {}, {
2459
2519
  ref: t
2460
2520
  }), null);
2461
2521
  }
2462
2522
  });
2463
- function Rn(e) {
2464
- return Bt({
2465
- __APP_VERSION__: "2.1.0",
2523
+ function In(e) {
2524
+ return jt({
2525
+ __APP_VERSION__: "2.2.0",
2466
2526
  ...e.asyncComponentOptions,
2467
2527
  //@ts-ignore
2468
2528
  loader: async () => {
2469
- var c, l;
2529
+ var l, c;
2470
2530
  const t = Ke();
2471
2531
  let r = "/";
2472
- const n = (l = (c = t == null ? void 0 : t.matched) == null ? void 0 : c[0]) == null ? void 0 : l.path;
2532
+ const n = (c = (l = t == null ? void 0 : t.matched) == null ? void 0 : l[0]) == null ? void 0 : c.path;
2473
2533
  n && (n.endsWith("/:pathMatch(.*)*") ? r = n.replace("/:pathMatch(.*)*", "") : r = t.matched[0].path);
2474
2534
  const o = (e == null ? void 0 : e.export) || "default";
2475
2535
  C.debug(
@@ -2486,7 +2546,7 @@ function Rn(e) {
2486
2546
  ), o in s && typeof a == "function")
2487
2547
  return {
2488
2548
  render() {
2489
- return Vt(bn, {
2549
+ return qt(Nn, {
2490
2550
  moduleName: i,
2491
2551
  providerInfo: a,
2492
2552
  basename: r,
@@ -2498,13 +2558,13 @@ function Rn(e) {
2498
2558
  }
2499
2559
  });
2500
2560
  }
2501
- function In(e) {
2561
+ function Pn(e) {
2502
2562
  return C.warn(
2503
2563
  "createRemoteAppComponent is deprecated, please use createRemoteAppComponent instead!"
2504
- ), Rn(e);
2564
+ ), In(e);
2505
2565
  }
2506
2566
  export {
2507
- wn as createBridgeComponent,
2508
- Rn as createRemoteAppComponent,
2509
- In as createRemoteComponent
2567
+ An as createBridgeComponent,
2568
+ In as createRemoteAppComponent,
2569
+ Pn as createRemoteComponent
2510
2570
  };