@apocaliss92/addon-series-scraper 0.0.0-stage → 0.1.21

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