@linagora/linid-im-front-corelib 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/.github/workflows/pull-request.yml +26 -1
  2. package/.github/workflows/release.yml +1 -1
  3. package/CHANGELOG.md +13 -0
  4. package/CONTRIBUTING.md +7 -2
  5. package/dist/core-lib.es.js +921 -851
  6. package/dist/core-lib.umd.js +9 -9
  7. package/dist/package.json +20 -12
  8. package/dist/types/src/index.d.ts +3 -0
  9. package/dist/types/src/services/httpClientService.d.ts +13 -0
  10. package/dist/types/src/services/linIdConfigurationService.d.ts +21 -0
  11. package/dist/types/src/stores/linIdConfigurationStore.d.ts +79 -0
  12. package/dist/types/src/types/linidConfiguration.d.ts +42 -0
  13. package/docs/services.md +39 -0
  14. package/docs/types-and-interfaces.md +56 -9
  15. package/eslint.config.js +2 -1
  16. package/package.json +19 -11
  17. package/src/index.ts +11 -0
  18. package/src/services/httpClientService.ts +61 -0
  19. package/src/services/linIdConfigurationService.ts +73 -0
  20. package/src/stores/linIdConfigurationStore.ts +116 -0
  21. package/src/types/linidConfiguration.ts +70 -0
  22. package/tests/unit/components/LinidZoneRenderer.spec.js +135 -0
  23. package/tests/unit/lifecycle/skeleton.spec.js +138 -0
  24. package/tests/unit/services/federationService.spec.js +146 -0
  25. package/tests/unit/services/httpClientService.spec.js +49 -0
  26. package/tests/unit/services/linIdConfigurationService.spec.js +113 -0
  27. package/tests/unit/stores/linIdConfigurationStore.spec.js +171 -0
  28. package/tests/unit/stores/linidZoneStore.spec.js +94 -0
  29. package/tsconfig.json +11 -27
  30. package/tsconfig.lib.json +20 -0
  31. package/tsconfig.node.json +9 -0
  32. package/tsconfig.spec.json +16 -0
  33. package/vite.config.ts +11 -16
  34. package/vitest.config.ts +19 -0
  35. package/dist/types/vite.config.d.ts +0 -2
@@ -1,12 +1,12 @@
1
- (function(t,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],s):(t=typeof globalThis<"u"?globalThis:t||self,s(t.CoreLib={},t.Vue))})(this,(function(exports,vue){"use strict";var runtime={},runtime_cjs={},index_cjs$3={},index_cjs$2={},index_cjs$1={},hasRequiredIndex_cjs$3;function requireIndex_cjs$3(){if(hasRequiredIndex_cjs$3)return index_cjs$1;hasRequiredIndex_cjs$3=1;const FederationModuleManifest="federation-manifest.json",MANIFEST_EXT=".json",BROWSER_LOG_KEY="FEDERATION_DEBUG",NameTransformSymbol={AT:"@",HYPHEN:"-",SLASH:"/"},NameTransformMap={[NameTransformSymbol.AT]:"scope_",[NameTransformSymbol.HYPHEN]:"_",[NameTransformSymbol.SLASH]:"__"},EncodedNameTransformMap={[NameTransformMap[NameTransformSymbol.AT]]:NameTransformSymbol.AT,[NameTransformMap[NameTransformSymbol.HYPHEN]]:NameTransformSymbol.HYPHEN,[NameTransformMap[NameTransformSymbol.SLASH]]:NameTransformSymbol.SLASH},SEPARATOR=":",ManifestFileName="mf-manifest.json",StatsFileName="mf-stats.json",MFModuleType={NPM:"npm",APP:"app"},MODULE_DEVTOOL_IDENTIFIER="__MF_DEVTOOLS_MODULE_INFO__",ENCODE_NAME_PREFIX="ENCODE_NAME_PREFIX",TEMP_DIR=".federation",MFPrefetchCommon={identifier:"MFDataPrefetch",globalKey:"__PREFETCH__",library:"mf-data-prefetch",exportsKey:"__PREFETCH_EXPORTS__",fileName:"bootstrap.js"};var ContainerPlugin=Object.freeze({__proto__:null}),ContainerReferencePlugin=Object.freeze({__proto__:null}),ModuleFederationPlugin=Object.freeze({__proto__:null}),SharePlugin=Object.freeze({__proto__:null});function isBrowserEnv(){return typeof window<"u"&&typeof window.document<"u"}function isReactNativeEnv(){return typeof navigator<"u"&&navigator?.product==="ReactNative"}function isBrowserDebug(){try{if(isBrowserEnv()&&window.localStorage)return!!localStorage.getItem(BROWSER_LOG_KEY)}catch{return!1}return!1}function isDebugMode(){return typeof process<"u"&&process.env&&process.env.FEDERATION_DEBUG?!!process.env.FEDERATION_DEBUG:typeof FEDERATION_DEBUG<"u"&&FEDERATION_DEBUG?!0:isBrowserDebug()}const getProcessEnv=function(){return typeof process<"u"&&process.env?process.env:{}},LOG_CATEGORY="[ Federation Runtime ]",parseEntry=(t,s,h=SEPARATOR)=>{const u=t.split(h),d=getProcessEnv().NODE_ENV==="development"&&s,E="*",_=y=>y.startsWith("http")||y.includes(MANIFEST_EXT);if(u.length>=2){let[y,...R]=u;t.startsWith(h)&&(y=u.slice(0,2).join(h),R=[d||u.slice(2).join(h)]);let $=d||R.join(h);return _($)?{name:y,entry:$}:{name:y,version:$||E}}else if(u.length===1){const[y]=u;return d&&_(d)?{name:y,entry:d}:{name:y,version:d||E}}else throw`Invalid entry value: ${t}`},composeKeyWithSeparator=function(...t){return t.length?t.reduce((s,h)=>h?s?`${s}${SEPARATOR}${h}`:h:s,""):""},encodeName=function(t,s="",h=!1){try{const u=h?".js":"";return`${s}${t.replace(new RegExp(`${NameTransformSymbol.AT}`,"g"),NameTransformMap[NameTransformSymbol.AT]).replace(new RegExp(`${NameTransformSymbol.HYPHEN}`,"g"),NameTransformMap[NameTransformSymbol.HYPHEN]).replace(new RegExp(`${NameTransformSymbol.SLASH}`,"g"),NameTransformMap[NameTransformSymbol.SLASH])}${u}`}catch(u){throw u}},decodeName=function(t,s,h){try{let u=t;if(s){if(!u.startsWith(s))return u;u=u.replace(new RegExp(s,"g"),"")}return u=u.replace(new RegExp(`${NameTransformMap[NameTransformSymbol.AT]}`,"g"),EncodedNameTransformMap[NameTransformMap[NameTransformSymbol.AT]]).replace(new RegExp(`${NameTransformMap[NameTransformSymbol.SLASH]}`,"g"),EncodedNameTransformMap[NameTransformMap[NameTransformSymbol.SLASH]]).replace(new RegExp(`${NameTransformMap[NameTransformSymbol.HYPHEN]}`,"g"),EncodedNameTransformMap[NameTransformMap[NameTransformSymbol.HYPHEN]]),h&&(u=u.replace(".js","")),u}catch(u){throw u}},generateExposeFilename=(t,s)=>{if(!t)return"";let h=t;return h==="."&&(h="default_export"),h.startsWith("./")&&(h=h.replace("./","")),encodeName(h,"__federation_expose_",s)},generateShareFilename=(t,s)=>t?encodeName(t,"__federation_shared_",s):"",getResourceUrl=(t,s)=>{if("getPublicPath"in t){let h;return t.getPublicPath.startsWith("function")?h=new Function("return "+t.getPublicPath)()():h=new Function(t.getPublicPath)(),`${h}${s}`}else return"publicPath"in t?!isBrowserEnv()&&!isReactNativeEnv()&&"ssrPublicPath"in t?`${t.ssrPublicPath}${s}`:`${t.publicPath}${s}`:(console.warn("Cannot get resource URL. If in debug mode, please ignore.",t,s),"")},assert=(t,s)=>{t||error(s)},error=t=>{throw new Error(`${LOG_CATEGORY}: ${t}`)},warn=t=>{console.warn(`${LOG_CATEGORY}: ${t}`)};function safeToString(t){try{return JSON.stringify(t,null,2)}catch{return""}}const VERSION_PATTERN_REGEXP=/^([\d^=v<>~]|[*xX]$)/;function isRequiredVersion(t){return VERSION_PATTERN_REGEXP.test(t)}const simpleJoinRemoteEntry=(t,s)=>{if(!t)return s;const u=(d=>{if(d===".")return"";if(d.startsWith("./"))return d.replace("./","");if(d.startsWith("/")){const E=d.slice(1);return E.endsWith("/")?E.slice(0,-1):E}return d})(t);return u?u.endsWith("/")?`${u}${s}`:`${u}/${s}`:s};function inferAutoPublicPath(t){return t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")}function generateSnapshotFromManifest(t,s={}){const{remotes:h={},overrides:u={},version:d}=s;let E;const _=()=>"publicPath"in t.metaData?t.metaData.publicPath==="auto"&&d?inferAutoPublicPath(d):t.metaData.publicPath:t.metaData.getPublicPath,y=Object.keys(u);let R={};Object.keys(h).length||(R=t.remotes?.reduce((D,P)=>{let F;const V=P.federationContainerName;return y.includes(V)?F=u[V]:"version"in P?F=P.version:F=P.entry,D[V]={matchedVersion:F},D},{})||{}),Object.keys(h).forEach(D=>R[D]={matchedVersion:y.includes(D)?u[D]:h[D]});const{remoteEntry:{path:$,name:x,type:C},types:H={path:"",name:"",zip:"",api:""},buildInfo:{buildVersion:B},globalName:w,ssrRemoteEntry:U}=t.metaData,{exposes:Q}=t;let J={version:d||"",buildVersion:B,globalName:w,remoteEntry:simpleJoinRemoteEntry($,x),remoteEntryType:C,remoteTypes:simpleJoinRemoteEntry(H.path,H.name),remoteTypesZip:H.zip||"",remoteTypesAPI:H.api||"",remotesInfo:R,shared:t?.shared.map(D=>({assets:D.assets,sharedName:D.name,version:D.version})),modules:Q?.map(D=>({moduleName:D.name,modulePath:D.path,assets:D.assets}))};if(t.metaData?.prefetchInterface){const D=t.metaData.prefetchInterface;J={...J,prefetchInterface:D}}if(t.metaData?.prefetchEntry){const{path:D,name:P,type:F}=t.metaData.prefetchEntry;J={...J,prefetchEntry:simpleJoinRemoteEntry(D,P),prefetchEntryType:F}}if("publicPath"in t.metaData?E={...J,publicPath:_(),ssrPublicPath:t.metaData.ssrPublicPath}:E={...J,getPublicPath:_()},U){const D=simpleJoinRemoteEntry(U.path,U.name);E.ssrRemoteEntry=D,E.ssrRemoteEntryType=U.type||"commonjs-module"}return E}function isManifestProvider(t){return!!("remoteEntry"in t&&t.remoteEntry.includes(MANIFEST_EXT))}function getManifestFileName(t){if(!t)return{statsFileName:StatsFileName,manifestFileName:ManifestFileName};let s=typeof t=="boolean"?"":t.filePath||"",h=typeof t=="boolean"?"":t.fileName||"";const u=".json",d=R=>R.endsWith(u)?R:`${R}${u}`,E=(R,$)=>R.replace(u,`${$}${u}`),_=h?d(h):ManifestFileName,y=h?E(_,"-stats"):StatsFileName;return{statsFileName:simpleJoinRemoteEntry(s,y),manifestFileName:simpleJoinRemoteEntry(s,_)}}const PREFIX="[ Module Federation ]",DEFAULT_DELEGATE=console,LOGGER_STACK_SKIP_TOKENS=["logger.ts","logger.js","captureStackTrace","Logger.emit","Logger.log","Logger.info","Logger.warn","Logger.error","Logger.debug"];function captureStackTrace(){try{const t=new Error().stack;if(!t)return;const[,...s]=t.split(`
2
- `),h=s.filter(d=>!LOGGER_STACK_SKIP_TOKENS.some(E=>d.includes(E)));return h.length?`Stack trace:
3
- ${h.slice(0,5).join(`
4
- `)}`:void 0}catch{return}}class Logger{constructor(s,h=DEFAULT_DELEGATE){this.prefix=s,this.delegate=h??DEFAULT_DELEGATE}setPrefix(s){this.prefix=s}setDelegate(s){this.delegate=s??DEFAULT_DELEGATE}emit(s,h){const u=this.delegate,E=isDebugMode()?captureStackTrace():void 0,_=E?[...h,E]:h,y=(()=>{switch(s){case"log":return["log","info"];case"info":return["info","log"];case"warn":return["warn","info","log"];case"error":return["error","warn","log"];case"debug":default:return["debug","log"]}})();for(const R of y){const $=u[R];if(typeof $=="function"){$.call(u,this.prefix,..._);return}}for(const R of y){const $=DEFAULT_DELEGATE[R];if(typeof $=="function"){$.call(DEFAULT_DELEGATE,this.prefix,..._);return}}}log(...s){this.emit("log",s)}warn(...s){this.emit("warn",s)}error(...s){this.emit("error",s)}success(...s){this.emit("info",s)}info(...s){this.emit("info",s)}ready(...s){this.emit("info",s)}debug(...s){isDebugMode()&&this.emit("debug",s)}}function createLogger(t){return new Logger(t)}function createInfrastructureLogger(t){const s=new Logger(t);return Object.defineProperty(s,"__mf_infrastructure_logger__",{value:!0,enumerable:!1,configurable:!1}),s}function bindLoggerToCompiler(t,s,h){if(t.__mf_infrastructure_logger__&&s?.getInfrastructureLogger)try{const u=s.getInfrastructureLogger(h);u&&typeof u=="object"&&(typeof u.log=="function"||typeof u.info=="function"||typeof u.warn=="function"||typeof u.error=="function")&&t.setDelegate(u)}catch{t.setDelegate(void 0)}}const logger=createLogger(PREFIX),infrastructureLogger=createInfrastructureLogger(PREFIX);async function safeWrapper(t,s){try{return await t()}catch(h){!s&&warn(h);return}}function isStaticResourcesEqual(t,s){const h=/^(https?:)?\/\//i,u=t.replace(h,"").replace(/\/$/,""),d=s.replace(h,"").replace(/\/$/,"");return u===d}function createScript(t){let s=null,h=!0,u=2e4,d;const E=document.getElementsByTagName("script");for(let y=0;y<E.length;y++){const R=E[y],$=R.getAttribute("src");if($&&isStaticResourcesEqual($,t.url)){s=R,h=!1;break}}if(!s){const y=t.attrs;s=document.createElement("script"),s.type=y?.type==="module"?"module":"text/javascript";let R;t.createScriptHook&&(R=t.createScriptHook(t.url,t.attrs),R instanceof HTMLScriptElement?s=R:typeof R=="object"&&("script"in R&&R.script&&(s=R.script),"timeout"in R&&R.timeout&&(u=R.timeout))),s.src||(s.src=t.url),y&&!R&&Object.keys(y).forEach($=>{s&&($==="async"||$==="defer"?s[$]=y[$]:s.getAttribute($)||s.setAttribute($,y[$]))})}const _=async(y,R)=>{clearTimeout(d);const $=()=>{R?.type==="error"?t?.onErrorCallback&&t?.onErrorCallback(R):t?.cb&&t?.cb()};if(s&&(s.onerror=null,s.onload=null,safeWrapper(()=>{const{needDeleteScript:x=!0}=t;x&&s?.parentNode&&s.parentNode.removeChild(s)}),y&&typeof y=="function")){const x=y(R);if(x instanceof Promise){const C=await x;return $(),C}return $(),x}$()};return s.onerror=_.bind(null,s.onerror),s.onload=_.bind(null,s.onload),d=setTimeout(()=>{_(null,new Error(`Remote script "${t.url}" time-outed.`))},u),{script:s,needAttach:h}}function createLink(t){let s=null,h=!0;const u=document.getElementsByTagName("link");for(let E=0;E<u.length;E++){const _=u[E],y=_.getAttribute("href"),R=_.getAttribute("rel");if(y&&isStaticResourcesEqual(y,t.url)&&R===t.attrs.rel){s=_,h=!1;break}}if(!s){s=document.createElement("link"),s.setAttribute("href",t.url);let E;const _=t.attrs;t.createLinkHook&&(E=t.createLinkHook(t.url,_),E instanceof HTMLLinkElement&&(s=E)),_&&!E&&Object.keys(_).forEach(y=>{s&&!s.getAttribute(y)&&s.setAttribute(y,_[y])})}const d=(E,_)=>{const y=()=>{_?.type==="error"?t?.onErrorCallback&&t?.onErrorCallback(_):t?.cb&&t?.cb()};if(s&&(s.onerror=null,s.onload=null,safeWrapper(()=>{const{needDeleteLink:R=!0}=t;R&&s?.parentNode&&s.parentNode.removeChild(s)}),E)){const R=E(_);return y(),R}y()};return s.onerror=d.bind(null,s.onerror),s.onload=d.bind(null,s.onload),{link:s,needAttach:h}}function loadScript(t,s){const{attrs:h={},createScriptHook:u}=s;return new Promise((d,E)=>{const{script:_,needAttach:y}=createScript({url:t,cb:d,onErrorCallback:E,attrs:{fetchpriority:"high",...h},createScriptHook:u,needDeleteScript:!0});y&&document.head.appendChild(_)})}const sdkImportCache=new Map;function importNodeModule(t){if(!t)throw new Error("import specifier is required");if(sdkImportCache.has(t))return sdkImportCache.get(t);const h=new Function("name","return import(name)")(t).then(u=>u).catch(u=>{throw console.error(`Error importing module ${t}:`,u),sdkImportCache.delete(t),u});return sdkImportCache.set(t,h),h}const loadNodeFetch=async()=>{const t=await importNodeModule("node-fetch");return t.default||t},lazyLoaderHookFetch=async(t,s,h)=>{const d=await((E,_)=>h.lifecycle.fetch.emit(E,_))(t,s||{});return!d||!(d instanceof Response)?(typeof fetch>"u"?await loadNodeFetch():fetch)(t,s||{}):d},createScriptNode=typeof ENV_TARGET>"u"||ENV_TARGET!=="web"?(url,cb,attrs,loaderHook)=>{if(loaderHook?.createScriptHook){const t=loaderHook.createScriptHook(url);t&&typeof t=="object"&&"url"in t&&(url=t.url)}let urlObj;try{urlObj=new URL(url)}catch(t){console.error("Error constructing URL:",t),cb(new Error(`Invalid URL: ${t}`));return}const getFetch=async()=>loaderHook?.fetch?(t,s)=>lazyLoaderHookFetch(t,s,loaderHook):typeof fetch>"u"?loadNodeFetch():fetch,handleScriptFetch=async(f,urlObj)=>{try{const res=await f(urlObj.href),data=await res.text(),[path,vm]=await Promise.all([importNodeModule("path"),importNodeModule("vm")]),scriptContext={exports:{},module:{exports:{}}},urlDirname=urlObj.pathname.split("/").slice(0,-1).join("/"),filename=path.basename(urlObj.pathname),script=new vm.Script(`(function(exports, module, require, __dirname, __filename) {${data}
5
- })`,{filename,importModuleDynamically:vm.constants?.USE_MAIN_CONTEXT_DEFAULT_LOADER??importNodeModule});script.runInThisContext()(scriptContext.exports,scriptContext.module,eval("require"),urlDirname,filename);const exportedInterface=scriptContext.module.exports||scriptContext.exports;if(attrs&&exportedInterface&&attrs.globalName){const t=exportedInterface[attrs.globalName]||exportedInterface;cb(void 0,t);return}cb(void 0,exportedInterface)}catch(t){cb(t instanceof Error?t:new Error(`Script execution error: ${t}`))}};getFetch().then(async t=>{if(attrs?.type==="esm"||attrs?.type==="module")return loadModule(urlObj.href,{fetch:t,vm:await importNodeModule("vm")}).then(async s=>{await s.evaluate(),cb(void 0,s.namespace)}).catch(s=>{cb(s instanceof Error?s:new Error(`Script execution error: ${s}`))});handleScriptFetch(t,urlObj)}).catch(t=>{cb(t)})}:(t,s,h,u)=>{s(new Error("createScriptNode is disabled in non-Node.js environment"))},loadScriptNode=typeof ENV_TARGET>"u"||ENV_TARGET!=="web"?(t,s)=>new Promise((h,u)=>{createScriptNode(t,(d,E)=>{if(d)u(d);else{const _=s?.attrs?.globalName||`__FEDERATION_${s?.attrs?.name}:custom__`,y=globalThis[_]=E;h(y)}},s.attrs,s.loaderHook)}):(t,s)=>{throw new Error("loadScriptNode is disabled in non-Node.js environment")},esmModuleCache=new Map;async function loadModule(t,s){if(esmModuleCache.has(t))return esmModuleCache.get(t);const{fetch:h,vm:u}=s,E=await(await h(t)).text(),_=new u.SourceTextModule(E,{importModuleDynamically:async(y,R)=>{const $=new URL(y,t).href;return loadModule($,s)}});return esmModuleCache.set(t,_),await _.link(async y=>{const R=new URL(y,t).href;return await loadModule(R,s)}),_}function normalizeOptions(t,s,h){return function(u){if(u===!1)return!1;if(typeof u>"u")return t?s:!1;if(u===!0)return s;if(u&&typeof u=="object")return{...s,...u};throw new Error(`Unexpected type for \`${h}\`, expect boolean/undefined/object, got: ${typeof u}`)}}const createModuleFederationConfig=t=>t;return index_cjs$1.BROWSER_LOG_KEY=BROWSER_LOG_KEY,index_cjs$1.ENCODE_NAME_PREFIX=ENCODE_NAME_PREFIX,index_cjs$1.EncodedNameTransformMap=EncodedNameTransformMap,index_cjs$1.FederationModuleManifest=FederationModuleManifest,index_cjs$1.MANIFEST_EXT=MANIFEST_EXT,index_cjs$1.MFModuleType=MFModuleType,index_cjs$1.MFPrefetchCommon=MFPrefetchCommon,index_cjs$1.MODULE_DEVTOOL_IDENTIFIER=MODULE_DEVTOOL_IDENTIFIER,index_cjs$1.ManifestFileName=ManifestFileName,index_cjs$1.NameTransformMap=NameTransformMap,index_cjs$1.NameTransformSymbol=NameTransformSymbol,index_cjs$1.SEPARATOR=SEPARATOR,index_cjs$1.StatsFileName=StatsFileName,index_cjs$1.TEMP_DIR=TEMP_DIR,index_cjs$1.assert=assert,index_cjs$1.bindLoggerToCompiler=bindLoggerToCompiler,index_cjs$1.composeKeyWithSeparator=composeKeyWithSeparator,index_cjs$1.containerPlugin=ContainerPlugin,index_cjs$1.containerReferencePlugin=ContainerReferencePlugin,index_cjs$1.createInfrastructureLogger=createInfrastructureLogger,index_cjs$1.createLink=createLink,index_cjs$1.createLogger=createLogger,index_cjs$1.createModuleFederationConfig=createModuleFederationConfig,index_cjs$1.createScript=createScript,index_cjs$1.createScriptNode=createScriptNode,index_cjs$1.decodeName=decodeName,index_cjs$1.encodeName=encodeName,index_cjs$1.error=error,index_cjs$1.generateExposeFilename=generateExposeFilename,index_cjs$1.generateShareFilename=generateShareFilename,index_cjs$1.generateSnapshotFromManifest=generateSnapshotFromManifest,index_cjs$1.getManifestFileName=getManifestFileName,index_cjs$1.getProcessEnv=getProcessEnv,index_cjs$1.getResourceUrl=getResourceUrl,index_cjs$1.inferAutoPublicPath=inferAutoPublicPath,index_cjs$1.infrastructureLogger=infrastructureLogger,index_cjs$1.isBrowserEnv=isBrowserEnv,index_cjs$1.isDebugMode=isDebugMode,index_cjs$1.isManifestProvider=isManifestProvider,index_cjs$1.isReactNativeEnv=isReactNativeEnv,index_cjs$1.isRequiredVersion=isRequiredVersion,index_cjs$1.isStaticResourcesEqual=isStaticResourcesEqual,index_cjs$1.loadScript=loadScript,index_cjs$1.loadScriptNode=loadScriptNode,index_cjs$1.logger=logger,index_cjs$1.moduleFederationPlugin=ModuleFederationPlugin,index_cjs$1.normalizeOptions=normalizeOptions,index_cjs$1.parseEntry=parseEntry,index_cjs$1.safeToString=safeToString,index_cjs$1.safeWrapper=safeWrapper,index_cjs$1.sharePlugin=SharePlugin,index_cjs$1.simpleJoinRemoteEntry=simpleJoinRemoteEntry,index_cjs$1.warn=warn,index_cjs$1}var index_cjs={},hasRequiredIndex_cjs$2;function requireIndex_cjs$2(){if(hasRequiredIndex_cjs$2)return index_cjs;hasRequiredIndex_cjs$2=1;const t="RUNTIME-001",s="RUNTIME-002",h="RUNTIME-003",u="RUNTIME-004",d="RUNTIME-005",E="RUNTIME-006",_="RUNTIME-007",y="RUNTIME-008",R="RUNTIME-009",$="TYPE-001",x="BUILD-001",C="BUILD-002",H=D=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${D.split("-")[0].toLowerCase()}/${D}`,B=(D,P,F,V)=>{const ee=[`${[P[D]]} #${D}`];return F&&ee.push(`args: ${JSON.stringify(F)}`),ee.push(H(D)),V&&ee.push(`Original Error Message:
1
+ (function(t,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],s):(t=typeof globalThis<"u"?globalThis:t||self,s(t.CoreLib={},t.Vue))})(this,(function(exports,vue){"use strict";var runtime={},runtime_cjs={},index_cjs$3={},index_cjs$2={},index_cjs$1={},hasRequiredIndex_cjs$3;function requireIndex_cjs$3(){if(hasRequiredIndex_cjs$3)return index_cjs$1;hasRequiredIndex_cjs$3=1;const FederationModuleManifest="federation-manifest.json",MANIFEST_EXT=".json",BROWSER_LOG_KEY="FEDERATION_DEBUG",NameTransformSymbol={AT:"@",HYPHEN:"-",SLASH:"/"},NameTransformMap={[NameTransformSymbol.AT]:"scope_",[NameTransformSymbol.HYPHEN]:"_",[NameTransformSymbol.SLASH]:"__"},EncodedNameTransformMap={[NameTransformMap[NameTransformSymbol.AT]]:NameTransformSymbol.AT,[NameTransformMap[NameTransformSymbol.HYPHEN]]:NameTransformSymbol.HYPHEN,[NameTransformMap[NameTransformSymbol.SLASH]]:NameTransformSymbol.SLASH},SEPARATOR=":",ManifestFileName="mf-manifest.json",StatsFileName="mf-stats.json",MFModuleType={NPM:"npm",APP:"app"},MODULE_DEVTOOL_IDENTIFIER="__MF_DEVTOOLS_MODULE_INFO__",ENCODE_NAME_PREFIX="ENCODE_NAME_PREFIX",TEMP_DIR=".federation",MFPrefetchCommon={identifier:"MFDataPrefetch",globalKey:"__PREFETCH__",library:"mf-data-prefetch",exportsKey:"__PREFETCH_EXPORTS__",fileName:"bootstrap.js"};var ContainerPlugin=Object.freeze({__proto__:null}),ContainerReferencePlugin=Object.freeze({__proto__:null}),ModuleFederationPlugin=Object.freeze({__proto__:null}),SharePlugin=Object.freeze({__proto__:null});function isBrowserEnv(){return typeof window<"u"&&typeof window.document<"u"}function isReactNativeEnv(){return typeof navigator<"u"&&navigator?.product==="ReactNative"}function isBrowserDebug(){try{if(isBrowserEnv()&&window.localStorage)return!!localStorage.getItem(BROWSER_LOG_KEY)}catch{return!1}return!1}function isDebugMode(){return typeof process<"u"&&process.env&&process.env.FEDERATION_DEBUG?!!process.env.FEDERATION_DEBUG:typeof FEDERATION_DEBUG<"u"&&FEDERATION_DEBUG?!0:isBrowserDebug()}const getProcessEnv=function(){return typeof process<"u"&&process.env?process.env:{}},LOG_CATEGORY="[ Federation Runtime ]",parseEntry=(t,s,d=SEPARATOR)=>{const u=t.split(d),h=getProcessEnv().NODE_ENV==="development"&&s,E="*",_=y=>y.startsWith("http")||y.includes(MANIFEST_EXT);if(u.length>=2){let[y,...R]=u;t.startsWith(d)&&(y=u.slice(0,2).join(d),R=[h||u.slice(2).join(d)]);let $=h||R.join(d);return _($)?{name:y,entry:$}:{name:y,version:$||E}}else if(u.length===1){const[y]=u;return h&&_(h)?{name:y,entry:h}:{name:y,version:h||E}}else throw`Invalid entry value: ${t}`},composeKeyWithSeparator=function(...t){return t.length?t.reduce((s,d)=>d?s?`${s}${SEPARATOR}${d}`:d:s,""):""},encodeName=function(t,s="",d=!1){try{const u=d?".js":"";return`${s}${t.replace(new RegExp(`${NameTransformSymbol.AT}`,"g"),NameTransformMap[NameTransformSymbol.AT]).replace(new RegExp(`${NameTransformSymbol.HYPHEN}`,"g"),NameTransformMap[NameTransformSymbol.HYPHEN]).replace(new RegExp(`${NameTransformSymbol.SLASH}`,"g"),NameTransformMap[NameTransformSymbol.SLASH])}${u}`}catch(u){throw u}},decodeName=function(t,s,d){try{let u=t;if(s){if(!u.startsWith(s))return u;u=u.replace(new RegExp(s,"g"),"")}return u=u.replace(new RegExp(`${NameTransformMap[NameTransformSymbol.AT]}`,"g"),EncodedNameTransformMap[NameTransformMap[NameTransformSymbol.AT]]).replace(new RegExp(`${NameTransformMap[NameTransformSymbol.SLASH]}`,"g"),EncodedNameTransformMap[NameTransformMap[NameTransformSymbol.SLASH]]).replace(new RegExp(`${NameTransformMap[NameTransformSymbol.HYPHEN]}`,"g"),EncodedNameTransformMap[NameTransformMap[NameTransformSymbol.HYPHEN]]),d&&(u=u.replace(".js","")),u}catch(u){throw u}},generateExposeFilename=(t,s)=>{if(!t)return"";let d=t;return d==="."&&(d="default_export"),d.startsWith("./")&&(d=d.replace("./","")),encodeName(d,"__federation_expose_",s)},generateShareFilename=(t,s)=>t?encodeName(t,"__federation_shared_",s):"",getResourceUrl=(t,s)=>{if("getPublicPath"in t){let d;return t.getPublicPath.startsWith("function")?d=new Function("return "+t.getPublicPath)()():d=new Function(t.getPublicPath)(),`${d}${s}`}else return"publicPath"in t?!isBrowserEnv()&&!isReactNativeEnv()&&"ssrPublicPath"in t?`${t.ssrPublicPath}${s}`:`${t.publicPath}${s}`:(console.warn("Cannot get resource URL. If in debug mode, please ignore.",t,s),"")},assert=(t,s)=>{t||error(s)},error=t=>{throw new Error(`${LOG_CATEGORY}: ${t}`)},warn=t=>{console.warn(`${LOG_CATEGORY}: ${t}`)};function safeToString(t){try{return JSON.stringify(t,null,2)}catch{return""}}const VERSION_PATTERN_REGEXP=/^([\d^=v<>~]|[*xX]$)/;function isRequiredVersion(t){return VERSION_PATTERN_REGEXP.test(t)}const simpleJoinRemoteEntry=(t,s)=>{if(!t)return s;const u=(h=>{if(h===".")return"";if(h.startsWith("./"))return h.replace("./","");if(h.startsWith("/")){const E=h.slice(1);return E.endsWith("/")?E.slice(0,-1):E}return h})(t);return u?u.endsWith("/")?`${u}${s}`:`${u}/${s}`:s};function inferAutoPublicPath(t){return t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")}function generateSnapshotFromManifest(t,s={}){const{remotes:d={},overrides:u={},version:h}=s;let E;const _=()=>"publicPath"in t.metaData?t.metaData.publicPath==="auto"&&h?inferAutoPublicPath(h):t.metaData.publicPath:t.metaData.getPublicPath,y=Object.keys(u);let R={};Object.keys(d).length||(R=t.remotes?.reduce((L,P)=>{let F;const V=P.federationContainerName;return y.includes(V)?F=u[V]:"version"in P?F=P.version:F=P.entry,L[V]={matchedVersion:F},L},{})||{}),Object.keys(d).forEach(L=>R[L]={matchedVersion:y.includes(L)?u[L]:d[L]});const{remoteEntry:{path:$,name:x,type:k},types:H={path:"",name:"",zip:"",api:""},buildInfo:{buildVersion:B},globalName:w,ssrRemoteEntry:U}=t.metaData,{exposes:Q}=t;let J={version:h||"",buildVersion:B,globalName:w,remoteEntry:simpleJoinRemoteEntry($,x),remoteEntryType:k,remoteTypes:simpleJoinRemoteEntry(H.path,H.name),remoteTypesZip:H.zip||"",remoteTypesAPI:H.api||"",remotesInfo:R,shared:t?.shared.map(L=>({assets:L.assets,sharedName:L.name,version:L.version})),modules:Q?.map(L=>({moduleName:L.name,modulePath:L.path,assets:L.assets}))};if(t.metaData?.prefetchInterface){const L=t.metaData.prefetchInterface;J={...J,prefetchInterface:L}}if(t.metaData?.prefetchEntry){const{path:L,name:P,type:F}=t.metaData.prefetchEntry;J={...J,prefetchEntry:simpleJoinRemoteEntry(L,P),prefetchEntryType:F}}if("publicPath"in t.metaData?E={...J,publicPath:_(),ssrPublicPath:t.metaData.ssrPublicPath}:E={...J,getPublicPath:_()},U){const L=simpleJoinRemoteEntry(U.path,U.name);E.ssrRemoteEntry=L,E.ssrRemoteEntryType=U.type||"commonjs-module"}return E}function isManifestProvider(t){return!!("remoteEntry"in t&&t.remoteEntry.includes(MANIFEST_EXT))}function getManifestFileName(t){if(!t)return{statsFileName:StatsFileName,manifestFileName:ManifestFileName};let s=typeof t=="boolean"?"":t.filePath||"",d=typeof t=="boolean"?"":t.fileName||"";const u=".json",h=R=>R.endsWith(u)?R:`${R}${u}`,E=(R,$)=>R.replace(u,`${$}${u}`),_=d?h(d):ManifestFileName,y=d?E(_,"-stats"):StatsFileName;return{statsFileName:simpleJoinRemoteEntry(s,y),manifestFileName:simpleJoinRemoteEntry(s,_)}}const PREFIX="[ Module Federation ]",DEFAULT_DELEGATE=console,LOGGER_STACK_SKIP_TOKENS=["logger.ts","logger.js","captureStackTrace","Logger.emit","Logger.log","Logger.info","Logger.warn","Logger.error","Logger.debug"];function captureStackTrace(){try{const t=new Error().stack;if(!t)return;const[,...s]=t.split(`
2
+ `),d=s.filter(h=>!LOGGER_STACK_SKIP_TOKENS.some(E=>h.includes(E)));return d.length?`Stack trace:
3
+ ${d.slice(0,5).join(`
4
+ `)}`:void 0}catch{return}}class Logger{constructor(s,d=DEFAULT_DELEGATE){this.prefix=s,this.delegate=d??DEFAULT_DELEGATE}setPrefix(s){this.prefix=s}setDelegate(s){this.delegate=s??DEFAULT_DELEGATE}emit(s,d){const u=this.delegate,E=isDebugMode()?captureStackTrace():void 0,_=E?[...d,E]:d,y=(()=>{switch(s){case"log":return["log","info"];case"info":return["info","log"];case"warn":return["warn","info","log"];case"error":return["error","warn","log"];case"debug":default:return["debug","log"]}})();for(const R of y){const $=u[R];if(typeof $=="function"){$.call(u,this.prefix,..._);return}}for(const R of y){const $=DEFAULT_DELEGATE[R];if(typeof $=="function"){$.call(DEFAULT_DELEGATE,this.prefix,..._);return}}}log(...s){this.emit("log",s)}warn(...s){this.emit("warn",s)}error(...s){this.emit("error",s)}success(...s){this.emit("info",s)}info(...s){this.emit("info",s)}ready(...s){this.emit("info",s)}debug(...s){isDebugMode()&&this.emit("debug",s)}}function createLogger(t){return new Logger(t)}function createInfrastructureLogger(t){const s=new Logger(t);return Object.defineProperty(s,"__mf_infrastructure_logger__",{value:!0,enumerable:!1,configurable:!1}),s}function bindLoggerToCompiler(t,s,d){if(t.__mf_infrastructure_logger__&&s?.getInfrastructureLogger)try{const u=s.getInfrastructureLogger(d);u&&typeof u=="object"&&(typeof u.log=="function"||typeof u.info=="function"||typeof u.warn=="function"||typeof u.error=="function")&&t.setDelegate(u)}catch{t.setDelegate(void 0)}}const logger=createLogger(PREFIX),infrastructureLogger=createInfrastructureLogger(PREFIX);async function safeWrapper(t,s){try{return await t()}catch(d){!s&&warn(d);return}}function isStaticResourcesEqual(t,s){const d=/^(https?:)?\/\//i,u=t.replace(d,"").replace(/\/$/,""),h=s.replace(d,"").replace(/\/$/,"");return u===h}function createScript(t){let s=null,d=!0,u=2e4,h;const E=document.getElementsByTagName("script");for(let y=0;y<E.length;y++){const R=E[y],$=R.getAttribute("src");if($&&isStaticResourcesEqual($,t.url)){s=R,d=!1;break}}if(!s){const y=t.attrs;s=document.createElement("script"),s.type=y?.type==="module"?"module":"text/javascript";let R;t.createScriptHook&&(R=t.createScriptHook(t.url,t.attrs),R instanceof HTMLScriptElement?s=R:typeof R=="object"&&("script"in R&&R.script&&(s=R.script),"timeout"in R&&R.timeout&&(u=R.timeout))),s.src||(s.src=t.url),y&&!R&&Object.keys(y).forEach($=>{s&&($==="async"||$==="defer"?s[$]=y[$]:s.getAttribute($)||s.setAttribute($,y[$]))})}const _=async(y,R)=>{clearTimeout(h);const $=()=>{R?.type==="error"?t?.onErrorCallback&&t?.onErrorCallback(R):t?.cb&&t?.cb()};if(s&&(s.onerror=null,s.onload=null,safeWrapper(()=>{const{needDeleteScript:x=!0}=t;x&&s?.parentNode&&s.parentNode.removeChild(s)}),y&&typeof y=="function")){const x=y(R);if(x instanceof Promise){const k=await x;return $(),k}return $(),x}$()};return s.onerror=_.bind(null,s.onerror),s.onload=_.bind(null,s.onload),h=setTimeout(()=>{_(null,new Error(`Remote script "${t.url}" time-outed.`))},u),{script:s,needAttach:d}}function createLink(t){let s=null,d=!0;const u=document.getElementsByTagName("link");for(let E=0;E<u.length;E++){const _=u[E],y=_.getAttribute("href"),R=_.getAttribute("rel");if(y&&isStaticResourcesEqual(y,t.url)&&R===t.attrs.rel){s=_,d=!1;break}}if(!s){s=document.createElement("link"),s.setAttribute("href",t.url);let E;const _=t.attrs;t.createLinkHook&&(E=t.createLinkHook(t.url,_),E instanceof HTMLLinkElement&&(s=E)),_&&!E&&Object.keys(_).forEach(y=>{s&&!s.getAttribute(y)&&s.setAttribute(y,_[y])})}const h=(E,_)=>{const y=()=>{_?.type==="error"?t?.onErrorCallback&&t?.onErrorCallback(_):t?.cb&&t?.cb()};if(s&&(s.onerror=null,s.onload=null,safeWrapper(()=>{const{needDeleteLink:R=!0}=t;R&&s?.parentNode&&s.parentNode.removeChild(s)}),E)){const R=E(_);return y(),R}y()};return s.onerror=h.bind(null,s.onerror),s.onload=h.bind(null,s.onload),{link:s,needAttach:d}}function loadScript(t,s){const{attrs:d={},createScriptHook:u}=s;return new Promise((h,E)=>{const{script:_,needAttach:y}=createScript({url:t,cb:h,onErrorCallback:E,attrs:{fetchpriority:"high",...d},createScriptHook:u,needDeleteScript:!0});y&&document.head.appendChild(_)})}const sdkImportCache=new Map;function importNodeModule(t){if(!t)throw new Error("import specifier is required");if(sdkImportCache.has(t))return sdkImportCache.get(t);const d=new Function("name","return import(name)")(t).then(u=>u).catch(u=>{throw console.error(`Error importing module ${t}:`,u),sdkImportCache.delete(t),u});return sdkImportCache.set(t,d),d}const loadNodeFetch=async()=>{const t=await importNodeModule("node-fetch");return t.default||t},lazyLoaderHookFetch=async(t,s,d)=>{const h=await((E,_)=>d.lifecycle.fetch.emit(E,_))(t,s||{});return!h||!(h instanceof Response)?(typeof fetch>"u"?await loadNodeFetch():fetch)(t,s||{}):h},createScriptNode=typeof ENV_TARGET>"u"||ENV_TARGET!=="web"?(url,cb,attrs,loaderHook)=>{if(loaderHook?.createScriptHook){const t=loaderHook.createScriptHook(url);t&&typeof t=="object"&&"url"in t&&(url=t.url)}let urlObj;try{urlObj=new URL(url)}catch(t){console.error("Error constructing URL:",t),cb(new Error(`Invalid URL: ${t}`));return}const getFetch=async()=>loaderHook?.fetch?(t,s)=>lazyLoaderHookFetch(t,s,loaderHook):typeof fetch>"u"?loadNodeFetch():fetch,handleScriptFetch=async(f,urlObj)=>{try{const res=await f(urlObj.href),data=await res.text(),[path,vm]=await Promise.all([importNodeModule("path"),importNodeModule("vm")]),scriptContext={exports:{},module:{exports:{}}},urlDirname=urlObj.pathname.split("/").slice(0,-1).join("/"),filename=path.basename(urlObj.pathname),script=new vm.Script(`(function(exports, module, require, __dirname, __filename) {${data}
5
+ })`,{filename,importModuleDynamically:vm.constants?.USE_MAIN_CONTEXT_DEFAULT_LOADER??importNodeModule});script.runInThisContext()(scriptContext.exports,scriptContext.module,eval("require"),urlDirname,filename);const exportedInterface=scriptContext.module.exports||scriptContext.exports;if(attrs&&exportedInterface&&attrs.globalName){const t=exportedInterface[attrs.globalName]||exportedInterface;cb(void 0,t);return}cb(void 0,exportedInterface)}catch(t){cb(t instanceof Error?t:new Error(`Script execution error: ${t}`))}};getFetch().then(async t=>{if(attrs?.type==="esm"||attrs?.type==="module")return loadModule(urlObj.href,{fetch:t,vm:await importNodeModule("vm")}).then(async s=>{await s.evaluate(),cb(void 0,s.namespace)}).catch(s=>{cb(s instanceof Error?s:new Error(`Script execution error: ${s}`))});handleScriptFetch(t,urlObj)}).catch(t=>{cb(t)})}:(t,s,d,u)=>{s(new Error("createScriptNode is disabled in non-Node.js environment"))},loadScriptNode=typeof ENV_TARGET>"u"||ENV_TARGET!=="web"?(t,s)=>new Promise((d,u)=>{createScriptNode(t,(h,E)=>{if(h)u(h);else{const _=s?.attrs?.globalName||`__FEDERATION_${s?.attrs?.name}:custom__`,y=globalThis[_]=E;d(y)}},s.attrs,s.loaderHook)}):(t,s)=>{throw new Error("loadScriptNode is disabled in non-Node.js environment")},esmModuleCache=new Map;async function loadModule(t,s){if(esmModuleCache.has(t))return esmModuleCache.get(t);const{fetch:d,vm:u}=s,E=await(await d(t)).text(),_=new u.SourceTextModule(E,{importModuleDynamically:async(y,R)=>{const $=new URL(y,t).href;return loadModule($,s)}});return esmModuleCache.set(t,_),await _.link(async y=>{const R=new URL(y,t).href;return await loadModule(R,s)}),_}function normalizeOptions(t,s,d){return function(u){if(u===!1)return!1;if(typeof u>"u")return t?s:!1;if(u===!0)return s;if(u&&typeof u=="object")return{...s,...u};throw new Error(`Unexpected type for \`${d}\`, expect boolean/undefined/object, got: ${typeof u}`)}}const createModuleFederationConfig=t=>t;return index_cjs$1.BROWSER_LOG_KEY=BROWSER_LOG_KEY,index_cjs$1.ENCODE_NAME_PREFIX=ENCODE_NAME_PREFIX,index_cjs$1.EncodedNameTransformMap=EncodedNameTransformMap,index_cjs$1.FederationModuleManifest=FederationModuleManifest,index_cjs$1.MANIFEST_EXT=MANIFEST_EXT,index_cjs$1.MFModuleType=MFModuleType,index_cjs$1.MFPrefetchCommon=MFPrefetchCommon,index_cjs$1.MODULE_DEVTOOL_IDENTIFIER=MODULE_DEVTOOL_IDENTIFIER,index_cjs$1.ManifestFileName=ManifestFileName,index_cjs$1.NameTransformMap=NameTransformMap,index_cjs$1.NameTransformSymbol=NameTransformSymbol,index_cjs$1.SEPARATOR=SEPARATOR,index_cjs$1.StatsFileName=StatsFileName,index_cjs$1.TEMP_DIR=TEMP_DIR,index_cjs$1.assert=assert,index_cjs$1.bindLoggerToCompiler=bindLoggerToCompiler,index_cjs$1.composeKeyWithSeparator=composeKeyWithSeparator,index_cjs$1.containerPlugin=ContainerPlugin,index_cjs$1.containerReferencePlugin=ContainerReferencePlugin,index_cjs$1.createInfrastructureLogger=createInfrastructureLogger,index_cjs$1.createLink=createLink,index_cjs$1.createLogger=createLogger,index_cjs$1.createModuleFederationConfig=createModuleFederationConfig,index_cjs$1.createScript=createScript,index_cjs$1.createScriptNode=createScriptNode,index_cjs$1.decodeName=decodeName,index_cjs$1.encodeName=encodeName,index_cjs$1.error=error,index_cjs$1.generateExposeFilename=generateExposeFilename,index_cjs$1.generateShareFilename=generateShareFilename,index_cjs$1.generateSnapshotFromManifest=generateSnapshotFromManifest,index_cjs$1.getManifestFileName=getManifestFileName,index_cjs$1.getProcessEnv=getProcessEnv,index_cjs$1.getResourceUrl=getResourceUrl,index_cjs$1.inferAutoPublicPath=inferAutoPublicPath,index_cjs$1.infrastructureLogger=infrastructureLogger,index_cjs$1.isBrowserEnv=isBrowserEnv,index_cjs$1.isDebugMode=isDebugMode,index_cjs$1.isManifestProvider=isManifestProvider,index_cjs$1.isReactNativeEnv=isReactNativeEnv,index_cjs$1.isRequiredVersion=isRequiredVersion,index_cjs$1.isStaticResourcesEqual=isStaticResourcesEqual,index_cjs$1.loadScript=loadScript,index_cjs$1.loadScriptNode=loadScriptNode,index_cjs$1.logger=logger,index_cjs$1.moduleFederationPlugin=ModuleFederationPlugin,index_cjs$1.normalizeOptions=normalizeOptions,index_cjs$1.parseEntry=parseEntry,index_cjs$1.safeToString=safeToString,index_cjs$1.safeWrapper=safeWrapper,index_cjs$1.sharePlugin=SharePlugin,index_cjs$1.simpleJoinRemoteEntry=simpleJoinRemoteEntry,index_cjs$1.warn=warn,index_cjs$1}var index_cjs={},hasRequiredIndex_cjs$2;function requireIndex_cjs$2(){if(hasRequiredIndex_cjs$2)return index_cjs;hasRequiredIndex_cjs$2=1;const t="RUNTIME-001",s="RUNTIME-002",d="RUNTIME-003",u="RUNTIME-004",h="RUNTIME-005",E="RUNTIME-006",_="RUNTIME-007",y="RUNTIME-008",R="RUNTIME-009",$="TYPE-001",x="BUILD-001",k="BUILD-002",H=L=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${L.split("-")[0].toLowerCase()}/${L}`,B=(L,P,F,V)=>{const ee=[`${[P[L]]} #${L}`];return F&&ee.push(`args: ${JSON.stringify(F)}`),ee.push(H(L)),V&&ee.push(`Original Error Message:
6
6
  ${V}`),ee.join(`
7
- `)},w={[t]:"Failed to get remoteEntry exports.",[s]:'The remote entry interface does not contain "init"',[h]:"Failed to get manifest.",[u]:"Failed to locate remote.",[d]:"Invalid loadShareSync function call from bundler runtime",[E]:"Invalid loadShareSync function call from runtime",[_]:"Failed to get remote snapshot.",[y]:"Failed to load script resources.",[R]:"Please call createInstance first."},U={[$]:"Failed to generate type declaration. Execute the below cmd to reproduce and fix the error."},Q={[x]:"Failed to find expose module.",[C]:"PublicPath is required in prod mode."},J={...w,...U,...Q};return index_cjs.BUILD_001=x,index_cjs.BUILD_002=C,index_cjs.RUNTIME_001=t,index_cjs.RUNTIME_002=s,index_cjs.RUNTIME_003=h,index_cjs.RUNTIME_004=u,index_cjs.RUNTIME_005=d,index_cjs.RUNTIME_006=E,index_cjs.RUNTIME_007=_,index_cjs.RUNTIME_008=y,index_cjs.RUNTIME_009=R,index_cjs.TYPE_001=$,index_cjs.buildDescMap=Q,index_cjs.errorDescMap=J,index_cjs.getShortErrorMsg=B,index_cjs.runtimeDescMap=w,index_cjs.typeDescMap=U,index_cjs}var hasRequiredIndex_cjs$1;function requireIndex_cjs$1(){if(hasRequiredIndex_cjs$1)return index_cjs$2;hasRequiredIndex_cjs$1=1;var t=requireIndex_cjs$3(),s=requireIndex_cjs$2();const h="[ Federation Runtime ]",u=t.createLogger(h);function d(r,e){r||E(e)}function E(r){throw r instanceof Error?(r.message.startsWith(h)||(r.message=`${h}: ${r.message}`),r):new Error(`${h}: ${r}`)}function _(r){r instanceof Error&&(r.message.startsWith(h)||(r.message=`${h}: ${r.message}`)),u.warn(r)}function y(r,e){return r.findIndex(n=>n===e)===-1&&r.push(e),r}function R(r){return"version"in r&&r.version?`${r.name}:${r.version}`:"entry"in r&&r.entry?`${r.name}:${r.entry}`:`${r.name}`}function $(r){return typeof r.entry<"u"}function x(r){return!r.entry.includes(".json")}async function C(r,e){try{return await r()}catch(n){!e&&_(n);return}}function H(r){return r&&typeof r=="object"}const B=Object.prototype.toString;function w(r){return B.call(r)==="[object Object]"}function U(r,e){const n=/^(https?:)?\/\//i,o=r.replace(n,"").replace(/\/$/,""),i=e.replace(n,"").replace(/\/$/,"");return o===i}function Q(r){return Array.isArray(r)?r:[r]}function J(r){const e={url:"",type:"global",globalName:""};return t.isBrowserEnv()||t.isReactNativeEnv()?"remoteEntry"in r?{url:r.remoteEntry,type:r.remoteEntryType,globalName:r.globalName}:e:"ssrRemoteEntry"in r?{url:r.ssrRemoteEntry||e.url,type:r.ssrRemoteEntryType||e.type,globalName:r.globalName}:e}const D=(r,e)=>{let n;return r.endsWith("/")?n=r.slice(0,-1):n=r,e.startsWith(".")&&(e=e.slice(1)),n=n+e,n},P=typeof globalThis=="object"?globalThis:window,F=(()=>{try{return document.defaultView}catch{return P}})(),V=F;function ee(r,e,n){Object.defineProperty(r,e,{value:n,configurable:!1,writable:!0})}function O(r,e){return Object.hasOwnProperty.call(r,e)}O(P,"__GLOBAL_LOADING_REMOTE_ENTRY__")||ee(P,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});const ce=P.__GLOBAL_LOADING_REMOTE_ENTRY__;function ne(r){O(r,"__VMOK__")&&!O(r,"__FEDERATION__")&&ee(r,"__FEDERATION__",r.__VMOK__),O(r,"__FEDERATION__")||(ee(r,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),ee(r,"__VMOK__",r.__FEDERATION__)),r.__FEDERATION__.__GLOBAL_PLUGIN__??=[],r.__FEDERATION__.__INSTANCES__??=[],r.__FEDERATION__.moduleInfo??={},r.__FEDERATION__.__SHARE__??={},r.__FEDERATION__.__MANIFEST_LOADING__??={},r.__FEDERATION__.__PRELOADED_MAP__??=new Map}ne(P),ne(F);function I(){P.__FEDERATION__.__GLOBAL_PLUGIN__=[],P.__FEDERATION__.__INSTANCES__=[],P.__FEDERATION__.moduleInfo={},P.__FEDERATION__.__SHARE__={},P.__FEDERATION__.__MANIFEST_LOADING__={},Object.keys(ce).forEach(r=>{delete ce[r]})}function N(r){P.__FEDERATION__.__INSTANCES__.push(r)}function k(){return P.__FEDERATION__.__DEBUG_CONSTRUCTOR__}function z(r,e=t.isDebugMode()){e&&(P.__FEDERATION__.__DEBUG_CONSTRUCTOR__=r,P.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="0.21.4")}function Z(r,e){if(typeof e=="string"){if(r[e])return{value:r[e],key:e};{const o=Object.keys(r);for(const i of o){const[c,a]=i.split(":"),l=`${c}:${e}`,p=r[l];if(p)return{value:p,key:l}}return{value:void 0,key:e}}}else throw new Error("key must be string")}const fe=()=>F.__FEDERATION__.moduleInfo,Ie=(r,e)=>{const n=R(r),o=Z(e,n).value;if(o&&!o.version&&"version"in r&&r.version&&(o.version=r.version),o)return o;if("version"in r&&r.version){const{version:i,...c}=r,a=R(c),l=Z(F.__FEDERATION__.moduleInfo,a).value;if(l?.version===i)return l}},he=r=>Ie(r,F.__FEDERATION__.moduleInfo),le=(r,e)=>{const n=R(r);return F.__FEDERATION__.moduleInfo[n]=e,F.__FEDERATION__.moduleInfo},K=r=>(F.__FEDERATION__.moduleInfo={...F.__FEDERATION__.moduleInfo,...r},()=>{const e=Object.keys(r);for(const n of e)delete F.__FEDERATION__.moduleInfo[n]}),$e=(r,e)=>{const n=e||`__FEDERATION_${r}:custom__`,o=P[n];return{remoteEntryKey:n,entryExports:o}},Ge=r=>{const{__GLOBAL_PLUGIN__:e}=F.__FEDERATION__;r.forEach(n=>{e.findIndex(o=>o.name===n.name)===-1?e.push(n):_(`The plugin ${n.name} has been registered.`)})},Ve=()=>F.__FEDERATION__.__GLOBAL_PLUGIN__,Be=r=>P.__FEDERATION__.__PRELOADED_MAP__.get(r),qe=r=>P.__FEDERATION__.__PRELOADED_MAP__.set(r,!0),Ee="default",We="global",Ke="[0-9A-Za-z-]+",Me=`(?:\\+(${Ke}(?:\\.${Ke})*))`,ye="0|[1-9]\\d*",ve="[0-9]+",ze="\\d*[a-zA-Z-][a-zA-Z0-9-]*",Xe=`(?:${ve}|${ze})`,dt=`(?:-?(${Xe}(?:\\.${Xe})*))`,Ye=`(?:${ye}|${ze})`,Je=`(?:-(${Ye}(?:\\.${Ye})*))`,Pe=`${ye}|x|X|\\*`,pe=`[v=\\s]*(${Pe})(?:\\.(${Pe})(?:\\.(${Pe})(?:${Je})?${Me}?)?)?`,ht=`^\\s*(${pe})\\s+-\\s+(${pe})\\s*$`,pt=`[v=\\s]*${`(${ve})\\.(${ve})\\.(${ve})`}${dt}?${Me}?`,xe="((?:<|>)?=?)",mt=`(\\s*)${xe}\\s*(${pt}|${pe})`,Ze="(?:~>?)",_t=`(\\s*)${Ze}\\s+`,Qe="(?:\\^)",Et=`(\\s*)${Qe}\\s+`,yt="(<|>)?=?\\s*\\*",gt=`^${Qe}${pe}$`,bt=`v?${`(${ye})\\.(${ye})\\.(${ye})`}${Je}?${Me}?`,St=`^${Ze}${pe}$`,Rt=`^${xe}\\s*${pe}$`,Nt=`^${xe}\\s*(${bt})$|^$`,It="^\\s*>=\\s*0.0.0\\s*$";function ie(r){return new RegExp(r)}function X(r){return!r||r.toLowerCase()==="x"||r==="*"}function et(...r){return e=>r.reduce((n,o)=>o(n),e)}function tt(r){return r.match(ie(Nt))}function rt(r,e,n,o){const i=`${r}.${e}.${n}`;return o?`${i}-${o}`:i}function $t(r){return r.replace(ie(ht),(e,n,o,i,c,a,l,p,m,b,S,g)=>(X(o)?n="":X(i)?n=`>=${o}.0.0`:X(c)?n=`>=${o}.${i}.0`:n=`>=${n}`,X(m)?p="":X(b)?p=`<${Number(m)+1}.0.0-0`:X(S)?p=`<${m}.${Number(b)+1}.0-0`:g?p=`<=${m}.${b}.${S}-${g}`:p=`<=${p}`,`${n} ${p}`.trim()))}function vt(r){return r.replace(ie(mt),"$1$2$3")}function Tt(r){return r.replace(ie(_t),"$1~")}function Ot(r){return r.replace(ie(Et),"$1^")}function Mt(r){return r.trim().split(/\s+/).map(e=>e.replace(ie(gt),(n,o,i,c,a)=>X(o)?"":X(i)?`>=${o}.0.0 <${Number(o)+1}.0.0-0`:X(c)?o==="0"?`>=${o}.${i}.0 <${o}.${Number(i)+1}.0-0`:`>=${o}.${i}.0 <${Number(o)+1}.0.0-0`:a?o==="0"?i==="0"?`>=${o}.${i}.${c}-${a} <${o}.${i}.${Number(c)+1}-0`:`>=${o}.${i}.${c}-${a} <${o}.${Number(i)+1}.0-0`:`>=${o}.${i}.${c}-${a} <${Number(o)+1}.0.0-0`:o==="0"?i==="0"?`>=${o}.${i}.${c} <${o}.${i}.${Number(c)+1}-0`:`>=${o}.${i}.${c} <${o}.${Number(i)+1}.0-0`:`>=${o}.${i}.${c} <${Number(o)+1}.0.0-0`)).join(" ")}function Pt(r){return r.trim().split(/\s+/).map(e=>e.replace(ie(St),(n,o,i,c,a)=>X(o)?"":X(i)?`>=${o}.0.0 <${Number(o)+1}.0.0-0`:X(c)?`>=${o}.${i}.0 <${o}.${Number(i)+1}.0-0`:a?`>=${o}.${i}.${c}-${a} <${o}.${Number(i)+1}.0-0`:`>=${o}.${i}.${c} <${o}.${Number(i)+1}.0-0`)).join(" ")}function xt(r){return r.split(/\s+/).map(e=>e.trim().replace(ie(Rt),(n,o,i,c,a,l)=>{const p=X(i),m=p||X(c),b=m||X(a);return o==="="&&b&&(o=""),l="",p?o===">"||o==="<"?"<0.0.0-0":"*":o&&b?(m&&(c=0),a=0,o===">"?(o=">=",m?(i=Number(i)+1,c=0,a=0):(c=Number(c)+1,a=0)):o==="<="&&(o="<",m?i=Number(i)+1:c=Number(c)+1),o==="<"&&(l="-0"),`${o+i}.${c}.${a}${l}`):m?`>=${i}.0.0${l} <${Number(i)+1}.0.0-0`:b?`>=${i}.${c}.0${l} <${i}.${Number(c)+1}.0-0`:n})).join(" ")}function wt(r){return r.trim().replace(ie(yt),"")}function jt(r){return r.trim().replace(ie(It),"")}function Te(r,e){return r=Number(r)||r,e=Number(e)||e,r>e?1:r===e?0:-1}function At(r,e){const{preRelease:n}=r,{preRelease:o}=e;if(n===void 0&&o)return 1;if(n&&o===void 0)return-1;if(n===void 0&&o===void 0)return 0;for(let i=0,c=n.length;i<=c;i++){const a=n[i],l=o[i];if(a!==l)return a===void 0&&l===void 0?0:a?l?Te(a,l):-1:1}return 0}function Oe(r,e){return Te(r.major,e.major)||Te(r.minor,e.minor)||Te(r.patch,e.patch)||At(r,e)}function we(r,e){return r.version===e.version}function Dt(r,e){switch(r.operator){case"":case"=":return we(r,e);case">":return Oe(r,e)<0;case">=":return we(r,e)||Oe(r,e)<0;case"<":return Oe(r,e)>0;case"<=":return we(r,e)||Oe(r,e)>0;case void 0:return!0;default:return!1}}function Lt(r){return et(Mt,Pt,xt,wt)(r)}function Ft(r){return et($t,vt,Tt,Ot)(r.trim()).split(/\s+/).join(" ")}function ge(r,e){if(!r)return!1;const n=tt(r);if(!n)return!1;const[,o,,i,c,a,l]=n,p={operator:o,version:rt(i,c,a,l),major:i,minor:c,patch:a,preRelease:l?.split(".")},m=e.split("||");for(const b of m){const S=b.trim();if(!S||S==="*"||S==="x")return!0;try{const g=Ft(S);if(!g.trim())return!0;const T=g.split(" ").map(v=>Lt(v)).join(" ");if(!T.trim())return!0;const M=T.split(/\s+/).map(v=>jt(v)).filter(Boolean);if(M.length===0)continue;let j=!0;for(const v of M){const A=tt(v);if(!A){j=!1;break}const[,G,,L,q,Y,ue]=A,W={operator:G,version:rt(L,q,Y,ue),major:L,minor:q,patch:Y,preRelease:ue?.split(".")};if(!Dt(W,p)){j=!1;break}}if(j)return!0}catch(g){console.error(`[semver] Error processing range part "${S}":`,g);continue}}return!1}function kt(r,e,n,o){let i;return"get"in r?i=r.get:"lib"in r?i=()=>Promise.resolve(r.lib):i=()=>Promise.resolve(()=>{throw new Error(`Can not get shared '${n}'!`)}),{deps:[],useIn:[],from:e,loading:null,...r,shareConfig:{requiredVersion:`^${r.version}`,singleton:!1,eager:!1,strictVersion:!1,...r.shareConfig},get:i,loaded:r?.loaded||"lib"in r?!0:void 0,version:r.version??"0",scope:Array.isArray(r.scope)?r.scope:[r.scope??"default"],strategy:(r.strategy??o)||"version-first"}}function nt(r,e){const n=e.shared||{},o=e.name,i=Object.keys(n).reduce((a,l)=>{const p=Q(n[l]);return a[l]=a[l]||[],p.forEach(m=>{a[l].push(kt(m,o,l,e.shareStrategy))}),a},{}),c={...r.shared};return Object.keys(i).forEach(a=>{c[a]?i[a].forEach(l=>{c[a].find(m=>m.version===l.version)||c[a].push(l)}):c[a]=i[a]}),{shared:c,shareInfos:i}}function be(r,e){const n=o=>{if(!Number.isNaN(Number(o))){const c=o.split(".");let a=o;for(let l=0;l<3-c.length;l++)a+=".0";return a}return o};return!!ge(n(r),`<=${n(e)}`)}const je=(r,e)=>{const n=e||function(o,i){return be(o,i)};return Object.keys(r).reduce((o,i)=>!o||n(o,i)||o==="0"?i:o,0)},Ae=r=>!!r.loaded||typeof r.lib=="function",Ct=r=>!!r.loading;function Ht(r,e,n){const o=r[e][n],i=function(c,a){return!Ae(o[c])&&be(c,a)};return je(r[e][n],i)}function Ut(r,e,n){const o=r[e][n],i=function(c,a){const l=p=>Ae(p)||Ct(p);return l(o[a])?l(o[c])?!!be(c,a):!0:l(o[c])?!1:be(c,a)};return je(r[e][n],i)}function Gt(r){return r==="loaded-first"?Ut:Ht}function me(r,e,n,o){if(!r)return;const{shareConfig:i,scope:c=Ee,strategy:a}=n,l=Array.isArray(c)?c:[c];for(const p of l)if(i&&r[p]&&r[p][e]){const{requiredVersion:m}=i,S=Gt(a)(r,p,e),g=()=>{if(i.singleton){if(typeof m=="string"&&!ge(S,m)){const j=`Version ${S} from ${S&&r[p][e][S].from} of shared singleton module ${e} does not satisfy the requirement of ${n.from} which needs ${m})`;i.strictVersion?E(j):_(j)}return r[p][e][S]}else{if(m===!1||m==="*"||ge(S,m))return r[p][e][S];for(const[j,v]of Object.entries(r[p][e]))if(ge(j,m))return v}},T={shareScopeMap:r,scope:p,pkgName:e,version:S,GlobalFederation:V.__FEDERATION__,resolver:g};return(o.emit(T)||T).resolver()}}function De(){return V.__FEDERATION__.__SHARE__}function ot(r){const{pkgName:e,extraOptions:n,shareInfos:o}=r,i=a=>{if(!a)return;const l={};a.forEach(b=>{l[b.version]=b});const m=je(l,function(b,S){return!Ae(l[b])&&be(b,S)});return l[m]},c=n?.resolver??i;return Object.assign({},c(o[e]),n?.customShareInfo)}function Vt(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function Le(r,e){for(const n of r){const o=e.startsWith(n.name);let i=e.replace(n.name,"");if(o){if(i.startsWith("/")){const l=n.name;return i=`.${i}`,{pkgNameOrAlias:l,expose:i,remote:n}}else if(i==="")return{pkgNameOrAlias:n.name,expose:".",remote:n}}const c=n.alias&&e.startsWith(n.alias);let a=n.alias&&e.replace(n.alias,"");if(n.alias&&c){if(a&&a.startsWith("/")){const l=n.alias;return a=`.${a}`,{pkgNameOrAlias:l,expose:a,remote:n}}else if(a==="")return{pkgNameOrAlias:n.alias,expose:".",remote:n}}}}function Bt(r,e){for(const n of r)if(e===n.name||n.alias&&e===n.alias)return n}function qt(r,e){const n=Ve(),o=[e.hooks,e.remoteHandler.hooks,e.sharedHandler.hooks,e.snapshotHandler.hooks,e.loaderHook,e.bridgeHook];return n.length>0&&n.forEach(i=>{r?.find(c=>c.name!==i.name)&&r.push(i)}),r&&r.length>0&&r.forEach(i=>{o.forEach(c=>{c.applyPlugin(i,e)})}),r}const st=".then(callbacks[0]).catch(callbacks[1])";async function Wt({entry:r,remoteEntryExports:e}){return new Promise((n,o)=>{try{e?n(e):typeof FEDERATION_ALLOW_NEW_FUNCTION<"u"?new Function("callbacks",`import("${r}")${st}`)([n,o]):import(r).then(n).catch(o)}catch(i){o(i)}})}async function Kt({entry:r,remoteEntryExports:e}){return new Promise((n,o)=>{try{e?n(e):typeof __system_context__>"u"?System.import(r).then(n).catch(o):new Function("callbacks",`System.import("${r}")${st}`)([n,o])}catch(i){o(i)}})}function it(r,e,n){const{remoteEntryKey:o,entryExports:i}=$e(r,e);return d(i,s.getShortErrorMsg(s.RUNTIME_001,s.runtimeDescMap,{remoteName:r,remoteEntryUrl:n,remoteEntryKey:o})),i}async function zt({name:r,globalName:e,entry:n,loaderHook:o,getEntryUrl:i}){const{entryExports:c}=$e(r,e);if(c)return c;const a=i?i(n):n;return t.loadScript(a,{attrs:{},createScriptHook:(l,p)=>{const m=o.lifecycle.createScript.emit({url:l,attrs:p});if(m&&(m instanceof HTMLScriptElement||"script"in m||"timeout"in m))return m}}).then(()=>it(r,e,n)).catch(l=>{throw d(void 0,s.getShortErrorMsg(s.RUNTIME_008,s.runtimeDescMap,{remoteName:r,resourceUrl:n})),l})}async function Xt({remoteInfo:r,remoteEntryExports:e,loaderHook:n,getEntryUrl:o}){const{entry:i,entryGlobalName:c,name:a,type:l}=r;switch(l){case"esm":case"module":return Wt({entry:i,remoteEntryExports:e});case"system":return Kt({entry:i,remoteEntryExports:e});default:return zt({entry:i,globalName:c,name:a,loaderHook:n,getEntryUrl:o})}}async function Yt({remoteInfo:r,loaderHook:e}){const{entry:n,entryGlobalName:o,name:i,type:c}=r,{entryExports:a}=$e(i,o);return a||t.loadScriptNode(n,{attrs:{name:i,globalName:o,type:c},loaderHook:{createScriptHook:(l,p={})=>{const m=e.lifecycle.createScript.emit({url:l,attrs:p});if(m&&"url"in m)return m}}}).then(()=>it(i,o,n)).catch(l=>{throw l})}function Fe(r){const{entry:e,name:n}=r;return t.composeKeyWithSeparator(n,e)}async function Se(r){const{origin:e,remoteEntryExports:n,remoteInfo:o,getEntryUrl:i,_inErrorHandling:c=!1}=r,a=Fe(o);if(n)return n;if(!ce[a]){const l=e.remoteHandler.hooks.lifecycle.loadEntry,p=e.loaderHook;ce[a]=l.emit({loaderHook:p,remoteInfo:o,remoteEntryExports:n}).then(m=>m||((typeof ENV_TARGET<"u"?ENV_TARGET==="web":t.isBrowserEnv())?Xt({remoteInfo:o,remoteEntryExports:n,loaderHook:p,getEntryUrl:i}):Yt({remoteInfo:o,loaderHook:p}))).catch(async m=>{const b=Fe(o);if(m instanceof Error&&m.message.includes(s.RUNTIME_008)&&!c){const g=M=>Se({...M,_inErrorHandling:!0}),T=await e.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:g,origin:e,remoteInfo:o,remoteEntryExports:n,globalLoading:ce,uniqueKey:b});if(T)return T}throw m})}return ce[a]}function Re(r){return{...r,entry:"entry"in r?r.entry:"",type:r.type||We,entryGlobalName:r.entryGlobalName||r.name,shareScope:r.shareScope||Ee}}function at(r){return{resourceCategory:"sync",share:!0,depsRemote:!0,prefetchInterface:!1,...r}}function Jt(r,e){return e.map(n=>{const o=Bt(r,n.nameOrAlias);return d(o,`Unable to preload ${n.nameOrAlias} as it is not included in ${!o&&t.safeToString({remoteInfo:o,remotes:r})}`),{remote:o,preloadConfig:at(n)}})}function Zt(r){return r?r.map(e=>e==="."?e:e.startsWith("./")?e.replace("./",""):e):[]}function ke(r,e,n,o=!0){const{cssAssets:i,jsAssetsWithoutEntry:c,entryAssets:a}=n;if(e.options.inBrowser){if(a.forEach(l=>{const{moduleInfo:p}=l,m=e.moduleCache.get(r.name);Se(m?{origin:e,remoteInfo:p,remoteEntryExports:m.remoteEntryExports}:{origin:e,remoteInfo:p,remoteEntryExports:void 0})}),o){const l={rel:"preload",as:"style"};i.forEach(p=>{const{link:m,needAttach:b}=t.createLink({url:p,cb:()=>{},attrs:l,createLinkHook:(S,g)=>{const T=e.loaderHook.lifecycle.createLink.emit({url:S,attrs:g});if(T instanceof HTMLLinkElement)return T}});b&&document.head.appendChild(m)})}else{const l={rel:"stylesheet",type:"text/css"};i.forEach(p=>{const{link:m,needAttach:b}=t.createLink({url:p,cb:()=>{},attrs:l,createLinkHook:(S,g)=>{const T=e.loaderHook.lifecycle.createLink.emit({url:S,attrs:g});if(T instanceof HTMLLinkElement)return T},needDeleteLink:!1});b&&document.head.appendChild(m)})}if(o){const l={rel:"preload",as:"script"};c.forEach(p=>{const{link:m,needAttach:b}=t.createLink({url:p,cb:()=>{},attrs:l,createLinkHook:(S,g)=>{const T=e.loaderHook.lifecycle.createLink.emit({url:S,attrs:g});if(T instanceof HTMLLinkElement)return T}});b&&document.head.appendChild(m)})}else{const l={fetchpriority:"high",type:r?.type==="module"?"module":"text/javascript"};c.forEach(p=>{const{script:m,needAttach:b}=t.createScript({url:p,cb:()=>{},attrs:l,createScriptHook:(S,g)=>{const T=e.loaderHook.lifecycle.createScript.emit({url:S,attrs:g});if(T instanceof HTMLScriptElement)return T},needDeleteScript:!0});b&&document.head.appendChild(m)})}}}var Qt={global:{Global:V,nativeGlobal:F,resetFederationGlobalInfo:I,setGlobalFederationInstance:N,getGlobalFederationConstructor:k,setGlobalFederationConstructor:z,getInfoWithoutType:Z,getGlobalSnapshot:fe,getTargetSnapshotInfoByModuleInfo:Ie,getGlobalSnapshotInfoByModuleInfo:he,setGlobalSnapshotInfoByModuleInfo:le,addGlobalSnapshot:K,getRemoteEntryExports:$e,registerGlobalPlugins:Ge,getGlobalHostPlugins:Ve,getPreloaded:Be,setPreloaded:qe},share:{getRegisteredShare:me,getGlobalShareScope:De},utils:{matchRemoteWithNameAndExpose:Le,preloadAssets:ke,getRemoteInfo:Re}};class Ce{constructor({remoteInfo:e,host:n}){this.inited=!1,this.lib=void 0,this.remoteInfo=e,this.host=n}async getEntry(){if(this.remoteEntryExports)return this.remoteEntryExports;let e;return e=await Se({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports}),d(e,`remoteEntryExports is undefined
8
- ${t.safeToString(this.remoteInfo)}`),this.remoteEntryExports=e,this.remoteEntryExports}async get(e,n,o,i){const{loadFactory:c=!0}=o||{loadFactory:!0},a=await this.getEntry();if(!this.inited){const S=this.host.shareScopeMap,g=Array.isArray(this.remoteInfo.shareScope)?this.remoteInfo.shareScope:[this.remoteInfo.shareScope];g.length||g.push("default"),g.forEach(A=>{S[A]||(S[A]={})});const T=S[g[0]],M=[],j={version:this.remoteInfo.version||"",shareScopeKeys:Array.isArray(this.remoteInfo.shareScope)?g:this.remoteInfo.shareScope||"default"};Object.defineProperty(j,"shareScopeMap",{value:S,enumerable:!1});const v=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:T,remoteEntryInitOptions:j,initScope:M,remoteInfo:this.remoteInfo,origin:this.host});typeof a?.init>"u"&&E(s.getShortErrorMsg(s.RUNTIME_002,s.runtimeDescMap,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName})),await a.init(v.shareScope,v.initScope,v.remoteEntryInitOptions),await this.host.hooks.lifecycle.initContainer.emit({...v,id:e,remoteSnapshot:i,remoteEntryExports:a})}this.lib=a,this.inited=!0;let l;l=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:a,expose:n,moduleInfo:this.remoteInfo}),l||(l=await a.get(n)),d(l,`${R(this.remoteInfo)} remote don't export ${n}.`);const p=D(this.remoteInfo.name,n),m=this.wraperFactory(l,p);return c?await m():m}wraperFactory(e,n){function o(i,c){i&&typeof i=="object"&&Object.isExtensible(i)&&!Object.getOwnPropertyDescriptor(i,Symbol.for("mf_module_id"))&&Object.defineProperty(i,Symbol.for("mf_module_id"),{value:c,enumerable:!1})}return e instanceof Promise?async()=>{const i=await e();return o(i,n),i}:()=>{const i=e();return o(i,n),i}}}class te{constructor(e){this.type="",this.listeners=new Set,e&&(this.type=e)}on(e){typeof e=="function"&&this.listeners.add(e)}once(e){const n=this;this.on(function o(...i){return n.remove(o),e.apply(null,i)})}emit(...e){let n;return this.listeners.size>0&&this.listeners.forEach(o=>{n=o(...e)}),n}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}}class oe extends te{emit(...e){let n;const o=Array.from(this.listeners);if(o.length>0){let i=0;const c=a=>a===!1?!1:i<o.length?Promise.resolve(o[i++].apply(null,e)).then(c):a;n=c()}return Promise.resolve(n)}}function ct(r,e){if(!H(e))return!1;if(r!==e){for(const n in r)if(!(n in e))return!1}return!0}class Ne extends te{constructor(e){super(),this.onerror=E,this.type=e}emit(e){H(e)||E(`The data for the "${this.type}" hook should be an object.`);for(const n of this.listeners)try{const o=n(e);if(ct(e,o))e=o;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(o){_(o),this.onerror(o)}return e}}class de extends te{constructor(e){super(),this.onerror=E,this.type=e}emit(e){H(e)||E(`The response data for the "${this.type}" hook must be an object.`);const n=Array.from(this.listeners);if(n.length>0){let o=0;const i=a=>(_(a),this.onerror(a),e),c=a=>{if(ct(e,a)){if(e=a,o<n.length)try{return Promise.resolve(n[o++](e)).then(c,i)}catch(l){return i(l)}}else this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`);return e};return Promise.resolve(c(e))}return Promise.resolve(e)}}class _e{constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}applyPlugin(e,n){d(w(e),"Plugin configuration is invalid.");const o=e.name;d(o,"A name must be provided by the plugin."),this.registerPlugins[o]||(this.registerPlugins[o]=e,e.apply?.(n),Object.keys(this.lifecycle).forEach(i=>{const c=e[i];c&&this.lifecycle[i].on(c)}))}removePlugin(e){d(e,"A name is required.");const n=this.registerPlugins[e];d(n,`The plugin "${e}" is not registered.`),Object.keys(n).forEach(o=>{o!=="name"&&this.lifecycle[o].remove(n[o])})}}function lt(r,e){const n=J(e);n.url||E(`The attribute remoteEntry of ${r.name} must not be undefined.`);let o=t.getResourceUrl(e,n.url);!t.isBrowserEnv()&&!o.startsWith("http")&&(o=`https:${o}`),r.type=n.type,r.entryGlobalName=n.globalName,r.entry=o,r.version=e.version,r.buildVersion=e.buildVersion}function er(){return{name:"snapshot-plugin",async afterResolve(r){const{remote:e,pkgNameOrAlias:n,expose:o,origin:i,remoteInfo:c,id:a}=r;if(!$(e)||!x(e)){const{remoteSnapshot:l,globalSnapshot:p}=await i.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:e,id:a});lt(c,l);const m={remote:e,preloadConfig:{nameOrAlias:n,exposes:[o],resourceCategory:"sync",share:!1,depsRemote:!1}},b=await i.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:i,preloadOptions:m,remoteInfo:c,remote:e,remoteSnapshot:l,globalSnapshot:p});return b&&ke(c,i,b,!1),{...r,remoteSnapshot:l}}return r}}}function tr(r){const e=r.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 ut(r,e,n,o,i={},c){const a=R(e),{value:l}=Z(r,a),p=c||l;if(p&&!t.isManifestProvider(p)&&(n(p,e,o),p.remotesInfo)){const m=Object.keys(p.remotesInfo);for(const b of m){if(i[b])continue;i[b]=!0;const S=tr(b),g=p.remotesInfo[b];ut(r,{name:S.name,version:g.matchedVersion},n,!1,i,void 0)}}}const He=(r,e)=>document.querySelector(`${r}[${r==="link"?"href":"src"}="${e}"]`);function rr(r,e,n,o,i){const c=[],a=[],l=[],p=new Set,m=new Set,{options:b}=r,{preloadConfig:S}=e,{depsRemote:g}=S;if(ut(o,n,(v,A,G)=>{let L;if(G)L=S;else if(Array.isArray(g)){const se=g.find(re=>re.nameOrAlias===A.name||re.nameOrAlias===A.alias);if(!se)return;L=at(se)}else if(g===!0)L=S;else return;const q=t.getResourceUrl(v,J(v).url);q&&l.push({name:A.name,moduleInfo:{name:A.name,entry:q,type:"remoteEntryType"in v?v.remoteEntryType:"global",entryGlobalName:"globalName"in v?v.globalName:A.name,shareScope:"",version:"version"in v?v.version:void 0},url:q});let Y="modules"in v?v.modules:[];const ue=Zt(L.exposes);ue.length&&"modules"in v&&(Y=v?.modules?.reduce((se,re)=>(ue?.indexOf(re.moduleName)!==-1&&se.push(re),se),[]));function W(se){const re=se.map(ae=>t.getResourceUrl(v,ae));return L.filter?re.filter(L.filter):re}if(Y){const se=Y.length;for(let re=0;re<se;re++){const ae=Y[re],Ue=`${A.name}/${ae.moduleName}`;r.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:ae.moduleName==="."?A.name:Ue,name:A.name,remoteSnapshot:v,preloadConfig:L,remote:A,origin:r}),!Be(Ue)&&(L.resourceCategory==="all"?(c.push(...W(ae.assets.css.async)),c.push(...W(ae.assets.css.sync)),a.push(...W(ae.assets.js.async)),a.push(...W(ae.assets.js.sync))):(L.resourceCategory="sync")&&(c.push(...W(ae.assets.css.sync)),a.push(...W(ae.assets.js.sync))),qe(Ue))}}},!0,{},i),i.shared&&i.shared.length>0){const v=(A,G)=>{const L=me(r.shareScopeMap,G.sharedName,A,r.sharedHandler.hooks.lifecycle.resolveShare);L&&typeof L.lib=="function"&&(G.assets.js.sync.forEach(q=>{p.add(q)}),G.assets.css.sync.forEach(q=>{m.add(q)}))};i.shared.forEach(A=>{const G=b.shared?.[A.sharedName];if(!G)return;const L=A.version?G.find(Y=>Y.version===A.version):G;if(!L)return;Q(L).forEach(Y=>{v(Y,A)})})}const M=a.filter(v=>!p.has(v)&&!He("script",v));return{cssAssets:c.filter(v=>!m.has(v)&&!He("link",v)),jsAssetsWithoutEntry:M,entryAssets:l.filter(v=>!He("script",v.url))}}const nr=function(){return{name:"generate-preload-assets-plugin",async generatePreloadAssets(r){const{origin:e,preloadOptions:n,remoteInfo:o,remote:i,globalSnapshot:c,remoteSnapshot:a}=r;return t.isBrowserEnv()?$(i)&&x(i)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:i.name,url:i.entry,moduleInfo:{name:o.name,entry:i.entry,type:o.type||"global",entryGlobalName:"",shareScope:""}}]}:(lt(o,a),rr(e,n,o,c,a)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}};function ft(r,e){const n=he({name:e.name,version:e.options.version}),o=n&&"remotesInfo"in n&&n.remotesInfo&&Z(n.remotesInfo,r.name).value;return o&&o.matchedVersion?{hostGlobalSnapshot:n,globalSnapshot:fe(),remoteSnapshot:he({name:r.name,version:o.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:fe(),remoteSnapshot:he({name:r.name,version:"version"in r?r.version:void 0})}}class or{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new _e({beforeLoadRemoteSnapshot:new oe("beforeLoadRemoteSnapshot"),loadSnapshot:new de("loadGlobalSnapshot"),loadRemoteSnapshot:new de("loadRemoteSnapshot"),afterLoadSnapshot:new de("afterLoadSnapshot")}),this.manifestLoading=V.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}async loadRemoteSnapshotInfo({moduleInfo:e,id:n,expose:o}){const{options:i}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:i,moduleInfo:e});let c=he({name:this.HostInstance.options.name,version:this.HostInstance.options.version});c||(c={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},K({[this.HostInstance.options.name]:c})),c&&"remotesInfo"in c&&!Z(c.remotesInfo,e.name).value&&("version"in e||"entry"in e)&&(c.remotesInfo={...c?.remotesInfo,[e.name]:{matchedVersion:"version"in e?e.version:e.entry}});const{hostGlobalSnapshot:a,remoteSnapshot:l,globalSnapshot:p}=this.getGlobalRemoteInfo(e),{remoteSnapshot:m,globalSnapshot:b}=await this.hooks.lifecycle.loadSnapshot.emit({options:i,moduleInfo:e,hostGlobalSnapshot:a,remoteSnapshot:l,globalSnapshot:p});let S,g;if(m)if(t.isManifestProvider(m)){const T=t.isBrowserEnv()?m.remoteEntry:m.ssrRemoteEntry||m.remoteEntry||"",M=await this.getManifestJson(T,e,{}),j=le({...e,entry:T},M);S=M,g=j}else{const{remoteSnapshot:T}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:m,from:"global"});S=T,g=b}else if($(e)){const T=await this.getManifestJson(e.entry,e,{}),M=le(e,T),{remoteSnapshot:j}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:T,from:"global"});S=j,g=M}else E(s.getShortErrorMsg(s.RUNTIME_007,s.runtimeDescMap,{hostName:e.name,hostVersion:e.version,globalSnapshot:JSON.stringify(b)}));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:n,host:this.HostInstance,options:i,moduleInfo:e,remoteSnapshot:S}),{remoteSnapshot:S,globalSnapshot:g}}getGlobalRemoteInfo(e){return ft(e,this.HostInstance)}async getManifestJson(e,n,o){const i=async()=>{let a=this.manifestCache.get(e);if(a)return a;try{let l=await this.loaderHook.lifecycle.fetch.emit(e,{});(!l||!(l instanceof Response))&&(l=await fetch(e,{})),a=await l.json()}catch(l){a=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:l,from:"runtime",lifecycle:"afterResolve",origin:this.HostInstance}),a||(delete this.manifestLoading[e],E(s.getShortErrorMsg(s.RUNTIME_003,s.runtimeDescMap,{manifestUrl:e,moduleName:n.name,hostName:this.HostInstance.options.name},`${l}`)))}return d(a.metaData&&a.exposes&&a.shared,`${e} is not a federation manifest`),this.manifestCache.set(e,a),a},c=async()=>{const a=await i(),l=t.generateSnapshotFromManifest(a,{version:e}),{remoteSnapshot:p}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:n,manifestJson:a,remoteSnapshot:l,manifestUrl:e,from:"manifest"});return p};return this.manifestLoading[e]||(this.manifestLoading[e]=c().then(a=>a)),this.manifestLoading[e]}}class sr{constructor(e){this.hooks=new _e({afterResolve:new de("afterResolve"),beforeLoadShare:new de("beforeLoadShare"),loadShare:new oe,resolveShare:new Ne("resolveShare"),initContainerShareScopeMap:new Ne("initContainerShareScopeMap")}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}registerShared(e,n){const{shareInfos:o,shared:i}=nt(e,n);return Object.keys(o).forEach(a=>{o[a].forEach(p=>{p.scope.forEach(m=>{this.shareScopeMap[m]?.[a]||this.setShared({pkgName:a,lib:p.lib,get:p.get,loaded:p.loaded||!!p.lib,shared:p,from:n.name})})})}),{shareInfos:o,shared:i}}async loadShare(e,n){const{host:o}=this,i=ot({pkgName:e,extraOptions:n,shareInfos:o.options.shared});i?.scope&&await Promise.all(i.scope.map(async m=>{await Promise.all(this.initializeSharing(m,{strategy:i.strategy}))}));const c=await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:i,shared:o.options.shared,origin:o}),{shareInfo:a}=c;d(a,`Cannot find ${e} Share in the ${o.options.name}. Please ensure that the ${e} Share parameters have been injected`);const l=me(this.shareScopeMap,e,a,this.hooks.lifecycle.resolveShare),p=m=>{m.useIn||(m.useIn=[]),y(m.useIn,o.options.name)};if(l&&l.lib)return p(l),l.lib;if(l&&l.loading&&!l.loaded){const m=await l.loading;return l.loaded=!0,l.lib||(l.lib=m),p(l),m}else if(l){const b=(async()=>{const S=await l.get();return p(l),l.loaded=!0,l.lib=S,S})();return this.setShared({pkgName:e,loaded:!1,shared:l,from:o.options.name,lib:null,loading:b}),b}else{if(n?.customShareInfo)return!1;const b=(async()=>{const S=await a.get();a.lib=S,a.loaded=!0,p(a);const g=me(this.shareScopeMap,e,a,this.hooks.lifecycle.resolveShare);return g&&(g.lib=S,g.loaded=!0,g.from=a.from),S})();return this.setShared({pkgName:e,loaded:!1,shared:a,from:o.options.name,lib:null,loading:b}),b}}initializeSharing(e=Ee,n){const{host:o}=this,i=n?.from,c=n?.strategy;let a=n?.initScope;const l=[];if(i!=="build"){const{initTokens:M}=this;a||(a=[]);let j=M[e];if(j||(j=M[e]={from:this.host.name}),a.indexOf(j)>=0)return l;a.push(j)}const p=this.shareScopeMap,m=o.options.name;p[e]||(p[e]={});const b=p[e],S=(M,j)=>{const{version:v,eager:A}=j;b[M]=b[M]||{};const G=b[M],L=G[v],q=!!(L&&(L.eager||L.shareConfig?.eager));(!L||L.strategy!=="loaded-first"&&!L.loaded&&(!A!=!q?A:m>L.from))&&(G[v]=j)},g=M=>M&&M.init&&M.init(p[e],a),T=async M=>{const{module:j}=await o.remoteHandler.getRemoteModuleAndOptions({id:M});if(j.getEntry){let v;try{v=await j.getEntry()}catch(A){v=await o.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:M,error:A,from:"runtime",lifecycle:"beforeLoadShare",origin:o})}j.inited||(await g(v),j.inited=!0)}};return Object.keys(o.options.shared).forEach(M=>{o.options.shared[M].forEach(v=>{v.scope.includes(e)&&S(M,v)})}),(o.options.shareStrategy==="version-first"||c==="version-first")&&o.options.remotes.forEach(M=>{M.shareScope===e&&l.push(T(M.name))}),l}loadShareSync(e,n){const{host:o}=this,i=ot({pkgName:e,extraOptions:n,shareInfos:o.options.shared});i?.scope&&i.scope.forEach(l=>{this.initializeSharing(l,{strategy:i.strategy})});const c=me(this.shareScopeMap,e,i,this.hooks.lifecycle.resolveShare),a=l=>{l.useIn||(l.useIn=[]),y(l.useIn,o.options.name)};if(c){if(typeof c.lib=="function")return a(c),c.loaded||(c.loaded=!0,c.from===o.options.name&&(i.loaded=!0)),c.lib;if(typeof c.get=="function"){const l=c.get();if(!(l instanceof Promise))return a(c),this.setShared({pkgName:e,loaded:!0,from:o.options.name,lib:l,shared:c}),l}}if(i.lib)return i.loaded||(i.loaded=!0),i.lib;if(i.get){const l=i.get();if(l instanceof Promise){const p=n?.from==="build"?s.RUNTIME_005:s.RUNTIME_006;throw new Error(s.getShortErrorMsg(p,s.runtimeDescMap,{hostName:o.options.name,sharedPkgName:e}))}return i.lib=l,this.setShared({pkgName:e,loaded:!0,from:o.options.name,lib:i.lib,shared:i}),i.lib}throw new Error(s.getShortErrorMsg(s.RUNTIME_006,s.runtimeDescMap,{hostName:o.options.name,sharedPkgName:e}))}initShareScopeMap(e,n,o={}){const{host:i}=this;this.shareScopeMap[e]=n,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:n,options:i.options,origin:i,scopeName:e,hostShareScopeMap:o.hostShareScopeMap})}setShared({pkgName:e,shared:n,from:o,lib:i,loading:c,loaded:a,get:l}){const{version:p,scope:m="default",...b}=n;(Array.isArray(m)?m:[m]).forEach(g=>{if(this.shareScopeMap[g]||(this.shareScopeMap[g]={}),this.shareScopeMap[g][e]||(this.shareScopeMap[g][e]={}),!this.shareScopeMap[g][e][p]){this.shareScopeMap[g][e][p]={version:p,scope:[g],...b,lib:i,loaded:a,loading:c},l&&(this.shareScopeMap[g][e][p].get=l);return}const T=this.shareScopeMap[g][e][p];c&&!T.loading&&(T.loading=c),a&&!T.loaded&&(T.loaded=a),o&&T.from!==o&&(T.from=o)})}_setGlobalShareScopeMap(e){const n=De(),o=e.id||e.name;o&&!n[o]&&(n[o]=this.shareScopeMap)}}class ir{constructor(e){this.hooks=new _e({beforeRegisterRemote:new Ne("beforeRegisterRemote"),registerRemote:new Ne("registerRemote"),beforeRequest:new de("beforeRequest"),onLoad:new oe("onLoad"),handlePreloadModule:new te("handlePreloadModule"),errorLoadRemote:new oe("errorLoadRemote"),beforePreloadRemote:new oe("beforePreloadRemote"),generatePreloadAssets:new oe("generatePreloadAssets"),afterPreloadRemote:new oe,loadEntry:new oe}),this.host=e,this.idToRemoteMap={}}formatAndRegisterRemote(e,n){return(n.remotes||[]).reduce((i,c)=>(this.registerRemote(c,i,{force:!1}),i),e.remotes)}setIdToRemoteMap(e,n){const{remote:o,expose:i}=n,{name:c,alias:a}=o;if(this.idToRemoteMap[e]={name:o.name,expose:i},a&&e.startsWith(c)){const l=e.replace(c,a);this.idToRemoteMap[l]={name:o.name,expose:i};return}if(a&&e.startsWith(a)){const l=e.replace(a,c);this.idToRemoteMap[l]={name:o.name,expose:i}}}async loadRemote(e,n){const{host:o}=this;try{const{loadFactory:i=!0}=n||{loadFactory:!0},{module:c,moduleOptions:a,remoteMatchInfo:l}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:p,remote:m,expose:b,id:S,remoteSnapshot:g}=l,T=await c.get(S,b,n,g),M=await this.hooks.lifecycle.onLoad.emit({id:S,pkgNameOrAlias:p,expose:b,exposeModule:i?T:void 0,exposeModuleFactory:i?void 0:T,remote:m,options:a,moduleInstance:c,origin:o});return this.setIdToRemoteMap(e,l),typeof M=="function"?M:T}catch(i){const{from:c="runtime"}=n||{from:"runtime"},a=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:i,from:c,lifecycle:"onLoad",origin:o});if(!a)throw i;return a}}async preloadRemote(e){const{host:n}=this;await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:n.options,origin:n});const o=Jt(n.options.remotes,e);await Promise.all(o.map(async i=>{const{remote:c}=i,a=Re(c),{globalSnapshot:l,remoteSnapshot:p}=await n.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:c}),m=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:n,preloadOptions:i,remote:c,remoteInfo:a,globalSnapshot:l,remoteSnapshot:p});m&&ke(a,n,m)}))}registerRemotes(e,n){const{host:o}=this;e.forEach(i=>{this.registerRemote(i,o.options.remotes,{force:n?.force})})}async getRemoteModuleAndOptions(e){const{host:n}=this,{id:o}=e;let i;try{i=await this.hooks.lifecycle.beforeRequest.emit({id:o,options:n.options,origin:n})}catch(M){if(i=await this.hooks.lifecycle.errorLoadRemote.emit({id:o,options:n.options,origin:n,from:"runtime",error:M,lifecycle:"beforeRequest"}),!i)throw M}const{id:c}=i,a=Le(n.options.remotes,c);d(a,s.getShortErrorMsg(s.RUNTIME_004,s.runtimeDescMap,{hostName:n.options.name,requestId:c}));const{remote:l}=a,p=Re(l),m=await n.sharedHandler.hooks.lifecycle.afterResolve.emit({id:c,...a,options:n.options,origin:n,remoteInfo:p}),{remote:b,expose:S}=m;d(b&&S,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${c}.`);let g=n.moduleCache.get(b.name);const T={host:n,remoteInfo:p};return g||(g=new Ce(T),n.moduleCache.set(b.name,g)),{module:g,moduleOptions:T,remoteMatchInfo:m}}registerRemote(e,n,o){const{host:i}=this,c=()=>{if(e.alias){const l=n.find(p=>e.alias&&(p.name.startsWith(e.alias)||p.alias?.startsWith(e.alias)));d(!l,`The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${l&&l.name} name or alias`)}"entry"in e&&t.isBrowserEnv()&&!e.entry.startsWith("http")&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||(e.shareScope=Ee),e.type||(e.type=We)};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:i});const a=n.find(l=>l.name===e.name);if(!a)c(),n.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:i});else{const l=[`The remote "${e.name}" is already registered.`,"Please note that overriding it may cause unexpected errors."];o?.force&&(this.removeRemote(a),c(),n.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:i}),t.warn(l.join(" ")))}}removeRemote(e){try{const{host:n}=this,{name:o}=e,i=n.options.remotes.findIndex(a=>a.name===o);i!==-1&&n.options.remotes.splice(i,1);const c=n.moduleCache.get(e.name);if(c){const a=c.remoteInfo,l=a.entryGlobalName;P[l]&&(Object.getOwnPropertyDescriptor(P,l)?.configurable?delete P[l]:P[l]=void 0);const p=Fe(c.remoteInfo);ce[p]&&delete ce[p],n.snapshotHandler.manifestCache.delete(a.entry);let m=a.buildVersion?t.composeKeyWithSeparator(a.name,a.buildVersion):a.name;const b=P.__FEDERATION__.__INSTANCES__.findIndex(g=>a.buildVersion?g.options.id===m:g.name===m);if(b!==-1){const g=P.__FEDERATION__.__INSTANCES__[b];m=g.options.id||m;const T=De();let M=!0;const j=[];Object.keys(T).forEach(v=>{const A=T[v];A&&Object.keys(A).forEach(G=>{const L=A[G];L&&Object.keys(L).forEach(q=>{const Y=L[q];Y&&Object.keys(Y).forEach(ue=>{const W=Y[ue];W&&typeof W=="object"&&W.from===a.name&&(W.loaded||W.loading?(W.useIn=W.useIn.filter(se=>se!==a.name),W.useIn.length?M=!1:j.push([v,G,q,ue])):j.push([v,G,q,ue]))})})})}),M&&(g.shareScopeMap={},delete T[m]),j.forEach(([v,A,G,L])=>{delete T[v]?.[A]?.[G]?.[L]}),P.__FEDERATION__.__INSTANCES__.splice(b,1)}const{hostGlobalSnapshot:S}=ft(e,n);if(S){const g=S&&"remotesInfo"in S&&S.remotesInfo&&Z(S.remotesInfo,e.name).key;g&&(delete S.remotesInfo[g],V.__FEDERATION__.__MANIFEST_LOADING__[g]&&delete V.__FEDERATION__.__MANIFEST_LOADING__[g])}n.moduleCache.delete(e.name)}}catch(n){u.log("removeRemote fail: ",n)}}}const ar=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN=="boolean"?!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN:!0;class cr{constructor(e){this.hooks=new _e({beforeInit:new Ne("beforeInit"),init:new te,beforeInitContainer:new de("beforeInitContainer"),initContainer:new de("initContainer")}),this.version="0.21.4",this.moduleCache=new Map,this.loaderHook=new _e({getModuleInfo:new te,createScript:new te,createLink:new te,fetch:new oe,loadEntryError:new oe,getModuleFactory:new oe}),this.bridgeHook=new _e({beforeBridgeRender:new te,afterBridgeRender:new te,beforeBridgeDestroy:new te,afterBridgeDestroy:new te});const n=ar?[er(),nr()]:[],o={id:Vt(),name:e.name,plugins:n,remotes:[],shared:{},inBrowser:t.isBrowserEnv()};this.name=e.name,this.options=o,this.snapshotHandler=new or(this),this.sharedHandler=new sr(this),this.remoteHandler=new ir(this),this.shareScopeMap=this.sharedHandler.shareScopeMap,this.registerPlugins([...o.plugins,...e.plugins||[]]),this.options=this.formatOptions(o,e)}initOptions(e){this.registerPlugins(e.plugins);const n=this.formatOptions(this.options,e);return this.options=n,n}async loadShare(e,n){return this.sharedHandler.loadShare(e,n)}loadShareSync(e,n){return this.sharedHandler.loadShareSync(e,n)}initializeSharing(e=Ee,n){return this.sharedHandler.initializeSharing(e,n)}initRawContainer(e,n,o){const i=Re({name:e,entry:n}),c=new Ce({host:this,remoteInfo:i});return c.remoteEntryExports=o,this.moduleCache.set(e,c),c}async loadRemote(e,n){return this.remoteHandler.loadRemote(e,n)}async preloadRemote(e){return this.remoteHandler.preloadRemote(e)}initShareScopeMap(e,n,o={}){this.sharedHandler.initShareScopeMap(e,n,o)}formatOptions(e,n){const{shared:o}=nt(e,n),{userOptions:i,options:c}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:n,options:e,shareInfo:o}),a=this.remoteHandler.formatAndRegisterRemote(c,i),{shared:l}=this.sharedHandler.registerShared(c,i),p=[...c.plugins];i.plugins&&i.plugins.forEach(b=>{p.includes(b)||p.push(b)});const m={...e,...n,plugins:p,remotes:a,shared:l};return this.hooks.lifecycle.init.emit({origin:this,options:m}),m}registerPlugins(e){const n=qt(e,this);this.options.plugins=this.options.plugins.reduce((o,i)=>(i&&o&&!o.find(c=>c.name===i.name)&&o.push(i),o),n||[])}registerRemotes(e,n){return this.remoteHandler.registerRemotes(e,n)}registerShared(e){this.sharedHandler.registerShared(this.options,{...this.options,shared:e})}}var lr=Object.freeze({__proto__:null});return index_cjs$2.loadScript=t.loadScript,index_cjs$2.loadScriptNode=t.loadScriptNode,index_cjs$2.CurrentGlobal=P,index_cjs$2.Global=V,index_cjs$2.Module=Ce,index_cjs$2.ModuleFederation=cr,index_cjs$2.addGlobalSnapshot=K,index_cjs$2.assert=d,index_cjs$2.getGlobalFederationConstructor=k,index_cjs$2.getGlobalSnapshot=fe,index_cjs$2.getInfoWithoutType=Z,index_cjs$2.getRegisteredShare=me,index_cjs$2.getRemoteEntry=Se,index_cjs$2.getRemoteInfo=Re,index_cjs$2.helpers=Qt,index_cjs$2.isStaticResourcesEqual=U,index_cjs$2.matchRemoteWithNameAndExpose=Le,index_cjs$2.registerGlobalPlugins=Ge,index_cjs$2.resetFederationGlobalInfo=I,index_cjs$2.safeWrapper=C,index_cjs$2.satisfy=ge,index_cjs$2.setGlobalFederationConstructor=z,index_cjs$2.setGlobalFederationInstance=N,index_cjs$2.types=lr,index_cjs$2}var utils_cjs={},hasRequiredUtils_cjs;function requireUtils_cjs(){if(hasRequiredUtils_cjs)return utils_cjs;hasRequiredUtils_cjs=1;var t=requireIndex_cjs$1();function s(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function h(u,d){const E=s();return t.CurrentGlobal.__FEDERATION__.__INSTANCES__.find(_=>!!(E&&_.options.id===E||_.options.name===u&&!_.options.version&&!d||_.options.name===u&&d&&_.options.version===d))}return utils_cjs.getGlobalFederationInstance=h,utils_cjs}var hasRequiredIndex_cjs;function requireIndex_cjs(){if(hasRequiredIndex_cjs)return index_cjs$3;hasRequiredIndex_cjs=1;var t=requireIndex_cjs$1(),s=requireIndex_cjs$2(),h=requireUtils_cjs();function u(w){const U=t.getGlobalFederationConstructor()||t.ModuleFederation,Q=new U(w);return t.setGlobalFederationInstance(Q),Q}let d=null;function E(w){const U=h.getGlobalFederationInstance(w.name,w.version);return U?(U.initOptions(w),d||(d=U),U):(d=u(w),d)}function _(...w){return t.assert(d,s.getShortErrorMsg(s.RUNTIME_009,s.runtimeDescMap)),d.loadRemote.apply(d,w)}function y(...w){return t.assert(d,s.getShortErrorMsg(s.RUNTIME_009,s.runtimeDescMap)),d.loadShare.apply(d,w)}function R(...w){return t.assert(d,s.getShortErrorMsg(s.RUNTIME_009,s.runtimeDescMap)),d.loadShareSync.apply(d,w)}function $(...w){return t.assert(d,s.getShortErrorMsg(s.RUNTIME_009,s.runtimeDescMap)),d.preloadRemote.apply(d,w)}function x(...w){return t.assert(d,s.getShortErrorMsg(s.RUNTIME_009,s.runtimeDescMap)),d.registerRemotes.apply(d,w)}function C(...w){return t.assert(d,s.getShortErrorMsg(s.RUNTIME_009,s.runtimeDescMap)),d.registerPlugins.apply(d,w)}function H(){return d}function B(...w){return t.assert(d,s.getShortErrorMsg(s.RUNTIME_009,s.runtimeDescMap)),d.registerShared.apply(d,w)}return t.setGlobalFederationConstructor(t.ModuleFederation),index_cjs$3.Module=t.Module,index_cjs$3.ModuleFederation=t.ModuleFederation,index_cjs$3.getRemoteEntry=t.getRemoteEntry,index_cjs$3.getRemoteInfo=t.getRemoteInfo,index_cjs$3.loadScript=t.loadScript,index_cjs$3.loadScriptNode=t.loadScriptNode,index_cjs$3.registerGlobalPlugins=t.registerGlobalPlugins,index_cjs$3.createInstance=u,index_cjs$3.getInstance=H,index_cjs$3.init=E,index_cjs$3.loadRemote=_,index_cjs$3.loadShare=y,index_cjs$3.loadShareSync=R,index_cjs$3.preloadRemote=$,index_cjs$3.registerPlugins=C,index_cjs$3.registerRemotes=x,index_cjs$3.registerShared=B,index_cjs$3}var hasRequiredRuntime_cjs;function requireRuntime_cjs(){return hasRequiredRuntime_cjs||(hasRequiredRuntime_cjs=1,(function(t){var s=requireIndex_cjs();Object.prototype.hasOwnProperty.call(s,"__proto__")&&!Object.prototype.hasOwnProperty.call(t,"__proto__")&&Object.defineProperty(t,"__proto__",{enumerable:!0,value:s.__proto__}),Object.keys(s).forEach(function(h){h!=="default"&&!Object.prototype.hasOwnProperty.call(t,h)&&(t[h]=s[h])})})(runtime_cjs)),runtime_cjs}var hasRequiredRuntime;function requireRuntime(){return hasRequiredRuntime||(hasRequiredRuntime=1,(function(t){var s=runtime&&runtime.__createBinding||(Object.create?(function(u,d,E,_){_===void 0&&(_=E);var y=Object.getOwnPropertyDescriptor(d,E);(!y||("get"in y?!d.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return d[E]}}),Object.defineProperty(u,_,y)}):(function(u,d,E,_){_===void 0&&(_=E),u[_]=d[E]})),h=runtime&&runtime.__exportStar||function(u,d){for(var E in u)E!=="default"&&!Object.prototype.hasOwnProperty.call(d,E)&&s(d,u,E)};Object.defineProperty(t,"__esModule",{value:!0}),h(requireRuntime_cjs(),t)})(runtime)),runtime}var runtimeExports=requireRuntime();const loadAsyncComponent=t=>vue.defineAsyncComponent(()=>runtimeExports.loadRemote(t).then(s=>{if(!s?.default)throw new Error(`Failed to load component from ${t}`);return s.default}));const IS_CLIENT=typeof window<"u";let activePinia;const setActivePinia=t=>activePinia=t;process.env.NODE_ENV;const piniaSymbol=process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function isPlainObject(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var MutationType;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(MutationType||(MutationType={}));function patchObject(t,s){for(const h in s){const u=s[h];if(!(h in t))continue;const d=t[h];isPlainObject(d)&&isPlainObject(u)&&!vue.isRef(u)&&!vue.isReactive(u)?t[h]=patchObject(d,u):t[h]=u}return t}const noop=()=>{};function addSubscription(t,s,h,u=noop){t.add(s);const d=()=>{t.delete(s)&&u()};return!h&&vue.getCurrentScope()&&vue.onScopeDispose(d),d}function triggerSubscriptions(t,...s){t.forEach(h=>{h(...s)})}const fallbackRunWithContext=t=>t(),ACTION_MARKER=Symbol(),ACTION_NAME=Symbol();function mergeReactiveObjects(t,s){t instanceof Map&&s instanceof Map?s.forEach((h,u)=>t.set(u,h)):t instanceof Set&&s instanceof Set&&s.forEach(t.add,t);for(const h in s){if(!s.hasOwnProperty(h))continue;const u=s[h],d=t[h];isPlainObject(d)&&isPlainObject(u)&&t.hasOwnProperty(h)&&!vue.isRef(u)&&!vue.isReactive(u)?t[h]=mergeReactiveObjects(d,u):t[h]=u}return t}const skipHydrateSymbol=process.env.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();function shouldHydrate(t){return!isPlainObject(t)||!Object.prototype.hasOwnProperty.call(t,skipHydrateSymbol)}const{assign}=Object;function isComputed(t){return!!(vue.isRef(t)&&t.effect)}function createOptionsStore(t,s,h,u){const{state:d,actions:E,getters:_}=s,y=h.state.value[t];let R;function $(){!y&&(process.env.NODE_ENV==="production"||!u)&&(h.state.value[t]=d?d():{});const x=process.env.NODE_ENV!=="production"&&u?vue.toRefs(vue.ref(d?d():{}).value):vue.toRefs(h.state.value[t]);return assign(x,E,Object.keys(_||{}).reduce((C,H)=>(process.env.NODE_ENV!=="production"&&H in x&&console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${H}" in store "${t}".`),C[H]=vue.markRaw(vue.computed(()=>{setActivePinia(h);const B=h._s.get(t);return _[H].call(B,B)})),C),{}))}return R=createSetupStore(t,$,s,h,u,!0),R}function createSetupStore(t,s,h={},u,d,E){let _;const y=assign({actions:{}},h);if(process.env.NODE_ENV!=="production"&&!u._e.active)throw new Error("Pinia destroyed");const R={deep:!0};process.env.NODE_ENV!=="production"&&(R.onTrigger=I=>{$?B=I:$==!1&&!O._hotUpdating&&(Array.isArray(B)?B.push(I):console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."))});let $,x,C=new Set,H=new Set,B;const w=u.state.value[t];!E&&!w&&(process.env.NODE_ENV==="production"||!d)&&(u.state.value[t]={});const U=vue.ref({});let Q;function J(I){let N;$=x=!1,process.env.NODE_ENV!=="production"&&(B=[]),typeof I=="function"?(I(u.state.value[t]),N={type:MutationType.patchFunction,storeId:t,events:B}):(mergeReactiveObjects(u.state.value[t],I),N={type:MutationType.patchObject,payload:I,storeId:t,events:B});const k=Q=Symbol();vue.nextTick().then(()=>{Q===k&&($=!0)}),x=!0,triggerSubscriptions(C,N,u.state.value[t])}const D=E?function(){const{state:N}=h,k=N?N():{};this.$patch(z=>{assign(z,k)})}:process.env.NODE_ENV!=="production"?()=>{throw new Error(`🍍: Store "${t}" is built using the setup syntax and does not implement $reset().`)}:noop;function P(){_.stop(),C.clear(),H.clear(),u._s.delete(t)}const F=(I,N="")=>{if(ACTION_MARKER in I)return I[ACTION_NAME]=N,I;const k=function(){setActivePinia(u);const z=Array.from(arguments),Z=new Set,fe=new Set;function Ie(K){Z.add(K)}function he(K){fe.add(K)}triggerSubscriptions(H,{args:z,name:k[ACTION_NAME],store:O,after:Ie,onError:he});let le;try{le=I.apply(this&&this.$id===t?this:O,z)}catch(K){throw triggerSubscriptions(fe,K),K}return le instanceof Promise?le.then(K=>(triggerSubscriptions(Z,K),K)).catch(K=>(triggerSubscriptions(fe,K),Promise.reject(K))):(triggerSubscriptions(Z,le),le)};return k[ACTION_MARKER]=!0,k[ACTION_NAME]=N,k},V=vue.markRaw({actions:{},getters:{},state:[],hotState:U}),ee={_p:u,$id:t,$onAction:addSubscription.bind(null,H),$patch:J,$reset:D,$subscribe(I,N={}){const k=addSubscription(C,I,N.detached,()=>z()),z=_.run(()=>vue.watch(()=>u.state.value[t],Z=>{(N.flush==="sync"?x:$)&&I({storeId:t,type:MutationType.direct,events:B},Z)},assign({},R,N)));return k},$dispose:P},O=vue.reactive(process.env.NODE_ENV!=="production"||process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&IS_CLIENT?assign({_hmrPayload:V,_customProperties:vue.markRaw(new Set)},ee):ee);u._s.set(t,O);const ne=(u._a&&u._a.runWithContext||fallbackRunWithContext)(()=>u._e.run(()=>(_=vue.effectScope()).run(()=>s({action:F}))));for(const I in ne){const N=ne[I];if(vue.isRef(N)&&!isComputed(N)||vue.isReactive(N))process.env.NODE_ENV!=="production"&&d?U.value[I]=vue.toRef(ne,I):E||(w&&shouldHydrate(N)&&(vue.isRef(N)?N.value=w[I]:mergeReactiveObjects(N,w[I])),u.state.value[t][I]=N),process.env.NODE_ENV!=="production"&&V.state.push(I);else if(typeof N=="function"){const k=process.env.NODE_ENV!=="production"&&d?N:F(N,I);ne[I]=k,process.env.NODE_ENV!=="production"&&(V.actions[I]=N),y.actions[I]=N}else process.env.NODE_ENV!=="production"&&isComputed(N)&&(V.getters[I]=E?h.getters[I]:N,IS_CLIENT&&(ne._getters||(ne._getters=vue.markRaw([]))).push(I))}if(assign(O,ne),assign(vue.toRaw(O),ne),Object.defineProperty(O,"$state",{get:()=>process.env.NODE_ENV!=="production"&&d?U.value:u.state.value[t],set:I=>{if(process.env.NODE_ENV!=="production"&&d)throw new Error("cannot set hotState");J(N=>{assign(N,I)})}}),process.env.NODE_ENV!=="production"&&(O._hotUpdate=vue.markRaw(I=>{O._hotUpdating=!0,I._hmrPayload.state.forEach(N=>{if(N in O.$state){const k=I.$state[N],z=O.$state[N];typeof k=="object"&&isPlainObject(k)&&isPlainObject(z)?patchObject(k,z):I.$state[N]=z}O[N]=vue.toRef(I.$state,N)}),Object.keys(O.$state).forEach(N=>{N in I.$state||delete O[N]}),$=!1,x=!1,u.state.value[t]=vue.toRef(I._hmrPayload,"hotState"),x=!0,vue.nextTick().then(()=>{$=!0});for(const N in I._hmrPayload.actions){const k=I[N];O[N]=F(k,N)}for(const N in I._hmrPayload.getters){const k=I._hmrPayload.getters[N],z=E?vue.computed(()=>(setActivePinia(u),k.call(O,O))):k;O[N]=z}Object.keys(O._hmrPayload.getters).forEach(N=>{N in I._hmrPayload.getters||delete O[N]}),Object.keys(O._hmrPayload.actions).forEach(N=>{N in I._hmrPayload.actions||delete O[N]}),O._hmrPayload=I._hmrPayload,O._getters=I._getters,O._hotUpdating=!1})),process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&IS_CLIENT){const I={writable:!0,configurable:!0,enumerable:!1};["_p","_hmrPayload","_getters","_customProperties"].forEach(N=>{Object.defineProperty(O,N,assign({value:O[N]},I))})}return u._p.forEach(I=>{if(process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&IS_CLIENT){const N=_.run(()=>I({store:O,app:u._a,pinia:u,options:y}));Object.keys(N||{}).forEach(k=>O._customProperties.add(k)),assign(O,N)}else assign(O,_.run(()=>I({store:O,app:u._a,pinia:u,options:y})))}),process.env.NODE_ENV!=="production"&&O.$state&&typeof O.$state=="object"&&typeof O.$state.constructor=="function"&&!O.$state.constructor.toString().includes("[native code]")&&console.warn(`[🍍]: The "state" must be a plain object. It cannot be
7
+ `)},w={[t]:"Failed to get remoteEntry exports.",[s]:'The remote entry interface does not contain "init"',[d]:"Failed to get manifest.",[u]:"Failed to locate remote.",[h]:"Invalid loadShareSync function call from bundler runtime",[E]:"Invalid loadShareSync function call from runtime",[_]:"Failed to get remote snapshot.",[y]:"Failed to load script resources.",[R]:"Please call createInstance first."},U={[$]:"Failed to generate type declaration. Execute the below cmd to reproduce and fix the error."},Q={[x]:"Failed to find expose module.",[k]:"PublicPath is required in prod mode."},J={...w,...U,...Q};return index_cjs.BUILD_001=x,index_cjs.BUILD_002=k,index_cjs.RUNTIME_001=t,index_cjs.RUNTIME_002=s,index_cjs.RUNTIME_003=d,index_cjs.RUNTIME_004=u,index_cjs.RUNTIME_005=h,index_cjs.RUNTIME_006=E,index_cjs.RUNTIME_007=_,index_cjs.RUNTIME_008=y,index_cjs.RUNTIME_009=R,index_cjs.TYPE_001=$,index_cjs.buildDescMap=Q,index_cjs.errorDescMap=J,index_cjs.getShortErrorMsg=B,index_cjs.runtimeDescMap=w,index_cjs.typeDescMap=U,index_cjs}var hasRequiredIndex_cjs$1;function requireIndex_cjs$1(){if(hasRequiredIndex_cjs$1)return index_cjs$2;hasRequiredIndex_cjs$1=1;var t=requireIndex_cjs$3(),s=requireIndex_cjs$2();const d="[ Federation Runtime ]",u=t.createLogger(d);function h(n,e){n||E(e)}function E(n){throw n instanceof Error?(n.message.startsWith(d)||(n.message=`${d}: ${n.message}`),n):new Error(`${d}: ${n}`)}function _(n){n instanceof Error&&(n.message.startsWith(d)||(n.message=`${d}: ${n.message}`)),u.warn(n)}function y(n,e){return n.findIndex(r=>r===e)===-1&&n.push(e),n}function R(n){return"version"in n&&n.version?`${n.name}:${n.version}`:"entry"in n&&n.entry?`${n.name}:${n.entry}`:`${n.name}`}function $(n){return typeof n.entry<"u"}function x(n){return!n.entry.includes(".json")}async function k(n,e){try{return await n()}catch(r){!e&&_(r);return}}function H(n){return n&&typeof n=="object"}const B=Object.prototype.toString;function w(n){return B.call(n)==="[object Object]"}function U(n,e){const r=/^(https?:)?\/\//i,o=n.replace(r,"").replace(/\/$/,""),i=e.replace(r,"").replace(/\/$/,"");return o===i}function Q(n){return Array.isArray(n)?n:[n]}function J(n){const e={url:"",type:"global",globalName:""};return t.isBrowserEnv()||t.isReactNativeEnv()?"remoteEntry"in n?{url:n.remoteEntry,type:n.remoteEntryType,globalName:n.globalName}:e:"ssrRemoteEntry"in n?{url:n.ssrRemoteEntry||e.url,type:n.ssrRemoteEntryType||e.type,globalName:n.globalName}:e}const L=(n,e)=>{let r;return n.endsWith("/")?r=n.slice(0,-1):r=n,e.startsWith(".")&&(e=e.slice(1)),r=r+e,r},P=typeof globalThis=="object"?globalThis:window,F=(()=>{try{return document.defaultView}catch{return P}})(),V=F;function ee(n,e,r){Object.defineProperty(n,e,{value:r,configurable:!1,writable:!0})}function O(n,e){return Object.hasOwnProperty.call(n,e)}O(P,"__GLOBAL_LOADING_REMOTE_ENTRY__")||ee(P,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});const ce=P.__GLOBAL_LOADING_REMOTE_ENTRY__;function re(n){O(n,"__VMOK__")&&!O(n,"__FEDERATION__")&&ee(n,"__FEDERATION__",n.__VMOK__),O(n,"__FEDERATION__")||(ee(n,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),ee(n,"__VMOK__",n.__FEDERATION__)),n.__FEDERATION__.__GLOBAL_PLUGIN__??=[],n.__FEDERATION__.__INSTANCES__??=[],n.__FEDERATION__.moduleInfo??={},n.__FEDERATION__.__SHARE__??={},n.__FEDERATION__.__MANIFEST_LOADING__??={},n.__FEDERATION__.__PRELOADED_MAP__??=new Map}re(P),re(F);function I(){P.__FEDERATION__.__GLOBAL_PLUGIN__=[],P.__FEDERATION__.__INSTANCES__=[],P.__FEDERATION__.moduleInfo={},P.__FEDERATION__.__SHARE__={},P.__FEDERATION__.__MANIFEST_LOADING__={},Object.keys(ce).forEach(n=>{delete ce[n]})}function N(n){P.__FEDERATION__.__INSTANCES__.push(n)}function C(){return P.__FEDERATION__.__DEBUG_CONSTRUCTOR__}function K(n,e=t.isDebugMode()){e&&(P.__FEDERATION__.__DEBUG_CONSTRUCTOR__=n,P.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="0.21.4")}function Z(n,e){if(typeof e=="string"){if(n[e])return{value:n[e],key:e};{const o=Object.keys(n);for(const i of o){const[c,a]=i.split(":"),l=`${c}:${e}`,p=n[l];if(p)return{value:p,key:l}}return{value:void 0,key:e}}}else throw new Error("key must be string")}const fe=()=>F.__FEDERATION__.moduleInfo,Ie=(n,e)=>{const r=R(n),o=Z(e,r).value;if(o&&!o.version&&"version"in n&&n.version&&(o.version=n.version),o)return o;if("version"in n&&n.version){const{version:i,...c}=n,a=R(c),l=Z(F.__FEDERATION__.moduleInfo,a).value;if(l?.version===i)return l}},he=n=>Ie(n,F.__FEDERATION__.moduleInfo),le=(n,e)=>{const r=R(n);return F.__FEDERATION__.moduleInfo[r]=e,F.__FEDERATION__.moduleInfo},z=n=>(F.__FEDERATION__.moduleInfo={...F.__FEDERATION__.moduleInfo,...n},()=>{const e=Object.keys(n);for(const r of e)delete F.__FEDERATION__.moduleInfo[r]}),$e=(n,e)=>{const r=e||`__FEDERATION_${n}:custom__`,o=P[r];return{remoteEntryKey:r,entryExports:o}},Ge=n=>{const{__GLOBAL_PLUGIN__:e}=F.__FEDERATION__;n.forEach(r=>{e.findIndex(o=>o.name===r.name)===-1?e.push(r):_(`The plugin ${r.name} has been registered.`)})},Ve=()=>F.__FEDERATION__.__GLOBAL_PLUGIN__,Be=n=>P.__FEDERATION__.__PRELOADED_MAP__.get(n),qe=n=>P.__FEDERATION__.__PRELOADED_MAP__.set(n,!0),Ee="default",We="global",ze="[0-9A-Za-z-]+",Me=`(?:\\+(${ze}(?:\\.${ze})*))`,ye="0|[1-9]\\d*",ve="[0-9]+",Ke="\\d*[a-zA-Z-][a-zA-Z0-9-]*",Xe=`(?:${ve}|${Ke})`,dt=`(?:-?(${Xe}(?:\\.${Xe})*))`,Ye=`(?:${ye}|${Ke})`,Je=`(?:-(${Ye}(?:\\.${Ye})*))`,Pe=`${ye}|x|X|\\*`,pe=`[v=\\s]*(${Pe})(?:\\.(${Pe})(?:\\.(${Pe})(?:${Je})?${Me}?)?)?`,ht=`^\\s*(${pe})\\s+-\\s+(${pe})\\s*$`,pt=`[v=\\s]*${`(${ve})\\.(${ve})\\.(${ve})`}${dt}?${Me}?`,xe="((?:<|>)?=?)",mt=`(\\s*)${xe}\\s*(${pt}|${pe})`,Ze="(?:~>?)",_t=`(\\s*)${Ze}\\s+`,Qe="(?:\\^)",Et=`(\\s*)${Qe}\\s+`,yt="(<|>)?=?\\s*\\*",gt=`^${Qe}${pe}$`,bt=`v?${`(${ye})\\.(${ye})\\.(${ye})`}${Je}?${Me}?`,St=`^${Ze}${pe}$`,Rt=`^${xe}\\s*${pe}$`,Nt=`^${xe}\\s*(${bt})$|^$`,It="^\\s*>=\\s*0.0.0\\s*$";function ie(n){return new RegExp(n)}function X(n){return!n||n.toLowerCase()==="x"||n==="*"}function et(...n){return e=>n.reduce((r,o)=>o(r),e)}function tt(n){return n.match(ie(Nt))}function nt(n,e,r,o){const i=`${n}.${e}.${r}`;return o?`${i}-${o}`:i}function $t(n){return n.replace(ie(ht),(e,r,o,i,c,a,l,p,m,b,S,g)=>(X(o)?r="":X(i)?r=`>=${o}.0.0`:X(c)?r=`>=${o}.${i}.0`:r=`>=${r}`,X(m)?p="":X(b)?p=`<${Number(m)+1}.0.0-0`:X(S)?p=`<${m}.${Number(b)+1}.0-0`:g?p=`<=${m}.${b}.${S}-${g}`:p=`<=${p}`,`${r} ${p}`.trim()))}function vt(n){return n.replace(ie(mt),"$1$2$3")}function Tt(n){return n.replace(ie(_t),"$1~")}function Ot(n){return n.replace(ie(Et),"$1^")}function Mt(n){return n.trim().split(/\s+/).map(e=>e.replace(ie(gt),(r,o,i,c,a)=>X(o)?"":X(i)?`>=${o}.0.0 <${Number(o)+1}.0.0-0`:X(c)?o==="0"?`>=${o}.${i}.0 <${o}.${Number(i)+1}.0-0`:`>=${o}.${i}.0 <${Number(o)+1}.0.0-0`:a?o==="0"?i==="0"?`>=${o}.${i}.${c}-${a} <${o}.${i}.${Number(c)+1}-0`:`>=${o}.${i}.${c}-${a} <${o}.${Number(i)+1}.0-0`:`>=${o}.${i}.${c}-${a} <${Number(o)+1}.0.0-0`:o==="0"?i==="0"?`>=${o}.${i}.${c} <${o}.${i}.${Number(c)+1}-0`:`>=${o}.${i}.${c} <${o}.${Number(i)+1}.0-0`:`>=${o}.${i}.${c} <${Number(o)+1}.0.0-0`)).join(" ")}function Pt(n){return n.trim().split(/\s+/).map(e=>e.replace(ie(St),(r,o,i,c,a)=>X(o)?"":X(i)?`>=${o}.0.0 <${Number(o)+1}.0.0-0`:X(c)?`>=${o}.${i}.0 <${o}.${Number(i)+1}.0-0`:a?`>=${o}.${i}.${c}-${a} <${o}.${Number(i)+1}.0-0`:`>=${o}.${i}.${c} <${o}.${Number(i)+1}.0-0`)).join(" ")}function xt(n){return n.split(/\s+/).map(e=>e.trim().replace(ie(Rt),(r,o,i,c,a,l)=>{const p=X(i),m=p||X(c),b=m||X(a);return o==="="&&b&&(o=""),l="",p?o===">"||o==="<"?"<0.0.0-0":"*":o&&b?(m&&(c=0),a=0,o===">"?(o=">=",m?(i=Number(i)+1,c=0,a=0):(c=Number(c)+1,a=0)):o==="<="&&(o="<",m?i=Number(i)+1:c=Number(c)+1),o==="<"&&(l="-0"),`${o+i}.${c}.${a}${l}`):m?`>=${i}.0.0${l} <${Number(i)+1}.0.0-0`:b?`>=${i}.${c}.0${l} <${i}.${Number(c)+1}.0-0`:r})).join(" ")}function wt(n){return n.trim().replace(ie(yt),"")}function jt(n){return n.trim().replace(ie(It),"")}function Te(n,e){return n=Number(n)||n,e=Number(e)||e,n>e?1:n===e?0:-1}function At(n,e){const{preRelease:r}=n,{preRelease:o}=e;if(r===void 0&&o)return 1;if(r&&o===void 0)return-1;if(r===void 0&&o===void 0)return 0;for(let i=0,c=r.length;i<=c;i++){const a=r[i],l=o[i];if(a!==l)return a===void 0&&l===void 0?0:a?l?Te(a,l):-1:1}return 0}function Oe(n,e){return Te(n.major,e.major)||Te(n.minor,e.minor)||Te(n.patch,e.patch)||At(n,e)}function we(n,e){return n.version===e.version}function Lt(n,e){switch(n.operator){case"":case"=":return we(n,e);case">":return Oe(n,e)<0;case">=":return we(n,e)||Oe(n,e)<0;case"<":return Oe(n,e)>0;case"<=":return we(n,e)||Oe(n,e)>0;case void 0:return!0;default:return!1}}function Dt(n){return et(Mt,Pt,xt,wt)(n)}function Ft(n){return et($t,vt,Tt,Ot)(n.trim()).split(/\s+/).join(" ")}function ge(n,e){if(!n)return!1;const r=tt(n);if(!r)return!1;const[,o,,i,c,a,l]=r,p={operator:o,version:nt(i,c,a,l),major:i,minor:c,patch:a,preRelease:l?.split(".")},m=e.split("||");for(const b of m){const S=b.trim();if(!S||S==="*"||S==="x")return!0;try{const g=Ft(S);if(!g.trim())return!0;const T=g.split(" ").map(v=>Dt(v)).join(" ");if(!T.trim())return!0;const M=T.split(/\s+/).map(v=>jt(v)).filter(Boolean);if(M.length===0)continue;let j=!0;for(const v of M){const A=tt(v);if(!A){j=!1;break}const[,G,,D,q,Y,ue]=A,W={operator:G,version:nt(D,q,Y,ue),major:D,minor:q,patch:Y,preRelease:ue?.split(".")};if(!Lt(W,p)){j=!1;break}}if(j)return!0}catch(g){console.error(`[semver] Error processing range part "${S}":`,g);continue}}return!1}function Ct(n,e,r,o){let i;return"get"in n?i=n.get:"lib"in n?i=()=>Promise.resolve(n.lib):i=()=>Promise.resolve(()=>{throw new Error(`Can not get shared '${r}'!`)}),{deps:[],useIn:[],from:e,loading:null,...n,shareConfig:{requiredVersion:`^${n.version}`,singleton:!1,eager:!1,strictVersion:!1,...n.shareConfig},get:i,loaded:n?.loaded||"lib"in n?!0:void 0,version:n.version??"0",scope:Array.isArray(n.scope)?n.scope:[n.scope??"default"],strategy:(n.strategy??o)||"version-first"}}function rt(n,e){const r=e.shared||{},o=e.name,i=Object.keys(r).reduce((a,l)=>{const p=Q(r[l]);return a[l]=a[l]||[],p.forEach(m=>{a[l].push(Ct(m,o,l,e.shareStrategy))}),a},{}),c={...n.shared};return Object.keys(i).forEach(a=>{c[a]?i[a].forEach(l=>{c[a].find(m=>m.version===l.version)||c[a].push(l)}):c[a]=i[a]}),{shared:c,shareInfos:i}}function be(n,e){const r=o=>{if(!Number.isNaN(Number(o))){const c=o.split(".");let a=o;for(let l=0;l<3-c.length;l++)a+=".0";return a}return o};return!!ge(r(n),`<=${r(e)}`)}const je=(n,e)=>{const r=e||function(o,i){return be(o,i)};return Object.keys(n).reduce((o,i)=>!o||r(o,i)||o==="0"?i:o,0)},Ae=n=>!!n.loaded||typeof n.lib=="function",kt=n=>!!n.loading;function Ht(n,e,r){const o=n[e][r],i=function(c,a){return!Ae(o[c])&&be(c,a)};return je(n[e][r],i)}function Ut(n,e,r){const o=n[e][r],i=function(c,a){const l=p=>Ae(p)||kt(p);return l(o[a])?l(o[c])?!!be(c,a):!0:l(o[c])?!1:be(c,a)};return je(n[e][r],i)}function Gt(n){return n==="loaded-first"?Ut:Ht}function me(n,e,r,o){if(!n)return;const{shareConfig:i,scope:c=Ee,strategy:a}=r,l=Array.isArray(c)?c:[c];for(const p of l)if(i&&n[p]&&n[p][e]){const{requiredVersion:m}=i,S=Gt(a)(n,p,e),g=()=>{if(i.singleton){if(typeof m=="string"&&!ge(S,m)){const j=`Version ${S} from ${S&&n[p][e][S].from} of shared singleton module ${e} does not satisfy the requirement of ${r.from} which needs ${m})`;i.strictVersion?E(j):_(j)}return n[p][e][S]}else{if(m===!1||m==="*"||ge(S,m))return n[p][e][S];for(const[j,v]of Object.entries(n[p][e]))if(ge(j,m))return v}},T={shareScopeMap:n,scope:p,pkgName:e,version:S,GlobalFederation:V.__FEDERATION__,resolver:g};return(o.emit(T)||T).resolver()}}function Le(){return V.__FEDERATION__.__SHARE__}function ot(n){const{pkgName:e,extraOptions:r,shareInfos:o}=n,i=a=>{if(!a)return;const l={};a.forEach(b=>{l[b.version]=b});const m=je(l,function(b,S){return!Ae(l[b])&&be(b,S)});return l[m]},c=r?.resolver??i;return Object.assign({},c(o[e]),r?.customShareInfo)}function Vt(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function De(n,e){for(const r of n){const o=e.startsWith(r.name);let i=e.replace(r.name,"");if(o){if(i.startsWith("/")){const l=r.name;return i=`.${i}`,{pkgNameOrAlias:l,expose:i,remote:r}}else if(i==="")return{pkgNameOrAlias:r.name,expose:".",remote:r}}const c=r.alias&&e.startsWith(r.alias);let a=r.alias&&e.replace(r.alias,"");if(r.alias&&c){if(a&&a.startsWith("/")){const l=r.alias;return a=`.${a}`,{pkgNameOrAlias:l,expose:a,remote:r}}else if(a==="")return{pkgNameOrAlias:r.alias,expose:".",remote:r}}}}function Bt(n,e){for(const r of n)if(e===r.name||r.alias&&e===r.alias)return r}function qt(n,e){const r=Ve(),o=[e.hooks,e.remoteHandler.hooks,e.sharedHandler.hooks,e.snapshotHandler.hooks,e.loaderHook,e.bridgeHook];return r.length>0&&r.forEach(i=>{n?.find(c=>c.name!==i.name)&&n.push(i)}),n&&n.length>0&&n.forEach(i=>{o.forEach(c=>{c.applyPlugin(i,e)})}),n}const st=".then(callbacks[0]).catch(callbacks[1])";async function Wt({entry:n,remoteEntryExports:e}){return new Promise((r,o)=>{try{e?r(e):typeof FEDERATION_ALLOW_NEW_FUNCTION<"u"?new Function("callbacks",`import("${n}")${st}`)([r,o]):import(n).then(r).catch(o)}catch(i){o(i)}})}async function zt({entry:n,remoteEntryExports:e}){return new Promise((r,o)=>{try{e?r(e):typeof __system_context__>"u"?System.import(n).then(r).catch(o):new Function("callbacks",`System.import("${n}")${st}`)([r,o])}catch(i){o(i)}})}function it(n,e,r){const{remoteEntryKey:o,entryExports:i}=$e(n,e);return h(i,s.getShortErrorMsg(s.RUNTIME_001,s.runtimeDescMap,{remoteName:n,remoteEntryUrl:r,remoteEntryKey:o})),i}async function Kt({name:n,globalName:e,entry:r,loaderHook:o,getEntryUrl:i}){const{entryExports:c}=$e(n,e);if(c)return c;const a=i?i(r):r;return t.loadScript(a,{attrs:{},createScriptHook:(l,p)=>{const m=o.lifecycle.createScript.emit({url:l,attrs:p});if(m&&(m instanceof HTMLScriptElement||"script"in m||"timeout"in m))return m}}).then(()=>it(n,e,r)).catch(l=>{throw h(void 0,s.getShortErrorMsg(s.RUNTIME_008,s.runtimeDescMap,{remoteName:n,resourceUrl:r})),l})}async function Xt({remoteInfo:n,remoteEntryExports:e,loaderHook:r,getEntryUrl:o}){const{entry:i,entryGlobalName:c,name:a,type:l}=n;switch(l){case"esm":case"module":return Wt({entry:i,remoteEntryExports:e});case"system":return zt({entry:i,remoteEntryExports:e});default:return Kt({entry:i,globalName:c,name:a,loaderHook:r,getEntryUrl:o})}}async function Yt({remoteInfo:n,loaderHook:e}){const{entry:r,entryGlobalName:o,name:i,type:c}=n,{entryExports:a}=$e(i,o);return a||t.loadScriptNode(r,{attrs:{name:i,globalName:o,type:c},loaderHook:{createScriptHook:(l,p={})=>{const m=e.lifecycle.createScript.emit({url:l,attrs:p});if(m&&"url"in m)return m}}}).then(()=>it(i,o,r)).catch(l=>{throw l})}function Fe(n){const{entry:e,name:r}=n;return t.composeKeyWithSeparator(r,e)}async function Se(n){const{origin:e,remoteEntryExports:r,remoteInfo:o,getEntryUrl:i,_inErrorHandling:c=!1}=n,a=Fe(o);if(r)return r;if(!ce[a]){const l=e.remoteHandler.hooks.lifecycle.loadEntry,p=e.loaderHook;ce[a]=l.emit({loaderHook:p,remoteInfo:o,remoteEntryExports:r}).then(m=>m||((typeof ENV_TARGET<"u"?ENV_TARGET==="web":t.isBrowserEnv())?Xt({remoteInfo:o,remoteEntryExports:r,loaderHook:p,getEntryUrl:i}):Yt({remoteInfo:o,loaderHook:p}))).catch(async m=>{const b=Fe(o);if(m instanceof Error&&m.message.includes(s.RUNTIME_008)&&!c){const g=M=>Se({...M,_inErrorHandling:!0}),T=await e.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:g,origin:e,remoteInfo:o,remoteEntryExports:r,globalLoading:ce,uniqueKey:b});if(T)return T}throw m})}return ce[a]}function Re(n){return{...n,entry:"entry"in n?n.entry:"",type:n.type||We,entryGlobalName:n.entryGlobalName||n.name,shareScope:n.shareScope||Ee}}function at(n){return{resourceCategory:"sync",share:!0,depsRemote:!0,prefetchInterface:!1,...n}}function Jt(n,e){return e.map(r=>{const o=Bt(n,r.nameOrAlias);return h(o,`Unable to preload ${r.nameOrAlias} as it is not included in ${!o&&t.safeToString({remoteInfo:o,remotes:n})}`),{remote:o,preloadConfig:at(r)}})}function Zt(n){return n?n.map(e=>e==="."?e:e.startsWith("./")?e.replace("./",""):e):[]}function Ce(n,e,r,o=!0){const{cssAssets:i,jsAssetsWithoutEntry:c,entryAssets:a}=r;if(e.options.inBrowser){if(a.forEach(l=>{const{moduleInfo:p}=l,m=e.moduleCache.get(n.name);Se(m?{origin:e,remoteInfo:p,remoteEntryExports:m.remoteEntryExports}:{origin:e,remoteInfo:p,remoteEntryExports:void 0})}),o){const l={rel:"preload",as:"style"};i.forEach(p=>{const{link:m,needAttach:b}=t.createLink({url:p,cb:()=>{},attrs:l,createLinkHook:(S,g)=>{const T=e.loaderHook.lifecycle.createLink.emit({url:S,attrs:g});if(T instanceof HTMLLinkElement)return T}});b&&document.head.appendChild(m)})}else{const l={rel:"stylesheet",type:"text/css"};i.forEach(p=>{const{link:m,needAttach:b}=t.createLink({url:p,cb:()=>{},attrs:l,createLinkHook:(S,g)=>{const T=e.loaderHook.lifecycle.createLink.emit({url:S,attrs:g});if(T instanceof HTMLLinkElement)return T},needDeleteLink:!1});b&&document.head.appendChild(m)})}if(o){const l={rel:"preload",as:"script"};c.forEach(p=>{const{link:m,needAttach:b}=t.createLink({url:p,cb:()=>{},attrs:l,createLinkHook:(S,g)=>{const T=e.loaderHook.lifecycle.createLink.emit({url:S,attrs:g});if(T instanceof HTMLLinkElement)return T}});b&&document.head.appendChild(m)})}else{const l={fetchpriority:"high",type:n?.type==="module"?"module":"text/javascript"};c.forEach(p=>{const{script:m,needAttach:b}=t.createScript({url:p,cb:()=>{},attrs:l,createScriptHook:(S,g)=>{const T=e.loaderHook.lifecycle.createScript.emit({url:S,attrs:g});if(T instanceof HTMLScriptElement)return T},needDeleteScript:!0});b&&document.head.appendChild(m)})}}}var Qt={global:{Global:V,nativeGlobal:F,resetFederationGlobalInfo:I,setGlobalFederationInstance:N,getGlobalFederationConstructor:C,setGlobalFederationConstructor:K,getInfoWithoutType:Z,getGlobalSnapshot:fe,getTargetSnapshotInfoByModuleInfo:Ie,getGlobalSnapshotInfoByModuleInfo:he,setGlobalSnapshotInfoByModuleInfo:le,addGlobalSnapshot:z,getRemoteEntryExports:$e,registerGlobalPlugins:Ge,getGlobalHostPlugins:Ve,getPreloaded:Be,setPreloaded:qe},share:{getRegisteredShare:me,getGlobalShareScope:Le},utils:{matchRemoteWithNameAndExpose:De,preloadAssets:Ce,getRemoteInfo:Re}};class ke{constructor({remoteInfo:e,host:r}){this.inited=!1,this.lib=void 0,this.remoteInfo=e,this.host=r}async getEntry(){if(this.remoteEntryExports)return this.remoteEntryExports;let e;return e=await Se({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports}),h(e,`remoteEntryExports is undefined
8
+ ${t.safeToString(this.remoteInfo)}`),this.remoteEntryExports=e,this.remoteEntryExports}async get(e,r,o,i){const{loadFactory:c=!0}=o||{loadFactory:!0},a=await this.getEntry();if(!this.inited){const S=this.host.shareScopeMap,g=Array.isArray(this.remoteInfo.shareScope)?this.remoteInfo.shareScope:[this.remoteInfo.shareScope];g.length||g.push("default"),g.forEach(A=>{S[A]||(S[A]={})});const T=S[g[0]],M=[],j={version:this.remoteInfo.version||"",shareScopeKeys:Array.isArray(this.remoteInfo.shareScope)?g:this.remoteInfo.shareScope||"default"};Object.defineProperty(j,"shareScopeMap",{value:S,enumerable:!1});const v=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:T,remoteEntryInitOptions:j,initScope:M,remoteInfo:this.remoteInfo,origin:this.host});typeof a?.init>"u"&&E(s.getShortErrorMsg(s.RUNTIME_002,s.runtimeDescMap,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName})),await a.init(v.shareScope,v.initScope,v.remoteEntryInitOptions),await this.host.hooks.lifecycle.initContainer.emit({...v,id:e,remoteSnapshot:i,remoteEntryExports:a})}this.lib=a,this.inited=!0;let l;l=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:a,expose:r,moduleInfo:this.remoteInfo}),l||(l=await a.get(r)),h(l,`${R(this.remoteInfo)} remote don't export ${r}.`);const p=L(this.remoteInfo.name,r),m=this.wraperFactory(l,p);return c?await m():m}wraperFactory(e,r){function o(i,c){i&&typeof i=="object"&&Object.isExtensible(i)&&!Object.getOwnPropertyDescriptor(i,Symbol.for("mf_module_id"))&&Object.defineProperty(i,Symbol.for("mf_module_id"),{value:c,enumerable:!1})}return e instanceof Promise?async()=>{const i=await e();return o(i,r),i}:()=>{const i=e();return o(i,r),i}}}class te{constructor(e){this.type="",this.listeners=new Set,e&&(this.type=e)}on(e){typeof e=="function"&&this.listeners.add(e)}once(e){const r=this;this.on(function o(...i){return r.remove(o),e.apply(null,i)})}emit(...e){let r;return this.listeners.size>0&&this.listeners.forEach(o=>{r=o(...e)}),r}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}}class oe extends te{emit(...e){let r;const o=Array.from(this.listeners);if(o.length>0){let i=0;const c=a=>a===!1?!1:i<o.length?Promise.resolve(o[i++].apply(null,e)).then(c):a;r=c()}return Promise.resolve(r)}}function ct(n,e){if(!H(e))return!1;if(n!==e){for(const r in n)if(!(r in e))return!1}return!0}class Ne extends te{constructor(e){super(),this.onerror=E,this.type=e}emit(e){H(e)||E(`The data for the "${this.type}" hook should be an object.`);for(const r of this.listeners)try{const o=r(e);if(ct(e,o))e=o;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(o){_(o),this.onerror(o)}return e}}class de extends te{constructor(e){super(),this.onerror=E,this.type=e}emit(e){H(e)||E(`The response data for the "${this.type}" hook must be an object.`);const r=Array.from(this.listeners);if(r.length>0){let o=0;const i=a=>(_(a),this.onerror(a),e),c=a=>{if(ct(e,a)){if(e=a,o<r.length)try{return Promise.resolve(r[o++](e)).then(c,i)}catch(l){return i(l)}}else this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`);return e};return Promise.resolve(c(e))}return Promise.resolve(e)}}class _e{constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}applyPlugin(e,r){h(w(e),"Plugin configuration is invalid.");const o=e.name;h(o,"A name must be provided by the plugin."),this.registerPlugins[o]||(this.registerPlugins[o]=e,e.apply?.(r),Object.keys(this.lifecycle).forEach(i=>{const c=e[i];c&&this.lifecycle[i].on(c)}))}removePlugin(e){h(e,"A name is required.");const r=this.registerPlugins[e];h(r,`The plugin "${e}" is not registered.`),Object.keys(r).forEach(o=>{o!=="name"&&this.lifecycle[o].remove(r[o])})}}function lt(n,e){const r=J(e);r.url||E(`The attribute remoteEntry of ${n.name} must not be undefined.`);let o=t.getResourceUrl(e,r.url);!t.isBrowserEnv()&&!o.startsWith("http")&&(o=`https:${o}`),n.type=r.type,n.entryGlobalName=r.globalName,n.entry=o,n.version=e.version,n.buildVersion=e.buildVersion}function en(){return{name:"snapshot-plugin",async afterResolve(n){const{remote:e,pkgNameOrAlias:r,expose:o,origin:i,remoteInfo:c,id:a}=n;if(!$(e)||!x(e)){const{remoteSnapshot:l,globalSnapshot:p}=await i.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:e,id:a});lt(c,l);const m={remote:e,preloadConfig:{nameOrAlias:r,exposes:[o],resourceCategory:"sync",share:!1,depsRemote:!1}},b=await i.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:i,preloadOptions:m,remoteInfo:c,remote:e,remoteSnapshot:l,globalSnapshot:p});return b&&Ce(c,i,b,!1),{...n,remoteSnapshot:l}}return n}}}function tn(n){const e=n.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 ut(n,e,r,o,i={},c){const a=R(e),{value:l}=Z(n,a),p=c||l;if(p&&!t.isManifestProvider(p)&&(r(p,e,o),p.remotesInfo)){const m=Object.keys(p.remotesInfo);for(const b of m){if(i[b])continue;i[b]=!0;const S=tn(b),g=p.remotesInfo[b];ut(n,{name:S.name,version:g.matchedVersion},r,!1,i,void 0)}}}const He=(n,e)=>document.querySelector(`${n}[${n==="link"?"href":"src"}="${e}"]`);function nn(n,e,r,o,i){const c=[],a=[],l=[],p=new Set,m=new Set,{options:b}=n,{preloadConfig:S}=e,{depsRemote:g}=S;if(ut(o,r,(v,A,G)=>{let D;if(G)D=S;else if(Array.isArray(g)){const se=g.find(ne=>ne.nameOrAlias===A.name||ne.nameOrAlias===A.alias);if(!se)return;D=at(se)}else if(g===!0)D=S;else return;const q=t.getResourceUrl(v,J(v).url);q&&l.push({name:A.name,moduleInfo:{name:A.name,entry:q,type:"remoteEntryType"in v?v.remoteEntryType:"global",entryGlobalName:"globalName"in v?v.globalName:A.name,shareScope:"",version:"version"in v?v.version:void 0},url:q});let Y="modules"in v?v.modules:[];const ue=Zt(D.exposes);ue.length&&"modules"in v&&(Y=v?.modules?.reduce((se,ne)=>(ue?.indexOf(ne.moduleName)!==-1&&se.push(ne),se),[]));function W(se){const ne=se.map(ae=>t.getResourceUrl(v,ae));return D.filter?ne.filter(D.filter):ne}if(Y){const se=Y.length;for(let ne=0;ne<se;ne++){const ae=Y[ne],Ue=`${A.name}/${ae.moduleName}`;n.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:ae.moduleName==="."?A.name:Ue,name:A.name,remoteSnapshot:v,preloadConfig:D,remote:A,origin:n}),!Be(Ue)&&(D.resourceCategory==="all"?(c.push(...W(ae.assets.css.async)),c.push(...W(ae.assets.css.sync)),a.push(...W(ae.assets.js.async)),a.push(...W(ae.assets.js.sync))):(D.resourceCategory="sync")&&(c.push(...W(ae.assets.css.sync)),a.push(...W(ae.assets.js.sync))),qe(Ue))}}},!0,{},i),i.shared&&i.shared.length>0){const v=(A,G)=>{const D=me(n.shareScopeMap,G.sharedName,A,n.sharedHandler.hooks.lifecycle.resolveShare);D&&typeof D.lib=="function"&&(G.assets.js.sync.forEach(q=>{p.add(q)}),G.assets.css.sync.forEach(q=>{m.add(q)}))};i.shared.forEach(A=>{const G=b.shared?.[A.sharedName];if(!G)return;const D=A.version?G.find(Y=>Y.version===A.version):G;if(!D)return;Q(D).forEach(Y=>{v(Y,A)})})}const M=a.filter(v=>!p.has(v)&&!He("script",v));return{cssAssets:c.filter(v=>!m.has(v)&&!He("link",v)),jsAssetsWithoutEntry:M,entryAssets:l.filter(v=>!He("script",v.url))}}const rn=function(){return{name:"generate-preload-assets-plugin",async generatePreloadAssets(n){const{origin:e,preloadOptions:r,remoteInfo:o,remote:i,globalSnapshot:c,remoteSnapshot:a}=n;return t.isBrowserEnv()?$(i)&&x(i)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:i.name,url:i.entry,moduleInfo:{name:o.name,entry:i.entry,type:o.type||"global",entryGlobalName:"",shareScope:""}}]}:(lt(o,a),nn(e,r,o,c,a)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}};function ft(n,e){const r=he({name:e.name,version:e.options.version}),o=r&&"remotesInfo"in r&&r.remotesInfo&&Z(r.remotesInfo,n.name).value;return o&&o.matchedVersion?{hostGlobalSnapshot:r,globalSnapshot:fe(),remoteSnapshot:he({name:n.name,version:o.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:fe(),remoteSnapshot:he({name:n.name,version:"version"in n?n.version:void 0})}}class on{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new _e({beforeLoadRemoteSnapshot:new oe("beforeLoadRemoteSnapshot"),loadSnapshot:new de("loadGlobalSnapshot"),loadRemoteSnapshot:new de("loadRemoteSnapshot"),afterLoadSnapshot:new de("afterLoadSnapshot")}),this.manifestLoading=V.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}async loadRemoteSnapshotInfo({moduleInfo:e,id:r,expose:o}){const{options:i}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:i,moduleInfo:e});let c=he({name:this.HostInstance.options.name,version:this.HostInstance.options.version});c||(c={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},z({[this.HostInstance.options.name]:c})),c&&"remotesInfo"in c&&!Z(c.remotesInfo,e.name).value&&("version"in e||"entry"in e)&&(c.remotesInfo={...c?.remotesInfo,[e.name]:{matchedVersion:"version"in e?e.version:e.entry}});const{hostGlobalSnapshot:a,remoteSnapshot:l,globalSnapshot:p}=this.getGlobalRemoteInfo(e),{remoteSnapshot:m,globalSnapshot:b}=await this.hooks.lifecycle.loadSnapshot.emit({options:i,moduleInfo:e,hostGlobalSnapshot:a,remoteSnapshot:l,globalSnapshot:p});let S,g;if(m)if(t.isManifestProvider(m)){const T=t.isBrowserEnv()?m.remoteEntry:m.ssrRemoteEntry||m.remoteEntry||"",M=await this.getManifestJson(T,e,{}),j=le({...e,entry:T},M);S=M,g=j}else{const{remoteSnapshot:T}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:m,from:"global"});S=T,g=b}else if($(e)){const T=await this.getManifestJson(e.entry,e,{}),M=le(e,T),{remoteSnapshot:j}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:T,from:"global"});S=j,g=M}else E(s.getShortErrorMsg(s.RUNTIME_007,s.runtimeDescMap,{hostName:e.name,hostVersion:e.version,globalSnapshot:JSON.stringify(b)}));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:r,host:this.HostInstance,options:i,moduleInfo:e,remoteSnapshot:S}),{remoteSnapshot:S,globalSnapshot:g}}getGlobalRemoteInfo(e){return ft(e,this.HostInstance)}async getManifestJson(e,r,o){const i=async()=>{let a=this.manifestCache.get(e);if(a)return a;try{let l=await this.loaderHook.lifecycle.fetch.emit(e,{});(!l||!(l instanceof Response))&&(l=await fetch(e,{})),a=await l.json()}catch(l){a=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:l,from:"runtime",lifecycle:"afterResolve",origin:this.HostInstance}),a||(delete this.manifestLoading[e],E(s.getShortErrorMsg(s.RUNTIME_003,s.runtimeDescMap,{manifestUrl:e,moduleName:r.name,hostName:this.HostInstance.options.name},`${l}`)))}return h(a.metaData&&a.exposes&&a.shared,`${e} is not a federation manifest`),this.manifestCache.set(e,a),a},c=async()=>{const a=await i(),l=t.generateSnapshotFromManifest(a,{version:e}),{remoteSnapshot:p}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:r,manifestJson:a,remoteSnapshot:l,manifestUrl:e,from:"manifest"});return p};return this.manifestLoading[e]||(this.manifestLoading[e]=c().then(a=>a)),this.manifestLoading[e]}}class sn{constructor(e){this.hooks=new _e({afterResolve:new de("afterResolve"),beforeLoadShare:new de("beforeLoadShare"),loadShare:new oe,resolveShare:new Ne("resolveShare"),initContainerShareScopeMap:new Ne("initContainerShareScopeMap")}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}registerShared(e,r){const{shareInfos:o,shared:i}=rt(e,r);return Object.keys(o).forEach(a=>{o[a].forEach(p=>{p.scope.forEach(m=>{this.shareScopeMap[m]?.[a]||this.setShared({pkgName:a,lib:p.lib,get:p.get,loaded:p.loaded||!!p.lib,shared:p,from:r.name})})})}),{shareInfos:o,shared:i}}async loadShare(e,r){const{host:o}=this,i=ot({pkgName:e,extraOptions:r,shareInfos:o.options.shared});i?.scope&&await Promise.all(i.scope.map(async m=>{await Promise.all(this.initializeSharing(m,{strategy:i.strategy}))}));const c=await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:i,shared:o.options.shared,origin:o}),{shareInfo:a}=c;h(a,`Cannot find ${e} Share in the ${o.options.name}. Please ensure that the ${e} Share parameters have been injected`);const l=me(this.shareScopeMap,e,a,this.hooks.lifecycle.resolveShare),p=m=>{m.useIn||(m.useIn=[]),y(m.useIn,o.options.name)};if(l&&l.lib)return p(l),l.lib;if(l&&l.loading&&!l.loaded){const m=await l.loading;return l.loaded=!0,l.lib||(l.lib=m),p(l),m}else if(l){const b=(async()=>{const S=await l.get();return p(l),l.loaded=!0,l.lib=S,S})();return this.setShared({pkgName:e,loaded:!1,shared:l,from:o.options.name,lib:null,loading:b}),b}else{if(r?.customShareInfo)return!1;const b=(async()=>{const S=await a.get();a.lib=S,a.loaded=!0,p(a);const g=me(this.shareScopeMap,e,a,this.hooks.lifecycle.resolveShare);return g&&(g.lib=S,g.loaded=!0,g.from=a.from),S})();return this.setShared({pkgName:e,loaded:!1,shared:a,from:o.options.name,lib:null,loading:b}),b}}initializeSharing(e=Ee,r){const{host:o}=this,i=r?.from,c=r?.strategy;let a=r?.initScope;const l=[];if(i!=="build"){const{initTokens:M}=this;a||(a=[]);let j=M[e];if(j||(j=M[e]={from:this.host.name}),a.indexOf(j)>=0)return l;a.push(j)}const p=this.shareScopeMap,m=o.options.name;p[e]||(p[e]={});const b=p[e],S=(M,j)=>{const{version:v,eager:A}=j;b[M]=b[M]||{};const G=b[M],D=G[v],q=!!(D&&(D.eager||D.shareConfig?.eager));(!D||D.strategy!=="loaded-first"&&!D.loaded&&(!A!=!q?A:m>D.from))&&(G[v]=j)},g=M=>M&&M.init&&M.init(p[e],a),T=async M=>{const{module:j}=await o.remoteHandler.getRemoteModuleAndOptions({id:M});if(j.getEntry){let v;try{v=await j.getEntry()}catch(A){v=await o.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:M,error:A,from:"runtime",lifecycle:"beforeLoadShare",origin:o})}j.inited||(await g(v),j.inited=!0)}};return Object.keys(o.options.shared).forEach(M=>{o.options.shared[M].forEach(v=>{v.scope.includes(e)&&S(M,v)})}),(o.options.shareStrategy==="version-first"||c==="version-first")&&o.options.remotes.forEach(M=>{M.shareScope===e&&l.push(T(M.name))}),l}loadShareSync(e,r){const{host:o}=this,i=ot({pkgName:e,extraOptions:r,shareInfos:o.options.shared});i?.scope&&i.scope.forEach(l=>{this.initializeSharing(l,{strategy:i.strategy})});const c=me(this.shareScopeMap,e,i,this.hooks.lifecycle.resolveShare),a=l=>{l.useIn||(l.useIn=[]),y(l.useIn,o.options.name)};if(c){if(typeof c.lib=="function")return a(c),c.loaded||(c.loaded=!0,c.from===o.options.name&&(i.loaded=!0)),c.lib;if(typeof c.get=="function"){const l=c.get();if(!(l instanceof Promise))return a(c),this.setShared({pkgName:e,loaded:!0,from:o.options.name,lib:l,shared:c}),l}}if(i.lib)return i.loaded||(i.loaded=!0),i.lib;if(i.get){const l=i.get();if(l instanceof Promise){const p=r?.from==="build"?s.RUNTIME_005:s.RUNTIME_006;throw new Error(s.getShortErrorMsg(p,s.runtimeDescMap,{hostName:o.options.name,sharedPkgName:e}))}return i.lib=l,this.setShared({pkgName:e,loaded:!0,from:o.options.name,lib:i.lib,shared:i}),i.lib}throw new Error(s.getShortErrorMsg(s.RUNTIME_006,s.runtimeDescMap,{hostName:o.options.name,sharedPkgName:e}))}initShareScopeMap(e,r,o={}){const{host:i}=this;this.shareScopeMap[e]=r,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:r,options:i.options,origin:i,scopeName:e,hostShareScopeMap:o.hostShareScopeMap})}setShared({pkgName:e,shared:r,from:o,lib:i,loading:c,loaded:a,get:l}){const{version:p,scope:m="default",...b}=r;(Array.isArray(m)?m:[m]).forEach(g=>{if(this.shareScopeMap[g]||(this.shareScopeMap[g]={}),this.shareScopeMap[g][e]||(this.shareScopeMap[g][e]={}),!this.shareScopeMap[g][e][p]){this.shareScopeMap[g][e][p]={version:p,scope:[g],...b,lib:i,loaded:a,loading:c},l&&(this.shareScopeMap[g][e][p].get=l);return}const T=this.shareScopeMap[g][e][p];c&&!T.loading&&(T.loading=c),a&&!T.loaded&&(T.loaded=a),o&&T.from!==o&&(T.from=o)})}_setGlobalShareScopeMap(e){const r=Le(),o=e.id||e.name;o&&!r[o]&&(r[o]=this.shareScopeMap)}}class an{constructor(e){this.hooks=new _e({beforeRegisterRemote:new Ne("beforeRegisterRemote"),registerRemote:new Ne("registerRemote"),beforeRequest:new de("beforeRequest"),onLoad:new oe("onLoad"),handlePreloadModule:new te("handlePreloadModule"),errorLoadRemote:new oe("errorLoadRemote"),beforePreloadRemote:new oe("beforePreloadRemote"),generatePreloadAssets:new oe("generatePreloadAssets"),afterPreloadRemote:new oe,loadEntry:new oe}),this.host=e,this.idToRemoteMap={}}formatAndRegisterRemote(e,r){return(r.remotes||[]).reduce((i,c)=>(this.registerRemote(c,i,{force:!1}),i),e.remotes)}setIdToRemoteMap(e,r){const{remote:o,expose:i}=r,{name:c,alias:a}=o;if(this.idToRemoteMap[e]={name:o.name,expose:i},a&&e.startsWith(c)){const l=e.replace(c,a);this.idToRemoteMap[l]={name:o.name,expose:i};return}if(a&&e.startsWith(a)){const l=e.replace(a,c);this.idToRemoteMap[l]={name:o.name,expose:i}}}async loadRemote(e,r){const{host:o}=this;try{const{loadFactory:i=!0}=r||{loadFactory:!0},{module:c,moduleOptions:a,remoteMatchInfo:l}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:p,remote:m,expose:b,id:S,remoteSnapshot:g}=l,T=await c.get(S,b,r,g),M=await this.hooks.lifecycle.onLoad.emit({id:S,pkgNameOrAlias:p,expose:b,exposeModule:i?T:void 0,exposeModuleFactory:i?void 0:T,remote:m,options:a,moduleInstance:c,origin:o});return this.setIdToRemoteMap(e,l),typeof M=="function"?M:T}catch(i){const{from:c="runtime"}=r||{from:"runtime"},a=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:i,from:c,lifecycle:"onLoad",origin:o});if(!a)throw i;return a}}async preloadRemote(e){const{host:r}=this;await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:r.options,origin:r});const o=Jt(r.options.remotes,e);await Promise.all(o.map(async i=>{const{remote:c}=i,a=Re(c),{globalSnapshot:l,remoteSnapshot:p}=await r.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:c}),m=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:r,preloadOptions:i,remote:c,remoteInfo:a,globalSnapshot:l,remoteSnapshot:p});m&&Ce(a,r,m)}))}registerRemotes(e,r){const{host:o}=this;e.forEach(i=>{this.registerRemote(i,o.options.remotes,{force:r?.force})})}async getRemoteModuleAndOptions(e){const{host:r}=this,{id:o}=e;let i;try{i=await this.hooks.lifecycle.beforeRequest.emit({id:o,options:r.options,origin:r})}catch(M){if(i=await this.hooks.lifecycle.errorLoadRemote.emit({id:o,options:r.options,origin:r,from:"runtime",error:M,lifecycle:"beforeRequest"}),!i)throw M}const{id:c}=i,a=De(r.options.remotes,c);h(a,s.getShortErrorMsg(s.RUNTIME_004,s.runtimeDescMap,{hostName:r.options.name,requestId:c}));const{remote:l}=a,p=Re(l),m=await r.sharedHandler.hooks.lifecycle.afterResolve.emit({id:c,...a,options:r.options,origin:r,remoteInfo:p}),{remote:b,expose:S}=m;h(b&&S,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${c}.`);let g=r.moduleCache.get(b.name);const T={host:r,remoteInfo:p};return g||(g=new ke(T),r.moduleCache.set(b.name,g)),{module:g,moduleOptions:T,remoteMatchInfo:m}}registerRemote(e,r,o){const{host:i}=this,c=()=>{if(e.alias){const l=r.find(p=>e.alias&&(p.name.startsWith(e.alias)||p.alias?.startsWith(e.alias)));h(!l,`The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${l&&l.name} name or alias`)}"entry"in e&&t.isBrowserEnv()&&!e.entry.startsWith("http")&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||(e.shareScope=Ee),e.type||(e.type=We)};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:i});const a=r.find(l=>l.name===e.name);if(!a)c(),r.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:i});else{const l=[`The remote "${e.name}" is already registered.`,"Please note that overriding it may cause unexpected errors."];o?.force&&(this.removeRemote(a),c(),r.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:i}),t.warn(l.join(" ")))}}removeRemote(e){try{const{host:r}=this,{name:o}=e,i=r.options.remotes.findIndex(a=>a.name===o);i!==-1&&r.options.remotes.splice(i,1);const c=r.moduleCache.get(e.name);if(c){const a=c.remoteInfo,l=a.entryGlobalName;P[l]&&(Object.getOwnPropertyDescriptor(P,l)?.configurable?delete P[l]:P[l]=void 0);const p=Fe(c.remoteInfo);ce[p]&&delete ce[p],r.snapshotHandler.manifestCache.delete(a.entry);let m=a.buildVersion?t.composeKeyWithSeparator(a.name,a.buildVersion):a.name;const b=P.__FEDERATION__.__INSTANCES__.findIndex(g=>a.buildVersion?g.options.id===m:g.name===m);if(b!==-1){const g=P.__FEDERATION__.__INSTANCES__[b];m=g.options.id||m;const T=Le();let M=!0;const j=[];Object.keys(T).forEach(v=>{const A=T[v];A&&Object.keys(A).forEach(G=>{const D=A[G];D&&Object.keys(D).forEach(q=>{const Y=D[q];Y&&Object.keys(Y).forEach(ue=>{const W=Y[ue];W&&typeof W=="object"&&W.from===a.name&&(W.loaded||W.loading?(W.useIn=W.useIn.filter(se=>se!==a.name),W.useIn.length?M=!1:j.push([v,G,q,ue])):j.push([v,G,q,ue]))})})})}),M&&(g.shareScopeMap={},delete T[m]),j.forEach(([v,A,G,D])=>{delete T[v]?.[A]?.[G]?.[D]}),P.__FEDERATION__.__INSTANCES__.splice(b,1)}const{hostGlobalSnapshot:S}=ft(e,r);if(S){const g=S&&"remotesInfo"in S&&S.remotesInfo&&Z(S.remotesInfo,e.name).key;g&&(delete S.remotesInfo[g],V.__FEDERATION__.__MANIFEST_LOADING__[g]&&delete V.__FEDERATION__.__MANIFEST_LOADING__[g])}r.moduleCache.delete(e.name)}}catch(r){u.log("removeRemote fail: ",r)}}}const cn=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN=="boolean"?!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN:!0;class ln{constructor(e){this.hooks=new _e({beforeInit:new Ne("beforeInit"),init:new te,beforeInitContainer:new de("beforeInitContainer"),initContainer:new de("initContainer")}),this.version="0.21.4",this.moduleCache=new Map,this.loaderHook=new _e({getModuleInfo:new te,createScript:new te,createLink:new te,fetch:new oe,loadEntryError:new oe,getModuleFactory:new oe}),this.bridgeHook=new _e({beforeBridgeRender:new te,afterBridgeRender:new te,beforeBridgeDestroy:new te,afterBridgeDestroy:new te});const r=cn?[en(),rn()]:[],o={id:Vt(),name:e.name,plugins:r,remotes:[],shared:{},inBrowser:t.isBrowserEnv()};this.name=e.name,this.options=o,this.snapshotHandler=new on(this),this.sharedHandler=new sn(this),this.remoteHandler=new an(this),this.shareScopeMap=this.sharedHandler.shareScopeMap,this.registerPlugins([...o.plugins,...e.plugins||[]]),this.options=this.formatOptions(o,e)}initOptions(e){this.registerPlugins(e.plugins);const r=this.formatOptions(this.options,e);return this.options=r,r}async loadShare(e,r){return this.sharedHandler.loadShare(e,r)}loadShareSync(e,r){return this.sharedHandler.loadShareSync(e,r)}initializeSharing(e=Ee,r){return this.sharedHandler.initializeSharing(e,r)}initRawContainer(e,r,o){const i=Re({name:e,entry:r}),c=new ke({host:this,remoteInfo:i});return c.remoteEntryExports=o,this.moduleCache.set(e,c),c}async loadRemote(e,r){return this.remoteHandler.loadRemote(e,r)}async preloadRemote(e){return this.remoteHandler.preloadRemote(e)}initShareScopeMap(e,r,o={}){this.sharedHandler.initShareScopeMap(e,r,o)}formatOptions(e,r){const{shared:o}=rt(e,r),{userOptions:i,options:c}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:r,options:e,shareInfo:o}),a=this.remoteHandler.formatAndRegisterRemote(c,i),{shared:l}=this.sharedHandler.registerShared(c,i),p=[...c.plugins];i.plugins&&i.plugins.forEach(b=>{p.includes(b)||p.push(b)});const m={...e,...r,plugins:p,remotes:a,shared:l};return this.hooks.lifecycle.init.emit({origin:this,options:m}),m}registerPlugins(e){const r=qt(e,this);this.options.plugins=this.options.plugins.reduce((o,i)=>(i&&o&&!o.find(c=>c.name===i.name)&&o.push(i),o),r||[])}registerRemotes(e,r){return this.remoteHandler.registerRemotes(e,r)}registerShared(e){this.sharedHandler.registerShared(this.options,{...this.options,shared:e})}}var un=Object.freeze({__proto__:null});return index_cjs$2.loadScript=t.loadScript,index_cjs$2.loadScriptNode=t.loadScriptNode,index_cjs$2.CurrentGlobal=P,index_cjs$2.Global=V,index_cjs$2.Module=ke,index_cjs$2.ModuleFederation=ln,index_cjs$2.addGlobalSnapshot=z,index_cjs$2.assert=h,index_cjs$2.getGlobalFederationConstructor=C,index_cjs$2.getGlobalSnapshot=fe,index_cjs$2.getInfoWithoutType=Z,index_cjs$2.getRegisteredShare=me,index_cjs$2.getRemoteEntry=Se,index_cjs$2.getRemoteInfo=Re,index_cjs$2.helpers=Qt,index_cjs$2.isStaticResourcesEqual=U,index_cjs$2.matchRemoteWithNameAndExpose=De,index_cjs$2.registerGlobalPlugins=Ge,index_cjs$2.resetFederationGlobalInfo=I,index_cjs$2.safeWrapper=k,index_cjs$2.satisfy=ge,index_cjs$2.setGlobalFederationConstructor=K,index_cjs$2.setGlobalFederationInstance=N,index_cjs$2.types=un,index_cjs$2}var utils_cjs={},hasRequiredUtils_cjs;function requireUtils_cjs(){if(hasRequiredUtils_cjs)return utils_cjs;hasRequiredUtils_cjs=1;var t=requireIndex_cjs$1();function s(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function d(u,h){const E=s();return t.CurrentGlobal.__FEDERATION__.__INSTANCES__.find(_=>!!(E&&_.options.id===E||_.options.name===u&&!_.options.version&&!h||_.options.name===u&&h&&_.options.version===h))}return utils_cjs.getGlobalFederationInstance=d,utils_cjs}var hasRequiredIndex_cjs;function requireIndex_cjs(){if(hasRequiredIndex_cjs)return index_cjs$3;hasRequiredIndex_cjs=1;var t=requireIndex_cjs$1(),s=requireIndex_cjs$2(),d=requireUtils_cjs();function u(w){const U=t.getGlobalFederationConstructor()||t.ModuleFederation,Q=new U(w);return t.setGlobalFederationInstance(Q),Q}let h=null;function E(w){const U=d.getGlobalFederationInstance(w.name,w.version);return U?(U.initOptions(w),h||(h=U),U):(h=u(w),h)}function _(...w){return t.assert(h,s.getShortErrorMsg(s.RUNTIME_009,s.runtimeDescMap)),h.loadRemote.apply(h,w)}function y(...w){return t.assert(h,s.getShortErrorMsg(s.RUNTIME_009,s.runtimeDescMap)),h.loadShare.apply(h,w)}function R(...w){return t.assert(h,s.getShortErrorMsg(s.RUNTIME_009,s.runtimeDescMap)),h.loadShareSync.apply(h,w)}function $(...w){return t.assert(h,s.getShortErrorMsg(s.RUNTIME_009,s.runtimeDescMap)),h.preloadRemote.apply(h,w)}function x(...w){return t.assert(h,s.getShortErrorMsg(s.RUNTIME_009,s.runtimeDescMap)),h.registerRemotes.apply(h,w)}function k(...w){return t.assert(h,s.getShortErrorMsg(s.RUNTIME_009,s.runtimeDescMap)),h.registerPlugins.apply(h,w)}function H(){return h}function B(...w){return t.assert(h,s.getShortErrorMsg(s.RUNTIME_009,s.runtimeDescMap)),h.registerShared.apply(h,w)}return t.setGlobalFederationConstructor(t.ModuleFederation),index_cjs$3.Module=t.Module,index_cjs$3.ModuleFederation=t.ModuleFederation,index_cjs$3.getRemoteEntry=t.getRemoteEntry,index_cjs$3.getRemoteInfo=t.getRemoteInfo,index_cjs$3.loadScript=t.loadScript,index_cjs$3.loadScriptNode=t.loadScriptNode,index_cjs$3.registerGlobalPlugins=t.registerGlobalPlugins,index_cjs$3.createInstance=u,index_cjs$3.getInstance=H,index_cjs$3.init=E,index_cjs$3.loadRemote=_,index_cjs$3.loadShare=y,index_cjs$3.loadShareSync=R,index_cjs$3.preloadRemote=$,index_cjs$3.registerPlugins=k,index_cjs$3.registerRemotes=x,index_cjs$3.registerShared=B,index_cjs$3}var hasRequiredRuntime_cjs;function requireRuntime_cjs(){return hasRequiredRuntime_cjs||(hasRequiredRuntime_cjs=1,(function(t){var s=requireIndex_cjs();Object.prototype.hasOwnProperty.call(s,"__proto__")&&!Object.prototype.hasOwnProperty.call(t,"__proto__")&&Object.defineProperty(t,"__proto__",{enumerable:!0,value:s.__proto__}),Object.keys(s).forEach(function(d){d!=="default"&&!Object.prototype.hasOwnProperty.call(t,d)&&(t[d]=s[d])})})(runtime_cjs)),runtime_cjs}var hasRequiredRuntime;function requireRuntime(){return hasRequiredRuntime||(hasRequiredRuntime=1,(function(t){var s=runtime&&runtime.__createBinding||(Object.create?(function(u,h,E,_){_===void 0&&(_=E);var y=Object.getOwnPropertyDescriptor(h,E);(!y||("get"in y?!h.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return h[E]}}),Object.defineProperty(u,_,y)}):(function(u,h,E,_){_===void 0&&(_=E),u[_]=h[E]})),d=runtime&&runtime.__exportStar||function(u,h){for(var E in u)E!=="default"&&!Object.prototype.hasOwnProperty.call(h,E)&&s(h,u,E)};Object.defineProperty(t,"__esModule",{value:!0}),d(requireRuntime_cjs(),t)})(runtime)),runtime}var runtimeExports=requireRuntime();const loadAsyncComponent=t=>vue.defineAsyncComponent(()=>runtimeExports.loadRemote(t).then(s=>{if(!s?.default)throw new Error(`Failed to load component from ${t}`);return s.default}));const IS_CLIENT=typeof window<"u";let activePinia;const setActivePinia=t=>activePinia=t;process.env.NODE_ENV;const piniaSymbol=process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function isPlainObject(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var MutationType;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(MutationType||(MutationType={}));function patchObject(t,s){for(const d in s){const u=s[d];if(!(d in t))continue;const h=t[d];isPlainObject(h)&&isPlainObject(u)&&!vue.isRef(u)&&!vue.isReactive(u)?t[d]=patchObject(h,u):t[d]=u}return t}const noop=()=>{};function addSubscription(t,s,d,u=noop){t.add(s);const h=()=>{t.delete(s)&&u()};return!d&&vue.getCurrentScope()&&vue.onScopeDispose(h),h}function triggerSubscriptions(t,...s){t.forEach(d=>{d(...s)})}const fallbackRunWithContext=t=>t(),ACTION_MARKER=Symbol(),ACTION_NAME=Symbol();function mergeReactiveObjects(t,s){t instanceof Map&&s instanceof Map?s.forEach((d,u)=>t.set(u,d)):t instanceof Set&&s instanceof Set&&s.forEach(t.add,t);for(const d in s){if(!s.hasOwnProperty(d))continue;const u=s[d],h=t[d];isPlainObject(h)&&isPlainObject(u)&&t.hasOwnProperty(d)&&!vue.isRef(u)&&!vue.isReactive(u)?t[d]=mergeReactiveObjects(h,u):t[d]=u}return t}const skipHydrateSymbol=process.env.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();function shouldHydrate(t){return!isPlainObject(t)||!Object.prototype.hasOwnProperty.call(t,skipHydrateSymbol)}const{assign}=Object;function isComputed(t){return!!(vue.isRef(t)&&t.effect)}function createOptionsStore(t,s,d,u){const{state:h,actions:E,getters:_}=s,y=d.state.value[t];let R;function $(){!y&&(process.env.NODE_ENV==="production"||!u)&&(d.state.value[t]=h?h():{});const x=process.env.NODE_ENV!=="production"&&u?vue.toRefs(vue.ref(h?h():{}).value):vue.toRefs(d.state.value[t]);return assign(x,E,Object.keys(_||{}).reduce((k,H)=>(process.env.NODE_ENV!=="production"&&H in x&&console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${H}" in store "${t}".`),k[H]=vue.markRaw(vue.computed(()=>{setActivePinia(d);const B=d._s.get(t);return _[H].call(B,B)})),k),{}))}return R=createSetupStore(t,$,s,d,u,!0),R}function createSetupStore(t,s,d={},u,h,E){let _;const y=assign({actions:{}},d);if(process.env.NODE_ENV!=="production"&&!u._e.active)throw new Error("Pinia destroyed");const R={deep:!0};process.env.NODE_ENV!=="production"&&(R.onTrigger=I=>{$?B=I:$==!1&&!O._hotUpdating&&(Array.isArray(B)?B.push(I):console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."))});let $,x,k=new Set,H=new Set,B;const w=u.state.value[t];!E&&!w&&(process.env.NODE_ENV==="production"||!h)&&(u.state.value[t]={});const U=vue.ref({});let Q;function J(I){let N;$=x=!1,process.env.NODE_ENV!=="production"&&(B=[]),typeof I=="function"?(I(u.state.value[t]),N={type:MutationType.patchFunction,storeId:t,events:B}):(mergeReactiveObjects(u.state.value[t],I),N={type:MutationType.patchObject,payload:I,storeId:t,events:B});const C=Q=Symbol();vue.nextTick().then(()=>{Q===C&&($=!0)}),x=!0,triggerSubscriptions(k,N,u.state.value[t])}const L=E?function(){const{state:N}=d,C=N?N():{};this.$patch(K=>{assign(K,C)})}:process.env.NODE_ENV!=="production"?()=>{throw new Error(`🍍: Store "${t}" is built using the setup syntax and does not implement $reset().`)}:noop;function P(){_.stop(),k.clear(),H.clear(),u._s.delete(t)}const F=(I,N="")=>{if(ACTION_MARKER in I)return I[ACTION_NAME]=N,I;const C=function(){setActivePinia(u);const K=Array.from(arguments),Z=new Set,fe=new Set;function Ie(z){Z.add(z)}function he(z){fe.add(z)}triggerSubscriptions(H,{args:K,name:C[ACTION_NAME],store:O,after:Ie,onError:he});let le;try{le=I.apply(this&&this.$id===t?this:O,K)}catch(z){throw triggerSubscriptions(fe,z),z}return le instanceof Promise?le.then(z=>(triggerSubscriptions(Z,z),z)).catch(z=>(triggerSubscriptions(fe,z),Promise.reject(z))):(triggerSubscriptions(Z,le),le)};return C[ACTION_MARKER]=!0,C[ACTION_NAME]=N,C},V=vue.markRaw({actions:{},getters:{},state:[],hotState:U}),ee={_p:u,$id:t,$onAction:addSubscription.bind(null,H),$patch:J,$reset:L,$subscribe(I,N={}){const C=addSubscription(k,I,N.detached,()=>K()),K=_.run(()=>vue.watch(()=>u.state.value[t],Z=>{(N.flush==="sync"?x:$)&&I({storeId:t,type:MutationType.direct,events:B},Z)},assign({},R,N)));return C},$dispose:P},O=vue.reactive(process.env.NODE_ENV!=="production"||process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&IS_CLIENT?assign({_hmrPayload:V,_customProperties:vue.markRaw(new Set)},ee):ee);u._s.set(t,O);const re=(u._a&&u._a.runWithContext||fallbackRunWithContext)(()=>u._e.run(()=>(_=vue.effectScope()).run(()=>s({action:F}))));for(const I in re){const N=re[I];if(vue.isRef(N)&&!isComputed(N)||vue.isReactive(N))process.env.NODE_ENV!=="production"&&h?U.value[I]=vue.toRef(re,I):E||(w&&shouldHydrate(N)&&(vue.isRef(N)?N.value=w[I]:mergeReactiveObjects(N,w[I])),u.state.value[t][I]=N),process.env.NODE_ENV!=="production"&&V.state.push(I);else if(typeof N=="function"){const C=process.env.NODE_ENV!=="production"&&h?N:F(N,I);re[I]=C,process.env.NODE_ENV!=="production"&&(V.actions[I]=N),y.actions[I]=N}else process.env.NODE_ENV!=="production"&&isComputed(N)&&(V.getters[I]=E?d.getters[I]:N,IS_CLIENT&&(re._getters||(re._getters=vue.markRaw([]))).push(I))}if(assign(O,re),assign(vue.toRaw(O),re),Object.defineProperty(O,"$state",{get:()=>process.env.NODE_ENV!=="production"&&h?U.value:u.state.value[t],set:I=>{if(process.env.NODE_ENV!=="production"&&h)throw new Error("cannot set hotState");J(N=>{assign(N,I)})}}),process.env.NODE_ENV!=="production"&&(O._hotUpdate=vue.markRaw(I=>{O._hotUpdating=!0,I._hmrPayload.state.forEach(N=>{if(N in O.$state){const C=I.$state[N],K=O.$state[N];typeof C=="object"&&isPlainObject(C)&&isPlainObject(K)?patchObject(C,K):I.$state[N]=K}O[N]=vue.toRef(I.$state,N)}),Object.keys(O.$state).forEach(N=>{N in I.$state||delete O[N]}),$=!1,x=!1,u.state.value[t]=vue.toRef(I._hmrPayload,"hotState"),x=!0,vue.nextTick().then(()=>{$=!0});for(const N in I._hmrPayload.actions){const C=I[N];O[N]=F(C,N)}for(const N in I._hmrPayload.getters){const C=I._hmrPayload.getters[N],K=E?vue.computed(()=>(setActivePinia(u),C.call(O,O))):C;O[N]=K}Object.keys(O._hmrPayload.getters).forEach(N=>{N in I._hmrPayload.getters||delete O[N]}),Object.keys(O._hmrPayload.actions).forEach(N=>{N in I._hmrPayload.actions||delete O[N]}),O._hmrPayload=I._hmrPayload,O._getters=I._getters,O._hotUpdating=!1})),process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&IS_CLIENT){const I={writable:!0,configurable:!0,enumerable:!1};["_p","_hmrPayload","_getters","_customProperties"].forEach(N=>{Object.defineProperty(O,N,assign({value:O[N]},I))})}return u._p.forEach(I=>{if(process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&IS_CLIENT){const N=_.run(()=>I({store:O,app:u._a,pinia:u,options:y}));Object.keys(N||{}).forEach(C=>O._customProperties.add(C)),assign(O,N)}else assign(O,_.run(()=>I({store:O,app:u._a,pinia:u,options:y})))}),process.env.NODE_ENV!=="production"&&O.$state&&typeof O.$state=="object"&&typeof O.$state.constructor=="function"&&!O.$state.constructor.toString().includes("[native code]")&&console.warn(`[🍍]: The "state" must be a plain object. It cannot be
9
9
  state: () => new MyClass()
10
- Found in store "${O.$id}".`),w&&E&&h.hydrate&&h.hydrate(O.$state,w),$=!0,x=!0,O}function defineStore(t,s,h){let u;const d=typeof s=="function";u=d?h:s;function E(_,y){const R=vue.hasInjectionContext();if(_=(process.env.NODE_ENV==="test"&&activePinia&&activePinia._testing?null:_)||(R?vue.inject(piniaSymbol,null):null),_&&setActivePinia(_),process.env.NODE_ENV!=="production"&&!activePinia)throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
10
+ Found in store "${O.$id}".`),w&&E&&d.hydrate&&d.hydrate(O.$state,w),$=!0,x=!0,O}function defineStore(t,s,d){let u;const h=typeof s=="function";u=h?d:s;function E(_,y){const R=vue.hasInjectionContext();if(_=(process.env.NODE_ENV==="test"&&activePinia&&activePinia._testing?null:_)||(R?vue.inject(piniaSymbol,null):null),_&&setActivePinia(_),process.env.NODE_ENV!=="production"&&!activePinia)throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
11
11
  See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
12
- This will fail in production.`);_=activePinia,_._s.has(t)||(d?createSetupStore(t,s,u,_):createOptionsStore(t,u,_),process.env.NODE_ENV!=="production"&&(E._pinia=_));const $=_._s.get(t);if(process.env.NODE_ENV!=="production"&&y){const x="__hot:"+t,C=d?createSetupStore(x,s,u,_,!0):createOptionsStore(x,assign({},u),_,!0);y._hotUpdate(C),delete _.state.value[x],_._s.delete(x)}if(process.env.NODE_ENV!=="production"&&IS_CLIENT){const x=vue.getCurrentInstance();if(x&&x.proxy&&!y){const C=x.proxy,H="_pStores"in C?C._pStores:C._pStores={};H[t]=$}}return $}return E.$id=t,E}const useLinidZoneStore=defineStore("linidZoneStore",{state:()=>({zones:{}}),actions:{register(t,s){this.zones[t]||(this.zones[t]=[]),this.zones[t].push(s)}}}),_sfc_main=vue.defineComponent({__name:"LinidZoneRenderer",props:{zone:{}},setup(t){const s=t,h=useLinidZoneStore(),u=vue.ref([]),d=vue.ref(!1);return vue.watchEffect(()=>{d.value=!1;const E=h.zones[s.zone]||[];u.value=E.map(_=>({..._,component:loadAsyncComponent(_.plugin)})),Promise.resolve().then(()=>{d.value=!0})}),(E,_)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(u.value,(y,R)=>(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(y.component),vue.mergeProps({key:y.plugin+R},{ref_for:!0},y.props),null,16))),128)),d.value&&u.value.length===0?vue.renderSlot(E.$slots,"default",{key:0},()=>[_[0]||(_[0]=vue.createElementVNode("div",null,"No components to render in this zone.",-1))]):vue.createCommentVNode("",!0)],64))}});var ModuleLifecyclePhase=(t=>(t.SETUP="setup",t.CONFIGURE="configure",t.INITIALIZE="initialize",t.READY="ready",t.POST_INIT="postInit",t))(ModuleLifecyclePhase||{});class BasicRemoteModule{id;name;version;description;constructor(s,h,u,d){this.id=s,this.name=h,this.version=u,this.description=d}async setup(){return{success:!0}}async configure(s){return{success:!0}}async initialize(){return{success:!0}}async ready(){return{success:!0}}async postInit(){return{success:!0}}}exports.BasicRemoteModule=BasicRemoteModule,exports.LinidZoneRenderer=_sfc_main,exports.ModuleLifecyclePhase=ModuleLifecyclePhase,exports.useLinidZoneStore=useLinidZoneStore,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})}));
12
+ This will fail in production.`);_=activePinia,_._s.has(t)||(h?createSetupStore(t,s,u,_):createOptionsStore(t,u,_),process.env.NODE_ENV!=="production"&&(E._pinia=_));const $=_._s.get(t);if(process.env.NODE_ENV!=="production"&&y){const x="__hot:"+t,k=h?createSetupStore(x,s,u,_,!0):createOptionsStore(x,assign({},u),_,!0);y._hotUpdate(k),delete _.state.value[x],_._s.delete(x)}if(process.env.NODE_ENV!=="production"&&IS_CLIENT){const x=vue.getCurrentInstance();if(x&&x.proxy&&!y){const k=x.proxy,H="_pStores"in k?k._pStores:k._pStores={};H[t]=$}}return $}return E.$id=t,E}const useLinidZoneStore=defineStore("linidZoneStore",{state:()=>({zones:{}}),actions:{register(t,s){this.zones[t]||(this.zones[t]=[]),this.zones[t].push(s)}}}),_sfc_main=vue.defineComponent({__name:"LinidZoneRenderer",props:{zone:{}},setup(t){const s=t,d=useLinidZoneStore(),u=vue.ref([]),h=vue.ref(!1);return vue.watchEffect(()=>{h.value=!1;const E=d.zones[s.zone]||[];u.value=E.map(_=>({..._,component:loadAsyncComponent(_.plugin)})),Promise.resolve().then(()=>{h.value=!0})}),(E,_)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(u.value,(y,R)=>(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(y.component),vue.mergeProps({key:y.plugin+R},{ref_for:!0},y.props),null,16))),128)),h.value&&u.value.length===0?vue.renderSlot(E.$slots,"default",{key:0},()=>[_[0]||(_[0]=vue.createElementVNode("div",null,"No components to render in this zone.",-1))]):vue.createCommentVNode("",!0)],64))}});let httpClient=null;function setHttpClient(t){if(httpClient!==null){console.warn("[LinID CoreLib] HTTP client has already been initialized. Re-initialization is ignored.");return}httpClient=t}function getHttpClient(){if(httpClient===null)throw new Error("[LinID CoreLib] HTTP client is not initialized. Call setHttpClient() first.");return httpClient}async function getEntitiesConfiguration(){return(await getHttpClient().get("/metadata/entities")).data}async function getRoutesConfiguration(){return(await getHttpClient().get("/metadata/routes")).data}const useLinIdConfigurationStore=defineStore("linidConfigurationStore",{state:()=>({entities:[],routes:[],loading:!1,error:null}),getters:{getEntityByName:t=>s=>t.entities.find(d=>d.name===s),getRoutesByEntity:t=>s=>t.routes.filter(d=>d.entity===s)},actions:{async fetchConfiguration(){this.loading=!0,this.error=null;try{const[t,s]=await Promise.all([getEntitiesConfiguration(),getRoutesConfiguration()]);this.entities=t,this.routes=s}catch(t){this.error=t instanceof Error?t.message:"Failed to fetch configuration",console.error("[LinID CoreLib] Failed to fetch configuration:",t)}finally{this.loading=!1}}}});var ModuleLifecyclePhase=(t=>(t.SETUP="setup",t.CONFIGURE="configure",t.INITIALIZE="initialize",t.READY="ready",t.POST_INIT="postInit",t))(ModuleLifecyclePhase||{});class BasicRemoteModule{id;name;version;description;constructor(s,d,u,h){this.id=s,this.name=d,this.version=u,this.description=h}async setup(){return{success:!0}}async configure(s){return{success:!0}}async initialize(){return{success:!0}}async ready(){return{success:!0}}async postInit(){return{success:!0}}}exports.BasicRemoteModule=BasicRemoteModule,exports.LinidZoneRenderer=_sfc_main,exports.ModuleLifecyclePhase=ModuleLifecyclePhase,exports.getHttpClient=getHttpClient,exports.setHttpClient=setHttpClient,exports.useLinIdConfigurationStore=useLinIdConfigurationStore,exports.useLinidZoneStore=useLinidZoneStore,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})}));
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linagora/linid-im-front-corelib",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "Core library of the LinID Identity Manager project. Provides shared types, services, components, and utilities for front-end and plugin, enabling consistent integration across the LinID ecosystem.",
5
5
  "type": "module",
6
6
  "main": "dist/core-lib.umd.js",
@@ -13,8 +13,11 @@
13
13
  }
14
14
  },
15
15
  "scripts": {
16
- "build": "vite build && vue-tsc --declaration --emitDeclarationOnly",
17
- "test": "vitest",
16
+ "build": "vite build && vue-tsc --declaration --emitDeclarationOnly -p tsconfig.lib.json",
17
+ "test": "vitest run",
18
+ "test:coverage": "vitest --run --coverage",
19
+ "test:watch": "vitest",
20
+ "test:ci": "vitest run --coverage --reporter=dot",
18
21
  "dev": "vite",
19
22
  "lint": "eslint . --max-warnings 0",
20
23
  "lint:fix": "eslint . --fix",
@@ -51,24 +54,29 @@
51
54
  "homepage": "https://github.com/linagora/linid-im-front-corelib#readme",
52
55
  "peerDependencies": {
53
56
  "@module-federation/enhanced": "0.21.4",
57
+ "axios": "1.13.2",
54
58
  "pinia": "3.0.4",
55
59
  "vue": "3.5.24"
56
60
  },
57
61
  "devDependencies": {
58
62
  "@eslint/js": "9.39.1",
59
- "@types/node": "20.19.9",
60
- "@vitejs/plugin-vue": "6.0.1",
63
+ "@types/node": "24.10.2",
64
+ "@vitejs/plugin-vue": "6.0.2",
65
+ "@vitest/coverage-v8": "4.0.15",
61
66
  "@vue/eslint-config-prettier": "10.2.0",
62
67
  "@vue/eslint-config-typescript": "14.6.0",
68
+ "@vue/test-utils": "2.4.6",
63
69
  "eslint": "9.39.1",
64
70
  "eslint-plugin-headers": "1.3.3",
65
- "eslint-plugin-jsdoc": "61.2.1",
66
- "eslint-plugin-vue": "10.5.1",
67
- "prettier": "3.6.2",
71
+ "eslint-plugin-jsdoc": "61.5.0",
72
+ "eslint-plugin-vue": "10.6.2",
73
+ "happy-dom": "20.0.11",
74
+ "prettier": "3.7.4",
68
75
  "typescript": "5.9.3",
69
- "vite": "7.2.2",
70
- "vitest": "4.0.8",
71
- "vue-tsc": "3.1.3"
76
+ "vite": "7.2.7",
77
+ "vite-tsconfig-paths": "5.1.4",
78
+ "vitest": "4.0.15",
79
+ "vue-tsc": "3.1.8"
72
80
  },
73
- "packageManager": "pnpm@10.20.0"
81
+ "packageManager": "pnpm@10.25.0"
74
82
  }
@@ -1,6 +1,9 @@
1
1
  export { default as LinidZoneRenderer } from './components/LinidZoneRenderer.vue';
2
2
  export { useLinidZoneStore } from './stores/linidZoneStore';
3
+ export { useLinIdConfigurationStore } from './stores/linIdConfigurationStore';
4
+ export { getHttpClient, setHttpClient } from './services/httpClientService';
3
5
  export type { LinidZoneEntry } from './types/linidZone';
6
+ export type { LinIdAttributeConfiguration, LinIdEntityConfiguration, LinIdRouteConfiguration, } from './types/linidConfiguration';
4
7
  export type { ModuleHostConfig, RemoteComponentModule, RemoteModule, } from './types/module';
5
8
  export type { ModuleLifecycleHooks, ModuleLifecycleResult, } from './types/moduleLifecycle';
6
9
  export { ModuleLifecyclePhase } from './types/moduleLifecycle';
@@ -0,0 +1,13 @@
1
+ import type { AxiosInstance } from 'axios';
2
+ /**
3
+ * Initializes the shared HTTP client instance.
4
+ * Should be called once by the host application during boot.
5
+ * @param client - The Axios instance to use as the shared HTTP client.
6
+ */
7
+ export declare function setHttpClient(client: AxiosInstance): void;
8
+ /**
9
+ * Returns the shared HTTP client instance.
10
+ * Must be called after initialization via `setHttpClient()`.
11
+ * @returns The shared Axios instance.
12
+ */
13
+ export declare function getHttpClient(): AxiosInstance;
@@ -0,0 +1,21 @@
1
+ import type { LinIdEntityConfiguration, LinIdRouteConfiguration } from '../types/linidConfiguration';
2
+ /**
3
+ * Service for managing and exposing LinID entity and route configurations.
4
+ * Fetches metadata from the backend API.
5
+ */
6
+ /**
7
+ * Fetches all entity configurations from the backend.
8
+ * @returns A promise resolving to an array of entity configurations.
9
+ */
10
+ export declare function getEntitiesConfiguration(): Promise<LinIdEntityConfiguration[]>;
11
+ /**
12
+ * Fetches a specific entity configuration by name.
13
+ * @param entityId - The name/identifier of the entity.
14
+ * @returns A promise resolving to the entity configuration.
15
+ */
16
+ export declare function getEntityConfiguration(entityId: string): Promise<LinIdEntityConfiguration>;
17
+ /**
18
+ * Fetches all route configurations from the backend.
19
+ * @returns A promise resolving to an array of route configurations.
20
+ */
21
+ export declare function getRoutesConfiguration(): Promise<LinIdRouteConfiguration[]>;
@@ -0,0 +1,79 @@
1
+ import type { LinIdEntityConfiguration, LinIdRouteConfiguration } from '../types/linidConfiguration';
2
+ /**
3
+ * State interface for the LinId Configuration Store.
4
+ */
5
+ interface LinIdConfigurationState {
6
+ /** List of entity configurations fetched from the backend. */
7
+ entities: LinIdEntityConfiguration[];
8
+ /** List of route configurations fetched from the backend. */
9
+ routes: LinIdRouteConfiguration[];
10
+ /** Indicates if the configuration is currently being loaded. */
11
+ loading: boolean;
12
+ /** Error message if the configuration fetch failed. */
13
+ error: string | null;
14
+ }
15
+ /**
16
+ * Pinia store managing LinID entity and route configurations.
17
+ *
18
+ * Fetches and stores metadata from the backend API.
19
+ */
20
+ export declare const useLinIdConfigurationStore: import("pinia").StoreDefinition<"linidConfigurationStore", LinIdConfigurationState, {
21
+ /**
22
+ * Returns an entity configuration by name.
23
+ * @param state - The store state.
24
+ * @returns A function that takes an entity name and returns the configuration.
25
+ */
26
+ getEntityByName: (state: {
27
+ entities: {
28
+ name: string;
29
+ attributes: {
30
+ name: string;
31
+ type: string;
32
+ required: boolean;
33
+ hasValidations: boolean;
34
+ input: string;
35
+ inputSettings: Record<string, unknown>;
36
+ }[];
37
+ }[];
38
+ routes: {
39
+ method: string;
40
+ path: string;
41
+ entity: string | null;
42
+ variables: string[];
43
+ }[];
44
+ loading: boolean;
45
+ error: string | null;
46
+ } & import("pinia").PiniaCustomStateProperties<LinIdConfigurationState>) => (name: string) => LinIdEntityConfiguration | undefined;
47
+ /**
48
+ * Returns all routes for a specific entity.
49
+ * @param state - The store state.
50
+ * @returns A function that takes an entity name and returns its routes.
51
+ */
52
+ getRoutesByEntity: (state: {
53
+ entities: {
54
+ name: string;
55
+ attributes: {
56
+ name: string;
57
+ type: string;
58
+ required: boolean;
59
+ hasValidations: boolean;
60
+ input: string;
61
+ inputSettings: Record<string, unknown>;
62
+ }[];
63
+ }[];
64
+ routes: {
65
+ method: string;
66
+ path: string;
67
+ entity: string | null;
68
+ variables: string[];
69
+ }[];
70
+ loading: boolean;
71
+ error: string | null;
72
+ } & import("pinia").PiniaCustomStateProperties<LinIdConfigurationState>) => (entityName: string) => LinIdRouteConfiguration[];
73
+ }, {
74
+ /**
75
+ * Fetches all entity and route configurations from the backend.
76
+ */
77
+ fetchConfiguration(): Promise<void>;
78
+ }>;
79
+ export {};