UNPKG

starknetkit

Version:

<!-- logo --> <p align="center"> <img width='300' src="https://starknetkit-website-git-blo-1541-argentlabs.vercel.app/starknetKit-logo.svg"> </p>

1,466 lines (1,461 loc) 134 kB
var te = Object.defineProperty, re = (t, e, o) => e in t ? te(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o, O = (t, e, o) => (re(t, typeof e != "symbol" ? e + "" : e, o), o), Z = (t, e, o) => { if (!e.has(t)) throw TypeError("Cannot " + o); }, v = (t, e, o) => (Z(t, e, "read from private field"), o ? o.call(t) : e.get(t)), L = (t, e, o) => { if (e.has(t)) throw TypeError("Cannot add the same private member more than once"); e instanceof WeakSet ? e.add(t) : e.set(t, o); }, G = (t, e, o, r) => (Z(t, e, "write to private field"), r ? r.call(t, o) : e.set(t, o), o), _ = (t, e, o) => (Z(t, e, "access private method"), o); const generateUID = () => `${Date.now()}-${Math.floor(Math.random() * 8999999999999) + 1e12}`, shuffle = (t) => { for (let e = t.length - 1; e > 0; e--) { const o = Math.floor(Math.random() * (e + 1)); [t[e], t[o]] = [t[o], t[e]]; } return t; }, pipe$1 = (...t) => (e) => t.reduce((o, r) => o.then(r), Promise.resolve(e)); function ensureKeysArray(t) { return Object.keys(t); } const ssrSafeWindow = typeof window < "u" ? window : null; function getBuilderId() { return typeof FEDERATION_BUILD_IDENTIFIER < "u" ? FEDERATION_BUILD_IDENTIFIER : ""; } function isDebugMode$1() { return !!""; } function isBrowserEnv$1() { return typeof window < "u"; } const LOG_CATEGORY$1 = "[ Federation Runtime ]"; function assert(t, e) { t || error(e); } function error(t) { throw t instanceof Error ? (t.message = `${LOG_CATEGORY$1}: ${t.message}`, t) : new Error(`${LOG_CATEGORY$1}: ${t}`); } function warn$1(t) { t instanceof Error ? (t.message = `${LOG_CATEGORY$1}: ${t.message}`, console.warn(t)) : console.warn(`${LOG_CATEGORY$1}: ${t}`); } function addUniqueItem(t, e) { return t.findIndex((o) => o === e) === -1 && t.push(e), t; } function getFMId(t) { return "version" in t && t.version ? `${t.name}:${t.version}` : "entry" in t && t.entry ? `${t.name}:${t.entry}` : `${t.name}`; } function isRemoteInfoWithEntry(t) { return typeof t.entry < "u"; } function isPureRemoteEntry(t) { return !t.entry.includes(".json") && t.entry.includes(".js"); } function safeToString$1(t) { try { return JSON.stringify(t, null, 2); } catch { return ""; } } function isObject(t) { return t && typeof t == "object"; } const objectToString = Object.prototype.toString; function isPlainObject(t) { return objectToString.call(t) === "[object Object]"; } function arrayOptions(t) { return Array.isArray(t) ? t : [ t ]; } function _extends$1$1() { return _extends$1$1 = Object.assign || function(t) { for (var e = 1; e < arguments.length; e++) { var o = arguments[e]; for (var r in o) Object.prototype.hasOwnProperty.call(o, r) && (t[r] = o[r]); } return t; }, _extends$1$1.apply(this, arguments); } function _object_without_properties_loose$1(t, e) { if (t == null) return {}; var o = {}, r = Object.keys(t), n, a; for (a = 0; a < r.length; a++) n = r[a], !(e.indexOf(n) >= 0) && (o[n] = t[n]); return o; } const nativeGlobal = (() => { try { return new Function("return this")(); } catch { return globalThis; } })(), Global = nativeGlobal; function definePropertyGlobalVal(t, e, o) { Object.defineProperty(t, e, { value: o, configurable: !1, writable: !0 }); } function includeOwnProperty(t, e) { return Object.hasOwnProperty.call(t, e); } includeOwnProperty(globalThis, "__GLOBAL_LOADING_REMOTE_ENTRY__") || definePropertyGlobalVal(globalThis, "__GLOBAL_LOADING_REMOTE_ENTRY__", {}); const globalLoading = globalThis.__GLOBAL_LOADING_REMOTE_ENTRY__; function setGlobalDefaultVal(t) { var e, o, r, n, a, i; includeOwnProperty(t, "__VMOK__") && !includeOwnProperty(t, "__FEDERATION__") && definePropertyGlobalVal(t, "__FEDERATION__", t.__VMOK__), includeOwnProperty(t, "__FEDERATION__") || (definePropertyGlobalVal(t, "__FEDERATION__", { __GLOBAL_PLUGIN__: [], __INSTANCES__: [], moduleInfo: {}, __SHARE__: {}, __MANIFEST_LOADING__: {}, __PRELOADED_MAP__: /* @__PURE__ */ new Map() }), definePropertyGlobalVal(t, "__VMOK__", t.__FEDERATION__)), (e = t.__FEDERATION__).__GLOBAL_PLUGIN__ != null || (e.__GLOBAL_PLUGIN__ = []), (o = t.__FEDERATION__).__INSTANCES__ != null || (o.__INSTANCES__ = []), (r = t.__FEDERATION__).moduleInfo != null || (r.moduleInfo = {}), (n = t.__FEDERATION__).__SHARE__ != null || (n.__SHARE__ = {}), (a = t.__FEDERATION__).__MANIFEST_LOADING__ != null || (a.__MANIFEST_LOADING__ = {}), (i = t.__FEDERATION__).__PRELOADED_MAP__ != null || (i.__PRELOADED_MAP__ = /* @__PURE__ */ new Map()); } setGlobalDefaultVal(globalThis); setGlobalDefaultVal(nativeGlobal); function getGlobalFederationInstance(t, e) { const o = getBuilderId(); return globalThis.__FEDERATION__.__INSTANCES__.find((r) => !!(o && r.options.id === getBuilderId() || r.options.name === t && !r.options.version && !e || r.options.name === t && e && r.options.version === e)); } function setGlobalFederationInstance(t) { globalThis.__FEDERATION__.__INSTANCES__.push(t); } function getGlobalFederationConstructor() { return globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR__; } function setGlobalFederationConstructor(t, e = isDebugMode$1()) { e && (globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = t, globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.1.21"); } function getInfoWithoutType(t, e) { if (typeof e == "string") { if (t[e]) return { value: t[e], key: e }; { const o = Object.keys(t); for (const r of o) { const [n, a] = r.split(":"), i = `${n}:${e}`, s = t[i]; if (s) return { value: s, key: i }; } return { value: void 0, key: e }; } } else throw new Error("key must be string"); } const getGlobalSnapshot = () => nativeGlobal.__FEDERATION__.moduleInfo, getTargetSnapshotInfoByModuleInfo = (t, e) => { const o = getFMId(t), r = getInfoWithoutType(e, o).value; if (r && !r.version && "version" in t && t.version && (r.version = t.version), r) return r; if ("version" in t && t.version) { const { version: n } = t, a = _object_without_properties_loose$1(t, [ "version" ]), i = getFMId(a), s = getInfoWithoutType(nativeGlobal.__FEDERATION__.moduleInfo, i).value; if (s?.version === n) return s; } }, getGlobalSnapshotInfoByModuleInfo = (t) => getTargetSnapshotInfoByModuleInfo(t, nativeGlobal.__FEDERATION__.moduleInfo), setGlobalSnapshotInfoByModuleInfo = (t, e) => { const o = getFMId(t); return nativeGlobal.__FEDERATION__.moduleInfo[o] = e, nativeGlobal.__FEDERATION__.moduleInfo; }, addGlobalSnapshot = (t) => (nativeGlobal.__FEDERATION__.moduleInfo = _extends$1$1({}, nativeGlobal.__FEDERATION__.moduleInfo, t), () => { const e = Object.keys(t); for (const o of e) delete nativeGlobal.__FEDERATION__.moduleInfo[o]; }), getRemoteEntryExports = (t, e) => { const o = e || `__FEDERATION_${t}:custom__`, r = globalThis[o]; return { remoteEntryKey: o, entryExports: r }; }, getGlobalHostPlugins = () => nativeGlobal.__FEDERATION__.__GLOBAL_PLUGIN__, getPreloaded = (t) => globalThis.__FEDERATION__.__PRELOADED_MAP__.get(t), setPreloaded = (t) => globalThis.__FEDERATION__.__PRELOADED_MAP__.set(t, !0), DEFAULT_SCOPE = "default", DEFAULT_REMOTE_TYPE = "global", buildIdentifier = "[0-9A-Za-z-]+", build = `(?:\\+(${buildIdentifier}(?:\\.${buildIdentifier})*))`, numericIdentifier = "0|[1-9]\\d*", numericIdentifierLoose = "[0-9]+", nonNumericIdentifier = "\\d*[a-zA-Z-][a-zA-Z0-9-]*", preReleaseIdentifierLoose = `(?:${numericIdentifierLoose}|${nonNumericIdentifier})`, preReleaseLoose = `(?:-?(${preReleaseIdentifierLoose}(?:\\.${preReleaseIdentifierLoose})*))`, preReleaseIdentifier = `(?:${numericIdentifier}|${nonNumericIdentifier})`, preRelease = `(?:-(${preReleaseIdentifier}(?:\\.${preReleaseIdentifier})*))`, xRangeIdentifier = `${numericIdentifier}|x|X|\\*`, xRangePlain = `[v=\\s]*(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:${preRelease})?${build}?)?)?`, hyphenRange = `^\\s*(${xRangePlain})\\s+-\\s+(${xRangePlain})\\s*$`, mainVersionLoose = `(${numericIdentifierLoose})\\.(${numericIdentifierLoose})\\.(${numericIdentifierLoose})`, loosePlain = `[v=\\s]*${mainVersionLoose}${preReleaseLoose}?${build}?`, gtlt = "((?:<|>)?=?)", comparatorTrim = `(\\s*)${gtlt}\\s*(${loosePlain}|${xRangePlain})`, loneTilde = "(?:~>?)", tildeTrim = `(\\s*)${loneTilde}\\s+`, loneCaret = "(?:\\^)", caretTrim = `(\\s*)${loneCaret}\\s+`, star = "(<|>)?=?\\s*\\*", caret = `^${loneCaret}${xRangePlain}$`, mainVersion = `(${numericIdentifier})\\.(${numericIdentifier})\\.(${numericIdentifier})`, fullPlain = `v?${mainVersion}${preRelease}?${build}?`, tilde = `^${loneTilde}${xRangePlain}$`, xRange = `^${gtlt}\\s*${xRangePlain}$`, comparator = `^${gtlt}\\s*(${fullPlain})$|^$`, gte0 = "^\\s*>=\\s*0.0.0\\s*$"; function parseRegex(t) { return new RegExp(t); } function isXVersion(t) { return !t || t.toLowerCase() === "x" || t === "*"; } function pipe(...t) { return (e) => t.reduce((o, r) => r(o), e); } function extractComparator(t) { return t.match(parseRegex(comparator)); } function combineVersion(t, e, o, r) { const n = `${t}.${e}.${o}`; return r ? `${n}-${r}` : n; } function parseHyphen(t) { return t.replace(parseRegex(hyphenRange), (e, o, r, n, a, i, s, c, l, u, h, d) => (isXVersion(r) ? o = "" : isXVersion(n) ? o = `>=${r}.0.0` : isXVersion(a) ? o = `>=${r}.${n}.0` : o = `>=${o}`, isXVersion(l) ? c = "" : isXVersion(u) ? c = `<${Number(l) + 1}.0.0-0` : isXVersion(h) ? c = `<${l}.${Number(u) + 1}.0-0` : d ? c = `<=${l}.${u}.${h}-${d}` : c = `<=${c}`, `${o} ${c}`.trim())); } function parseComparatorTrim(t) { return t.replace(parseRegex(comparatorTrim), "$1$2$3"); } function parseTildeTrim(t) { return t.replace(parseRegex(tildeTrim), "$1~"); } function parseCaretTrim(t) { return t.replace(parseRegex(caretTrim), "$1^"); } function parseCarets(t) { return t.trim().split(/\s+/).map((e) => e.replace(parseRegex(caret), (o, r, n, a, i) => isXVersion(r) ? "" : isXVersion(n) ? `>=${r}.0.0 <${Number(r) + 1}.0.0-0` : isXVersion(a) ? r === "0" ? `>=${r}.${n}.0 <${r}.${Number(n) + 1}.0-0` : `>=${r}.${n}.0 <${Number(r) + 1}.0.0-0` : i ? r === "0" ? n === "0" ? `>=${r}.${n}.${a}-${i} <${r}.${n}.${Number(a) + 1}-0` : `>=${r}.${n}.${a}-${i} <${r}.${Number(n) + 1}.0-0` : `>=${r}.${n}.${a}-${i} <${Number(r) + 1}.0.0-0` : r === "0" ? n === "0" ? `>=${r}.${n}.${a} <${r}.${n}.${Number(a) + 1}-0` : `>=${r}.${n}.${a} <${r}.${Number(n) + 1}.0-0` : `>=${r}.${n}.${a} <${Number(r) + 1}.0.0-0`)).join(" "); } function parseTildes(t) { return t.trim().split(/\s+/).map((e) => e.replace(parseRegex(tilde), (o, r, n, a, i) => isXVersion(r) ? "" : isXVersion(n) ? `>=${r}.0.0 <${Number(r) + 1}.0.0-0` : isXVersion(a) ? `>=${r}.${n}.0 <${r}.${Number(n) + 1}.0-0` : i ? `>=${r}.${n}.${a}-${i} <${r}.${Number(n) + 1}.0-0` : `>=${r}.${n}.${a} <${r}.${Number(n) + 1}.0-0`)).join(" "); } function parseXRanges(t) { return t.split(/\s+/).map((e) => e.trim().replace(parseRegex(xRange), (o, r, n, a, i, s) => { const c = isXVersion(n), l = c || isXVersion(a), u = l || isXVersion(i); return r === "=" && u && (r = ""), s = "", c ? r === ">" || r === "<" ? "<0.0.0-0" : "*" : r && u ? (l && (a = 0), i = 0, r === ">" ? (r = ">=", l ? (n = Number(n) + 1, a = 0, i = 0) : (a = Number(a) + 1, i = 0)) : r === "<=" && (r = "<", l ? n = Number(n) + 1 : a = Number(a) + 1), r === "<" && (s = "-0"), `${r + n}.${a}.${i}${s}`) : l ? `>=${n}.0.0${s} <${Number(n) + 1}.0.0-0` : u ? `>=${n}.${a}.0${s} <${n}.${Number(a) + 1}.0-0` : o; })).join(" "); } function parseStar(t) { return t.trim().replace(parseRegex(star), ""); } function parseGTE0(t) { return t.trim().replace(parseRegex(gte0), ""); } function compareAtom(t, e) { return t = Number(t) || t, e = Number(e) || e, t > e ? 1 : t === e ? 0 : -1; } function comparePreRelease(t, e) { const { preRelease: o } = t, { preRelease: r } = e; if (o === void 0 && r) return 1; if (o && r === void 0) return -1; if (o === void 0 && r === void 0) return 0; for (let n = 0, a = o.length; n <= a; n++) { const i = o[n], s = r[n]; if (i !== s) return i === void 0 && s === void 0 ? 0 : i ? s ? compareAtom(i, s) : -1 : 1; } return 0; } function compareVersion(t, e) { return compareAtom(t.major, e.major) || compareAtom(t.minor, e.minor) || compareAtom(t.patch, e.patch) || comparePreRelease(t, e); } function eq(t, e) { return t.version === e.version; } function compare(t, e) { switch (t.operator) { case "": case "=": return eq(t, e); case ">": return compareVersion(t, e) < 0; case ">=": return eq(t, e) || compareVersion(t, e) < 0; case "<": return compareVersion(t, e) > 0; case "<=": return eq(t, e) || compareVersion(t, e) > 0; case void 0: return !0; default: return !1; } } function parseComparatorString(t) { return pipe( parseCarets, parseTildes, parseXRanges, parseStar )(t); } function parseRange(t) { return pipe( parseHyphen, parseComparatorTrim, parseTildeTrim, parseCaretTrim )(t.trim()).split(/\s+/).join(" "); } function satisfy(t, e) { if (!t) return !1; const o = parseRange(e).split(" ").map((u) => parseComparatorString(u)).join(" ").split(/\s+/).map((u) => parseGTE0(u)), r = extractComparator(t); if (!r) return !1; const [, n, , a, i, s, c] = r, l = { operator: n, version: combineVersion(a, i, s, c), major: a, minor: i, patch: s, preRelease: c?.split(".") }; for (const u of o) { const h = extractComparator(u); if (!h) return !1; const [, d, , m, g, M, y] = h, p = { operator: d, version: combineVersion(m, g, M, y), major: m, minor: g, patch: M, preRelease: y?.split(".") }; if (!compare(p, l)) return !1; } return !0; } function _extends$8() { return _extends$8 = Object.assign || function(t) { for (var e = 1; e < arguments.length; e++) { var o = arguments[e]; for (var r in o) Object.prototype.hasOwnProperty.call(o, r) && (t[r] = o[r]); } return t; }, _extends$8.apply(this, arguments); } function formatShare(t, e, o) { let r; "get" in t ? r = t.get : "lib" in t ? r = () => Promise.resolve(t.lib) : r = () => Promise.resolve(() => { throw new Error(`Can not get shared '${o}'!`); }); var n, a; return _extends$8({ deps: [], useIn: [], from: e, loading: null }, t, { shareConfig: _extends$8({ requiredVersion: `^${t.version}`, singleton: !1, eager: !1, strictVersion: !1 }, t.shareConfig), get: r, loaded: "lib" in t ? !0 : void 0, version: (n = t.version) != null ? n : "0", scope: Array.isArray(t.scope) ? t.scope : [ (a = t.scope) != null ? a : "default" ], strategy: t.strategy || "version-first" }); } function formatShareConfigs(t, e) { const o = e.shared || {}, r = e.name, n = Object.keys(o).reduce((i, s) => { const c = arrayOptions(o[s]); return i[s] = i[s] || [], c.forEach((l) => { i[s].push(formatShare(l, r, s)); }), i; }, {}), a = _extends$8({}, t.shared); return Object.keys(n).forEach((i) => { a[i] ? n[i].forEach((s) => { a[i].find((c) => c.version === s.version) || a[i].push(s); }) : a[i] = n[i]; }), { shared: a, shareInfos: n }; } function versionLt(t, e) { const o = (r) => { if (!Number.isNaN(Number(r))) { const n = r.split("."); let a = r; for (let i = 0; i < 3 - n.length; i++) a += ".0"; return a; } return r; }; return !!satisfy(o(t), `<=${o(e)}`); } const findVersion = (t, e) => { const o = e || function(r, n) { return versionLt(r, n); }; return Object.keys(t).reduce((r, n) => !r || o(r, n) || r === "0" ? n : r, 0); }, isLoaded = (t) => !!t.loaded || typeof t.lib == "function"; function findSingletonVersionOrderByVersion(t, e, o) { const r = t[e][o], n = function(a, i) { return !isLoaded(r[a]) && versionLt(a, i); }; return findVersion(t[e][o], n); } function findSingletonVersionOrderByLoaded(t, e, o) { const r = t[e][o], n = function(a, i) { return isLoaded(r[i]) ? isLoaded(r[a]) ? !!versionLt(a, i) : !0 : isLoaded(r[a]) ? !1 : versionLt(a, i); }; return findVersion(t[e][o], n); } function getFindShareFunction(t) { return t === "loaded-first" ? findSingletonVersionOrderByLoaded : findSingletonVersionOrderByVersion; } function getRegisteredShare(t, e, o, r) { if (!t) return; const { shareConfig: n, scope: a = DEFAULT_SCOPE, strategy: i } = o, s = Array.isArray(a) ? a : [ a ]; for (const c of s) if (n && t[c] && t[c][e]) { const { requiredVersion: l } = n, u = getFindShareFunction(i)(t, c, e), h = () => { if (n.singleton) { if (typeof l == "string" && !satisfy(u, l)) { const m = `Version ${u} from ${u && t[c][e][u].from} of shared singleton module ${e} does not satisfy the requirement of ${o.from} which needs ${l})`; n.strictVersion ? error(m) : warn$1(m); } return t[c][e][u]; } else { if (l === !1 || l === "*" || satisfy(u, l)) return t[c][e][u]; for (const [m, g] of Object.entries(t[c][e])) if (satisfy(m, l)) return g; } }, d = { shareScopeMap: t, scope: c, pkgName: e, version: u, GlobalFederation: Global.__FEDERATION__, resolver: h }; return (r.emit(d) || d).resolver(); } } function getGlobalShareScope() { return Global.__FEDERATION__.__SHARE__; } function getTargetSharedOptions(t) { const { pkgName: e, extraOptions: o, shareInfos: r } = t, n = (s) => { if (!s) return; const c = {}; s.forEach((u) => { c[u.version] = u; }); const l = findVersion(c, function(u, h) { return !isLoaded(c[u]) && versionLt(u, h); }); return c[l]; }; var a; const i = (a = o?.resolver) != null ? a : n; return Object.assign({}, i(r[e]), o?.customShareInfo); } function _define_property$4(t, e, o) { return e in t ? Object.defineProperty(t, e, { value: o, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = o, t; } var MANIFEST_EXT = ".json", BROWSER_LOG_KEY = "FEDERATION_DEBUG", BROWSER_LOG_VALUE = "1", NameTransformSymbol = { AT: "@", HYPHEN: "-", SLASH: "/" }, _obj, NameTransformMap = (_obj = {}, _define_property$4(_obj, NameTransformSymbol.AT, "scope_"), _define_property$4(_obj, NameTransformSymbol.HYPHEN, "_"), _define_property$4(_obj, NameTransformSymbol.SLASH, "__"), _obj), _obj1; _obj1 = {}, _define_property$4(_obj1, NameTransformMap[NameTransformSymbol.AT], NameTransformSymbol.AT), _define_property$4(_obj1, NameTransformMap[NameTransformSymbol.HYPHEN], NameTransformSymbol.HYPHEN), _define_property$4(_obj1, NameTransformMap[NameTransformSymbol.SLASH], NameTransformSymbol.SLASH); var SEPARATOR = ":"; function isBrowserEnv() { return typeof window < "u"; } function isDebugMode() { return typeof process < "u" && process.env && process.env.FEDERATION_DEBUG ? !!process.env.FEDERATION_DEBUG : typeof FEDERATION_DEBUG < "u" && !!FEDERATION_DEBUG; } function _array_like_to_array$2(t, e) { (e == null || e > t.length) && (e = t.length); for (var o = 0, r = new Array(e); o < e; o++) r[o] = t[o]; return r; } function _array_without_holes(t) { if (Array.isArray(t)) return _array_like_to_array$2(t); } function _class_call_check(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(t, e) { for (var o = 0; o < e.length; o++) { var r = e[o]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r); } } function _create_class(t, e, o) { return e && _defineProperties(t.prototype, e), o && _defineProperties(t, o), t; } function _define_property$3(t, e, o) { return e in t ? Object.defineProperty(t, e, { value: o, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = o, t; } function _iterable_to_array$1(t) { if (typeof Symbol < "u" && t[Symbol.iterator] != null || t["@@iterator"] != null) return Array.from(t); } function _non_iterable_spread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _to_consumable_array(t) { return _array_without_holes(t) || _iterable_to_array$1(t) || _unsupported_iterable_to_array$2(t) || _non_iterable_spread(); } function _unsupported_iterable_to_array$2(t, e) { if (t) { if (typeof t == "string") return _array_like_to_array$2(t, e); var o = Object.prototype.toString.call(t).slice(8, -1); if (o === "Object" && t.constructor && (o = t.constructor.name), o === "Map" || o === "Set") return Array.from(o); if (o === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)) return _array_like_to_array$2(t, e); } } function safeToString(t) { try { return JSON.stringify(t, null, 2); } catch { return ""; } } var DEBUG_LOG = "[ FEDERATION DEBUG ]"; function safeGetLocalStorageItem() { try { if (typeof window < "u" && window.localStorage) return localStorage.getItem(BROWSER_LOG_KEY) === BROWSER_LOG_VALUE; } catch { return typeof document < "u"; } return !1; } var Logger = /* @__PURE__ */ function() { function t(e) { _class_call_check(this, t), _define_property$3(this, "enable", !1), _define_property$3(this, "identifier", void 0), this.identifier = e || DEBUG_LOG, isBrowserEnv() && safeGetLocalStorageItem() ? this.enable = !0 : isDebugMode() && (this.enable = !0); } return _create_class(t, [ { key: "info", value: function(e, o) { if (this.enable) { var r = safeToString(o) || ""; isBrowserEnv() ? console.info("%c ".concat(this.identifier, ": ").concat(e, " ").concat(r), "color:#3300CC") : console.info("\x1B[34m%s", "".concat(this.identifier, ": ").concat(e, " ").concat(r ? ` `.concat(r) : "")); } } }, { key: "logOriginalInfo", value: function() { for (var e = arguments.length, o = new Array(e), r = 0; r < e; r++) o[r] = arguments[r]; if (this.enable) if (isBrowserEnv()) { var n; console.info("%c ".concat(this.identifier, ": OriginalInfo"), "color:#3300CC"), (n = console).log.apply(n, _to_consumable_array(o)); } else { var a; console.info("%c ".concat(this.identifier, ": OriginalInfo"), "color:#3300CC"), (a = console).log.apply(a, _to_consumable_array(o)); } } } ]), t; }(), LOG_CATEGORY = "[ Federation Runtime ]"; new Logger(); var composeKeyWithSeparator = function() { for (var t = arguments.length, e = new Array(t), o = 0; o < t; o++) e[o] = arguments[o]; return e.length ? e.reduce(function(r, n) { return n ? r ? "".concat(r).concat(SEPARATOR).concat(n) : n : r; }, "") : ""; }, getResourceUrl = function(t, e) { if ("getPublicPath" in t) { var o = new Function(t.getPublicPath)(); return "".concat(o).concat(e); } else return "publicPath" in t ? "".concat(t.publicPath).concat(e) : (console.warn("Can not get resource url, if in debug mode, please ignore", t, e), ""); }, warn = function(t) { console.warn("".concat(LOG_CATEGORY, ": ").concat(t)); }; function _define_property$2(t, e, o) { return e in t ? Object.defineProperty(t, e, { value: o, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = o, t; } function _object_spread$2(t) { for (var e = 1; e < arguments.length; e++) { var o = arguments[e] != null ? arguments[e] : {}, r = Object.keys(o); typeof Object.getOwnPropertySymbols == "function" && (r = r.concat(Object.getOwnPropertySymbols(o).filter(function(n) { return Object.getOwnPropertyDescriptor(o, n).enumerable; }))), r.forEach(function(n) { _define_property$2(t, n, o[n]); }); } return t; } function ownKeys(t, e) { var o = Object.keys(t); if (Object.getOwnPropertySymbols) { var r = Object.getOwnPropertySymbols(t); e && (r = r.filter(function(n) { return Object.getOwnPropertyDescriptor(t, n).enumerable; })), o.push.apply(o, r); } return o; } function _object_spread_props(t, e) { return e = e ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(e)) : ownKeys(Object(e)).forEach(function(o) { Object.defineProperty(t, o, Object.getOwnPropertyDescriptor(e, o)); }), t; } var simpleJoinRemoteEntry = function(t, e) { if (!t) return e; var o = function(n) { if (n === ".") return ""; if (n.startsWith("./")) return n.replace("./", ""); if (n.startsWith("/")) { var a = n.slice(1); return a.endsWith("/") ? a.slice(0, -1) : a; } return n; }, r = o(t); return r ? r.endsWith("/") ? "".concat(r).concat(e) : "".concat(r, "/").concat(e) : e; }; function inferAutoPublicPath(t) { return t.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); } function generateSnapshotFromManifest(t) { var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, o, r, n = e.remotes, a = n === void 0 ? {} : n, i = e.overrides, s = i === void 0 ? {} : i, c = e.version, l, u = function() { return "publicPath" in t.metaData ? t.metaData.publicPath === "auto" && c ? inferAutoPublicPath(c) : t.metaData.publicPath : t.metaData.getPublicPath; }, h = Object.keys(s), d = {}; if (!Object.keys(a).length) { var m; d = ((m = t.remotes) === null || m === void 0 ? void 0 : m.reduce(function(D, x) { var U, B = x.federationContainerName; return h.includes(B) ? U = s[B] : "version" in x ? U = x.version : U = x.entry, D[B] = { matchedVersion: U }, D; }, {})) || {}; } Object.keys(a).forEach(function(D) { return d[D] = { matchedVersion: h.includes(D) ? s[D] : a[D] }; }); var g = t.metaData, M = g.remoteEntry, y = M.path, p = M.name, I = M.type, A = g.types, b = g.buildInfo.buildVersion, E = g.globalName, S = t.exposes, N = { version: c || "", buildVersion: b, globalName: E, remoteEntry: simpleJoinRemoteEntry(y, p), remoteEntryType: I, remoteTypes: simpleJoinRemoteEntry(A.path, A.name), remoteTypesZip: A.zip || "", remoteTypesAPI: A.api || "", remotesInfo: d, shared: t?.shared.map(function(D) { return { assets: D.assets, sharedName: D.name, version: D.version }; }), modules: S?.map(function(D) { return { moduleName: D.name, modulePath: D.path, assets: D.assets }; }) }; if (!((o = t.metaData) === null || o === void 0) && o.prefetchInterface) { var j = t.metaData.prefetchInterface; N = _object_spread_props(_object_spread$2({}, N), { prefetchInterface: j }); } if (!((r = t.metaData) === null || r === void 0) && r.prefetchEntry) { var w = t.metaData.prefetchEntry, z = w.path, Q = w.name, V = w.type; N = _object_spread_props(_object_spread$2({}, N), { prefetchEntry: simpleJoinRemoteEntry(z, Q), prefetchEntryType: V }); } return "publicPath" in t.metaData ? l = _object_spread_props(_object_spread$2({}, N), { publicPath: u() }) : l = _object_spread_props(_object_spread$2({}, N), { getPublicPath: u() }), l; } function isManifestProvider(t) { return !!("remoteEntry" in t && t.remoteEntry.includes(MANIFEST_EXT)); } function asyncGeneratorStep$1(t, e, o, r, n, a, i) { try { var s = t[a](i), c = s.value; } catch (l) { o(l); return; } s.done ? e(c) : Promise.resolve(c).then(r, n); } function _async_to_generator$1(t) { return function() { var e = this, o = arguments; return new Promise(function(r, n) { var a = t.apply(e, o); function i(c) { asyncGeneratorStep$1(a, r, n, i, s, "next", c); } function s(c) { asyncGeneratorStep$1(a, r, n, i, s, "throw", c); } i(void 0); }); }; } function _define_property$1(t, e, o) { return e in t ? Object.defineProperty(t, e, { value: o, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = o, t; } function _instanceof(t, e) { return e != null && typeof Symbol < "u" && e[Symbol.hasInstance] ? !!e[Symbol.hasInstance](t) : t instanceof e; } function _object_spread$1(t) { for (var e = 1; e < arguments.length; e++) { var o = arguments[e] != null ? arguments[e] : {}, r = Object.keys(o); typeof Object.getOwnPropertySymbols == "function" && (r = r.concat(Object.getOwnPropertySymbols(o).filter(function(n) { return Object.getOwnPropertyDescriptor(o, n).enumerable; }))), r.forEach(function(n) { _define_property$1(t, n, o[n]); }); } return t; } function _type_of$2(t) { return t && typeof Symbol < "u" && t.constructor === Symbol ? "symbol" : typeof t; } function _ts_generator$1(t, e) { var o, r, n, a, i = { label: 0, sent: function() { if (n[0] & 1) throw n[1]; return n[1]; }, trys: [], ops: [] }; return a = { next: s(0), throw: s(1), return: s(2) }, typeof Symbol == "function" && (a[Symbol.iterator] = function() { return this; }), a; function s(l) { return function(u) { return c([ l, u ]); }; } function c(l) { if (o) throw new TypeError("Generator is already executing."); for (; i; ) try { if (o = 1, r && (n = l[0] & 2 ? r.return : l[0] ? r.throw || ((n = r.return) && n.call(r), 0) : r.next) && !(n = n.call(r, l[1])).done) return n; switch (r = 0, n && (l = [ l[0] & 2, n.value ]), l[0]) { case 0: case 1: n = l; break; case 4: return i.label++, { value: l[1], done: !1 }; case 5: i.label++, r = l[1], l = [ 0 ]; continue; case 7: l = i.ops.pop(), i.trys.pop(); continue; default: if (n = i.trys, !(n = n.length > 0 && n[n.length - 1]) && (l[0] === 6 || l[0] === 2)) { i = 0; continue; } if (l[0] === 3 && (!n || l[1] > n[0] && l[1] < n[3])) { i.label = l[1]; break; } if (l[0] === 6 && i.label < n[1]) { i.label = n[1], n = l; break; } if (n && i.label < n[2]) { i.label = n[2], i.ops.push(l); break; } n[2] && i.ops.pop(), i.trys.pop(); continue; } l = e.call(t, i); } catch (u) { l = [ 6, u ], r = 0; } finally { o = n = 0; } if (l[0] & 5) throw l[1]; return { value: l[0] ? l[1] : void 0, done: !0 }; } } function safeWrapper(t, e) { return _safeWrapper.apply(this, arguments); } function _safeWrapper() { return _safeWrapper = _async_to_generator$1(function(t, e) { var o, r; return _ts_generator$1(this, function(n) { switch (n.label) { case 0: return n.trys.push([ 0, 2, , 3 ]), [ 4, t() ]; case 1: return o = n.sent(), [ 2, o ]; case 2: return r = n.sent(), !e && warn(r), [ 2 ]; case 3: return [ 2 ]; } }); }), _safeWrapper.apply(this, arguments); } function isStaticResourcesEqual(t, e) { var o = /^(https?:)?\/\//i, r = t.replace(o, "").replace(/\/$/, ""), n = e.replace(o, "").replace(/\/$/, ""); return r === n; } function createScript(t) { for (var e = null, o = !0, r = 2e4, n, a = document.getElementsByTagName("script"), i = 0; i < a.length; i++) { var s = a[i], c = s.getAttribute("src"); if (c && isStaticResourcesEqual(c, t.url)) { e = s, o = !1; break; } } if (!e) { if (e = document.createElement("script"), e.type = "text/javascript", e.src = t.url, t.createScriptHook) { var l = t.createScriptHook(t.url); _instanceof(l, HTMLScriptElement) ? e = l : (typeof l > "u" ? "undefined" : _type_of$2(l)) === "object" && (l.script && (e = l.script), l.timeout && (r = l.timeout)); } var u = t.attrs; u && Object.keys(u).forEach(function(d) { e && (d === "async" || d === "defer" ? e[d] = u[d] : e.getAttribute(d) || e.setAttribute(d, u[d])); }); } var h = function(d, m) { var g; if (clearTimeout(n), e && (e.onerror = null, e.onload = null, safeWrapper(function() { var p = t.needDeleteScript, I = p === void 0 ? !0 : p; I && e != null && e.parentNode && e.parentNode.removeChild(e); }), d)) { var M, y = d(m); return t == null || (M = t.cb) === null || M === void 0 || M.call(t), y; } t == null || (g = t.cb) === null || g === void 0 || g.call(t); }; return e.onerror = h.bind(null, e.onerror), e.onload = h.bind(null, e.onload), n = setTimeout(function() { h(null, new Error('Remote script "'.concat(t.url, '" time-outed.'))); }, r), { script: e, needAttach: o }; } function createLink(t) { for (var e = null, o = !0, r = document.getElementsByTagName("link"), n = 0; n < r.length; n++) { var a = r[n], i = a.getAttribute("href"), s = a.getAttribute("ref"); if (i && isStaticResourcesEqual(i, t.url) && s === t.attrs.ref) { e = a, o = !1; break; } } if (!e) { if (e = document.createElement("link"), e.setAttribute("href", t.url), t.createLinkHook) { var c = t.createLinkHook(t.url); _instanceof(c, HTMLLinkElement) && (e = c); } var l = t.attrs; l && Object.keys(l).forEach(function(h) { e && !e.getAttribute(h) && e.setAttribute(h, l[h]); }); } var u = function(h, d) { if (e && (e.onerror = null, e.onload = null, safeWrapper(function() { var g = t.needDeleteLink, M = g === void 0 ? !0 : g; M && e != null && e.parentNode && e.parentNode.removeChild(e); }), h)) { var m = h(d); return t.cb(), m; } t.cb(); }; return e.onerror = u.bind(null, e.onerror), e.onload = u.bind(null, e.onload), { link: e, needAttach: o }; } function loadScript(t, e) { var o = e.attrs, r = o === void 0 ? {} : o, n = e.createScriptHook; return new Promise(function(a, i) { var s = createScript({ url: t, cb: a, attrs: _object_spread$1({ crossorigin: "anonymous", fetchpriority: "high" }, r), createScriptHook: n, needDeleteScript: !0 }), c = s.script, l = s.needAttach; l && document.head.appendChild(c); }); } function _array_like_to_array(t, e) { (e == null || e > t.length) && (e = t.length); for (var o = 0, r = new Array(e); o < e; o++) r[o] = t[o]; return r; } function _array_with_holes(t) { if (Array.isArray(t)) return t; } function asyncGeneratorStep(t, e, o, r, n, a, i) { try { var s = t[a](i), c = s.value; } catch (l) { o(l); return; } s.done ? e(c) : Promise.resolve(c).then(r, n); } function _async_to_generator(t) { return function() { var e = this, o = arguments; return new Promise(function(r, n) { var a = t.apply(e, o); function i(c) { asyncGeneratorStep(a, r, n, i, s, "next", c); } function s(c) { asyncGeneratorStep(a, r, n, i, s, "throw", c); } i(void 0); }); }; } function _iterable_to_array_limit(t, e) { var o = t == null ? null : typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"]; if (o != null) { var r = [], n = !0, a = !1, i, s; try { for (o = o.call(t); !(n = (i = o.next()).done) && (r.push(i.value), !(e && r.length === e)); n = !0) ; } catch (c) { a = !0, s = c; } finally { try { !n && o.return != null && o.return(); } finally { if (a) throw s; } } return r; } } function _non_iterable_rest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _sliced_to_array(t, e) { return _array_with_holes(t) || _iterable_to_array_limit(t, e) || _unsupported_iterable_to_array(t, e) || _non_iterable_rest(); } function _type_of$1(t) { return t && typeof Symbol < "u" && t.constructor === Symbol ? "symbol" : typeof t; } function _unsupported_iterable_to_array(t, e) { if (t) { if (typeof t == "string") return _array_like_to_array(t, e); var o = Object.prototype.toString.call(t).slice(8, -1); if (o === "Object" && t.constructor && (o = t.constructor.name), o === "Map" || o === "Set") return Array.from(o); if (o === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)) return _array_like_to_array(t, e); } } function _ts_generator(t, e) { var o, r, n, a, i = { label: 0, sent: function() { if (n[0] & 1) throw n[1]; return n[1]; }, trys: [], ops: [] }; return a = { next: s(0), throw: s(1), return: s(2) }, typeof Symbol == "function" && (a[Symbol.iterator] = function() { return this; }), a; function s(l) { return function(u) { return c([ l, u ]); }; } function c(l) { if (o) throw new TypeError("Generator is already executing."); for (; i; ) try { if (o = 1, r && (n = l[0] & 2 ? r.return : l[0] ? r.throw || ((n = r.return) && n.call(r), 0) : r.next) && !(n = n.call(r, l[1])).done) return n; switch (r = 0, n && (l = [ l[0] & 2, n.value ]), l[0]) { case 0: case 1: n = l; break; case 4: return i.label++, { value: l[1], done: !1 }; case 5: i.label++, r = l[1], l = [ 0 ]; continue; case 7: l = i.ops.pop(), i.trys.pop(); continue; default: if (n = i.trys, !(n = n.length > 0 && n[n.length - 1]) && (l[0] === 6 || l[0] === 2)) { i = 0; continue; } if (l[0] === 3 && (!n || l[1] > n[0] && l[1] < n[3])) { i.label = l[1]; break; } if (l[0] === 6 && i.label < n[1]) { i.label = n[1], n = l; break; } if (n && i.label < n[2]) { i.label = n[2], i.ops.push(l); break; } n[2] && i.ops.pop(), i.trys.pop(); continue; } l = e.call(t, i); } catch (u) { l = [ 6, u ], r = 0; } finally { o = n = 0; } if (l[0] & 5) throw l[1]; return { value: l[0] ? l[1] : void 0, done: !0 }; } } function importNodeModule(t) { if (!t) throw new Error("import specifier is required"); var e = new Function("name", "return import(name)"); return e(t).then(function(o) { return o.default; }).catch(function(o) { throw console.error("Error importing module ".concat(t, ":"), o), o; }); } function createScriptNode(url, cb, attrs, createScriptHook) { if (createScriptHook) { var hookResult = createScriptHook(url); hookResult && (typeof hookResult > "u" ? "undefined" : _type_of$1(hookResult)) === "object" && "url" in hookResult && (url = hookResult.url); } var urlObj; try { urlObj = new URL(url); } catch (t) { console.error("Error constructing URL:", t), cb(new Error("Invalid URL: ".concat(t))); return; } var getFetch = function() { var t = _async_to_generator(function() { var e; return _ts_generator(this, function(o) { switch (o.label) { case 0: return typeof fetch > "u" ? [ 4, importNodeModule("node-fetch") ] : [ 3, 2 ]; case 1: return e = o.sent(), [ 2, e?.default || e ]; case 2: return [ 2, fetch ]; case 3: return [ 2 ]; } }); }); return function() { return t.apply(this, arguments); }; }(); console.log("fetching", urlObj.href), getFetch().then(function(f) { f(urlObj.href).then(function(t) { return t.text(); }).then(function() { var _ref = _async_to_generator(function(data) { var _ref, path, vm, scriptContext, urlDirname, filename, script, exportedInterface, container; return _ts_generator(this, function(_state) { switch (_state.label) { case 0: return [ 4, Promise.all([ importNodeModule("path"), importNodeModule("vm") ]) ]; case 1: _ref = _sliced_to_array.apply(void 0, [ _state.sent(), 2 ]), path = _ref[0], vm = _ref[1], scriptContext = { exports: {}, module: { exports: {} } }, urlDirname = urlObj.pathname.split("/").slice(0, -1).join("/"), filename = path.basename(urlObj.pathname); try { if (script = new vm.Script("(function(exports, module, require, __dirname, __filename) {".concat(data, ` })`), filename), script.runInThisContext()(scriptContext.exports, scriptContext.module, eval("require"), urlDirname, filename), exportedInterface = scriptContext.module.exports || scriptContext.exports, attrs && exportedInterface && attrs.globalName) return container = exportedInterface[attrs.globalName] || exportedInterface, cb(void 0, container), [ 2 ]; cb(void 0, exportedInterface); } catch (t) { cb(new Error("Script execution error: ".concat(t))); } return [ 2 ]; } }); }); return function(t) { return _ref.apply(this, arguments); }; }()).catch(function(t) { cb(t); }); }); } function loadScriptNode(t, e) { return new Promise(function(o, r) { createScriptNode(t, function(n, a) { if (n) r(n); else { var i, s, c = (e == null || (i = e.attrs) === null || i === void 0 ? void 0 : i.globalName) || "__FEDERATION_".concat(e == null || (s = e.attrs) === null || s === void 0 ? void 0 : s.name, ":custom__"), l = globalThis[c] = a; o(l); } }, e.attrs, e.createScriptHook); }); } function matchRemoteWithNameAndExpose(t, e) { for (const o of t) { const r = e.startsWith(o.name); let n = e.replace(o.name, ""); if (r) { if (n.startsWith("/")) { const s = o.name; return n = `.${n}`, { pkgNameOrAlias: s, expose: n, remote: o }; } else if (n === "") return { pkgNameOrAlias: o.name, expose: ".", remote: o }; } const a = o.alias && e.startsWith(o.alias); let i = o.alias && e.replace(o.alias, ""); if (o.alias && a) { if (i && i.startsWith("/")) { const s = o.alias; return i = `.${i}`, { pkgNameOrAlias: s, expose: i, remote: o }; } else if (i === "") return { pkgNameOrAlias: o.alias, expose: ".", remote: o }; } } } function matchRemote(t, e) { for (const o of t) if (e === o.name || o.alias && e === o.alias) return o; } function registerPlugins$1(t, e) { const o = getGlobalHostPlugins(); return o.length > 0 && o.forEach((r) => { t != null && t.find((n) => n.name !== r.name) && t.push(r); }), t && t.length > 0 && t.forEach((r) => { e.forEach((n) => { n.applyPlugin(r); }); }), t; } function _extends$7() { return _extends$7 = Object.assign || function(t) { for (var e = 1; e < arguments.length; e++) { var o = arguments[e]; for (var r in o) Object.prototype.hasOwnProperty.call(o, r) && (t[r] = o[r]); } return t; }, _extends$7.apply(this, arguments); } async function loadEsmEntry({ entry: t, remoteEntryExports: e }) { return new Promise((o, r) => { try { e ? o(e) : new Function("callbacks", `import("${t}").then(callbacks[0]).catch(callbacks[1])`)([ o, r ]); } catch (n) { r(n); } }); } async function loadEntryScript({ name: t, globalName: e, entry: o, createScriptHook: r }) { const { entryExports: n } = getRemoteEntryExports(t, e); return n || (typeof document > "u" ? loadScriptNode(o, { attrs: { name: t, globalName: e }, createScriptHook: r }).then(() => { const { remoteEntryKey: a, entryExports: i } = getRemoteEntryExports(t, e); return assert(i, ` Unable to use the ${t}'s '${o}' URL with ${a}'s globalName to get remoteEntry exports. Possible reasons could be: 1. '${o}' is not the correct URL, or the remoteEntry resource or name is incorrect. 2. ${a} cannot be used to get remoteEntry exports in the window object. `), i; }).catch((a) => { throw a; }) : loadScript(o, { attrs: {}, createScriptHook: r }).then(() => { const { remoteEntryKey: a, entryExports: i } = getRemoteEntryExports(t, e); return assert(i, ` Unable to use the ${t}'s '${o}' URL with ${a}'s globalName to get remoteEntry exports. Possible reasons could be: 1. '${o}' is not the correct URL, or the remoteEntry resource or name is incorrect. 2. ${a} cannot be used to get remoteEntry exports in the window object. `), i; }).catch((a) => { throw a; })); } function getRemoteEntryUniqueKey(t) { const { entry: e, name: o } = t; return composeKeyWithSeparator(o, e); } async function getRemoteEntry({ remoteEntryExports: t, remoteInfo: e, createScriptHook: o }) { const { entry: r, name: n, type: a, entryGlobalName: i } = e, s = getRemoteEntryUniqueKey(e); return t || (globalLoading[s] || ([ "esm", "module" ].includes(a) ? globalLoading[s] = loadEsmEntry({ entry: r, remoteEntryExports: t }) : globalLoading[s] = loadEntryScript({ name: n, globalName: i, entry: r, createScriptHook: o })), globalLoading[s]); } function getRemoteInfo(t) { return _extends$7({}, t, { entry: "entry" in t ? t.entry : "", type: t.type || DEFAULT_REMOTE_TYPE, entryGlobalName: t.entryGlobalName || t.name, shareScope: t.shareScope || DEFAULT_SCOPE }); } function _extends$6() { return _extends$6 = Object.assign || function(t) { for (var e = 1; e < arguments.length; e++) { var o = arguments[e]; for (var r in o) Object.prototype.hasOwnProperty.call(o, r) && (t[r] = o[r]); } return t; }, _extends$6.apply(this, arguments); } let Module = class { async getEntry() { if (this.remoteEntryExports) return this.remoteEntryExports; const t = await getRemoteEntry({ remoteInfo: this.remoteInfo, remoteEntryExports: this.remoteEntryExports, createScriptHook: (e) => { const o = this.host.loaderHook.lifecycle.createScript.emit({ url: e }); if (o && (typeof document > "u" || o instanceof HTMLScriptElement || "script" in o || "timeout" in o)) return o; } }); return assert(t, `remoteEntryExports is undefined ${safeToString$1(this.remoteInfo)}`), this.remoteEntryExports = t, this.remoteEntryExports; } async get(t, e, o) { const { loadFactory: r = !0 } = o || { loadFactory: !0 }, n = await this.getEntry(); if (!this.inited) { const s = this.host.shareScopeMap, c = this.remoteInfo.shareScope || "default"; s[c] || (s[c] = {}); const l = s[c], u = [], h = { version: this.remoteInfo.version || "" }; Object.defineProperty(h, "shareScopeMap", { value: s, enumerable: !1 }); const d = await this.host.hooks.lifecycle.beforeInitContainer.emit({ shareScope: l, remoteEntryInitOptions: h, initScope: u, remoteInfo: this.remoteInfo, origin: this.host }); await n.init(d.shareScope, d.initScope, d.remoteEntryInitOptions), await this.host.hooks.lifecycle.initContainer.emit(_extends$6({}, d, { remoteEntryExports: n })); } this.lib = n, this.inited = !0; const a = await n.get(e); assert(a, `${getFMId(this.remoteInfo)} remote don't export ${e}.`); const i = this.wraperFactory(a, t); return r ? await i() : i; } wraperFactory(t, e) { function o(r, n) { r && typeof r == "object" && Object.isExtensible(r) && !Object.getOwnPropertyDescriptor(r, Symbol.for("mf_module_id")) && Object.defineProperty(r, Symbol.for("mf_module_id"), { value: n, enumerable: !1 });