@starknet-io/get-starknet-core
Version:
[](https://www.npmjs.com/package/get-starknet)
19 lines (15 loc) • 105 kB
JavaScript
var ne=Object.defineProperty;var oe=(y,A,b)=>A in y?ne(y,A,{enumerable:!0,configurable:!0,writable:!0,value:b}):y[A]=b;var z=(y,A,b)=>(oe(y,typeof A!="symbol"?A+"":A,b),b),K=(y,A,b)=>{if(!A.has(y))throw TypeError("Cannot "+b)};var T=(y,A,b)=>(K(y,A,"read from private field"),b?b.call(y):A.get(y)),R=(y,A,b)=>{if(A.has(y))throw TypeError("Cannot add the same private member more than once");A instanceof WeakSet?A.add(y):A.set(y,b)},G=(y,A,b,Z)=>(K(y,A,"write to private field"),Z?Z.call(y,b):A.set(y,b),b);var L=(y,A,b)=>(K(y,A,"access private method"),b);(function(y,A){typeof exports=="object"&&typeof module<"u"?A(exports):typeof define=="function"&&define.amd?define(["exports"],A):(y=typeof globalThis<"u"?globalThis:y||self,A(y.core={}))})(this,function(exports){var y,ee,b,W,F,te,q,J,P,x,U,Q,re,H,V;"use strict";const generateUID=()=>`${Date.now()}-${Math.floor(Math.random()*8999999999999)+1e12}`,shuffle=t=>{for(let e=t.length-1;e>0;e--){const r=Math.floor(Math.random()*(e+1));[t[e],t[r]]=[t[r],t[e]]}return t},pipe$1=(...t)=>e=>t.reduce((r,n)=>r.then(n),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 Boolean("")}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(r=>r===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 r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},_extends$1$1.apply(this,arguments)}function _object_without_properties_loose$1(t,e){if(t==null)return{};var r={},n=Object.keys(t),o,s;for(s=0;s<n.length;s++)o=n[s],!(e.indexOf(o)>=0)&&(r[o]=t[o]);return r}const nativeGlobal=(()=>{try{return new Function("return this")()}catch{return globalThis}})(),Global=nativeGlobal;function definePropertyGlobalVal(t,e,r){Object.defineProperty(t,e,{value:r,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,r,n,o,s,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__:new Map}),definePropertyGlobalVal(t,"__VMOK__",t.__FEDERATION__));var a;(a=(e=t.__FEDERATION__).__GLOBAL_PLUGIN__)!=null||(e.__GLOBAL_PLUGIN__=[]);var c;(c=(r=t.__FEDERATION__).__INSTANCES__)!=null||(r.__INSTANCES__=[]);var l;(l=(n=t.__FEDERATION__).moduleInfo)!=null||(n.moduleInfo={});var d;(d=(o=t.__FEDERATION__).__SHARE__)!=null||(o.__SHARE__={});var u;(u=(s=t.__FEDERATION__).__MANIFEST_LOADING__)!=null||(s.__MANIFEST_LOADING__={});var h;(h=(i=t.__FEDERATION__).__PRELOADED_MAP__)!=null||(i.__PRELOADED_MAP__=new Map)}setGlobalDefaultVal(globalThis),setGlobalDefaultVal(nativeGlobal);function getGlobalFederationInstance(t,e){const r=getBuilderId();return globalThis.__FEDERATION__.__INSTANCES__.find(n=>!!(r&&n.options.id===getBuilderId()||n.options.name===t&&!n.options.version&&!e||n.options.name===t&&e&&n.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 n=Object.keys(t);for(const o of n){const[s,i]=o.split(":"),a=`${s}:${e}`,c=t[a];if(c)return{value:c,key:a}}return{value:void 0,key:e}}}else throw new Error("key must be string")}const getGlobalSnapshot=()=>nativeGlobal.__FEDERATION__.moduleInfo,getTargetSnapshotInfoByModuleInfo=(t,e)=>{const r=getFMId(t),n=getInfoWithoutType(e,r).value;if(n&&!n.version&&"version"in t&&t.version&&(n.version=t.version),n)return n;if("version"in t&&t.version){const{version:o}=t,s=_object_without_properties_loose$1(t,["version"]),i=getFMId(s),a=getInfoWithoutType(nativeGlobal.__FEDERATION__.moduleInfo,i).value;if((a==null?void 0:a.version)===o)return a}},getGlobalSnapshotInfoByModuleInfo=t=>getTargetSnapshotInfoByModuleInfo(t,nativeGlobal.__FEDERATION__.moduleInfo),setGlobalSnapshotInfoByModuleInfo=(t,e)=>{const r=getFMId(t);return nativeGlobal.__FEDERATION__.moduleInfo[r]=e,nativeGlobal.__FEDERATION__.moduleInfo},addGlobalSnapshot=t=>(nativeGlobal.__FEDERATION__.moduleInfo=_extends$1$1({},nativeGlobal.__FEDERATION__.moduleInfo,t),()=>{const e=Object.keys(t);for(const r of e)delete nativeGlobal.__FEDERATION__.moduleInfo[r]}),getRemoteEntryExports=(t,e)=>{const r=e||`__FEDERATION_${t}:custom__`,n=globalThis[r];return{remoteEntryKey:r,entryExports:n}},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((r,n)=>n(r),e)}function extractComparator(t){return t.match(parseRegex(comparator))}function combineVersion(t,e,r,n){const o=`${t}.${e}.${r}`;return n?`${o}-${n}`:o}function parseHyphen(t){return t.replace(parseRegex(hyphenRange),(e,r,n,o,s,i,a,c,l,d,u,h)=>(isXVersion(n)?r="":isXVersion(o)?r=`>=${n}.0.0`:isXVersion(s)?r=`>=${n}.${o}.0`:r=`>=${r}`,isXVersion(l)?c="":isXVersion(d)?c=`<${Number(l)+1}.0.0-0`:isXVersion(u)?c=`<${l}.${Number(d)+1}.0-0`:h?c=`<=${l}.${d}.${u}-${h}`:c=`<=${c}`,`${r} ${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),(r,n,o,s,i)=>isXVersion(n)?"":isXVersion(o)?`>=${n}.0.0 <${Number(n)+1}.0.0-0`:isXVersion(s)?n==="0"?`>=${n}.${o}.0 <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.0 <${Number(n)+1}.0.0-0`:i?n==="0"?o==="0"?`>=${n}.${o}.${s}-${i} <${n}.${o}.${Number(s)+1}-0`:`>=${n}.${o}.${s}-${i} <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.${s}-${i} <${Number(n)+1}.0.0-0`:n==="0"?o==="0"?`>=${n}.${o}.${s} <${n}.${o}.${Number(s)+1}-0`:`>=${n}.${o}.${s} <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.${s} <${Number(n)+1}.0.0-0`)).join(" ")}function parseTildes(t){return t.trim().split(/\s+/).map(e=>e.replace(parseRegex(tilde),(r,n,o,s,i)=>isXVersion(n)?"":isXVersion(o)?`>=${n}.0.0 <${Number(n)+1}.0.0-0`:isXVersion(s)?`>=${n}.${o}.0 <${n}.${Number(o)+1}.0-0`:i?`>=${n}.${o}.${s}-${i} <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.${s} <${n}.${Number(o)+1}.0-0`)).join(" ")}function parseXRanges(t){return t.split(/\s+/).map(e=>e.trim().replace(parseRegex(xRange),(r,n,o,s,i,a)=>{const c=isXVersion(o),l=c||isXVersion(s),d=l||isXVersion(i);return n==="="&&d&&(n=""),a="",c?n===">"||n==="<"?"<0.0.0-0":"*":n&&d?(l&&(s=0),i=0,n===">"?(n=">=",l?(o=Number(o)+1,s=0,i=0):(s=Number(s)+1,i=0)):n==="<="&&(n="<",l?o=Number(o)+1:s=Number(s)+1),n==="<"&&(a="-0"),`${n+o}.${s}.${i}${a}`):l?`>=${o}.0.0${a} <${Number(o)+1}.0.0-0`:d?`>=${o}.${s}.0${a} <${o}.${Number(s)+1}.0-0`:r})).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:r}=t,{preRelease:n}=e;if(r===void 0&&Boolean(n))return 1;if(Boolean(r)&&n===void 0)return-1;if(r===void 0&&n===void 0)return 0;for(let o=0,s=r.length;o<=s;o++){const i=r[o],a=n[o];if(i!==a)return i===void 0&&a===void 0?0:i?a?compareAtom(i,a):-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(h=>parseComparatorString(h)).join(" ").split(/\s+/).map(h=>parseGTE0(h)),s=extractComparator(t);if(!s)return!1;const[,i,,a,c,l,d]=s,u={operator:i,version:combineVersion(a,c,l,d),major:a,minor:c,patch:l,preRelease:d==null?void 0:d.split(".")};for(const h of o){const M=extractComparator(h);if(!M)return!1;const[,m,,D,g,p,w]=M,I={operator:m,version:combineVersion(D,g,p,w),major:D,minor:g,patch:p,preRelease:w==null?void 0:w.split(".")};if(!compare(I,u))return!1}return!0}function _extends$8(){return _extends$8=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},_extends$8.apply(this,arguments)}function formatShare(t,e,r){let n;"get"in t?n=t.get:"lib"in t?n=()=>Promise.resolve(t.lib):n=()=>Promise.resolve(()=>{throw new Error(`Can not get shared '${r}'!`)});var o,s;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:n,loaded:"lib"in t?!0:void 0,version:(o=t.version)!=null?o:"0",scope:Array.isArray(t.scope)?t.scope:[(s=t.scope)!=null?s:"default"],strategy:t.strategy||"version-first"})}function formatShareConfigs(t,e){const r=e.shared||{},n=e.name,o=Object.keys(r).reduce((i,a)=>{const c=arrayOptions(r[a]);return i[a]=i[a]||[],c.forEach(l=>{i[a].push(formatShare(l,n,a))}),i},{}),s=_extends$8({},t.shared);return Object.keys(o).forEach(i=>{s[i]?o[i].forEach(a=>{s[i].find(l=>l.version===a.version)||s[i].push(a)}):s[i]=o[i]}),{shared:s,shareInfos:o}}function versionLt(t,e){const r=n=>{if(!Number.isNaN(Number(n))){const s=n.split(".");let i=n;for(let a=0;a<3-s.length;a++)i+=".0";return i}return n};return!!satisfy(r(t),`<=${r(e)}`)}const findVersion=(t,e)=>{const r=e||function(n,o){return versionLt(n,o)};return Object.keys(t).reduce((n,o)=>!n||r(n,o)||n==="0"?o:n,0)},isLoaded=t=>Boolean(t.loaded)||typeof t.lib=="function";function findSingletonVersionOrderByVersion(t,e,r){const n=t[e][r],o=function(s,i){return!isLoaded(n[s])&&versionLt(s,i)};return findVersion(t[e][r],o)}function findSingletonVersionOrderByLoaded(t,e,r){const n=t[e][r],o=function(s,i){return isLoaded(n[i])?isLoaded(n[s])?Boolean(versionLt(s,i)):!0:isLoaded(n[s])?!1:versionLt(s,i)};return findVersion(t[e][r],o)}function getFindShareFunction(t){return t==="loaded-first"?findSingletonVersionOrderByLoaded:findSingletonVersionOrderByVersion}function getRegisteredShare(t,e,r,n){if(!t)return;const{shareConfig:o,scope:s=DEFAULT_SCOPE,strategy:i}=r,a=Array.isArray(s)?s:[s];for(const c of a)if(o&&t[c]&&t[c][e]){const{requiredVersion:l}=o,u=getFindShareFunction(i)(t,c,e),h=()=>{if(o.singleton){if(typeof l=="string"&&!satisfy(u,l)){const D=`Version ${u} from ${u&&t[c][e][u].from} of shared singleton module ${e} does not satisfy the requirement of ${r.from} which needs ${l})`;o.strictVersion?error(D):warn$1(D)}return t[c][e][u]}else{if(l===!1||l==="*"||satisfy(u,l))return t[c][e][u];for(const[D,g]of Object.entries(t[c][e]))if(satisfy(D,l))return g}},M={shareScopeMap:t,scope:c,pkgName:e,version:u,GlobalFederation:Global.__FEDERATION__,resolver:h};return(n.emit(M)||M).resolver()}}function getGlobalShareScope(){return Global.__FEDERATION__.__SHARE__}function getTargetSharedOptions(t){const{pkgName:e,extraOptions:r,shareInfos:n}=t,o=a=>{if(!a)return;const c={};a.forEach(u=>{c[u.version]=u});const d=findVersion(c,function(u,h){return!isLoaded(c[u])&&versionLt(u,h)});return c[d]};var s;const i=(s=r==null?void 0:r.resolver)!=null?s:o;return Object.assign({},i(n[e]),r==null?void 0:r.customShareInfo)}function _define_property$4(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,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?Boolean(process.env.FEDERATION_DEBUG):typeof FEDERATION_DEBUG<"u"&&Boolean(FEDERATION_DEBUG)}function _array_like_to_array$2(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}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 r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function _create_class(t,e,r){return e&&_defineProperties(t.prototype,e),r&&_defineProperties(t,r),t}function _define_property$3(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,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 r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))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=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,r){if(this.enable){var n=safeToString(r)||"";isBrowserEnv()?console.info("%c ".concat(this.identifier,": ").concat(e," ").concat(n),"color:#3300CC"):console.info("\x1B[34m%s","".concat(this.identifier,": ").concat(e," ").concat(n?`
`.concat(n):""))}}},{key:"logOriginalInfo",value:function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];if(this.enable)if(isBrowserEnv()){var s;console.info("%c ".concat(this.identifier,": OriginalInfo"),"color:#3300CC"),(s=console).log.apply(s,_to_consumable_array(n))}else{var i;console.info("%c ".concat(this.identifier,": OriginalInfo"),"color:#3300CC"),(i=console).log.apply(i,_to_consumable_array(n))}}}]),t}(),LOG_CATEGORY="[ Federation Runtime ]";new Logger;var composeKeyWithSeparator=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return r.length?r.reduce(function(o,s){return s?o?"".concat(o).concat(SEPARATOR).concat(s):s:o},""):""},getResourceUrl=function(t,e){if("getPublicPath"in t){var r=new Function(t.getPublicPath)();return"".concat(r).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,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _object_spread$2(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable}))),n.forEach(function(o){_define_property$2(t,o,r[o])})}return t}function ownKeys(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,n)}return r}function _object_spread_props(t,e){return e=e!=null?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):ownKeys(Object(e)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}),t}var simpleJoinRemoteEntry=function(t,e){if(!t)return e;var r=function(o){if(o===".")return"";if(o.startsWith("./"))return o.replace("./","");if(o.startsWith("/")){var s=o.slice(1);return s.endsWith("/")?s.slice(0,-1):s}return o},n=r(t);return n?n.endsWith("/")?"".concat(n).concat(e):"".concat(n,"/").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]:{},r,n,o=e.remotes,s=o===void 0?{}:o,i=e.overrides,a=i===void 0?{}:i,c=e.version,l,d=function(){return"publicPath"in t.metaData?t.metaData.publicPath==="auto"&&c?inferAutoPublicPath(c):t.metaData.publicPath:t.metaData.getPublicPath},u=Object.keys(a),h={};if(!Object.keys(s).length){var M;h=((M=t.remotes)===null||M===void 0?void 0:M.reduce(function(E,Y){var $,X=Y.federationContainerName;return u.includes(X)?$=a[X]:"version"in Y?$=Y.version:$=Y.entry,E[X]={matchedVersion:$},E},{}))||{}}Object.keys(s).forEach(function(E){return h[E]={matchedVersion:u.includes(E)?a[E]:s[E]}});var m=t.metaData,D=m.remoteEntry,g=D.path,p=D.name,w=D.type,I=m.types,N=m.buildInfo.buildVersion,j=m.globalName,_=t.exposes,C={version:c||"",buildVersion:N,globalName:j,remoteEntry:simpleJoinRemoteEntry(g,p),remoteEntryType:w,remoteTypes:simpleJoinRemoteEntry(I.path,I.name),remoteTypesZip:I.zip||"",remoteTypesAPI:I.api||"",remotesInfo:h,shared:t==null?void 0:t.shared.map(function(E){return{assets:E.assets,sharedName:E.name,version:E.version}}),modules:_==null?void 0:_.map(function(E){return{moduleName:E.name,modulePath:E.path,assets:E.assets}})};if(!((r=t.metaData)===null||r===void 0)&&r.prefetchInterface){var k=t.metaData.prefetchInterface;C=_object_spread_props(_object_spread$2({},C),{prefetchInterface:k})}if(!((n=t.metaData)===null||n===void 0)&&n.prefetchEntry){var v=t.metaData.prefetchEntry,S=v.path,O=v.name,B=v.type;C=_object_spread_props(_object_spread$2({},C),{prefetchEntry:simpleJoinRemoteEntry(S,O),prefetchEntryType:B})}return"publicPath"in t.metaData?l=_object_spread_props(_object_spread$2({},C),{publicPath:d()}):l=_object_spread_props(_object_spread$2({},C),{getPublicPath:d()}),l}function isManifestProvider(t){return!!("remoteEntry"in t&&t.remoteEntry.includes(MANIFEST_EXT))}function asyncGeneratorStep$1(t,e,r,n,o,s,i){try{var a=t[s](i),c=a.value}catch(l){r(l);return}a.done?e(c):Promise.resolve(c).then(n,o)}function _async_to_generator$1(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var s=t.apply(e,r);function i(c){asyncGeneratorStep$1(s,n,o,i,a,"next",c)}function a(c){asyncGeneratorStep$1(s,n,o,i,a,"throw",c)}i(void 0)})}}function _define_property$1(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,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 r=arguments[e]!=null?arguments[e]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable}))),n.forEach(function(o){_define_property$1(t,o,r[o])})}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 r,n,o,s,i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(l){return function(d){return c([l,d])}}function c(l){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=l[0]&2?n.return:l[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;switch(n=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,n=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(o=i.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){i=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(l[0]===6&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=e.call(t,i)}catch(d){l=[6,d],n=0}finally{r=o=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 r,n;return _ts_generator$1(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,t()];case 1:return r=o.sent(),[2,r];case 2:return n=o.sent(),!e&&warn(n),[2];case 3:return[2]}})}),_safeWrapper.apply(this,arguments)}function isStaticResourcesEqual(t,e){var r=/^(https?:)?\/\//i,n=t.replace(r,"").replace(/\/$/,""),o=e.replace(r,"").replace(/\/$/,"");return n===o}function createScript(t){for(var e=null,r=!0,n=2e4,o,s=document.getElementsByTagName("script"),i=0;i<s.length;i++){var a=s[i],c=a.getAttribute("src");if(c&&isStaticResourcesEqual(c,t.url)){e=a,r=!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&&(n=l.timeout))}var d=t.attrs;d&&Object.keys(d).forEach(function(h){e&&(h==="async"||h==="defer"?e[h]=d[h]:e.getAttribute(h)||e.setAttribute(h,d[h]))})}var u=function(h,M){var m;if(clearTimeout(o),e&&(e.onerror=null,e.onload=null,safeWrapper(function(){var p=t.needDeleteScript,w=p===void 0?!0:p;w&&e!=null&&e.parentNode&&e.parentNode.removeChild(e)}),h)){var D,g=h(M);return t==null||(D=t.cb)===null||D===void 0||D.call(t),g}t==null||(m=t.cb)===null||m===void 0||m.call(t)};return e.onerror=u.bind(null,e.onerror),e.onload=u.bind(null,e.onload),o=setTimeout(function(){u(null,new Error('Remote script "'.concat(t.url,'" time-outed.')))},n),{script:e,needAttach:r}}function createLink(t){for(var e=null,r=!0,n=document.getElementsByTagName("link"),o=0;o<n.length;o++){var s=n[o],i=s.getAttribute("href"),a=s.getAttribute("ref");if(i&&isStaticResourcesEqual(i,t.url)&&a===t.attrs.ref){e=s,r=!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(u){e&&!e.getAttribute(u)&&e.setAttribute(u,l[u])})}var d=function(u,h){if(e&&(e.onerror=null,e.onload=null,safeWrapper(function(){var m=t.needDeleteLink,D=m===void 0?!0:m;D&&e!=null&&e.parentNode&&e.parentNode.removeChild(e)}),u)){var M=u(h);return t.cb(),M}t.cb()};return e.onerror=d.bind(null,e.onerror),e.onload=d.bind(null,e.onload),{link:e,needAttach:r}}function loadScript(t,e){var r=e.attrs,n=r===void 0?{}:r,o=e.createScriptHook;return new Promise(function(s,i){var a=createScript({url:t,cb:s,attrs:_object_spread$1({crossorigin:"anonymous",fetchpriority:"high"},n),createScriptHook:o,needDeleteScript:!0}),c=a.script,l=a.needAttach;l&&document.head.appendChild(c)})}function _array_like_to_array(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function _array_with_holes(t){if(Array.isArray(t))return t}function asyncGeneratorStep(t,e,r,n,o,s,i){try{var a=t[s](i),c=a.value}catch(l){r(l);return}a.done?e(c):Promise.resolve(c).then(n,o)}function _async_to_generator(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var s=t.apply(e,r);function i(c){asyncGeneratorStep(s,n,o,i,a,"next",c)}function a(c){asyncGeneratorStep(s,n,o,i,a,"throw",c)}i(void 0)})}}function _iterable_to_array_limit(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],o=!0,s=!1,i,a;try{for(r=r.call(t);!(o=(i=r.next()).done)&&(n.push(i.value),!(e&&n.length===e));o=!0);}catch(c){s=!0,a=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}return n}}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 r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _array_like_to_array(t,e)}}function _ts_generator(t,e){var r,n,o,s,i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(l){return function(d){return c([l,d])}}function c(l){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=l[0]&2?n.return:l[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;switch(n=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,n=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(o=i.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){i=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(l[0]===6&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=e.call(t,i)}catch(d){l=[6,d],n=0}finally{r=o=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(r){return r.default}).catch(function(r){throw console.error("Error importing module ".concat(t,":"),r),r})}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(r){switch(r.label){case 0:return typeof fetch>"u"?[4,importNodeModule("node-fetch")]:[3,2];case 1:return e=r.sent(),[2,(e==null?void 0: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(r,n){createScriptNode(t,function(o,s){if(o)n(o);else{var i,a,c=(e==null||(i=e.attrs)===null||i===void 0?void 0:i.globalName)||"__FEDERATION_".concat(e==null||(a=e.attrs)===null||a===void 0?void 0:a.name,":custom__"),l=globalThis[c]=s;r(l)}},e.attrs,e.createScriptHook)})}function matchRemoteWithNameAndExpose(t,e){for(const r of t){const n=e.startsWith(r.name);let o=e.replace(r.name,"");if(n){if(o.startsWith("/")){const a=r.name;return o=`.${o}`,{pkgNameOrAlias:a,expose:o,remote:r}}else if(o==="")return{pkgNameOrAlias:r.name,expose:".",remote:r}}const s=r.alias&&e.startsWith(r.alias);let i=r.alias&&e.replace(r.alias,"");if(r.alias&&s){if(i&&i.startsWith("/")){const a=r.alias;return i=`.${i}`,{pkgNameOrAlias:a,expose:i,remote:r}}else if(i==="")return{pkgNameOrAlias:r.alias,expose:".",remote:r}}}}function matchRemote(t,e){for(const r of t)if(e===r.name||r.alias&&e===r.alias)return r}function registerPlugins$1(t,e){const r=getGlobalHostPlugins();return r.length>0&&r.forEach(n=>{t!=null&&t.find(o=>o.name!==n.name)&&t.push(n)}),t&&t.length>0&&t.forEach(n=>{e.forEach(o=>{o.applyPlugin(n)})}),t}function _extends$7(){return _extends$7=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},_extends$7.apply(this,arguments)}async function loadEsmEntry({entry:t,remoteEntryExports:e}){return new Promise((r,n)=>{try{e?r(e):new Function("callbacks",`import("${t}").then(callbacks[0]).catch(callbacks[1])`)([r,n])}catch(o){n(o)}})}async function loadEntryScript({name:t,globalName:e,entry:r,createScriptHook:n}){const{entryExports:o}=getRemoteEntryExports(t,e);return o||(typeof document>"u"?loadScriptNode(r,{attrs:{name:t,globalName:e},createScriptHook:n}).then(()=>{const{remoteEntryKey:s,entryExports:i}=getRemoteEntryExports(t,e);return assert(i,`
Unable to use the ${t}'s '${r}' URL with ${s}'s globalName to get remoteEntry exports.
Possible reasons could be:
1. '${r}' is not the correct URL, or the remoteEntry resource or name is incorrect.
2. ${s} cannot be used to get remoteEntry exports in the window object.
`),i}).catch(s=>{throw s}):loadScript(r,{attrs:{},createScriptHook:n}).then(()=>{const{remoteEntryKey:s,entryExports:i}=getRemoteEntryExports(t,e);return assert(i,`
Unable to use the ${t}'s '${r}' URL with ${s}'s globalName to get remoteEntry exports.
Possible reasons could be:
1. '${r}' is not the correct URL, or the remoteEntry resource or name is incorrect.
2. ${s} cannot be used to get remoteEntry exports in the window object.
`),i}).catch(s=>{throw s}))}function getRemoteEntryUniqueKey(t){const{entry:e,name:r}=t;return composeKeyWithSeparator(r,e)}async function getRemoteEntry({remoteEntryExports:t,remoteInfo:e,createScriptHook:r}){const{entry:n,name:o,type:s,entryGlobalName:i}=e,a=getRemoteEntryUniqueKey(e);return t||(globalLoading[a]||(["esm","module"].includes(s)?globalLoading[a]=loadEsmEntry({entry:n,remoteEntryExports:t}):globalLoading[a]=loadEntryScript({name:o,globalName:i,entry:n,createScriptHook:r})),globalLoading[a])}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 r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},_extends$6.apply(this,arguments)}let Module=class{async getEntry(){if(this.remoteEntryExports)return this.remoteEntryExports;const e=await getRemoteEntry({remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,createScriptHook:r=>{const n=this.host.loaderHook.lifecycle.createScript.emit({url:r});if(!!n&&(typeof document>"u"||n instanceof HTMLScriptElement||"script"in n||"timeout"in n))return n}});return assert(e,`remoteEntryExports is undefined
${safeToString$1(this.remoteInfo)}`),this.remoteEntryExports=e,this.remoteEntryExports}async get(e,r,n){const{loadFactory:o=!0}=n||{loadFactory:!0},s=await this.getEntry();if(!this.inited){const l=this.host.shareScopeMap,d=this.remoteInfo.shareScope||"default";l[d]||(l[d]={});const u=l[d],h=[],M={version:this.remoteInfo.version||""};Object.defineProperty(M,"shareScopeMap",{value:l,enumerable:!1});const m=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:u,remoteEntryInitOptions:M,initScope:h,remoteInfo:this.remoteInfo,origin:this.host});await s.init(m.shareScope,m.initScope,m.remoteEntryInitOptions),await this.host.hooks.lifecycle.initContainer.emit(_extends$6({},m,{remoteEntryExports:s}))}this.lib=s,this.inited=!0;const i=await s.get(r);assert(i,`${getFMId(this.remoteInfo)} remote don't export ${r}.`);const a=this.wraperFactory(i,e);return o?await a():a}wraperFactory(e,r){function n(o,s){o&&typeof o=="object"&&Object.isExtensible(o)&&!Object.getOwnPropertyDescriptor(o,Symbol.for("mf_module_id"))&&Object.defineProperty(o,Symbol.for("mf_module_id"),{value:s,enumerable:!1})}return e instanceof Promise?async()=>{const o=await e();return n(o,r),o}:()=>{const o=e();return n(o,r),o}}constructor({remoteInfo:e,host:r}){this.inited=!1,this.lib=void 0,this.remoteInfo=e,this.host=r}};class SyncHook{on(e){typeof e=="function"&&this.listeners.add(e)}once(e){const r=this;this.on(function n(...o){return r.remove(n),e.apply(null,o)})}emit(...e){let r;return this.listeners.size>0&&this.listeners.forEach(n=>{r=n(...e)}),r}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}constructor(e){this.type="",this.listeners=new Set,e&&(this.type=e)}}class AsyncHook extends SyncHook{emit(...e){let r;const n=Array.from(this.listeners);if(n.length>0){let o=0;const s=i=>i===!1?!1:o<n.length?Promise.resolve(n[o++].apply(null,e)).then(s):i;r=s()}return Promise.resolve(r)}}function checkReturnData(t,e){if(!isObject(e))return!1;if(t!==e){for(const r in t)if(!(r in e))return!1}return!0}class SyncWaterfallHook extends SyncHook{emit(e){isObject(e)||error(`The data for the "${this.type}" hook should be an object.`);for(const r of this.listeners)try{const n=r(e);if(checkReturnData(e,n))e=n;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(n){warn$1(n),this.onerror(n)}return e}constructor(e){super(),this.onerror=error,this.type=e}}class AsyncWaterfallHook extends SyncHook{emit(e){isObject(e)||error(`The response data for the "${this.type}" hook must be an object.`);const r=Array.from(this.listeners);if(r.length>0){let n=0;const o=i=>(warn$1(i),this.onerror(i),e),s=i=>{if(checkReturnData(e,i)){if(e=i,n<r.length)try{return Promise.resolve(r[n++](e)).then(s,o)}catch(a){return o(a)}}else this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`);return e};return Promise.resolve(s(e))}return Promise.resolve(e)}constructor(e){super(),this.onerror=error,this.type=e}}class PluginSystem{applyPlugin(e){assert(isPlainObject(e),"Plugin configuration is invalid.");const r=e.name;assert(r,"A name must be provided by the plugin."),this.registerPlugins[r]||(this.registerPlugins[r]=e,Object.keys(this.lifecycle).forEach(n=>{const o=e[n];o&&this.lifecycle[n].on(o)}))}removePlugin(e){assert(e,"A name is required.");const r=this.registerPlugins[e];assert(r,`The plugin "${e}" is not registered.`),Object.keys(r).forEach(n=>{n!=="name"&&this.lifecycle[n].remove(r[n])})}inherit({lifecycle:e,registerPlugins:r}){Object.keys(e).forEach(n=>{assert(!this.lifecycle[n],`The hook "${n}" has a conflict and cannot be inherited.`),this.lifecycle[n]=e[n]}),Object.keys(r).forEach(n=>{assert(!this.registerPlugins[n],`The plugin "${n}" has a conflict and cannot be inherited.`),this.applyPlugin(r[n])})}constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}}function _extends$5(){return _extends$5=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},_extends$5.apply(this,arguments)}function defaultPreloadArgs(t){return _extends$5({resourceCategory:"sync",share:!0,depsRemote:!0,prefetchInterface:!1},t)}function formatPreloadArgs(t,e){return e.map(r=>{const n=matchRemote(t,r.nameOrAlias);return assert(n,`Unable to preload ${r.nameOrAlias} as it is not included in ${!n&&safeToString$1({remoteInfo:n,remotes:t})}`),{remote:n,preloadConfig:defaultPreloadArgs(r)}})}function normalizePreloadExposes(t){return t?t.map(e=>e==="."?e:e.startsWith("./")?e.replace("./",""):e):[]}function preloadAssets(t,e,r,n=!0){const{cssAssets:o,jsAssetsWithoutEntry:s,entryAssets:i}=r;e.options.inBrowser&&(i.forEach(a=>{const{moduleInfo:c}=a,l=e.moduleCache.get(t.name);getRemoteEntry(l?{remoteInfo:c,remoteEntryExports:l.remoteEntryExports,createScriptHook:d=>{const u=e.loaderHook.lifecycle.createScript.emit({url:d});if(!!u&&(typeof document>"u"||u instanceof HTMLScriptElement||"script"in u||"timeout"in u))return u}}:{remoteInfo:c,remoteEntryExports:void 0,createScriptHook:d=>{const u=e.loaderHook.lifecycle.createScript.emit({url:d});if(!!u&&(typeof document>"u"||u instanceof HTMLScriptElement||"script"in u||"timeout"in u))return u}})}),n?o.forEach(a=>{const{link:c,needAttach:l}=createLink({url:a,cb:()=>{},attrs:{rel:"preload",as:"style",crossorigin:"anonymous"},createLinkHook:d=>{const u=e.loaderHook.lifecycle.createLink.emit({url:d});if(u instanceof HTMLLinkElement)return u}});l&&document.head.appendChild(c)}):o.forEach(a=>{const{link:c,needAttach:l}=createLink({url:a,cb:()=>{},attrs:{rel:"stylesheet",type:"text/css"},createLinkHook:d=>{const u=e.loaderHook.lifecycle.createLink.emit({url:d});if(u instanceof HTMLLinkElement)return u},needDeleteLink:!1});l&&document.head.appendChild(c)}),n?s.forEach(a=>{const{link:c,needAttach:l}=createLink({url:a,cb:()=>{},attrs:{rel:"preload",as:"script",crossorigin:"anonymous"},createLinkHook:d=>{const u=e.loaderHook.lifecycle.createLink.emit({url:d});if(u instanceof HTMLLinkElement)return u}});l&&document.head.appendChild(c)}):s.forEach(a=>{const{script:c,needAttach:l}=createScript({url:a,cb:()=>{},attrs:{crossorigin:"anonymous",fetchpriority:"high"},createScriptHook:d=>{const u=e.loaderHook.lifecycle.createScript.emit({url:d});if(u instanceof HTMLScriptElement)return u},needDeleteScript:!0});l&&document.head.appendChild(c)}))}function _extends$4(){return _extends$4=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},_extends$4.apply(this,arguments)}function assignRemoteInfo(t,e){(!("remoteEntry"in e)||!e.remoteEntry)&&error(`The attribute remoteEntry of ${name} must not be undefined.`);const{remoteEntry:r}=e;let n=getResourceUrl(e,r);!isBrowserEnv$1()&&!n.startsWith("http")&&(n=`https:${n}`),t.type=e.remoteEntryType,t.entryGlobalName=e.globalName,t.entry=n,t.version=e.version,t.buildVersion=e.buildVersion}function snapshotPlugin(){return{name:"snapshot-plugin",async afterResolve(t){const{remote:e,pkgNameOrAlias:r,expose:n,origin:o,remoteInfo:s}=t;if(!isRemoteInfoWithEntry(e)||!isPureRemoteEntry(e)){const{remoteSnapshot:i,globalSnapshot:a}=await o.snapshotHandler.loadRemoteSnapshotInfo(e);assignRemoteInfo(s,i);const c={remote:e,preloadConfig:{nameOrAlias:r,exposes:[n],resourceCategory:"sync",share:!1,depsRemote:!1}},l=await o.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:o,preloadOptions:c,remoteInfo:s,remote:e,remoteSnapshot:i,globalSnapshot:a});return l&&preloadAssets(s,o,l,!1),_extends$4({},t,{remoteSnapshot:i})}return t}}}function splitId(t){const e=t.split(":");return e.length===1?{name:e[0],version:void 0}:e.length===2?{name:e[0],version:e[1]}:{name:e[1],version:e[2]}}function traverseModuleInfo(t,e,r,n,o={},s){const i=getFMId(e),{value:a}=getInfoWithoutType(t,i),c=s||a;if(c&&!isManifestProvider(c)&&(r(c,e,n),c.remotesInfo)){const l=Object.keys(c.remotesInfo);for(const d of l){if(o[d])continue;o[d]=!0;const u=splitId(d),h=c.remotesInfo[d];traverseModuleInfo(t,{name:u.name,version:h.matchedVersion},r,!1,o,void 0)}}}function generatePreloadAssets(t,e,r,n,o){const s=[],i=[],a=[],c=new Set,l=new Set,{options:d}=t,{preloadConfig:u}=e,{depsRemote:h}=u;if(traverseModuleInfo(n,r,(g,p,w)=>{let I;if(w)I=u;else if(Array.isArray(h)){const v=h.find(S=>S.nameOrAlias===p.name||S.nameOrAlias===p.alias);if(!v)return;I=defaultPreloadArgs(v)}else if(h===!0)I=u;else return;const N=getResourceUrl(g,"remoteEntry"in g?g.remoteEntry:"");N&&a.push({name:p.name,moduleInfo:{name:p.name,entry:N,type:"remoteEntryType"in g?g.remoteEntryType:"global",entryGlobalName:"globalName"in g?g.globalName:p.name,shareScope:"",version:"version"in g?g.version:void 0},url:N});let j="modules"in g?g.modules:[];const _=normalizePreloadExposes(I.exposes);if(_.length&&"modules"in g){var C;j=g==null||(C=g.modules)==null?void 0:C.reduce((v,S)=>((_==null?void 0:_.indexOf(S.moduleName))!==-1&&v.push(S),v),[])}function k(v){const S=v.map(O=>getResourceUrl(g,O));return I.filter?S.filter(I.filter):S}if(j){const v=j.length;for(let S=0;S<v;S++){const O=j[S],B=`${p.name}/${O.moduleName}`;t.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:O.moduleName==="."?p.name:B,name:p.name,remoteSnapshot:g,preloadConfig:I,remote:p,origin:t}),!getPreloaded(B)&&(I.resourceCategory==="all"?(s.push(...k(O.assets.css.async)),s.push(...k(O.assets.css.sync)),i.push(...k(O.assets.js.async)),i.push(...k(O.assets.js.sync))):(I.resourceCategory="sync")&&(s.push(...k(O.assets.css.sync)),i.push(...k(O.assets.js.sync))),setPreloaded(B))}}},!0,{},o),o.shared){const g=(p,w)=>{const I=getRegisteredShare(t.shareScopeMap,w.sharedName,p,t.sharedHandler.hooks.lifecycle.resolveShare);I&&typeof I.lib=="function"&&(w.assets.js.sync.forEach(N=>{c.add(N)}),w.assets.css.sync.forEach(N=>{l.add(N)}))};o.shared.forEach(p=>{var w;const I=(w=d.shared)==null?void 0:w[p.sharedName];if(!I)return;const N=p.version?I.find(_=>_.version===p.version):I;if(!N)return;arrayOptions(N).forEach(_=>{g(_,p)})})}const m=i.filter(g=>!c.has(g));return{cssAssets:s.filter(g=>!l.has(g)),jsAssetsWithoutEntry:m,entryAssets:a}}const generatePreloadAssetsPlugin=function(){return{name:"generate-preload-assets-plugin",async generatePreloadAssets(t){const{origin:e,preloadOptions:r,remoteInfo:n,remote:o,globalSnapshot:s,remoteSnapshot:i}=t;return isRemoteInfoWithEntry(o)&&isPureRemoteEntry(o)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:o.name,url:o.entry,moduleInfo:{name:n.name,entry:o.entry,type:"global",entryGlobalName:"",shareScope:""}}]}:(assignRemoteInfo(n,i),generatePreloadAssets(e,r,n,s,i))}}};function _extends$3(){return _extends$3=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},_extends$3.apply(this,arguments)}class SnapshotHandler{async loadSnapshot(e){const{options:r}=this.HostInstance,{hostGlobalSnapshot:n,remoteSnapshot:o,globalSnapshot:s}=this.getGlobalRemoteInfo(e),{remoteSnapshot:i,globalSnapshot:a}=await this.hooks.lifecycle.loadSnapshot.emit({options:r,moduleInfo:e,hostGlobalSnapshot:n,remoteSnapshot:o,globalSnapshot:s});return{remoteSnapshot:i,globalSnapshot:a}}async loadRemoteSnapshotInfo(e){const{options:r}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:r,moduleInfo:e});let n=getGlobalSnapshotInfoByModuleInfo({name:this.HostInstance.options.name,version:this.HostInstance.options.version});n||(n={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},addGlobalSnapshot({[this.HostInstance.options.name]:n})),n&&"remotesInfo"in n&&!getInfoWithoutType(n.remotesInfo,e.name).value&&("version"in e||"entry"in e)&&(n.remotesInfo=_extends$3({},n==null?void 0:n.remotesInfo,{[e.name]:{matchedVersion:"version"in e?e.version:e.entry}}));const{hostGlobalSnapshot:o,remoteSnapshot:s,globalSnapshot:i}=this.getGlobalRemoteInfo(e),{remoteSnapshot:a,globalSnapshot:c}=await this.hooks.lifecycle.loadSnapshot.emit({options:r,moduleInfo:e,hostGlobalSnapshot:o,remoteSnapshot:s,globalSnapshot:i});if(a)if(isManifestProvider(a)){const l=await this.getManifestJson(a.remoteEntry,e,{}),d=setGlobalSnapshotInfoByModuleInfo(_extends$3({},e,{entry:a.remoteEntry}),l);return{remoteSnapshot:l,globalSnapshot:d}}else{const{remoteSnapshot:l}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:a,from:"global"});return{remoteSnapshot:l,globalSnapshot:c}}else if(isRemoteInfoWithEntry(e)){const l=await this.getManifestJson(e.entry,e,{}),d=setGlobalSnapshotInfoByModuleInfo(e,l),{remoteSnapshot:u}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:l,from:"global"});return{remoteSnapshot:u,globalSnapshot:d}}else error(`
Cannot get remoteSnapshot with the n