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