@module-federation/bridge-vue3 2.8.2 → 2.9.0
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/dist/index.cjs +6 -6
- package/dist/index.js +1495 -1263
- package/dist/provider.d.ts +1 -0
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
`),r=t.filter(o=>!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("vue"),He=require("vue-router");function st(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const ir=st(N),pe=st(He),ar=".json",cr="FEDERATION_DEBUG",lr=":";let Pe=function(e){return e[e.UNKNOWN=1]="UNKNOWN",e[e.CALCULATED=2]="CALCULATED",e[e.NO_USE=0]="NO_USE",e}({});const B=typeof ENV_TARGET<"u"?ENV_TARGET==="web":typeof window<"u"&&typeof window.document<"u";function it(){return B}function at(){return typeof navigator<"u"&&(navigator==null?void 0:navigator.product)==="ReactNative"}function ur(){try{if(it()&&window.localStorage)return!!localStorage.getItem(cr)}catch{return!1}return!1}function ke(){return typeof process<"u"&&process.env&&process.env.FEDERATION_DEBUG?!!process.env.FEDERATION_DEBUG:typeof FEDERATION_DEBUG<"u"&&FEDERATION_DEBUG?!0:ur()}const fr="[ Federation Runtime ]",ct=function(...e){return e.length?e.reduce((t,r)=>r?t?`${t}${lr}${r}`:r:t,""):""};function Le(e,t){if("getPublicPath"in e){let r;return e.getPublicPath.startsWith("function")?r=new Function("return "+e.getPublicPath)()():r=new Function(e.getPublicPath)(),`${r}${t}`}else return"publicPath"in e?!it()&&!at()&&"ssrPublicPath"in e&&typeof e.ssrPublicPath=="string"?`${e.ssrPublicPath}${t}`:`${e.publicPath}${t}`:(console.warn("Cannot get resource URL. If in debug mode, please ignore.",e,t),"")}const lt=e=>{console.warn(`${fr}: ${e}`)};function ut(e){try{return JSON.stringify(e,null,2)}catch{return""}}const $e=(e,t)=>{if(!e)return t;const o=(n=>{if(n===".")return"";if(n.startsWith("./"))return n.replace("./","");if(n.startsWith("/")){const s=n.slice(1);return s.endsWith("/")?s.slice(0,-1):s}return n})(e);return o?o.endsWith("/")?`${o}${t}`:`${o}/${t}`:t};function hr(e){return e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")}function dr(e,t={}){var _;const{remotes:r={},overrides:o={},version:n}=t;let s;const i=()=>"publicPath"in e.metaData?(e.metaData.publicPath==="auto"||e.metaData.publicPath==="")&&n?hr(n):e.metaData.publicPath:e.metaData.getPublicPath,a=Object.keys(o);let c={};Object.keys(r).length||(c=((_=e.remotes)==null?void 0:_.reduce((E,R)=>{let S;const b=R.federationContainerName;return a.includes(b)?S=o[b]:"version"in R?S=R.version:S=R.entry,E[b]={matchedVersion:S},E},{}))||{}),Object.keys(r).forEach(E=>c[E]={matchedVersion:a.includes(E)?o[E]:r[E]});const{remoteEntry:{path:l,name:u,type:f},types:d={path:"",name:"",zip:"",api:""},buildInfo:{buildVersion:m},globalName:h,ssrRemoteEntry:p}=e.metaData,{exposes:y}=e;let g={version:n||"",buildVersion:m,globalName:h,remoteEntry:$e(l,u),remoteEntryType:f,remoteTypes:$e(d.path,d.name),remoteTypesZip:d.zip||"",remoteTypesAPI:d.api||"",remotesInfo:c,shared:e==null?void 0:e.shared.map(E=>({assets:E.assets,sharedName:E.name,version:E.version,usedExports:E.referenceExports||[]})),modules:y==null?void 0:y.map(E=>({moduleName:E.name,modulePath:E.path,assets:E.assets}))};if("publicPath"in e.metaData?(s={...g,publicPath:i()},typeof e.metaData.ssrPublicPath=="string"&&(s.ssrPublicPath=e.metaData.ssrPublicPath)):s={...g,getPublicPath:i()},p){const E=$e(p.path,p.name);s.ssrRemoteEntry=E,s.ssrRemoteEntryType=p.type||"commonjs-module"}return s}function ft(e){return!!("remoteEntry"in e&&e.remoteEntry.includes(ar))}const mr="[ Module Federation ]",te=console,pr=["logger.ts","logger.js","captureStackTrace","Logger.emit","Logger.log","Logger.info","Logger.warn","Logger.error","Logger.debug"];function yr(){try{const e=new Error().stack;if(!e)return;const[,...t]=e.split(`
|
|
2
|
+
`),r=t.filter(o=>!pr.some(n=>o.includes(n)));return r.length?`Stack trace:
|
|
3
3
|
${r.slice(0,5).join(`
|
|
4
|
-
`)}`:void 0}catch{return}}var
|
|
5
|
-
})`,{filename:
|
|
4
|
+
`)}`:void 0}catch{return}}var ht=class{constructor(e,t=te){this.prefix=e,this.delegate=t??te}setPrefix(e){this.prefix=e}setDelegate(e){this.delegate=e??te}emit(e,t){const r=this.delegate,o=ke()?yr():void 0,n=o?[...t,o]:t,s=(()=>{switch(e){case"log":return["log","info"];case"info":return["info","log"];case"warn":return["warn","info","log"];case"error":return["error","warn","log"];default:return["debug","log"]}})();for(const i of s){const a=r[i];if(typeof a=="function"){a.call(r,this.prefix,...n);return}}for(const i of s){const a=te[i];if(typeof a=="function"){a.call(te,this.prefix,...n);return}}}log(...e){this.emit("log",e)}warn(...e){this.emit("warn",e)}error(...e){this.emit("error",e)}success(...e){this.emit("info",e)}info(...e){this.emit("info",e)}ready(...e){this.emit("info",e)}debug(...e){ke()&&this.emit("debug",e)}};function dt(e){return new ht(e)}function Er(e){const t=new ht(e);return Object.defineProperty(t,"__mf_infrastructure_logger__",{value:!0,enumerable:!1,configurable:!1}),t}Er(mr);async function mt(e,t){try{return await e()}catch(r){lt(r);return}}function Oe(e,t){const r=/^(https?:)?\/\//i;return e.replace(r,"").replace(/\/$/,"")===t.replace(r,"").replace(/\/$/,"")}function pt(e){let t=null,r=!0,o=2e4,n;const s=document.getElementsByTagName("script");for(let l=0;l<s.length;l++){const u=s[l],f=u.getAttribute("src");if(f&&Oe(f,e.url)){t=u,r=!1;break}}if(!t){const l=e.attrs;t=document.createElement("script"),t.type=(l==null?void 0:l.type)==="module"?"module":"text/javascript";let u;e.createScriptHook&&(u=e.createScriptHook(e.url,e.attrs),u instanceof HTMLScriptElement?t=u:typeof u=="object"&&("script"in u&&u.script&&(t=u.script),"timeout"in u&&u.timeout&&(o=u.timeout))),t.src||(t.src=e.url),l&&!u&&Object.keys(l).forEach(f=>{t&&(f==="async"||f==="defer"?t[f]=l[f]:t.getAttribute(f)||t.setAttribute(f,l[f]))})}let i=null;const a=typeof window<"u"?l=>{if(l.filename&&Oe(l.filename,e.url)){const u=new Error(`ScriptExecutionError: Script "${e.url}" loaded but threw a runtime error during execution: ${l.message} (${l.filename}:${l.lineno}:${l.colno})`);u.name="ScriptExecutionError",i=u}}:null;a&&window.addEventListener("error",a);const c=async(l,u)=>{clearTimeout(n),a&&window.removeEventListener("error",a);const f=()=>{if((u==null?void 0:u.type)==="error"){const d=new Error(u!=null&&u.isTimeout?`ScriptNetworkError: Script "${e.url}" timed out.`:`ScriptNetworkError: Failed to load script "${e.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);d.name="ScriptNetworkError",e!=null&&e.onErrorCallback&&(e==null||e.onErrorCallback(d))}else i?e!=null&&e.onErrorCallback&&(e==null||e.onErrorCallback(i)):e!=null&&e.cb&&(e==null||e.cb())};if(t&&(t.onerror=null,t.onload=null,mt(()=>{const{needDeleteScript:d=!0}=e;d&&t!=null&&t.parentNode&&t.parentNode.removeChild(t)}),l&&typeof l=="function")){const d=l(u);if(d instanceof Promise){const m=await d;return f(),m}return f(),d}f()};return t.onerror=c.bind(null,t.onerror),t.onload=c.bind(null,t.onload),n=setTimeout(()=>{c(null,{type:"error",isTimeout:!0})},o),{script:t,needAttach:r}}function gr(e){let t=null,r=!0,o=2e4,n;const s=document.getElementsByTagName("link");for(let a=0;a<s.length;a++){const c=s[a],l=c.getAttribute("href"),u=c.getAttribute("rel");if(l&&Oe(l,e.url)&&u===e.attrs.rel){t=c,r=!1;break}}if(!t){t=document.createElement("link"),t.setAttribute("href",e.url);let a,c=!0;const l=e.attrs;e.createLinkHook&&(a=e.createLinkHook(e.url,l),a instanceof HTMLLinkElement?(t=a,c=!1):typeof a=="object"&&("link"in a&&a.link&&(t=a.link,c=!1),"timeout"in a&&a.timeout&&(o=a.timeout))),l&&c&&Object.keys(l).forEach(u=>{t&&!t.getAttribute(u)&&t.setAttribute(u,l[u])})}if(!r)return Promise.resolve().then(()=>{e!=null&&e.cb&&(e==null||e.cb())}),{link:t,needAttach:r};const i=(a,c)=>{n&&clearTimeout(n);const l=()=>{if((c==null?void 0:c.type)==="error"){const u=new Error(c!=null&&c.isTimeout?`LinkNetworkError: Link "${e.url}" timed out.`:`LinkNetworkError: Failed to load link "${e.url}" - the URL is unreachable or the server returned an error.`);u.name="LinkNetworkError",e!=null&&e.onErrorCallback&&(e==null||e.onErrorCallback(u))}else e!=null&&e.cb&&(e==null||e.cb())};if(t&&(t.onerror=null,t.onload=null,mt(()=>{const{needDeleteLink:u=!0}=e;u&&t!=null&&t.parentNode&&t.parentNode.removeChild(t)}),a)){const u=a(c);return l(),u}l()};return t.onerror=i.bind(null,t.onerror),t.onload=i.bind(null,t.onload),n=setTimeout(()=>{i(null,{type:"error",isTimeout:!0})},o),{link:t,needAttach:r}}function _r(e,t){const{attrs:r={},createScriptHook:o}=t;return new Promise((n,s)=>{const{script:i,needAttach:a}=pt({url:e,cb:n,onErrorCallback:s,attrs:{fetchpriority:"high",...r},createScriptHook:o,needDeleteScript:!0});a&&document.head.appendChild(i)})}const ue=new Map;function G(e){if(!e)throw new Error("import specifier is required");if(ue.has(e))return ue.get(e);const t=new Function("name","return import(name)")(e).then(r=>r).catch(r=>{throw console.error(`Error importing module ${e}:`,r),ue.delete(e),r});return ue.set(e,t),t}const Rr=async(e,t,r)=>{const n=await((s,i)=>r.lifecycle.fetch.emit(s,i))(e,t||{});return!n||!(n instanceof Response)?fetch(e,t||{}):n},Sr=typeof ENV_TARGET>"u"||ENV_TARGET!=="web"?(e,t,r,o)=>{if(o!=null&&o.createScriptHook){const a=o.createScriptHook(e);a&&typeof a=="object"&&"url"in a&&(e=a.url)}let n;try{n=new URL(e)}catch(a){console.error("Error constructing URL:",a),t(new Error(`Invalid URL: ${a}`));return}const s=async()=>o!=null&&o.fetch?(a,c)=>Rr(a,c,o):fetch,i=async(a,c)=>{var l;try{const f=await(await a(c.href)).text(),[d,m]=await Promise.all([G("path"),G("vm")]),h={exports:{},module:{exports:{}}},p=c.pathname.split("/").slice(0,-1).join("/"),y=d.basename(c.pathname),g=new m.Script(`(function(exports, module, require, __dirname, __filename) {${f}
|
|
5
|
+
})`,{filename:y,importModuleDynamically:((l=m.constants)==null?void 0:l.USE_MAIN_CONTEXT_DEFAULT_LOADER)??G});let _;_=(await G("node:module")).createRequire(c.protocol==="file:"||c.protocol==="node:"?c.href:d.join(process.cwd(),"__mf_require_base__.js")),g.runInThisContext()(h.exports,h.module,_,p,y);const E=h.module.exports||h.exports;if(r&&E&&r.globalName){t(void 0,E[r.globalName]||E);return}t(void 0,E)}catch(u){t(u instanceof Error?u:new Error(`Script execution error: ${u}`))}};s().then(async a=>{if((r==null?void 0:r.type)==="esm"||(r==null?void 0:r.type)==="module")return gt(n.href,{fetch:a,vm:await G("vm")}).then(async c=>{await c.evaluate(),t(void 0,c.namespace)}).catch(c=>{t(c instanceof Error?c:new Error(`Script execution error: ${c}`))});i(a,n)}).catch(a=>{t(a)})}:(e,t,r,o)=>{t(new Error("createScriptNode is disabled in non-Node.js environment"))},br=typeof ENV_TARGET>"u"||ENV_TARGET!=="web"?(e,t)=>new Promise((r,o)=>{Sr(e,(n,s)=>{var i,a;if(n)o(n);else{const c=((i=t==null?void 0:t.attrs)==null?void 0:i.globalName)||`__FEDERATION_${(a=t==null?void 0:t.attrs)==null?void 0:a.name}:custom__`;r(globalThis[c]=s)}},t.attrs,t.loaderHook)}):(e,t)=>{throw new Error("loadScriptNode is disabled in non-Node.js environment")},X=new Map,yt=e=>e.startsWith("http:")||e.startsWith("https:"),Et=e=>!e.startsWith("./")&&!e.startsWith("../")&&!e.startsWith("/")&&!e.includes(":");function wr(e){const t=new URL(e),r=encodeURIComponent(t.protocol.slice(0,-1)),o=encodeURIComponent(t.host),n=t.pathname.split("/").map(i=>encodeURIComponent(i)).join("/"),s=encodeURIComponent(`${t.search}${t.hash}`);return`/${r}/${o}${n}${s?`/${s}`:""}`}function Ir(e,t){const r=t.endsWith("/")?t:`${t}/`;return new URL(`__module_federation_remote__${wr(e)}`,r).href}async function $r(e){return e.startsWith("node:")?!0:Et(e)?(await G("node:module")).builtinModules.includes(e):!1}function vr(e){const t=e&&(typeof e=="object"||typeof e=="function")?e:{default:e},r={...t};return Object.prototype.hasOwnProperty.call(r,"default")||(r.default=t),r}async function Tr(e,t,r){if(typeof r.SyntheticModule!="function")throw new Error("vm.SyntheticModule is required to load Node.js built-in modules in ESM remote entries.");const o=vr(t),n=Object.keys(o),s=new r.SyntheticModule(n,function(){for(const a of n)this.setExport(a,o[a])},{identifier:e});return X.set(e,s),await s.link(async()=>{throw new Error(`Node.js built-in module "${e}" should not request child modules.`)}),await s.evaluate(),s}async function Nr(e,t){const r=`node-builtin:${e}`;return X.has(r)?X.get(r):Tr(r,await G(e),t)}async function qe(e,t,r){if(await $r(e))return Nr(e,r.vm);if(Et(e))throw new Error(`Unsupported ESM module specifier "${e}". Only relative or absolute http(s) remote modules and Node.js built-in modules are supported.`);const o=new URL(e,t).href;if(!yt(o))throw new Error(`Unsupported ESM module specifier "${e}" resolved to "${o}". Only http(s) remote modules and Node.js built-in modules are supported.`);return gt(o,r)}async function Ar(e){if(e.status==="linked"&&await e.evaluate(),e.status==="errored")throw e.error;return e}async function gt(e,t){if(X.has(e))return X.get(e);const{fetch:r,vm:o}=t;if(!yt(e))throw new Error(`Unsupported ESM module URL "${e}". Only http(s) remote modules and Node.js built-in modules are supported.`);const n=await(await r(e)).text(),s=(await G("node:url")).pathToFileURL(process.cwd()).href,i=new o.SourceTextModule(n,{identifier:e,initializeImportMeta:a=>{a.url=Ir(e,s)},importModuleDynamically:async a=>Ar(await qe(a,e,t))});return X.set(e,i),await i.link(async a=>qe(a,e,t)),i}const D=dt("[ Module Federation Bridge Vue3 ]"),Mr=e=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split("-")[0].toLowerCase()}#${e.toLowerCase()}`,_t=(e,t,r,o)=>{const n=[`${[t[e]]} #${e}`];return r&&n.push(`args: ${JSON.stringify(r)}`),n.push(Mr(e)),o&&n.push(`Original Error Message:
|
|
6
6
|
${o}`),n.join(`
|
|
7
|
-
`)};function Ir(e,t,r,o,n,s){return o(Et(e,t,r,n))}const B="[ Federation Runtime ]",Oe=ft(B);function C(e,t,r,o,n){e||S(t)}function S(e,t,r,o,n){if(t!==void 0)return Ir(e,t,r??{},a=>{throw new Error(`${B}: ${a}`)},o);const s=e;throw s instanceof Error?(s.message.startsWith(B)||(s.message=`${B}: ${s.message}`),s):new Error(`${B}: ${s}`)}function oe(e){e instanceof Error&&(e.message.startsWith(B)||(e.message=`${B}: ${e.message}`)),Oe.warn(e)}function $r(e,t){return e.findIndex(r=>r===t)===-1&&e.push(t),e}function ne(e){return"version"in e&&e.version?`${e.name}:${e.version}`:"entry"in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function De(e){return typeof e.entry<"u"}function gt(e){return!e.entry.includes(".json")}function He(e){return e&&typeof e=="object"}const Tr=Object.prototype.toString;function vr(e){return Tr.call(e)==="[object Object]"}function Rt(e){return Array.isArray(e)?e:[e]}function _t(e){const t={url:"",type:"global",globalName:""};return U||st()||!("ssrRemoteEntry"in e)?"remoteEntry"in e?{url:e.remoteEntry,type:e.remoteEntryType,globalName:e.globalName}:t:"ssrRemoteEntry"in e?{url:e.ssrRemoteEntry||t.url,type:e.ssrRemoteEntryType||t.type,globalName:e.globalName}:t}const Nr=(e,t)=>{let r;return e.endsWith("/")?r=e.slice(0,-1):r=e,t.startsWith(".")&&(t=t.slice(1)),r=r+t,r},N=typeof globalThis=="object"?globalThis:window,O=(()=>{try{return document.defaultView}catch{return N}})(),be=O;function me(e,t,r){Object.defineProperty(e,t,{value:r,configurable:!1,writable:!0})}function pe(e,t){return Object.hasOwnProperty.call(e,t)}pe(N,"__GLOBAL_LOADING_REMOTE_ENTRY__")||me(N,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});const J=N.__GLOBAL_LOADING_REMOTE_ENTRY__;function bt(e){var t,r,o,n,s,a;pe(e,"__VMOK__")&&!pe(e,"__FEDERATION__")&&me(e,"__FEDERATION__",e.__VMOK__),pe(e,"__FEDERATION__")||(me(e,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),me(e,"__VMOK__",e.__FEDERATION__)),(t=e.__FEDERATION__).__GLOBAL_PLUGIN__??(t.__GLOBAL_PLUGIN__=[]),(r=e.__FEDERATION__).__INSTANCES__??(r.__INSTANCES__=[]),(o=e.__FEDERATION__).moduleInfo??(o.moduleInfo={}),(n=e.__FEDERATION__).__SHARE__??(n.__SHARE__={}),(s=e.__FEDERATION__).__MANIFEST_LOADING__??(s.__MANIFEST_LOADING__={}),(a=e.__FEDERATION__).__PRELOADED_MAP__??(a.__PRELOADED_MAP__=new Map)}bt(N);bt(O);function Ar(e,t=Me()){t&&(N.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,N.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="2.8.2")}function W(e,t){if(typeof t=="string"){if(e[t])return{value:e[t],key:t};{const r=Object.keys(e);for(const o of r){const[n,s]=o.split(":"),a=`${n}:${t}`,c=e[a];if(c)return{value:c,key:a}}return{value:void 0,key:t}}}else S(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`)}const qe=()=>O.__FEDERATION__.moduleInfo,Mr=(e,t)=>{const r=W(t,ne(e)).value;if(r&&!r.version&&"version"in e&&e.version&&(r.version=e.version),r)return r;if("version"in e&&e.version){const{version:o,...n}=e,s=ne(n),a=W(O.__FEDERATION__.moduleInfo,s).value;if((a==null?void 0:a.version)===o)return a}},ye=e=>Mr(e,O.__FEDERATION__.moduleInfo),ze=(e,t)=>{const r=ne(e);return O.__FEDERATION__.moduleInfo[r]=t,O.__FEDERATION__.moduleInfo},Pr=e=>(O.__FEDERATION__.moduleInfo={...O.__FEDERATION__.moduleInfo,...e},()=>{const t=Object.keys(e);for(const r of t)delete O.__FEDERATION__.moduleInfo[r]}),xe=(e,t)=>{const r=t||`__FEDERATION_${e}:custom__`;return{remoteEntryKey:r,entryExports:N[r]}},kr=()=>O.__FEDERATION__.__GLOBAL_PLUGIN__,Or=e=>N.__FEDERATION__.__PRELOADED_MAP__.get(e),Lr=e=>N.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),Ke="[0-9A-Za-z-]+",Ge=`(?:\\+(${Ke}(?:\\.${Ke})*))`,re="0|[1-9]\\d*",Ee="[0-9]+",St="\\d*[a-zA-Z-][a-zA-Z0-9-]*",Je=`(?:${Ee}|${St})`,Cr=`(?:-?(${Je}(?:\\.${Je})*))`,Ze=`(?:${re}|${St})`,wt=`(?:-(${Ze}(?:\\.${Ze})*))`,$e=`${re}|x|X|\\*`,Y=`[v=\\s]*(${$e})(?:\\.(${$e})(?:\\.(${$e})(?:${wt})?${Ge}?)?)?`,Fr=`^\\s*(${Y})\\s+-\\s+(${Y})\\s*$`,Dr=`[v=\\s]*${`(${Ee})\\.(${Ee})\\.(${Ee})`}${Cr}?${Ge}?`,Ue="((?:<|>)?=?)",Hr=`(\\s*)${Ue}\\s*(${Dr}|${Y})`,It="(?:~>?)",xr=`(\\s*)${It}\\s+`,$t="(?:\\^)",Gr=`(\\s*)${$t}\\s+`,Ur="(<|>)?=?\\s*\\*",Br=`^${$t}${Y}$`,jr=`v?${`(${re})\\.(${re})\\.(${re})`}${wt}?${Ge}?`,Vr=`^${It}${Y}$`,Wr=`^${Ue}\\s*${Y}$`,qr=`^${Ue}\\s*(${jr})$|^$`,zr="^\\s*>=\\s*0.0.0\\s*$";function L(e){return new RegExp(e)}function A(e){return!e||e.toLowerCase()==="x"||e==="*"}function Tt(...e){return t=>e.reduce((r,o)=>o(r),t)}function Xe(e){return e.match(L(qr))}function Ye(e,t,r,o){const n=`${e}.${t}.${r}`;return o?`${n}-${o}`:n}function Kr(e){return e.replace(L(Fr),(t,r,o,n,s,a,c,i,l,u,f,m)=>(A(o)?r="":A(n)?r=`>=${o}.0.0`:A(s)?r=`>=${o}.${n}.0`:r=`>=${r}`,A(l)?i="":A(u)?i=`<${Number(l)+1}.0.0-0`:A(f)?i=`<${l}.${Number(u)+1}.0-0`:m?i=`<=${l}.${u}.${f}-${m}`:i=`<=${i}`,`${r} ${i}`.trim()))}function Jr(e){return e.replace(L(Hr),"$1$2$3")}function Zr(e){return e.replace(L(xr),"$1~")}function Xr(e){return e.replace(L(Gr),"$1^")}function Yr(e){return e.trim().split(/\s+/).map(t=>t.replace(L(Br),(r,o,n,s,a)=>A(o)?"":A(n)?`>=${o}.0.0 <${Number(o)+1}.0.0-0`:A(s)?o==="0"?`>=${o}.${n}.0 <${o}.${Number(n)+1}.0-0`:`>=${o}.${n}.0 <${Number(o)+1}.0.0-0`:a?o==="0"?n==="0"?`>=${o}.${n}.${s}-${a} <${o}.${n}.${Number(s)+1}-0`:`>=${o}.${n}.${s}-${a} <${o}.${Number(n)+1}.0-0`:`>=${o}.${n}.${s}-${a} <${Number(o)+1}.0.0-0`:o==="0"?n==="0"?`>=${o}.${n}.${s} <${o}.${n}.${Number(s)+1}-0`:`>=${o}.${n}.${s} <${o}.${Number(n)+1}.0-0`:`>=${o}.${n}.${s} <${Number(o)+1}.0.0-0`)).join(" ")}function Qr(e){return e.trim().split(/\s+/).map(t=>t.replace(L(Vr),(r,o,n,s,a)=>A(o)?"":A(n)?`>=${o}.0.0 <${Number(o)+1}.0.0-0`:A(s)?`>=${o}.${n}.0 <${o}.${Number(n)+1}.0-0`:a?`>=${o}.${n}.${s}-${a} <${o}.${Number(n)+1}.0-0`:`>=${o}.${n}.${s} <${o}.${Number(n)+1}.0-0`)).join(" ")}function eo(e){return e.split(/\s+/).map(t=>t.trim().replace(L(Wr),(r,o,n,s,a,c)=>{const i=A(n),l=i||A(s),u=l||A(a);return o==="="&&u&&(o=""),c="",i?o===">"||o==="<"?"<0.0.0-0":"*":o&&u?(l&&(s=0),a=0,o===">"?(o=">=",l?(n=Number(n)+1,s=0,a=0):(s=Number(s)+1,a=0)):o==="<="&&(o="<",l?n=Number(n)+1:s=Number(s)+1),o==="<"&&(c="-0"),`${o+n}.${s}.${a}${c}`):l?`>=${n}.0.0${c} <${Number(n)+1}.0.0-0`:u?`>=${n}.${s}.0${c} <${n}.${Number(s)+1}.0-0`:r})).join(" ")}function to(e){return e.trim().replace(L(Ur),"")}function ro(e){return e.trim().replace(L(zr),"")}function ge(e,t){return e=Number(e)||e,t=Number(t)||t,e>t?1:e===t?0:-1}function oo(e,t){const{preRelease:r}=e,{preRelease:o}=t;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 n=0,s=r.length;n<=s;n++){const a=r[n],c=o[n];if(a!==c)return a===void 0&&c===void 0?0:a?c?ge(a,c):-1:1}return 0}function le(e,t){return ge(e.major,t.major)||ge(e.minor,t.minor)||ge(e.patch,t.patch)||oo(e,t)}function Te(e,t){return e.version===t.version}function no(e,t){switch(e.operator){case"":case"=":return Te(e,t);case">":return le(e,t)<0;case">=":return Te(e,t)||le(e,t)<0;case"<":return le(e,t)>0;case"<=":return Te(e,t)||le(e,t)>0;case void 0:return!0;default:return!1}}function so(e){return Tt(Yr,Qr,eo,to)(e)}function io(e){return Tt(Kr,Jr,Zr,Xr)(e.trim()).split(/\s+/).join(" ")}function te(e,t){if(!e)return!1;const r=Xe(e);if(!r)return!1;const[,o,,n,s,a,c]=r,i={operator:o,version:Ye(n,s,a,c),major:n,minor:s,patch:a,preRelease:c==null?void 0:c.split(".")},l=t.split("||");for(const u of l){const f=u.trim();if(!f||f==="*"||f==="x")return!0;try{const m=io(f);if(!m.trim())return!0;const h=m.split(" ").map(E=>so(E)).join(" ");if(!h.trim())return!0;const d=h.split(/\s+/).map(E=>ro(E)).filter(Boolean);if(d.length===0)continue;let p=!0;for(const E of d){const y=Xe(E);if(!y){p=!1;break}const[,R,,g,_,b,I]=y;if(!no({operator:R,version:Ye(g,_,b,I),major:g,minor:_,patch:b,preRelease:I==null?void 0:I.split(".")},i)){p=!1;break}}if(p)return!0}catch(m){console.error(`[semver] Error processing range part "${f}":`,m);continue}}return!1}const ae="default",vt="global";function ao(e,t,r,o){var s,a;let n;return"get"in e?n=e.get:"lib"in e?n=()=>Promise.resolve(e.lib):n=()=>Promise.resolve(()=>{S(`Cannot get shared "${r}" from "${t}": neither "get" nor "lib" is provided in the share config.`)}),(s=e.shareConfig)!=null&&s.eager&&((a=e.treeShaking)!=null&&a.mode)&&S(`Invalid shared config for "${r}" from "${t}": cannot use both "eager: true" and "treeShaking.mode" simultaneously. Choose one strategy.`),{deps:[],useIn:[],from:t,loading:null,...e,shareConfig:{requiredVersion:`^${e.version}`,singleton:!1,eager:!1,strictVersion:!1,...e.shareConfig},get:n,loaded:e!=null&&e.loaded||"lib"in e?!0:void 0,version:e.version??"0",scope:Array.isArray(e.scope)?e.scope:[e.scope??"default"],strategy:(e.strategy??o)||"version-first",treeShaking:e.treeShaking?{...e.treeShaking,mode:e.treeShaking.mode??"server-calc",status:e.treeShaking.status??Ae.UNKNOWN,useIn:[]}:void 0}}function Nt(e,t){const r=t.shared||{},o=t.name,n=Object.keys(r).reduce((a,c)=>{const i=Rt(r[c]);return a[c]=a[c]||[],i.forEach(l=>{a[c].push(ao(l,o,c,t.shareStrategy))}),a},{}),s={...e.shared};return Object.keys(n).forEach(a=>{s[a]?n[a].forEach(c=>{s[a].find(i=>i.version===c.version)||s[a].push(c)}):s[a]=n[a]}),{allShareInfos:s,newShareInfos:n}}function se(e,t){if(!e)return!1;const{status:r,mode:o}=e;return r===Ae.NO_USE?!1:r===Ae.CALCULATED?!0:o==="runtime-infer"?t?lo(e,t):!0:!1}function j(e,t){const r=o=>{if(!Number.isNaN(Number(o))){const n=o.split(".");let s=o;for(let a=0;a<3-n.length;a++)s+=".0";return s}return o};return!!te(r(e),`<=${r(t)}`)}const ie=(e,t)=>{const r=t||function(o,n){return j(o,n)};return Object.keys(e).reduce((o,n)=>!o||r(o,n)||o==="0"?n:o,0)},_e=e=>!!e.loaded||typeof e.lib=="function",co=e=>!!e.loading,lo=(e,t)=>{if(!e||!t)return!1;const{usedExports:r}=e;return r?!!t.every(o=>r.includes(o)):!1};function uo(e,t,r,o){const n=e[t][r];let s="",a=se(o);const c=function(i,l){return a?n[i].treeShaking?n[l].treeShaking?!_e(n[i].treeShaking)&&j(i,l):!1:!0:!_e(n[i])&&j(i,l)};if(a){if(s=ie(e[t][r],c),s)return{version:s,useTreesShaking:a};a=!1}return{version:ie(e[t][r],c),useTreesShaking:a}}const q=e=>_e(e)||co(e);function fo(e,t,r,o){const n=e[t][r];let s="",a=se(o);const c=function(i,l){if(a){if(!n[i].treeShaking)return!0;if(!n[l].treeShaking)return!1;if(q(n[l].treeShaking))return q(n[i].treeShaking)?!!j(i,l):!0;if(q(n[i].treeShaking))return!1}return q(n[l])?q(n[i])?!!j(i,l):!0:q(n[i])?!1:j(i,l)};if(a){if(s=ie(e[t][r],c),s)return{version:s,useTreesShaking:a};a=!1}return{version:ie(e[t][r],c),useTreesShaking:a}}function ho(e){return e==="loaded-first"?fo:uo}function Re(e,t,r,o){if(!e)return;const{shareConfig:n,scope:s=ae,strategy:a,treeShaking:c}=r,i=Array.isArray(s)?s:[s];for(const l of i)if(n&&e[l]&&e[l][t]){const{requiredVersion:u}=n,{version:f,useTreesShaking:m}=ho(a)(e,l,t,c),h=()=>{const p=e[l][t][f];if(n.singleton){if(typeof u=="string"&&!te(f,u)){const E=`Version ${f} from ${f&&p.from} of shared singleton module ${t} does not satisfy the requirement of ${r.from} which needs ${u})`;n.strictVersion?S(E):oe(E)}return{shared:p,useTreesShaking:m}}else{if(u===!1||u==="*")return{shared:p,useTreesShaking:m};if(te(f,u))return{shared:p,useTreesShaking:m};const E=se(c);if(E){for(const[y,R]of Object.entries(e[l][t]))if(se(R.treeShaking,c==null?void 0:c.usedExports)&&te(y,u))return{shared:R,useTreesShaking:E}}for(const[y,R]of Object.entries(e[l][t]))if(te(y,u))return{shared:R,useTreesShaking:!1}}},d={shareScopeMap:e,scope:l,pkgName:t,version:f,GlobalFederation:be.__FEDERATION__,shareInfo:r,resolver:h};return(o.emit(d)||d).resolver()}}function At(){return be.__FEDERATION__.__SHARE__}function Qe(e){const{pkgName:t,extraOptions:r,shareInfos:o}=e,n=i=>{if(!i)return;const l={};return i.forEach(f=>{l[f.version]=f}),l[ie(l,function(f,m){return!_e(l[f])&&j(f,m)})]},s=(r==null?void 0:r.resolver)??n,a=i=>i!==null&&typeof i=="object"&&!Array.isArray(i),c=(...i)=>{const l={};for(const u of i)if(u)for(const[f,m]of Object.entries(u)){const h=l[f];a(h)&&a(m)?l[f]=c(h,m):m!==void 0&&(l[f]=m)}return l};return c(s(o[t]),r==null?void 0:r.customShareInfo)}const z=(e,t)=>{e.useIn||(e.useIn=[]),$r(e.useIn,t)};function ue(e,t){return t&&e.treeShaking?e.treeShaking:e}function Be(e,t){return!t||t==="."?e:`${e}/${t.replace(/^\.\//,"")}`}function et(e,t){for(const r of e){const o=t.startsWith(r.name);let n=t.replace(r.name,"");if(o){if(n.startsWith("/")){const c=r.name;return n=`.${n}`,{pkgNameOrAlias:c,expose:n,remote:r}}else if(n==="")return{pkgNameOrAlias:r.name,expose:".",remote:r}}const s=r.alias&&t.startsWith(r.alias);let a=r.alias&&t.replace(r.alias,"");if(r.alias&&s){if(a&&a.startsWith("/")){const c=r.alias;return a=`.${a}`,{pkgNameOrAlias:c,expose:a,remote:r}}else if(a==="")return{pkgNameOrAlias:r.alias,expose:".",remote:r}}}}function mo(e,t){for(const r of e)if(t===r.name||r.alias&&t===r.alias)return r}const Mt="RUNTIME-001",Pt="RUNTIME-002",kt="RUNTIME-003",Ot="RUNTIME-004",Lt="RUNTIME-005",Le="RUNTIME-006",Ct="RUNTIME-007",Se="RUNTIME-008",po="RUNTIME-009",Ft="RUNTIME-010",Dt="RUNTIME-011",yo="RUNTIME-012",Ht="RUNTIME-013",xt="RUNTIME-014",Gt="RUNTIME-015",M={[Mt]:"Failed to get remoteEntry exports.",[Pt]:'The remote entry interface does not contain "init"',[kt]:"Failed to get manifest.",[Ot]:"Failed to locate remote.",[Lt]:"Invalid loadShareSync function call from bundler runtime",[Le]:"Invalid loadShareSync function call from runtime",[Ct]:"Failed to get remote snapshot.",[Se]:"Failed to load script resources.",[po]:"Please call createInstance first.",[Ft]:'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.',[Dt]:"The remoteEntry URL is missing from the remote snapshot.",[yo]:'The getter for the shared module is not a function. This may be caused by setting "shared.import: false" without the host providing the corresponding lib.',[Ht]:"The manifest is not a valid Module Federation manifest.",[xt]:"The remote does not expose the requested module.",[Gt]:"Remote container initialization failed."};({...M});const Ut=".then(callbacks[0]).catch(callbacks[1])",Eo=["Failed to fetch dynamically imported module","Importing a module script failed","error loading dynamically imported module"];function go(e){return e instanceof TypeError?Eo.some(t=>e.message.includes(t)):!1}function Bt(e){return e==="esm"||e==="module"}async function Ro({entry:e,remoteEntryExports:t,name:r,getEntryUrl:o}){return new Promise((n,s)=>{const a=i=>{if(go(i)){const l=i instanceof Error?i.message:String(i);try{S(Se,M,{remoteName:r,resourceUrl:c},l)}catch(u){s(u);return}}s(i)},c=o?o(e):e;try{t?n(t):typeof FEDERATION_ALLOW_NEW_FUNCTION<"u"?new Function("callbacks",`import("${c}")${Ut}`)([n,a]):import(c).then(n).catch(a)}catch(i){S(`Failed to load ESM entry from "${c}". ${i instanceof Error?i.message:String(i)}`)}})}async function _o({entry:e,remoteEntryExports:t}){return new Promise((r,o)=>{try{t?r(t):typeof __system_context__>"u"?System.import(e).then(r).catch(o):new Function("callbacks",`System.import("${e}")${Ut}`)([r,o])}catch(n){S(`Failed to load SystemJS entry from "${e}". ${n instanceof Error?n.message:String(n)}`)}})}function jt(e,t,r){const{remoteEntryKey:o,entryExports:n}=xe(e,t);return n||S(Mt,M,{remoteName:e,remoteEntryUrl:r,remoteEntryKey:o}),n}async function bo({name:e,globalName:t,entry:r,remoteInfo:o,loaderHook:n,getEntryUrl:s,resourceContext:a}){const{entryExports:c}=xe(e,t);if(c)return c;const i=s?s(r):r;return hr(i,{attrs:{},createScriptHook:(l,u)=>{const f=n.lifecycle.createScript.emit({url:l,attrs:u,remoteInfo:o,resourceContext:a?{...a,url:l}:void 0});if(f&&(f instanceof HTMLScriptElement||"script"in f||"timeout"in f))return f}}).then(()=>jt(e,t,r),l=>{const u=l instanceof Error?l.message:String(l);S(Se,M,{remoteName:e,resourceUrl:i},u)})}async function So({remoteInfo:e,remoteEntryExports:t,loaderHook:r,getEntryUrl:o,resourceContext:n}){const{entry:s,entryGlobalName:a,name:c,type:i}=e;return Bt(i)?Ro({entry:s,remoteEntryExports:t,name:c,getEntryUrl:o}):i==="system"?_o({entry:s,remoteEntryExports:t}):bo({entry:s,globalName:a,name:c,remoteInfo:e,loaderHook:r,getEntryUrl:o,resourceContext:n})}async function wo({remoteInfo:e,loaderHook:t,resourceContext:r}){const{entry:o,entryGlobalName:n,name:s,type:a}=e,{entryExports:c}=xe(s,n);return c||pr(o,{attrs:{name:s,globalName:n,type:a},loaderHook:{createScriptHook:(i,l={})=>{const u=t.lifecycle.createScript.emit({url:i,attrs:l,remoteInfo:e,resourceContext:r?{...r,url:i}:void 0});if(u&&"url"in u)return u}}}).then(()=>jt(s,n,o)).catch(i=>{S(`Failed to load Node.js entry for remote "${s}" from "${o}". ${i instanceof Error?i.message:String(i)}`)})}function Ce(e){const{entry:t,name:r}=e;return it(r,t)}async function je(e){const{origin:t,remoteEntryExports:r,remoteInfo:o,getEntryUrl:n,resourceContext:s,_inErrorHandling:a=!1}=e,c=Ce(o);if(r)return r;if(!J[c]){const i=t.remoteHandler.hooks.lifecycle.loadEntry,l=t.loaderHook;J[c]=i.emit({origin:t,loaderHook:l,remoteInfo:o,remoteEntryExports:r}).then(u=>u||((typeof ENV_TARGET<"u"?ENV_TARGET==="web":U)?So({remoteInfo:o,remoteEntryExports:r,loaderHook:l,getEntryUrl:n,resourceContext:s}):wo({remoteInfo:o,loaderHook:l,resourceContext:s}))).then(async u=>(await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:o,remoteEntryExports:u}),u)).catch(async u=>{const f=Ce(o),m=u instanceof Error&&u.message.includes("ScriptExecutionError");if(u instanceof Error&&u.message.includes(Se)&&!m&&!a){const h=p=>je({...p,_inErrorHandling:!0}),d=await t.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:h,origin:t,remoteInfo:o,remoteEntryExports:r,globalLoading:J,uniqueKey:f});if(d)return await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:o,remoteEntryExports:d,recovered:!0}),d}throw await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:o,error:u}),u})}return J[c]}function K(e){return{...e,entry:"entry"in e?e.entry:"",type:e.type||vt,entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||ae}}function Io(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function $o(e,t){const r=kr(),o=[t.hooks,t.remoteHandler.hooks,t.sharedHandler.hooks,t.snapshotHandler.hooks,t.loaderHook,t.bridgeHook];return r.length>0&&r.forEach(n=>{e!=null&&e.find(s=>s.name!==n.name)&&e.push(n)}),e&&e.length>0&&e.forEach(n=>{o.forEach(s=>{s.applyPlugin(n,t)})}),e}function To(e){return{name:e.name,alias:e.alias,entry:"entry"in e?e.entry:void 0,version:"version"in e?e.version:void 0,type:e.type,entryGlobalName:e.entryGlobalName,shareScope:e.shareScope}}function D(e){var r,o,n,s,a,c;const t={};for(const[i,l]of Object.entries(e.shared)){const u=l[0];u&&(t[i]={version:u.version,singleton:(r=u.shareConfig)==null?void 0:r.singleton,requiredVersion:((o=u.shareConfig)==null?void 0:o.requiredVersion)===!1?!1:(n=u.shareConfig)==null?void 0:n.requiredVersion,eager:u.eager,strictVersion:(s=u.shareConfig)==null?void 0:s.strictVersion})}return{project:{name:e.name,mfRole:((a=e.remotes)==null?void 0:a.length)>0?"host":"unknown"},mfConfig:{name:e.name,remotes:((c=e.remotes)==null?void 0:c.map(To))??[],shared:t}}}function Vt(e){return{resourceCategory:"sync",share:!0,depsRemote:!0,...e}}function vo(e,t){return t.map(r=>{const o=mo(e,r.nameOrAlias);return C(o,`Unable to preload ${r.nameOrAlias} as it is not included in ${!o&&ct({remoteInfo:o,remotes:e})}`),{remote:o,preloadConfig:Vt(r)}})}function No(e){return e?e.map(t=>t==="."?t:t.startsWith("./")?t.replace("./",""):t):[]}function Ve(e){return e instanceof Error?e.message.includes("timed out")||e.name.includes("Timeout"):!1}function V(e,t,r,o){return{url:t,status:r,resourceType:e.resourceType,initiator:e.initiator,id:e.id,error:o}}async function Ao(e,t,r,o){const n=e.moduleCache.get(r.name),s=r.entry;if(n!=null&&n.remoteEntryExports)return V(o,s,"cached");try{if(!await je({origin:e,remoteInfo:r,remoteEntryExports:n==null?void 0:n.remoteEntryExports,resourceContext:{...o,url:s}}))throw new Error(`Failed to load remoteEntry "${s}".`);return V(o,s,"success")}catch(a){return V(o,s,Ve(a)?"timeout":"error",a)}}function fe({host:e,remoteInfo:t,url:r,attrs:o,context:n,needDeleteLink:s}){return new Promise(a=>{const{link:c,needAttach:i}=fr({url:r,cb:()=>{a(V(n,r,i?"success":"cached"))},onErrorCallback:l=>{a(V(n,r,Ve(l)?"timeout":"error",l))},attrs:o,createLinkHook:(l,u)=>{const f=e.loaderHook.lifecycle.createLink.emit({url:l,attrs:u,remoteInfo:t,resourceContext:{...n,url:l}});return f instanceof HTMLLinkElement,f},needDeleteLink:s});i&&document.head.appendChild(c)})}function Mo({host:e,remoteInfo:t,url:r,attrs:o,context:n}){return new Promise(s=>{const{script:a,needAttach:c}=dt({url:r,cb:()=>{s(V(n,r,c?"success":"cached"))},onErrorCallback:i=>{s(V(n,r,Ve(i)?"timeout":"error",i))},attrs:o,createScriptHook:(i,l)=>{const u=e.loaderHook.lifecycle.createScript.emit({url:i,attrs:l,remoteInfo:t,resourceContext:{...n,url:i}});return u instanceof HTMLScriptElement,u},needDeleteScript:!0});c&&document.head.appendChild(a)})}function he(e,t){return{...e,resourceType:t}}function Wt(e,t,r,o=!0,n={initiator:"preloadRemote",id:e.name}){const{cssAssets:s,jsAssetsWithoutEntry:a,entryAssets:c}=r,i=[];if(t.options.inBrowser){if(c.forEach(f=>{const{moduleInfo:m}=f;i.push(Ao(t,e,m,he(n,"remoteEntry")))}),o){const f={rel:"preload",as:"style"};s.forEach(m=>{i.push(fe({host:t,remoteInfo:e,url:m,attrs:f,context:he(n,"css")}))})}else{const f={rel:"stylesheet",type:"text/css"};s.forEach(m=>{i.push(fe({host:t,remoteInfo:e,url:m,attrs:f,needDeleteLink:!1,context:he(n,"css")}))})}let l=Mo,u={fetchpriority:"high",type:"text/javascript"};o?(l=fe,u={rel:"preload",as:"script"}):Bt(e.type)&&(l=fe,u={rel:"modulepreload",fetchpriority:"high"}),a.forEach(f=>{i.push(l({host:t,remoteInfo:e,url:f,attrs:u,context:he(n,"js")}))})}return Promise.all(i)}function Po(e){if(!e||!("modules"in e)||!Array.isArray(e.modules))return;const t=e.modules.map(r=>r.moduleName).filter(Boolean);return t.length?t.join(","):void 0}function ko(e,t,r){const o=t,n=Array.isArray(e.shareScope)?e.shareScope:[e.shareScope];n.length||n.push("default"),n.forEach(a=>{o[a]||(o[a]={})});const s={version:e.version||"",shareScopeKeys:Array.isArray(e.shareScope)?n:e.shareScope||"default"};return Object.defineProperty(s,"shareScopeMap",{value:o,enumerable:!1}),{remoteEntryInitOptions:s,shareScope:o[n[0]],initScope:r??[]}}var tt=class{constructor({remoteInfo:e,host:t}){this.inited=!1,this.initing=!1,this.lib=void 0,this.remoteInfo=e,this.host=t}async getEntry(e){if(this.remoteEntryExports)return this.remoteEntryExports;const t=await je({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,resourceContext:{initiator:"loadRemote",id:Be(this.remoteInfo.name,e),resourceType:"remoteEntry"}});return C(t,`remoteEntryExports is undefined
|
|
8
|
-
${ct(this.remoteInfo)}`),this.remoteEntryExports=t,this.remoteEntryExports}async init(e,t,r,o){const n=await this.getEntry(o);if(this.inited)return await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:n,cached:!0,origin:this.host}),n;if(this.initPromise){try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:n,cached:!0,origin:this.host})}catch(s){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:n,error:s,cached:!0,origin:this.host}),s}return n}this.initing=!0,this.initPromise=(async()=>{await this.host.loaderHook.lifecycle.beforeInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,origin:this.host});const{remoteEntryInitOptions:s,shareScope:a,initScope:c}=ko(this.remoteInfo,this.host.shareScopeMap,r),i=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:a,remoteEntryInitOptions:s,initScope:c,remoteInfo:this.remoteInfo,origin:this.host});typeof(n==null?void 0:n.init)>"u"&&S(Pt,M,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName},void 0,D(this.host.options));try{await n.init(i.shareScope,i.initScope,i.remoteEntryInitOptions)}catch(l){S(Gt,M,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName,shareScope:this.remoteInfo.shareScope},`${l}`,D(this.host.options))}await this.host.hooks.lifecycle.initContainer.emit({...i,id:e,remoteSnapshot:t,remoteEntryExports:n}),this.inited=!0})();try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:n,origin:this.host})}catch(s){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:n,error:s,origin:this.host}),s}finally{this.initing=!1,this.initPromise=void 0}return n}async get(e,t,r,o){const{loadFactory:n=!0}=r||{loadFactory:!0},s=await this.init(e,o,void 0,t);this.lib=s,await this.host.loaderHook.lifecycle.beforeGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:s,origin:this.host});let a;try{const l=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:s,expose:t,moduleInfo:this.remoteInfo});a=typeof l=="function"?l:void 0,a||(a=await s.get(t)),a||S(xt,M,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,expose:t,requestId:e,availableExposes:Po(o)},void 0,D(this.host.options)),await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:s,moduleFactory:a,origin:this.host})}catch(l){throw await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:s,error:l,origin:this.host}),l}const c=Nr(this.remoteInfo.name,t),i=this.wraperFactory(a,c);if(!n)return i;await this.host.loaderHook.lifecycle.beforeExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:n,origin:this.host});try{const l=await i();return await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:n,exposeModule:l,origin:this.host}),l}catch(l){throw await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:n,error:l,origin:this.host}),l}}wraperFactory(e,t){function r(o,n){o&&typeof o=="object"&&Object.isExtensible(o)&&!Object.getOwnPropertyDescriptor(o,Symbol.for("mf_module_id"))&&Object.defineProperty(o,Symbol.for("mf_module_id"),{value:n,enumerable:!1})}return()=>{const o=e();return o instanceof Promise?o.then(n=>(r(n,t),n)):(r(o,t),o)}}},H=class{constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}applyPlugin(e,t){var o;C(vr(e),"Plugin configuration is invalid.");const r=e.name;C(r,"A name must be provided by the plugin."),this.registerPlugins[r]||(this.registerPlugins[r]=e,(o=e.apply)==null||o.call(e,t),Object.keys(this.lifecycle).forEach(n=>{const s=e[n];s&&this.lifecycle[n].on(s)}))}removePlugin(e){C(e,"A name is required.");const t=this.registerPlugins[e];C(t,`The plugin "${e}" is not registered.`),Object.keys(t).forEach(r=>{r!=="name"&&this.lifecycle[r].remove(t[r])})}},P=class{constructor(e){this.type="",this.listeners=new Set,e&&(this.type=e)}on(e){typeof e=="function"&&this.listeners.add(e)}once(e){const t=this;this.on(function r(...o){return t.remove(r),e.apply(null,o)})}emit(...e){let t;return this.listeners.size>0&&this.listeners.forEach(r=>{const o=r(...e);o!==void 0&&(t=o)}),t}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}},T=class extends P{emit(...e){let t;const r=Array.from(this.listeners);if(r.length>0){let o=0;const n=s=>s===!1?!1:o<r.length?Promise.resolve(r[o++].apply(null,e)).then(a=>a===void 0||e.length===1&&a===e[0]?n(s):n(a)):s;t=n()}return Promise.resolve(t)}};function qt(e,t){if(!He(t))return!1;if(e!==t){for(const r in e)if(!(r in t))return!1}return!0}var X=class extends P{constructor(e){super(),this.onerror=S,this.type=e}emit(e){He(e)||S(`The data for the "${this.type}" hook should be an object.`);for(const t of this.listeners)try{const r=t(e);if(r===void 0)continue;if(qt(e,r))e=r;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(r){oe(r),this.onerror(r)}return e}},x=class extends P{constructor(e){super(),this.onerror=S,this.type=e}emit(e){He(e)||S(`The response data for the "${this.type}" hook must be an object.`);const t=Array.from(this.listeners);if(t.length>0){let r=0;const o=s=>(oe(s),this.onerror(s),e),n=s=>{if(s!==void 0&&qt(e,s))e=s;else if(s!==void 0)return this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`),e;if(r<t.length)try{return Promise.resolve(t[r++](e)).then(n,o)}catch(a){return o(a)}return e};return Promise.resolve(n(e))}return Promise.resolve(e)}};const ee="Remote loading is disabled by experiments.optimization.disableRemote.";var Oo=class{constructor(){this.hooks=new H({})}formatAndRegisterRemote(){return[]}loadRemote(){throw new Error(ee)}preloadRemote(){throw new Error(ee)}registerRemotes(){throw new Error(ee)}getRemoteModuleAndOptions(){throw new Error(ee)}initRawContainer(){throw new Error(ee)}};function zt(e,t){const r=_t(t);r.url||S(Dt,M,{remoteName:e.name});let o=Pe(t,r.url);!U&&!o.startsWith("http")&&(o=`https:${o}`),e.type=r.type,e.entryGlobalName=r.globalName,e.entry=o,e.version=t.version,e.buildVersion=t.buildVersion}function Lo(){return{name:"snapshot-plugin",async afterResolve(e){const{remote:t,pkgNameOrAlias:r,expose:o,origin:n,remoteInfo:s,id:a}=e;if(!De(t)||!gt(t)){const{remoteSnapshot:c,globalSnapshot:i}=await n.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:t,id:Be(t.name,o)});zt(s,c);const l={remote:t,preloadConfig:{nameOrAlias:r,exposes:[o],resourceCategory:"sync",share:!1,depsRemote:!1}},u=await n.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:n,preloadOptions:l,remoteInfo:s,remote:t,remoteSnapshot:c,globalSnapshot:i});return u&&Wt(s,n,u,!1,{initiator:"loadRemote",id:a}).catch(()=>{}),{...e,remoteSnapshot:c}}return e}}}function Co(e){const t=e.split(":");return t.length===1?{name:t[0],version:void 0}:t.length===2?{name:t[0],version:t[1]}:{name:t[1],version:t[2]}}function Kt(e,t,r,o,n={},s){const{value:a}=W(e,ne(t)),c=s||a;if(c&&!lt(c)&&(r(c,t,o),c.remotesInfo)){const i=Object.keys(c.remotesInfo);for(const l of i){if(n[l])continue;n[l]=!0;const u=Co(l),f=c.remotesInfo[l];Kt(e,{name:u.name,version:f.matchedVersion},r,!1,n,void 0)}}}const ve=(e,t)=>document.querySelector(`${e}[${e==="link"?"href":"src"}="${t}"]`);function Fo(e,t,r,o,n){const s=[],a=[],c=[],i=new Set,l=new Set,{options:u}=e,{preloadConfig:f}=t,{depsRemote:m}=f;if(Kt(o,r,(d,p,E)=>{var I;let y;if(E)y=f;else if(Array.isArray(m)){const w=m.find($=>$.nameOrAlias===p.name||$.nameOrAlias===p.alias);if(!w)return;y=Vt(w)}else if(m===!0)y=f;else return;const R=Pe(d,_t(d).url);R&&c.push({name:p.name,moduleInfo:{name:p.name,entry:R,type:"remoteEntryType"in d?d.remoteEntryType:"global",entryGlobalName:"globalName"in d?d.globalName:p.name,shareScope:"",version:"version"in d?d.version:void 0},url:R});let g="modules"in d?d.modules:[];const _=No(y.exposes);_.length&&"modules"in d&&(g=(I=d==null?void 0:d.modules)==null?void 0:I.reduce((w,$)=>((_==null?void 0:_.indexOf($.moduleName))!==-1&&w.push($),w),[]));function b(w){const $=w.map(k=>Pe(d,k));return y.filter?$.filter(y.filter):$}if(g){const w=g.length;for(let $=0;$<w;$++){const k=g[$],we=`${p.name}/${k.moduleName}`;e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:k.moduleName==="."?p.name:we,name:p.name,remoteSnapshot:d,preloadConfig:y,remote:p,origin:e}),!Or(we)&&(y.resourceCategory==="all"?(s.push(...b(k.assets.css.async)),s.push(...b(k.assets.css.sync)),a.push(...b(k.assets.js.async)),a.push(...b(k.assets.js.sync))):y.resourceCategory==="sync"&&(s.push(...b(k.assets.css.sync)),a.push(...b(k.assets.js.sync))),Lr(we))}}},!0,{},n),n.shared&&n.shared.length>0){const d=(p,E)=>{const{shared:y}=Re(e.shareScopeMap,E.sharedName,p,e.sharedHandler.hooks.lifecycle.resolveShare)||{};y&&typeof y.lib=="function"&&(E.assets.js.sync.forEach(R=>{i.add(R)}),E.assets.css.sync.forEach(R=>{l.add(R)}))};n.shared.forEach(p=>{var R;const E=(R=u.shared)==null?void 0:R[p.sharedName];if(!E)return;const y=p.version?E.find(g=>g.version===p.version):E;y&&Rt(y).forEach(g=>{d(g,p)})})}const h=a.filter(d=>!i.has(d)&&!ve("script",d));return{cssAssets:s.filter(d=>!l.has(d)&&!ve("link",d)),jsAssetsWithoutEntry:h,entryAssets:c.filter(d=>!ve("script",d.url))}}const Do=function(){return{name:"generate-preload-assets-plugin",async generatePreloadAssets(e){const{origin:t,preloadOptions:r,remoteInfo:o,remote:n,globalSnapshot:s,remoteSnapshot:a}=e;return U?De(n)&>(n)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:n.name,url:n.entry,moduleInfo:{name:o.name,entry:n.entry,type:o.type||"global",entryGlobalName:"",shareScope:""}}]}:(zt(o,a),Fo(t,r,o,s,a)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}};function Jt(e,t){const r=ye({name:t.name,version:t.options.version}),o=r&&"remotesInfo"in r&&r.remotesInfo&&W(r.remotesInfo,e.name).value;return o&&o.matchedVersion?{hostGlobalSnapshot:r,globalSnapshot:qe(),remoteSnapshot:ye({name:e.name,version:o.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:qe(),remoteSnapshot:ye({name:e.name,version:"version"in e?e.version:void 0})}}var Ho=class{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new H({beforeLoadRemoteSnapshot:new T("beforeLoadRemoteSnapshot"),loadSnapshot:new x("loadGlobalSnapshot"),loadRemoteSnapshot:new x("loadRemoteSnapshot"),afterLoadSnapshot:new x("afterLoadSnapshot")}),this.manifestLoading=be.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}async loadRemoteSnapshotInfo({moduleInfo:e,id:t,initiator:r="loadRemote"}){const{options:o}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:o,moduleInfo:e,origin:this.HostInstance});let n=ye({name:this.HostInstance.options.name,version:this.HostInstance.options.version});n||(n={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},Pr({[this.HostInstance.options.name]:n})),n&&"remotesInfo"in n&&!W(n.remotesInfo,e.name).value&&("version"in e||"entry"in e)&&(n.remotesInfo={...n==null?void 0:n.remotesInfo,[e.name]:{matchedVersion:"version"in e?e.version:e.entry}});const{hostGlobalSnapshot:s,remoteSnapshot:a,globalSnapshot:c}=this.getGlobalRemoteInfo(e),{remoteSnapshot:i,globalSnapshot:l}=await this.hooks.lifecycle.loadSnapshot.emit({options:o,moduleInfo:e,hostGlobalSnapshot:s,remoteSnapshot:a,globalSnapshot:c});let u,f;if(i)if(lt(i)){const m=U?i.remoteEntry:i.ssrRemoteEntry||i.remoteEntry||"",h=await this.loadManifestSnapshot(m,e,{},{initiator:r,id:t||e.name}),d=ze({...e,entry:m},h);u=h,f=d}else{const{remoteSnapshot:m}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:i,from:"global"});u=m,f=l}else if(De(e)){const m=await this.loadManifestSnapshot(e.entry,e,{},{initiator:r,id:t||e.name}),h=ze(e,m);u=m,f=h}else S(Ct,M,{remoteName:e.name,remoteVersion:e.version,hostName:this.HostInstance.options.name,globalSnapshot:JSON.stringify(l)},void 0,D(this.HostInstance.options));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:t,host:this.HostInstance,options:o,moduleInfo:e,remoteSnapshot:u}),{remoteSnapshot:u,globalSnapshot:f}}getGlobalRemoteInfo(e){return Jt(e,this.HostInstance)}async getManifestJson(e,t,r,o){return(async()=>{const s=K(t);let a=this.manifestCache.get(e);if(a)return a;try{let i=await this.loaderHook.lifecycle.fetch.emit(e,{},s,o?{...o,url:e,resourceType:"manifest"}:void 0);(!i||!(i instanceof Response))&&(i=await fetch(e,{})),a=await i.json()}catch(i){a=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:i,from:"runtime",lifecycle:"afterResolve",remote:s,origin:this.HostInstance}),a||(delete this.manifestLoading[e],S(kt,M,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name},`${i}`,D(this.HostInstance.options)))}const c=[!a.metaData&&"metaData",!a.exposes&&"exposes",!a.shared&&"shared"].filter(Boolean);return c.length>0&&await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:new Error(`"${e}" is not a valid federation manifest for remote "${t.name}". Missing required fields: ${c.join(", ")}.`),from:"runtime",lifecycle:"afterResolve",remote:s,origin:this.HostInstance}),c.length>0&&S(Ht,M,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name,missingFields:c.join(",")},void 0,D(this.HostInstance.options)),this.manifestCache.set(e,a),a})()}async loadManifestSnapshot(e,t,r,o){const n=async()=>{const s=await this.getManifestJson(e,t,r,o),a=ir(s,{version:e}),{remoteSnapshot:c}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:t,manifestJson:s,remoteSnapshot:a,manifestUrl:e,from:"manifest"});return c};return this.manifestLoading[e]||(this.manifestLoading[e]=n().then(s=>s)),this.manifestLoading[e]}},xo=class{constructor(){this.hooks=new H({})}},Go=class{constructor(e){this.hooks=new H({beforeRegisterShare:new X("beforeRegisterShare"),afterResolve:new x("afterResolve"),beforeLoadShare:new x("beforeLoadShare"),loadShare:new T,afterLoadShare:new P("afterLoadShare"),errorLoadShare:new P("errorLoadShare"),resolveShare:new X("resolveShare"),initContainerShareScopeMap:new X("initContainerShareScopeMap")}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}emitAfterLoadShare({lifecycle:e,pkgName:t,shareInfo:r,selectedShared:o}){try{this.hooks.lifecycle.afterLoadShare.emit({pkgName:t,shareInfo:r,selectedShared:o,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,origin:this.host})}catch(n){oe(n)}}emitErrorLoadShare({lifecycle:e,pkgName:t,shareInfo:r,error:o,recovered:n}){try{this.hooks.lifecycle.errorLoadShare.emit({pkgName:t,shareInfo:r,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,origin:this.host,error:o,recovered:n})}catch(s){oe(s)}}registerShared(e,t){const{newShareInfos:r,allShareInfos:o}=Nt(e,t);return Object.keys(r).forEach(n=>{r[n].forEach(s=>{s.scope.forEach(a=>{var c;this.hooks.lifecycle.beforeRegisterShare.emit({origin:this.host,pkgName:n,shared:s}),(c=this.shareScopeMap[a])!=null&&c[n]||this.setShared({pkgName:n,lib:s.lib,get:s.get,loaded:s.loaded||!!s.lib,shared:s,from:t.name})})})}),{newShareInfos:r,allShareInfos:o}}async loadShare(e,t){const{host:r}=this,o=Qe({pkgName:e,extraOptions:t,shareInfos:r.options.shared});let n=o;try{o!=null&&o.scope&&await Promise.all(o.scope.map(async i=>{await Promise.all(this.initializeSharing(i,{strategy:o.strategy}))})),n=(await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:o,shared:r.options.shared,origin:r})).shareInfo,C(n,`Cannot find shared "${e}" in host "${r.options.name}". Ensure the shared config for "${e}" is declared in the federation plugin options and the host has been initialized before loading shares.`);const s=n,{shared:a,useTreesShaking:c}=Re(this.shareScopeMap,e,n,this.hooks.lifecycle.resolveShare)||{};if(a){const i=ue(a,c);if(i.lib)return z(i,r.options.name),this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:s,selectedShared:a}),i.lib;if(i.loading&&!i.loaded){const l=await i.loading;return i.loaded=!0,i.lib||(i.lib=l),z(i,r.options.name),this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:s,selectedShared:a}),l}else{const u=(async()=>{const m=await i.get();return z(i,r.options.name),i.loaded=!0,i.lib=m,m})();this.setShared({pkgName:e,loaded:!1,shared:a,from:r.options.name,lib:null,loading:u,treeShaking:c?i:void 0});const f=await u;return this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:s,selectedShared:a}),f}}else{if(t!=null&&t.customShareInfo)return this.emitErrorLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:s,recovered:!0}),!1;const i=se(s.treeShaking),l=ue(s,i),f=(async()=>{const h=await l.get();l.lib=h,l.loaded=!0,z(l,r.options.name);const{shared:d,useTreesShaking:p}=Re(this.shareScopeMap,e,s,this.hooks.lifecycle.resolveShare)||{};if(d){const E=ue(d,p);E.lib=h,E.loaded=!0,d.from=s.from}return h})();this.setShared({pkgName:e,loaded:!1,shared:s,from:r.options.name,lib:null,loading:f,treeShaking:i?l:void 0});const m=await f;return this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:s,selectedShared:s}),m}}catch(s){throw this.emitErrorLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:n,error:s}),s}}initializeSharing(e=ae,t){const{host:r}=this,o=t==null?void 0:t.from,n=t==null?void 0:t.strategy;let s=t==null?void 0:t.initScope;const a=[];if(o!=="build"){const{initTokens:m}=this;s||(s=[]);let h=m[e];if(h||(h=m[e]={from:this.host.name}),s.indexOf(h)>=0)return a;s.push(h)}const c=this.shareScopeMap,i=r.options.name;c[e]||(c[e]={});const l=c[e],u=(m,h)=>{var g;const{version:d,eager:p}=h;l[m]=l[m]||{};const E=l[m],y=E[d]&&ue(E[d]),R=!!(y&&("eager"in y&&y.eager||"shareConfig"in y&&((g=y.shareConfig)!=null&&g.eager)));(!y||y.strategy!=="loaded-first"&&!y.loaded&&(!p!=!R?p:i>E[d].from))&&(E[d]=h)},f=async m=>{const{module:h}=await r.remoteHandler.getRemoteModuleAndOptions({id:m});let d;try{d=await h.getEntry()}catch(p){if(d=await r.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:m,error:p,from:"runtime",lifecycle:"beforeLoadShare",remote:h.remoteInfo,origin:r}),!d)return}finally{d!=null&&d.init&&!h.initing&&(h.remoteEntryExports=d,await h.init(void 0,void 0,s))}};return Object.keys(r.options.shared).forEach(m=>{r.options.shared[m].forEach(h=>{h.scope.includes(e)&&u(m,h)})}),(r.options.shareStrategy==="version-first"||n==="version-first")&&r.options.remotes.forEach(m=>{m.shareScope===e&&a.push(f(m.name))}),a}loadShareSync(e,t){const{host:r}=this,o=Qe({pkgName:e,extraOptions:t,shareInfos:r.options.shared});try{o!=null&&o.scope&&o.scope.forEach(s=>{this.initializeSharing(s,{strategy:o.strategy})});const{shared:n}=Re(this.shareScopeMap,e,o,this.hooks.lifecycle.resolveShare)||{};if(n){if(typeof n.lib=="function")return z(n,r.options.name),n.loaded||(n.loaded=!0,n.from===r.options.name&&(o.loaded=!0)),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:o,selectedShared:n}),n.lib;if(typeof n.get=="function"){const s=n.get();if(!(s instanceof Promise))return z(n,r.options.name),this.setShared({pkgName:e,loaded:!0,from:r.options.name,lib:s,shared:n}),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:o,selectedShared:n}),s}}if(o.lib)return o.loaded||(o.loaded=!0),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:o,selectedShared:o}),o.lib;if(o.get){const s=o.get();return s instanceof Promise&&S((t==null?void 0:t.from)==="build"?Lt:Le,M,{hostName:r.options.name,sharedPkgName:e},void 0,D(r.options)),o.lib=s,this.setShared({pkgName:e,loaded:!0,from:r.options.name,lib:o.lib,shared:o}),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:o,selectedShared:o}),o.lib}S(Le,M,{hostName:r.options.name,sharedPkgName:e},void 0,D(r.options))}catch(n){throw this.emitErrorLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:o,error:n}),n}}initShareScopeMap(e,t,r={}){const{host:o}=this;this.shareScopeMap[e]=t,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:t,options:o.options,origin:o,scopeName:e,hostShareScopeMap:r.hostShareScopeMap})}setShared({pkgName:e,shared:t,from:r,lib:o,loading:n,loaded:s,get:a,treeShaking:c}){const{version:i,scope:l="default",...u}=t,f=Array.isArray(l)?l:[l],m=h=>{const d=(E,y,R)=>{R&&!E[y]&&(E[y]=R)},p=c?h.treeShaking:h;d(p,"loaded",s),d(p,"loading",n),d(p,"get",a)};f.forEach(h=>{this.shareScopeMap[h]||(this.shareScopeMap[h]={}),this.shareScopeMap[h][e]||(this.shareScopeMap[h][e]={}),this.shareScopeMap[h][e][i]||(this.shareScopeMap[h][e][i]={version:i,scope:[h],...u,lib:o});const d=this.shareScopeMap[h][e][i];m(d),r&&d.from!==r&&(d.from=r)})}_setGlobalShareScopeMap(e){const t=At(),r=e.id||e.name;r&&!t[r]&&(t[r]=this.shareScopeMap)}},Uo=class{constructor(){this.shareScopeMap={},this.hooks=new H({afterResolve:new x("afterResolve")})}registerShared(){return{newShareInfos:{},allShareInfos:{}}}loadShare(){throw new Error("Shared dependency loading is disabled by experiments.optimization.disableShared.")}loadShareSync(){throw new Error("Shared dependency loading is disabled by experiments.optimization.disableShared.")}initializeSharing(){return[]}initShareScopeMap(e,t){this.shareScopeMap[e]=t}},Bo=class{constructor(e){this.hooks=new H({beforeRegisterRemote:new X("beforeRegisterRemote"),registerRemote:new X("registerRemote"),beforeRequest:new x("beforeRequest"),afterMatchRemote:new T("afterMatchRemote"),onLoad:new T("onLoad"),afterLoadRemote:new T("afterLoadRemote"),handlePreloadModule:new P("handlePreloadModule"),errorLoadRemote:new T("errorLoadRemote"),beforePreloadRemote:new T("beforePreloadRemote"),generatePreloadAssets:new T("generatePreloadAssets"),afterPreloadRemote:new T("afterPreloadRemote"),loadEntry:new T}),this.host=e,this.idToRemoteMap={}}formatAndRegisterRemote(e,t){return(t.remotes||[]).reduce((r,o)=>(this.registerRemote(o,r,{force:!1}),r),e.remotes)}setIdToRemoteMap(e,t){const{remote:r,expose:o}=t,{name:n,alias:s}=r;if(this.idToRemoteMap[e]={name:r.name,expose:o},s&&e.startsWith(n)){const a=e.replace(n,s);this.idToRemoteMap[a]={name:r.name,expose:o};return}if(s&&e.startsWith(s)){const a=e.replace(s,n);this.idToRemoteMap[a]={name:r.name,expose:o}}}async loadRemote(e,t){const{host:r}=this,o=et(r.options.remotes,e);let n=e,s=o==null?void 0:o.expose,a=o?K(o.remote):void 0,c;try{const{loadFactory:i=!0}=t||{loadFactory:!0},{module:l,moduleOptions:u,remoteMatchInfo:f}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:m,remote:h,expose:d,id:p,remoteSnapshot:E}=f;n=p,s=d,a=K(h);const y=await l.get(p,d,t,E),R=await this.hooks.lifecycle.onLoad.emit({id:p,pkgNameOrAlias:m,expose:d,exposeModule:i?y:void 0,exposeModuleFactory:i?void 0:y,remote:h,options:u,moduleInstance:l,origin:r});return this.setIdToRemoteMap(e,f),c={id:n,expose:s,remote:a,options:t,origin:r},typeof R=="function"?R:y}catch(i){const{from:l="runtime"}=t||{from:"runtime"};let u;try{u=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:i,from:l,lifecycle:"onLoad",expose:s,remote:a,origin:r})}catch(f){throw c={id:n,expose:s,remote:a,options:t,error:f,origin:r},f}if(!u)throw c={id:n,expose:s,remote:a,options:t,error:i,origin:r},i;return c={id:n,expose:s,remote:a,options:t,error:i,origin:r,recovered:!0},u}finally{c&&await this.hooks.lifecycle.afterLoadRemote.emit(c)}}async preloadRemote(e){const{host:t}=this,r=[];await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:t.options,origin:t});const o=vo(t.options.remotes,e),n=c=>{const{preloadConfig:i,remote:l}=c,u=i.exposes||[];return u.length?u.map(f=>({ops:{...c,preloadConfig:{...i,exposes:[f]}},id:Be(l.name,f)})):[{ops:c,id:`${l.name}/*`}]};let s;await Promise.all(o.flatMap(n).map(async c=>{const{ops:i,id:l}=c,{remote:u,preloadConfig:f}=i,m=K(u);try{const{globalSnapshot:h,remoteSnapshot:d}=await t.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:u,id:l,initiator:"preloadRemote"}),p=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:t,preloadOptions:i,remote:u,remoteInfo:m,globalSnapshot:h,remoteSnapshot:d});if(!p)return;const E=await Wt(m,t,p,!0,{initiator:"preloadRemote",id:l});r.push({remote:u,remoteInfo:m,preloadConfig:f,id:l,results:E})}catch(h){r.push({remote:u,remoteInfo:m,preloadConfig:f,id:l,results:[{url:m.entry,status:"error",resourceType:/\.json(?:$|[?#])/i.test(m.entry)?"manifest":"remoteEntry",initiator:"preloadRemote",id:l,error:h}]})}}));const a=r.flatMap(c=>c.results.filter(i=>i.status==="error"||i.status==="timeout"));if(a.length>0&&(s=new Error(`preloadRemote failed to load ${a.length} resource(s).`),Object.assign(s,{results:r,failedResults:a})),await this.hooks.lifecycle.afterPreloadRemote.emit({preloadOps:e,options:t.options,origin:t,results:r,error:s}),s)throw s}registerRemotes(e,t){const{host:r}=this;e.forEach(o=>{this.registerRemote(o,r.options.remotes,{force:t==null?void 0:t.force})})}initRawContainer(e,t,r){const{host:o}=this,n=new tt({host:o,remoteInfo:K({name:e,entry:t})});return n.remoteEntryExports=r,o.moduleCache.set(e,n),n}async getRemoteModuleAndOptions(e){const{host:t}=this,{id:r}=e;let o;try{o=await this.hooks.lifecycle.beforeRequest.emit({id:r,options:t.options,origin:t})}catch(h){if(o=await this.hooks.lifecycle.errorLoadRemote.emit({id:r,options:t.options,origin:t,from:"runtime",error:h,lifecycle:"beforeRequest"}),!o)throw h}const{id:n}=o,s=et(t.options.remotes,n);if(!s)try{S(Ot,M,{hostName:t.options.name,requestId:n},void 0,D(t.options))}catch(h){throw await this.hooks.lifecycle.afterMatchRemote.emit({id:n,options:t.options,error:h,origin:t}),h}const{remote:a}=s,c=K(a);await this.hooks.lifecycle.afterMatchRemote.emit({id:n,...s,options:t.options,remoteInfo:c,origin:t});const i=await t.sharedHandler.hooks.lifecycle.afterResolve.emit({id:n,...s,options:t.options,origin:t,remoteInfo:c}),{remote:l,expose:u}=i;C(l&&u,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${n}.`);let f=t.moduleCache.get(l.name);const m={host:t,remoteInfo:c};return f||(f=new tt(m),t.moduleCache.set(l.name,f)),{module:f,moduleOptions:m,remoteMatchInfo:i}}registerRemote(e,t,r){const{host:o}=this,n=()=>{if(e.alias){const a=t.find(c=>{var i;return e.alias&&(c.name.startsWith(e.alias)||((i=c.alias)==null?void 0:i.startsWith(e.alias)))});C(!a,`The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${a&&a.name} name or alias`)}"entry"in e&&U&&typeof window<"u"&&!e.entry.startsWith("http")&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||(e.shareScope=ae),e.type||(e.type=vt)};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:o});const s=t.find(a=>a.name===e.name);if(!s)n(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:o});else{const a=[`The remote "${e.name}" is already registered.`,"Please note that overriding it may cause unexpected errors."];r!=null&&r.force&&(this.removeRemote(s),n(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:o}),at(a.join(" ")))}}removeRemote(e){var t;try{const{host:r}=this,{name:o}=e,n=r.options.remotes.findIndex(i=>i.name===o);n!==-1&&r.options.remotes.splice(n,1);const s=W(N.__FEDERATION__.moduleInfo,ne(e)).key;delete N.__FEDERATION__.moduleInfo[s],"entry"in e&&(r.snapshotHandler.manifestCache.delete(e.entry),delete be.__FEDERATION__.__MANIFEST_LOADING__[e.entry]);const{hostGlobalSnapshot:a}=Jt(e,r);if(a){const i=a&&"remotesInfo"in a&&a.remotesInfo&&W(a.remotesInfo,e.name).key;i&&delete a.remotesInfo[i]}const c=r.moduleCache.get(e.name);if(c){const i=c.remoteInfo,l=i.entryGlobalName;N[l]&&((t=Object.getOwnPropertyDescriptor(N,l))!=null&&t.configurable?delete N[l]:N[l]=void 0);const u=Ce(c.remoteInfo);J[u]&&delete J[u];let f=i.buildVersion?it(i.name,i.buildVersion):i.name;const m=N.__FEDERATION__.__INSTANCES__.findIndex(h=>i.buildVersion?h.options.id===f:h.name===f);if(m!==-1){const h=N.__FEDERATION__.__INSTANCES__[m];f=h.options.id||f;const d=At();let p=!0;const E=[];Object.keys(d).forEach(y=>{const R=d[y];R&&Object.keys(R).forEach(g=>{const _=R[g];_&&Object.keys(_).forEach(b=>{const I=_[b];I&&Object.keys(I).forEach(w=>{const $=I[w];$&&typeof $=="object"&&$.from===i.name&&($.loaded||$.loading?($.useIn=$.useIn.filter(k=>k!==i.name),$.useIn.length?p=!1:E.push([y,g,b,w])):E.push([y,g,b,w]))})})})}),p&&(h.shareScopeMap={},delete d[f]),E.forEach(([y,R,g,_])=>{var b,I,w;(w=(I=(b=d[y])==null?void 0:b[R])==null?void 0:I[g])==null||delete w[_]}),N.__FEDERATION__.__INSTANCES__.splice(m,1)}r.moduleCache.delete(e.name)}}catch(r){Oe.error(`removeRemote failed: ${r instanceof Error?r.message:String(r)}`)}}};const jo=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN=="boolean"?!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN:!0,Ne=typeof FEDERATION_OPTIMIZE_NO_REMOTE=="boolean"?!FEDERATION_OPTIMIZE_NO_REMOTE:!0,rt=typeof FEDERATION_OPTIMIZE_NO_SHARED=="boolean"?!FEDERATION_OPTIMIZE_NO_SHARED:!0;var Vo=class{constructor(e){this.hooks=new H({beforeInit:new X("beforeInit"),init:new P,beforeInitContainer:new x("beforeInitContainer"),initContainer:new x("initContainer")}),this.version="2.8.2",this.moduleCache=new Map,this.loaderHook=new H({getModuleInfo:new P,createScript:new P,createLink:new P,fetch:new T,loadEntryError:new T,afterLoadEntry:new T("afterLoadEntry"),beforeInitRemote:new T("beforeInitRemote"),afterInitRemote:new T("afterInitRemote"),beforeGetExpose:new T("beforeGetExpose"),afterGetExpose:new T("afterGetExpose"),beforeExecuteFactory:new T("beforeExecuteFactory"),afterExecuteFactory:new T("afterExecuteFactory"),getModuleFactory:new T}),this.bridgeHook=new H({beforeBridgeRender:new P,afterBridgeRender:new P,beforeBridgeDestroy:new P,afterBridgeDestroy:new P});const t=Ne&&jo?[Lo(),Do()]:[],r={id:Io(),name:e.name,plugins:t,remotes:[],shared:{},inBrowser:U};this.name=e.name,this.options=r,this.snapshotHandler=Ne?new Ho(this):new xo,this.sharedHandler=rt?new Go(this):new Uo,this.remoteHandler=Ne?new Bo(this):new Oo,this.shareScopeMap=this.sharedHandler.shareScopeMap,this.registerPlugins([...r.plugins,...e.plugins||[]]),this.options=this.formatOptions(r,e)}initOptions(e){e.name&&e.name!==this.options.name&&S(Et(Ft,M)),this.registerPlugins(e.plugins);const t=this.formatOptions(this.options,e);return this.options=t,t}async loadShare(e,t){return this.sharedHandler.loadShare(e,t)}loadShareSync(e,t){return this.sharedHandler.loadShareSync(e,t)}initializeSharing(e=ae,t){return this.sharedHandler.initializeSharing(e,t)}initRawContainer(e,t,r){return this.remoteHandler.initRawContainer(e,t,r)}async loadRemote(e,t){return this.remoteHandler.loadRemote(e,t)}async preloadRemote(e){return this.remoteHandler.preloadRemote(e)}initShareScopeMap(e,t,r={}){this.sharedHandler.initShareScopeMap(e,t,r)}formatOptions(e,t){const r=rt?Nt(e,t).allShareInfos:{},{userOptions:o,options:n}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:t,options:e,shareInfo:r}),s=this.remoteHandler.formatAndRegisterRemote(n,o),{allShareInfos:a}=this.sharedHandler.registerShared(n,o),c=[...n.plugins];o.plugins&&o.plugins.forEach(l=>{c.includes(l)||c.push(l)});const i={...e,...t,plugins:c,remotes:s,shared:a,id:o.id||e.id};return this.hooks.lifecycle.init.emit({origin:this,options:i}),i}registerPlugins(e){const t=$o(e,this);this.options.plugins=this.options.plugins.reduce((r,o)=>(o&&r&&!r.find(n=>n.name===o.name)&&r.push(o),r),t||[])}registerRemotes(e,t){return this.remoteHandler.registerRemotes(e,t)}registerShared(e){this.sharedHandler.registerShared(this.options,{...this.options,shared:e})}};let Wo=null;function Zt(e){return Wo}Ar(Vo);function Xt(e,t){const r=o=>{if(!o.startsWith("/"))return o;const n=o.length>1&&o.endsWith("/"),s=`${t}/${o}`.replace(/\/+/g,"/").replace(/\/$/,"")||"/";return n?`${s}/`:s};return e.map(o=>{const n={...o,path:r(o.path)};return typeof o.redirect=="string"?n.redirect=r(o.redirect):o.redirect&&typeof o.redirect=="object"&&"path"in o.redirect&&typeof o.redirect.path=="string"&&(n.redirect={...o.redirect,path:r(o.redirect.path)}),o.children&&o.children.length>0&&(n.children=Xt(o.children,t)),n})}function qo(e){const t=e.replace(/\/+$/,""),r=s=>s.startsWith("/")&&s!==t&&!s.startsWith(t+"/"),o=s=>`${t}${s}`.replace(/\/+/g,"/"),n=s=>typeof s=="string"?r(s)?o(s):s:"path"in s&&typeof s.path=="string"&&r(s.path)?{...s,path:o(s.path)}:s;return s=>{const a=s.push.bind(s),c=s.replace.bind(s),i=s.resolve.bind(s);s.push=l=>a(n(l)),s.replace=l=>c(n(l)),s.resolve=(l,...u)=>i(n(l),...u)}}function zo(e){const{router:t,basename:r,memoryRoute:o,hashRoute:n}=e,s=t.getRoutes().sort((h,d)=>h.path.split("/").filter(p=>p).length-d.path.split("/").filter(p=>p).length),a=new Map,c=new Set;s.forEach(h=>{const d=a.get(h.path)||[];d.push(h),a.set(h.path,d)});const i=(h,d)=>`${h}/${d}`.replace(/\/+/g,"/").replace(/\/$/,"")||"/",l=(h,d="")=>{if(!h.children||h.children.length===0)return h;for(let p=0;p<h.children.length;p++){const E=h.children[p],y=i(d,E.path),g=(a.get(y)||[]).find(_=>!c.has(_)&&_!==h&&(E.name==null||_.name===E.name));if(g){const _={...g,path:E.path};h.children[p]=_,c.add(g),l(_,y)}}return h};let u=[];for(const h of s)if(!c.has(h)){const d=l(h,h.path);c.add(h),u.push(d)}let f,m;return o?f=de.createMemoryHistory(r):n?(f=de.createWebHashHistory(),r&&(u=Xt(u,r),m=qo(r))):f=de.createWebHistory(r),{history:f,routes:u,patchRouter:m}}function Ko(e){const t=new Map,r=Zt();return()=>({__APP_VERSION__:"2.8.2",async render(o){var d,p,E,y,R,g;F.debug("createBridgeComponent render Info",o);const{moduleName:n,dom:s,basename:a,memoryRoute:c,hashRoute:i,...l}=o,u=Qt.createApp(e.rootComponent,l);t.set(s,u);const f=await((E=(p=(d=r==null?void 0:r.bridgeHook)==null?void 0:d.lifecycle)==null?void 0:p.beforeBridgeRender)==null?void 0:E.emit(o)),m=f&&typeof f=="object"&&(f!=null&&f.extraProps)?f==null?void 0:f.extraProps:{},h=e.appOptions({app:u,basename:a,memoryRoute:c,hashRoute:i,...l,...m});if(h!=null&&h.router){const{history:_,routes:b,patchRouter:I}=zo({router:h.router,basename:o.basename,memoryRoute:o.memoryRoute,hashRoute:o.hashRoute}),w=de.createRouter({...h.router.options,history:_,routes:b});I&&I(w),h.afterRouterCreate&&h.afterRouterCreate(w),F.debug("createBridgeComponent render router info>>>",{moduleName:n,router:w}),c&&await w.push(c.entryPath),u.use(w)}u.mount(s),(g=(R=(y=r==null?void 0:r.bridgeHook)==null?void 0:y.lifecycle)==null?void 0:R.afterBridgeRender)==null||g.emit(o)},destroy(o){var s,a,c,i,l,u;F.debug("createBridgeComponent destroy Info",o);const n=t.get(o==null?void 0:o.dom);(c=(a=(s=r==null?void 0:r.bridgeHook)==null?void 0:s.lifecycle)==null?void 0:a.beforeBridgeDestroy)==null||c.emit(o),n==null||n.unmount(),(u=(l=(i=r==null?void 0:r.bridgeHook)==null?void 0:i.lifecycle)==null?void 0:l.afterBridgeDestroy)==null||u.emit(o)}})}function Jo(){const e=new PopStateEvent("popstate",{state:window.history.state});window.dispatchEvent(e)}const Zo=v.defineComponent({name:"RemoteApp",props:{moduleName:String,basename:String,memoryRoute:Object,hashRoute:Boolean,providerInfo:Function,rootAttrs:Object},inheritAttrs:!1,setup(e){const t=v.ref(null),r=v.ref(null),o=v.ref(""),n=v.ref(!1),s=v.ref(!1),a=v.ref(!1),c=Fe.useRoute(),i=Zt(),l=v.useAttrs(),u=()=>({name:e.moduleName,dom:t.value,basename:e.basename,memoryRoute:e.memoryRoute,hashRoute:e.hashRoute}),f=async()=>{var y,R,g,_,b,I,w;if(!t.value||n.value)return;const d=(y=e.providerInfo)==null?void 0:y.call(e);r.value=d;let p={...l,moduleName:e.moduleName,dom:t.value,basename:e.basename,memoryRoute:e.memoryRoute,hashRoute:e.hashRoute};F.debug("createRemoteAppComponent LazyComponent render >>>",p);const E=await((_=(g=(R=i==null?void 0:i.bridgeHook)==null?void 0:R.lifecycle)==null?void 0:g.beforeBridgeRender)==null?void 0:_.emit(p))||{};p={...p,...E.extraProps},d.render(p),n.value=!0,(w=(I=(b=i==null?void 0:i.bridgeHook)==null?void 0:b.lifecycle)==null?void 0:I.afterBridgeRender)==null||w.emit(p)},m=()=>{var E,y,R,g,_,b;const d=r.value;if(!d||!n.value)return;F.debug("createRemoteAppComponent LazyComponent destroy >>>",{...e});const p=u();(R=(y=(E=i==null?void 0:i.bridgeHook)==null?void 0:E.lifecycle)==null?void 0:y.beforeBridgeDestroy)==null||R.emit(p),d.destroy({dom:t.value}),r.value=null,n.value=!1,(b=(_=(g=i==null?void 0:i.bridgeHook)==null?void 0:g.lifecycle)==null?void 0:_.afterBridgeDestroy)==null||b.emit(p)},h=v.watch(()=>c==null?void 0:c.path,d=>{s.value&&o.value!==""&&o.value!==d&&(F.debug("createRemoteAppComponent dispatchPopstateEnv >>>",{...e,pathname:c.path}),Jo()),o.value=d});return v.onMounted(()=>{s.value=!0,f()}),v.onActivated(async()=>{s.value=!0,a.value&&(a.value=!1,await v.nextTick(),f())}),v.onDeactivated(()=>{s.value=!1,a.value=!0,m()}),v.onBeforeUnmount(()=>{h(),m()}),()=>v.createVNode("div",v.mergeProps(e.rootAttrs||{},{ref:t}),null)}});function Yt(e){return v.defineAsyncComponent({__APP_VERSION__:"2.8.2",...e.asyncComponentOptions,loader:async()=>{var i,l;const t=Fe.useRoute();let r="/";const o=(l=(i=t==null?void 0:t.matched)==null?void 0:i[0])==null?void 0:l.path;o&&(o.endsWith("/:pathMatch(.*)*")?r=o.replace("/:pathMatch(.*)*",""):r=t.matched[0].path);const n=(e==null?void 0:e.export)||"default";F.debug("createRemoteAppComponent LazyComponent create >>>",{basename:r,info:e});const s=await e.loader(),a=s&&s[Symbol.for("mf_module_id")],c=s[n];if(F.debug("createRemoteAppComponent LazyComponent loadRemote info >>>",{moduleName:a,module:s,exportName:n,basename:r,route:t}),n in s&&typeof c=="function")return{render(){return v.h(Zo,{moduleName:a,providerInfo:c,basename:r,rootAttrs:e.rootAttrs,memoryRoute:e.memoryRoute,hashRoute:e.hashRoute})}};throw new Error("module not found")}})}function Xo(e){return F.warn("createRemoteComponent is deprecated, please use createRemoteAppComponent instead!"),Yt(e)}exports.createBridgeComponent=Ko;exports.createRemoteAppComponent=Yt;exports.createRemoteComponent=Xo;
|
|
7
|
+
`)};function Pr(e,t,r,o,n,s){return o(_t(e,t,r,n))}const W="[ Federation Runtime ]",Ce=dt(W);function L(e,t,r,o,n){e||I(t)}function I(e,t,r,o,n){if(t!==void 0)return Pr(e,t,r??{},i=>{throw new Error(`${W}: ${i}`)},o);const s=e;throw s instanceof Error?(s.message.startsWith(W)||(s.message=`${W}: ${s.message}`),s):new Error(`${W}: ${s}`)}function se(e){e instanceof Error&&(e.message.startsWith(W)||(e.message=`${W}: ${e.message}`)),Ce.warn(e)}function kr(e,t){return e.findIndex(r=>r===t)===-1&&e.push(t),e}function ie(e){return"version"in e&&e.version?`${e.name}:${e.version}`:"entry"in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function Fe(e){return typeof e.entry<"u"}function Rt(e){return!e.entry.includes(".json")}function xe(e){return e&&typeof e=="object"}const Lr=Object.prototype.toString;function St(e){return Lr.call(e)==="[object Object]"}function bt(e){return Array.isArray(e)?e:[e]}function wt(e){const t={url:"",type:"global",globalName:""};return B||at()||!("ssrRemoteEntry"in e)?"remoteEntry"in e?{url:e.remoteEntry,type:e.remoteEntryType,globalName:e.globalName}:t:"ssrRemoteEntry"in e?{url:e.ssrRemoteEntry||t.url,type:e.ssrRemoteEntryType||t.type,globalName:e.globalName}:t}const Or=(e,t)=>{let r;return e.endsWith("/")?r=e.slice(0,-1):r=e,t.startsWith(".")&&(t=t.slice(1)),r=r+t,r},Cr=2e3,T=typeof globalThis=="object"?globalThis:window,O=(()=>{try{return document.defaultView}catch{return T}})(),we=O;function ye(e,t,r){Object.defineProperty(e,t,{value:r,configurable:!1,writable:!0})}function Ee(e,t){return Object.hasOwnProperty.call(e,t)}Ee(T,"__GLOBAL_LOADING_REMOTE_ENTRY__")||ye(T,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});const j=T.__GLOBAL_LOADING_REMOTE_ENTRY__;function It(e){var t,r,o,n,s,i,a;Ee(e,"__VMOK__")&&!Ee(e,"__FEDERATION__")&&ye(e,"__FEDERATION__",e.__VMOK__),Ee(e,"__FEDERATION__")||(ye(e,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map,__PRELOADED_ASSETS__:new Set}),ye(e,"__VMOK__",e.__FEDERATION__)),(t=e.__FEDERATION__).__GLOBAL_PLUGIN__??(t.__GLOBAL_PLUGIN__=[]),(r=e.__FEDERATION__).__INSTANCES__??(r.__INSTANCES__=[]),(o=e.__FEDERATION__).moduleInfo??(o.moduleInfo={}),(n=e.__FEDERATION__).__SHARE__??(n.__SHARE__={}),(s=e.__FEDERATION__).__MANIFEST_LOADING__??(s.__MANIFEST_LOADING__={}),(i=e.__FEDERATION__).__PRELOADED_MAP__??(i.__PRELOADED_MAP__=new Map),(a=e.__FEDERATION__).__PRELOADED_ASSETS__??(a.__PRELOADED_ASSETS__=new Set)}It(T);It(O);function Dr(e,t=ke()){t&&(T.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,T.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="2.9.0")}function q(e,t){if(typeof t=="string"){if(e[t])return{value:e[t],key:t};{const r=Object.keys(e);for(const o of r){const[n,s]=o.split(":"),i=`${n}:${t}`,a=e[i];if(a)return{value:a,key:i}}return{value:void 0,key:t}}}else I(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`)}const ze=()=>O.__FEDERATION__.moduleInfo,Hr=(e,t)=>{const r=q(t,ie(e)).value;if(r&&!r.version&&"version"in e&&e.version&&(r.version=e.version),r)return r;if("version"in e&&e.version){const{version:o,...n}=e,s=ie(n),i=q(O.__FEDERATION__.moduleInfo,s).value;if((i==null?void 0:i.version)===o)return i}},ge=e=>Hr(e,O.__FEDERATION__.moduleInfo),Ke=(e,t)=>{const r=ie(e);return O.__FEDERATION__.moduleInfo[r]=t,O.__FEDERATION__.moduleInfo},Fr=e=>(O.__FEDERATION__.moduleInfo={...O.__FEDERATION__.moduleInfo,...e},()=>{const t=Object.keys(e);for(const r of t)delete O.__FEDERATION__.moduleInfo[r]}),Ge=(e,t)=>{const r=t||`__FEDERATION_${e}:custom__`;return{remoteEntryKey:r,entryExports:T[r]}},xr=()=>O.__FEDERATION__.__GLOBAL_PLUGIN__,Gr=e=>T.__FEDERATION__.__PRELOADED_MAP__.get(e),Ur=e=>T.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),Br=e=>T.__FEDERATION__.__PRELOADED_ASSETS__.has(e),jr=e=>{const t=T.__FEDERATION__.__PRELOADED_ASSETS__;if(t.add(e),t.size>Cr){const r=t.values().next().value;r!==void 0&&t.delete(r)}},Je="[0-9A-Za-z-]+",Ue=`(?:\\+(${Je}(?:\\.${Je})*))`,ne="0|[1-9]\\d*",_e="[0-9]+",$t="\\d*[a-zA-Z-][a-zA-Z0-9-]*",Ze=`(?:${_e}|${$t})`,Wr=`(?:-?(${Ze}(?:\\.${Ze})*))`,Xe=`(?:${ne}|${$t})`,vt=`(?:-(${Xe}(?:\\.${Xe})*))`,ve=`${ne}|x|X|\\*`,Q=`[v=\\s]*(${ve})(?:\\.(${ve})(?:\\.(${ve})(?:${vt})?${Ue}?)?)?`,Vr=`^\\s*(${Q})\\s+-\\s+(${Q})\\s*$`,qr=`[v=\\s]*${`(${_e})\\.(${_e})\\.(${_e})`}${Wr}?${Ue}?`,Be="((?:<|>)?=?)",zr=`(\\s*)${Be}\\s*(${qr}|${Q})`,Tt="(?:~>?)",Kr=`(\\s*)${Tt}\\s+`,Nt="(?:\\^)",Jr=`(\\s*)${Nt}\\s+`,Zr="(<|>)?=?\\s*\\*",Xr=`^${Nt}${Q}$`,Yr=`v?${`(${ne})\\.(${ne})\\.(${ne})`}${vt}?${Ue}?`,Qr=`^${Tt}${Q}$`,eo=`^${Be}\\s*${Q}$`,to=`^${Be}\\s*(${Yr})$|^$`,ro="^\\s*>=\\s*0.0.0\\s*$";function C(e){return new RegExp(e)}function M(e){return!e||e.toLowerCase()==="x"||e==="*"}function At(...e){return t=>e.reduce((r,o)=>o(r),t)}function Ye(e){return e.match(C(to))}function Qe(e,t,r,o){const n=`${e}.${t}.${r}`;return o?`${n}-${o}`:n}function oo(e){return e.replace(C(Vr),(t,r,o,n,s,i,a,c,l,u,f,d)=>(M(o)?r="":M(n)?r=`>=${o}.0.0`:M(s)?r=`>=${o}.${n}.0`:r=`>=${r}`,M(l)?c="":M(u)?c=`<${Number(l)+1}.0.0-0`:M(f)?c=`<${l}.${Number(u)+1}.0-0`:d?c=`<=${l}.${u}.${f}-${d}`:c=`<=${c}`,`${r} ${c}`.trim()))}function no(e){return e.replace(C(zr),"$1$2$3")}function so(e){return e.replace(C(Kr),"$1~")}function io(e){return e.replace(C(Jr),"$1^")}function ao(e){return e.trim().split(/\s+/).map(t=>t.replace(C(Xr),(r,o,n,s,i)=>M(o)?"":M(n)?`>=${o}.0.0 <${Number(o)+1}.0.0-0`:M(s)?o==="0"?`>=${o}.${n}.0 <${o}.${Number(n)+1}.0-0`:`>=${o}.${n}.0 <${Number(o)+1}.0.0-0`:i?o==="0"?n==="0"?`>=${o}.${n}.${s}-${i} <${o}.${n}.${Number(s)+1}-0`:`>=${o}.${n}.${s}-${i} <${o}.${Number(n)+1}.0-0`:`>=${o}.${n}.${s}-${i} <${Number(o)+1}.0.0-0`:o==="0"?n==="0"?`>=${o}.${n}.${s} <${o}.${n}.${Number(s)+1}-0`:`>=${o}.${n}.${s} <${o}.${Number(n)+1}.0-0`:`>=${o}.${n}.${s} <${Number(o)+1}.0.0-0`)).join(" ")}function co(e){return e.trim().split(/\s+/).map(t=>t.replace(C(Qr),(r,o,n,s,i)=>M(o)?"":M(n)?`>=${o}.0.0 <${Number(o)+1}.0.0-0`:M(s)?`>=${o}.${n}.0 <${o}.${Number(n)+1}.0-0`:i?`>=${o}.${n}.${s}-${i} <${o}.${Number(n)+1}.0-0`:`>=${o}.${n}.${s} <${o}.${Number(n)+1}.0-0`)).join(" ")}function lo(e){return e.split(/\s+/).map(t=>t.trim().replace(C(eo),(r,o,n,s,i,a)=>{const c=M(n),l=c||M(s),u=l||M(i);return o==="="&&u&&(o=""),a="",c?o===">"||o==="<"?"<0.0.0-0":"*":o&&u?(l&&(s=0),i=0,o===">"?(o=">=",l?(n=Number(n)+1,s=0,i=0):(s=Number(s)+1,i=0)):o==="<="&&(o="<",l?n=Number(n)+1:s=Number(s)+1),o==="<"&&(a="-0"),`${o+n}.${s}.${i}${a}`):l?`>=${n}.0.0${a} <${Number(n)+1}.0.0-0`:u?`>=${n}.${s}.0${a} <${n}.${Number(s)+1}.0-0`:r})).join(" ")}function uo(e){return e.trim().replace(C(Zr),"")}function fo(e){return e.trim().replace(C(ro),"")}function Re(e,t){return e=Number(e)||e,t=Number(t)||t,e>t?1:e===t?0:-1}function ho(e,t){const{preRelease:r}=e,{preRelease:o}=t;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 n=0,s=r.length;n<=s;n++){const i=r[n],a=o[n];if(i!==a)return i===void 0&&a===void 0?0:i?a?Re(i,a):-1:1}return 0}function fe(e,t){return Re(e.major,t.major)||Re(e.minor,t.minor)||Re(e.patch,t.patch)||ho(e,t)}function Te(e,t){return e.version===t.version}function mo(e,t){switch(e.operator){case"":case"=":return Te(e,t);case">":return fe(e,t)<0;case">=":return Te(e,t)||fe(e,t)<0;case"<":return fe(e,t)>0;case"<=":return Te(e,t)||fe(e,t)>0;case void 0:return!0;default:return!1}}function po(e){return At(ao,co,lo,uo)(e)}function yo(e){return At(oo,no,so,io)(e.trim()).split(/\s+/).join(" ")}function oe(e,t){if(!e)return!1;const r=Ye(e);if(!r)return!1;const[,o,,n,s,i,a]=r,c={operator:o,version:Qe(n,s,i,a),major:n,minor:s,patch:i,preRelease:a==null?void 0:a.split(".")},l=t.split("||");for(const u of l){const f=u.trim();if(!f||f==="*"||f==="x")return!0;try{const d=yo(f);if(!d.trim())return!0;const m=d.split(" ").map(y=>po(y)).join(" ");if(!m.trim())return!0;const h=m.split(/\s+/).map(y=>fo(y)).filter(Boolean);if(h.length===0)continue;let p=!0;for(const y of h){const g=Ye(y);if(!g){p=!1;break}const[,_,,E,R,S,b]=g;if(!mo({operator:_,version:Qe(E,R,S,b),major:E,minor:R,patch:S,preRelease:b==null?void 0:b.split(".")},c)){p=!1;break}}if(p)return!0}catch(d){console.error(`[semver] Error processing range part "${f}":`,d);continue}}return!1}const le="default",Mt="global";function Eo(e,t,r,o){var s,i;let n;return"get"in e?n=e.get:"lib"in e?n=()=>Promise.resolve(e.lib):n=()=>Promise.resolve(()=>{I(`Cannot get shared "${r}" from "${t}": neither "get" nor "lib" is provided in the share config.`)}),(s=e.shareConfig)!=null&&s.eager&&((i=e.treeShaking)!=null&&i.mode)&&I(`Invalid shared config for "${r}" from "${t}": cannot use both "eager: true" and "treeShaking.mode" simultaneously. Choose one strategy.`),{deps:[],useIn:[],from:t,loading:null,...e,shareConfig:{requiredVersion:`^${e.version}`,singleton:!1,eager:!1,strictVersion:!1,...e.shareConfig},get:n,loaded:e!=null&&e.loaded||"lib"in e?!0:void 0,version:e.version??"0",scope:Array.isArray(e.scope)?e.scope:[e.scope??"default"],strategy:(e.strategy??o)||"version-first",treeShaking:e.treeShaking?{...e.treeShaking,mode:e.treeShaking.mode??"server-calc",status:e.treeShaking.status??Pe.UNKNOWN,useIn:[]}:void 0}}function Pt(e,t){const r=t.shared||{},o=t.name,n=Object.keys(r).reduce((i,a)=>{const c=bt(r[a]);return i[a]=i[a]||[],c.forEach(l=>{i[a].push(Eo(l,o,a,t.shareStrategy))}),i},{}),s={...e.shared};return Object.keys(n).forEach(i=>{s[i]?n[i].forEach(a=>{s[i].find(c=>c.version===a.version)||s[i].push(a)}):s[i]=n[i]}),{allShareInfos:s,newShareInfos:n}}function ae(e,t){if(!e)return!1;const{status:r,mode:o}=e;return r===Pe.NO_USE?!1:r===Pe.CALCULATED?!0:o==="runtime-infer"?t?_o(e,t):!0:!1}function V(e,t){const r=o=>{if(!Number.isNaN(Number(o))){const n=o.split(".");let s=o;for(let i=0;i<3-n.length;i++)s+=".0";return s}return o};return!!oe(r(e),`<=${r(t)}`)}const ce=(e,t)=>{const r=t||function(o,n){return V(o,n)};return Object.keys(e).reduce((o,n)=>!o||r(o,n)||o==="0"?n:o,0)},be=e=>!!e.loaded||typeof e.lib=="function",go=e=>!!e.loading,_o=(e,t)=>{if(!e||!t)return!1;const{usedExports:r}=e;return r?!!t.every(o=>r.includes(o)):!1};function Ro(e,t,r,o){const n=e[t][r];let s="",i=ae(o);const a=function(c,l){return i?n[c].treeShaking?n[l].treeShaking?!be(n[c].treeShaking)&&V(c,l):!1:!0:!be(n[c])&&V(c,l)};if(i){if(s=ce(e[t][r],a),s)return{version:s,useTreesShaking:i};i=!1}return{version:ce(e[t][r],a),useTreesShaking:i}}const K=e=>be(e)||go(e);function So(e,t,r,o){const n=e[t][r];let s="",i=ae(o);const a=function(c,l){if(i){if(!n[c].treeShaking)return!0;if(!n[l].treeShaking)return!1;if(K(n[l].treeShaking))return K(n[c].treeShaking)?!!V(c,l):!0;if(K(n[c].treeShaking))return!1}return K(n[l])?K(n[c])?!!V(c,l):!0:K(n[c])?!1:V(c,l)};if(i){if(s=ce(e[t][r],a),s)return{version:s,useTreesShaking:i};i=!1}return{version:ce(e[t][r],a),useTreesShaking:i}}function bo(e){return e==="loaded-first"?So:Ro}function Se(e,t,r,o,n){if(!e)return;const{shareConfig:s,scope:i=le,strategy:a,treeShaking:c}=r,l=Array.isArray(i)?i:[i];for(const u of l)if(s&&e[u]&&e[u][t]){const{requiredVersion:f}=s,{version:d,useTreesShaking:m}=bo(a)(e,u,t,c),h=()=>{const y=e[u][t][d];if(s.singleton){if(typeof f=="string"&&!oe(d,f)){const g=`Version ${d} from ${d&&y.from} of shared singleton module ${t} does not satisfy the requirement of ${r.from} which needs ${f})`;s.strictVersion?I(g):se(g)}return{shared:y,useTreesShaking:m}}else{if(f===!1||f==="*")return{shared:y,useTreesShaking:m};if(oe(d,f))return{shared:y,useTreesShaking:m};const g=ae(c);if(g){for(const[_,E]of Object.entries(e[u][t]))if(ae(E.treeShaking,c==null?void 0:c.usedExports)&&oe(_,f))return{shared:E,useTreesShaking:g}}for(const[_,E]of Object.entries(e[u][t]))if(oe(_,f))return{shared:E,useTreesShaking:!1}}},p={shareScopeMap:e,scope:u,pkgName:t,version:d,GlobalFederation:we.__FEDERATION__,shareInfo:r,resolver:h,loadContext:n};return(o.emit(p)||p).resolver()}}function kt(){return we.__FEDERATION__.__SHARE__}function et(e){const{pkgName:t,extraOptions:r,shareInfos:o}=e,n=c=>{if(!c)return;const l={};return c.forEach(f=>{l[f.version]=f}),l[ce(l,function(f,d){return!be(l[f])&&V(f,d)})]},s=(r==null?void 0:r.resolver)??n,i=c=>c!==null&&typeof c=="object"&&!Array.isArray(c),a=(...c)=>{const l={};for(const u of c)if(u)for(const[f,d]of Object.entries(u)){const m=l[f];i(m)&&i(d)?l[f]=a(m,d):d!==void 0&&(l[f]=d)}return l};return a(s(o[t]),r==null?void 0:r.customShareInfo)}const J=(e,t)=>{e.useIn||(e.useIn=[]),kr(e.useIn,t)};function he(e,t){return t&&e.treeShaking?e.treeShaking:e}function je(e,t){return!t||t==="."?e:`${e}/${t.replace(/^\.\//,"")}`}function tt(e,t){for(const r of e){const o=t.startsWith(r.name);let n=t.replace(r.name,"");if(o){if(n.startsWith("/")){const a=r.name;return n=`.${n}`,{pkgNameOrAlias:a,expose:n,remote:r}}else if(n==="")return{pkgNameOrAlias:r.name,expose:".",remote:r}}const s=r.alias&&t.startsWith(r.alias);let i=r.alias&&t.replace(r.alias,"");if(r.alias&&s){if(i&&i.startsWith("/")){const a=r.alias;return i=`.${i}`,{pkgNameOrAlias:a,expose:i,remote:r}}else if(i==="")return{pkgNameOrAlias:r.alias,expose:".",remote:r}}}}function wo(e,t){for(const r of e)if(t===r.name||r.alias&&t===r.alias)return r}const Lt="RUNTIME-001",Ot="RUNTIME-002",Ct="RUNTIME-003",Dt="RUNTIME-004",Ht="RUNTIME-005",De="RUNTIME-006",Ft="RUNTIME-007",Ie="RUNTIME-008",Io="RUNTIME-009",xt="RUNTIME-010",Gt="RUNTIME-011",$o="RUNTIME-012",Ut="RUNTIME-013",Bt="RUNTIME-014",jt="RUNTIME-015",P={[Lt]:"Failed to get remoteEntry exports.",[Ot]:'The remote entry interface does not contain "init"',[Ct]:"Failed to get manifest.",[Dt]:"Failed to locate remote.",[Ht]:"Invalid loadShareSync function call from bundler runtime",[De]:"Invalid loadShareSync function call from runtime",[Ft]:"Failed to get remote snapshot.",[Ie]:"Failed to load script resources.",[Io]:"Please call createInstance first.",[xt]:'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.',[Gt]:"The remoteEntry URL is missing from the remote snapshot.",[$o]:'The getter for the shared module is not a function. This may be caused by setting "shared.import: false" without the host providing the corresponding lib.',[Ut]:"The manifest is not a valid Module Federation manifest.",[Bt]:"The remote does not expose the requested module.",[jt]:"Remote container initialization failed."};({...P});const Wt=".then(callbacks[0]).catch(callbacks[1])",rt=new WeakMap,vo=["Failed to fetch dynamically imported module","Importing a module script failed","error loading dynamically imported module"];function To(e){return e instanceof TypeError?vo.some(t=>e.message.includes(t)):!1}function Vt(e){return e==="esm"||e==="module"}async function No({entry:e,remoteEntryExports:t,name:r,getEntryUrl:o}){return new Promise((n,s)=>{const i=c=>{if(To(c)){const l=c instanceof Error?c.message:String(c);try{I(Ie,P,{remoteName:r,resourceUrl:a},l)}catch(u){s(u);return}}s(c)},a=o?o(e):e;try{t?n(t):typeof FEDERATION_ALLOW_NEW_FUNCTION<"u"?new Function("callbacks",`import("${a}")${Wt}`)([n,i]):import(a).then(n).catch(i)}catch(c){I(`Failed to load ESM entry from "${a}". ${c instanceof Error?c.message:String(c)}`)}})}async function Ao({entry:e,remoteEntryExports:t}){return new Promise((r,o)=>{try{t?r(t):typeof __system_context__>"u"?System.import(e).then(r).catch(o):new Function("callbacks",`System.import("${e}")${Wt}`)([r,o])}catch(n){I(`Failed to load SystemJS entry from "${e}". ${n instanceof Error?n.message:String(n)}`)}})}function qt(e,t,r){const{remoteEntryKey:o,entryExports:n}=Ge(e,t);return n||I(Lt,P,{remoteName:e,remoteEntryUrl:r,remoteEntryKey:o}),n}async function Mo({name:e,globalName:t,entry:r,remoteInfo:o,loaderHook:n,getEntryUrl:s,resourceContext:i}){const{entryExports:a}=Ge(e,t);if(a)return a;const c=s?s(r):r;return _r(c,{attrs:{},createScriptHook:(l,u)=>{const f=n.lifecycle.createScript.emit({url:l,attrs:u,remoteInfo:o,resourceContext:i?{...i,url:l}:void 0});if(f&&(f instanceof HTMLScriptElement||"script"in f||"timeout"in f))return f}}).then(()=>qt(e,t,r),l=>{const u=l instanceof Error?l.message:String(l);I(Ie,P,{remoteName:e,resourceUrl:c},u)})}async function Po({remoteInfo:e,remoteEntryExports:t,loaderHook:r,getEntryUrl:o,resourceContext:n}){const{entry:s,entryGlobalName:i,name:a,type:c}=e;return Vt(c)?No({entry:s,remoteEntryExports:t,name:a,getEntryUrl:o}):c==="system"?Ao({entry:s,remoteEntryExports:t}):Mo({entry:s,globalName:i,name:a,remoteInfo:e,loaderHook:r,getEntryUrl:o,resourceContext:n})}async function ko({remoteInfo:e,loaderHook:t,resourceContext:r}){const{entry:o,entryGlobalName:n,name:s,type:i}=e,{entryExports:a}=Ge(s,n);return a||br(o,{attrs:{name:s,globalName:n,type:i},loaderHook:{createScriptHook:(c,l={})=>{const u=t.lifecycle.createScript.emit({url:c,attrs:l,remoteInfo:e,resourceContext:r?{...r,url:c}:void 0});if(u&&"url"in u)return u}}}).then(()=>qt(s,n,o)).catch(c=>{I(`Failed to load Node.js entry for remote "${s}" from "${o}". ${c instanceof Error?c.message:String(c)}`)})}function zt(e){const{entry:t,name:r}=e;return ct(r,t)}async function We(e){const{origin:t,remoteEntryExports:r,remoteInfo:o,getEntryUrl:n,resourceContext:s,_inErrorHandling:i=!1}=e,a=zt(o);if(r)return await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:o,remoteEntryExports:r,resourceContext:s,cached:!0}),r;if(!j[a]){const l=t.remoteHandler.hooks.lifecycle.loadEntry,u=t.loaderHook;j[a]=l.emit({origin:t,loaderHook:u,remoteInfo:o,remoteEntryExports:r,resourceContext:s}).then(f=>f||((typeof ENV_TARGET<"u"?ENV_TARGET==="web":B)?Po({remoteInfo:o,remoteEntryExports:r,loaderHook:u,getEntryUrl:n,resourceContext:s}):ko({remoteInfo:o,loaderHook:u,resourceContext:s}))).then(async f=>(await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:o,remoteEntryExports:f,resourceContext:s}),f)).catch(async f=>{const d=f instanceof Error&&f.message.includes("ScriptExecutionError");if(f instanceof Error&&f.message.includes(Ie)&&!d&&!i){const m=p=>We({...p,_inErrorHandling:!0}),h=await t.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:m,origin:t,remoteInfo:o,remoteEntryExports:r,globalLoading:j,uniqueKey:a});if(h)return await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:o,remoteEntryExports:h,resourceContext:s,error:f,recovered:!0}),h}throw await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:o,resourceContext:s,error:f}),f}),rt.set(j[a],t)}const c=j[a];if(rt.get(c)!==t)try{const l=await c;return await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:o,remoteEntryExports:l,resourceContext:s}),l}catch(l){throw await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:o,resourceContext:s,error:l}),l}return c}function Z(e){return{...e,entry:"entry"in e?e.entry:"",type:e.type||Mt,entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||le}}function Lo(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function Oo(e){const t=new Map;return[...e||[],...xr()].forEach(r=>{r&&(L(St(r),"Plugin configuration is invalid."),L(r.name,"A name must be provided by the plugin."),t.has(r.name)||t.set(r.name,r))}),Array.from(t.values())}function Co(e,t){return t===void 0?e:{...t,name:e.name,version:e.version}}function Do(e,t){const r=new Map;t.options.plugins.forEach(n=>{n&&r.set(n.name,n)});const o=[t.hooks,t.remoteHandler.hooks,t.sharedHandler.hooks,t.snapshotHandler.hooks,t.loaderHook,t.bridgeHook];return Oo(e).forEach(n=>{var i;if(r.set(n.name,n),t.hooks.registerPlugins[n.name])return;const s=Co(n,(i=n.apply)==null?void 0:i.call(n,t));o.forEach(a=>{a.applyPlugin(s)})}),Array.from(r.values())}function Ho(e){return{name:e.name,alias:e.alias,entry:"entry"in e?e.entry:void 0,version:"version"in e?e.version:void 0,type:e.type,entryGlobalName:e.entryGlobalName,shareScope:e.shareScope}}function H(e){var r,o,n,s,i,a;const t={};for(const[c,l]of Object.entries(e.shared)){const u=l[0];u&&(t[c]={version:u.version,singleton:(r=u.shareConfig)==null?void 0:r.singleton,requiredVersion:((o=u.shareConfig)==null?void 0:o.requiredVersion)===!1?!1:(n=u.shareConfig)==null?void 0:n.requiredVersion,eager:u.eager,strictVersion:(s=u.shareConfig)==null?void 0:s.strictVersion})}return{project:{name:e.name,mfRole:((i=e.remotes)==null?void 0:i.length)>0?"host":"unknown"},mfConfig:{name:e.name,remotes:((a=e.remotes)==null?void 0:a.map(Ho))??[],shared:t}}}function Kt(e){return{resourceCategory:"sync",share:!0,depsRemote:!0,recordPreloadedAssets:!0,...e}}function Fo(e,t){return t.map(r=>{const o=wo(e,r.nameOrAlias);return L(o,`Unable to preload ${r.nameOrAlias} as it is not included in ${!o&&ut({remoteInfo:o,remotes:e})}`),{remote:o,preloadConfig:Kt(r)}})}function xo(e){return e?e.map(t=>t==="."?t:t.startsWith("./")?t.replace("./",""):t):[]}function Ve(e){return e instanceof Error?e.message.includes("timed out")||e.name.includes("Timeout"):!1}function U(e,t,r,o){return{url:t,status:r,resourceType:e.resourceType,initiator:e.initiator,id:e.id,error:o}}function Ne(e,t,r,o){return r?Br(t)?Promise.resolve(U(e,t,"cached")):(jr(t),o()):o()}async function Go(e,t,r,o){const n=e.moduleCache.get(r.name),s=r.entry;if(n!=null&&n.remoteEntryExports)return U(o,s,"cached");try{if(!await We({origin:e,remoteInfo:r,remoteEntryExports:n==null?void 0:n.remoteEntryExports,resourceContext:{...o,url:s}}))throw new Error(`Failed to load remoteEntry "${s}".`);return U(o,s,"success")}catch(i){return U(o,s,Ve(i)?"timeout":"error",i)}}function de({host:e,remoteInfo:t,url:r,attrs:o,context:n,needDeleteLink:s}){return new Promise(i=>{const{link:a,needAttach:c}=gr({url:r,cb:()=>{i(U(n,r,c?"success":"cached"))},onErrorCallback:l=>{i(U(n,r,Ve(l)?"timeout":"error",l))},attrs:o,createLinkHook:(l,u)=>{const f=e.loaderHook.lifecycle.createLink.emit({url:l,attrs:u,remoteInfo:t,resourceContext:{...n,url:l}});return f instanceof HTMLLinkElement,f},needDeleteLink:s});c&&document.head.appendChild(a)})}function Uo({host:e,remoteInfo:t,url:r,attrs:o,context:n}){return new Promise(s=>{const{script:i,needAttach:a}=pt({url:r,cb:()=>{s(U(n,r,a?"success":"cached"))},onErrorCallback:c=>{s(U(n,r,Ve(c)?"timeout":"error",c))},attrs:o,createScriptHook:(c,l)=>{const u=e.loaderHook.lifecycle.createScript.emit({url:c,attrs:l,remoteInfo:t,resourceContext:{...n,url:c}});return u instanceof HTMLScriptElement,u},needDeleteScript:!0});a&&document.head.appendChild(i)})}function me(e,t){return{...e,resourceType:t}}function Jt(e,t,r,o=!0,n={initiator:"preloadRemote",id:e.name},s=!0){const{cssAssets:i,jsAssetsWithoutEntry:a,entryAssets:c}=r,l=[];if(t.options.inBrowser){if(c.forEach(d=>{const{moduleInfo:m}=d;l.push(Go(t,e,m,me(n,"remoteEntry")))}),o){const d={rel:"preload",as:"style"};i.forEach(m=>{const h=me(n,"css");l.push(Ne(h,m,s,()=>de({host:t,remoteInfo:e,url:m,attrs:d,context:h})))})}else{const d={rel:"stylesheet",type:"text/css"};i.forEach(m=>{const h=me(n,"css");l.push(Ne(h,m,s,()=>de({host:t,remoteInfo:e,url:m,attrs:d,needDeleteLink:!1,context:h})))})}let u=Uo,f={fetchpriority:"high",type:"text/javascript"};o?(u=de,f={rel:"preload",as:"script"}):Vt(e.type)&&(u=de,f={rel:"modulepreload",fetchpriority:"high"}),a.forEach(d=>{const m=me(n,"js");l.push(Ne(m,d,s,()=>u({host:t,remoteInfo:e,url:d,attrs:f,context:m})))})}return Promise.all(l)}function Bo(e){if(!e||!("modules"in e)||!Array.isArray(e.modules))return;const t=e.modules.map(r=>r.moduleName).filter(Boolean);return t.length?t.join(","):void 0}function jo(e,t,r){const o=t,n=Array.isArray(e.shareScope)?e.shareScope:[e.shareScope];n.length||n.push("default"),n.forEach(i=>{o[i]||(o[i]={})});const s={version:e.version||"",shareScopeKeys:Array.isArray(e.shareScope)?n:e.shareScope||"default"};return Object.defineProperty(s,"shareScopeMap",{value:o,enumerable:!1}),{remoteEntryInitOptions:s,shareScope:o[n[0]],initScope:r??[]}}var ot=class{constructor({remoteInfo:e,host:t}){this.inited=!1,this.initing=!1,this.lib=void 0,this.remoteInfo=e,this.host=t}async getEntry(e,t){const r=t||{initiator:"loadRemote",id:je(this.remoteInfo.name,e),resourceType:"remoteEntry",url:this.remoteInfo.entry,expose:e},o=await We({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,resourceContext:r});return L(o,`remoteEntryExports is undefined
|
|
8
|
+
${ut(this.remoteInfo)}`),this.remoteEntryExports=o,this.remoteEntryExports}async init(e,t,r,o,n){const s=await this.getEntry(o,n);if(this.inited)return await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,cached:!0,origin:this.host}),s;if(this.initPromise){try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,cached:!0,origin:this.host})}catch(i){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,error:i,cached:!0,origin:this.host}),i}return s}this.initing=!0,this.initPromise=(async()=>{await this.host.loaderHook.lifecycle.beforeInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,origin:this.host});const{remoteEntryInitOptions:i,shareScope:a,initScope:c}=jo(this.remoteInfo,this.host.shareScopeMap,r),l=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:a,remoteEntryInitOptions:i,initScope:c,remoteInfo:this.remoteInfo,origin:this.host});typeof(s==null?void 0:s.init)>"u"&&I(Ot,P,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName},void 0,H(this.host.options));try{await s.init(l.shareScope,l.initScope,l.remoteEntryInitOptions)}catch(u){I(jt,P,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName,shareScope:this.remoteInfo.shareScope},`${u}`,H(this.host.options))}await this.host.hooks.lifecycle.initContainer.emit({...l,id:e,remoteSnapshot:t,remoteEntryExports:s}),this.inited=!0})();try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,origin:this.host})}catch(i){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,error:i,origin:this.host}),i}finally{this.initing=!1,this.initPromise=void 0}return s}async get(e,t,r,o){const{loadFactory:n=!0}=r||{loadFactory:!0},s=await this.init(e,o,void 0,t);this.lib=s,await this.host.loaderHook.lifecycle.beforeGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:s,origin:this.host});let i;try{const l=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:s,expose:t,moduleInfo:this.remoteInfo});i=typeof l=="function"?l:void 0,i||(i=await s.get(t)),i||I(Bt,P,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,expose:t,requestId:e,availableExposes:Bo(o)},void 0,H(this.host.options)),await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:s,moduleFactory:i,origin:this.host})}catch(l){throw await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:s,error:l,origin:this.host}),l}const a=Or(this.remoteInfo.name,t),c=this.wraperFactory(i,a);if(!n)return c;await this.host.loaderHook.lifecycle.beforeExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:n,origin:this.host});try{const l=await c();return await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:n,exposeModule:l,origin:this.host}),l}catch(l){throw await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:n,error:l,origin:this.host}),l}}wraperFactory(e,t){function r(o,n){o&&typeof o=="object"&&Object.isExtensible(o)&&!Object.getOwnPropertyDescriptor(o,Symbol.for("mf_module_id"))&&Object.defineProperty(o,Symbol.for("mf_module_id"),{value:n,enumerable:!1})}return()=>{const o=e();return o instanceof Promise?o.then(n=>(r(n,t),n)):(r(o,t),o)}}},F=class{constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}applyPlugin(e){L(St(e),"Plugin configuration is invalid.");const t=e.name;L(t,"A name must be provided by the plugin."),this.registerPlugins[t]||(this.registerPlugins[t]=e,this.lifecycleKeys.forEach(r=>{const o=e[r];o&&this.lifecycle[r].on(o)}))}removePlugin(e){L(e,"A name is required.");const t=this.registerPlugins[e];L(t,`The plugin "${e}" is not registered.`),this.lifecycleKeys.forEach(r=>{const o=t[r];o&&this.lifecycle[r].remove(o)}),delete this.registerPlugins[e]}},A=class{constructor(e){this.type="",this.listeners=new Set,e&&(this.type=e)}on(e){typeof e=="function"&&this.listeners.add(e)}once(e){const t=this;this.on(function r(...o){return t.remove(r),e.apply(null,o)})}emit(...e){let t;return this.listeners.size>0&&this.listeners.forEach(r=>{const o=r(...e);o!==void 0&&(t=o)}),t}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}},v=class extends A{emit(...e){let t;const r=Array.from(this.listeners);if(r.length>0){let o=0;const n=s=>s===!1?!1:o<r.length?Promise.resolve(r[o++].apply(null,e)).then(i=>i===void 0||e.length===1&&i===e[0]?n(s):n(i)):s;t=n()}return Promise.resolve(t)}};function Zt(e,t){if(!xe(t))return!1;if(e!==t){for(const r in e)if(!(r in t))return!1}return!0}var Y=class extends A{constructor(e){super(),this.onerror=I,this.type=e}emit(e){xe(e)||I(`The data for the "${this.type}" hook should be an object.`);for(const t of this.listeners)try{const r=t(e);if(r===void 0)continue;if(Zt(e,r))e=r;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(r){se(r),this.onerror(r)}return e}},x=class extends A{constructor(e){super(),this.onerror=I,this.type=e}emit(e){xe(e)||I(`The response data for the "${this.type}" hook must be an object.`);const t=Array.from(this.listeners);if(t.length>0){let r=0;const o=s=>(se(s),this.onerror(s),e),n=s=>{if(s!==void 0&&Zt(e,s))e=s;else if(s!==void 0)return this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`),e;if(r<t.length)try{return Promise.resolve(t[r++](e)).then(n,o)}catch(i){return o(i)}return e};return Promise.resolve(n(e))}return Promise.resolve(e)}};const re="Remote loading is disabled by experiments.optimization.disableRemote.";var Wo=class{constructor(){this.hooks=new F({})}formatAndRegisterRemote(){return[]}loadRemote(){throw new Error(re)}preloadRemote(){throw new Error(re)}registerRemotes(){throw new Error(re)}getRemoteModuleAndOptions(){throw new Error(re)}initRawContainer(){throw new Error(re)}};function Xt(e,t){const r=wt(t);r.url||I(Gt,P,{remoteName:e.name});let o=Le(t,r.url);!B&&!o.startsWith("http")&&(o=`https:${o}`),e.type=r.type,e.entryGlobalName=r.globalName,e.entry=o,e.version=t.version,e.buildVersion=t.buildVersion}function Vo(){return{name:"snapshot-plugin",async afterResolve(e){const{remote:t,pkgNameOrAlias:r,expose:o,origin:n,remoteInfo:s,id:i}=e;if(!Fe(t)||!Rt(t)){const{remoteSnapshot:a,globalSnapshot:c}=await n.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:t,id:je(t.name,o)});Xt(s,a);const l=[{nameOrAlias:r,exposes:[o],resourceCategory:"sync",share:!1,depsRemote:!1,recordPreloadedAssets:!0}];await n.remoteHandler.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:l,options:n.options,origin:n});const[u]=l;if(u){const f={remote:t,preloadConfig:u},d=await n.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:n,preloadOptions:f,remoteInfo:s,remote:t,remoteSnapshot:a,globalSnapshot:c});d&&Jt(s,n,d,!1,{initiator:"loadRemote",id:i},u.recordPreloadedAssets).catch(()=>{})}return{...e,remoteSnapshot:a}}return e}}}function qo(e){const t=e.split(":");return t.length===1?{name:t[0],version:void 0}:t.length===2?{name:t[0],version:t[1]}:{name:t[1],version:t[2]}}function Yt(e,t,r,o,n={},s){const{value:i}=q(e,ie(t)),a=s||i;if(a&&!ft(a)&&(r(a,t,o),a.remotesInfo)){const c=Object.keys(a.remotesInfo);for(const l of c){if(n[l])continue;n[l]=!0;const u=qo(l),f=a.remotesInfo[l];Yt(e,{name:u.name,version:f.matchedVersion},r,!1,n,void 0)}}}const Ae=(e,t)=>document.querySelector(`${e}[${e==="link"?"href":"src"}="${t}"]`);function zo(e,t,r,o,n){const s=[],i=[],a=[],c=new Set,l=new Set,{options:u}=e,{preloadConfig:f}=t,{depsRemote:d}=f;if(Yt(o,r,(h,p,y)=>{var b;let g;if(y)g=f;else if(Array.isArray(d)){const $=d.find(w=>w.nameOrAlias===p.name||w.nameOrAlias===p.alias);if(!$)return;g=Kt($)}else if(d===!0)g=f;else return;const _=Le(h,wt(h).url);_&&a.push({name:p.name,moduleInfo:{name:p.name,entry:_,type:"remoteEntryType"in h?h.remoteEntryType:"global",entryGlobalName:"globalName"in h?h.globalName:p.name,shareScope:"",version:"version"in h?h.version:void 0},url:_});let E="modules"in h?h.modules:[];const R=xo(g.exposes);R.length&&"modules"in h&&(E=(b=h==null?void 0:h.modules)==null?void 0:b.reduce(($,w)=>((R==null?void 0:R.indexOf(w.moduleName))!==-1&&$.push(w),$),[]));function S($){const w=$.map(k=>Le(h,k));return g.filter?w.filter(g.filter):w}if(E){const $=E.length;for(let w=0;w<$;w++){const k=E[w],z=`${p.name}/${k.moduleName}`;e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:k.moduleName==="."?p.name:z,name:p.name,remoteSnapshot:h,preloadConfig:g,remote:p,origin:e}),!Gr(z)&&(g.resourceCategory==="all"?(s.push(...S(k.assets.css.async)),s.push(...S(k.assets.css.sync)),i.push(...S(k.assets.js.async)),i.push(...S(k.assets.js.sync))):g.resourceCategory==="sync"&&(s.push(...S(k.assets.css.sync)),i.push(...S(k.assets.js.sync))),Ur(z))}}},!0,{},n),n.shared&&n.shared.length>0){const h=(p,y)=>{const{shared:g}=Se(e.shareScopeMap,y.sharedName,p,e.sharedHandler.hooks.lifecycle.resolveShare)||{};g&&typeof g.lib=="function"&&(y.assets.js.sync.forEach(_=>{c.add(_)}),y.assets.css.sync.forEach(_=>{l.add(_)}))};n.shared.forEach(p=>{var _;const y=(_=u.shared)==null?void 0:_[p.sharedName];if(!y)return;const g=p.version?y.find(E=>E.version===p.version):y;g&&bt(g).forEach(E=>{h(E,p)})})}const m=i.filter(h=>!c.has(h)&&!Ae("script",h));return{cssAssets:s.filter(h=>!l.has(h)&&!Ae("link",h)),jsAssetsWithoutEntry:m,entryAssets:a.filter(h=>!Ae("script",h.url))}}const Ko=function(){return{name:"generate-preload-assets-plugin",async generatePreloadAssets(e){const{origin:t,preloadOptions:r,remoteInfo:o,remote:n,globalSnapshot:s,remoteSnapshot:i}=e;return B?Fe(n)&&Rt(n)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:n.name,url:n.entry,moduleInfo:{name:o.name,entry:n.entry,type:o.type||"global",entryGlobalName:"",shareScope:""}}]}:(Xt(o,i),zo(t,r,o,s,i)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}};function Qt(e,t){const r=ge({name:t.name,version:t.options.version}),o=r&&"remotesInfo"in r&&r.remotesInfo&&q(r.remotesInfo,e.name).value;return o&&o.matchedVersion?{hostGlobalSnapshot:r,globalSnapshot:ze(),remoteSnapshot:ge({name:e.name,version:o.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:ze(),remoteSnapshot:ge({name:e.name,version:"version"in e?e.version:void 0})}}var Jo=class{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new F({beforeLoadRemoteSnapshot:new v("beforeLoadRemoteSnapshot"),loadSnapshot:new x("loadGlobalSnapshot"),loadRemoteSnapshot:new x("loadRemoteSnapshot"),afterLoadSnapshot:new x("afterLoadSnapshot"),beforeLoadManifest:new v("beforeLoadManifest"),afterLoadManifest:new v("afterLoadManifest")}),this.manifestLoading=we.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}async loadRemoteSnapshotInfo({moduleInfo:e,id:t,initiator:r="loadRemote"}){const{options:o}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:o,moduleInfo:e,origin:this.HostInstance});let n=ge({name:this.HostInstance.options.name,version:this.HostInstance.options.version});n||(n={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},Fr({[this.HostInstance.options.name]:n})),n&&"remotesInfo"in n&&!q(n.remotesInfo,e.name).value&&("version"in e||"entry"in e)&&(n.remotesInfo={...n==null?void 0:n.remotesInfo,[e.name]:{matchedVersion:"version"in e?e.version:e.entry}});const{hostGlobalSnapshot:s,remoteSnapshot:i,globalSnapshot:a}=this.getGlobalRemoteInfo(e),{remoteSnapshot:c,globalSnapshot:l}=await this.hooks.lifecycle.loadSnapshot.emit({options:o,moduleInfo:e,hostGlobalSnapshot:s,remoteSnapshot:i,globalSnapshot:a});let u,f;if(c)if(ft(c)){const d=B?c.remoteEntry:c.ssrRemoteEntry||c.remoteEntry||"",m=await this.loadManifestSnapshot(d,e,{},{initiator:r,id:t||e.name}),h=Ke({...e,entry:d},m);u=m,f=h}else{const{remoteSnapshot:d}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:c,from:"global"});u=d,f=l}else if(Fe(e)){const d=await this.loadManifestSnapshot(e.entry,e,{},{initiator:r,id:t||e.name}),m=Ke(e,d);u=d,f=m}else I(Ft,P,{remoteName:e.name,remoteVersion:e.version,hostName:this.HostInstance.options.name,globalSnapshot:JSON.stringify(l)},void 0,H(this.HostInstance.options));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:t,host:this.HostInstance,options:o,moduleInfo:e,remoteSnapshot:u}),{remoteSnapshot:u,globalSnapshot:f}}getGlobalRemoteInfo(e){return Qt(e,this.HostInstance)}async getManifestJson(e,t,r,o){return(async()=>{const s=Z(t);let i=this.manifestCache.get(e);if(i)return await this.hooks.lifecycle.afterLoadManifest.emit({manifestUrl:e,moduleInfo:t,resourceOptions:o,manifestJson:i,cached:!0,origin:this.HostInstance}),i;await this.hooks.lifecycle.beforeLoadManifest.emit({manifestUrl:e,moduleInfo:t,resourceOptions:o,origin:this.HostInstance});let a,c,l=!1;try{let d=await this.loaderHook.lifecycle.fetch.emit(e,{},s,o?{...o,url:e,resourceType:"manifest"}:void 0);(!d||!(d instanceof Response))&&(d=await fetch(e,{})),a=d,i=await d.json()}catch(d){c=d,i=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:d,from:"runtime",lifecycle:"afterResolve",remote:s,origin:this.HostInstance}),i||(delete this.manifestLoading[e],await this.hooks.lifecycle.afterLoadManifest.emit({manifestUrl:e,moduleInfo:t,resourceOptions:o,response:a,error:d,origin:this.HostInstance}),I(Ct,P,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name},`${d}`,H(this.HostInstance.options))),l=!0}const u=[!i.metaData&&"metaData",!i.exposes&&"exposes",!i.shared&&"shared"].filter(Boolean),f=u.length>0?new Error(`"${e}" is not a valid federation manifest for remote "${t.name}". Missing required fields: ${u.join(", ")}.`):void 0;return f&&await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:f,from:"runtime",lifecycle:"afterResolve",remote:s,origin:this.HostInstance}),await this.hooks.lifecycle.afterLoadManifest.emit({manifestUrl:e,moduleInfo:t,resourceOptions:o,manifestJson:i,response:a,error:f||c,recovered:f?void 0:l||void 0,origin:this.HostInstance}),f&&I(Ut,P,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name,missingFields:u.join(",")},void 0,H(this.HostInstance.options)),this.manifestCache.set(e,i),i})()}async loadManifestSnapshot(e,t,r,o){const n=async()=>{const s=await this.getManifestJson(e,t,r,o),i=dr(s,{version:e}),{remoteSnapshot:a}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:t,manifestJson:s,remoteSnapshot:i,manifestUrl:e,from:"manifest"});return a};return this.manifestLoading[e]||(this.manifestLoading[e]=n().then(s=>s)),this.manifestLoading[e]}},Zo=class{constructor(){this.hooks=new F({})}},Xo=class{constructor(e){this.hooks=new F({beforeRegisterShare:new Y("beforeRegisterShare"),afterRegisterShare:new A("afterRegisterShare"),afterResolve:new x("afterResolve"),beforeLoadShare:new x("beforeLoadShare"),loadShare:new v,afterLoadShare:new A("afterLoadShare"),errorLoadShare:new A("errorLoadShare"),resolveShare:new Y("resolveShare"),initContainerShareScopeMap:new Y("initContainerShareScopeMap")}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}emitAfterRegisterShare(e,t){this.hooks.lifecycle.afterRegisterShare.emit({pkgName:e,...t,shareScopeMap:this.shareScopeMap,origin:this.host})}emitAfterLoadShare({lifecycle:e,pkgName:t,shareInfo:r,selectedShared:o,loadContext:n}){try{this.hooks.lifecycle.afterLoadShare.emit({pkgName:t,shareInfo:r,selectedShared:o,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,loadContext:n,origin:this.host})}catch(s){se(s)}}emitErrorLoadShare({lifecycle:e,pkgName:t,shareInfo:r,error:o,recovered:n,loadContext:s}){try{this.hooks.lifecycle.errorLoadShare.emit({pkgName:t,shareInfo:r,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,origin:this.host,error:o,recovered:n,loadContext:s})}catch(i){se(i)}}registerShared(e,t){const{newShareInfos:r,allShareInfos:o}=Pt(e,t);return Object.keys(r).forEach(n=>{r[n].forEach(s=>{s.scope.forEach(i=>{var l,u,f;this.hooks.lifecycle.beforeRegisterShare.emit({origin:this.host,pkgName:n,shared:s});const a=(l=this.shareScopeMap[i])==null?void 0:l[n],c=a==null?void 0:a[s.version];a||this.setShared({pkgName:n,lib:s.lib,get:s.get,loaded:s.loaded||!!s.lib,shared:s,from:t.name}),this.emitAfterRegisterShare(n,{scope:i,shared:s,previousShared:c,registeredShared:(f=(u=this.shareScopeMap[i])==null?void 0:u[n])==null?void 0:f[s.version],trigger:"runtime"})})})}),{newShareInfos:r,allShareInfos:o}}async loadShare(e,t){const{host:r}=this;let o=t==null?void 0:t.context;const n=et({pkgName:e,extraOptions:t,shareInfos:r.options.shared});let s=n;try{n!=null&&n.scope&&await Promise.all(n.scope.map(async u=>{await Promise.all(this.initializeSharing(u,{strategy:n.strategy,context:o}))}));const i=await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:n,shared:r.options.shared,origin:r,loadContext:o});s=i.shareInfo,o=i.loadContext||o,L(s,`Cannot find shared "${e}" in host "${r.options.name}". Ensure the shared config for "${e}" is declared in the federation plugin options and the host has been initialized before loading shares.`);const a=s,{shared:c,useTreesShaking:l}=Se(this.shareScopeMap,e,s,this.hooks.lifecycle.resolveShare,o)||{};if(c){const u=he(c,l);if(u.lib)return J(u,r.options.name),this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:a,selectedShared:c,loadContext:o}),u.lib;if(u.loading&&!u.loaded){const f=await u.loading;return u.loaded=!0,u.lib||(u.lib=f),J(u,r.options.name),this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:a,selectedShared:c,loadContext:o}),f}else{const d=(async()=>{const h=await u.get();return J(u,r.options.name),u.loaded=!0,u.lib=h,h})();this.setShared({pkgName:e,loaded:!1,shared:c,from:r.options.name,lib:null,loading:d,treeShaking:l?u:void 0});const m=await d;return this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:a,selectedShared:c,loadContext:o}),m}}else{if(t!=null&&t.customShareInfo)return this.emitErrorLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:a,recovered:!0,loadContext:o}),!1;const u=ae(a.treeShaking),f=he(a,u),m=(async()=>{const p=await f.get();f.lib=p,f.loaded=!0,J(f,r.options.name);const{shared:y,useTreesShaking:g}=Se(this.shareScopeMap,e,a,this.hooks.lifecycle.resolveShare,o)||{};if(y){const _=he(y,g);_.lib=p,_.loaded=!0,y.from=a.from}return p})();this.setShared({pkgName:e,loaded:!1,shared:a,from:r.options.name,lib:null,loading:m,treeShaking:u?f:void 0});const h=await m;return this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:a,selectedShared:a,loadContext:o}),h}}catch(i){throw this.emitErrorLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:s,error:i,loadContext:o}),i}}initializeSharing(e=le,t){var m;const{host:r}=this,o=t==null?void 0:t.from,n=t==null?void 0:t.strategy,s=((m=t==null?void 0:t.context)==null?void 0:m.trigger)||o||"runtime";let i=t==null?void 0:t.initScope;const a=[];if(o!=="build"){const{initTokens:h}=this;i||(i=[]);let p=h[e];if(p||(p=h[e]={from:this.host.name}),i.indexOf(p)>=0)return a;i.push(p)}const c=this.shareScopeMap,l=r.options.name;c[e]||(c[e]={});const u=c[e],f=(h,p)=>{var b;const{version:y,eager:g}=p;u[h]=u[h]||{};const _=u[h],E=_[y],R=E&&he(E),S=!!(R&&("eager"in R&&R.eager||"shareConfig"in R&&((b=R.shareConfig)!=null&&b.eager)));(!R||R.strategy!=="loaded-first"&&!R.loaded&&(!g!=!S?g:l>_[y].from))&&(_[y]=p),this.emitAfterRegisterShare(h,{scope:e,shared:p,previousShared:E,registeredShared:_[y],trigger:s})},d=async h=>{const{module:p}=await r.remoteHandler.getRemoteModuleAndOptions({id:h});let y;const g={initiator:"loadShare",id:h,resourceType:"remoteEntry",url:p.remoteInfo.entry};try{y=await p.getEntry(void 0,g)}catch(_){if(y=await r.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:h,error:_,from:"runtime",lifecycle:"beforeLoadShare",remote:p.remoteInfo,origin:r}),!y)return}finally{y!=null&&y.init&&!p.initing&&(p.remoteEntryExports=y,await p.init(void 0,void 0,i,void 0,g))}};return Object.keys(r.options.shared).forEach(h=>{r.options.shared[h].forEach(p=>{p.scope.includes(e)&&f(h,p)})}),(r.options.shareStrategy==="version-first"||n==="version-first")&&r.options.remotes.forEach(h=>{h.shareScope===e&&a.push(d(h.name))}),a}loadShareSync(e,t){const{host:r}=this,o=t==null?void 0:t.context,n=et({pkgName:e,extraOptions:t,shareInfos:r.options.shared});try{n!=null&&n.scope&&n.scope.forEach(i=>{this.initializeSharing(i,{strategy:n.strategy,from:t==null?void 0:t.from,context:o})});const{shared:s}=Se(this.shareScopeMap,e,n,this.hooks.lifecycle.resolveShare,o)||{};if(s){if(typeof s.lib=="function")return J(s,r.options.name),s.loaded||(s.loaded=!0,s.from===r.options.name&&(n.loaded=!0)),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:n,selectedShared:s,loadContext:o}),s.lib;if(typeof s.get=="function"){const i=s.get();if(!(i instanceof Promise))return J(s,r.options.name),this.setShared({pkgName:e,loaded:!0,from:r.options.name,lib:i,shared:s}),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:n,selectedShared:s,loadContext:o}),i}}if(n.lib)return n.loaded||(n.loaded=!0),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:n,selectedShared:n,loadContext:o}),n.lib;if(n.get){const i=n.get();return i instanceof Promise&&I((t==null?void 0:t.from)==="build"?Ht:De,P,{hostName:r.options.name,sharedPkgName:e},void 0,H(r.options)),n.lib=i,this.setShared({pkgName:e,loaded:!0,from:r.options.name,lib:n.lib,shared:n}),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:n,selectedShared:n,loadContext:o}),n.lib}I(De,P,{hostName:r.options.name,sharedPkgName:e},void 0,H(r.options))}catch(s){throw this.emitErrorLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:n,error:s,loadContext:o}),s}}initShareScopeMap(e,t,r={}){const{host:o}=this;this.shareScopeMap[e]=t,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:t,options:o.options,origin:o,scopeName:e,hostShareScopeMap:r.hostShareScopeMap})}setShared({pkgName:e,shared:t,from:r,lib:o,loading:n,loaded:s,get:i,treeShaking:a}){const{version:c,scope:l="default",...u}=t,f=Array.isArray(l)?l:[l],d=m=>{const h=(y,g,_)=>{_&&!y[g]&&(y[g]=_)},p=a?m.treeShaking:m;h(p,"loaded",s),h(p,"loading",n),h(p,"get",i),h(p,"lib",o)};f.forEach(m=>{this.shareScopeMap[m]||(this.shareScopeMap[m]={}),this.shareScopeMap[m][e]||(this.shareScopeMap[m][e]={}),this.shareScopeMap[m][e][c]||(this.shareScopeMap[m][e][c]={version:c,scope:[m],...u,lib:o});const h=this.shareScopeMap[m][e][c];d(h),r&&h.from!==r&&(h.from=r)})}_setGlobalShareScopeMap(e){const t=kt(),r=e.id||e.name;r&&!t[r]&&(t[r]=this.shareScopeMap)}},Yo=class{constructor(){this.shareScopeMap={},this.hooks=new F({afterResolve:new x("afterResolve")})}registerShared(){return{newShareInfos:{},allShareInfos:{}}}loadShare(){throw new Error("Shared dependency loading is disabled by experiments.optimization.disableShared.")}loadShareSync(){throw new Error("Shared dependency loading is disabled by experiments.optimization.disableShared.")}initializeSharing(){return[]}initShareScopeMap(e,t){this.shareScopeMap[e]=t}},Qo=class{constructor(e){this.hooks=new F({beforeRegisterRemote:new Y("beforeRegisterRemote"),registerRemote:new Y("registerRemote"),beforeRequest:new x("beforeRequest"),afterMatchRemote:new v("afterMatchRemote"),onLoad:new v("onLoad"),afterLoadRemote:new v("afterLoadRemote"),handlePreloadModule:new A("handlePreloadModule"),errorLoadRemote:new v("errorLoadRemote"),beforePreloadRemote:new v("beforePreloadRemote"),generatePreloadAssets:new v("generatePreloadAssets"),afterPreloadRemote:new v("afterPreloadRemote"),loadEntry:new v}),this.host=e,this.idToRemoteMap={}}formatAndRegisterRemote(e,t){return(t.remotes||[]).reduce((r,o)=>(this.registerRemote(o,r,{force:!1}),r),e.remotes)}setIdToRemoteMap(e,t){const{remote:r,expose:o}=t,{name:n,alias:s}=r;if(this.idToRemoteMap[e]={name:r.name,expose:o},s&&e.startsWith(n)){const i=e.replace(n,s);this.idToRemoteMap[i]={name:r.name,expose:o};return}if(s&&e.startsWith(s)){const i=e.replace(s,n);this.idToRemoteMap[i]={name:r.name,expose:o}}}async loadRemote(e,t){const{host:r}=this,o=tt(r.options.remotes,e);let n=e,s=o==null?void 0:o.expose,i=o?Z(o.remote):void 0,a;try{const{loadFactory:c=!0}=t||{loadFactory:!0},{module:l,moduleOptions:u,remoteMatchInfo:f}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:d,remote:m,expose:h,id:p,remoteSnapshot:y}=f;n=p,s=h,i=Z(m);const g=await l.get(p,h,t,y),_=await this.hooks.lifecycle.onLoad.emit({id:p,pkgNameOrAlias:d,expose:h,exposeModule:c?g:void 0,exposeModuleFactory:c?void 0:g,remote:m,options:u,moduleInstance:l,origin:r});return this.setIdToRemoteMap(e,f),a={id:n,expose:s,remote:i,options:t,origin:r},typeof _=="function"?_:g}catch(c){const{from:l="runtime"}=t||{from:"runtime"};let u;try{u=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:c,from:l,lifecycle:"onLoad",expose:s,remote:i,origin:r})}catch(f){throw a={id:n,expose:s,remote:i,options:t,error:f,origin:r},f}if(!u)throw a={id:n,expose:s,remote:i,options:t,error:c,origin:r},c;return a={id:n,expose:s,remote:i,options:t,error:c,origin:r,recovered:!0},u}finally{a&&await this.hooks.lifecycle.afterLoadRemote.emit(a)}}async preloadRemote(e){const{host:t}=this,r=[];await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:t.options,origin:t});const o=Fo(t.options.remotes,e),n=a=>{const{preloadConfig:c,remote:l}=a,u=c.exposes||[];return u.length?u.map(f=>({ops:{...a,preloadConfig:{...c,exposes:[f]}},id:je(l.name,f)})):[{ops:a,id:`${l.name}/*`}]};let s;await Promise.all(o.flatMap(n).map(async a=>{const{ops:c,id:l}=a,{remote:u,preloadConfig:f}=c,d=Z(u);try{const{globalSnapshot:m,remoteSnapshot:h}=await t.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:u,id:l,initiator:"preloadRemote"}),p=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:t,preloadOptions:c,remote:u,remoteInfo:d,globalSnapshot:m,remoteSnapshot:h});if(!p)return;const y=await Jt(d,t,p,!0,{initiator:"preloadRemote",id:l},f.recordPreloadedAssets);r.push({remote:u,remoteInfo:d,preloadConfig:f,id:l,results:y})}catch(m){r.push({remote:u,remoteInfo:d,preloadConfig:f,id:l,results:[{url:d.entry,status:"error",resourceType:/\.json(?:$|[?#])/i.test(d.entry)?"manifest":"remoteEntry",initiator:"preloadRemote",id:l,error:m}]})}}));const i=r.flatMap(a=>a.results.filter(c=>c.status==="error"||c.status==="timeout"));if(i.length>0&&(s=new Error(`preloadRemote failed to load ${i.length} resource(s).`),Object.assign(s,{results:r,failedResults:i})),await this.hooks.lifecycle.afterPreloadRemote.emit({preloadOps:e,options:t.options,origin:t,results:r,error:s}),s)throw s}registerRemotes(e,t){const{host:r}=this;e.forEach(o=>{this.registerRemote(o,r.options.remotes,{force:t==null?void 0:t.force})})}initRawContainer(e,t,r){const{host:o}=this,n=new ot({host:o,remoteInfo:Z({name:e,entry:t})});return n.remoteEntryExports=r,o.moduleCache.set(e,n),n}async getRemoteModuleAndOptions(e){const{host:t}=this,{id:r}=e;let o;try{o=await this.hooks.lifecycle.beforeRequest.emit({id:r,options:t.options,origin:t})}catch(m){if(o=await this.hooks.lifecycle.errorLoadRemote.emit({id:r,options:t.options,origin:t,from:"runtime",error:m,lifecycle:"beforeRequest"}),!o)throw m}const{id:n}=o,s=tt(t.options.remotes,n);if(!s)try{I(Dt,P,{hostName:t.options.name,requestId:n},void 0,H(t.options))}catch(m){throw await this.hooks.lifecycle.afterMatchRemote.emit({id:n,options:t.options,error:m,origin:t}),m}const{remote:i}=s,a=Z(i);await this.hooks.lifecycle.afterMatchRemote.emit({id:n,...s,options:t.options,remoteInfo:a,origin:t});const c=await t.sharedHandler.hooks.lifecycle.afterResolve.emit({id:n,...s,options:t.options,origin:t,remoteInfo:a}),{remote:l,expose:u}=c;L(l&&u,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${n}.`);let f=t.moduleCache.get(l.name);const d={host:t,remoteInfo:a};return f||(f=new ot(d),t.moduleCache.set(l.name,f)),{module:f,moduleOptions:d,remoteMatchInfo:c}}registerRemote(e,t,r){const{host:o}=this,n=()=>{if(e.alias){const i=t.find(a=>{var c;return e.alias&&(a.name.startsWith(e.alias)||((c=a.alias)==null?void 0:c.startsWith(e.alias)))});L(!i,`The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${i&&i.name} name or alias`)}"entry"in e&&B&&typeof window<"u"&&!e.entry.startsWith("http")&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||(e.shareScope=le),e.type||(e.type=Mt)};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:o});const s=t.find(i=>i.name===e.name);if(!s)n(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:o});else{const i=[`The remote "${e.name}" is already registered.`,"Please note that overriding it may cause unexpected errors."];r!=null&&r.force&&(this.removeRemote(s),n(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:o}),lt(i.join(" ")))}}removeRemote(e){var t;try{const{host:r}=this,{name:o}=e,n=r.options.remotes.findIndex(c=>c.name===o);n!==-1&&r.options.remotes.splice(n,1);const s=q(T.__FEDERATION__.moduleInfo,ie(e)).key;delete T.__FEDERATION__.moduleInfo[s],"entry"in e&&(r.snapshotHandler.manifestCache.delete(e.entry),delete we.__FEDERATION__.__MANIFEST_LOADING__[e.entry]);const{hostGlobalSnapshot:i}=Qt(e,r);if(i){const c=i&&"remotesInfo"in i&&i.remotesInfo&&q(i.remotesInfo,e.name).key;c&&delete i.remotesInfo[c]}const a=r.moduleCache.get(e.name);if(a){const c=a.remoteInfo,l=c.entryGlobalName;T[l]&&((t=Object.getOwnPropertyDescriptor(T,l))!=null&&t.configurable?delete T[l]:T[l]=void 0);const u=zt(a.remoteInfo);j[u]&&delete j[u];let f=c.buildVersion?ct(c.name,c.buildVersion):c.name;const d=T.__FEDERATION__.__INSTANCES__.findIndex(m=>c.buildVersion?m.options.id===f:m.name===f);if(d!==-1){const m=T.__FEDERATION__.__INSTANCES__[d];f=m.options.id||f;const h=kt();let p=!0;const y=[];Object.keys(h).forEach(g=>{const _=h[g];_&&Object.keys(_).forEach(E=>{const R=_[E];R&&Object.keys(R).forEach(S=>{const b=R[S];b&&Object.keys(b).forEach($=>{const w=b[$];w&&typeof w=="object"&&w.from===c.name&&(w.loaded||w.loading?(w.useIn=w.useIn.filter(k=>k!==c.name),w.useIn.length?p=!1:y.push([g,E,S,$])):y.push([g,E,S,$]))})})})}),p&&(m.shareScopeMap={},delete h[f]),y.forEach(([g,_,E,R])=>{var S,b,$;($=(b=(S=h[g])==null?void 0:S[_])==null?void 0:b[E])==null||delete $[R]}),T.__FEDERATION__.__INSTANCES__.splice(d,1)}r.moduleCache.delete(e.name)}}catch(r){Ce.error(`removeRemote failed: ${r instanceof Error?r.message:String(r)}`)}}};const en=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN=="boolean"?!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN:!0,Me=typeof FEDERATION_OPTIMIZE_NO_REMOTE=="boolean"?!FEDERATION_OPTIMIZE_NO_REMOTE:!0,nt=typeof FEDERATION_OPTIMIZE_NO_SHARED=="boolean"?!FEDERATION_OPTIMIZE_NO_SHARED:!0;var tn=class{constructor(e){this.hooks=new F({beforeInit:new Y("beforeInit"),init:new A,beforeInitContainer:new x("beforeInitContainer"),initContainer:new x("initContainer")}),this.version="2.9.0",this.moduleCache=new Map,this.loaderHook=new F({getModuleInfo:new A,createScript:new A,createLink:new A,fetch:new v,loadEntryError:new v,afterLoadEntry:new v("afterLoadEntry"),beforeInitRemote:new v("beforeInitRemote"),afterInitRemote:new v("afterInitRemote"),beforeGetExpose:new v("beforeGetExpose"),afterGetExpose:new v("afterGetExpose"),beforeExecuteFactory:new v("beforeExecuteFactory"),afterExecuteFactory:new v("afterExecuteFactory"),getModuleFactory:new v}),this.bridgeHook=new F({beforeBridgeRender:new A,afterBridgeRender:new A,beforeBridgeDestroy:new A,afterBridgeDestroy:new A,afterBridgeRouteSync:new A});const t=Me&&en?[Vo(),Ko()]:[],r={id:Lo(),name:e.name,plugins:t,remotes:[],shared:{},inBrowser:B};this.name=e.name,this.options=r,this.snapshotHandler=Me?new Jo(this):new Zo,this.sharedHandler=nt?new Xo(this):new Yo,this.remoteHandler=Me?new Qo(this):new Wo,this.shareScopeMap=this.sharedHandler.shareScopeMap,this.registerPlugins([...r.plugins,...e.plugins||[]]),this.options=this.formatOptions(r,e)}initOptions(e){e.name&&e.name!==this.options.name&&I(_t(xt,P)),this.registerPlugins(e.plugins);const t=this.formatOptions(this.options,e);return this.options=t,t}async loadShare(e,t){return this.sharedHandler.loadShare(e,t)}loadShareSync(e,t){return this.sharedHandler.loadShareSync(e,t)}initializeSharing(e=le,t){return this.sharedHandler.initializeSharing(e,t)}initRawContainer(e,t,r){return this.remoteHandler.initRawContainer(e,t,r)}async loadRemote(e,t){return this.remoteHandler.loadRemote(e,t)}async preloadRemote(e){return this.remoteHandler.preloadRemote(e)}initShareScopeMap(e,t,r={}){this.sharedHandler.initShareScopeMap(e,t,r)}formatOptions(e,t){const r=nt?Pt(e,t).allShareInfos:{},{userOptions:o,options:n}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:t,options:e,shareInfo:r}),s=this.remoteHandler.formatAndRegisterRemote(n,o),{allShareInfos:i}=this.sharedHandler.registerShared(n,o),a=[...n.plugins];o.plugins&&o.plugins.forEach(l=>{a.includes(l)||a.push(l)});const c={...e,...t,plugins:a,remotes:s,shared:i,id:o.id||e.id};return this.hooks.lifecycle.init.emit({origin:this,options:c}),c}registerPlugins(e){this.options.plugins=Do(e,this)}registerRemotes(e,t){return this.remoteHandler.registerRemotes(e,t)}registerShared(e){this.sharedHandler.registerShared(this.options,{...this.options,shared:e})}};let rn=null;function er(e){return rn}Dr(tn);function tr(e,t){const r=o=>{if(!o.startsWith("/"))return o;const n=o.length>1&&o.endsWith("/"),s=`${t}/${o}`.replace(/\/+/g,"/").replace(/\/$/,"")||"/";return n?`${s}/`:s};return e.map(o=>{const n={...o,path:r(o.path)};return typeof o.redirect=="string"?n.redirect=r(o.redirect):o.redirect&&typeof o.redirect=="object"&&"path"in o.redirect&&typeof o.redirect.path=="string"&&(n.redirect={...o.redirect,path:r(o.redirect.path)}),o.children&&o.children.length>0&&(n.children=tr(o.children,t)),n})}function on(e){const t=e.replace(/\/+$/,""),r=s=>s.startsWith("/")&&s!==t&&!s.startsWith(t+"/"),o=s=>`${t}${s}`.replace(/\/+/g,"/"),n=s=>typeof s=="string"?r(s)?o(s):s:"path"in s&&typeof s.path=="string"&&r(s.path)?{...s,path:o(s.path)}:s;return s=>{const i=s.push.bind(s),a=s.replace.bind(s),c=s.resolve.bind(s);s.push=l=>i(n(l)),s.replace=l=>a(n(l)),s.resolve=(l,...u)=>c(n(l),...u)}}function nn(e){const{router:t,basename:r,memoryRoute:o,hashRoute:n}=e,s=t.getRoutes().sort((m,h)=>m.path.split("/").filter(p=>p).length-h.path.split("/").filter(p=>p).length),i=new Map,a=new Set;s.forEach(m=>{const h=i.get(m.path)||[];h.push(m),i.set(m.path,h)});const c=(m,h)=>`${m}/${h}`.replace(/\/+/g,"/").replace(/\/$/,"")||"/",l=(m,h="")=>{if(!m.children||m.children.length===0)return m;for(let p=0;p<m.children.length;p++){const y=m.children[p],g=c(h,y.path),E=(i.get(g)||[]).find(R=>!a.has(R)&&R!==m&&(y.name==null||R.name===y.name));if(E){const R={...E,path:y.path};m.children[p]=R,a.add(E),l(R,g)}}return m};let u=[];for(const m of s)if(!a.has(m)){const h=l(m,m.path);a.add(m),u.push(h)}let f,d;return o?f=pe.createMemoryHistory(r):n?(f=pe.createWebHashHistory(),r&&(u=tr(u,r),d=on(r))):f=pe.createWebHistory(r),{history:f,routes:u,patchRouter:d}}function sn(e){const t=new Map,r=er();return()=>({__APP_VERSION__:"2.9.0",async render(o){var p,y,g,_,E,R,S,b,$;D.debug("createBridgeComponent render Info",o);const{moduleName:n,dom:s,basename:i,memoryRoute:a,hashRoute:c,...l}=o,u={side:"producer",framework:"vue",operation:t.has(s)?"update":"render",reason:"direct"},f=ir.createApp(e.rootComponent,l);t.set(s,f);const d=await((g=(y=(p=r==null?void 0:r.bridgeHook)==null?void 0:p.lifecycle)==null?void 0:y.beforeBridgeRender)==null?void 0:g.emit(o,u)),m=d&&typeof d=="object"&&(d!=null&&d.extraProps)?d==null?void 0:d.extraProps:{},h=e.appOptions({app:f,basename:i,memoryRoute:a,hashRoute:c,...l,...m});if(h!=null&&h.router){const{history:w,routes:k,patchRouter:z}=nn({router:h.router,basename:o.basename,memoryRoute:o.memoryRoute,hashRoute:o.hashRoute}),ee=pe.createRouter({...h.router.options,history:w,routes:k});if(z&&z(ee),h.afterRouterCreate&&h.afterRouterCreate(ee),D.debug("createBridgeComponent render router info>>>",{moduleName:n,router:ee}),a){const or={action:"memory-route-init",to:a.entryPath,basename:i},nr={side:"producer",framework:"vue",operation:"route-sync",moduleName:n,route:or},sr=await ee.push(a.entryPath);(R=(E=(_=r==null?void 0:r.bridgeHook)==null?void 0:_.lifecycle)==null?void 0:E.afterBridgeRouteSync)==null||R.emit({context:nr,result:sr})}f.use(ee)}f.mount(s),($=(b=(S=r==null?void 0:r.bridgeHook)==null?void 0:S.lifecycle)==null?void 0:b.afterBridgeRender)==null||$.emit(o,{context:u})},destroy(o){var i,a,c,l,u,f;D.debug("createBridgeComponent destroy Info",o);const n=t.get(o==null?void 0:o.dom),s={side:"producer",framework:"vue",operation:"destroy",reason:"direct"};(c=(a=(i=r==null?void 0:r.bridgeHook)==null?void 0:i.lifecycle)==null?void 0:a.beforeBridgeDestroy)==null||c.emit(o,s),n==null||n.unmount(),(f=(u=(l=r==null?void 0:r.bridgeHook)==null?void 0:l.lifecycle)==null?void 0:u.afterBridgeDestroy)==null||f.emit(o,{context:s})}})}function an(){const e=new PopStateEvent("popstate",{state:window.history.state});window.dispatchEvent(e)}const cn=N.defineComponent({name:"RemoteApp",props:{moduleName:String,basename:String,memoryRoute:Object,hashRoute:Boolean,providerInfo:Function,rootAttrs:Object},inheritAttrs:!1,setup(e){const t=N.ref(null),r=N.ref(null),o=N.ref(""),n=N.ref(!1),s=N.ref(!1),i=N.ref(!1),a=He.useRoute(),c=er(),l=N.useAttrs(),u=()=>({name:e.moduleName,dom:t.value,basename:e.basename,memoryRoute:e.memoryRoute,hashRoute:e.hashRoute}),f=async()=>{var _,E,R,S,b,$,w;if(!t.value||n.value)return;const h=(_=e.providerInfo)==null?void 0:_.call(e);r.value=h;let p={...l,moduleName:e.moduleName,dom:t.value,basename:e.basename,memoryRoute:e.memoryRoute,hashRoute:e.hashRoute};D.debug("createRemoteAppComponent LazyComponent render >>>",p);const y={side:"consumer",framework:"vue",operation:"render"},g=await((S=(R=(E=c==null?void 0:c.bridgeHook)==null?void 0:E.lifecycle)==null?void 0:R.beforeBridgeRender)==null?void 0:S.emit(p,y))||{};p={...p,...g.extraProps},h.render(p),n.value=!0,(w=($=(b=c==null?void 0:c.bridgeHook)==null?void 0:b.lifecycle)==null?void 0:$.afterBridgeRender)==null||w.emit(p,{context:y})},d=()=>{var g,_,E,R,S,b;const h=r.value;if(!h||!n.value)return;D.debug("createRemoteAppComponent LazyComponent destroy >>>",{...e});const p=u(),y={side:"consumer",framework:"vue",operation:"destroy"};(E=(_=(g=c==null?void 0:c.bridgeHook)==null?void 0:g.lifecycle)==null?void 0:_.beforeBridgeDestroy)==null||E.emit(p,y),h.destroy({dom:t.value,moduleName:e.moduleName}),r.value=null,n.value=!1,(b=(S=(R=c==null?void 0:c.bridgeHook)==null?void 0:R.lifecycle)==null?void 0:S.afterBridgeDestroy)==null||b.emit(p,{context:y})},m=N.watch(()=>a==null?void 0:a.path,h=>{var p,y,g;if(s.value&&o.value!==""&&o.value!==h){D.debug("createRemoteAppComponent dispatchPopstateEnv >>>",{...e,pathname:a.path});const _={action:"host-to-remote",mechanism:"popstate",from:o.value,to:h,basename:e.basename},E={side:"consumer",framework:"vue",operation:"route-sync",moduleName:e.moduleName,route:_};an(),(g=(y=(p=c==null?void 0:c.bridgeHook)==null?void 0:p.lifecycle)==null?void 0:y.afterBridgeRouteSync)==null||g.emit({context:E})}o.value=h});return N.onMounted(()=>{s.value=!0,f()}),N.onActivated(async()=>{s.value=!0,i.value&&(i.value=!1,await N.nextTick(),f())}),N.onDeactivated(()=>{s.value=!1,i.value=!0,d()}),N.onBeforeUnmount(()=>{m(),d()}),()=>N.createVNode("div",N.mergeProps(e.rootAttrs||{},{ref:t}),null)}});function rr(e){return N.defineAsyncComponent({__APP_VERSION__:"2.9.0",...e.asyncComponentOptions,loader:async()=>{var c,l;const t=He.useRoute();let r="/";const o=(l=(c=t==null?void 0:t.matched)==null?void 0:c[0])==null?void 0:l.path;o&&(o.endsWith("/:pathMatch(.*)*")?r=o.replace("/:pathMatch(.*)*",""):r=t.matched[0].path);const n=(e==null?void 0:e.export)||"default";D.debug("createRemoteAppComponent LazyComponent create >>>",{basename:r,info:e});const s=await e.loader(),i=s&&s[Symbol.for("mf_module_id")],a=s[n];if(D.debug("createRemoteAppComponent LazyComponent loadRemote info >>>",{moduleName:i,module:s,exportName:n,basename:r,route:t}),n in s&&typeof a=="function")return{render(){return N.h(cn,{moduleName:i,providerInfo:a,basename:r,rootAttrs:e.rootAttrs,memoryRoute:e.memoryRoute,hashRoute:e.hashRoute})}};throw new Error("module not found")}})}function ln(e){return D.warn("createRemoteComponent is deprecated, please use createRemoteAppComponent instead!"),rr(e)}exports.createBridgeComponent=sn;exports.createRemoteAppComponent=rr;exports.createRemoteComponent=ln;
|