@linagora/linid-im-front-corelib 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/core-lib.es.js +3 -2
- package/dist/core-lib.umd.js +3 -3
- package/dist/package.json +8 -4
- package/dist/tsconfig.lib.tsbuildinfo +1 -0
- package/dist/types/src/index.d.ts +2 -1
- package/package.json +8 -4
- package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -83
- package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -90
- package/.github/ISSUE_TEMPLATE/question.yml +0 -31
- package/.github/ISSUE_TEMPLATE/security.yml +0 -69
- package/.github/actions/setup-node-pnpm/action.yml +0 -29
- package/.github/workflows/pull-request.yml +0 -147
- package/.github/workflows/release.yml +0 -90
- package/.prettierignore +0 -7
- package/.prettierrc.json +0 -5
- package/.vscode/extensions.json +0 -3
- package/.vscode/settings.json +0 -9
- package/CHANGELOG.md +0 -51
- package/CONTRIBUTING.md +0 -269
- package/COPYRIGHT +0 -23
- package/docs/components-plugin-zones.md +0 -168
- package/docs/helpers.md +0 -188
- package/docs/module-lifecycle.md +0 -717
- package/docs/services.md +0 -39
- package/docs/types-and-interfaces.md +0 -139
- package/eslint.config.js +0 -136
- package/src/components/LinidZoneRenderer.vue +0 -77
- package/src/index.ts +0 -62
- package/src/lifecycle/skeleton.ts +0 -147
- package/src/services/federationService.ts +0 -44
- package/src/services/httpClientService.ts +0 -61
- package/src/services/linIdConfigurationService.ts +0 -73
- package/src/stores/linIdConfigurationStore.ts +0 -116
- package/src/stores/linidZoneStore.ts +0 -62
- package/src/types/linidConfiguration.ts +0 -70
- package/src/types/linidZone.ts +0 -48
- package/src/types/module.ts +0 -96
- package/src/types/moduleLifecycle.ts +0 -154
- package/tests/unit/components/LinidZoneRenderer.spec.js +0 -135
- package/tests/unit/lifecycle/skeleton.spec.js +0 -138
- package/tests/unit/services/federationService.spec.js +0 -146
- package/tests/unit/services/httpClientService.spec.js +0 -49
- package/tests/unit/services/linIdConfigurationService.spec.js +0 -113
- package/tests/unit/stores/linIdConfigurationStore.spec.js +0 -171
- package/tests/unit/stores/linidZoneStore.spec.js +0 -94
- package/tsconfig.json +0 -14
- package/tsconfig.lib.json +0 -20
- package/tsconfig.node.json +0 -9
- package/tsconfig.spec.json +0 -16
- package/vite.config.ts +0 -37
- package/vitest.config.ts +0 -19
package/README.md
CHANGED
|
@@ -84,9 +84,9 @@ A full technical documentation is available in the `docs/` directory:
|
|
|
84
84
|
Learn how to use the component that dynamically renders remote Vue plugins.
|
|
85
85
|
→ [`docs/components-plugin-zones.md`](docs/components-plugin-zones.md)
|
|
86
86
|
|
|
87
|
-
- 🧰 **
|
|
88
|
-
Detailed description of all
|
|
89
|
-
→ [`docs/
|
|
87
|
+
- 🧰 **Services**
|
|
88
|
+
Detailed description of all services provided by the library.
|
|
89
|
+
→ [`docs/services.md`](docs/services.md)
|
|
90
90
|
|
|
91
91
|
- 🧩 **TypeScript Types & Interfaces**
|
|
92
92
|
Detailed description of all types and interfaces used in the plugin system.
|
package/dist/core-lib.es.js
CHANGED
|
@@ -697,7 +697,7 @@ function requireIndex_cjs$1() {
|
|
|
697
697
|
return P.__FEDERATION__.__DEBUG_CONSTRUCTOR__;
|
|
698
698
|
}
|
|
699
699
|
function K(n, e = t.isDebugMode()) {
|
|
700
|
-
e && (P.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = n, P.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.21.
|
|
700
|
+
e && (P.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = n, P.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.21.6");
|
|
701
701
|
}
|
|
702
702
|
function Z(n, e) {
|
|
703
703
|
if (typeof e == "string") {
|
|
@@ -2399,7 +2399,7 @@ function requireIndex_cjs$1() {
|
|
|
2399
2399
|
beforeInitContainer: new de("beforeInitContainer"),
|
|
2400
2400
|
// maybe will change, temporarily for internal use only
|
|
2401
2401
|
initContainer: new de("initContainer")
|
|
2402
|
-
}), this.version = "0.21.
|
|
2402
|
+
}), this.version = "0.21.6", this.moduleCache = /* @__PURE__ */ new Map(), this.loaderHook = new _e({
|
|
2403
2403
|
// FIXME: may not be suitable , not open to the public yet
|
|
2404
2404
|
getModuleInfo: new te(),
|
|
2405
2405
|
createScript: new te(),
|
|
@@ -3104,6 +3104,7 @@ export {
|
|
|
3104
3104
|
_sfc_main as LinidZoneRenderer,
|
|
3105
3105
|
ModuleLifecyclePhase,
|
|
3106
3106
|
getHttpClient,
|
|
3107
|
+
loadAsyncComponent,
|
|
3107
3108
|
setHttpClient,
|
|
3108
3109
|
useLinIdConfigurationStore,
|
|
3109
3110
|
useLinidZoneStore
|
package/dist/core-lib.umd.js
CHANGED
|
@@ -4,9 +4,9 @@ ${d.slice(0,5).join(`
|
|
|
4
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
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"',[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
|
|
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.6")}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.6",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
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)||(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"})}));
|
|
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.loadAsyncComponent=loadAsyncComponent,exports.setHttpClient=setHttpClient,exports.useLinIdConfigurationStore=useLinIdConfigurationStore,exports.useLinidZoneStore=useLinidZoneStore,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})}));
|
package/dist/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linagora/linid-im-front-corelib",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
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
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
6
9
|
"main": "dist/core-lib.umd.js",
|
|
7
10
|
"module": "dist/core-lib.es.js",
|
|
8
11
|
"types": "dist/types/index.d.ts",
|
|
@@ -53,14 +56,14 @@
|
|
|
53
56
|
},
|
|
54
57
|
"homepage": "https://github.com/linagora/linid-im-front-corelib#readme",
|
|
55
58
|
"peerDependencies": {
|
|
56
|
-
"@module-federation/enhanced": "0.21.
|
|
59
|
+
"@module-federation/enhanced": "0.21.6",
|
|
57
60
|
"axios": "1.13.2",
|
|
58
61
|
"pinia": "3.0.4",
|
|
59
|
-
"vue": "3.5.
|
|
62
|
+
"vue": "3.5.25"
|
|
60
63
|
},
|
|
61
64
|
"devDependencies": {
|
|
62
65
|
"@eslint/js": "9.39.1",
|
|
63
|
-
"@types/node": "
|
|
66
|
+
"@types/node": "25.0.0",
|
|
64
67
|
"@vitejs/plugin-vue": "6.0.2",
|
|
65
68
|
"@vitest/coverage-v8": "4.0.15",
|
|
66
69
|
"@vue/eslint-config-prettier": "10.2.0",
|
|
@@ -68,6 +71,7 @@
|
|
|
68
71
|
"@vue/test-utils": "2.4.6",
|
|
69
72
|
"eslint": "9.39.1",
|
|
70
73
|
"eslint-plugin-headers": "1.3.3",
|
|
74
|
+
"eslint-plugin-import": "2.32.0",
|
|
71
75
|
"eslint-plugin-jsdoc": "61.5.0",
|
|
72
76
|
"eslint-plugin-vue": "10.6.2",
|
|
73
77
|
"happy-dom": "20.0.11",
|