@module-federation/bridge-vue3 0.0.0-next-20250224065053 → 0.0.0-next-20250224110717

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.es.js CHANGED
@@ -2,12 +2,198 @@ import * as Vue from "vue";
2
2
  import { defineComponent, ref, watch, onMounted, onBeforeUnmount, createVNode, defineAsyncComponent, h } from "vue";
3
3
  import * as VueRouter from "vue-router";
4
4
  import { useRoute } from "vue-router";
5
+ var __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropNames = Object.getOwnPropertyNames, __hasOwnProp = Object.prototype.hasOwnProperty, __export = (r, t) => {
6
+ for (var n in t)
7
+ __defProp(r, n, { get: t[n], enumerable: !0 });
8
+ }, __copyProps = (r, t, n, o) => {
9
+ if (t && typeof t == "object" || typeof t == "function")
10
+ for (let s of __getOwnPropNames(t))
11
+ !__hasOwnProp.call(r, s) && s !== n && __defProp(r, s, { get: () => t[s], enumerable: !(o = __getOwnPropDesc(t, s)) || o.enumerable });
12
+ return r;
13
+ }, __toCommonJS = (r) => __copyProps(__defProp({}, "__esModule", { value: !0 }), r), browser_exports = {};
14
+ __export(browser_exports, {
15
+ createLogger: () => createLogger2,
16
+ logger: () => logger$1
17
+ });
18
+ var browser = __toCommonJS(browser_exports), supportsSubstitutions = void 0, supportColor = () => {
19
+ if (typeof supportsSubstitutions < "u")
20
+ return supportsSubstitutions;
21
+ const r = console.log;
22
+ try {
23
+ const t = "color test", n = "color: red;";
24
+ supportsSubstitutions = !1, console.log = (...o) => {
25
+ o[0] === `%c${t}` && o[1] === n && (supportsSubstitutions = !0);
26
+ }, console.log(`%c${t}`, n);
27
+ } catch {
28
+ supportsSubstitutions = !1;
29
+ } finally {
30
+ console.log = r;
31
+ }
32
+ return supportsSubstitutions;
33
+ }, ansiToCss = {
34
+ bold: "font-weight: bold;",
35
+ red: "color: red;",
36
+ green: "color: green;",
37
+ orange: "color: orange;",
38
+ dodgerblue: "color: dodgerblue;",
39
+ magenta: "color: magenta;",
40
+ gray: "color: gray;"
41
+ }, formatter = (r) => supportColor() ? (t) => {
42
+ if (Array.isArray(t)) {
43
+ const [n, o] = t;
44
+ return [`%c${n.replace("%c", "")}`, o ? `${ansiToCss[r]}${o}` : `${ansiToCss[r] || ""}`];
45
+ }
46
+ return [`%c${String(t).replace("%c", "")}`, ansiToCss[r] || ""];
47
+ } : (t) => [String(t)], bold = formatter("bold"), red = formatter("red"), green = formatter("green"), orange = formatter("orange"), dodgerblue = formatter("dodgerblue"), magenta = formatter("magenta");
48
+ formatter("gray");
49
+ function getLabel(r, t, n) {
50
+ let o = [""];
51
+ if ("label" in t)
52
+ if (o = [(r !== "log" ? n[r] : void 0) || t.label || ""], t.color) {
53
+ const l = t.color(o[0]);
54
+ Array.isArray(l) && l.length === 2 ? o = bold([l[0], l[1]]) : o = bold(l[0] || "");
55
+ } else
56
+ o = bold(o[0]);
57
+ return o = o.filter(Boolean), o;
58
+ }
59
+ function finalLog(r, t, n, o) {
60
+ r.length ? Array.isArray(o) ? console.log(...r, ...o, ...n) : console.log(...r, t, ...n) : Array.isArray(o) ? console.log(...o) : console.log(t, ...n);
61
+ }
62
+ var LOG_LEVEL = {
63
+ error: 0,
64
+ warn: 1,
65
+ info: 2,
66
+ log: 3,
67
+ verbose: 4
68
+ }, errorStackRegExp = /at\s.*:\d+:\d+[\s\)]*$/, anonymousErrorStackRegExp = /at\s.*\(<anonymous>\)$/, isErrorStackMessage = (r) => errorStackRegExp.test(r) || anonymousErrorStackRegExp.test(r);
69
+ function validateOptions(r) {
70
+ const t = { ...r };
71
+ if (r.labels && typeof r.labels != "object")
72
+ throw new Error("Labels must be an object");
73
+ if (r.level && typeof r.level != "string")
74
+ throw new Error("Level must be a string");
75
+ return t;
76
+ }
77
+ var createLogger$1 = (r = {}, { getLabel: t, handleError: n, finalLog: o, greet: s, LOG_TYPES: l }) => {
78
+ const a = validateOptions(r);
79
+ let i = a.level || "log", c = a.labels || {}, u = (p, m, ...y) => {
80
+ if (LOG_LEVEL[l[p].level] > LOG_LEVEL[i])
81
+ return;
82
+ if (m == null)
83
+ return console.log();
84
+ let _ = l[p], E = "";
85
+ const g = t(p, _, c);
86
+ if (m instanceof Error)
87
+ if (m.stack) {
88
+ let [b, ...S] = m.stack.split(`
89
+ `);
90
+ b.startsWith("Error: ") && (b = b.slice(7)), E = `${b}
91
+ ${n(S.join(`
92
+ `))}`;
93
+ } else
94
+ E = m.message;
95
+ else
96
+ _.level === "error" && typeof m == "string" ? E = m.split(`
97
+ `).map((S) => isErrorStackMessage(S) ? n(S) : S).join(`
98
+ `) : E = `${m}`;
99
+ o(g, E, y, m);
100
+ }, d = {
101
+ // greet
102
+ greet: (p) => u("log", s(p))
103
+ };
104
+ return Object.keys(l).forEach((p) => {
105
+ d[p] = (...m) => u(p, ...m);
106
+ }), Object.defineProperty(d, "level", {
107
+ get: () => i,
108
+ set(p) {
109
+ i = p;
110
+ }
111
+ }), Object.defineProperty(d, "labels", {
112
+ get: () => c,
113
+ set(p) {
114
+ c = p;
115
+ }
116
+ }), d.override = (p) => {
117
+ Object.assign(d, p);
118
+ }, d;
119
+ }, startColor = [189, 255, 243], endColor = [74, 194, 154], isWord = (r) => !/[\s\n]/.test(r);
120
+ function gradient(r) {
121
+ if (!supportColor())
122
+ return [r];
123
+ const t = [...r], n = t.filter(isWord), o = n.length - 1;
124
+ if (o === 0)
125
+ return console.log(`%c${r}`, `color: rgb(${startColor.join(",")}); font-weight: bold;`), [r];
126
+ let s = "", l = [];
127
+ return t.forEach((a) => {
128
+ if (isWord(a)) {
129
+ const i = n.indexOf(a) / o, c = Math.round(startColor[0] + (endColor[0] - startColor[0]) * i), u = Math.round(startColor[1] + (endColor[1] - startColor[1]) * i), d = Math.round(startColor[2] + (endColor[2] - startColor[2]) * i);
130
+ s += `%c${a}`, l.push(`color: rgb(${c},${u},${d}); font-weight: bold;`);
131
+ } else
132
+ s += a;
133
+ }), [s, ...l];
134
+ }
135
+ var LOG_TYPES = {
136
+ // Level error
137
+ error: {
138
+ label: "error",
139
+ level: "error",
140
+ color: red
141
+ },
142
+ // Level warn
143
+ warn: {
144
+ label: "warn",
145
+ level: "warn",
146
+ color: orange
147
+ },
148
+ // Level info
149
+ info: {
150
+ label: "info",
151
+ level: "info",
152
+ color: dodgerblue
153
+ },
154
+ start: {
155
+ label: "start",
156
+ level: "info",
157
+ color: dodgerblue
158
+ },
159
+ ready: {
160
+ label: "ready",
161
+ level: "info",
162
+ color: green
163
+ },
164
+ success: {
165
+ label: "success",
166
+ level: "info",
167
+ color: green
168
+ },
169
+ // Level log
170
+ log: {
171
+ level: "log"
172
+ },
173
+ // Level debug
174
+ debug: {
175
+ label: "debug",
176
+ level: "verbose",
177
+ color: magenta
178
+ }
179
+ };
180
+ function createLogger2(r = {}) {
181
+ return createLogger$1(r, {
182
+ handleError: (t) => t,
183
+ getLabel,
184
+ gradient,
185
+ finalLog,
186
+ LOG_TYPES,
187
+ greet: (t) => gradient(t)
188
+ });
189
+ }
190
+ var logger$1 = createLogger2();
5
191
  function _extends$2() {
6
192
  return _extends$2 = Object.assign || function(t) {
7
- for (var o = 1; o < arguments.length; o++) {
8
- var r = arguments[o];
9
- for (var s in r)
10
- Object.prototype.hasOwnProperty.call(r, s) && (t[s] = r[s]);
193
+ for (var n = 1; n < arguments.length; n++) {
194
+ var o = arguments[n];
195
+ for (var s in o)
196
+ Object.prototype.hasOwnProperty.call(o, s) && (t[s] = o[s]);
11
197
  }
12
198
  return t;
13
199
  }, _extends$2.apply(this, arguments);
@@ -28,57 +214,56 @@ function isBrowserDebug() {
28
214
  function isDebugMode() {
29
215
  return typeof process < "u" && process.env && process.env.FEDERATION_DEBUG ? !!process.env.FEDERATION_DEBUG : typeof FEDERATION_DEBUG < "u" && FEDERATION_DEBUG ? !0 : isBrowserDebug();
30
216
  }
31
- let Logger = class {
32
- log(...t) {
33
- console.log(this.prefix, ...t);
34
- }
35
- warn(...t) {
36
- console.warn(this.prefix, ...t);
37
- }
38
- error(...t) {
39
- console.error(this.prefix, ...t);
40
- }
41
- success(...t) {
42
- console.log(this.prefix, ...t);
43
- }
44
- info(...t) {
45
- console.log(this.prefix, ...t);
46
- }
47
- ready(...t) {
48
- console.log(this.prefix, ...t);
49
- }
50
- debug(...t) {
51
- isDebugMode() && console.log(this.prefix, ...t);
52
- }
53
- constructor(t) {
54
- this.prefix = t;
55
- }
56
- };
57
- function createLogger(n) {
58
- return new Logger(n);
59
- }
60
- const LOG_CATEGORY$1 = "[ Federation Runtime ]", composeKeyWithSeparator = function(...n) {
61
- return n.length ? n.reduce((t, o) => o ? t ? `${t}${SEPARATOR}${o}` : o : t, "") : "";
62
- }, getResourceUrl = (n, t) => {
63
- if ("getPublicPath" in n) {
64
- let o;
65
- return n.getPublicPath.startsWith("function") ? o = new Function("return " + n.getPublicPath)()() : o = new Function(n.getPublicPath)(), `${o}${t}`;
217
+ const PREFIX = "[ Module Federation ]";
218
+ function setDebug(r) {
219
+ isDebugMode() && (r.level = "verbose");
220
+ }
221
+ function setPrefix(r, t) {
222
+ r.labels = {
223
+ warn: `${t} Warn`,
224
+ error: `${t} Error`,
225
+ success: `${t} Success`,
226
+ info: `${t} Info`,
227
+ ready: `${t} Ready`,
228
+ debug: `${t} Debug`
229
+ };
230
+ }
231
+ function createLogger(r) {
232
+ const t = browser.createLogger({
233
+ labels: {
234
+ warn: `${PREFIX} Warn`,
235
+ error: `${PREFIX} Error`,
236
+ success: `${PREFIX} Success`,
237
+ info: `${PREFIX} Info`,
238
+ ready: `${PREFIX} Ready`,
239
+ debug: `${PREFIX} Debug`
240
+ }
241
+ });
242
+ return setDebug(t), setPrefix(t, r), t;
243
+ }
244
+ createLogger(PREFIX);
245
+ const LOG_CATEGORY$1 = "[ Federation Runtime ]", composeKeyWithSeparator = function(...r) {
246
+ return r.length ? r.reduce((t, n) => n ? t ? `${t}${SEPARATOR}${n}` : n : t, "") : "";
247
+ }, getResourceUrl = (r, t) => {
248
+ if ("getPublicPath" in r) {
249
+ let n;
250
+ return r.getPublicPath.startsWith("function") ? n = new Function("return " + r.getPublicPath)()() : n = new Function(r.getPublicPath)(), `${n}${t}`;
66
251
  } else
67
- return "publicPath" in n ? `${n.publicPath}${t}` : (console.warn("Cannot get resource URL. If in debug mode, please ignore.", n, t), "");
68
- }, warn$1 = (n) => {
69
- console.warn(`${LOG_CATEGORY$1}: ${n}`);
252
+ return "publicPath" in r ? `${r.publicPath}${t}` : (console.warn("Cannot get resource URL. If in debug mode, please ignore.", r, t), "");
253
+ }, warn$1 = (r) => {
254
+ console.warn(`${LOG_CATEGORY$1}: ${r}`);
70
255
  };
71
- function safeToString(n) {
256
+ function safeToString(r) {
72
257
  try {
73
- return JSON.stringify(n, null, 2);
258
+ return JSON.stringify(r, null, 2);
74
259
  } catch {
75
260
  return "";
76
261
  }
77
262
  }
78
- const simpleJoinRemoteEntry = (n, t) => {
79
- if (!n)
263
+ const simpleJoinRemoteEntry = (r, t) => {
264
+ if (!r)
80
265
  return t;
81
- const r = ((s) => {
266
+ const o = ((s) => {
82
267
  if (s === ".")
83
268
  return "";
84
269
  if (s.startsWith("./"))
@@ -88,25 +273,25 @@ const simpleJoinRemoteEntry = (n, t) => {
88
273
  return l.endsWith("/") ? l.slice(0, -1) : l;
89
274
  }
90
275
  return s;
91
- })(n);
92
- return r ? r.endsWith("/") ? `${r}${t}` : `${r}/${t}` : t;
276
+ })(r);
277
+ return o ? o.endsWith("/") ? `${o}${t}` : `${o}/${t}` : t;
93
278
  };
94
- function inferAutoPublicPath(n) {
95
- return n.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
279
+ function inferAutoPublicPath(r) {
280
+ return r.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
96
281
  }
97
- function generateSnapshotFromManifest(n, t = {}) {
98
- var o, r;
282
+ function generateSnapshotFromManifest(r, t = {}) {
283
+ var n, o;
99
284
  const { remotes: s = {}, overrides: l = {}, version: a } = t;
100
285
  let i;
101
- const c = () => "publicPath" in n.metaData ? n.metaData.publicPath === "auto" && a ? inferAutoPublicPath(a) : n.metaData.publicPath : n.metaData.getPublicPath, u = Object.keys(l);
286
+ const c = () => "publicPath" in r.metaData ? r.metaData.publicPath === "auto" && a ? inferAutoPublicPath(a) : r.metaData.publicPath : r.metaData.getPublicPath, u = Object.keys(l);
102
287
  let d = {};
103
288
  if (!Object.keys(s).length) {
104
- var m;
105
- d = ((m = n.remotes) == null ? void 0 : m.reduce((R, $) => {
106
- let T;
107
- const A = $.federationContainerName;
108
- return u.includes(A) ? T = l[A] : "version" in $ ? T = $.version : T = $.entry, R[A] = {
109
- matchedVersion: T
289
+ var p;
290
+ d = ((p = r.remotes) == null ? void 0 : p.reduce((R, $) => {
291
+ let w;
292
+ const O = $.federationContainerName;
293
+ return u.includes(O) ? w = l[O] : "version" in $ ? w = $.version : w = $.entry, R[O] = {
294
+ matchedVersion: w
110
295
  }, R;
111
296
  }, {})) || {};
112
297
  }
@@ -114,133 +299,133 @@ function generateSnapshotFromManifest(n, t = {}) {
114
299
  // overrides will override dependencies
115
300
  matchedVersion: u.includes(R) ? l[R] : s[R]
116
301
  });
117
- const { remoteEntry: { path: p, name: y, type: g }, types: E, buildInfo: { buildVersion: _ }, globalName: b, ssrRemoteEntry: v } = n.metaData, { exposes: I } = n;
118
- let S = {
302
+ const { remoteEntry: { path: m, name: y, type: _ }, types: E, buildInfo: { buildVersion: g }, globalName: b, ssrRemoteEntry: S } = r.metaData, { exposes: v } = r;
303
+ let I = {
119
304
  version: a || "",
120
- buildVersion: _,
305
+ buildVersion: g,
121
306
  globalName: b,
122
- remoteEntry: simpleJoinRemoteEntry(p, y),
123
- remoteEntryType: g,
307
+ remoteEntry: simpleJoinRemoteEntry(m, y),
308
+ remoteEntryType: _,
124
309
  remoteTypes: simpleJoinRemoteEntry(E.path, E.name),
125
310
  remoteTypesZip: E.zip || "",
126
311
  remoteTypesAPI: E.api || "",
127
312
  remotesInfo: d,
128
- shared: n == null ? void 0 : n.shared.map((R) => ({
313
+ shared: r == null ? void 0 : r.shared.map((R) => ({
129
314
  assets: R.assets,
130
315
  sharedName: R.name,
131
316
  version: R.version
132
317
  })),
133
- modules: I == null ? void 0 : I.map((R) => ({
318
+ modules: v == null ? void 0 : v.map((R) => ({
134
319
  moduleName: R.name,
135
320
  modulePath: R.path,
136
321
  assets: R.assets
137
322
  }))
138
323
  };
139
- if ((o = n.metaData) != null && o.prefetchInterface) {
140
- const R = n.metaData.prefetchInterface;
141
- S = _extends$2({}, S, {
324
+ if ((n = r.metaData) != null && n.prefetchInterface) {
325
+ const R = r.metaData.prefetchInterface;
326
+ I = _extends$2({}, I, {
142
327
  prefetchInterface: R
143
328
  });
144
329
  }
145
- if ((r = n.metaData) != null && r.prefetchEntry) {
146
- const { path: R, name: $, type: T } = n.metaData.prefetchEntry;
147
- S = _extends$2({}, S, {
330
+ if ((o = r.metaData) != null && o.prefetchEntry) {
331
+ const { path: R, name: $, type: w } = r.metaData.prefetchEntry;
332
+ I = _extends$2({}, I, {
148
333
  prefetchEntry: simpleJoinRemoteEntry(R, $),
149
- prefetchEntryType: T
334
+ prefetchEntryType: w
150
335
  });
151
336
  }
152
- if ("publicPath" in n.metaData ? i = _extends$2({}, S, {
337
+ if ("publicPath" in r.metaData ? i = _extends$2({}, I, {
153
338
  publicPath: c()
154
- }) : i = _extends$2({}, S, {
339
+ }) : i = _extends$2({}, I, {
155
340
  getPublicPath: c()
156
- }), v) {
157
- const R = simpleJoinRemoteEntry(v.path, v.name);
158
- i.ssrRemoteEntry = R, i.ssrRemoteEntryType = v.type || "commonjs-module";
341
+ }), S) {
342
+ const R = simpleJoinRemoteEntry(S.path, S.name);
343
+ i.ssrRemoteEntry = R, i.ssrRemoteEntryType = S.type || "commonjs-module";
159
344
  }
160
345
  return i;
161
346
  }
162
- function isManifestProvider(n) {
163
- return !!("remoteEntry" in n && n.remoteEntry.includes(MANIFEST_EXT));
347
+ function isManifestProvider(r) {
348
+ return !!("remoteEntry" in r && r.remoteEntry.includes(MANIFEST_EXT));
164
349
  }
165
- async function safeWrapper(n, t) {
350
+ async function safeWrapper(r, t) {
166
351
  try {
167
- return await n();
168
- } catch (o) {
169
- warn$1(o);
352
+ return await r();
353
+ } catch (n) {
354
+ warn$1(n);
170
355
  return;
171
356
  }
172
357
  }
173
- function isStaticResourcesEqual(n, t) {
174
- const o = /^(https?:)?\/\//i, r = n.replace(o, "").replace(/\/$/, ""), s = t.replace(o, "").replace(/\/$/, "");
175
- return r === s;
358
+ function isStaticResourcesEqual(r, t) {
359
+ const n = /^(https?:)?\/\//i, o = r.replace(n, "").replace(/\/$/, ""), s = t.replace(n, "").replace(/\/$/, "");
360
+ return o === s;
176
361
  }
177
- function createScript(n) {
178
- let t = null, o = !0, r = 2e4, s;
362
+ function createScript(r) {
363
+ let t = null, n = !0, o = 2e4, s;
179
364
  const l = document.getElementsByTagName("script");
180
365
  for (let i = 0; i < l.length; i++) {
181
366
  const c = l[i], u = c.getAttribute("src");
182
- if (u && isStaticResourcesEqual(u, n.url)) {
183
- t = c, o = !1;
367
+ if (u && isStaticResourcesEqual(u, r.url)) {
368
+ t = c, n = !1;
184
369
  break;
185
370
  }
186
371
  }
187
372
  if (!t) {
188
- const i = n.attrs;
373
+ const i = r.attrs;
189
374
  t = document.createElement("script"), t.type = (i == null ? void 0 : i.type) === "module" ? "module" : "text/javascript";
190
375
  let c;
191
- n.createScriptHook && (c = n.createScriptHook(n.url, n.attrs), c instanceof HTMLScriptElement ? t = c : typeof c == "object" && ("script" in c && c.script && (t = c.script), "timeout" in c && c.timeout && (r = c.timeout))), t.src || (t.src = n.url), i && !c && Object.keys(i).forEach((u) => {
376
+ r.createScriptHook && (c = r.createScriptHook(r.url, r.attrs), c instanceof HTMLScriptElement ? t = c : typeof c == "object" && ("script" in c && c.script && (t = c.script), "timeout" in c && c.timeout && (o = c.timeout))), t.src || (t.src = r.url), i && !c && Object.keys(i).forEach((u) => {
192
377
  t && (u === "async" || u === "defer" ? t[u] = i[u] : t.getAttribute(u) || t.setAttribute(u, i[u]));
193
378
  });
194
379
  }
195
380
  const a = async (i, c) => {
196
381
  clearTimeout(s);
197
382
  const u = () => {
198
- (c == null ? void 0 : c.type) === "error" ? n != null && n.onErrorCallback && (n == null || n.onErrorCallback(c)) : n != null && n.cb && (n == null || n.cb());
383
+ (c == null ? void 0 : c.type) === "error" ? r != null && r.onErrorCallback && (r == null || r.onErrorCallback(c)) : r != null && r.cb && (r == null || r.cb());
199
384
  };
200
385
  if (t && (t.onerror = null, t.onload = null, safeWrapper(() => {
201
- const { needDeleteScript: d = !0 } = n;
386
+ const { needDeleteScript: d = !0 } = r;
202
387
  d && t != null && t.parentNode && t.parentNode.removeChild(t);
203
388
  }), i && typeof i == "function")) {
204
389
  const d = i(c);
205
390
  if (d instanceof Promise) {
206
- const m = await d;
207
- return u(), m;
391
+ const p = await d;
392
+ return u(), p;
208
393
  }
209
394
  return u(), d;
210
395
  }
211
396
  u();
212
397
  };
213
398
  return t.onerror = a.bind(null, t.onerror), t.onload = a.bind(null, t.onload), s = setTimeout(() => {
214
- a(null, new Error(`Remote script "${n.url}" time-outed.`));
215
- }, r), {
399
+ a(null, new Error(`Remote script "${r.url}" time-outed.`));
400
+ }, o), {
216
401
  script: t,
217
- needAttach: o
402
+ needAttach: n
218
403
  };
219
404
  }
220
- function createLink(n) {
221
- let t = null, o = !0;
222
- const r = document.getElementsByTagName("link");
223
- for (let l = 0; l < r.length; l++) {
224
- const a = r[l], i = a.getAttribute("href"), c = a.getAttribute("ref");
225
- if (i && isStaticResourcesEqual(i, n.url) && c === n.attrs.ref) {
226
- t = a, o = !1;
405
+ function createLink(r) {
406
+ let t = null, n = !0;
407
+ const o = document.getElementsByTagName("link");
408
+ for (let l = 0; l < o.length; l++) {
409
+ const a = o[l], i = a.getAttribute("href"), c = a.getAttribute("ref");
410
+ if (i && isStaticResourcesEqual(i, r.url) && c === r.attrs.ref) {
411
+ t = a, n = !1;
227
412
  break;
228
413
  }
229
414
  }
230
415
  if (!t) {
231
- t = document.createElement("link"), t.setAttribute("href", n.url);
416
+ t = document.createElement("link"), t.setAttribute("href", r.url);
232
417
  let l;
233
- const a = n.attrs;
234
- n.createLinkHook && (l = n.createLinkHook(n.url, a), l instanceof HTMLLinkElement && (t = l)), a && !l && Object.keys(a).forEach((i) => {
418
+ const a = r.attrs;
419
+ r.createLinkHook && (l = r.createLinkHook(r.url, a), l instanceof HTMLLinkElement && (t = l)), a && !l && Object.keys(a).forEach((i) => {
235
420
  t && !t.getAttribute(i) && t.setAttribute(i, a[i]);
236
421
  });
237
422
  }
238
423
  const s = (l, a) => {
239
424
  const i = () => {
240
- (a == null ? void 0 : a.type) === "error" ? n != null && n.onErrorCallback && (n == null || n.onErrorCallback(a)) : n != null && n.cb && (n == null || n.cb());
425
+ (a == null ? void 0 : a.type) === "error" ? r != null && r.onErrorCallback && (r == null || r.onErrorCallback(a)) : r != null && r.cb && (r == null || r.cb());
241
426
  };
242
427
  if (t && (t.onerror = null, t.onload = null, safeWrapper(() => {
243
- const { needDeleteLink: c = !0 } = n;
428
+ const { needDeleteLink: c = !0 } = r;
244
429
  c && t != null && t.parentNode && t.parentNode.removeChild(t);
245
430
  }), l)) {
246
431
  const c = l(a);
@@ -250,52 +435,52 @@ function createLink(n) {
250
435
  };
251
436
  return t.onerror = s.bind(null, t.onerror), t.onload = s.bind(null, t.onload), {
252
437
  link: t,
253
- needAttach: o
438
+ needAttach: n
254
439
  };
255
440
  }
256
- function loadScript(n, t) {
257
- const { attrs: o = {}, createScriptHook: r } = t;
441
+ function loadScript(r, t) {
442
+ const { attrs: n = {}, createScriptHook: o } = t;
258
443
  return new Promise((s, l) => {
259
444
  const { script: a, needAttach: i } = createScript({
260
- url: n,
445
+ url: r,
261
446
  cb: s,
262
447
  onErrorCallback: l,
263
448
  attrs: _extends$2({
264
449
  fetchpriority: "high"
265
- }, o),
266
- createScriptHook: r,
450
+ }, n),
451
+ createScriptHook: o,
267
452
  needDeleteScript: !0
268
453
  });
269
454
  i && document.head.appendChild(a);
270
455
  });
271
456
  }
272
- function importNodeModule(n) {
273
- if (!n)
457
+ function importNodeModule(r) {
458
+ if (!r)
274
459
  throw new Error("import specifier is required");
275
- return new Function("name", "return import(name)")(n).then((o) => o).catch((o) => {
276
- throw console.error(`Error importing module ${n}:`, o), o;
460
+ return new Function("name", "return import(name)")(r).then((n) => n).catch((n) => {
461
+ throw console.error(`Error importing module ${r}:`, n), n;
277
462
  });
278
463
  }
279
464
  const loadNodeFetch = async () => {
280
- const n = await importNodeModule("node-fetch");
281
- return n.default || n;
282
- }, lazyLoaderHookFetch = async (n, t, o) => {
283
- const s = await ((l, a) => o.lifecycle.fetch.emit(l, a))(n, t || {});
284
- return !s || !(s instanceof Response) ? (typeof fetch > "u" ? await loadNodeFetch() : fetch)(n, t || {}) : s;
465
+ const r = await importNodeModule("node-fetch");
466
+ return r.default || r;
467
+ }, lazyLoaderHookFetch = async (r, t, n) => {
468
+ const s = await ((l, a) => n.lifecycle.fetch.emit(l, a))(r, t || {});
469
+ return !s || !(s instanceof Response) ? (typeof fetch > "u" ? await loadNodeFetch() : fetch)(r, t || {}) : s;
285
470
  };
286
471
  function createScriptNode(url, cb, attrs, loaderHook) {
287
472
  if (loaderHook != null && loaderHook.createScriptHook) {
288
- const n = loaderHook.createScriptHook(url);
289
- n && typeof n == "object" && "url" in n && (url = n.url);
473
+ const r = loaderHook.createScriptHook(url);
474
+ r && typeof r == "object" && "url" in r && (url = r.url);
290
475
  }
291
476
  let urlObj;
292
477
  try {
293
478
  urlObj = new URL(url);
294
- } catch (n) {
295
- console.error("Error constructing URL:", n), cb(new Error(`Invalid URL: ${n}`));
479
+ } catch (r) {
480
+ console.error("Error constructing URL:", r), cb(new Error(`Invalid URL: ${r}`));
296
481
  return;
297
482
  }
298
- const getFetch = async () => loaderHook != null && loaderHook.fetch ? (n, t) => lazyLoaderHookFetch(n, t, loaderHook) : typeof fetch > "u" ? loadNodeFetch() : fetch, handleScriptFetch = async (f, urlObj) => {
483
+ const getFetch = async () => loaderHook != null && loaderHook.fetch ? (r, t) => lazyLoaderHookFetch(r, t, loaderHook) : typeof fetch > "u" ? loadNodeFetch() : fetch, handleScriptFetch = async (f, urlObj) => {
299
484
  try {
300
485
  var _vm_constants;
301
486
  const res = await f(urlObj.href), data = await res.text(), [path, vm] = await Promise.all([
@@ -316,91 +501,91 @@ function createScriptNode(url, cb, attrs, loaderHook) {
316
501
  script.runInThisContext()(scriptContext.exports, scriptContext.module, eval("require"), urlDirname, filename);
317
502
  const exportedInterface = scriptContext.module.exports || scriptContext.exports;
318
503
  if (attrs && exportedInterface && attrs.globalName) {
319
- const n = exportedInterface[attrs.globalName] || exportedInterface;
320
- cb(void 0, n);
504
+ const r = exportedInterface[attrs.globalName] || exportedInterface;
505
+ cb(void 0, r);
321
506
  return;
322
507
  }
323
508
  cb(void 0, exportedInterface);
324
- } catch (n) {
325
- cb(n instanceof Error ? n : new Error(`Script execution error: ${n}`));
509
+ } catch (r) {
510
+ cb(r instanceof Error ? r : new Error(`Script execution error: ${r}`));
326
511
  }
327
512
  };
328
- getFetch().then(async (n) => {
513
+ getFetch().then(async (r) => {
329
514
  if ((attrs == null ? void 0 : attrs.type) === "esm" || (attrs == null ? void 0 : attrs.type) === "module")
330
515
  return loadModule(urlObj.href, {
331
- fetch: n,
516
+ fetch: r,
332
517
  vm: await importNodeModule("vm")
333
518
  }).then(async (t) => {
334
519
  await t.evaluate(), cb(void 0, t.namespace);
335
520
  }).catch((t) => {
336
521
  cb(t instanceof Error ? t : new Error(`Script execution error: ${t}`));
337
522
  });
338
- handleScriptFetch(n, urlObj);
339
- }).catch((n) => {
340
- cb(n);
523
+ handleScriptFetch(r, urlObj);
524
+ }).catch((r) => {
525
+ cb(r);
341
526
  });
342
527
  }
343
- function loadScriptNode(n, t) {
344
- return new Promise((o, r) => {
345
- createScriptNode(n, (s, l) => {
528
+ function loadScriptNode(r, t) {
529
+ return new Promise((n, o) => {
530
+ createScriptNode(r, (s, l) => {
346
531
  if (s)
347
- r(s);
532
+ o(s);
348
533
  else {
349
534
  var a, i;
350
535
  const c = (t == null || (a = t.attrs) == null ? void 0 : a.globalName) || `__FEDERATION_${t == null || (i = t.attrs) == null ? void 0 : i.name}:custom__`, u = globalThis[c] = l;
351
- o(u);
536
+ n(u);
352
537
  }
353
538
  }, t.attrs, t.loaderHook);
354
539
  });
355
540
  }
356
- async function loadModule(n, t) {
357
- const { fetch: o, vm: r } = t, l = await (await o(n)).text(), a = new r.SourceTextModule(l, {
541
+ async function loadModule(r, t) {
542
+ const { fetch: n, vm: o } = t, l = await (await n(r)).text(), a = new o.SourceTextModule(l, {
358
543
  // @ts-ignore
359
544
  importModuleDynamically: async (i, c) => {
360
- const u = new URL(i, n).href;
545
+ const u = new URL(i, r).href;
361
546
  return loadModule(u, t);
362
547
  }
363
548
  });
364
549
  return await a.link(async (i) => {
365
- const c = new URL(i, n).href;
550
+ const c = new URL(i, r).href;
366
551
  return await loadModule(c, t);
367
552
  }), a;
368
553
  }
369
554
  const LoggerInstance = createLogger("[ Module Federation Bridge Vue3 ]");
370
555
  function _extends$1() {
371
556
  return _extends$1 = Object.assign || function(t) {
372
- for (var o = 1; o < arguments.length; o++) {
373
- var r = arguments[o];
374
- for (var s in r)
375
- Object.prototype.hasOwnProperty.call(r, s) && (t[s] = r[s]);
557
+ for (var n = 1; n < arguments.length; n++) {
558
+ var o = arguments[n];
559
+ for (var s in o)
560
+ Object.prototype.hasOwnProperty.call(o, s) && (t[s] = o[s]);
376
561
  }
377
562
  return t;
378
563
  }, _extends$1.apply(this, arguments);
379
564
  }
380
- function _object_without_properties_loose(n, t) {
381
- if (n == null)
565
+ function _object_without_properties_loose(r, t) {
566
+ if (r == null)
382
567
  return {};
383
- var o = {}, r = Object.keys(n), s, l;
384
- for (l = 0; l < r.length; l++)
385
- s = r[l], !(t.indexOf(s) >= 0) && (o[s] = n[s]);
386
- return o;
568
+ var n = {}, o = Object.keys(r), s, l;
569
+ for (l = 0; l < o.length; l++)
570
+ s = o[l], !(t.indexOf(s) >= 0) && (n[s] = r[s]);
571
+ return n;
387
572
  }
388
- const RUNTIME_001 = "RUNTIME-001", RUNTIME_002 = "RUNTIME-002", RUNTIME_003 = "RUNTIME-003", RUNTIME_004 = "RUNTIME-004", RUNTIME_005 = "RUNTIME-005", RUNTIME_006 = "RUNTIME-006", RUNTIME_007 = "RUNTIME-007", RUNTIME_008 = "RUNTIME-008", TYPE_001 = "TYPE-001", BUILD_001 = "BUILD-001", getDocsUrl = (n) => `https://module-federation.io/guide/troubleshooting/${n.split("-")[0].toLowerCase()}/${n}`, getShortErrorMsg = (n, t, o, r) => {
573
+ const RUNTIME_001 = "RUNTIME-001", RUNTIME_002 = "RUNTIME-002", RUNTIME_003 = "RUNTIME-003", RUNTIME_004 = "RUNTIME-004", RUNTIME_005 = "RUNTIME-005", RUNTIME_006 = "RUNTIME-006", RUNTIME_007 = "RUNTIME-007", RUNTIME_008 = "RUNTIME-008", TYPE_001 = "TYPE-001", BUILD_001 = "BUILD-001", getDocsUrl = (r) => `https://module-federation.io/guide/troubleshooting/${r.split("-")[0].toLowerCase()}/${r}`, getShortErrorMsg = (r, t, n, o) => {
389
574
  const s = [
390
575
  `${[
391
- t[n]
392
- ]} #${n}`
576
+ t[r]
577
+ ]} #${r}`
393
578
  ];
394
- return o && s.push(`args: ${JSON.stringify(o)}`), s.push(getDocsUrl(n)), r && s.push(`Original Error Message:
395
- ${r}`), s.join(`
579
+ return n && s.push(`args: ${JSON.stringify(n)}`), s.push(getDocsUrl(r)), o && s.push(`Original Error Message:
580
+ ${o}`), s.join(`
396
581
  `);
397
582
  };
398
583
  function _extends() {
399
584
  return _extends = Object.assign || function(t) {
400
- for (var o = 1; o < arguments.length; o++) {
401
- var r = arguments[o];
402
- for (var s in r)
403
- Object.prototype.hasOwnProperty.call(r, s) && (t[s] = r[s]);
585
+ for (var n = 1; n < arguments.length; n++) {
586
+ var o = arguments[n];
587
+ for (var s in o)
588
+ Object.prototype.hasOwnProperty.call(o, s) && (t[s] = o[s]);
404
589
  }
405
590
  return t;
406
591
  }, _extends.apply(this, arguments);
@@ -421,58 +606,58 @@ const runtimeDescMap = {
421
606
  };
422
607
  _extends({}, runtimeDescMap, typeDescMap, buildDescMap);
423
608
  const LOG_CATEGORY = "[ Federation Runtime ]", logger = createLogger(LOG_CATEGORY);
424
- function assert(n, t) {
425
- n || error(t);
609
+ function assert(r, t) {
610
+ r || error(t);
426
611
  }
427
- function error(n) {
428
- throw n instanceof Error ? (n.message = `${LOG_CATEGORY}: ${n.message}`, n) : new Error(`${LOG_CATEGORY}: ${n}`);
612
+ function error(r) {
613
+ throw r instanceof Error ? (r.message = `${LOG_CATEGORY}: ${r.message}`, r) : new Error(`${LOG_CATEGORY}: ${r}`);
429
614
  }
430
- function warn(n) {
431
- n instanceof Error && (n.message = `${LOG_CATEGORY}: ${n.message}`), logger.warn(n);
615
+ function warn(r) {
616
+ r instanceof Error && (r.message = `${LOG_CATEGORY}: ${r.message}`), logger.warn(r);
432
617
  }
433
- function addUniqueItem(n, t) {
434
- return n.findIndex((o) => o === t) === -1 && n.push(t), n;
618
+ function addUniqueItem(r, t) {
619
+ return r.findIndex((n) => n === t) === -1 && r.push(t), r;
435
620
  }
436
- function getFMId(n) {
437
- return "version" in n && n.version ? `${n.name}:${n.version}` : "entry" in n && n.entry ? `${n.name}:${n.entry}` : `${n.name}`;
621
+ function getFMId(r) {
622
+ return "version" in r && r.version ? `${r.name}:${r.version}` : "entry" in r && r.entry ? `${r.name}:${r.entry}` : `${r.name}`;
438
623
  }
439
- function isRemoteInfoWithEntry(n) {
440
- return typeof n.entry < "u";
624
+ function isRemoteInfoWithEntry(r) {
625
+ return typeof r.entry < "u";
441
626
  }
442
- function isPureRemoteEntry(n) {
443
- return !n.entry.includes(".json") && n.entry.includes(".js");
627
+ function isPureRemoteEntry(r) {
628
+ return !r.entry.includes(".json") && r.entry.includes(".js");
444
629
  }
445
- function isObject(n) {
446
- return n && typeof n == "object";
630
+ function isObject(r) {
631
+ return r && typeof r == "object";
447
632
  }
448
633
  const objectToString = Object.prototype.toString;
449
- function isPlainObject(n) {
450
- return objectToString.call(n) === "[object Object]";
634
+ function isPlainObject(r) {
635
+ return objectToString.call(r) === "[object Object]";
451
636
  }
452
- function arrayOptions(n) {
453
- return Array.isArray(n) ? n : [
454
- n
637
+ function arrayOptions(r) {
638
+ return Array.isArray(r) ? r : [
639
+ r
455
640
  ];
456
641
  }
457
- function getRemoteEntryInfoFromSnapshot(n) {
642
+ function getRemoteEntryInfoFromSnapshot(r) {
458
643
  const t = {
459
644
  url: "",
460
645
  type: "global",
461
646
  globalName: ""
462
647
  };
463
- return isBrowserEnv() ? "remoteEntry" in n ? {
464
- url: n.remoteEntry,
465
- type: n.remoteEntryType,
466
- globalName: n.globalName
467
- } : t : "ssrRemoteEntry" in n ? {
468
- url: n.ssrRemoteEntry || t.url,
469
- type: n.ssrRemoteEntryType || t.type,
470
- globalName: n.globalName
648
+ return isBrowserEnv() ? "remoteEntry" in r ? {
649
+ url: r.remoteEntry,
650
+ type: r.remoteEntryType,
651
+ globalName: r.globalName
652
+ } : t : "ssrRemoteEntry" in r ? {
653
+ url: r.ssrRemoteEntry || t.url,
654
+ type: r.ssrRemoteEntryType || t.type,
655
+ globalName: r.globalName
471
656
  } : t;
472
657
  }
473
- const processModuleAlias = (n, t) => {
474
- let o;
475
- return n.endsWith("/") ? o = n.slice(0, -1) : o = n, t.startsWith(".") && (t = t.slice(1)), o = o + t, o;
658
+ const processModuleAlias = (r, t) => {
659
+ let n;
660
+ return r.endsWith("/") ? n = r.slice(0, -1) : n = r, t.startsWith(".") && (t = t.slice(1)), n = n + t, n;
476
661
  }, CurrentGlobal = typeof globalThis == "object" ? globalThis : window, nativeGlobal = (() => {
477
662
  try {
478
663
  return document.defaultView;
@@ -480,57 +665,57 @@ const processModuleAlias = (n, t) => {
480
665
  return CurrentGlobal;
481
666
  }
482
667
  })(), Global = nativeGlobal;
483
- function definePropertyGlobalVal(n, t, o) {
484
- Object.defineProperty(n, t, {
485
- value: o,
668
+ function definePropertyGlobalVal(r, t, n) {
669
+ Object.defineProperty(r, t, {
670
+ value: n,
486
671
  configurable: !1,
487
672
  writable: !0
488
673
  });
489
674
  }
490
- function includeOwnProperty(n, t) {
491
- return Object.hasOwnProperty.call(n, t);
675
+ function includeOwnProperty(r, t) {
676
+ return Object.hasOwnProperty.call(r, t);
492
677
  }
493
678
  includeOwnProperty(CurrentGlobal, "__GLOBAL_LOADING_REMOTE_ENTRY__") || definePropertyGlobalVal(CurrentGlobal, "__GLOBAL_LOADING_REMOTE_ENTRY__", {});
494
679
  const globalLoading = CurrentGlobal.__GLOBAL_LOADING_REMOTE_ENTRY__;
495
- function setGlobalDefaultVal(n) {
496
- var t, o, r, s, l, a;
497
- includeOwnProperty(n, "__VMOK__") && !includeOwnProperty(n, "__FEDERATION__") && definePropertyGlobalVal(n, "__FEDERATION__", n.__VMOK__), includeOwnProperty(n, "__FEDERATION__") || (definePropertyGlobalVal(n, "__FEDERATION__", {
680
+ function setGlobalDefaultVal(r) {
681
+ var t, n, o, s, l, a;
682
+ includeOwnProperty(r, "__VMOK__") && !includeOwnProperty(r, "__FEDERATION__") && definePropertyGlobalVal(r, "__FEDERATION__", r.__VMOK__), includeOwnProperty(r, "__FEDERATION__") || (definePropertyGlobalVal(r, "__FEDERATION__", {
498
683
  __GLOBAL_PLUGIN__: [],
499
684
  __INSTANCES__: [],
500
685
  moduleInfo: {},
501
686
  __SHARE__: {},
502
687
  __MANIFEST_LOADING__: {},
503
688
  __PRELOADED_MAP__: /* @__PURE__ */ new Map()
504
- }), definePropertyGlobalVal(n, "__VMOK__", n.__FEDERATION__));
689
+ }), definePropertyGlobalVal(r, "__VMOK__", r.__FEDERATION__));
505
690
  var i;
506
- (i = (t = n.__FEDERATION__).__GLOBAL_PLUGIN__) != null || (t.__GLOBAL_PLUGIN__ = []);
691
+ (i = (t = r.__FEDERATION__).__GLOBAL_PLUGIN__) != null || (t.__GLOBAL_PLUGIN__ = []);
507
692
  var c;
508
- (c = (o = n.__FEDERATION__).__INSTANCES__) != null || (o.__INSTANCES__ = []);
693
+ (c = (n = r.__FEDERATION__).__INSTANCES__) != null || (n.__INSTANCES__ = []);
509
694
  var u;
510
- (u = (r = n.__FEDERATION__).moduleInfo) != null || (r.moduleInfo = {});
695
+ (u = (o = r.__FEDERATION__).moduleInfo) != null || (o.moduleInfo = {});
511
696
  var d;
512
- (d = (s = n.__FEDERATION__).__SHARE__) != null || (s.__SHARE__ = {});
513
- var m;
514
- (m = (l = n.__FEDERATION__).__MANIFEST_LOADING__) != null || (l.__MANIFEST_LOADING__ = {});
697
+ (d = (s = r.__FEDERATION__).__SHARE__) != null || (s.__SHARE__ = {});
515
698
  var p;
516
- (p = (a = n.__FEDERATION__).__PRELOADED_MAP__) != null || (a.__PRELOADED_MAP__ = /* @__PURE__ */ new Map());
699
+ (p = (l = r.__FEDERATION__).__MANIFEST_LOADING__) != null || (l.__MANIFEST_LOADING__ = {});
700
+ var m;
701
+ (m = (a = r.__FEDERATION__).__PRELOADED_MAP__) != null || (a.__PRELOADED_MAP__ = /* @__PURE__ */ new Map());
517
702
  }
518
703
  setGlobalDefaultVal(CurrentGlobal);
519
704
  setGlobalDefaultVal(nativeGlobal);
520
- function setGlobalFederationConstructor(n, t = isDebugMode()) {
521
- t && (CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = n, CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.6.21");
705
+ function setGlobalFederationConstructor(r, t = isDebugMode()) {
706
+ t && (CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = r, CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.6.21");
522
707
  }
523
- function getInfoWithoutType(n, t) {
708
+ function getInfoWithoutType(r, t) {
524
709
  if (typeof t == "string") {
525
- if (n[t])
710
+ if (r[t])
526
711
  return {
527
- value: n[t],
712
+ value: r[t],
528
713
  key: t
529
714
  };
530
715
  {
531
- const r = Object.keys(n);
532
- for (const s of r) {
533
- const [l, a] = s.split(":"), i = `${l}:${t}`, c = n[i];
716
+ const o = Object.keys(r);
717
+ for (const s of o) {
718
+ const [l, a] = s.split(":"), i = `${l}:${t}`, c = r[i];
534
719
  if (c)
535
720
  return {
536
721
  value: c,
@@ -545,121 +730,121 @@ function getInfoWithoutType(n, t) {
545
730
  } else
546
731
  throw new Error("key must be string");
547
732
  }
548
- const getGlobalSnapshot = () => nativeGlobal.__FEDERATION__.moduleInfo, getTargetSnapshotInfoByModuleInfo = (n, t) => {
549
- const o = getFMId(n), r = getInfoWithoutType(t, o).value;
550
- if (r && !r.version && "version" in n && n.version && (r.version = n.version), r)
551
- return r;
552
- if ("version" in n && n.version) {
553
- const { version: s } = n, l = _object_without_properties_loose(n, [
733
+ const getGlobalSnapshot = () => nativeGlobal.__FEDERATION__.moduleInfo, getTargetSnapshotInfoByModuleInfo = (r, t) => {
734
+ const n = getFMId(r), o = getInfoWithoutType(t, n).value;
735
+ if (o && !o.version && "version" in r && r.version && (o.version = r.version), o)
736
+ return o;
737
+ if ("version" in r && r.version) {
738
+ const { version: s } = r, l = _object_without_properties_loose(r, [
554
739
  "version"
555
740
  ]), a = getFMId(l), i = getInfoWithoutType(nativeGlobal.__FEDERATION__.moduleInfo, a).value;
556
741
  if ((i == null ? void 0 : i.version) === s)
557
742
  return i;
558
743
  }
559
- }, getGlobalSnapshotInfoByModuleInfo = (n) => getTargetSnapshotInfoByModuleInfo(n, nativeGlobal.__FEDERATION__.moduleInfo), setGlobalSnapshotInfoByModuleInfo = (n, t) => {
560
- const o = getFMId(n);
561
- return nativeGlobal.__FEDERATION__.moduleInfo[o] = t, nativeGlobal.__FEDERATION__.moduleInfo;
562
- }, addGlobalSnapshot = (n) => (nativeGlobal.__FEDERATION__.moduleInfo = _extends$1({}, nativeGlobal.__FEDERATION__.moduleInfo, n), () => {
563
- const t = Object.keys(n);
564
- for (const o of t)
565
- delete nativeGlobal.__FEDERATION__.moduleInfo[o];
566
- }), getRemoteEntryExports = (n, t) => {
567
- const o = t || `__FEDERATION_${n}:custom__`, r = CurrentGlobal[o];
744
+ }, getGlobalSnapshotInfoByModuleInfo = (r) => getTargetSnapshotInfoByModuleInfo(r, nativeGlobal.__FEDERATION__.moduleInfo), setGlobalSnapshotInfoByModuleInfo = (r, t) => {
745
+ const n = getFMId(r);
746
+ return nativeGlobal.__FEDERATION__.moduleInfo[n] = t, nativeGlobal.__FEDERATION__.moduleInfo;
747
+ }, addGlobalSnapshot = (r) => (nativeGlobal.__FEDERATION__.moduleInfo = _extends$1({}, nativeGlobal.__FEDERATION__.moduleInfo, r), () => {
748
+ const t = Object.keys(r);
749
+ for (const n of t)
750
+ delete nativeGlobal.__FEDERATION__.moduleInfo[n];
751
+ }), getRemoteEntryExports = (r, t) => {
752
+ const n = t || `__FEDERATION_${r}:custom__`, o = CurrentGlobal[n];
568
753
  return {
569
- remoteEntryKey: o,
570
- entryExports: r
754
+ remoteEntryKey: n,
755
+ entryExports: o
571
756
  };
572
- }, getGlobalHostPlugins = () => nativeGlobal.__FEDERATION__.__GLOBAL_PLUGIN__, getPreloaded = (n) => CurrentGlobal.__FEDERATION__.__PRELOADED_MAP__.get(n), setPreloaded = (n) => CurrentGlobal.__FEDERATION__.__PRELOADED_MAP__.set(n, !0), DEFAULT_SCOPE = "default", DEFAULT_REMOTE_TYPE = "global", buildIdentifier = "[0-9A-Za-z-]+", build = `(?:\\+(${buildIdentifier}(?:\\.${buildIdentifier})*))`, numericIdentifier = "0|[1-9]\\d*", numericIdentifierLoose = "[0-9]+", nonNumericIdentifier = "\\d*[a-zA-Z-][a-zA-Z0-9-]*", preReleaseIdentifierLoose = `(?:${numericIdentifierLoose}|${nonNumericIdentifier})`, preReleaseLoose = `(?:-?(${preReleaseIdentifierLoose}(?:\\.${preReleaseIdentifierLoose})*))`, preReleaseIdentifier = `(?:${numericIdentifier}|${nonNumericIdentifier})`, preRelease = `(?:-(${preReleaseIdentifier}(?:\\.${preReleaseIdentifier})*))`, xRangeIdentifier = `${numericIdentifier}|x|X|\\*`, xRangePlain = `[v=\\s]*(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:${preRelease})?${build}?)?)?`, hyphenRange = `^\\s*(${xRangePlain})\\s+-\\s+(${xRangePlain})\\s*$`, mainVersionLoose = `(${numericIdentifierLoose})\\.(${numericIdentifierLoose})\\.(${numericIdentifierLoose})`, loosePlain = `[v=\\s]*${mainVersionLoose}${preReleaseLoose}?${build}?`, gtlt = "((?:<|>)?=?)", comparatorTrim = `(\\s*)${gtlt}\\s*(${loosePlain}|${xRangePlain})`, loneTilde = "(?:~>?)", tildeTrim = `(\\s*)${loneTilde}\\s+`, loneCaret = "(?:\\^)", caretTrim = `(\\s*)${loneCaret}\\s+`, star = "(<|>)?=?\\s*\\*", caret = `^${loneCaret}${xRangePlain}$`, mainVersion = `(${numericIdentifier})\\.(${numericIdentifier})\\.(${numericIdentifier})`, fullPlain = `v?${mainVersion}${preRelease}?${build}?`, tilde = `^${loneTilde}${xRangePlain}$`, xRange = `^${gtlt}\\s*${xRangePlain}$`, comparator = `^${gtlt}\\s*(${fullPlain})$|^$`, gte0 = "^\\s*>=\\s*0.0.0\\s*$";
573
- function parseRegex(n) {
574
- return new RegExp(n);
757
+ }, getGlobalHostPlugins = () => nativeGlobal.__FEDERATION__.__GLOBAL_PLUGIN__, getPreloaded = (r) => CurrentGlobal.__FEDERATION__.__PRELOADED_MAP__.get(r), setPreloaded = (r) => CurrentGlobal.__FEDERATION__.__PRELOADED_MAP__.set(r, !0), DEFAULT_SCOPE = "default", DEFAULT_REMOTE_TYPE = "global", buildIdentifier = "[0-9A-Za-z-]+", build = `(?:\\+(${buildIdentifier}(?:\\.${buildIdentifier})*))`, numericIdentifier = "0|[1-9]\\d*", numericIdentifierLoose = "[0-9]+", nonNumericIdentifier = "\\d*[a-zA-Z-][a-zA-Z0-9-]*", preReleaseIdentifierLoose = `(?:${numericIdentifierLoose}|${nonNumericIdentifier})`, preReleaseLoose = `(?:-?(${preReleaseIdentifierLoose}(?:\\.${preReleaseIdentifierLoose})*))`, preReleaseIdentifier = `(?:${numericIdentifier}|${nonNumericIdentifier})`, preRelease = `(?:-(${preReleaseIdentifier}(?:\\.${preReleaseIdentifier})*))`, xRangeIdentifier = `${numericIdentifier}|x|X|\\*`, xRangePlain = `[v=\\s]*(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:${preRelease})?${build}?)?)?`, hyphenRange = `^\\s*(${xRangePlain})\\s+-\\s+(${xRangePlain})\\s*$`, mainVersionLoose = `(${numericIdentifierLoose})\\.(${numericIdentifierLoose})\\.(${numericIdentifierLoose})`, loosePlain = `[v=\\s]*${mainVersionLoose}${preReleaseLoose}?${build}?`, gtlt = "((?:<|>)?=?)", comparatorTrim = `(\\s*)${gtlt}\\s*(${loosePlain}|${xRangePlain})`, loneTilde = "(?:~>?)", tildeTrim = `(\\s*)${loneTilde}\\s+`, loneCaret = "(?:\\^)", caretTrim = `(\\s*)${loneCaret}\\s+`, star = "(<|>)?=?\\s*\\*", caret = `^${loneCaret}${xRangePlain}$`, mainVersion = `(${numericIdentifier})\\.(${numericIdentifier})\\.(${numericIdentifier})`, fullPlain = `v?${mainVersion}${preRelease}?${build}?`, tilde = `^${loneTilde}${xRangePlain}$`, xRange = `^${gtlt}\\s*${xRangePlain}$`, comparator = `^${gtlt}\\s*(${fullPlain})$|^$`, gte0 = "^\\s*>=\\s*0.0.0\\s*$";
758
+ function parseRegex(r) {
759
+ return new RegExp(r);
575
760
  }
576
- function isXVersion(n) {
577
- return !n || n.toLowerCase() === "x" || n === "*";
761
+ function isXVersion(r) {
762
+ return !r || r.toLowerCase() === "x" || r === "*";
578
763
  }
579
- function pipe(...n) {
580
- return (t) => n.reduce((o, r) => r(o), t);
764
+ function pipe(...r) {
765
+ return (t) => r.reduce((n, o) => o(n), t);
581
766
  }
582
- function extractComparator(n) {
583
- return n.match(parseRegex(comparator));
767
+ function extractComparator(r) {
768
+ return r.match(parseRegex(comparator));
584
769
  }
585
- function combineVersion(n, t, o, r) {
586
- const s = `${n}.${t}.${o}`;
587
- return r ? `${s}-${r}` : s;
770
+ function combineVersion(r, t, n, o) {
771
+ const s = `${r}.${t}.${n}`;
772
+ return o ? `${s}-${o}` : s;
588
773
  }
589
- function parseHyphen(n) {
590
- return n.replace(parseRegex(hyphenRange), (t, o, r, s, l, a, i, c, u, d, m, p) => (isXVersion(r) ? o = "" : isXVersion(s) ? o = `>=${r}.0.0` : isXVersion(l) ? o = `>=${r}.${s}.0` : o = `>=${o}`, isXVersion(u) ? c = "" : isXVersion(d) ? c = `<${Number(u) + 1}.0.0-0` : isXVersion(m) ? c = `<${u}.${Number(d) + 1}.0-0` : p ? c = `<=${u}.${d}.${m}-${p}` : c = `<=${c}`, `${o} ${c}`.trim()));
774
+ function parseHyphen(r) {
775
+ return r.replace(parseRegex(hyphenRange), (t, n, o, s, l, a, i, c, u, d, p, m) => (isXVersion(o) ? n = "" : isXVersion(s) ? n = `>=${o}.0.0` : isXVersion(l) ? n = `>=${o}.${s}.0` : n = `>=${n}`, isXVersion(u) ? c = "" : isXVersion(d) ? c = `<${Number(u) + 1}.0.0-0` : isXVersion(p) ? c = `<${u}.${Number(d) + 1}.0-0` : m ? c = `<=${u}.${d}.${p}-${m}` : c = `<=${c}`, `${n} ${c}`.trim()));
591
776
  }
592
- function parseComparatorTrim(n) {
593
- return n.replace(parseRegex(comparatorTrim), "$1$2$3");
777
+ function parseComparatorTrim(r) {
778
+ return r.replace(parseRegex(comparatorTrim), "$1$2$3");
594
779
  }
595
- function parseTildeTrim(n) {
596
- return n.replace(parseRegex(tildeTrim), "$1~");
780
+ function parseTildeTrim(r) {
781
+ return r.replace(parseRegex(tildeTrim), "$1~");
597
782
  }
598
- function parseCaretTrim(n) {
599
- return n.replace(parseRegex(caretTrim), "$1^");
783
+ function parseCaretTrim(r) {
784
+ return r.replace(parseRegex(caretTrim), "$1^");
600
785
  }
601
- function parseCarets(n) {
602
- return n.trim().split(/\s+/).map((t) => t.replace(parseRegex(caret), (o, r, s, l, a) => isXVersion(r) ? "" : isXVersion(s) ? `>=${r}.0.0 <${Number(r) + 1}.0.0-0` : isXVersion(l) ? r === "0" ? `>=${r}.${s}.0 <${r}.${Number(s) + 1}.0-0` : `>=${r}.${s}.0 <${Number(r) + 1}.0.0-0` : a ? r === "0" ? s === "0" ? `>=${r}.${s}.${l}-${a} <${r}.${s}.${Number(l) + 1}-0` : `>=${r}.${s}.${l}-${a} <${r}.${Number(s) + 1}.0-0` : `>=${r}.${s}.${l}-${a} <${Number(r) + 1}.0.0-0` : r === "0" ? s === "0" ? `>=${r}.${s}.${l} <${r}.${s}.${Number(l) + 1}-0` : `>=${r}.${s}.${l} <${r}.${Number(s) + 1}.0-0` : `>=${r}.${s}.${l} <${Number(r) + 1}.0.0-0`)).join(" ");
786
+ function parseCarets(r) {
787
+ return r.trim().split(/\s+/).map((t) => t.replace(parseRegex(caret), (n, o, s, l, a) => isXVersion(o) ? "" : isXVersion(s) ? `>=${o}.0.0 <${Number(o) + 1}.0.0-0` : isXVersion(l) ? o === "0" ? `>=${o}.${s}.0 <${o}.${Number(s) + 1}.0-0` : `>=${o}.${s}.0 <${Number(o) + 1}.0.0-0` : a ? o === "0" ? s === "0" ? `>=${o}.${s}.${l}-${a} <${o}.${s}.${Number(l) + 1}-0` : `>=${o}.${s}.${l}-${a} <${o}.${Number(s) + 1}.0-0` : `>=${o}.${s}.${l}-${a} <${Number(o) + 1}.0.0-0` : o === "0" ? s === "0" ? `>=${o}.${s}.${l} <${o}.${s}.${Number(l) + 1}-0` : `>=${o}.${s}.${l} <${o}.${Number(s) + 1}.0-0` : `>=${o}.${s}.${l} <${Number(o) + 1}.0.0-0`)).join(" ");
603
788
  }
604
- function parseTildes(n) {
605
- return n.trim().split(/\s+/).map((t) => t.replace(parseRegex(tilde), (o, r, s, l, a) => isXVersion(r) ? "" : isXVersion(s) ? `>=${r}.0.0 <${Number(r) + 1}.0.0-0` : isXVersion(l) ? `>=${r}.${s}.0 <${r}.${Number(s) + 1}.0-0` : a ? `>=${r}.${s}.${l}-${a} <${r}.${Number(s) + 1}.0-0` : `>=${r}.${s}.${l} <${r}.${Number(s) + 1}.0-0`)).join(" ");
789
+ function parseTildes(r) {
790
+ return r.trim().split(/\s+/).map((t) => t.replace(parseRegex(tilde), (n, o, s, l, a) => isXVersion(o) ? "" : isXVersion(s) ? `>=${o}.0.0 <${Number(o) + 1}.0.0-0` : isXVersion(l) ? `>=${o}.${s}.0 <${o}.${Number(s) + 1}.0-0` : a ? `>=${o}.${s}.${l}-${a} <${o}.${Number(s) + 1}.0-0` : `>=${o}.${s}.${l} <${o}.${Number(s) + 1}.0-0`)).join(" ");
606
791
  }
607
- function parseXRanges(n) {
608
- return n.split(/\s+/).map((t) => t.trim().replace(parseRegex(xRange), (o, r, s, l, a, i) => {
792
+ function parseXRanges(r) {
793
+ return r.split(/\s+/).map((t) => t.trim().replace(parseRegex(xRange), (n, o, s, l, a, i) => {
609
794
  const c = isXVersion(s), u = c || isXVersion(l), d = u || isXVersion(a);
610
- return r === "=" && d && (r = ""), i = "", c ? r === ">" || r === "<" ? "<0.0.0-0" : "*" : r && d ? (u && (l = 0), a = 0, r === ">" ? (r = ">=", u ? (s = Number(s) + 1, l = 0, a = 0) : (l = Number(l) + 1, a = 0)) : r === "<=" && (r = "<", u ? s = Number(s) + 1 : l = Number(l) + 1), r === "<" && (i = "-0"), `${r + s}.${l}.${a}${i}`) : u ? `>=${s}.0.0${i} <${Number(s) + 1}.0.0-0` : d ? `>=${s}.${l}.0${i} <${s}.${Number(l) + 1}.0-0` : o;
795
+ return o === "=" && d && (o = ""), i = "", c ? o === ">" || o === "<" ? "<0.0.0-0" : "*" : o && d ? (u && (l = 0), a = 0, o === ">" ? (o = ">=", u ? (s = Number(s) + 1, l = 0, a = 0) : (l = Number(l) + 1, a = 0)) : o === "<=" && (o = "<", u ? s = Number(s) + 1 : l = Number(l) + 1), o === "<" && (i = "-0"), `${o + s}.${l}.${a}${i}`) : u ? `>=${s}.0.0${i} <${Number(s) + 1}.0.0-0` : d ? `>=${s}.${l}.0${i} <${s}.${Number(l) + 1}.0-0` : n;
611
796
  })).join(" ");
612
797
  }
613
- function parseStar(n) {
614
- return n.trim().replace(parseRegex(star), "");
798
+ function parseStar(r) {
799
+ return r.trim().replace(parseRegex(star), "");
615
800
  }
616
- function parseGTE0(n) {
617
- return n.trim().replace(parseRegex(gte0), "");
801
+ function parseGTE0(r) {
802
+ return r.trim().replace(parseRegex(gte0), "");
618
803
  }
619
- function compareAtom(n, t) {
620
- return n = Number(n) || n, t = Number(t) || t, n > t ? 1 : n === t ? 0 : -1;
804
+ function compareAtom(r, t) {
805
+ return r = Number(r) || r, t = Number(t) || t, r > t ? 1 : r === t ? 0 : -1;
621
806
  }
622
- function comparePreRelease(n, t) {
623
- const { preRelease: o } = n, { preRelease: r } = t;
624
- if (o === void 0 && r)
807
+ function comparePreRelease(r, t) {
808
+ const { preRelease: n } = r, { preRelease: o } = t;
809
+ if (n === void 0 && o)
625
810
  return 1;
626
- if (o && r === void 0)
811
+ if (n && o === void 0)
627
812
  return -1;
628
- if (o === void 0 && r === void 0)
813
+ if (n === void 0 && o === void 0)
629
814
  return 0;
630
- for (let s = 0, l = o.length; s <= l; s++) {
631
- const a = o[s], i = r[s];
815
+ for (let s = 0, l = n.length; s <= l; s++) {
816
+ const a = n[s], i = o[s];
632
817
  if (a !== i)
633
818
  return a === void 0 && i === void 0 ? 0 : a ? i ? compareAtom(a, i) : -1 : 1;
634
819
  }
635
820
  return 0;
636
821
  }
637
- function compareVersion(n, t) {
638
- return compareAtom(n.major, t.major) || compareAtom(n.minor, t.minor) || compareAtom(n.patch, t.patch) || comparePreRelease(n, t);
822
+ function compareVersion(r, t) {
823
+ return compareAtom(r.major, t.major) || compareAtom(r.minor, t.minor) || compareAtom(r.patch, t.patch) || comparePreRelease(r, t);
639
824
  }
640
- function eq(n, t) {
641
- return n.version === t.version;
825
+ function eq(r, t) {
826
+ return r.version === t.version;
642
827
  }
643
- function compare(n, t) {
644
- switch (n.operator) {
828
+ function compare(r, t) {
829
+ switch (r.operator) {
645
830
  case "":
646
831
  case "=":
647
- return eq(n, t);
832
+ return eq(r, t);
648
833
  case ">":
649
- return compareVersion(n, t) < 0;
834
+ return compareVersion(r, t) < 0;
650
835
  case ">=":
651
- return eq(n, t) || compareVersion(n, t) < 0;
836
+ return eq(r, t) || compareVersion(r, t) < 0;
652
837
  case "<":
653
- return compareVersion(n, t) > 0;
838
+ return compareVersion(r, t) > 0;
654
839
  case "<=":
655
- return eq(n, t) || compareVersion(n, t) > 0;
840
+ return eq(r, t) || compareVersion(r, t) > 0;
656
841
  case void 0:
657
842
  return !0;
658
843
  default:
659
844
  return !1;
660
845
  }
661
846
  }
662
- function parseComparatorString(n) {
847
+ function parseComparatorString(r) {
663
848
  return pipe(
664
849
  // handle caret
665
850
  // ^ --> * (any, kinda silly)
@@ -679,9 +864,9 @@ function parseComparatorString(n) {
679
864
  parseTildes,
680
865
  parseXRanges,
681
866
  parseStar
682
- )(n);
867
+ )(r);
683
868
  }
684
- function parseRange(n) {
869
+ function parseRange(r) {
685
870
  return pipe(
686
871
  // handle hyphenRange
687
872
  // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
@@ -695,15 +880,15 @@ function parseRange(n) {
695
880
  // handle trim caret
696
881
  // `^ 1.2.3` => `^1.2.3`
697
882
  parseCaretTrim
698
- )(n.trim()).split(/\s+/).join(" ");
883
+ )(r.trim()).split(/\s+/).join(" ");
699
884
  }
700
- function satisfy(n, t) {
701
- if (!n)
885
+ function satisfy(r, t) {
886
+ if (!r)
702
887
  return !1;
703
- const s = parseRange(t).split(" ").map((p) => parseComparatorString(p)).join(" ").split(/\s+/).map((p) => parseGTE0(p)), l = extractComparator(n);
888
+ const s = parseRange(t).split(" ").map((m) => parseComparatorString(m)).join(" ").split(/\s+/).map((m) => parseGTE0(m)), l = extractComparator(r);
704
889
  if (!l)
705
890
  return !1;
706
- const [, a, , i, c, u, d] = l, m = {
891
+ const [, a, , i, c, u, d] = l, p = {
707
892
  operator: a,
708
893
  version: combineVersion(i, c, u, d),
709
894
  major: i,
@@ -711,57 +896,57 @@ function satisfy(n, t) {
711
896
  patch: u,
712
897
  preRelease: d == null ? void 0 : d.split(".")
713
898
  };
714
- for (const p of s) {
715
- const y = extractComparator(p);
899
+ for (const m of s) {
900
+ const y = extractComparator(m);
716
901
  if (!y)
717
902
  return !1;
718
- const [, g, , E, _, b, v] = y, I = {
719
- operator: g,
720
- version: combineVersion(E, _, b, v),
903
+ const [, _, , E, g, b, S] = y, v = {
904
+ operator: _,
905
+ version: combineVersion(E, g, b, S),
721
906
  major: E,
722
- minor: _,
907
+ minor: g,
723
908
  patch: b,
724
- preRelease: v == null ? void 0 : v.split(".")
909
+ preRelease: S == null ? void 0 : S.split(".")
725
910
  };
726
- if (!compare(I, m))
911
+ if (!compare(v, p))
727
912
  return !1;
728
913
  }
729
914
  return !0;
730
915
  }
731
- function formatShare(n, t, o, r) {
916
+ function formatShare(r, t, n, o) {
732
917
  let s;
733
- "get" in n ? s = n.get : "lib" in n ? s = () => Promise.resolve(n.lib) : s = () => Promise.resolve(() => {
734
- throw new Error(`Can not get shared '${o}'!`);
735
- }), n.strategy && warn('"shared.strategy is deprecated, please set in initOptions.shareStrategy instead!"');
918
+ "get" in r ? s = r.get : "lib" in r ? s = () => Promise.resolve(r.lib) : s = () => Promise.resolve(() => {
919
+ throw new Error(`Can not get shared '${n}'!`);
920
+ }), r.strategy && warn('"shared.strategy is deprecated, please set in initOptions.shareStrategy instead!"');
736
921
  var l, a, i;
737
922
  return _extends$1({
738
923
  deps: [],
739
924
  useIn: [],
740
925
  from: t,
741
926
  loading: null
742
- }, n, {
927
+ }, r, {
743
928
  shareConfig: _extends$1({
744
- requiredVersion: `^${n.version}`,
929
+ requiredVersion: `^${r.version}`,
745
930
  singleton: !1,
746
931
  eager: !1,
747
932
  strictVersion: !1
748
- }, n.shareConfig),
933
+ }, r.shareConfig),
749
934
  get: s,
750
- loaded: n != null && n.loaded || "lib" in n ? !0 : void 0,
751
- version: (l = n.version) != null ? l : "0",
752
- scope: Array.isArray(n.scope) ? n.scope : [
753
- (a = n.scope) != null ? a : "default"
935
+ loaded: r != null && r.loaded || "lib" in r ? !0 : void 0,
936
+ version: (l = r.version) != null ? l : "0",
937
+ scope: Array.isArray(r.scope) ? r.scope : [
938
+ (a = r.scope) != null ? a : "default"
754
939
  ],
755
- strategy: ((i = n.strategy) != null ? i : r) || "version-first"
940
+ strategy: ((i = r.strategy) != null ? i : o) || "version-first"
756
941
  });
757
942
  }
758
- function formatShareConfigs(n, t) {
759
- const o = t.shared || {}, r = t.name, s = Object.keys(o).reduce((a, i) => {
760
- const c = arrayOptions(o[i]);
943
+ function formatShareConfigs(r, t) {
944
+ const n = t.shared || {}, o = t.name, s = Object.keys(n).reduce((a, i) => {
945
+ const c = arrayOptions(n[i]);
761
946
  return a[i] = a[i] || [], c.forEach((u) => {
762
- a[i].push(formatShare(u, r, i, t.shareStrategy));
947
+ a[i].push(formatShare(u, o, i, t.shareStrategy));
763
948
  }), a;
764
- }, {}), l = _extends$1({}, n.shared);
949
+ }, {}), l = _extends$1({}, r.shared);
765
950
  return Object.keys(s).forEach((a) => {
766
951
  l[a] ? s[a].forEach((i) => {
767
952
  l[a].find((u) => u.version === i.version) || l[a].push(i);
@@ -771,184 +956,184 @@ function formatShareConfigs(n, t) {
771
956
  shareInfos: s
772
957
  };
773
958
  }
774
- function versionLt(n, t) {
775
- const o = (r) => {
776
- if (!Number.isNaN(Number(r))) {
777
- const l = r.split(".");
778
- let a = r;
959
+ function versionLt(r, t) {
960
+ const n = (o) => {
961
+ if (!Number.isNaN(Number(o))) {
962
+ const l = o.split(".");
963
+ let a = o;
779
964
  for (let i = 0; i < 3 - l.length; i++)
780
965
  a += ".0";
781
966
  return a;
782
967
  }
783
- return r;
968
+ return o;
784
969
  };
785
- return !!satisfy(o(n), `<=${o(t)}`);
970
+ return !!satisfy(n(r), `<=${n(t)}`);
786
971
  }
787
- const findVersion = (n, t) => {
788
- const o = t || function(r, s) {
789
- return versionLt(r, s);
972
+ const findVersion = (r, t) => {
973
+ const n = t || function(o, s) {
974
+ return versionLt(o, s);
790
975
  };
791
- return Object.keys(n).reduce((r, s) => !r || o(r, s) || r === "0" ? s : r, 0);
792
- }, isLoaded = (n) => !!n.loaded || typeof n.lib == "function", isLoading = (n) => !!n.loading;
793
- function findSingletonVersionOrderByVersion(n, t, o) {
794
- const r = n[t][o], s = function(l, a) {
795
- return !isLoaded(r[l]) && versionLt(l, a);
976
+ return Object.keys(r).reduce((o, s) => !o || n(o, s) || o === "0" ? s : o, 0);
977
+ }, isLoaded = (r) => !!r.loaded || typeof r.lib == "function", isLoading = (r) => !!r.loading;
978
+ function findSingletonVersionOrderByVersion(r, t, n) {
979
+ const o = r[t][n], s = function(l, a) {
980
+ return !isLoaded(o[l]) && versionLt(l, a);
796
981
  };
797
- return findVersion(n[t][o], s);
982
+ return findVersion(r[t][n], s);
798
983
  }
799
- function findSingletonVersionOrderByLoaded(n, t, o) {
800
- const r = n[t][o], s = function(l, a) {
984
+ function findSingletonVersionOrderByLoaded(r, t, n) {
985
+ const o = r[t][n], s = function(l, a) {
801
986
  const i = (c) => isLoaded(c) || isLoading(c);
802
- return i(r[a]) ? i(r[l]) ? !!versionLt(l, a) : !0 : i(r[l]) ? !1 : versionLt(l, a);
987
+ return i(o[a]) ? i(o[l]) ? !!versionLt(l, a) : !0 : i(o[l]) ? !1 : versionLt(l, a);
803
988
  };
804
- return findVersion(n[t][o], s);
989
+ return findVersion(r[t][n], s);
805
990
  }
806
- function getFindShareFunction(n) {
807
- return n === "loaded-first" ? findSingletonVersionOrderByLoaded : findSingletonVersionOrderByVersion;
991
+ function getFindShareFunction(r) {
992
+ return r === "loaded-first" ? findSingletonVersionOrderByLoaded : findSingletonVersionOrderByVersion;
808
993
  }
809
- function getRegisteredShare(n, t, o, r) {
810
- if (!n)
994
+ function getRegisteredShare(r, t, n, o) {
995
+ if (!r)
811
996
  return;
812
- const { shareConfig: s, scope: l = DEFAULT_SCOPE, strategy: a } = o, i = Array.isArray(l) ? l : [
997
+ const { shareConfig: s, scope: l = DEFAULT_SCOPE, strategy: a } = n, i = Array.isArray(l) ? l : [
813
998
  l
814
999
  ];
815
1000
  for (const c of i)
816
- if (s && n[c] && n[c][t]) {
817
- const { requiredVersion: u } = s, m = getFindShareFunction(a)(n, c, t), p = () => {
1001
+ if (s && r[c] && r[c][t]) {
1002
+ const { requiredVersion: u } = s, p = getFindShareFunction(a)(r, c, t), m = () => {
818
1003
  if (s.singleton) {
819
- if (typeof u == "string" && !satisfy(m, u)) {
820
- const E = `Version ${m} from ${m && n[c][t][m].from} of shared singleton module ${t} does not satisfy the requirement of ${o.from} which needs ${u})`;
1004
+ if (typeof u == "string" && !satisfy(p, u)) {
1005
+ const E = `Version ${p} from ${p && r[c][t][p].from} of shared singleton module ${t} does not satisfy the requirement of ${n.from} which needs ${u})`;
821
1006
  s.strictVersion ? error(E) : warn(E);
822
1007
  }
823
- return n[c][t][m];
1008
+ return r[c][t][p];
824
1009
  } else {
825
- if (u === !1 || u === "*" || satisfy(m, u))
826
- return n[c][t][m];
827
- for (const [E, _] of Object.entries(n[c][t]))
1010
+ if (u === !1 || u === "*" || satisfy(p, u))
1011
+ return r[c][t][p];
1012
+ for (const [E, g] of Object.entries(r[c][t]))
828
1013
  if (satisfy(E, u))
829
- return _;
1014
+ return g;
830
1015
  }
831
1016
  }, y = {
832
- shareScopeMap: n,
1017
+ shareScopeMap: r,
833
1018
  scope: c,
834
1019
  pkgName: t,
835
- version: m,
1020
+ version: p,
836
1021
  GlobalFederation: Global.__FEDERATION__,
837
- resolver: p
1022
+ resolver: m
838
1023
  };
839
- return (r.emit(y) || y).resolver();
1024
+ return (o.emit(y) || y).resolver();
840
1025
  }
841
1026
  }
842
1027
  function getGlobalShareScope() {
843
1028
  return Global.__FEDERATION__.__SHARE__;
844
1029
  }
845
- function getTargetSharedOptions(n) {
846
- const { pkgName: t, extraOptions: o, shareInfos: r } = n, s = (i) => {
1030
+ function getTargetSharedOptions(r) {
1031
+ const { pkgName: t, extraOptions: n, shareInfos: o } = r, s = (i) => {
847
1032
  if (!i)
848
1033
  return;
849
1034
  const c = {};
850
- i.forEach((m) => {
851
- c[m.version] = m;
1035
+ i.forEach((p) => {
1036
+ c[p.version] = p;
852
1037
  });
853
- const d = findVersion(c, function(m, p) {
854
- return !isLoaded(c[m]) && versionLt(m, p);
1038
+ const d = findVersion(c, function(p, m) {
1039
+ return !isLoaded(c[p]) && versionLt(p, m);
855
1040
  });
856
1041
  return c[d];
857
1042
  };
858
1043
  var l;
859
- const a = (l = o == null ? void 0 : o.resolver) != null ? l : s;
860
- return Object.assign({}, a(r[t]), o == null ? void 0 : o.customShareInfo);
1044
+ const a = (l = n == null ? void 0 : n.resolver) != null ? l : s;
1045
+ return Object.assign({}, a(o[t]), n == null ? void 0 : n.customShareInfo);
861
1046
  }
862
1047
  function getBuilderId() {
863
1048
  return typeof FEDERATION_BUILD_IDENTIFIER < "u" ? FEDERATION_BUILD_IDENTIFIER : "";
864
1049
  }
865
- function matchRemoteWithNameAndExpose(n, t) {
866
- for (const o of n) {
867
- const r = t.startsWith(o.name);
868
- let s = t.replace(o.name, "");
869
- if (r) {
1050
+ function matchRemoteWithNameAndExpose(r, t) {
1051
+ for (const n of r) {
1052
+ const o = t.startsWith(n.name);
1053
+ let s = t.replace(n.name, "");
1054
+ if (o) {
870
1055
  if (s.startsWith("/")) {
871
- const i = o.name;
1056
+ const i = n.name;
872
1057
  return s = `.${s}`, {
873
1058
  pkgNameOrAlias: i,
874
1059
  expose: s,
875
- remote: o
1060
+ remote: n
876
1061
  };
877
1062
  } else if (s === "")
878
1063
  return {
879
- pkgNameOrAlias: o.name,
1064
+ pkgNameOrAlias: n.name,
880
1065
  expose: ".",
881
- remote: o
1066
+ remote: n
882
1067
  };
883
1068
  }
884
- const l = o.alias && t.startsWith(o.alias);
885
- let a = o.alias && t.replace(o.alias, "");
886
- if (o.alias && l) {
1069
+ const l = n.alias && t.startsWith(n.alias);
1070
+ let a = n.alias && t.replace(n.alias, "");
1071
+ if (n.alias && l) {
887
1072
  if (a && a.startsWith("/")) {
888
- const i = o.alias;
1073
+ const i = n.alias;
889
1074
  return a = `.${a}`, {
890
1075
  pkgNameOrAlias: i,
891
1076
  expose: a,
892
- remote: o
1077
+ remote: n
893
1078
  };
894
1079
  } else if (a === "")
895
1080
  return {
896
- pkgNameOrAlias: o.alias,
1081
+ pkgNameOrAlias: n.alias,
897
1082
  expose: ".",
898
- remote: o
1083
+ remote: n
899
1084
  };
900
1085
  }
901
1086
  }
902
1087
  }
903
- function matchRemote(n, t) {
904
- for (const o of n)
905
- if (t === o.name || o.alias && t === o.alias)
906
- return o;
1088
+ function matchRemote(r, t) {
1089
+ for (const n of r)
1090
+ if (t === n.name || n.alias && t === n.alias)
1091
+ return n;
907
1092
  }
908
- function registerPlugins(n, t) {
909
- const o = getGlobalHostPlugins();
910
- return o.length > 0 && o.forEach((r) => {
911
- n != null && n.find((s) => s.name !== r.name) && n.push(r);
912
- }), n && n.length > 0 && n.forEach((r) => {
1093
+ function registerPlugins(r, t) {
1094
+ const n = getGlobalHostPlugins();
1095
+ return n.length > 0 && n.forEach((o) => {
1096
+ r != null && r.find((s) => s.name !== o.name) && r.push(o);
1097
+ }), r && r.length > 0 && r.forEach((o) => {
913
1098
  t.forEach((s) => {
914
- s.applyPlugin(r);
1099
+ s.applyPlugin(o);
915
1100
  });
916
- }), n;
1101
+ }), r;
917
1102
  }
918
- async function loadEsmEntry({ entry: n, remoteEntryExports: t }) {
919
- return new Promise((o, r) => {
1103
+ async function loadEsmEntry({ entry: r, remoteEntryExports: t }) {
1104
+ return new Promise((n, o) => {
920
1105
  try {
921
- t ? o(t) : typeof FEDERATION_ALLOW_NEW_FUNCTION < "u" ? new Function("callbacks", `import("${n}").then(callbacks[0]).catch(callbacks[1])`)([
922
- o,
923
- r
1106
+ t ? n(t) : typeof FEDERATION_ALLOW_NEW_FUNCTION < "u" ? new Function("callbacks", `import("${r}").then(callbacks[0]).catch(callbacks[1])`)([
1107
+ n,
1108
+ o
924
1109
  ]) : import(
925
1110
  /* webpackIgnore: true */
926
1111
  /* @vite-ignore */
927
- n
928
- ).then(o).catch(r);
1112
+ r
1113
+ ).then(n).catch(o);
929
1114
  } catch (s) {
930
- r(s);
1115
+ o(s);
931
1116
  }
932
1117
  });
933
1118
  }
934
- async function loadSystemJsEntry({ entry: n, remoteEntryExports: t }) {
935
- return new Promise((o, r) => {
1119
+ async function loadSystemJsEntry({ entry: r, remoteEntryExports: t }) {
1120
+ return new Promise((n, o) => {
936
1121
  try {
937
- t ? o(t) : typeof __system_context__ > "u" ? System.import(n).then(o).catch(r) : new Function("callbacks", `System.import("${n}").then(callbacks[0]).catch(callbacks[1])`)([
938
- o,
939
- r
1122
+ t ? n(t) : typeof __system_context__ > "u" ? System.import(r).then(n).catch(o) : new Function("callbacks", `System.import("${r}").then(callbacks[0]).catch(callbacks[1])`)([
1123
+ n,
1124
+ o
940
1125
  ]);
941
1126
  } catch (s) {
942
- r(s);
1127
+ o(s);
943
1128
  }
944
1129
  });
945
1130
  }
946
- async function loadEntryScript({ name: n, globalName: t, entry: o, loaderHook: r }) {
947
- const { entryExports: s } = getRemoteEntryExports(n, t);
948
- return s || loadScript(o, {
1131
+ async function loadEntryScript({ name: r, globalName: t, entry: n, loaderHook: o }) {
1132
+ const { entryExports: s } = getRemoteEntryExports(r, t);
1133
+ return s || loadScript(n, {
949
1134
  attrs: {},
950
1135
  createScriptHook: (l, a) => {
951
- const i = r.lifecycle.createScript.emit({
1136
+ const i = o.lifecycle.createScript.emit({
952
1137
  url: l,
953
1138
  attrs: a
954
1139
  });
@@ -956,48 +1141,48 @@ async function loadEntryScript({ name: n, globalName: t, entry: o, loaderHook: r
956
1141
  return i;
957
1142
  }
958
1143
  }).then(() => {
959
- const { remoteEntryKey: l, entryExports: a } = getRemoteEntryExports(n, t);
1144
+ const { remoteEntryKey: l, entryExports: a } = getRemoteEntryExports(r, t);
960
1145
  return assert(a, getShortErrorMsg(RUNTIME_001, runtimeDescMap, {
961
- remoteName: n,
962
- remoteEntryUrl: o,
1146
+ remoteName: r,
1147
+ remoteEntryUrl: n,
963
1148
  remoteEntryKey: l
964
1149
  })), a;
965
1150
  }).catch((l) => {
966
1151
  throw assert(void 0, getShortErrorMsg(RUNTIME_008, runtimeDescMap, {
967
- remoteName: n,
968
- resourceUrl: o
1152
+ remoteName: r,
1153
+ resourceUrl: n
969
1154
  })), l;
970
1155
  });
971
1156
  }
972
- async function loadEntryDom({ remoteInfo: n, remoteEntryExports: t, loaderHook: o }) {
973
- const { entry: r, entryGlobalName: s, name: l, type: a } = n;
1157
+ async function loadEntryDom({ remoteInfo: r, remoteEntryExports: t, loaderHook: n }) {
1158
+ const { entry: o, entryGlobalName: s, name: l, type: a } = r;
974
1159
  switch (a) {
975
1160
  case "esm":
976
1161
  case "module":
977
1162
  return loadEsmEntry({
978
- entry: r,
1163
+ entry: o,
979
1164
  remoteEntryExports: t
980
1165
  });
981
1166
  case "system":
982
1167
  return loadSystemJsEntry({
983
- entry: r,
1168
+ entry: o,
984
1169
  remoteEntryExports: t
985
1170
  });
986
1171
  default:
987
1172
  return loadEntryScript({
988
- entry: r,
1173
+ entry: o,
989
1174
  globalName: s,
990
1175
  name: l,
991
- loaderHook: o
1176
+ loaderHook: n
992
1177
  });
993
1178
  }
994
1179
  }
995
- async function loadEntryNode({ remoteInfo: n, loaderHook: t }) {
996
- const { entry: o, entryGlobalName: r, name: s, type: l } = n, { entryExports: a } = getRemoteEntryExports(s, r);
997
- return a || loadScriptNode(o, {
1180
+ async function loadEntryNode({ remoteInfo: r, loaderHook: t }) {
1181
+ const { entry: n, entryGlobalName: o, name: s, type: l } = r, { entryExports: a } = getRemoteEntryExports(s, o);
1182
+ return a || loadScriptNode(n, {
998
1183
  attrs: {
999
1184
  name: s,
1000
- globalName: r,
1185
+ globalName: o,
1001
1186
  type: l
1002
1187
  },
1003
1188
  loaderHook: {
@@ -1011,47 +1196,47 @@ async function loadEntryNode({ remoteInfo: n, loaderHook: t }) {
1011
1196
  }
1012
1197
  }
1013
1198
  }).then(() => {
1014
- const { remoteEntryKey: i, entryExports: c } = getRemoteEntryExports(s, r);
1199
+ const { remoteEntryKey: i, entryExports: c } = getRemoteEntryExports(s, o);
1015
1200
  return assert(c, getShortErrorMsg(RUNTIME_001, runtimeDescMap, {
1016
1201
  remoteName: s,
1017
- remoteEntryUrl: o,
1202
+ remoteEntryUrl: n,
1018
1203
  remoteEntryKey: i
1019
1204
  })), c;
1020
1205
  }).catch((i) => {
1021
1206
  throw i;
1022
1207
  });
1023
1208
  }
1024
- function getRemoteEntryUniqueKey(n) {
1025
- const { entry: t, name: o } = n;
1026
- return composeKeyWithSeparator(o, t);
1209
+ function getRemoteEntryUniqueKey(r) {
1210
+ const { entry: t, name: n } = r;
1211
+ return composeKeyWithSeparator(n, t);
1027
1212
  }
1028
- async function getRemoteEntry({ origin: n, remoteEntryExports: t, remoteInfo: o }) {
1029
- const r = getRemoteEntryUniqueKey(o);
1213
+ async function getRemoteEntry({ origin: r, remoteEntryExports: t, remoteInfo: n }) {
1214
+ const o = getRemoteEntryUniqueKey(n);
1030
1215
  if (t)
1031
1216
  return t;
1032
- if (!globalLoading[r]) {
1033
- const s = n.remoteHandler.hooks.lifecycle.loadEntry, l = n.loaderHook;
1034
- globalLoading[r] = s.emit({
1217
+ if (!globalLoading[o]) {
1218
+ const s = r.remoteHandler.hooks.lifecycle.loadEntry, l = r.loaderHook;
1219
+ globalLoading[o] = s.emit({
1035
1220
  loaderHook: l,
1036
- remoteInfo: o,
1221
+ remoteInfo: n,
1037
1222
  remoteEntryExports: t
1038
1223
  }).then((a) => a || (isBrowserEnv() ? loadEntryDom({
1039
- remoteInfo: o,
1224
+ remoteInfo: n,
1040
1225
  remoteEntryExports: t,
1041
1226
  loaderHook: l
1042
1227
  }) : loadEntryNode({
1043
- remoteInfo: o,
1228
+ remoteInfo: n,
1044
1229
  loaderHook: l
1045
1230
  })));
1046
1231
  }
1047
- return globalLoading[r];
1232
+ return globalLoading[o];
1048
1233
  }
1049
- function getRemoteInfo(n) {
1050
- return _extends$1({}, n, {
1051
- entry: "entry" in n ? n.entry : "",
1052
- type: n.type || DEFAULT_REMOTE_TYPE,
1053
- entryGlobalName: n.entryGlobalName || n.name,
1054
- shareScope: n.shareScope || DEFAULT_SCOPE
1234
+ function getRemoteInfo(r) {
1235
+ return _extends$1({}, r, {
1236
+ entry: "entry" in r ? r.entry : "",
1237
+ type: r.type || DEFAULT_REMOTE_TYPE,
1238
+ entryGlobalName: r.entryGlobalName || r.name,
1239
+ shareScope: r.shareScope || DEFAULT_SCOPE
1055
1240
  });
1056
1241
  }
1057
1242
  let Module = class {
@@ -1066,40 +1251,40 @@ let Module = class {
1066
1251
  remoteEntryExports: this.remoteEntryExports
1067
1252
  });
1068
1253
  } catch {
1069
- const r = getRemoteEntryUniqueKey(this.remoteInfo);
1254
+ const o = getRemoteEntryUniqueKey(this.remoteInfo);
1070
1255
  t = await this.host.loaderHook.lifecycle.loadEntryError.emit({
1071
1256
  getRemoteEntry,
1072
1257
  origin: this.host,
1073
1258
  remoteInfo: this.remoteInfo,
1074
1259
  remoteEntryExports: this.remoteEntryExports,
1075
1260
  globalLoading,
1076
- uniqueKey: r
1261
+ uniqueKey: o
1077
1262
  });
1078
1263
  }
1079
1264
  return assert(t, `remoteEntryExports is undefined
1080
1265
  ${safeToString(this.remoteInfo)}`), this.remoteEntryExports = t, this.remoteEntryExports;
1081
1266
  }
1082
1267
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
1083
- async get(t, o, r, s) {
1084
- const { loadFactory: l = !0 } = r || {
1268
+ async get(t, n, o, s) {
1269
+ const { loadFactory: l = !0 } = o || {
1085
1270
  loadFactory: !0
1086
1271
  }, a = await this.getEntry();
1087
1272
  if (!this.inited) {
1088
- const m = this.host.shareScopeMap, p = this.remoteInfo.shareScope || "default";
1089
- m[p] || (m[p] = {});
1090
- const y = m[p], g = [], E = {
1273
+ const p = this.host.shareScopeMap, m = this.remoteInfo.shareScope || "default";
1274
+ p[m] || (p[m] = {});
1275
+ const y = p[m], _ = [], E = {
1091
1276
  version: this.remoteInfo.version || ""
1092
1277
  };
1093
1278
  Object.defineProperty(E, "shareScopeMap", {
1094
- value: m,
1279
+ value: p,
1095
1280
  // remoteEntryInitOptions will be traversed and assigned during container init, ,so this attribute is not allowed to be traversed
1096
1281
  enumerable: !1
1097
1282
  });
1098
- const _ = await this.host.hooks.lifecycle.beforeInitContainer.emit({
1283
+ const g = await this.host.hooks.lifecycle.beforeInitContainer.emit({
1099
1284
  shareScope: y,
1100
1285
  // @ts-ignore shareScopeMap will be set by Object.defineProperty
1101
1286
  remoteEntryInitOptions: E,
1102
- initScope: g,
1287
+ initScope: _,
1103
1288
  remoteInfo: this.remoteInfo,
1104
1289
  origin: this.host
1105
1290
  });
@@ -1107,7 +1292,7 @@ let Module = class {
1107
1292
  remoteName: name,
1108
1293
  remoteEntryUrl: this.remoteInfo.entry,
1109
1294
  remoteEntryKey: this.remoteInfo.entryGlobalName
1110
- })), await a.init(_.shareScope, _.initScope, _.remoteEntryInitOptions), await this.host.hooks.lifecycle.initContainer.emit(_extends$1({}, _, {
1295
+ })), await a.init(g.shareScope, g.initScope, g.remoteEntryInitOptions), await this.host.hooks.lifecycle.initContainer.emit(_extends$1({}, g, {
1111
1296
  id: t,
1112
1297
  remoteSnapshot: s,
1113
1298
  remoteEntryExports: a
@@ -1117,14 +1302,14 @@ let Module = class {
1117
1302
  let i;
1118
1303
  i = await this.host.loaderHook.lifecycle.getModuleFactory.emit({
1119
1304
  remoteEntryExports: a,
1120
- expose: o,
1305
+ expose: n,
1121
1306
  moduleInfo: this.remoteInfo
1122
- }), i || (i = await a.get(o)), assert(i, `${getFMId(this.remoteInfo)} remote don't export ${o}.`);
1123
- const c = processModuleAlias(this.remoteInfo.name, o), u = this.wraperFactory(i, c);
1307
+ }), i || (i = await a.get(n)), assert(i, `${getFMId(this.remoteInfo)} remote don't export ${n}.`);
1308
+ const c = processModuleAlias(this.remoteInfo.name, n), u = this.wraperFactory(i, c);
1124
1309
  return l ? await u() : u;
1125
1310
  }
1126
- wraperFactory(t, o) {
1127
- function r(s, l) {
1311
+ wraperFactory(t, n) {
1312
+ function o(s, l) {
1128
1313
  s && typeof s == "object" && Object.isExtensible(s) && !Object.getOwnPropertyDescriptor(s, Symbol.for("mf_module_id")) && Object.defineProperty(s, Symbol.for("mf_module_id"), {
1129
1314
  value: l,
1130
1315
  enumerable: !1
@@ -1132,14 +1317,14 @@ let Module = class {
1132
1317
  }
1133
1318
  return t instanceof Promise ? async () => {
1134
1319
  const s = await t();
1135
- return r(s, o), s;
1320
+ return o(s, n), s;
1136
1321
  } : () => {
1137
1322
  const s = t();
1138
- return r(s, o), s;
1323
+ return o(s, n), s;
1139
1324
  };
1140
1325
  }
1141
- constructor({ remoteInfo: t, host: o }) {
1142
- this.inited = !1, this.lib = void 0, this.remoteInfo = t, this.host = o;
1326
+ constructor({ remoteInfo: t, host: n }) {
1327
+ this.inited = !1, this.lib = void 0, this.remoteInfo = t, this.host = n;
1143
1328
  }
1144
1329
  };
1145
1330
  class SyncHook {
@@ -1147,16 +1332,16 @@ class SyncHook {
1147
1332
  typeof t == "function" && this.listeners.add(t);
1148
1333
  }
1149
1334
  once(t) {
1150
- const o = this;
1151
- this.on(function r(...s) {
1152
- return o.remove(r), t.apply(null, s);
1335
+ const n = this;
1336
+ this.on(function o(...s) {
1337
+ return n.remove(o), t.apply(null, s);
1153
1338
  });
1154
1339
  }
1155
1340
  emit(...t) {
1156
- let o;
1157
- return this.listeners.size > 0 && this.listeners.forEach((r) => {
1158
- o = r(...t);
1159
- }), o;
1341
+ let n;
1342
+ return this.listeners.size > 0 && this.listeners.forEach((o) => {
1343
+ n = o(...t);
1344
+ }), n;
1160
1345
  }
1161
1346
  remove(t) {
1162
1347
  this.listeners.delete(t);
@@ -1170,22 +1355,22 @@ class SyncHook {
1170
1355
  }
1171
1356
  class AsyncHook extends SyncHook {
1172
1357
  emit(...t) {
1173
- let o;
1174
- const r = Array.from(this.listeners);
1175
- if (r.length > 0) {
1358
+ let n;
1359
+ const o = Array.from(this.listeners);
1360
+ if (o.length > 0) {
1176
1361
  let s = 0;
1177
- const l = (a) => a === !1 ? !1 : s < r.length ? Promise.resolve(r[s++].apply(null, t)).then(l) : a;
1178
- o = l();
1362
+ const l = (a) => a === !1 ? !1 : s < o.length ? Promise.resolve(o[s++].apply(null, t)).then(l) : a;
1363
+ n = l();
1179
1364
  }
1180
- return Promise.resolve(o);
1365
+ return Promise.resolve(n);
1181
1366
  }
1182
1367
  }
1183
- function checkReturnData(n, t) {
1368
+ function checkReturnData(r, t) {
1184
1369
  if (!isObject(t))
1185
1370
  return !1;
1186
- if (n !== t) {
1187
- for (const o in n)
1188
- if (!(o in t))
1371
+ if (r !== t) {
1372
+ for (const n in r)
1373
+ if (!(n in t))
1189
1374
  return !1;
1190
1375
  }
1191
1376
  return !0;
@@ -1193,17 +1378,17 @@ function checkReturnData(n, t) {
1193
1378
  class SyncWaterfallHook extends SyncHook {
1194
1379
  emit(t) {
1195
1380
  isObject(t) || error(`The data for the "${this.type}" hook should be an object.`);
1196
- for (const o of this.listeners)
1381
+ for (const n of this.listeners)
1197
1382
  try {
1198
- const r = o(t);
1199
- if (checkReturnData(t, r))
1200
- t = r;
1383
+ const o = n(t);
1384
+ if (checkReturnData(t, o))
1385
+ t = o;
1201
1386
  else {
1202
1387
  this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);
1203
1388
  break;
1204
1389
  }
1205
- } catch (r) {
1206
- warn(r), this.onerror(r);
1390
+ } catch (o) {
1391
+ warn(o), this.onerror(o);
1207
1392
  }
1208
1393
  return t;
1209
1394
  }
@@ -1214,14 +1399,14 @@ class SyncWaterfallHook extends SyncHook {
1214
1399
  class AsyncWaterfallHook extends SyncHook {
1215
1400
  emit(t) {
1216
1401
  isObject(t) || error(`The response data for the "${this.type}" hook must be an object.`);
1217
- const o = Array.from(this.listeners);
1218
- if (o.length > 0) {
1219
- let r = 0;
1402
+ const n = Array.from(this.listeners);
1403
+ if (n.length > 0) {
1404
+ let o = 0;
1220
1405
  const s = (a) => (warn(a), this.onerror(a), t), l = (a) => {
1221
1406
  if (checkReturnData(t, a)) {
1222
- if (t = a, r < o.length)
1407
+ if (t = a, o < n.length)
1223
1408
  try {
1224
- return Promise.resolve(o[r++](t)).then(l, s);
1409
+ return Promise.resolve(n[o++](t)).then(l, s);
1225
1410
  } catch (i) {
1226
1411
  return s(i);
1227
1412
  }
@@ -1240,59 +1425,59 @@ class AsyncWaterfallHook extends SyncHook {
1240
1425
  class PluginSystem {
1241
1426
  applyPlugin(t) {
1242
1427
  assert(isPlainObject(t), "Plugin configuration is invalid.");
1243
- const o = t.name;
1244
- assert(o, "A name must be provided by the plugin."), this.registerPlugins[o] || (this.registerPlugins[o] = t, Object.keys(this.lifecycle).forEach((r) => {
1245
- const s = t[r];
1246
- s && this.lifecycle[r].on(s);
1428
+ const n = t.name;
1429
+ assert(n, "A name must be provided by the plugin."), this.registerPlugins[n] || (this.registerPlugins[n] = t, Object.keys(this.lifecycle).forEach((o) => {
1430
+ const s = t[o];
1431
+ s && this.lifecycle[o].on(s);
1247
1432
  }));
1248
1433
  }
1249
1434
  removePlugin(t) {
1250
1435
  assert(t, "A name is required.");
1251
- const o = this.registerPlugins[t];
1252
- assert(o, `The plugin "${t}" is not registered.`), Object.keys(o).forEach((r) => {
1253
- r !== "name" && this.lifecycle[r].remove(o[r]);
1436
+ const n = this.registerPlugins[t];
1437
+ assert(n, `The plugin "${t}" is not registered.`), Object.keys(n).forEach((o) => {
1438
+ o !== "name" && this.lifecycle[o].remove(n[o]);
1254
1439
  });
1255
1440
  }
1256
1441
  // eslint-disable-next-line @typescript-eslint/no-shadow
1257
- inherit({ lifecycle: t, registerPlugins: o }) {
1258
- Object.keys(t).forEach((r) => {
1259
- assert(!this.lifecycle[r], `The hook "${r}" has a conflict and cannot be inherited.`), this.lifecycle[r] = t[r];
1260
- }), Object.keys(o).forEach((r) => {
1261
- assert(!this.registerPlugins[r], `The plugin "${r}" has a conflict and cannot be inherited.`), this.applyPlugin(o[r]);
1442
+ inherit({ lifecycle: t, registerPlugins: n }) {
1443
+ Object.keys(t).forEach((o) => {
1444
+ assert(!this.lifecycle[o], `The hook "${o}" has a conflict and cannot be inherited.`), this.lifecycle[o] = t[o];
1445
+ }), Object.keys(n).forEach((o) => {
1446
+ assert(!this.registerPlugins[o], `The plugin "${o}" has a conflict and cannot be inherited.`), this.applyPlugin(n[o]);
1262
1447
  });
1263
1448
  }
1264
1449
  constructor(t) {
1265
1450
  this.registerPlugins = {}, this.lifecycle = t, this.lifecycleKeys = Object.keys(t);
1266
1451
  }
1267
1452
  }
1268
- function defaultPreloadArgs(n) {
1453
+ function defaultPreloadArgs(r) {
1269
1454
  return _extends$1({
1270
1455
  resourceCategory: "sync",
1271
1456
  share: !0,
1272
1457
  depsRemote: !0,
1273
1458
  prefetchInterface: !1
1274
- }, n);
1275
- }
1276
- function formatPreloadArgs(n, t) {
1277
- return t.map((o) => {
1278
- const r = matchRemote(n, o.nameOrAlias);
1279
- return assert(r, `Unable to preload ${o.nameOrAlias} as it is not included in ${!r && safeToString({
1280
- remoteInfo: r,
1281
- remotes: n
1459
+ }, r);
1460
+ }
1461
+ function formatPreloadArgs(r, t) {
1462
+ return t.map((n) => {
1463
+ const o = matchRemote(r, n.nameOrAlias);
1464
+ return assert(o, `Unable to preload ${n.nameOrAlias} as it is not included in ${!o && safeToString({
1465
+ remoteInfo: o,
1466
+ remotes: r
1282
1467
  })}`), {
1283
- remote: r,
1284
- preloadConfig: defaultPreloadArgs(o)
1468
+ remote: o,
1469
+ preloadConfig: defaultPreloadArgs(n)
1285
1470
  };
1286
1471
  });
1287
1472
  }
1288
- function normalizePreloadExposes(n) {
1289
- return n ? n.map((t) => t === "." ? t : t.startsWith("./") ? t.replace("./", "") : t) : [];
1473
+ function normalizePreloadExposes(r) {
1474
+ return r ? r.map((t) => t === "." ? t : t.startsWith("./") ? t.replace("./", "") : t) : [];
1290
1475
  }
1291
- function preloadAssets(n, t, o, r = !0) {
1292
- const { cssAssets: s, jsAssetsWithoutEntry: l, entryAssets: a } = o;
1476
+ function preloadAssets(r, t, n, o = !0) {
1477
+ const { cssAssets: s, jsAssetsWithoutEntry: l, entryAssets: a } = n;
1293
1478
  if (t.options.inBrowser) {
1294
1479
  if (a.forEach((i) => {
1295
- const { moduleInfo: c } = i, u = t.moduleCache.get(n.name);
1480
+ const { moduleInfo: c } = i, u = t.moduleCache.get(r.name);
1296
1481
  getRemoteEntry(u ? {
1297
1482
  origin: t,
1298
1483
  remoteInfo: c,
@@ -1302,7 +1487,7 @@ function preloadAssets(n, t, o, r = !0) {
1302
1487
  remoteInfo: c,
1303
1488
  remoteEntryExports: void 0
1304
1489
  });
1305
- }), r) {
1490
+ }), o) {
1306
1491
  const i = {
1307
1492
  rel: "preload",
1308
1493
  as: "style"
@@ -1313,10 +1498,10 @@ function preloadAssets(n, t, o, r = !0) {
1313
1498
  cb: () => {
1314
1499
  },
1315
1500
  attrs: i,
1316
- createLinkHook: (m, p) => {
1501
+ createLinkHook: (p, m) => {
1317
1502
  const y = t.loaderHook.lifecycle.createLink.emit({
1318
- url: m,
1319
- attrs: p
1503
+ url: p,
1504
+ attrs: m
1320
1505
  });
1321
1506
  if (y instanceof HTMLLinkElement)
1322
1507
  return y;
@@ -1335,10 +1520,10 @@ function preloadAssets(n, t, o, r = !0) {
1335
1520
  cb: () => {
1336
1521
  },
1337
1522
  attrs: i,
1338
- createLinkHook: (m, p) => {
1523
+ createLinkHook: (p, m) => {
1339
1524
  const y = t.loaderHook.lifecycle.createLink.emit({
1340
- url: m,
1341
- attrs: p
1525
+ url: p,
1526
+ attrs: m
1342
1527
  });
1343
1528
  if (y instanceof HTMLLinkElement)
1344
1529
  return y;
@@ -1348,7 +1533,7 @@ function preloadAssets(n, t, o, r = !0) {
1348
1533
  d && document.head.appendChild(u);
1349
1534
  });
1350
1535
  }
1351
- if (r) {
1536
+ if (o) {
1352
1537
  const i = {
1353
1538
  rel: "preload",
1354
1539
  as: "script"
@@ -1359,10 +1544,10 @@ function preloadAssets(n, t, o, r = !0) {
1359
1544
  cb: () => {
1360
1545
  },
1361
1546
  attrs: i,
1362
- createLinkHook: (m, p) => {
1547
+ createLinkHook: (p, m) => {
1363
1548
  const y = t.loaderHook.lifecycle.createLink.emit({
1364
- url: m,
1365
- attrs: p
1549
+ url: p,
1550
+ attrs: m
1366
1551
  });
1367
1552
  if (y instanceof HTMLLinkElement)
1368
1553
  return y;
@@ -1373,7 +1558,7 @@ function preloadAssets(n, t, o, r = !0) {
1373
1558
  } else {
1374
1559
  const i = {
1375
1560
  fetchpriority: "high",
1376
- type: (n == null ? void 0 : n.type) === "module" ? "module" : "text/javascript"
1561
+ type: (r == null ? void 0 : r.type) === "module" ? "module" : "text/javascript"
1377
1562
  };
1378
1563
  l.forEach((c) => {
1379
1564
  const { script: u, needAttach: d } = createScript({
@@ -1381,10 +1566,10 @@ function preloadAssets(n, t, o, r = !0) {
1381
1566
  cb: () => {
1382
1567
  },
1383
1568
  attrs: i,
1384
- createScriptHook: (m, p) => {
1569
+ createScriptHook: (p, m) => {
1385
1570
  const y = t.loaderHook.lifecycle.createScript.emit({
1386
- url: m,
1387
- attrs: p
1571
+ url: p,
1572
+ attrs: m
1388
1573
  });
1389
1574
  if (y instanceof HTMLScriptElement)
1390
1575
  return y;
@@ -1396,26 +1581,26 @@ function preloadAssets(n, t, o, r = !0) {
1396
1581
  }
1397
1582
  }
1398
1583
  }
1399
- function assignRemoteInfo(n, t) {
1400
- const o = getRemoteEntryInfoFromSnapshot(t);
1401
- o.url || error(`The attribute remoteEntry of ${n.name} must not be undefined.`);
1402
- let r = getResourceUrl(t, o.url);
1403
- !isBrowserEnv() && !r.startsWith("http") && (r = `https:${r}`), n.type = o.type, n.entryGlobalName = o.globalName, n.entry = r, n.version = t.version, n.buildVersion = t.buildVersion;
1584
+ function assignRemoteInfo(r, t) {
1585
+ const n = getRemoteEntryInfoFromSnapshot(t);
1586
+ n.url || error(`The attribute remoteEntry of ${r.name} must not be undefined.`);
1587
+ let o = getResourceUrl(t, n.url);
1588
+ !isBrowserEnv() && !o.startsWith("http") && (o = `https:${o}`), r.type = n.type, r.entryGlobalName = n.globalName, r.entry = o, r.version = t.version, r.buildVersion = t.buildVersion;
1404
1589
  }
1405
1590
  function snapshotPlugin() {
1406
1591
  return {
1407
1592
  name: "snapshot-plugin",
1408
- async afterResolve(n) {
1409
- const { remote: t, pkgNameOrAlias: o, expose: r, origin: s, remoteInfo: l } = n;
1593
+ async afterResolve(r) {
1594
+ const { remote: t, pkgNameOrAlias: n, expose: o, origin: s, remoteInfo: l } = r;
1410
1595
  if (!isRemoteInfoWithEntry(t) || !isPureRemoteEntry(t)) {
1411
1596
  const { remoteSnapshot: a, globalSnapshot: i } = await s.snapshotHandler.loadRemoteSnapshotInfo(t);
1412
1597
  assignRemoteInfo(l, a);
1413
1598
  const c = {
1414
1599
  remote: t,
1415
1600
  preloadConfig: {
1416
- nameOrAlias: o,
1601
+ nameOrAlias: n,
1417
1602
  exposes: [
1418
- r
1603
+ o
1419
1604
  ],
1420
1605
  resourceCategory: "sync",
1421
1606
  share: !1,
@@ -1429,16 +1614,16 @@ function snapshotPlugin() {
1429
1614
  remoteSnapshot: a,
1430
1615
  globalSnapshot: i
1431
1616
  });
1432
- return u && preloadAssets(l, s, u, !1), _extends$1({}, n, {
1617
+ return u && preloadAssets(l, s, u, !1), _extends$1({}, r, {
1433
1618
  remoteSnapshot: a
1434
1619
  });
1435
1620
  }
1436
- return n;
1621
+ return r;
1437
1622
  }
1438
1623
  };
1439
1624
  }
1440
- function splitId(n) {
1441
- const t = n.split(":");
1625
+ function splitId(r) {
1626
+ const t = r.split(":");
1442
1627
  return t.length === 1 ? {
1443
1628
  name: t[0],
1444
1629
  version: void 0
@@ -1450,108 +1635,108 @@ function splitId(n) {
1450
1635
  version: t[2]
1451
1636
  };
1452
1637
  }
1453
- function traverseModuleInfo(n, t, o, r, s = {}, l) {
1454
- const a = getFMId(t), { value: i } = getInfoWithoutType(n, a), c = l || i;
1455
- if (c && !isManifestProvider(c) && (o(c, t, r), c.remotesInfo)) {
1638
+ function traverseModuleInfo(r, t, n, o, s = {}, l) {
1639
+ const a = getFMId(t), { value: i } = getInfoWithoutType(r, a), c = l || i;
1640
+ if (c && !isManifestProvider(c) && (n(c, t, o), c.remotesInfo)) {
1456
1641
  const u = Object.keys(c.remotesInfo);
1457
1642
  for (const d of u) {
1458
1643
  if (s[d])
1459
1644
  continue;
1460
1645
  s[d] = !0;
1461
- const m = splitId(d), p = c.remotesInfo[d];
1462
- traverseModuleInfo(n, {
1463
- name: m.name,
1464
- version: p.matchedVersion
1465
- }, o, !1, s, void 0);
1646
+ const p = splitId(d), m = c.remotesInfo[d];
1647
+ traverseModuleInfo(r, {
1648
+ name: p.name,
1649
+ version: m.matchedVersion
1650
+ }, n, !1, s, void 0);
1466
1651
  }
1467
1652
  }
1468
1653
  }
1469
- function generatePreloadAssets(n, t, o, r, s) {
1470
- const l = [], a = [], i = [], c = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), { options: d } = n, { preloadConfig: m } = t, { depsRemote: p } = m;
1471
- if (traverseModuleInfo(r, o, (_, b, v) => {
1472
- let I;
1473
- if (v)
1474
- I = m;
1475
- else if (Array.isArray(p)) {
1476
- const w = p.find((O) => O.nameOrAlias === b.name || O.nameOrAlias === b.alias);
1477
- if (!w)
1654
+ function generatePreloadAssets(r, t, n, o, s) {
1655
+ const l = [], a = [], i = [], c = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), { options: d } = r, { preloadConfig: p } = t, { depsRemote: m } = p;
1656
+ if (traverseModuleInfo(o, n, (g, b, S) => {
1657
+ let v;
1658
+ if (S)
1659
+ v = p;
1660
+ else if (Array.isArray(m)) {
1661
+ const T = m.find((A) => A.nameOrAlias === b.name || A.nameOrAlias === b.alias);
1662
+ if (!T)
1478
1663
  return;
1479
- I = defaultPreloadArgs(w);
1480
- } else if (p === !0)
1481
- I = m;
1664
+ v = defaultPreloadArgs(T);
1665
+ } else if (m === !0)
1666
+ v = p;
1482
1667
  else
1483
1668
  return;
1484
- const S = getResourceUrl(_, getRemoteEntryInfoFromSnapshot(_).url);
1485
- S && i.push({
1669
+ const I = getResourceUrl(g, getRemoteEntryInfoFromSnapshot(g).url);
1670
+ I && i.push({
1486
1671
  name: b.name,
1487
1672
  moduleInfo: {
1488
1673
  name: b.name,
1489
- entry: S,
1490
- type: "remoteEntryType" in _ ? _.remoteEntryType : "global",
1491
- entryGlobalName: "globalName" in _ ? _.globalName : b.name,
1674
+ entry: I,
1675
+ type: "remoteEntryType" in g ? g.remoteEntryType : "global",
1676
+ entryGlobalName: "globalName" in g ? g.globalName : b.name,
1492
1677
  shareScope: "",
1493
- version: "version" in _ ? _.version : void 0
1678
+ version: "version" in g ? g.version : void 0
1494
1679
  },
1495
- url: S
1680
+ url: I
1496
1681
  });
1497
- let R = "modules" in _ ? _.modules : [];
1498
- const $ = normalizePreloadExposes(I.exposes);
1499
- if ($.length && "modules" in _) {
1500
- var T;
1501
- R = _ == null || (T = _.modules) == null ? void 0 : T.reduce((w, O) => (($ == null ? void 0 : $.indexOf(O.moduleName)) !== -1 && w.push(O), w), []);
1682
+ let R = "modules" in g ? g.modules : [];
1683
+ const $ = normalizePreloadExposes(v.exposes);
1684
+ if ($.length && "modules" in g) {
1685
+ var w;
1686
+ R = g == null || (w = g.modules) == null ? void 0 : w.reduce((T, A) => (($ == null ? void 0 : $.indexOf(A.moduleName)) !== -1 && T.push(A), T), []);
1502
1687
  }
1503
- function A(w) {
1504
- const O = w.map((M) => getResourceUrl(_, M));
1505
- return I.filter ? O.filter(I.filter) : O;
1688
+ function O(T) {
1689
+ const A = T.map((P) => getResourceUrl(g, P));
1690
+ return v.filter ? A.filter(v.filter) : A;
1506
1691
  }
1507
1692
  if (R) {
1508
- const w = R.length;
1509
- for (let O = 0; O < w; O++) {
1510
- const M = R[O], N = `${b.name}/${M.moduleName}`;
1511
- n.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({
1512
- id: M.moduleName === "." ? b.name : N,
1693
+ const T = R.length;
1694
+ for (let A = 0; A < T; A++) {
1695
+ const P = R[A], M = `${b.name}/${P.moduleName}`;
1696
+ r.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({
1697
+ id: P.moduleName === "." ? b.name : M,
1513
1698
  name: b.name,
1514
- remoteSnapshot: _,
1515
- preloadConfig: I,
1699
+ remoteSnapshot: g,
1700
+ preloadConfig: v,
1516
1701
  remote: b,
1517
- origin: n
1518
- }), !getPreloaded(N) && (I.resourceCategory === "all" ? (l.push(...A(M.assets.css.async)), l.push(...A(M.assets.css.sync)), a.push(...A(M.assets.js.async)), a.push(...A(M.assets.js.sync))) : (I.resourceCategory = "sync") && (l.push(...A(M.assets.css.sync)), a.push(...A(M.assets.js.sync))), setPreloaded(N));
1702
+ origin: r
1703
+ }), !getPreloaded(M) && (v.resourceCategory === "all" ? (l.push(...O(P.assets.css.async)), l.push(...O(P.assets.css.sync)), a.push(...O(P.assets.js.async)), a.push(...O(P.assets.js.sync))) : (v.resourceCategory = "sync") && (l.push(...O(P.assets.css.sync)), a.push(...O(P.assets.js.sync))), setPreloaded(M));
1519
1704
  }
1520
1705
  }
1521
1706
  }, !0, {}, s), s.shared) {
1522
- const _ = (b, v) => {
1523
- const I = getRegisteredShare(n.shareScopeMap, v.sharedName, b, n.sharedHandler.hooks.lifecycle.resolveShare);
1524
- I && typeof I.lib == "function" && (v.assets.js.sync.forEach((S) => {
1525
- c.add(S);
1526
- }), v.assets.css.sync.forEach((S) => {
1527
- u.add(S);
1707
+ const g = (b, S) => {
1708
+ const v = getRegisteredShare(r.shareScopeMap, S.sharedName, b, r.sharedHandler.hooks.lifecycle.resolveShare);
1709
+ v && typeof v.lib == "function" && (S.assets.js.sync.forEach((I) => {
1710
+ c.add(I);
1711
+ }), S.assets.css.sync.forEach((I) => {
1712
+ u.add(I);
1528
1713
  }));
1529
1714
  };
1530
1715
  s.shared.forEach((b) => {
1531
- var v;
1532
- const I = (v = d.shared) == null ? void 0 : v[b.sharedName];
1533
- if (!I)
1716
+ var S;
1717
+ const v = (S = d.shared) == null ? void 0 : S[b.sharedName];
1718
+ if (!v)
1534
1719
  return;
1535
- const S = b.version ? I.find(($) => $.version === b.version) : I;
1536
- if (!S)
1720
+ const I = b.version ? v.find(($) => $.version === b.version) : v;
1721
+ if (!I)
1537
1722
  return;
1538
- arrayOptions(S).forEach(($) => {
1539
- _($, b);
1723
+ arrayOptions(I).forEach(($) => {
1724
+ g($, b);
1540
1725
  });
1541
1726
  });
1542
1727
  }
1543
- const g = a.filter((_) => !c.has(_));
1728
+ const _ = a.filter((g) => !c.has(g));
1544
1729
  return {
1545
- cssAssets: l.filter((_) => !u.has(_)),
1546
- jsAssetsWithoutEntry: g,
1730
+ cssAssets: l.filter((g) => !u.has(g)),
1731
+ jsAssetsWithoutEntry: _,
1547
1732
  entryAssets: i
1548
1733
  };
1549
1734
  }
1550
1735
  const generatePreloadAssetsPlugin = function() {
1551
1736
  return {
1552
1737
  name: "generate-preload-assets-plugin",
1553
- async generatePreloadAssets(n) {
1554
- const { origin: t, preloadOptions: o, remoteInfo: r, remote: s, globalSnapshot: l, remoteSnapshot: a } = n;
1738
+ async generatePreloadAssets(r) {
1739
+ const { origin: t, preloadOptions: n, remoteInfo: o, remote: s, globalSnapshot: l, remoteSnapshot: a } = r;
1555
1740
  return isRemoteInfoWithEntry(s) && isPureRemoteEntry(s) ? {
1556
1741
  cssAssets: [],
1557
1742
  jsAssetsWithoutEntry: [],
@@ -1560,45 +1745,45 @@ const generatePreloadAssetsPlugin = function() {
1560
1745
  name: s.name,
1561
1746
  url: s.entry,
1562
1747
  moduleInfo: {
1563
- name: r.name,
1748
+ name: o.name,
1564
1749
  entry: s.entry,
1565
- type: r.type || "global",
1750
+ type: o.type || "global",
1566
1751
  entryGlobalName: "",
1567
1752
  shareScope: ""
1568
1753
  }
1569
1754
  }
1570
1755
  ]
1571
- } : (assignRemoteInfo(r, a), generatePreloadAssets(t, o, r, l, a));
1756
+ } : (assignRemoteInfo(o, a), generatePreloadAssets(t, n, o, l, a));
1572
1757
  }
1573
1758
  };
1574
1759
  };
1575
- function getGlobalRemoteInfo(n, t) {
1576
- const o = getGlobalSnapshotInfoByModuleInfo({
1760
+ function getGlobalRemoteInfo(r, t) {
1761
+ const n = getGlobalSnapshotInfoByModuleInfo({
1577
1762
  name: t.options.name,
1578
1763
  version: t.options.version
1579
- }), r = o && "remotesInfo" in o && o.remotesInfo && getInfoWithoutType(o.remotesInfo, n.name).value;
1580
- return r && r.matchedVersion ? {
1581
- hostGlobalSnapshot: o,
1764
+ }), o = n && "remotesInfo" in n && n.remotesInfo && getInfoWithoutType(n.remotesInfo, r.name).value;
1765
+ return o && o.matchedVersion ? {
1766
+ hostGlobalSnapshot: n,
1582
1767
  globalSnapshot: getGlobalSnapshot(),
1583
1768
  remoteSnapshot: getGlobalSnapshotInfoByModuleInfo({
1584
- name: n.name,
1585
- version: r.matchedVersion
1769
+ name: r.name,
1770
+ version: o.matchedVersion
1586
1771
  })
1587
1772
  } : {
1588
1773
  hostGlobalSnapshot: void 0,
1589
1774
  globalSnapshot: getGlobalSnapshot(),
1590
1775
  remoteSnapshot: getGlobalSnapshotInfoByModuleInfo({
1591
- name: n.name,
1592
- version: "version" in n ? n.version : void 0
1776
+ name: r.name,
1777
+ version: "version" in r ? r.version : void 0
1593
1778
  })
1594
1779
  };
1595
1780
  }
1596
1781
  class SnapshotHandler {
1597
1782
  async loadSnapshot(t) {
1598
- const { options: o } = this.HostInstance, { hostGlobalSnapshot: r, remoteSnapshot: s, globalSnapshot: l } = this.getGlobalRemoteInfo(t), { remoteSnapshot: a, globalSnapshot: i } = await this.hooks.lifecycle.loadSnapshot.emit({
1599
- options: o,
1783
+ const { options: n } = this.HostInstance, { hostGlobalSnapshot: o, remoteSnapshot: s, globalSnapshot: l } = this.getGlobalRemoteInfo(t), { remoteSnapshot: a, globalSnapshot: i } = await this.hooks.lifecycle.loadSnapshot.emit({
1784
+ options: n,
1600
1785
  moduleInfo: t,
1601
- hostGlobalSnapshot: r,
1786
+ hostGlobalSnapshot: o,
1602
1787
  remoteSnapshot: s,
1603
1788
  globalSnapshot: l
1604
1789
  });
@@ -1609,28 +1794,28 @@ class SnapshotHandler {
1609
1794
  }
1610
1795
  // eslint-disable-next-line max-lines-per-function
1611
1796
  async loadRemoteSnapshotInfo(t) {
1612
- const { options: o } = this.HostInstance;
1797
+ const { options: n } = this.HostInstance;
1613
1798
  await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({
1614
- options: o,
1799
+ options: n,
1615
1800
  moduleInfo: t
1616
1801
  });
1617
- let r = getGlobalSnapshotInfoByModuleInfo({
1802
+ let o = getGlobalSnapshotInfoByModuleInfo({
1618
1803
  name: this.HostInstance.options.name,
1619
1804
  version: this.HostInstance.options.version
1620
1805
  });
1621
- r || (r = {
1806
+ o || (o = {
1622
1807
  version: this.HostInstance.options.version || "",
1623
1808
  remoteEntry: "",
1624
1809
  remotesInfo: {}
1625
1810
  }, addGlobalSnapshot({
1626
- [this.HostInstance.options.name]: r
1627
- })), r && "remotesInfo" in r && !getInfoWithoutType(r.remotesInfo, t.name).value && ("version" in t || "entry" in t) && (r.remotesInfo = _extends$1({}, r == null ? void 0 : r.remotesInfo, {
1811
+ [this.HostInstance.options.name]: o
1812
+ })), o && "remotesInfo" in o && !getInfoWithoutType(o.remotesInfo, t.name).value && ("version" in t || "entry" in t) && (o.remotesInfo = _extends$1({}, o == null ? void 0 : o.remotesInfo, {
1628
1813
  [t.name]: {
1629
1814
  matchedVersion: "version" in t ? t.version : t.entry
1630
1815
  }
1631
1816
  }));
1632
1817
  const { hostGlobalSnapshot: s, remoteSnapshot: l, globalSnapshot: a } = this.getGlobalRemoteInfo(t), { remoteSnapshot: i, globalSnapshot: c } = await this.hooks.lifecycle.loadSnapshot.emit({
1633
- options: o,
1818
+ options: n,
1634
1819
  moduleInfo: t,
1635
1820
  hostGlobalSnapshot: s,
1636
1821
  remoteSnapshot: l,
@@ -1639,29 +1824,29 @@ class SnapshotHandler {
1639
1824
  let u, d;
1640
1825
  if (i)
1641
1826
  if (isManifestProvider(i)) {
1642
- const m = isBrowserEnv() ? i.remoteEntry : i.ssrRemoteEntry || i.remoteEntry || "", p = await this.getManifestJson(m, t, {}), y = setGlobalSnapshotInfoByModuleInfo(_extends$1({}, t, {
1827
+ const p = isBrowserEnv() ? i.remoteEntry : i.ssrRemoteEntry || i.remoteEntry || "", m = await this.getManifestJson(p, t, {}), y = setGlobalSnapshotInfoByModuleInfo(_extends$1({}, t, {
1643
1828
  // The global remote may be overridden
1644
1829
  // Therefore, set the snapshot key to the global address of the actual request
1645
- entry: m
1646
- }), p);
1647
- u = p, d = y;
1830
+ entry: p
1831
+ }), m);
1832
+ u = m, d = y;
1648
1833
  } else {
1649
- const { remoteSnapshot: m } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1834
+ const { remoteSnapshot: p } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1650
1835
  options: this.HostInstance.options,
1651
1836
  moduleInfo: t,
1652
1837
  remoteSnapshot: i,
1653
1838
  from: "global"
1654
1839
  });
1655
- u = m, d = c;
1840
+ u = p, d = c;
1656
1841
  }
1657
1842
  else if (isRemoteInfoWithEntry(t)) {
1658
- const m = await this.getManifestJson(t.entry, t, {}), p = setGlobalSnapshotInfoByModuleInfo(t, m), { remoteSnapshot: y } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1843
+ const p = await this.getManifestJson(t.entry, t, {}), m = setGlobalSnapshotInfoByModuleInfo(t, p), { remoteSnapshot: y } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1659
1844
  options: this.HostInstance.options,
1660
1845
  moduleInfo: t,
1661
- remoteSnapshot: m,
1846
+ remoteSnapshot: p,
1662
1847
  from: "global"
1663
1848
  });
1664
- u = y, d = p;
1849
+ u = y, d = m;
1665
1850
  } else
1666
1851
  error(getShortErrorMsg(RUNTIME_007, runtimeDescMap, {
1667
1852
  hostName: t.name,
@@ -1669,7 +1854,7 @@ class SnapshotHandler {
1669
1854
  globalSnapshot: JSON.stringify(c)
1670
1855
  }));
1671
1856
  return await this.hooks.lifecycle.afterLoadSnapshot.emit({
1672
- options: o,
1857
+ options: n,
1673
1858
  moduleInfo: t,
1674
1859
  remoteSnapshot: u
1675
1860
  }), {
@@ -1680,7 +1865,7 @@ class SnapshotHandler {
1680
1865
  getGlobalRemoteInfo(t) {
1681
1866
  return getGlobalRemoteInfo(t, this.HostInstance);
1682
1867
  }
1683
- async getManifestJson(t, o, r) {
1868
+ async getManifestJson(t, n, o) {
1684
1869
  const s = async () => {
1685
1870
  let a = this.manifestCache.get(t);
1686
1871
  if (a)
@@ -1697,7 +1882,7 @@ class SnapshotHandler {
1697
1882
  origin: this.HostInstance
1698
1883
  }), a || (delete this.manifestLoading[t], error(getShortErrorMsg(RUNTIME_003, runtimeDescMap, {
1699
1884
  manifestUrl: t,
1700
- moduleName: o.name
1885
+ moduleName: n.name
1701
1886
  }, `${i}`)));
1702
1887
  }
1703
1888
  return assert(a.metaData && a.exposes && a.shared, `${t} is not a federation manifest`), this.manifestCache.set(t, a), a;
@@ -1706,7 +1891,7 @@ class SnapshotHandler {
1706
1891
  version: t
1707
1892
  }), { remoteSnapshot: c } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1708
1893
  options: this.HostInstance.options,
1709
- moduleInfo: o,
1894
+ moduleInfo: n,
1710
1895
  manifestJson: a,
1711
1896
  remoteSnapshot: i,
1712
1897
  manifestUrl: t,
@@ -1727,29 +1912,29 @@ class SnapshotHandler {
1727
1912
  }
1728
1913
  class SharedHandler {
1729
1914
  // register shared in shareScopeMap
1730
- registerShared(t, o) {
1731
- const { shareInfos: r, shared: s } = formatShareConfigs(t, o);
1732
- return Object.keys(r).forEach((a) => {
1733
- r[a].forEach((c) => {
1915
+ registerShared(t, n) {
1916
+ const { shareInfos: o, shared: s } = formatShareConfigs(t, n);
1917
+ return Object.keys(o).forEach((a) => {
1918
+ o[a].forEach((c) => {
1734
1919
  !getRegisteredShare(this.shareScopeMap, a, c, this.hooks.lifecycle.resolveShare) && c && c.lib && this.setShared({
1735
1920
  pkgName: a,
1736
1921
  lib: c.lib,
1737
1922
  get: c.get,
1738
1923
  loaded: !0,
1739
1924
  shared: c,
1740
- from: o.name
1925
+ from: n.name
1741
1926
  });
1742
1927
  });
1743
1928
  }), {
1744
- shareInfos: r,
1929
+ shareInfos: o,
1745
1930
  shared: s
1746
1931
  };
1747
1932
  }
1748
- async loadShare(t, o) {
1749
- const { host: r } = this, s = getTargetSharedOptions({
1933
+ async loadShare(t, n) {
1934
+ const { host: o } = this, s = getTargetSharedOptions({
1750
1935
  pkgName: t,
1751
- extraOptions: o,
1752
- shareInfos: r.options.shared
1936
+ extraOptions: n,
1937
+ shareInfos: o.options.shared
1753
1938
  });
1754
1939
  s != null && s.scope && await Promise.all(s.scope.map(async (u) => {
1755
1940
  await Promise.all(this.initializeSharing(u, {
@@ -1759,12 +1944,12 @@ class SharedHandler {
1759
1944
  const l = await this.hooks.lifecycle.beforeLoadShare.emit({
1760
1945
  pkgName: t,
1761
1946
  shareInfo: s,
1762
- shared: r.options.shared,
1763
- origin: r
1947
+ shared: o.options.shared,
1948
+ origin: o
1764
1949
  }), { shareInfo: a } = l;
1765
- assert(a, `Cannot find ${t} Share in the ${r.options.name}. Please ensure that the ${t} Share parameters have been injected`);
1950
+ assert(a, `Cannot find ${t} Share in the ${o.options.name}. Please ensure that the ${t} Share parameters have been injected`);
1766
1951
  const i = getRegisteredShare(this.shareScopeMap, t, a, this.hooks.lifecycle.resolveShare), c = (u) => {
1767
- u.useIn || (u.useIn = []), addUniqueItem(u.useIn, r.options.name);
1952
+ u.useIn || (u.useIn = []), addUniqueItem(u.useIn, o.options.name);
1768
1953
  };
1769
1954
  if (i && i.lib)
1770
1955
  return c(i), i.lib;
@@ -1773,33 +1958,33 @@ class SharedHandler {
1773
1958
  return i.loaded = !0, i.lib || (i.lib = u), c(i), u;
1774
1959
  } else if (i) {
1775
1960
  const d = (async () => {
1776
- const m = await i.get();
1777
- a.lib = m, a.loaded = !0, c(a);
1778
- const p = getRegisteredShare(this.shareScopeMap, t, a, this.hooks.lifecycle.resolveShare);
1779
- return p && (p.lib = m, p.loaded = !0), m;
1961
+ const p = await i.get();
1962
+ a.lib = p, a.loaded = !0, c(a);
1963
+ const m = getRegisteredShare(this.shareScopeMap, t, a, this.hooks.lifecycle.resolveShare);
1964
+ return m && (m.lib = p, m.loaded = !0), p;
1780
1965
  })();
1781
1966
  return this.setShared({
1782
1967
  pkgName: t,
1783
1968
  loaded: !1,
1784
1969
  shared: i,
1785
- from: r.options.name,
1970
+ from: o.options.name,
1786
1971
  lib: null,
1787
1972
  loading: d
1788
1973
  }), d;
1789
1974
  } else {
1790
- if (o != null && o.customShareInfo)
1975
+ if (n != null && n.customShareInfo)
1791
1976
  return !1;
1792
1977
  const d = (async () => {
1793
- const m = await a.get();
1794
- a.lib = m, a.loaded = !0, c(a);
1795
- const p = getRegisteredShare(this.shareScopeMap, t, a, this.hooks.lifecycle.resolveShare);
1796
- return p && (p.lib = m, p.loaded = !0), m;
1978
+ const p = await a.get();
1979
+ a.lib = p, a.loaded = !0, c(a);
1980
+ const m = getRegisteredShare(this.shareScopeMap, t, a, this.hooks.lifecycle.resolveShare);
1981
+ return m && (m.lib = p, m.loaded = !0), p;
1797
1982
  })();
1798
1983
  return this.setShared({
1799
1984
  pkgName: t,
1800
1985
  loaded: !1,
1801
1986
  shared: a,
1802
- from: r.options.name,
1987
+ from: o.options.name,
1803
1988
  lib: null,
1804
1989
  loading: d
1805
1990
  }), d;
@@ -1811,65 +1996,65 @@ class SharedHandler {
1811
1996
  * If the share scope does not exist, it creates one.
1812
1997
  */
1813
1998
  // eslint-disable-next-line @typescript-eslint/member-ordering
1814
- initializeSharing(t = DEFAULT_SCOPE, o) {
1815
- const { host: r } = this, s = o == null ? void 0 : o.from, l = o == null ? void 0 : o.strategy;
1816
- let a = o == null ? void 0 : o.initScope;
1999
+ initializeSharing(t = DEFAULT_SCOPE, n) {
2000
+ const { host: o } = this, s = n == null ? void 0 : n.from, l = n == null ? void 0 : n.strategy;
2001
+ let a = n == null ? void 0 : n.initScope;
1817
2002
  const i = [];
1818
2003
  if (s !== "build") {
1819
- const { initTokens: g } = this;
2004
+ const { initTokens: _ } = this;
1820
2005
  a || (a = []);
1821
- let E = g[t];
1822
- if (E || (E = g[t] = {
2006
+ let E = _[t];
2007
+ if (E || (E = _[t] = {
1823
2008
  from: this.host.name
1824
2009
  }), a.indexOf(E) >= 0)
1825
2010
  return i;
1826
2011
  a.push(E);
1827
2012
  }
1828
- const c = this.shareScopeMap, u = r.options.name;
2013
+ const c = this.shareScopeMap, u = o.options.name;
1829
2014
  c[t] || (c[t] = {});
1830
- const d = c[t], m = (g, E) => {
1831
- var _;
1832
- const { version: b, eager: v } = E;
1833
- d[g] = d[g] || {};
1834
- const I = d[g], S = I[b], R = !!(S && (S.eager || (_ = S.shareConfig) != null && _.eager));
1835
- (!S || S.strategy !== "loaded-first" && !S.loaded && (!v != !R ? v : u > S.from)) && (I[b] = E);
1836
- }, p = (g) => g && g.init && g.init(c[t], a), y = async (g) => {
1837
- const { module: E } = await r.remoteHandler.getRemoteModuleAndOptions({
1838
- id: g
2015
+ const d = c[t], p = (_, E) => {
2016
+ var g;
2017
+ const { version: b, eager: S } = E;
2018
+ d[_] = d[_] || {};
2019
+ const v = d[_], I = v[b], R = !!(I && (I.eager || (g = I.shareConfig) != null && g.eager));
2020
+ (!I || I.strategy !== "loaded-first" && !I.loaded && (!S != !R ? S : u > I.from)) && (v[b] = E);
2021
+ }, m = (_) => _ && _.init && _.init(c[t], a), y = async (_) => {
2022
+ const { module: E } = await o.remoteHandler.getRemoteModuleAndOptions({
2023
+ id: _
1839
2024
  });
1840
2025
  if (E.getEntry) {
1841
- let _;
2026
+ let g;
1842
2027
  try {
1843
- _ = await E.getEntry();
2028
+ g = await E.getEntry();
1844
2029
  } catch (b) {
1845
- _ = await r.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
1846
- id: g,
2030
+ g = await o.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
2031
+ id: _,
1847
2032
  error: b,
1848
2033
  from: "runtime",
1849
2034
  lifecycle: "beforeLoadShare",
1850
- origin: r
2035
+ origin: o
1851
2036
  });
1852
2037
  }
1853
- E.inited || (await p(_), E.inited = !0);
2038
+ E.inited || (await m(g), E.inited = !0);
1854
2039
  }
1855
2040
  };
1856
- return Object.keys(r.options.shared).forEach((g) => {
1857
- r.options.shared[g].forEach((_) => {
1858
- _.scope.includes(t) && m(g, _);
2041
+ return Object.keys(o.options.shared).forEach((_) => {
2042
+ o.options.shared[_].forEach((g) => {
2043
+ g.scope.includes(t) && p(_, g);
1859
2044
  });
1860
- }), (r.options.shareStrategy === "version-first" || l === "version-first") && r.options.remotes.forEach((g) => {
1861
- g.shareScope === t && i.push(y(g.name));
2045
+ }), (o.options.shareStrategy === "version-first" || l === "version-first") && o.options.remotes.forEach((_) => {
2046
+ _.shareScope === t && i.push(y(_.name));
1862
2047
  }), i;
1863
2048
  }
1864
2049
  // The lib function will only be available if the shared set by eager or runtime init is set or the shared is successfully loaded.
1865
2050
  // 1. If the loaded shared already exists globally, then it will be reused
1866
2051
  // 2. If lib exists in local shared, it will be used directly
1867
2052
  // 3. If the local get returns something other than Promise, then it will be used directly
1868
- loadShareSync(t, o) {
1869
- const { host: r } = this, s = getTargetSharedOptions({
2053
+ loadShareSync(t, n) {
2054
+ const { host: o } = this, s = getTargetSharedOptions({
1870
2055
  pkgName: t,
1871
- extraOptions: o,
1872
- shareInfos: r.options.shared
2056
+ extraOptions: n,
2057
+ shareInfos: o.options.shared
1873
2058
  });
1874
2059
  s != null && s.scope && s.scope.forEach((i) => {
1875
2060
  this.initializeSharing(i, {
@@ -1877,18 +2062,18 @@ class SharedHandler {
1877
2062
  });
1878
2063
  });
1879
2064
  const l = getRegisteredShare(this.shareScopeMap, t, s, this.hooks.lifecycle.resolveShare), a = (i) => {
1880
- i.useIn || (i.useIn = []), addUniqueItem(i.useIn, r.options.name);
2065
+ i.useIn || (i.useIn = []), addUniqueItem(i.useIn, o.options.name);
1881
2066
  };
1882
2067
  if (l) {
1883
2068
  if (typeof l.lib == "function")
1884
- return a(l), l.loaded || (l.loaded = !0, l.from === r.options.name && (s.loaded = !0)), l.lib;
2069
+ return a(l), l.loaded || (l.loaded = !0, l.from === o.options.name && (s.loaded = !0)), l.lib;
1885
2070
  if (typeof l.get == "function") {
1886
2071
  const i = l.get();
1887
2072
  if (!(i instanceof Promise))
1888
2073
  return a(l), this.setShared({
1889
2074
  pkgName: t,
1890
2075
  loaded: !0,
1891
- from: r.options.name,
2076
+ from: o.options.name,
1892
2077
  lib: i,
1893
2078
  shared: l
1894
2079
  }), i;
@@ -1899,45 +2084,45 @@ class SharedHandler {
1899
2084
  if (s.get) {
1900
2085
  const i = s.get();
1901
2086
  if (i instanceof Promise) {
1902
- const c = (o == null ? void 0 : o.from) === "build" ? RUNTIME_005 : RUNTIME_006;
2087
+ const c = (n == null ? void 0 : n.from) === "build" ? RUNTIME_005 : RUNTIME_006;
1903
2088
  throw new Error(getShortErrorMsg(c, runtimeDescMap, {
1904
- hostName: r.options.name,
2089
+ hostName: o.options.name,
1905
2090
  sharedPkgName: t
1906
2091
  }));
1907
2092
  }
1908
2093
  return s.lib = i, this.setShared({
1909
2094
  pkgName: t,
1910
2095
  loaded: !0,
1911
- from: r.options.name,
2096
+ from: o.options.name,
1912
2097
  lib: s.lib,
1913
2098
  shared: s
1914
2099
  }), s.lib;
1915
2100
  }
1916
2101
  throw new Error(getShortErrorMsg(RUNTIME_006, runtimeDescMap, {
1917
- hostName: r.options.name,
2102
+ hostName: o.options.name,
1918
2103
  sharedPkgName: t
1919
2104
  }));
1920
2105
  }
1921
- initShareScopeMap(t, o, r = {}) {
2106
+ initShareScopeMap(t, n, o = {}) {
1922
2107
  const { host: s } = this;
1923
- this.shareScopeMap[t] = o, this.hooks.lifecycle.initContainerShareScopeMap.emit({
1924
- shareScope: o,
2108
+ this.shareScopeMap[t] = n, this.hooks.lifecycle.initContainerShareScopeMap.emit({
2109
+ shareScope: n,
1925
2110
  options: s.options,
1926
2111
  origin: s,
1927
2112
  scopeName: t,
1928
- hostShareScopeMap: r.hostShareScopeMap
2113
+ hostShareScopeMap: o.hostShareScopeMap
1929
2114
  });
1930
2115
  }
1931
- setShared({ pkgName: t, shared: o, from: r, lib: s, loading: l, loaded: a, get: i }) {
1932
- const { version: c, scope: u = "default" } = o, d = _object_without_properties_loose(o, [
2116
+ setShared({ pkgName: t, shared: n, from: o, lib: s, loading: l, loaded: a, get: i }) {
2117
+ const { version: c, scope: u = "default" } = n, d = _object_without_properties_loose(n, [
1933
2118
  "version",
1934
2119
  "scope"
1935
2120
  ]);
1936
2121
  (Array.isArray(u) ? u : [
1937
2122
  u
1938
- ]).forEach((p) => {
1939
- if (this.shareScopeMap[p] || (this.shareScopeMap[p] = {}), this.shareScopeMap[p][t] || (this.shareScopeMap[p][t] = {}), !this.shareScopeMap[p][t][c]) {
1940
- this.shareScopeMap[p][t][c] = _extends$1({
2123
+ ]).forEach((m) => {
2124
+ if (this.shareScopeMap[m] || (this.shareScopeMap[m] = {}), this.shareScopeMap[m][t] || (this.shareScopeMap[m][t] = {}), !this.shareScopeMap[m][t][c]) {
2125
+ this.shareScopeMap[m][t][c] = _extends$1({
1941
2126
  version: c,
1942
2127
  scope: [
1943
2128
  "default"
@@ -1946,16 +2131,16 @@ class SharedHandler {
1946
2131
  lib: s,
1947
2132
  loaded: a,
1948
2133
  loading: l
1949
- }), i && (this.shareScopeMap[p][t][c].get = i);
2134
+ }), i && (this.shareScopeMap[m][t][c].get = i);
1950
2135
  return;
1951
2136
  }
1952
- const y = this.shareScopeMap[p][t][c];
2137
+ const y = this.shareScopeMap[m][t][c];
1953
2138
  l && !y.loading && (y.loading = l);
1954
2139
  });
1955
2140
  }
1956
2141
  _setGlobalShareScopeMap(t) {
1957
- const o = getGlobalShareScope(), r = t.id || t.name;
1958
- r && !o[r] && (o[r] = this.shareScopeMap);
2142
+ const n = getGlobalShareScope(), o = t.id || t.name;
2143
+ o && !n[o] && (n[o] = this.shareScopeMap);
1959
2144
  }
1960
2145
  constructor(t) {
1961
2146
  this.hooks = new PluginSystem({
@@ -1970,20 +2155,20 @@ class SharedHandler {
1970
2155
  }
1971
2156
  }
1972
2157
  class RemoteHandler {
1973
- formatAndRegisterRemote(t, o) {
1974
- return (o.remotes || []).reduce((s, l) => (this.registerRemote(l, s, {
2158
+ formatAndRegisterRemote(t, n) {
2159
+ return (n.remotes || []).reduce((s, l) => (this.registerRemote(l, s, {
1975
2160
  force: !1
1976
2161
  }), s), t.remotes);
1977
2162
  }
1978
- setIdToRemoteMap(t, o) {
1979
- const { remote: r, expose: s } = o, { name: l, alias: a } = r;
2163
+ setIdToRemoteMap(t, n) {
2164
+ const { remote: o, expose: s } = n, { name: l, alias: a } = o;
1980
2165
  if (this.idToRemoteMap[t] = {
1981
- name: r.name,
2166
+ name: o.name,
1982
2167
  expose: s
1983
2168
  }, a && t.startsWith(l)) {
1984
2169
  const i = t.replace(l, a);
1985
2170
  this.idToRemoteMap[i] = {
1986
- name: r.name,
2171
+ name: o.name,
1987
2172
  expose: s
1988
2173
  };
1989
2174
  return;
@@ -1991,22 +2176,22 @@ class RemoteHandler {
1991
2176
  if (a && t.startsWith(a)) {
1992
2177
  const i = t.replace(a, l);
1993
2178
  this.idToRemoteMap[i] = {
1994
- name: r.name,
2179
+ name: o.name,
1995
2180
  expose: s
1996
2181
  };
1997
2182
  }
1998
2183
  }
1999
2184
  // eslint-disable-next-line max-lines-per-function
2000
2185
  // eslint-disable-next-line @typescript-eslint/member-ordering
2001
- async loadRemote(t, o) {
2002
- const { host: r } = this;
2186
+ async loadRemote(t, n) {
2187
+ const { host: o } = this;
2003
2188
  try {
2004
- const { loadFactory: s = !0 } = o || {
2189
+ const { loadFactory: s = !0 } = n || {
2005
2190
  loadFactory: !0
2006
2191
  }, { module: l, moduleOptions: a, remoteMatchInfo: i } = await this.getRemoteModuleAndOptions({
2007
2192
  id: t
2008
- }), { pkgNameOrAlias: c, remote: u, expose: d, id: m, remoteSnapshot: p } = i, y = await l.get(m, d, o, p), g = await this.hooks.lifecycle.onLoad.emit({
2009
- id: m,
2193
+ }), { pkgNameOrAlias: c, remote: u, expose: d, id: p, remoteSnapshot: m } = i, y = await l.get(p, d, n, m), _ = await this.hooks.lifecycle.onLoad.emit({
2194
+ id: p,
2010
2195
  pkgNameOrAlias: c,
2011
2196
  expose: d,
2012
2197
  exposeModule: s ? y : void 0,
@@ -2014,18 +2199,18 @@ class RemoteHandler {
2014
2199
  remote: u,
2015
2200
  options: a,
2016
2201
  moduleInstance: l,
2017
- origin: r
2202
+ origin: o
2018
2203
  });
2019
- return this.setIdToRemoteMap(t, i), typeof g == "function" ? g : y;
2204
+ return this.setIdToRemoteMap(t, i), typeof _ == "function" ? _ : y;
2020
2205
  } catch (s) {
2021
- const { from: l = "runtime" } = o || {
2206
+ const { from: l = "runtime" } = n || {
2022
2207
  from: "runtime"
2023
2208
  }, a = await this.hooks.lifecycle.errorLoadRemote.emit({
2024
2209
  id: t,
2025
2210
  error: s,
2026
2211
  from: l,
2027
2212
  lifecycle: "onLoad",
2028
- origin: r
2213
+ origin: o
2029
2214
  });
2030
2215
  if (!a)
2031
2216
  throw s;
@@ -2034,81 +2219,81 @@ class RemoteHandler {
2034
2219
  }
2035
2220
  // eslint-disable-next-line @typescript-eslint/member-ordering
2036
2221
  async preloadRemote(t) {
2037
- const { host: o } = this;
2222
+ const { host: n } = this;
2038
2223
  await this.hooks.lifecycle.beforePreloadRemote.emit({
2039
2224
  preloadOps: t,
2040
- options: o.options,
2041
- origin: o
2225
+ options: n.options,
2226
+ origin: n
2042
2227
  });
2043
- const r = formatPreloadArgs(o.options.remotes, t);
2044
- await Promise.all(r.map(async (s) => {
2045
- const { remote: l } = s, a = getRemoteInfo(l), { globalSnapshot: i, remoteSnapshot: c } = await o.snapshotHandler.loadRemoteSnapshotInfo(l), u = await this.hooks.lifecycle.generatePreloadAssets.emit({
2046
- origin: o,
2228
+ const o = formatPreloadArgs(n.options.remotes, t);
2229
+ await Promise.all(o.map(async (s) => {
2230
+ const { remote: l } = s, a = getRemoteInfo(l), { globalSnapshot: i, remoteSnapshot: c } = await n.snapshotHandler.loadRemoteSnapshotInfo(l), u = await this.hooks.lifecycle.generatePreloadAssets.emit({
2231
+ origin: n,
2047
2232
  preloadOptions: s,
2048
2233
  remote: l,
2049
2234
  remoteInfo: a,
2050
2235
  globalSnapshot: i,
2051
2236
  remoteSnapshot: c
2052
2237
  });
2053
- u && preloadAssets(a, o, u);
2238
+ u && preloadAssets(a, n, u);
2054
2239
  }));
2055
2240
  }
2056
- registerRemotes(t, o) {
2057
- const { host: r } = this;
2241
+ registerRemotes(t, n) {
2242
+ const { host: o } = this;
2058
2243
  t.forEach((s) => {
2059
- this.registerRemote(s, r.options.remotes, {
2060
- force: o == null ? void 0 : o.force
2244
+ this.registerRemote(s, o.options.remotes, {
2245
+ force: n == null ? void 0 : n.force
2061
2246
  });
2062
2247
  });
2063
2248
  }
2064
2249
  async getRemoteModuleAndOptions(t) {
2065
- const { host: o } = this, { id: r } = t;
2250
+ const { host: n } = this, { id: o } = t;
2066
2251
  let s;
2067
2252
  try {
2068
2253
  s = await this.hooks.lifecycle.beforeRequest.emit({
2069
- id: r,
2070
- options: o.options,
2071
- origin: o
2254
+ id: o,
2255
+ options: n.options,
2256
+ origin: n
2072
2257
  });
2073
- } catch (g) {
2258
+ } catch (_) {
2074
2259
  if (s = await this.hooks.lifecycle.errorLoadRemote.emit({
2075
- id: r,
2076
- options: o.options,
2077
- origin: o,
2260
+ id: o,
2261
+ options: n.options,
2262
+ origin: n,
2078
2263
  from: "runtime",
2079
- error: g,
2264
+ error: _,
2080
2265
  lifecycle: "beforeRequest"
2081
2266
  }), !s)
2082
- throw g;
2267
+ throw _;
2083
2268
  }
2084
- const { id: l } = s, a = matchRemoteWithNameAndExpose(o.options.remotes, l);
2269
+ const { id: l } = s, a = matchRemoteWithNameAndExpose(n.options.remotes, l);
2085
2270
  assert(a, getShortErrorMsg(RUNTIME_004, runtimeDescMap, {
2086
- hostName: o.options.name,
2271
+ hostName: n.options.name,
2087
2272
  requestId: l
2088
2273
  }));
2089
- const { remote: i } = a, c = getRemoteInfo(i), u = await o.sharedHandler.hooks.lifecycle.afterResolve.emit(_extends$1({
2274
+ const { remote: i } = a, c = getRemoteInfo(i), u = await n.sharedHandler.hooks.lifecycle.afterResolve.emit(_extends$1({
2090
2275
  id: l
2091
2276
  }, a, {
2092
- options: o.options,
2093
- origin: o,
2277
+ options: n.options,
2278
+ origin: n,
2094
2279
  remoteInfo: c
2095
- })), { remote: d, expose: m } = u;
2096
- assert(d && m, `The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${l}.`);
2097
- let p = o.moduleCache.get(d.name);
2280
+ })), { remote: d, expose: p } = u;
2281
+ assert(d && p, `The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${l}.`);
2282
+ let m = n.moduleCache.get(d.name);
2098
2283
  const y = {
2099
- host: o,
2284
+ host: n,
2100
2285
  remoteInfo: c
2101
2286
  };
2102
- return p || (p = new Module(y), o.moduleCache.set(d.name, p)), {
2103
- module: p,
2287
+ return m || (m = new Module(y), n.moduleCache.set(d.name, m)), {
2288
+ module: m,
2104
2289
  moduleOptions: y,
2105
2290
  remoteMatchInfo: u
2106
2291
  };
2107
2292
  }
2108
- registerRemote(t, o, r) {
2293
+ registerRemote(t, n, o) {
2109
2294
  const { host: s } = this, l = () => {
2110
2295
  if (t.alias) {
2111
- const i = o.find((c) => {
2296
+ const i = n.find((c) => {
2112
2297
  var u;
2113
2298
  return t.alias && (c.name.startsWith(t.alias) || ((u = c.alias) == null ? void 0 : u.startsWith(t.alias)));
2114
2299
  });
@@ -2120,9 +2305,9 @@ class RemoteHandler {
2120
2305
  remote: t,
2121
2306
  origin: s
2122
2307
  });
2123
- const a = o.find((i) => i.name === t.name);
2308
+ const a = n.find((i) => i.name === t.name);
2124
2309
  if (!a)
2125
- l(), o.push(t), this.hooks.lifecycle.registerRemote.emit({
2310
+ l(), n.push(t), this.hooks.lifecycle.registerRemote.emit({
2126
2311
  remote: t,
2127
2312
  origin: s
2128
2313
  });
@@ -2131,7 +2316,7 @@ class RemoteHandler {
2131
2316
  `The remote "${t.name}" is already registered.`,
2132
2317
  "Please note that overriding it may cause unexpected errors."
2133
2318
  ];
2134
- r != null && r.force && (this.removeRemote(a), l(), o.push(t), this.hooks.lifecycle.registerRemote.emit({
2319
+ o != null && o.force && (this.removeRemote(a), l(), n.push(t), this.hooks.lifecycle.registerRemote.emit({
2135
2320
  remote: t,
2136
2321
  origin: s
2137
2322
  }), warn$1(i.join(" ")));
@@ -2139,61 +2324,61 @@ class RemoteHandler {
2139
2324
  }
2140
2325
  removeRemote(t) {
2141
2326
  try {
2142
- const { host: r } = this, { name: s } = t, l = r.options.remotes.findIndex((i) => i.name === s);
2143
- l !== -1 && r.options.remotes.splice(l, 1);
2144
- const a = r.moduleCache.get(t.name);
2327
+ const { host: o } = this, { name: s } = t, l = o.options.remotes.findIndex((i) => i.name === s);
2328
+ l !== -1 && o.options.remotes.splice(l, 1);
2329
+ const a = o.moduleCache.get(t.name);
2145
2330
  if (a) {
2146
2331
  const i = a.remoteInfo, c = i.entryGlobalName;
2147
2332
  if (CurrentGlobal[c]) {
2148
- var o;
2149
- (o = Object.getOwnPropertyDescriptor(CurrentGlobal, c)) != null && o.configurable ? delete CurrentGlobal[c] : CurrentGlobal[c] = void 0;
2333
+ var n;
2334
+ (n = Object.getOwnPropertyDescriptor(CurrentGlobal, c)) != null && n.configurable ? delete CurrentGlobal[c] : CurrentGlobal[c] = void 0;
2150
2335
  }
2151
2336
  const u = getRemoteEntryUniqueKey(a.remoteInfo);
2152
- globalLoading[u] && delete globalLoading[u], r.snapshotHandler.manifestCache.delete(i.entry);
2337
+ globalLoading[u] && delete globalLoading[u], o.snapshotHandler.manifestCache.delete(i.entry);
2153
2338
  let d = i.buildVersion ? composeKeyWithSeparator(i.name, i.buildVersion) : i.name;
2154
- const m = CurrentGlobal.__FEDERATION__.__INSTANCES__.findIndex((y) => i.buildVersion ? y.options.id === d : y.name === d);
2155
- if (m !== -1) {
2156
- const y = CurrentGlobal.__FEDERATION__.__INSTANCES__[m];
2339
+ const p = CurrentGlobal.__FEDERATION__.__INSTANCES__.findIndex((y) => i.buildVersion ? y.options.id === d : y.name === d);
2340
+ if (p !== -1) {
2341
+ const y = CurrentGlobal.__FEDERATION__.__INSTANCES__[p];
2157
2342
  d = y.options.id || d;
2158
- const g = getGlobalShareScope();
2343
+ const _ = getGlobalShareScope();
2159
2344
  let E = !0;
2160
- const _ = [];
2161
- Object.keys(g).forEach((b) => {
2162
- const v = g[b];
2163
- v && Object.keys(v).forEach((I) => {
2164
- const S = v[I];
2165
- S && Object.keys(S).forEach((R) => {
2166
- const $ = S[R];
2167
- $ && Object.keys($).forEach((T) => {
2168
- const A = $[T];
2169
- A && typeof A == "object" && A.from === i.name && (A.loaded || A.loading ? (A.useIn = A.useIn.filter((w) => w !== i.name), A.useIn.length ? E = !1 : _.push([
2345
+ const g = [];
2346
+ Object.keys(_).forEach((b) => {
2347
+ const S = _[b];
2348
+ S && Object.keys(S).forEach((v) => {
2349
+ const I = S[v];
2350
+ I && Object.keys(I).forEach((R) => {
2351
+ const $ = I[R];
2352
+ $ && Object.keys($).forEach((w) => {
2353
+ const O = $[w];
2354
+ O && typeof O == "object" && O.from === i.name && (O.loaded || O.loading ? (O.useIn = O.useIn.filter((T) => T !== i.name), O.useIn.length ? E = !1 : g.push([
2170
2355
  b,
2171
- I,
2356
+ v,
2172
2357
  R,
2173
- T
2174
- ])) : _.push([
2358
+ w
2359
+ ])) : g.push([
2175
2360
  b,
2176
- I,
2361
+ v,
2177
2362
  R,
2178
- T
2363
+ w
2179
2364
  ]));
2180
2365
  });
2181
2366
  });
2182
2367
  });
2183
- }), E && (y.shareScopeMap = {}, delete g[d]), _.forEach(([b, v, I, S]) => {
2184
- var R, $, T;
2185
- (T = g[b]) == null || ($ = T[v]) == null || (R = $[I]) == null || delete R[S];
2186
- }), CurrentGlobal.__FEDERATION__.__INSTANCES__.splice(m, 1);
2368
+ }), E && (y.shareScopeMap = {}, delete _[d]), g.forEach(([b, S, v, I]) => {
2369
+ var R, $, w;
2370
+ (w = _[b]) == null || ($ = w[S]) == null || (R = $[v]) == null || delete R[I];
2371
+ }), CurrentGlobal.__FEDERATION__.__INSTANCES__.splice(p, 1);
2187
2372
  }
2188
- const { hostGlobalSnapshot: p } = getGlobalRemoteInfo(t, r);
2189
- if (p) {
2190
- const y = p && "remotesInfo" in p && p.remotesInfo && getInfoWithoutType(p.remotesInfo, t.name).key;
2191
- y && (delete p.remotesInfo[y], Global.__FEDERATION__.__MANIFEST_LOADING__[y] && delete Global.__FEDERATION__.__MANIFEST_LOADING__[y]);
2373
+ const { hostGlobalSnapshot: m } = getGlobalRemoteInfo(t, o);
2374
+ if (m) {
2375
+ const y = m && "remotesInfo" in m && m.remotesInfo && getInfoWithoutType(m.remotesInfo, t.name).key;
2376
+ y && (delete m.remotesInfo[y], Global.__FEDERATION__.__MANIFEST_LOADING__[y] && delete Global.__FEDERATION__.__MANIFEST_LOADING__[y]);
2192
2377
  }
2193
- r.moduleCache.delete(t.name);
2378
+ o.moduleCache.delete(t.name);
2194
2379
  }
2195
- } catch (r) {
2196
- logger.log("removeRemote fail: ", r);
2380
+ } catch (o) {
2381
+ logger.log("removeRemote fail: ", o);
2197
2382
  }
2198
2383
  }
2199
2384
  constructor(t) {
@@ -2215,57 +2400,57 @@ class RemoteHandler {
2215
2400
  class FederationHost {
2216
2401
  initOptions(t) {
2217
2402
  this.registerPlugins(t.plugins);
2218
- const o = this.formatOptions(this.options, t);
2219
- return this.options = o, o;
2403
+ const n = this.formatOptions(this.options, t);
2404
+ return this.options = n, n;
2220
2405
  }
2221
- async loadShare(t, o) {
2222
- return this.sharedHandler.loadShare(t, o);
2406
+ async loadShare(t, n) {
2407
+ return this.sharedHandler.loadShare(t, n);
2223
2408
  }
2224
2409
  // The lib function will only be available if the shared set by eager or runtime init is set or the shared is successfully loaded.
2225
2410
  // 1. If the loaded shared already exists globally, then it will be reused
2226
2411
  // 2. If lib exists in local shared, it will be used directly
2227
2412
  // 3. If the local get returns something other than Promise, then it will be used directly
2228
- loadShareSync(t, o) {
2229
- return this.sharedHandler.loadShareSync(t, o);
2413
+ loadShareSync(t, n) {
2414
+ return this.sharedHandler.loadShareSync(t, n);
2230
2415
  }
2231
- initializeSharing(t = DEFAULT_SCOPE, o) {
2232
- return this.sharedHandler.initializeSharing(t, o);
2416
+ initializeSharing(t = DEFAULT_SCOPE, n) {
2417
+ return this.sharedHandler.initializeSharing(t, n);
2233
2418
  }
2234
- initRawContainer(t, o, r) {
2419
+ initRawContainer(t, n, o) {
2235
2420
  const s = getRemoteInfo({
2236
2421
  name: t,
2237
- entry: o
2422
+ entry: n
2238
2423
  }), l = new Module({
2239
2424
  host: this,
2240
2425
  remoteInfo: s
2241
2426
  });
2242
- return l.remoteEntryExports = r, this.moduleCache.set(t, l), l;
2427
+ return l.remoteEntryExports = o, this.moduleCache.set(t, l), l;
2243
2428
  }
2244
2429
  // eslint-disable-next-line max-lines-per-function
2245
2430
  // eslint-disable-next-line @typescript-eslint/member-ordering
2246
- async loadRemote(t, o) {
2247
- return this.remoteHandler.loadRemote(t, o);
2431
+ async loadRemote(t, n) {
2432
+ return this.remoteHandler.loadRemote(t, n);
2248
2433
  }
2249
2434
  // eslint-disable-next-line @typescript-eslint/member-ordering
2250
2435
  async preloadRemote(t) {
2251
2436
  return this.remoteHandler.preloadRemote(t);
2252
2437
  }
2253
- initShareScopeMap(t, o, r = {}) {
2254
- this.sharedHandler.initShareScopeMap(t, o, r);
2438
+ initShareScopeMap(t, n, o = {}) {
2439
+ this.sharedHandler.initShareScopeMap(t, n, o);
2255
2440
  }
2256
- formatOptions(t, o) {
2257
- const { shared: r } = formatShareConfigs(t, o), { userOptions: s, options: l } = this.hooks.lifecycle.beforeInit.emit({
2441
+ formatOptions(t, n) {
2442
+ const { shared: o } = formatShareConfigs(t, n), { userOptions: s, options: l } = this.hooks.lifecycle.beforeInit.emit({
2258
2443
  origin: this,
2259
- userOptions: o,
2444
+ userOptions: n,
2260
2445
  options: t,
2261
- shareInfo: r
2446
+ shareInfo: o
2262
2447
  }), a = this.remoteHandler.formatAndRegisterRemote(l, s), { shared: i } = this.sharedHandler.registerShared(l, s), c = [
2263
2448
  ...l.plugins
2264
2449
  ];
2265
2450
  s.plugins && s.plugins.forEach((d) => {
2266
2451
  c.includes(d) || c.push(d);
2267
2452
  });
2268
- const u = _extends$1({}, t, o, {
2453
+ const u = _extends$1({}, t, n, {
2269
2454
  plugins: c,
2270
2455
  remotes: a,
2271
2456
  shared: i
@@ -2276,7 +2461,7 @@ class FederationHost {
2276
2461
  }), u;
2277
2462
  }
2278
2463
  registerPlugins(t) {
2279
- const o = registerPlugins(t, [
2464
+ const n = registerPlugins(t, [
2280
2465
  this.hooks,
2281
2466
  this.remoteHandler.hooks,
2282
2467
  this.sharedHandler.hooks,
@@ -2284,10 +2469,10 @@ class FederationHost {
2284
2469
  this.loaderHook,
2285
2470
  this.bridgeHook
2286
2471
  ]);
2287
- this.options.plugins = this.options.plugins.reduce((r, s) => (s && r && !r.find((l) => l.name === s.name) && r.push(s), r), o || []);
2472
+ this.options.plugins = this.options.plugins.reduce((o, s) => (s && o && !o.find((l) => l.name === s.name) && o.push(s), o), n || []);
2288
2473
  }
2289
- registerRemotes(t, o) {
2290
- return this.remoteHandler.registerRemotes(t, o);
2474
+ registerRemotes(t, n) {
2475
+ return this.remoteHandler.registerRemotes(t, n);
2291
2476
  }
2292
2477
  constructor(t) {
2293
2478
  this.hooks = new PluginSystem({
@@ -2311,7 +2496,7 @@ class FederationHost {
2311
2496
  beforeBridgeDestroy: new SyncHook(),
2312
2497
  afterBridgeDestroy: new SyncHook()
2313
2498
  });
2314
- const o = {
2499
+ const n = {
2315
2500
  id: getBuilderId(),
2316
2501
  name: t.name,
2317
2502
  plugins: [
@@ -2322,10 +2507,10 @@ class FederationHost {
2322
2507
  shared: {},
2323
2508
  inBrowser: isBrowserEnv()
2324
2509
  };
2325
- this.name = t.name, this.options = o, this.snapshotHandler = new SnapshotHandler(this), this.sharedHandler = new SharedHandler(this), this.remoteHandler = new RemoteHandler(this), this.shareScopeMap = this.sharedHandler.shareScopeMap, this.registerPlugins([
2326
- ...o.plugins,
2510
+ this.name = t.name, this.options = n, this.snapshotHandler = new SnapshotHandler(this), this.sharedHandler = new SharedHandler(this), this.remoteHandler = new RemoteHandler(this), this.shareScopeMap = this.sharedHandler.shareScopeMap, this.registerPlugins([
2511
+ ...n.plugins,
2327
2512
  ...t.plugins || []
2328
- ]), this.options = this.formatOptions(o, t);
2513
+ ]), this.options = this.formatOptions(n, t);
2329
2514
  }
2330
2515
  }
2331
2516
  let FederationInstance = null;
@@ -2333,45 +2518,45 @@ function getInstance() {
2333
2518
  return FederationInstance;
2334
2519
  }
2335
2520
  setGlobalFederationConstructor(FederationHost);
2336
- function createBridgeComponent(n) {
2337
- const t = /* @__PURE__ */ new Map(), o = getInstance();
2521
+ function createBridgeComponent(r) {
2522
+ const t = /* @__PURE__ */ new Map(), n = getInstance();
2338
2523
  return () => ({
2339
2524
  __APP_VERSION__: "0.9.0",
2340
- async render(r) {
2341
- var y, g, E;
2342
- LoggerInstance.debug("createBridgeComponent render Info", r);
2343
- const { moduleName: s, dom: l, basename: a, memoryRoute: i, ...c } = r, u = Vue.createApp(n.rootComponent, c);
2344
- t.set(r.dom, u);
2345
- const d = await ((E = (g = (y = o == null ? void 0 : o.bridgeHook) == null ? void 0 : y.lifecycle) == null ? void 0 : g.beforeBridgeRender) == null ? void 0 : E.emit(r)), m = d && typeof d == "object" && (d != null && d.extraProps) ? d == null ? void 0 : d.extraProps : {}, p = n.appOptions({
2525
+ async render(o) {
2526
+ var y, _, E;
2527
+ LoggerInstance.debug("createBridgeComponent render Info", o);
2528
+ const { moduleName: s, dom: l, basename: a, memoryRoute: i, ...c } = o, u = Vue.createApp(r.rootComponent, c);
2529
+ t.set(o.dom, u);
2530
+ const d = await ((E = (_ = (y = n == null ? void 0 : n.bridgeHook) == null ? void 0 : y.lifecycle) == null ? void 0 : _.beforeBridgeRender) == null ? void 0 : E.emit(o)), p = d && typeof d == "object" && (d != null && d.extraProps) ? d == null ? void 0 : d.extraProps : {}, m = r.appOptions({
2346
2531
  app: u,
2347
2532
  basename: a,
2348
2533
  memoryRoute: i,
2349
2534
  ...c,
2350
- ...m
2535
+ ...p
2351
2536
  });
2352
- if (p != null && p.router) {
2353
- const _ = r.memoryRoute ? VueRouter.createMemoryHistory(r.basename) : VueRouter.createWebHistory(r.basename), b = VueRouter.createRouter({
2354
- ...p.router.options,
2355
- history: _,
2356
- routes: p.router.getRoutes()
2537
+ if (m != null && m.router) {
2538
+ const g = o.memoryRoute ? VueRouter.createMemoryHistory(o.basename) : VueRouter.createWebHistory(o.basename), b = VueRouter.createRouter({
2539
+ ...m.router.options,
2540
+ history: g,
2541
+ routes: m.router.getRoutes()
2357
2542
  });
2358
2543
  LoggerInstance.log("createBridgeComponent render router info>>>", {
2359
- name: r.moduleName,
2544
+ name: o.moduleName,
2360
2545
  router: b
2361
- }), r.memoryRoute && await b.push(r.memoryRoute.entryPath), u.use(b);
2546
+ }), o.memoryRoute && await b.push(o.memoryRoute.entryPath), u.use(b);
2362
2547
  }
2363
- u.mount(r.dom);
2548
+ u.mount(o.dom);
2364
2549
  },
2365
- destroy(r) {
2366
- LoggerInstance.debug("createBridgeComponent destroy Info", r);
2367
- const s = t.get(r == null ? void 0 : r.dom);
2550
+ destroy(o) {
2551
+ LoggerInstance.debug("createBridgeComponent destroy Info", o);
2552
+ const s = t.get(o == null ? void 0 : o.dom);
2368
2553
  s == null || s.unmount();
2369
2554
  }
2370
2555
  });
2371
2556
  }
2372
2557
  function e() {
2373
- const n = new PopStateEvent("popstate", { state: window.history.state });
2374
- window.dispatchEvent(n);
2558
+ const r = new PopStateEvent("popstate", { state: window.history.state });
2559
+ window.dispatchEvent(r);
2375
2560
  }
2376
2561
  const RemoteApp = /* @__PURE__ */ defineComponent({
2377
2562
  name: "RemoteApp",
@@ -2381,34 +2566,34 @@ const RemoteApp = /* @__PURE__ */ defineComponent({
2381
2566
  memoryRoute: Object,
2382
2567
  providerInfo: Function
2383
2568
  },
2384
- setup(n) {
2385
- const t = ref(null), o = ref(null), r = ref(""), s = useRoute(), l = () => {
2569
+ setup(r) {
2570
+ const t = ref(null), n = ref(null), o = ref(""), s = useRoute(), l = () => {
2386
2571
  var d;
2387
- const i = (d = n.providerInfo) == null ? void 0 : d.call(n);
2388
- o.value = i;
2572
+ const i = (d = r.providerInfo) == null ? void 0 : d.call(r);
2573
+ n.value = i;
2389
2574
  let c = {
2390
- name: n.moduleName,
2575
+ name: r.moduleName,
2391
2576
  dom: t.value,
2392
- basename: n.basename,
2393
- memoryRoute: n.memoryRoute
2577
+ basename: r.basename,
2578
+ memoryRoute: r.memoryRoute
2394
2579
  };
2395
2580
  LoggerInstance.debug("createRemoteComponent LazyComponent render >>>", c), c = {
2396
2581
  ...c,
2397
2582
  ...{}.extraProps
2398
2583
  }, i.render(c);
2399
2584
  }, a = watch(() => s.path, (i) => {
2400
- i !== s.path && l(), r.value !== "" && r.value !== i && (LoggerInstance.debug("createRemoteComponent dispatchPopstateEnv >>>", {
2401
- ...n,
2585
+ i !== s.path && l(), o.value !== "" && o.value !== i && (LoggerInstance.debug("createRemoteComponent dispatchPopstateEnv >>>", {
2586
+ ...r,
2402
2587
  pathname: s.path
2403
- }), e()), r.value = i;
2588
+ }), e()), o.value = i;
2404
2589
  });
2405
2590
  return onMounted(() => {
2406
2591
  l();
2407
2592
  }), onBeforeUnmount(() => {
2408
2593
  var i;
2409
2594
  LoggerInstance.debug("createRemoteComponent LazyComponent destroy >>>", {
2410
- ...n
2411
- }), a(), (i = o.value) == null || i.destroy({
2595
+ ...r
2596
+ }), a(), (i = n.value) == null || i.destroy({
2412
2597
  dom: t.value
2413
2598
  });
2414
2599
  }), () => createVNode("div", {
@@ -2416,33 +2601,33 @@ const RemoteApp = /* @__PURE__ */ defineComponent({
2416
2601
  }, null);
2417
2602
  }
2418
2603
  });
2419
- function createRemoteComponent(n) {
2604
+ function createRemoteComponent(r) {
2420
2605
  return defineAsyncComponent({
2421
2606
  __APP_VERSION__: "0.9.0",
2422
- ...n.asyncComponentOptions,
2607
+ ...r.asyncComponentOptions,
2423
2608
  //@ts-ignore
2424
2609
  loader: async () => {
2425
2610
  var c;
2426
2611
  const t = useRoute();
2427
- let o = "/";
2428
- const r = (c = t.matched[0]) == null ? void 0 : c.path;
2429
- r && (r.endsWith("/:pathMatch(.*)*") ? o = r.replace("/:pathMatch(.*)*", "") : o = t.matched[0].path);
2430
- const s = (n == null ? void 0 : n.export) || "default";
2612
+ let n = "/";
2613
+ const o = (c = t.matched[0]) == null ? void 0 : c.path;
2614
+ o && (o.endsWith("/:pathMatch(.*)*") ? n = o.replace("/:pathMatch(.*)*", "") : n = t.matched[0].path);
2615
+ const s = (r == null ? void 0 : r.export) || "default";
2431
2616
  LoggerInstance.debug("createRemoteComponent LazyComponent create >>>", {
2432
- basename: o,
2433
- info: n
2617
+ basename: n,
2618
+ info: r
2434
2619
  });
2435
- const l = await n.loader(), a = l && l[Symbol.for("mf_module_id")], i = l[s];
2620
+ const l = await r.loader(), a = l && l[Symbol.for("mf_module_id")], i = l[s];
2436
2621
  if (LoggerInstance.debug(
2437
2622
  "createRemoteComponent LazyComponent loadRemote info >>>",
2438
- { name: a, module: l, exportName: s, basename: o, route: t }
2623
+ { name: a, module: l, exportName: s, basename: n, route: t }
2439
2624
  ), s in l && typeof i == "function")
2440
2625
  return {
2441
2626
  render() {
2442
2627
  return h(RemoteApp, {
2443
2628
  moduleName: a,
2444
2629
  providerInfo: i,
2445
- basename: o
2630
+ basename: n
2446
2631
  });
2447
2632
  }
2448
2633
  };