UNPKG

iobroker.javascript

Version:
4 lines 63.3 kB
import{t as e}from"./vite-preload-helper-B7qeedMF.js";var t=`FEDERATION_DEBUG`,n={AT:`@`,HYPHEN:`-`,SLASH:`/`},r={[n.AT]:`scope_`,[n.HYPHEN]:`_`,[n.SLASH]:`__`};r[n.AT],n.AT,r[n.HYPHEN],n.HYPHEN,r[n.SLASH],n.SLASH;var i=function(e){return e[e.UNKNOWN=1]=`UNKNOWN`,e[e.CALCULATED=2]=`CALCULATED`,e[e.NO_USE=0]=`NO_USE`,e}({});function a(){return!0}function o(){var e;return typeof navigator<`u`&&((e=navigator)==null?void 0:e.product)===`ReactNative`}function s(){try{if(a()&&window.localStorage)return!!localStorage.getItem(t)}catch{return!1}return!1}function c(){return typeof process<`u`&&{}.FEDERATION_DEBUG?!!{}.FEDERATION_DEBUG:typeof FEDERATION_DEBUG<`u`&&FEDERATION_DEBUG?!0:s()}var l=`[ Federation Runtime ]`,u=function(...e){return e.length?e.reduce((e,t)=>t?e?`${e}:${t}`:t:e,``):``};function d(e,t){if(`getPublicPath`in e){let n;return n=e.getPublicPath.startsWith(`function`)?Function(`return `+e.getPublicPath)()():Function(e.getPublicPath)(),`${n}${t}`}return`publicPath`in e?!a()&&!o()&&`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),``)}var f=e=>{console.warn(`${l}: ${e}`)};function p(e){try{return JSON.stringify(e,null,2)}catch{return``}}var m=(e,t)=>{if(!e)return t;let n=(e=>{if(e===`.`)return``;if(e.startsWith(`./`))return e.replace(`./`,``);if(e.startsWith(`/`)){let t=e.slice(1);return t.endsWith(`/`)?t.slice(0,-1):t}return e})(e);return n?n.endsWith(`/`)?`${n}${t}`:`${n}/${t}`:t};function h(e){return e.replace(/#.*$/,``).replace(/\?.*$/,``).replace(/\/[^\/]+$/,`/`)}function g(e,t={}){var n;let{remotes:r={},overrides:i={},version:a}=t,o,s=()=>`publicPath`in e.metaData?(e.metaData.publicPath===`auto`||e.metaData.publicPath===``)&&a?h(a):e.metaData.publicPath:e.metaData.getPublicPath,c=Object.keys(i),l={};Object.keys(r).length||(l=((n=e.remotes)==null?void 0:n.reduce((e,t)=>{let n,r=t.federationContainerName;return n=c.includes(r)?i[r]:`version`in t?t.version:t.entry,e[r]={matchedVersion:n},e},{}))||{}),Object.keys(r).forEach(e=>l[e]={matchedVersion:c.includes(e)?i[e]:r[e]});let{remoteEntry:{path:u,name:d,type:f},types:p={path:``,name:``,zip:``,api:``},buildInfo:{buildVersion:g},globalName:_,ssrRemoteEntry:v}=e.metaData,{exposes:y}=e,ee={version:a||``,buildVersion:g,globalName:_,remoteEntry:m(u,d),remoteEntryType:f,remoteTypes:m(p.path,p.name),remoteTypesZip:p.zip||``,remoteTypesAPI:p.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:y==null?void 0:y.map(e=>({moduleName:e.name,modulePath:e.path,assets:e.assets}))};if(`publicPath`in e.metaData?(o={...ee,publicPath:s()},typeof e.metaData.ssrPublicPath==`string`&&(o.ssrPublicPath=e.metaData.ssrPublicPath)):o={...ee,getPublicPath:s()},v){let e=m(v.path,v.name);o.ssrRemoteEntry=e,o.ssrRemoteEntryType=v.type||`commonjs-module`}return o}function _(e){return!!(`remoteEntry`in e&&e.remoteEntry.includes(`.json`))}var v=`[ Module Federation ]`,y=console,ee=[`logger.ts`,`logger.js`,`captureStackTrace`,`Logger.emit`,`Logger.log`,`Logger.info`,`Logger.warn`,`Logger.error`,`Logger.debug`];function te(){try{let e=Error().stack;if(!e)return;let[,...t]=e.split(` `),n=t.filter(e=>!ee.some(t=>e.includes(t)));return n.length?`Stack trace:\n${n.slice(0,5).join(` `)}`:void 0}catch{return}}var ne=class{constructor(e,t=y){this.prefix=e,this.delegate=t??y}setPrefix(e){this.prefix=e}setDelegate(e){this.delegate=e??y}emit(e,t){let n=this.delegate,r=c()?te():void 0,i=r?[...t,r]:t,a=(()=>{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(let e of a){let t=n[e];if(typeof t==`function`){t.call(n,this.prefix,...i);return}}for(let e of a){let t=y[e];if(typeof t==`function`){t.call(y,this.prefix,...i);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){c()&&this.emit(`debug`,e)}};function re(e){return new ne(e)}function ie(e){let t=new ne(e);return Object.defineProperty(t,"__mf_infrastructure_logger__",{value:!0,enumerable:!1,configurable:!1}),t}re(v),ie(v);async function ae(e,t){try{return await e()}catch(e){!t&&f(e);return}}function oe(e,t){let n=/^(https?:)?\/\//i;return e.replace(n,``).replace(/\/$/,``)===t.replace(n,``).replace(/\/$/,``)}function se(e){let t=null,n=!0,r=2e4,i,a=document.getElementsByTagName(`script`);for(let r=0;r<a.length;r++){let i=a[r],o=i.getAttribute(`src`);if(o&&oe(o,e.url)){t=i,n=!1;break}}if(!t){let n=e.attrs;t=document.createElement(`script`),t.type=(n==null?void 0:n.type)===`module`?`module`:`text/javascript`;let i;e.createScriptHook&&(i=e.createScriptHook(e.url,e.attrs),i instanceof HTMLScriptElement?t=i:typeof i==`object`&&(`script`in i&&i.script&&(t=i.script),`timeout`in i&&i.timeout&&(r=i.timeout))),t.src||(t.src=e.url),n&&!i&&Object.keys(n).forEach(e=>{t&&(e===`async`||e===`defer`?t[e]=n[e]:t.getAttribute(e)||t.setAttribute(e,n[e]))})}let o=null,s=typeof window<`u`?t=>{if(t.filename&&oe(t.filename,e.url)){let n=Error(`ScriptExecutionError: Script "${e.url}" loaded but threw a runtime error during execution: ${t.message} (${t.filename}:${t.lineno}:${t.colno})`);n.name=`ScriptExecutionError`,o=n}}:null;s&&window.addEventListener(`error`,s);let c=async(n,r)=>{clearTimeout(i),s&&window.removeEventListener(`error`,s);let a=()=>{if((r==null?void 0:r.type)===`error`){let t=Error(r!=null&&r.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.)`);t.name=`ScriptNetworkError`,e!=null&&e.onErrorCallback&&(e==null||e.onErrorCallback(t))}else o?e!=null&&e.onErrorCallback&&(e==null||e.onErrorCallback(o)):e!=null&&e.cb&&(e==null||e.cb())};if(t&&(t.onerror=null,t.onload=null,ae(()=>{let{needDeleteScript:n=!0}=e;n&&t!=null&&t.parentNode&&t.parentNode.removeChild(t)}),n&&typeof n==`function`)){let e=n(r);if(e instanceof Promise){let t=await e;return a(),t}return a(),e}a()};return t.onerror=c.bind(null,t.onerror),t.onload=c.bind(null,t.onload),i=setTimeout(()=>{c(null,{type:`error`,isTimeout:!0})},r),{script:t,needAttach:n}}function ce(e){let t=null,n=!0,r=2e4,i,a=document.getElementsByTagName(`link`);for(let r=0;r<a.length;r++){let i=a[r],o=i.getAttribute(`href`),s=i.getAttribute(`rel`);if(o&&oe(o,e.url)&&s===e.attrs.rel){t=i,n=!1;break}}if(!t){t=document.createElement(`link`),t.setAttribute(`href`,e.url);let n,i=!0,a=e.attrs;e.createLinkHook&&(n=e.createLinkHook(e.url,a),n instanceof HTMLLinkElement?(t=n,i=!1):typeof n==`object`&&(`link`in n&&n.link&&(t=n.link,i=!1),`timeout`in n&&n.timeout&&(r=n.timeout))),a&&i&&Object.keys(a).forEach(e=>{t&&!t.getAttribute(e)&&t.setAttribute(e,a[e])})}if(!n)return Promise.resolve().then(()=>{e!=null&&e.cb&&(e==null||e.cb())}),{link:t,needAttach:n};let o=(n,r)=>{i&&clearTimeout(i);let a=()=>{if((r==null?void 0:r.type)===`error`){let t=Error(r!=null&&r.isTimeout?`LinkNetworkError: Link "${e.url}" timed out.`:`LinkNetworkError: Failed to load link "${e.url}" - the URL is unreachable or the server returned an error.`);t.name=`LinkNetworkError`,e!=null&&e.onErrorCallback&&(e==null||e.onErrorCallback(t))}else e!=null&&e.cb&&(e==null||e.cb())};if(t&&(t.onerror=null,t.onload=null,ae(()=>{let{needDeleteLink:n=!0}=e;n&&t!=null&&t.parentNode&&t.parentNode.removeChild(t)}),n)){let e=n(r);return a(),e}a()};return t.onerror=o.bind(null,t.onerror),t.onload=o.bind(null,t.onload),i=setTimeout(()=>{o(null,{type:`error`,isTimeout:!0})},r),{link:t,needAttach:n}}function le(e,t){let{attrs:n={},createScriptHook:r}=t;return new Promise((t,i)=>{let{script:a,needAttach:o}=se({url:e,cb:t,onErrorCallback:i,attrs:{fetchpriority:`high`,...n},createScriptHook:r,needDeleteScript:!0});o&&document.head.appendChild(a)})}var ue=e=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split(`-`)[0].toLowerCase()}#${e.toLowerCase()}`,de=(e,t,n,r)=>{let i=[`${[t[e]]} #${e}`];return n&&i.push(`args: ${JSON.stringify(n)}`),i.push(ue(e)),r&&i.push(`Original Error Message:\n ${r}`),i.join(` `)};function fe(e,t,n,r,i,a){return r(de(e,t,n,i))}var b=`[ Federation Runtime ]`,pe=re(b);function x(e,t,n,r,i){e||(n===void 0?S(t):S(t,n,r,void 0,i))}function S(e,t,n,r,i){if(t!==void 0)return fe(e,t,n??{},e=>{throw Error(`${b}: ${e}`)},r,i);let a=e;throw a instanceof Error?(a.message.startsWith(b)||(a.message=`${b}: ${a.message}`),a):Error(`${b}: ${a}`)}function C(e){e instanceof Error&&(e.message.startsWith(b)||(e.message=`${b}: ${e.message}`)),pe.warn(e)}function me(e,t){return e.findIndex(e=>e===t)===-1&&e.push(t),e}function w(e){return`version`in e&&e.version?`${e.name}:${e.version}`:`entry`in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function he(e){return e.entry!==void 0}function ge(e){return!e.entry.includes(`.json`)}function _e(e){return e&&typeof e==`object`}var ve=Object.prototype.toString;function ye(e){return ve.call(e)===`[object Object]`}function be(e){return Array.isArray(e)?e:[e]}function xe(e){return`remoteEntry`in e?{url:e.remoteEntry,type:e.remoteEntryType,globalName:e.globalName}:{url:``,type:`global`,globalName:``}}var Se=(e,t)=>{let n;return n=e.endsWith(`/`)?e.slice(0,-1):e,t.startsWith(`.`)&&(t=t.slice(1)),n+=t,n},T=typeof globalThis==`object`?globalThis:window,E=(()=>{try{return document.defaultView}catch{return T}})(),D=E;function Ce(e,t,n){Object.defineProperty(e,t,{value:n,configurable:!1,writable:!0})}function we(e,t){return Object.hasOwnProperty.call(e,t)}we(T,`__GLOBAL_LOADING_REMOTE_ENTRY__`)||Ce(T,`__GLOBAL_LOADING_REMOTE_ENTRY__`,{});var O=T.__GLOBAL_LOADING_REMOTE_ENTRY__;function Te(e){we(e,`__VMOK__`)&&!we(e,`__FEDERATION__`)&&Ce(e,`__FEDERATION__`,e.__VMOK__),we(e,`__FEDERATION__`)||(Ce(e,`__FEDERATION__`,{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),Ce(e,`__VMOK__`,e.__FEDERATION__)),e.__FEDERATION__.__GLOBAL_PLUGIN__??=[],e.__FEDERATION__.__INSTANCES__??=[],e.__FEDERATION__.moduleInfo??={},e.__FEDERATION__.__SHARE__??={},e.__FEDERATION__.__MANIFEST_LOADING__??={},e.__FEDERATION__.__PRELOADED_MAP__??=new Map}Te(T),Te(E);function Ee(){T.__FEDERATION__.__GLOBAL_PLUGIN__=[],T.__FEDERATION__.__INSTANCES__=[],T.__FEDERATION__.moduleInfo={},T.__FEDERATION__.__SHARE__={},T.__FEDERATION__.__MANIFEST_LOADING__={},Object.keys(O).forEach(e=>{delete O[e]})}function De(e){T.__FEDERATION__.__INSTANCES__.push(e)}function Oe(){return T.__FEDERATION__.__DEBUG_CONSTRUCTOR__}function ke(e,t=c()){t&&(T.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,T.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__=`2.8.1`)}function k(e,t){if(typeof t==`string`){if(e[t])return{value:e[t],key:t};{let n=Object.keys(e);for(let r of n){let[n,i]=r.split(`:`),a=`${n}:${t}`,o=e[a];if(o)return{value:o,key:a}}return{value:void 0,key:t}}}S(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`)}var Ae=()=>E.__FEDERATION__.moduleInfo,je=(e,t)=>{let n=k(t,w(e)).value;if(n&&!n.version&&`version`in e&&e.version&&(n.version=e.version),n)return n;if(`version`in e&&e.version){let{version:t,...n}=e,r=w(n),i=k(E.__FEDERATION__.moduleInfo,r).value;if((i==null?void 0:i.version)===t)return i}},A=e=>je(e,E.__FEDERATION__.moduleInfo),Me=(e,t)=>{let n=w(e);return E.__FEDERATION__.moduleInfo[n]=t,E.__FEDERATION__.moduleInfo},Ne=e=>(E.__FEDERATION__.moduleInfo={...E.__FEDERATION__.moduleInfo,...e},()=>{let t=Object.keys(e);for(let e of t)delete E.__FEDERATION__.moduleInfo[e]}),Pe=(e,t)=>{let n=t||`__FEDERATION_${e}:custom__`;return{remoteEntryKey:n,entryExports:T[n]}},Fe=e=>{let{__GLOBAL_PLUGIN__:t}=E.__FEDERATION__;e.forEach(e=>{t.findIndex(t=>t.name===e.name)===-1?t.push(e):C(`The plugin ${e.name} has been registered.`)})},Ie=()=>E.__FEDERATION__.__GLOBAL_PLUGIN__,Le=e=>T.__FEDERATION__.__PRELOADED_MAP__.get(e),Re=e=>T.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),ze=`[0-9A-Za-z-]+`,Be=`(?:\\+(${ze}(?:\\.${ze})*))`,j=`0|[1-9]\\d*`,Ve=`[0-9]+`,He=`\\d*[a-zA-Z-][a-zA-Z0-9-]*`,Ue=`(?:${Ve}|${He})`,We=`(?:-?(${Ue}(?:\\.${Ue})*))`,Ge=`(?:${j}|${He})`,Ke=`(?:-(${Ge}(?:\\.${Ge})*))`,qe=`${j}|x|X|\\*`,M=`[v=\\s]*(${qe})(?:\\.(${qe})(?:\\.(${qe})(?:${Ke})?${Be}?)?)?`,Je=`^\\s*(${M})\\s+-\\s+(${M})\\s*$`,Ye=`[v=\\s]*${`(${Ve})\\.(${Ve})\\.(${Ve})`}${We}?${Be}?`,Xe=`((?:<|>)?=?)`,Ze=`(\\s*)${Xe}\\s*(${Ye}|${M})`,Qe=`(?:~>?)`,$e=`(\\s*)${Qe}\\s+`,et=`(?:\\^)`,tt=`(\\s*)${et}\\s+`,nt=`(<|>)?=?\\s*\\*`,rt=`^${et}${M}$`,it=`v?${`(${j})\\.(${j})\\.(${j})`}${Ke}?${Be}?`,at=`^${Qe}${M}$`,ot=`^${Xe}\\s*${M}$`,st=`^${Xe}\\s*(${it})$|^$`,ct=`^\\s*>=\\s*0.0.0\\s*$`;function N(e){return new RegExp(e)}function P(e){return!e||e.toLowerCase()===`x`||e===`*`}function lt(...e){return t=>e.reduce((e,t)=>t(e),t)}function ut(e){return e.match(N(st))}function dt(e,t,n,r){let i=`${e}.${t}.${n}`;return r?`${i}-${r}`:i}function ft(e){return e.replace(N(Je),(e,t,n,r,i,a,o,s,c,l,u,d)=>(t=P(n)?``:P(r)?`>=${n}.0.0`:P(i)?`>=${n}.${r}.0`:`>=${t}`,s=P(c)?``:P(l)?`<${Number(c)+1}.0.0-0`:P(u)?`<${c}.${Number(l)+1}.0-0`:d?`<=${c}.${l}.${u}-${d}`:`<=${s}`,`${t} ${s}`.trim()))}function pt(e){return e.replace(N(Ze),`$1$2$3`)}function mt(e){return e.replace(N($e),`$1~`)}function ht(e){return e.replace(N(tt),`$1^`)}function gt(e){return e.trim().split(/\s+/).map(e=>e.replace(N(rt),(e,t,n,r,i)=>P(t)?``:P(n)?`>=${t}.0.0 <${Number(t)+1}.0.0-0`:P(r)?t===`0`?`>=${t}.${n}.0 <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.0 <${Number(t)+1}.0.0-0`:i?t===`0`?n===`0`?`>=${t}.${n}.${r}-${i} <${t}.${n}.${Number(r)+1}-0`:`>=${t}.${n}.${r}-${i} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${r}-${i} <${Number(t)+1}.0.0-0`:t===`0`?n===`0`?`>=${t}.${n}.${r} <${t}.${n}.${Number(r)+1}-0`:`>=${t}.${n}.${r} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${r} <${Number(t)+1}.0.0-0`)).join(` `)}function _t(e){return e.trim().split(/\s+/).map(e=>e.replace(N(at),(e,t,n,r,i)=>P(t)?``:P(n)?`>=${t}.0.0 <${Number(t)+1}.0.0-0`:P(r)?`>=${t}.${n}.0 <${t}.${Number(n)+1}.0-0`:i?`>=${t}.${n}.${r}-${i} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${r} <${t}.${Number(n)+1}.0-0`)).join(` `)}function vt(e){return e.split(/\s+/).map(e=>e.trim().replace(N(ot),(e,t,n,r,i,a)=>{let o=P(n),s=o||P(r),c=s||P(i);return t===`=`&&c&&(t=``),a=``,o?t===`>`||t===`<`?`<0.0.0-0`:`*`:t&&c?(s&&(r=0),i=0,t===`>`?(t=`>=`,s?(n=Number(n)+1,r=0,i=0):(r=Number(r)+1,i=0)):t===`<=`&&(t=`<`,s?n=Number(n)+1:r=Number(r)+1),t===`<`&&(a=`-0`),`${t+n}.${r}.${i}${a}`):s?`>=${n}.0.0${a} <${Number(n)+1}.0.0-0`:c?`>=${n}.${r}.0${a} <${n}.${Number(r)+1}.0-0`:e})).join(` `)}function yt(e){return e.trim().replace(N(nt),``)}function bt(e){return e.trim().replace(N(ct),``)}function xt(e,t){return e=Number(e)||e,t=Number(t)||t,e>t?1:e===t?0:-1}function St(e,t){let{preRelease:n}=e,{preRelease:r}=t;if(n===void 0&&r)return 1;if(n&&r===void 0)return-1;if(n===void 0&&r===void 0)return 0;for(let e=0,t=n.length;e<=t;e++){let t=n[e],i=r[e];if(t!==i)return t===void 0&&i===void 0?0:t?i?xt(t,i):-1:1}return 0}function Ct(e,t){return xt(e.major,t.major)||xt(e.minor,t.minor)||xt(e.patch,t.patch)||St(e,t)}function wt(e,t){return e.version===t.version}function Tt(e,t){switch(e.operator){case``:case`=`:return wt(e,t);case`>`:return Ct(e,t)<0;case`>=`:return wt(e,t)||Ct(e,t)<0;case`<`:return Ct(e,t)>0;case`<=`:return wt(e,t)||Ct(e,t)>0;case void 0:return!0;default:return!1}}function Et(e){return lt(gt,_t,vt,yt)(e)}function Dt(e){return lt(ft,pt,mt,ht)(e.trim()).split(/\s+/).join(` `)}function F(e,t){if(!e)return!1;let n=ut(e);if(!n)return!1;let[,r,,i,a,o,s]=n,c={operator:r,version:dt(i,a,o,s),major:i,minor:a,patch:o,preRelease:s==null?void 0:s.split(`.`)},l=t.split(`||`);for(let e of l){let t=e.trim();if(!t||t===`*`||t===`x`)return!0;try{let e=Dt(t);if(!e.trim())return!0;let n=e.split(` `).map(e=>Et(e)).join(` `);if(!n.trim())return!0;let r=n.split(/\s+/).map(e=>bt(e)).filter(Boolean);if(r.length===0)continue;let i=!0;for(let e of r){let t=ut(e);if(!t){i=!1;break}let[,n,,r,a,o,s]=t;if(!Tt({operator:n,version:dt(r,a,o,s),major:r,minor:a,patch:o,preRelease:s==null?void 0:s.split(`.`)},c)){i=!1;break}}if(i)return!0}catch(e){console.error(`[semver] Error processing range part "${t}":`,e);continue}}return!1}var Ot=`default`,kt=`global`;function At(e,t,n,r){var a,o;let s;return s=`get`in e?e.get:`lib`in e?()=>Promise.resolve(e.lib):()=>Promise.resolve(()=>{S(`Cannot get shared "${n}" from "${t}": neither "get" nor "lib" is provided in the share config.`)}),(a=e.shareConfig)!=null&&a.eager&&(o=e.treeShaking)!=null&&o.mode&&S(`Invalid shared config for "${n}" 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:s,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??r)||`version-first`,treeShaking:e.treeShaking?{...e.treeShaking,mode:e.treeShaking.mode??`server-calc`,status:e.treeShaking.status??i.UNKNOWN,useIn:[]}:void 0}}function jt(e,t){let n=t.shared||{},r=t.name,i=Object.keys(n).reduce((e,i)=>{let a=be(n[i]);return e[i]=e[i]||[],a.forEach(n=>{e[i].push(At(n,r,i,t.shareStrategy))}),e},{}),a={...e.shared};return Object.keys(i).forEach(e=>{a[e]?i[e].forEach(t=>{a[e].find(e=>e.version===t.version)||a[e].push(t)}):a[e]=i[e]}),{allShareInfos:a,newShareInfos:i}}function I(e,t){if(!e)return!1;let{status:n,mode:r}=e;return n===i.NO_USE?!1:n===i.CALCULATED?!0:r===`runtime-infer`?!t||Nt(e,t):!1}function L(e,t){let n=e=>{if(!Number.isNaN(Number(e))){let t=e.split(`.`),n=e;for(let e=0;e<3-t.length;e++)n+=`.0`;return n}return e};return!!F(n(e),`<=${n(t)}`)}var R=(e,t)=>{let n=t||function(e,t){return L(e,t)};return Object.keys(e).reduce((e,t)=>!e||n(e,t)||e===`0`?t:e,0)},z=e=>!!e.loaded||typeof e.lib==`function`,Mt=e=>!!e.loading,Nt=(e,t)=>{if(!e||!t)return!1;let{usedExports:n}=e;return n?!!t.every(e=>n.includes(e)):!1};function Pt(e,t,n,r){let i=e[t][n],a=``,o=I(r),s=function(e,t){return o?i[e].treeShaking?i[t].treeShaking?!z(i[e].treeShaking)&&L(e,t):!1:!0:!z(i[e])&&L(e,t)};if(o){if(a=R(e[t][n],s),a)return{version:a,useTreesShaking:o};o=!1}return{version:R(e[t][n],s),useTreesShaking:o}}var B=e=>z(e)||Mt(e);function Ft(e,t,n,r){let i=e[t][n],a=``,o=I(r),s=function(e,t){if(o){if(!i[e].treeShaking)return!0;if(!i[t].treeShaking)return!1;if(B(i[t].treeShaking))return!B(i[e].treeShaking)||!!L(e,t);if(B(i[e].treeShaking))return!1}return B(i[t])?!B(i[e])||!!L(e,t):!B(i[e])&&L(e,t)};if(o){if(a=R(e[t][n],s),a)return{version:a,useTreesShaking:o};o=!1}return{version:R(e[t][n],s),useTreesShaking:o}}function It(e){return e===`loaded-first`?Ft:Pt}function V(e,t,n,r){if(!e)return;let{shareConfig:i,scope:a=Ot,strategy:o,treeShaking:s}=n,c=Array.isArray(a)?a:[a];for(let a of c)if(i&&e[a]&&e[a][t]){let{requiredVersion:c}=i,{version:l,useTreesShaking:u}=It(o)(e,a,t,s),d={shareScopeMap:e,scope:a,pkgName:t,version:l,GlobalFederation:D.__FEDERATION__,shareInfo:n,resolver:()=>{let r=e[a][t][l];if(i.singleton){if(typeof c==`string`&&!F(l,c)){let e=`Version ${l} from ${l&&r.from} of shared singleton module ${t} does not satisfy the requirement of ${n.from} which needs ${c})`;i.strictVersion?S(e):C(e)}return{shared:r,useTreesShaking:u}}{if(c===!1||c===`*`||F(l,c))return{shared:r,useTreesShaking:u};let n=I(s);if(n){for(let[r,i]of Object.entries(e[a][t]))if(I(i.treeShaking,s==null?void 0:s.usedExports)&&F(r,c))return{shared:i,useTreesShaking:n}}for(let[n,r]of Object.entries(e[a][t]))if(F(n,c))return{shared:r,useTreesShaking:!1}}}};return(r.emit(d)||d).resolver()}}function Lt(){return D.__FEDERATION__.__SHARE__}function Rt(e){let{pkgName:t,extraOptions:n,shareInfos:r}=e,i=(n==null?void 0:n.resolver)??(e=>{if(!e)return;let t={};return e.forEach(e=>{t[e.version]=e}),t[R(t,function(e,n){return!z(t[e])&&L(e,n)})]}),a=e=>typeof e==`object`&&!!e&&!Array.isArray(e),o=(...e)=>{let t={};for(let n of e)if(n)for(let[e,r]of Object.entries(n)){let n=t[e];a(n)&&a(r)?t[e]=o(n,r):r!==void 0&&(t[e]=r)}return t};return o(i(r[t]),n==null?void 0:n.customShareInfo)}var H=(e,t)=>{e.useIn||=[],me(e.useIn,t)};function zt(e,t){return t&&e.treeShaking?e.treeShaking:e}function Bt(e,t){return!t||t===`.`?e:`${e}/${t.replace(/^\.\//,``)}`}function Vt(e,t){for(let n of e){let e=t.startsWith(n.name),r=t.replace(n.name,``);if(e){if(r.startsWith(`/`)){let e=n.name;return r=`.${r}`,{pkgNameOrAlias:e,expose:r,remote:n}}if(r===``)return{pkgNameOrAlias:n.name,expose:`.`,remote:n}}let i=n.alias&&t.startsWith(n.alias),a=n.alias&&t.replace(n.alias,``);if(n.alias&&i){if(a&&a.startsWith(`/`)){let e=n.alias;return a=`.${a}`,{pkgNameOrAlias:e,expose:a,remote:n}}if(a===``)return{pkgNameOrAlias:n.alias,expose:`.`,remote:n}}}}function Ht(e,t){for(let n of e)if(t===n.name||n.alias&&t===n.alias)return n}var Ut=`RUNTIME-001`,Wt=`RUNTIME-002`,Gt=`RUNTIME-003`,Kt=`RUNTIME-004`,qt=`RUNTIME-005`,Jt=`RUNTIME-006`,Yt=`RUNTIME-007`,Xt=`RUNTIME-008`,Zt=`RUNTIME-009`,Qt=`RUNTIME-010`,$t=`RUNTIME-011`,en=`RUNTIME-012`,tn=`RUNTIME-013`,nn=`RUNTIME-014`,rn=`RUNTIME-015`,an=`TYPE-001`,on=`BUILD-001`,sn=`BUILD-002`,U={[Ut]:`Failed to get remoteEntry exports.`,[Wt]:`The remote entry interface does not contain "init"`,[Gt]:`Failed to get manifest.`,[Kt]:`Failed to locate remote.`,[qt]:`Invalid loadShareSync function call from bundler runtime`,[Jt]:`Invalid loadShareSync function call from runtime`,[Yt]:`Failed to get remote snapshot.`,[Xt]:`Failed to load script resources.`,[Zt]:`Please call createInstance first.`,[Qt]:`The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.`,[$t]:`The remoteEntry URL is missing from the remote snapshot.`,[en]:`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.`,[tn]:`The manifest is not a valid Module Federation manifest.`,[nn]:`The remote does not expose the requested module.`,[rn]:`Remote container initialization failed.`},cn={[an]:`Failed to generate type declaration. Execute the below cmd to reproduce and fix the error.`},ln={[on]:`Failed to find expose module.`,[sn]:`PublicPath is required in prod mode.`};({...U,...cn,...ln});var un=`.then(callbacks[0]).catch(callbacks[1])`;function dn(e){return e===`esm`||e===`module`}async function fn({entry:t,remoteEntryExports:n}){return new Promise((r,i)=>{try{n?r(n):typeof FEDERATION_ALLOW_NEW_FUNCTION<`u`?Function(`callbacks`,`import("${t}")${un}`)([r,i]):e(()=>import(t).then(r),[],import.meta.url).catch(i)}catch(e){S(`Failed to load ESM entry from "${t}". ${e instanceof Error?e.message:String(e)}`)}})}async function pn({entry:e,remoteEntryExports:t}){return new Promise((n,r)=>{try{t?n(t):typeof __system_context__>`u`?System.import(e).then(n).catch(r):Function(`callbacks`,`System.import("${e}")${un}`)([n,r])}catch(t){S(`Failed to load SystemJS entry from "${e}". ${t instanceof Error?t.message:String(t)}`)}})}function mn(e,t,n){let{remoteEntryKey:r,entryExports:i}=Pe(e,t);return i||S(Ut,U,{remoteName:e,remoteEntryUrl:n,remoteEntryKey:r}),i}async function hn({name:e,globalName:t,entry:n,remoteInfo:r,loaderHook:i,getEntryUrl:a,resourceContext:o}){let{entryExports:s}=Pe(e,t);if(s)return s;let c=a?a(n):n;return le(c,{attrs:{},createScriptHook:(e,t)=>{let n=i.lifecycle.createScript.emit({url:e,attrs:t,remoteInfo:r,resourceContext:o?{...o,url:e}:void 0});if(n&&(n instanceof HTMLScriptElement||`script`in n||`timeout`in n))return n}}).then(()=>mn(e,t,n),t=>{let n=t instanceof Error?t.message:String(t);S(Xt,U,{remoteName:e,resourceUrl:c},n)})}async function gn({remoteInfo:e,remoteEntryExports:t,loaderHook:n,getEntryUrl:r,resourceContext:i}){let{entry:a,entryGlobalName:o,name:s,type:c}=e;return dn(c)?fn({entry:a,remoteEntryExports:t}):c===`system`?pn({entry:a,remoteEntryExports:t}):hn({entry:a,globalName:o,name:s,remoteInfo:e,loaderHook:n,getEntryUrl:r,resourceContext:i})}function _n(e){let{entry:t,name:n}=e;return u(n,t)}async function vn(e){let{origin:t,remoteEntryExports:n,remoteInfo:r,getEntryUrl:i,resourceContext:a,_inErrorHandling:o=!1}=e,s=_n(r);if(n)return n;if(!O[s]){let e=t.remoteHandler.hooks.lifecycle.loadEntry,c=t.loaderHook;O[s]=e.emit({origin:t,loaderHook:c,remoteInfo:r,remoteEntryExports:n}).then(e=>e||gn({remoteInfo:r,remoteEntryExports:n,loaderHook:c,getEntryUrl:i,resourceContext:a})).then(async e=>(await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,remoteEntryExports:e}),e)).catch(async e=>{let i=_n(r),a=e instanceof Error&&e.message.includes(`ScriptExecutionError`);if(e instanceof Error&&e.message.includes(`RUNTIME-008`)&&!a&&!o){let e=await t.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:e=>vn({...e,_inErrorHandling:!0}),origin:t,remoteInfo:r,remoteEntryExports:n,globalLoading:O,uniqueKey:i});if(e)return await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,remoteEntryExports:e,recovered:!0}),e}throw await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,error:e}),e})}return O[s]}function W(e){return{...e,entry:`entry`in e?e.entry:``,type:e.type||`global`,entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||`default`}}function yn(){return typeof FEDERATION_BUILD_IDENTIFIER<`u`?FEDERATION_BUILD_IDENTIFIER:``}function bn(e,t){let n=Ie(),r=[t.hooks,t.remoteHandler.hooks,t.sharedHandler.hooks,t.snapshotHandler.hooks,t.loaderHook,t.bridgeHook];return n.length>0&&n.forEach(t=>{e!=null&&e.find(e=>e.name!==t.name)&&e.push(t)}),e&&e.length>0&&e.forEach(e=>{r.forEach(n=>{n.applyPlugin(e,t)})}),e}function xn(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 G(e){var t,n;let r={};for(let[t,n]of Object.entries(e.shared)){var i,a,o,s;let e=n[0];e&&(r[t]={version:e.version,singleton:(i=e.shareConfig)==null?void 0:i.singleton,requiredVersion:((a=e.shareConfig)==null?void 0:a.requiredVersion)===!1?!1:(o=e.shareConfig)==null?void 0:o.requiredVersion,eager:e.eager,strictVersion:(s=e.shareConfig)==null?void 0:s.strictVersion})}return{project:{name:e.name,mfRole:((t=e.remotes)==null?void 0:t.length)>0?`host`:`unknown`},mfConfig:{name:e.name,remotes:((n=e.remotes)==null?void 0:n.map(xn))??[],shared:r}}}function Sn(e){return{resourceCategory:`sync`,share:!0,depsRemote:!0,...e}}function Cn(e,t){return t.map(t=>{let n=Ht(e,t.nameOrAlias);return x(n,`Unable to preload ${t.nameOrAlias} as it is not included in ${!n&&p({remoteInfo:n,remotes:e})}`),{remote:n,preloadConfig:Sn(t)}})}function wn(e){return e?e.map(e=>e===`.`?e:e.startsWith(`./`)?e.replace(`./`,``):e):[]}function Tn(e){return e instanceof Error?e.message.includes(`timed out`)||e.name.includes(`Timeout`):!1}function K(e,t,n,r){return{url:t,status:n,resourceType:e.resourceType,initiator:e.initiator,id:e.id,error:r}}async function En(e,t,n,r){let i=e.moduleCache.get(n.name),a=n.entry;if(i!=null&&i.remoteEntryExports)return K(r,a,`cached`);try{if(!await vn({origin:e,remoteInfo:n,remoteEntryExports:i==null?void 0:i.remoteEntryExports,resourceContext:{...r,url:a}}))throw Error(`Failed to load remoteEntry "${a}".`);return K(r,a,`success`)}catch(e){return K(r,a,Tn(e)?`timeout`:`error`,e)}}function Dn({host:e,remoteInfo:t,url:n,attrs:r,context:i,needDeleteLink:a}){return new Promise(o=>{let{link:s,needAttach:c}=ce({url:n,cb:()=>{o(K(i,n,c?`success`:`cached`))},onErrorCallback:e=>{o(K(i,n,Tn(e)?`timeout`:`error`,e))},attrs:r,createLinkHook:(n,r)=>{let a=e.loaderHook.lifecycle.createLink.emit({url:n,attrs:r,remoteInfo:t,resourceContext:{...i,url:n}});return a instanceof HTMLLinkElement,a},needDeleteLink:a});c&&document.head.appendChild(s)})}function On({host:e,remoteInfo:t,url:n,attrs:r,context:i}){return new Promise(a=>{let{script:o,needAttach:s}=se({url:n,cb:()=>{a(K(i,n,s?`success`:`cached`))},onErrorCallback:e=>{a(K(i,n,Tn(e)?`timeout`:`error`,e))},attrs:r,createScriptHook:(n,r)=>{let a=e.loaderHook.lifecycle.createScript.emit({url:n,attrs:r,remoteInfo:t,resourceContext:{...i,url:n}});return a instanceof HTMLScriptElement,a},needDeleteScript:!0});s&&document.head.appendChild(o)})}function kn(e,t){return{...e,resourceType:t}}function An(e,t,n,r=!0,i={initiator:`preloadRemote`,id:e.name}){let{cssAssets:a,jsAssetsWithoutEntry:o,entryAssets:s}=n,c=[];if(t.options.inBrowser){if(s.forEach(n=>{let{moduleInfo:r}=n;c.push(En(t,e,r,kn(i,`remoteEntry`)))}),r){let n={rel:`preload`,as:`style`};a.forEach(r=>{c.push(Dn({host:t,remoteInfo:e,url:r,attrs:n,context:kn(i,`css`)}))})}else{let n={rel:`stylesheet`,type:`text/css`};a.forEach(r=>{c.push(Dn({host:t,remoteInfo:e,url:r,attrs:n,needDeleteLink:!1,context:kn(i,`css`)}))})}let n=On,l={fetchpriority:`high`,type:`text/javascript`};r?(n=Dn,l={rel:`preload`,as:`script`}):dn(e.type)&&(n=Dn,l={rel:`modulepreload`,fetchpriority:`high`}),o.forEach(r=>{c.push(n({host:t,remoteInfo:e,url:r,attrs:l,context:kn(i,`js`)}))})}return Promise.all(c)}var jn={global:{Global:D,nativeGlobal:E,resetFederationGlobalInfo:Ee,setGlobalFederationInstance:De,getGlobalFederationConstructor:Oe,setGlobalFederationConstructor:ke,getInfoWithoutType:k,getGlobalSnapshot:Ae,getTargetSnapshotInfoByModuleInfo:je,getGlobalSnapshotInfoByModuleInfo:A,setGlobalSnapshotInfoByModuleInfo:Me,addGlobalSnapshot:Ne,getRemoteEntryExports:Pe,registerGlobalPlugins:Fe,getGlobalHostPlugins:Ie,getPreloaded:Le,setPreloaded:Re},share:{getRegisteredShare:V,getGlobalShareScope:Lt},utils:{matchRemoteWithNameAndExpose:Vt,preloadAssets:An,getRemoteInfo:W}};function Mn(e){if(!e||!(`modules`in e)||!Array.isArray(e.modules))return;let t=e.modules.map(e=>e.moduleName).filter(Boolean);return t.length?t.join(`,`):void 0}function Nn(e,t,n){let r=t,i=Array.isArray(e.shareScope)?e.shareScope:[e.shareScope];i.length||i.push(`default`),i.forEach(e=>{r[e]||(r[e]={})});let a={version:e.version||``,shareScopeKeys:Array.isArray(e.shareScope)?i:e.shareScope||`default`};return Object.defineProperty(a,"shareScopeMap",{value:r,enumerable:!1}),{remoteEntryInitOptions:a,shareScope:r[i[0]],initScope:n??[]}}var Pn=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;let t=await vn({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,resourceContext:{initiator:`loadRemote`,id:Bt(this.remoteInfo.name,e),resourceType:`remoteEntry`}});return x(t,`remoteEntryExports is undefined \n ${p(this.remoteInfo)}`),this.remoteEntryExports=t,this.remoteEntryExports}async init(e,t,n,r){let i=await this.getEntry(r);if(this.inited)return await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:i,cached:!0,origin:this.host}),i;if(this.initPromise){try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:i,cached:!0,origin:this.host})}catch(n){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:i,error:n,cached:!0,origin:this.host}),n}return i}this.initing=!0,this.initPromise=(async()=>{await this.host.loaderHook.lifecycle.beforeInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,origin:this.host});let{remoteEntryInitOptions:r,shareScope:a,initScope:o}=Nn(this.remoteInfo,this.host.shareScopeMap,n),s=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:a,remoteEntryInitOptions:r,initScope:o,remoteInfo:this.remoteInfo,origin:this.host});(i==null?void 0:i.init)===void 0&&S(Wt,U,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName},void 0,G(this.host.options));try{await i.init(s.shareScope,s.initScope,s.remoteEntryInitOptions)}catch(e){S(rn,U,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName,shareScope:this.remoteInfo.shareScope},`${e}`,G(this.host.options))}await this.host.hooks.lifecycle.initContainer.emit({...s,id:e,remoteSnapshot:t,remoteEntryExports:i}),this.inited=!0})();try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:i,origin:this.host})}catch(n){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:i,error:n,origin:this.host}),n}finally{this.initing=!1,this.initPromise=void 0}return i}async get(e,t,n,r){let{loadFactory:i=!0}=n||{loadFactory:!0},a=await this.init(e,r,void 0,t);this.lib=a,await this.host.loaderHook.lifecycle.beforeGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:a,origin:this.host});let o;try{let n=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:a,expose:t,moduleInfo:this.remoteInfo});o=typeof n==`function`?n:void 0,o||=await a.get(t),o||S(nn,U,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,expose:t,requestId:e,availableExposes:Mn(r)},void 0,G(this.host.options)),await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:a,moduleFactory:o,origin:this.host})}catch(n){throw await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:a,error:n,origin:this.host}),n}let s=Se(this.remoteInfo.name,t),c=this.wraperFactory(o,s);if(!i)return c;await this.host.loaderHook.lifecycle.beforeExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:i,origin:this.host});try{let n=await c();return await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:i,exposeModule:n,origin:this.host}),n}catch(n){throw await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:i,error:n,origin:this.host}),n}}wraperFactory(e,t){function n(e,t){e&&typeof e==`object`&&Object.isExtensible(e)&&!Object.getOwnPropertyDescriptor(e,Symbol.for(`mf_module_id`))&&Object.defineProperty(e,Symbol.for(`mf_module_id`),{value:t,enumerable:!1})}return()=>{let r=e();return r instanceof Promise?r.then(e=>(n(e,t),e)):(n(r,t),r)}}},q=class{constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}applyPlugin(e,t){x(ye(e),`Plugin configuration is invalid.`);let n=e.name;if(x(n,`A name must be provided by the plugin.`),!this.registerPlugins[n]){var r;this.registerPlugins[n]=e,(r=e.apply)==null||r.call(e,t),Object.keys(this.lifecycle).forEach(t=>{let n=e[t];n&&this.lifecycle[t].on(n)})}}removePlugin(e){x(e,`A name is required.`);let t=this.registerPlugins[e];x(t,`The plugin "${e}" is not registered.`),Object.keys(t).forEach(e=>{e!==`name`&&this.lifecycle[e].remove(t[e])})}},J=class{constructor(e){this.type=``,this.listeners=new Set,e&&(this.type=e)}on(e){typeof e==`function`&&this.listeners.add(e)}once(e){let t=this;this.on(function n(...r){return t.remove(n),e.apply(null,r)})}emit(...e){let t;return this.listeners.size>0&&this.listeners.forEach(n=>{let r=n(...e);r!==void 0&&(t=r)}),t}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}},Y=class extends J{emit(...e){let t,n=Array.from(this.listeners);if(n.length>0){let r=0,i=t=>t===!1?!1:r<n.length?Promise.resolve(n[r++].apply(null,e)).then(n=>n===void 0||e.length===1&&n===e[0]?i(t):i(n)):t;t=i()}return Promise.resolve(t)}};function Fn(e,t){if(!_e(t))return!1;if(e!==t){for(let n in e)if(!(n in t))return!1}return!0}var X=class extends J{constructor(e){super(),this.onerror=S,this.type=e}emit(e){_e(e)||S(`The data for the "${this.type}" hook should be an object.`);for(let t of this.listeners)try{let n=t(e);if(n===void 0)continue;if(Fn(e,n))e=n;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(e){C(e),this.onerror(e)}return e}},Z=class extends J{constructor(e){super(),this.onerror=S,this.type=e}emit(e){_e(e)||S(`The response data for the "${this.type}" hook must be an object.`);let t=Array.from(this.listeners);if(t.length>0){let n=0,r=t=>(C(t),this.onerror(t),e),i=a=>{if(a!==void 0&&Fn(e,a))e=a;else if(a!==void 0)return this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`),e;if(n<t.length)try{return Promise.resolve(t[n++](e)).then(i,r)}catch(e){return r(e)}return e};return Promise.resolve(i(e))}return Promise.resolve(e)}},Q=`Remote loading is disabled by experiments.optimization.disableRemote.`,In=class{constructor(){this.hooks=new q({})}formatAndRegisterRemote(){return[]}loadRemote(){throw Error(Q)}preloadRemote(){throw Error(Q)}registerRemotes(){throw Error(Q)}getRemoteModuleAndOptions(){throw Error(Q)}initRawContainer(){throw Error(Q)}};function Ln(e,t){let n=xe(t);n.url||S($t,U,{remoteName:e.name});let r=d(t,n.url);e.type=n.type,e.entryGlobalName=n.globalName,e.entry=r,e.version=t.version,e.buildVersion=t.buildVersion}function Rn(){return{name:`snapshot-plugin`,async afterResolve(e){let{remote:t,pkgNameOrAlias:n,expose:r,origin:i,remoteInfo:a,id:o}=e;if(!he(t)||!ge(t)){let{remoteSnapshot:s,globalSnapshot:c}=await i.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:t,id:Bt(t.name,r)});Ln(a,s);let l={remote:t,preloadConfig:{nameOrAlias:n,exposes:[r],resourceCategory:`sync`,share:!1,depsRemote:!1}},u=await i.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:i,preloadOptions:l,remoteInfo:a,remote:t,remoteSnapshot:s,globalSnapshot:c});return u&&An(a,i,u,!1,{initiator:`loadRemote`,id:o}).catch(()=>void 0),{...e,remoteSnapshot:s}}return e}}}function zn(e){let 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 Bn(e,t,n,r,i={},a){let{value:o}=k(e,w(t)),s=a||o;if(s&&!_(s)&&(n(s,t,r),s.remotesInfo)){let t=Object.keys(s.remotesInfo);for(let r of t){if(i[r])continue;i[r]=!0;let t=zn(r),a=s.remotesInfo[r];Bn(e,{name:t.name,version:a.matchedVersion},n,!1,i,void 0)}}}var Vn=(e,t)=>document.querySelector(`${e}[${e===`link`?`href`:`src`}="${t}"]`);function Hn(e,t,n,r,i){let a=[],o=[],s=[],c=new Set,l=new Set,{options:u}=e,{preloadConfig:f}=t,{depsRemote:p}=f;if(Bn(r,n,(t,n,r)=>{var i;let c;if(r)c=f;else if(Array.isArray(p)){let e=p.find(e=>e.nameOrAlias===n.name||e.nameOrAlias===n.alias);if(!e)return;c=Sn(e)}else if(p===!0)c=f;else return;let l=d(t,xe(t).url);l&&s.push({name:n.name,moduleInfo:{name:n.name,entry:l,type:`remoteEntryType`in t?t.remoteEntryType:`global`,entryGlobalName:`globalName`in t?t.globalName:n.name,shareScope:``,version:`version`in t?t.version:void 0},url:l});let u=`modules`in t?t.modules:[],m=wn(c.exposes);m.length&&`modules`in t&&(u=t==null||(i=t.modules)==null?void 0:i.reduce((e,t)=>((m==null?void 0:m.indexOf(t.moduleName))!==-1&&e.push(t),e),[]));function h(e){let n=e.map(e=>d(t,e));return c.filter?n.filter(c.filter):n}if(u){let r=u.length;for(let i=0;i<r;i++){let r=u[i],s=`${n.name}/${r.moduleName}`;e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:r.moduleName===`.`?n.name:s,name:n.name,remoteSnapshot:t,preloadConfig:c,remote:n,origin:e}),!Le(s)&&(c.resourceCategory===`all`?(a.push(...h(r.assets.css.async)),a.push(...h(r.assets.css.sync)),o.push(...h(r.assets.js.async)),o.push(...h(r.assets.js.sync))):c.resourceCategory===`sync`&&(a.push(...h(r.assets.css.sync)),o.push(...h(r.assets.js.sync))),Re(s))}}},!0,{},i),i.shared&&i.shared.length>0){let t=(t,n)=>{let{shared:r}=V(e.shareScopeMap,n.sharedName,t,e.sharedHandler.hooks.lifecycle.resolveShare)||{};r&&typeof r.lib==`function`&&(n.assets.js.sync.forEach(e=>{c.add(e)}),n.assets.css.sync.forEach(e=>{l.add(e)}))};i.shared.forEach(e=>{var n;let r=(n=u.shared)==null?void 0:n[e.sharedName];if(!r)return;let i=e.version?r.find(t=>t.version===e.version):r;i&&be(i).forEach(n=>{t(n,e)})})}let m=o.filter(e=>!c.has(e)&&!Vn(`script`,e));return{cssAssets:a.filter(e=>!l.has(e)&&!Vn(`link`,e)),jsAssetsWithoutEntry:m,entryAssets:s.filter(e=>!Vn(`script`,e.url))}}var Un=function(){return{name:`generate-preload-assets-plugin`,async generatePreloadAssets(e){let{origin:t,preloadOptions:n,remoteInfo:r,remote:i,globalSnapshot:a,remoteSnapshot:o}=e;return he(i)&&ge(i)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:i.name,url:i.entry,moduleInfo:{name:r.name,entry:i.entry,type:r.type||`global`,entryGlobalName:``,shareScope:``}}]}:(Ln(r,o),Hn(t,n,r,a,o))}}};function Wn(e,t){let n=A({name:t.name,version:t.options.version}),r=n&&`remotesInfo`in n&&n.remotesInfo&&k(n.remotesInfo,e.name).value;return r&&r.matchedVersion?{hostGlobalSnapshot:n,globalSnapshot:Ae(),remoteSnapshot:A({name:e.name,version:r.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:Ae(),remoteSnapshot:A({name:e.name,version:`version`in e?e.version:void 0})}}var Gn=class{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new q({beforeLoadRemoteSnapshot:new Y(`beforeLoadRemoteSnapshot`),loadSnapshot:new Z(`loadGlobalSnapshot`),loadRemoteSnapshot:new Z(`loadRemoteSnapshot`),afterLoadSnapshot:new Z(`afterLoadSnapshot`)}),this.manifestLoading=D.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}async loadRemoteSnapshotInfo({moduleInfo:e,id:t,initiator:n=`loadRemote`}){let{options:r}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:r,moduleInfo:e,origin:this.HostInstance});let i=A({name:this.HostInstance.options.name,version:this.HostInstance.options.version});i||(i={version:this.HostInstance.options.version||``,remoteEntry:``,remotesInfo:{}},Ne({[this.HostInstance.options.name]:i})),i&&`remotesInfo`in i&&!k(i.remotesInfo,e.name).value&&(`version`in e||`entry`in e)&&(i.remotesInfo={...i==null?void 0:i.remotesInfo,[e.name]:{matchedVersion:`version`in e?e.version:e.entry}});let{hostGlobalSnapshot:a,remoteSnapshot:o,globalSnapshot:s}=this.getGlobalRemoteInfo(e),{remoteSnapshot:c,globalSnapshot:l}=await this.hooks.lifecycle.loadSnapshot.emit({options:r,moduleInfo:e,hostGlobalSnapshot:a,remoteSnapshot:o,globalSnapshot:s}),u,d;if(c)if(_(c)){let r=c.remoteEntry,i=await this.loadManifestSnapshot(r,e,{},{initiator:n,id:t||e.name}),a=Me({...e,entry:r},i);u=i,d=a}else{let{remoteSnapshot:t}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:c,from:`global`});u=t,d=l}else if(he(e)){let r=await this.loadManifestSnapshot(e.entry,e,{},{initiator:n,id:t||e.name}),i=Me(e,r);u=r,d=i}else S(Yt,U,{remoteName:e.name,remoteVersion:e.version,hostName:this.HostInstance.options.name,globalSnapshot:JSON.stringify(l)},void 0,G(this.HostInstance.options));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:t,host:this.HostInstance,options:r,moduleInfo:e,remoteSnapshot:u}),{remoteSnapshot:u,globalSnapshot:d}}getGlobalRemoteInfo(e){return Wn(e,this.HostInstance)}async getManifestJson(e,t,n,r){return(async()=>{let n=W(t),i=this.manifestCache.get(e);if(i)return i;try{let t=await this.loaderHook.lifecycle.fetch.emit(e,{},n,r?{...r,url:e,resourceType:`manifest`}:void 0);(!t||!(t instanceof Response))&&(t=await fetch(e,{})),i=await t.json()}catch(r){i=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:r,from:`runtime`,lifecycle:`afterResolve`,remote:n,origin:this.HostInstance}),i||(delete this.manifestLoading[e],S(Gt,U,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name},`${r}`,G(this.HostInstance.options)))}let a=[!i.metaData&&`metaData`,!i.exposes&&`exposes`,!i.shared&&`shared`].filter(Boolean);return a.length>0&&await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:Error(`"${e}" is not a valid federation manifest for remote "${t.name}". Missing required fields: ${a.join(`, `)}.`),from:`runtime`,lifecycle:`afterResolve`,remote:n,origin:this.HostInstance}),a.length>0&&S(tn,U,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name,missingFields:a.join(`,`)},void 0,G(this.HostInstance.options)),this.manifestCache.set(e,i),i})()}async loadManifestSnapshot(e,t,n,r){let i=async()=>{let i=await this.getManifestJson(e,t,n,r),a=g(i,{version:e}),{remoteSnapshot:o}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:t,manifestJson:i,remoteSnapshot:a,manifestUrl:e,from:`manifest`});return o};return this.manifestLoading[e]||(this.manifestLoading[e]=i().then(e=>e)),this.manifestLoading[e]}},Kn=class{constructor(){this.hooks=new q({})}},qn=class{constructor(e){this.hooks=new q({beforeRegisterShare:new X(`beforeRegisterShare`),afterResolve:new Z(`afterResolve`),beforeLoadShare:new Z(`beforeLoadShare`),loadShare:new Y,afterLoadShare:new J(`afterLoadShare`),errorLoadShare:new J(`errorLoadShare`),resolveShare:new X(`resolveShare`),initContainerShareScopeMap:new X(`initContainerShareScopeMap`)}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}emitAfterLoadShare({lifecycle:e,pkgName:t,shareInfo:n,selectedShared:r}){try{this.hooks.lifecycle.afterLoadShare.emit({pkgName:t,shareInfo:n,selectedShared:r,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,origin:this.host})}catch(e){C(e)}}emitErrorLoadShare({lifecycle:e,pkgName:t,shareInfo:n,error:r,recovered:i}){try{this.hooks.lifecycle.errorLoadShare.emit({pkgName:t,shareInfo:n,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,origin:this.host,error:r,recovered:i})}catch(e){C(e)}}registerShared(e,t){let{newShareInfos:n,allShareInfos:r}=jt(e,t);return Object.keys(n).forEach(e=>{n[e].forEach(n=>{n.scope.forEach(r=>{var i;this.hooks.lifecycle.beforeRegisterShare.emit({origin:this.host,pkgName:e,shared:n}),(i=this.shareScopeMap[r])!=null&&i[e]||this.setShared({pkgName:e,lib:n.lib,get:n.get,loaded:n.loaded||!!n.lib,shared:n,from:t.name})})})}),{newShareInfos:n,allShareInfos:r}}async loadShare(e,t){let{host:n}=this,r=Rt({pkgName:e,extraOptions:t,shareInfos:n.options.shared}),i=r;try{r!=null&&r.scope&&await Promise.all(r.scope.map(async e=>{await Promise.all(this.initializeSharing(e,{strategy:r.strategy}))})),i=(await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:r,shared:n.options.shared,origin:n})).shareInfo,x(i,`Cannot find shared "${e}" in host "${n.options.name}". Ensure the shared config for "${e}" is declared in the federation plugin options and the host has been initialized before loading shares.`);let a=i,{shared:o,useTreesShaking:s}=V(this.shareScopeMap,e,i,this.hooks.lifecycle.resolveShare)||{};if(o){let t=zt(o,s);if(t.lib)return H(t,n.options.name),this.emitAfterLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:a,selectedShared:o}),t.lib;if(t.loading&&!t.loaded){let r=await t.loading;return t.loaded=!0,t.lib||=r,H(t,n.options.name),this.emitAfterLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:a,selectedShared:o}),r}{let r=(async()=>{let e=await t.get();return H(t,n.options.name),t.loaded=!0,t.lib=e,e})();this.setShared({pkgName:e,loaded:!1,shared:o,from:n.options.name,lib:null,loading:r,treeShaking:s?t:void 0});let i=await r;return this.emitAfterLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:a,selectedShared:o}),i}}{if(t!=null&&t.customShareInfo)return this.emitErrorLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:a,recovered:!0}),!1;let r=I(a.treeShaking),i=zt(a,r),o=(async()=>{let t=await i.get();i.lib=t,i.loaded=!0,H(i,n.options.name);let{shared:r,useTreesShaking:o}=V(this.shareScopeMap,e,a,this.hooks.lifecycle.resolveShare)||{};if(r){let e=zt(r,o);e.lib=t,e.loaded=!0,r.from=a.from}return t})();this.setShared({pkgName:e,loaded:!1,shared:a,from:n.options.name,lib:null,loading:o,treeShaking:r?i:void 0});let s=await o;return this.emitAfterLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:a,selectedShared:a}),s}}catch(t){throw this.emitErrorLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:i,error:t}),t}}initializeSharing(e=Ot,t){let{host:n}=this,r=t==null?void 0:t.from,i=t==null?void 0:t.strategy,a=t==null?void 0:t.initScope,o=[];if(r!==`build`){let{initTokens:t}=this;a||=[];let n=t[e];if(n||=t[e]={from:this.host.name},a.indexOf(n)>=0)return o;a.push(n)}let s=this.shareScopeMap,c=n.options.name;s[e]||(s[e]={});let l=s[e],u=(e,t)=>{var n;let{version:r,eager:i}=t;l[e]=l[e]||{};let a=l[e],o=a[r]&&zt(a[r]),s=!!(o&&(`eager`in o&&o.eager||`shareConfig`in o&&(n=o.shareConfig)!=null&&n.eager));(!o||o.strategy!==`loaded-first`&&!o.loaded&&(!i==!s?c>a[r].from:i))&&(a[r]=t)},d=async e=>{let{module:t}=await n.remoteHandler.getRemoteModuleAndOptions({id:e}),r;try{r=await t.getEntry()}catch(i){if(r=await n.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:i,from:`runtime`,lifecycle:`beforeLoadShare`,remote:t.remoteInfo,origin:n}),!r)return}finally{r!=null&&r.init&&!t.initing&&(t.remoteEntryExports=r,await t.init(void 0,void 0,a))}};return Object.keys(n.options.shared).forEach(t=>{n.options.shared[t].forEach(n=>{n.scope.includes(e)&&u(t,n)})}),(n.options.shareStrategy===`version-first`||i===`version-first`)&&n.options.remotes.forEach(t=>{t.shareScope===e&&o.push(d(t.name))}),o}loadShareSync(e,t){let{host:n}=this,r=Rt({pkgName:e,extraOptions:t,shareInfos:n.options.shared});try{r!=null&&r.scope&&r.scope.forEach(e=>{this.initializeSharing(e,{strategy:r.strategy})});let{shared:i}=V(this.shareScopeMap,e