signalk-container 1.35.2 → 1.35.4

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.
@@ -1,7 +1,7 @@
1
1
  var e=window.__SK_REACT__;if(!e)throw Error(`signalk-container: window.__SK_REACT__ is not set. The host signalk-server admin UI must expose React on window for plugin federation. Requires signalk-server 2.27.0 or newer.`);var t=e,{Activity:n,Children:r,Component:i,Fragment:a,Profiler:o,PureComponent:s,StrictMode:c,Suspense:l,cache:u,cacheSignal:d,cloneElement:f,createContext:p,createElement:m,createRef:h,forwardRef:g,isValidElement:_,lazy:v,memo:y,startTransition:b,use:x,useActionState:S,useCallback:C,useContext:w,useDebugValue:T,useDeferredValue:E,useEffect:D,useEffectEvent:ee,useId:O,useImperativeHandle:te,useInsertionEffect:k,useLayoutEffect:ne,useMemo:re,useOptimistic:A,useReducer:ie,useRef:j,useState:M,useSyncExternalStore:ae,useTransition:oe,version:se}=t;async function N(e){return await(async()=>{if(typeof navigator>`u`||!navigator.clipboard)return!1;try{return await navigator.clipboard.writeText(e),!0}catch{return!1}})()||(()=>{if(typeof document>`u`)return!1;let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.top=`-1000px`,t.style.left=`-1000px`,t.setAttribute(`readonly`,``),document.body.appendChild(t),t.select();let n;try{n=document.execCommand(`copy`)}catch{n=!1}return document.body.removeChild(t),n})()}var P=window.__SK_REACT_JSX_RUNTIME__;if(!P)throw Error(`signalk-container: window.__SK_REACT_JSX_RUNTIME__ is not set by the host.`);var ce=P,{Fragment:F,jsx:I,jsxs:L}=ce;ce.jsxDEV;var R=1e4,le=200,z={overlay:{position:`fixed`,inset:0,background:`rgba(0,0,0,0.5)`,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:99999},modal:{background:`#fff`,borderRadius:8,boxShadow:`0 10px 25px rgba(0,0,0,0.2)`,width:`min(90vw, 1100px)`,maxHeight:`85vh`,display:`flex`,flexDirection:`column`,overflow:`hidden`},header:{padding:`12px 16px`,borderBottom:`1px solid #e5e7eb`,display:`flex`,alignItems:`center`,gap:12},title:{fontSize:16,fontWeight:600,color:`#111`,flex:1},statusDot:{width:10,height:10,borderRadius:`50%`,flexShrink:0},statusGreen:{background:`#10b981`},statusAmber:{background:`#f59e0b`},statusRed:{background:`#ef4444`},toolbarBtn:{padding:`5px 10px`,fontSize:12,background:`#fff`,color:`#374151`,border:`1px solid #d1d5db`,borderRadius:4,cursor:`pointer`},toolbarBtnActive:{background:`#3b82f6`,color:`#fff`,borderColor:`#3b82f6`},closeBtn:{padding:`5px 12px`,fontSize:12,background:`#fff`,color:`#374151`,border:`1px solid #d1d5db`,borderRadius:4,cursor:`pointer`},body:{flex:1,overflow:`auto`,background:`#1f2937`,color:`#e5e7eb`,fontFamily:`"SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace`,fontSize:12,lineHeight:1.5,padding:`12px 16px`,margin:0,whiteSpace:`pre-wrap`,wordBreak:`break-word`},endBanner:{padding:`8px 16px`,background:`#fef3c7`,color:`#92400e`,fontSize:12,borderTop:`1px solid #fde68a`},metaLine:{fontSize:11,color:`#6b7280`}};function ue({name:e,onClose:t}){let[n,r]=M([]),[i,a]=M(null),[o,s]=M(`connecting`),[c,l]=M(null),[u,d]=M(!0),[f,p]=M(!1),m=j(null),h=j(null),g=j(null),_=j(!1),v=j(!1),y=j(null),b=j(null),x=j(null),S=C(e=>{r(t=>{let n=t.concat(e);return n.length>R?n.slice(n.length-R):n})},[]);D(()=>{let t=!1;return(async()=>{let n=!1;try{let r=await fetch(`/plugins/signalk-container/api/containers/${encodeURIComponent(e)}/logs?tail=${le}`);if(t)return;if(r.ok){let e=await r.json();S(Array.isArray(e.lines)?e.lines:[]),a(typeof e.lastError==`string`?e.lastError:null),s(`backfill`)}else r.status===404?(S([`[error] container not found (HTTP 404)`]),l(`container not found`),s(`disconnected`),n=!0):(S([`[error] backfill failed: HTTP ${r.status}`]),s(`backfill`))}catch(e){if(t)return;let n=e instanceof Error?e.message:String(e);S([`[error] backfill failed: ${n}`])}if(t||n)return;let r=new EventSource(`/plugins/signalk-container/api/containers/${encodeURIComponent(e)}/logs/stream`);g.current=r,r.addEventListener(`hello`,()=>{t||s(`streaming`)}),r.onmessage=e=>{t||e.data!=null&&S([e.data])},r.addEventListener(`end`,e=>{if(t)return;let n=e.data;l(n||`stream ended`),s(`disconnected`),r.close()}),r.onerror=()=>{t||s(e=>e===`disconnected`?e:`connecting`)}})(),()=>{t=!0,g.current&&=(g.current.close(),null)}},[e,S]),ne(()=>{if(!u||_.current)return;let e=h.current;e&&(v.current=!0,e.scrollIntoView({block:`end`,inline:`nearest`}),requestAnimationFrame(()=>{v.current=!1}))},[n,u]);let w=C(e=>{if(v.current){v.current=!1;return}let t=m.current;if(!t)return;let n=t.scrollHeight-t.scrollTop-t.clientHeight<8;_.current=!n},[]),T=C(()=>{d(e=>{let t=!e;if(t){_.current=!1;let e=h.current;e&&(v.current=!0,e.scrollIntoView({block:`end`,inline:`nearest`}),requestAnimationFrame(()=>{v.current=!1}))}return t})},[]),E=n.length===0?i?`(no log lines yet — last runtime error: ${i})`:`(no log lines yet)`:n.join(`
2
2
  `),ee=C(async()=>{await N(E)&&(p(!0),setTimeout(()=>p(!1),1500))},[E]),O=C(()=>{let t=new Blob([E+`
3
- `],{type:`text/plain;charset=utf-8`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`${e}-${new Date().toISOString().replace(/[:.]/g,`-`)}.log`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n)},[E,e]);D(()=>{let e=e=>{e.key===`Escape`&&t()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t]),D(()=>{x.current=typeof document<`u`?document.activeElement:null;let e=setTimeout(()=>{b.current?.focus()},0);return()=>{clearTimeout(e);let t=x.current;if(t instanceof HTMLElement)try{t.focus()}catch{}}},[]);let te=C(e=>{if(e.key!==`Tab`)return;let t=y.current;if(!t)return;let n=Array.from(t.querySelectorAll(`button:not([disabled]), [tabindex]:not([tabindex="-1"])`)).filter(e=>e.offsetParent!==null);if(n.length===0)return;let r=n[0],i=n[n.length-1],a=document.activeElement;e.shiftKey?(a===r||!t.contains(a))&&(e.preventDefault(),i.focus()):a===i&&(e.preventDefault(),r.focus())},[]),k=C(e=>{e.target===e.currentTarget&&t()},[t]),re=o===`streaming`?z.statusGreen:o===`disconnected`?z.statusRed:z.statusAmber,A=o===`connecting`?`Connecting…`:o===`backfill`?`Backfilled — opening live stream…`:o===`streaming`?`Live`:`Disconnected`;return I(`div`,{style:z.overlay,onClick:k,role:`dialog`,"aria-modal":`true`,"aria-label":`Logs for ${e}`,children:L(`div`,{style:z.modal,ref:y,onKeyDown:te,children:[L(`div`,{style:z.header,children:[I(`span`,{style:{...z.statusDot,...re},title:A}),I(`span`,{style:z.title,children:e}),I(`span`,{style:z.metaLine,children:A}),L(`span`,{style:z.metaLine,children:[`· `,n.length,` lines`]}),I(`button`,{type:`button`,style:{...z.toolbarBtn,...u?z.toolbarBtnActive:{}},onClick:T,title:`Auto-scroll to bottom on new lines`,children:`Auto-scroll`}),I(`button`,{type:`button`,style:z.toolbarBtn,onClick:ee,title:`Copy visible log to clipboard`,children:f?`Copied!`:`Copy`}),I(`button`,{type:`button`,style:z.toolbarBtn,onClick:O,title:`Download log as text file`,children:`Download`}),I(`button`,{type:`button`,style:z.closeBtn,onClick:t,ref:b,children:`Close`})]}),L(`pre`,{ref:m,style:z.body,onScroll:w,"aria-label":`Container log output`,tabIndex:0,children:[E,I(`div`,{ref:h,"aria-hidden":`true`})]}),c&&L(`div`,{style:z.endBanner,children:[`Stream ended: `,c]})]})})}function B(e){return typeof e==`object`&&!!e}function de(e){if(!B(e)||typeof e.status!=`string`||typeof e.isContainerized!=`boolean`||!Array.isArray(e.remediation)||`platform`in e&&e.platform!==null&&e.platform!==`halos`||!B(e.binary)||!B(e.daemon)||typeof e.daemon.reachable!=`boolean`||!B(e.selfId)||!B(e.env)||!B(e.cgroupControllers))return!1;let t=e.cgroupControllers;if(!Array.isArray(t.missing)||t.available!==null&&!Array.isArray(t.available))return!1;if(`linger`in e&&e.linger!=null){if(!B(e.linger))return!1;let t=e.linger;if(t.user!==null&&typeof t.user!=`string`||typeof t.enabled!=`boolean`||!Array.isArray(t.advice))return!1}if(`devicePassthrough`in e&&e.devicePassthrough!=null){if(!B(e.devicePassthrough))return!1;let t=e.devicePassthrough;if(!Array.isArray(t.issues)||!t.issues.every(pe)||!Array.isArray(t.advice)||!t.advice.every(V))return!1}return!0}function V(e){return typeof e==`string`}var fe=new Set([`skipped`,`optimistic`,`unresolved`,`group-skipped`]);function pe(e){return B(e)?V(e.container)&&V(e.entry)&&V(e.hostPath)&&V(e.reason)&&typeof e.action==`string`&&fe.has(e.action):!1}function H(e){switch(e){case`ok`:return`Runtime ready`;case`no-runtime`:return`No container runtime found`;case`socket-unreachable`:return`Runtime socket unreachable`;case`permission-denied`:return`Runtime socket: permission denied`;case`self-id-unresolved`:return`Signal K container ID unresolved`;case`cgroup-controllers-incomplete`:return`Host cgroup controllers not fully delegated`}}function U(e){if(e===`halos`)return`HaLOS`}function W(e,t=`—`){return e==null||e===``?t:e}function G(e){return e==null?`unknown`:e?`yes`:`no`}function me(e){let t=[];if(t.push(`Deployment Doctor — ${H(e.status)}`),t.push(`status: ${e.status}`),t.push(``),t.push(`containerized: ${G(e.isContainerized)}`),e.platform&&t.push(`platform: ${U(e.platform)}`),t.push(`runtime: ${W(e.binary.name)} ${W(e.binary.version,``)}`.trimEnd()),t.push(`daemon reachable: ${G(e.daemon.reachable)}`),t.push(`rootless: ${G(e.daemon.rootless)}`),t.push(`socket: ${W(e.daemon.socketPath)}`),e.daemon.error&&t.push(`daemon error: ${e.daemon.error}`),e.isContainerized){let n=e.selfId.source?` (via ${e.selfId.source})`:``;t.push(`self container id: ${W(e.selfId.value)}${n}`)}let n=e.cgroupControllers;if(t.push(`cgroup controllers: ${W(n.available?.join(` `)??null)}`),n.missing.length>0&&t.push(`cgroup controllers MISSING: ${n.missing.join(` `)}`),n.kernelDisabledMemory&&t.push(`kernel cmdline disables the memory controller`),e.containerStorage){let n=e.containerStorage,r=n.idmapHazard?` (idmap hazard)`:``;t.push(`storage: ${W(n.fstype)} at ${W(n.storagePath)}${r}`)}if(e.linger){let n=e.linger.user?` for ${e.linger.user}`:``;t.push(`systemd linger: ${e.linger.enabled?`enabled`:`NOT enabled`}${n}`)}if(e.networkDns){let n=e.networkDns;t.push(`network DNS helper (${W(n.backend)}): ${n.dnsBroken?`MISSING — user-defined-network DNS is broken`:W(n.helperPath)}`)}if(e.devicePassthrough)for(let n of e.devicePassthrough.issues)t.push(n.action===`group-skipped`?`group passthrough (${n.container}): ${n.entry} ${n.action}`:`device passthrough (${n.container}): ${n.hostPath} ${n.action}`);let r=Object.entries(e.env).filter(([,e])=>e!=null);if(r.length>0){t.push(``),t.push(`env:`);for(let[e,n]of r)t.push(` ${e}=${n}`)}let i=(e.containerStorage?.advice.length??0)>0||(e.linger?.advice.length??0)>0||(e.networkDns?.advice.length??0)>0||(e.devicePassthrough?.advice.length??0)>0;if(e.remediation.length>0){t.push(``),t.push(`Remediation:`);for(let n of e.remediation)t.push(n)}else i||(t.push(``),t.push(`No action needed (status ok).`));if(e.containerStorage&&e.containerStorage.advice.length>0){t.push(``),t.push(`Storage advice:`);for(let n of e.containerStorage.advice)t.push(n)}if(e.linger&&e.linger.advice.length>0){t.push(``),t.push(`Linger advice:`);for(let n of e.linger.advice)t.push(n)}if(e.networkDns&&e.networkDns.advice.length>0){t.push(``),t.push(`Network DNS advice:`);for(let n of e.networkDns.advice)t.push(n)}if(e.devicePassthrough&&e.devicePassthrough.advice.length>0){t.push(``),t.push(`Device passthrough advice:`);for(let n of e.devicePassthrough.advice)t.push(n)}return t.join(`
4
- `)}var he=`/plugins/signalk-container/api/doctor/deployment`,K={overlay:{position:`fixed`,inset:0,background:`rgba(0,0,0,0.5)`,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:99999},modal:{background:`#fff`,borderRadius:8,boxShadow:`0 10px 25px rgba(0,0,0,0.2)`,width:`min(90vw, 760px)`,maxHeight:`85vh`,display:`flex`,flexDirection:`column`,overflow:`hidden`},header:{padding:`12px 16px`,borderBottom:`1px solid #e5e7eb`,display:`flex`,alignItems:`center`,gap:12},title:{fontSize:16,fontWeight:600,color:`#111`,flex:1},statusDot:{width:10,height:10,borderRadius:`50%`,flexShrink:0},statusGreen:{background:`#10b981`},statusAmber:{background:`#f59e0b`},statusRed:{background:`#ef4444`},toolbarBtn:{padding:`5px 10px`,fontSize:12,background:`#fff`,color:`#374151`,border:`1px solid #d1d5db`,borderRadius:4,cursor:`pointer`},body:{flex:1,overflow:`auto`,padding:`16px`,color:`#111`,fontSize:13},headline:{fontSize:15,fontWeight:600,marginBottom:12},row:{display:`flex`,gap:12,padding:`4px 0`,borderBottom:`1px solid #f3f4f6`},rowLabel:{width:150,flexShrink:0,color:`#6b7280`},rowValue:{color:`#111`,wordBreak:`break-word`},rowValueMissing:{color:`#b45309`,fontWeight:600},dim:{color:`#9ca3af`},sectionLabel:{fontSize:12,fontWeight:600,color:`#374151`,marginTop:16,marginBottom:6},pre:{background:`#1f2937`,color:`#e5e7eb`,fontFamily:`"SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace`,fontSize:12,lineHeight:1.5,padding:`12px`,margin:0,borderRadius:6,whiteSpace:`pre-wrap`,wordBreak:`break-word`},toggle:{marginTop:16,fontSize:12,background:`none`,border:`none`,color:`#3b82f6`,cursor:`pointer`,padding:0},message:{color:`#6b7280`,padding:`8px 0`},error:{color:`#ef4444`,padding:`8px 0`}};function ge(e){return e===`ok`?K.statusGreen:e===`self-id-unresolved`||e===`cgroup-controllers-incomplete`?K.statusAmber:K.statusRed}function q({label:e,value:t,missing:n}){return L(`div`,{style:K.row,children:[I(`span`,{style:K.rowLabel,children:e}),I(`span`,{style:{...K.rowValue,...n?K.rowValueMissing:{}},children:t})]})}function J(e){return e==null||e===``?I(`span`,{style:K.dim,children:`—`}):e}function _e({onClose:e}){let[t,n]=M(null),[r,i]=M(!0),[a,o]=M(null),[s,c]=M(!1),[l,u]=M(!1),d=j(null),f=j(null),p=j(null);D(()=>{let e=!1;return(async()=>{try{let t=await fetch(he);if(e)return;if(!t.ok){o(t.status===401||t.status===403?`HTTP ${t.status} — not authorized. Are you logged in to the admin UI?`:`HTTP ${t.status} fetching the deployment doctor.`),i(!1);return}let r=await t.json();if(e)return;if(!de(r)){o(`Unexpected response shape from the deployment doctor.`),i(!1);return}n(r),i(!1)}catch(t){if(e)return;o(t instanceof Error?t.message:`Failed to reach the server.`),i(!1)}})(),()=>{e=!0}},[]),D(()=>{let t=t=>{t.key===`Escape`&&e()};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e]),D(()=>{p.current=typeof document<`u`?document.activeElement:null;let e=setTimeout(()=>f.current?.focus(),0);return()=>{clearTimeout(e);let t=p.current;if(t instanceof HTMLElement)try{t.focus()}catch{}}},[]);let m=C(e=>{if(e.key!==`Tab`)return;let t=d.current;if(!t)return;let n=Array.from(t.querySelectorAll(`button:not([disabled]), [tabindex]:not([tabindex="-1"])`)).filter(e=>e.offsetParent!==null);if(n.length===0)return;let r=n[0],i=n[n.length-1],a=document.activeElement;e.shiftKey?(a===r||!t.contains(a))&&(e.preventDefault(),i.focus()):a===i&&(e.preventDefault(),r.focus())},[]),h=C(t=>{t.target===t.currentTarget&&e()},[e]),g=C(async()=>{t&&await N(me(t))&&u(!0)},[t]);D(()=>{if(!l)return;let e=setTimeout(()=>u(!1),1500);return()=>clearTimeout(e)},[l]);let _=t?.cgroupControllers;return I(`div`,{style:K.overlay,onClick:h,role:`dialog`,"aria-modal":`true`,"aria-label":`Deployment Doctor`,children:L(`div`,{style:K.modal,ref:d,onKeyDown:m,children:[L(`div`,{style:K.header,children:[t&&I(`span`,{style:{...K.statusDot,...ge(t.status)}}),I(`span`,{style:K.title,children:`Deployment Doctor`}),t&&I(`button`,{type:`button`,style:K.toolbarBtn,onClick:g,title:`Copy the full report to the clipboard`,children:l?`Copied!`:`Copy`}),I(`button`,{type:`button`,ref:f,style:K.toolbarBtn,onClick:e,children:`Close`})]}),L(`div`,{style:K.body,children:[r&&I(`div`,{style:K.message,children:`Running diagnostics…`}),a&&I(`div`,{style:K.error,children:a}),t&&L(F,{children:[I(`div`,{style:K.headline,children:H(t.status)}),I(q,{label:`Containerized`,value:t.isContainerized?`yes`:`no`}),t.platform&&I(q,{label:`Platform`,value:U(t.platform)}),I(q,{label:`Runtime`,value:t.binary.name?`${t.binary.name} ${t.binary.version??``}`.trim():J(null)}),I(q,{label:`Daemon reachable`,value:t.daemon.reachable?`yes`:`no`}),I(q,{label:`Rootless`,value:t.daemon.rootless==null?`unknown`:t.daemon.rootless?`yes`:`no`}),I(q,{label:`Socket`,value:J(t.daemon.socketPath)}),t.daemon.error&&I(q,{label:`Daemon error`,value:t.daemon.error,missing:!0}),t.isContainerized&&I(q,{label:`Self container ID`,value:t.selfId.value?`${t.selfId.value}${t.selfId.source?` (via ${t.selfId.source})`:``}`:J(null),missing:!t.selfId.value}),I(q,{label:`cgroup controllers`,value:J(_?.available?.join(` `)??null)}),_&&_.missing.length>0&&I(q,{label:`cgroup MISSING`,value:_.missing.join(` `),missing:!0}),_?.kernelDisabledMemory&&I(q,{label:`Kernel cmdline`,value:`disables the memory controller`,missing:!0}),t.containerStorage&&I(q,{label:`Storage`,value:`${t.containerStorage.fstype??`?`} at ${t.containerStorage.storagePath??`?`}${t.containerStorage.idmapHazard?` (idmap hazard)`:``}`,missing:t.containerStorage.idmapHazard}),t.linger&&I(q,{label:`systemd linger`,value:`${t.linger.enabled?`enabled`:`NOT enabled`}${t.linger.user?` for ${t.linger.user}`:``}`,missing:!t.linger.enabled}),t.devicePassthrough&&t.devicePassthrough.issues.map(e=>e.action===`group-skipped`?I(q,{label:`Group (${e.container})`,value:`${e.entry} ${e.action}`,missing:!0},`${e.container}:group:${e.entry}`):I(q,{label:`Device (${e.container})`,value:`${e.hostPath} ${e.action}`,missing:e.action!==`optimistic`},`${e.container}:${e.hostPath}:${e.entry}:${e.action}`)),I(`div`,{style:K.sectionLabel,children:`Remediation`}),t.remediation.length>0?I(`pre`,{style:K.pre,children:t.remediation.join(`
3
+ `],{type:`text/plain;charset=utf-8`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`${e}-${new Date().toISOString().replace(/[:.]/g,`-`)}.log`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n)},[E,e]);D(()=>{let e=e=>{e.key===`Escape`&&t()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t]),D(()=>{x.current=typeof document<`u`?document.activeElement:null;let e=setTimeout(()=>{b.current?.focus()},0);return()=>{clearTimeout(e);let t=x.current;if(t instanceof HTMLElement)try{t.focus()}catch{}}},[]);let te=C(e=>{if(e.key!==`Tab`)return;let t=y.current;if(!t)return;let n=Array.from(t.querySelectorAll(`button:not([disabled]), [tabindex]:not([tabindex="-1"])`)).filter(e=>e.offsetParent!==null);if(n.length===0)return;let r=n[0],i=n[n.length-1],a=document.activeElement;e.shiftKey?a!==r&&t.contains(a)||(e.preventDefault(),i.focus()):a===i&&(e.preventDefault(),r.focus())},[]),k=C(e=>{e.target===e.currentTarget&&t()},[t]),re=o===`streaming`?z.statusGreen:o===`disconnected`?z.statusRed:z.statusAmber,A=o===`connecting`?`Connecting…`:o===`backfill`?`Backfilled — opening live stream…`:o===`streaming`?`Live`:`Disconnected`;return I(`div`,{style:z.overlay,onClick:k,role:`dialog`,"aria-modal":`true`,"aria-label":`Logs for ${e}`,children:L(`div`,{style:z.modal,ref:y,onKeyDown:te,children:[L(`div`,{style:z.header,children:[I(`span`,{style:{...z.statusDot,...re},title:A}),I(`span`,{style:z.title,children:e}),I(`span`,{style:z.metaLine,children:A}),L(`span`,{style:z.metaLine,children:[`· `,n.length,` lines`]}),I(`button`,{type:`button`,style:{...z.toolbarBtn,...u?z.toolbarBtnActive:{}},onClick:T,title:`Auto-scroll to bottom on new lines`,children:`Auto-scroll`}),I(`button`,{type:`button`,style:z.toolbarBtn,onClick:ee,title:`Copy visible log to clipboard`,children:f?`Copied!`:`Copy`}),I(`button`,{type:`button`,style:z.toolbarBtn,onClick:O,title:`Download log as text file`,children:`Download`}),I(`button`,{type:`button`,style:z.closeBtn,onClick:t,ref:b,children:`Close`})]}),L(`pre`,{ref:m,style:z.body,onScroll:w,"aria-label":`Container log output`,tabIndex:0,children:[E,I(`div`,{ref:h,"aria-hidden":`true`})]}),c&&L(`div`,{style:z.endBanner,children:[`Stream ended: `,c]})]})})}function B(e){return typeof e==`object`&&!!e}function de(e){if(!B(e)||typeof e.status!=`string`||typeof e.isContainerized!=`boolean`||!Array.isArray(e.remediation)||`platform`in e&&e.platform!==null&&e.platform!==`halos`||!B(e.binary)||!B(e.daemon)||typeof e.daemon.reachable!=`boolean`||!B(e.selfId)||!B(e.env)||!B(e.cgroupControllers))return!1;let t=e.cgroupControllers;if(!Array.isArray(t.missing)||t.available!==null&&!Array.isArray(t.available))return!1;if(`linger`in e&&e.linger!=null){if(!B(e.linger))return!1;let t=e.linger;if(t.user!==null&&typeof t.user!=`string`||typeof t.enabled!=`boolean`||!Array.isArray(t.advice))return!1}if(`devicePassthrough`in e&&e.devicePassthrough!=null){if(!B(e.devicePassthrough))return!1;let t=e.devicePassthrough;if(!Array.isArray(t.issues)||!t.issues.every(pe)||!Array.isArray(t.advice)||!t.advice.every(V))return!1}return!0}function V(e){return typeof e==`string`}var fe=new Set([`skipped`,`optimistic`,`unresolved`,`group-skipped`]);function pe(e){return B(e)?V(e.container)&&V(e.entry)&&V(e.hostPath)&&V(e.reason)&&typeof e.action==`string`&&fe.has(e.action):!1}function H(e){switch(e){case`ok`:return`Runtime ready`;case`no-runtime`:return`No container runtime found`;case`socket-unreachable`:return`Runtime socket unreachable`;case`permission-denied`:return`Runtime socket: permission denied`;case`self-id-unresolved`:return`Signal K container ID unresolved`;case`cgroup-controllers-incomplete`:return`Host cgroup controllers not fully delegated`}}function U(e){if(e===`halos`)return`HaLOS`}function W(e,t=`—`){return e==null||e===``?t:e}function G(e){return e==null?`unknown`:e?`yes`:`no`}function me(e){let t=[];if(t.push(`Deployment Doctor — ${H(e.status)}`),t.push(`status: ${e.status}`),t.push(``),t.push(`containerized: ${G(e.isContainerized)}`),e.platform&&t.push(`platform: ${U(e.platform)}`),t.push(`runtime: ${W(e.binary.name)} ${W(e.binary.version,``)}`.trimEnd()),t.push(`daemon reachable: ${G(e.daemon.reachable)}`),t.push(`rootless: ${G(e.daemon.rootless)}`),t.push(`socket: ${W(e.daemon.socketPath)}`),e.daemon.error&&t.push(`daemon error: ${e.daemon.error}`),e.isContainerized){let n=e.selfId.source?` (via ${e.selfId.source})`:``;t.push(`self container id: ${W(e.selfId.value)}${n}`)}let n=e.cgroupControllers;if(t.push(`cgroup controllers: ${W(n.available?.join(` `)??null)}`),n.missing.length>0&&t.push(`cgroup controllers MISSING: ${n.missing.join(` `)}`),n.kernelDisabledMemory&&t.push(`kernel cmdline disables the memory controller`),e.containerStorage){let n=e.containerStorage,r=n.idmapHazard?` (idmap hazard)`:``;t.push(`storage: ${W(n.fstype)} at ${W(n.storagePath)}${r}`)}if(e.linger){let n=e.linger.user?` for ${e.linger.user}`:``;t.push(`systemd linger: ${e.linger.enabled?`enabled`:`NOT enabled`}${n}`)}if(e.networkDns){let n=e.networkDns;t.push(`network DNS helper (${W(n.backend)}): ${n.dnsBroken?`MISSING — user-defined-network DNS is broken`:W(n.helperPath)}`)}if(e.devicePassthrough)for(let n of e.devicePassthrough.issues)t.push(n.action===`group-skipped`?`group passthrough (${n.container}): ${n.entry} ${n.action}`:`device passthrough (${n.container}): ${n.hostPath} ${n.action}`);let r=Object.entries(e.env).filter(([,e])=>e!=null);if(r.length>0){t.push(``),t.push(`env:`);for(let[e,n]of r)t.push(` ${e}=${n}`)}let i=(e.containerStorage?.advice.length??0)>0||(e.linger?.advice.length??0)>0||(e.networkDns?.advice.length??0)>0||(e.devicePassthrough?.advice.length??0)>0;if(e.remediation.length>0){t.push(``),t.push(`Remediation:`);for(let n of e.remediation)t.push(n)}else i||(t.push(``),t.push(`No action needed (status ok).`));if(e.containerStorage&&e.containerStorage.advice.length>0){t.push(``),t.push(`Storage advice:`);for(let n of e.containerStorage.advice)t.push(n)}if(e.linger&&e.linger.advice.length>0){t.push(``),t.push(`Linger advice:`);for(let n of e.linger.advice)t.push(n)}if(e.networkDns&&e.networkDns.advice.length>0){t.push(``),t.push(`Network DNS advice:`);for(let n of e.networkDns.advice)t.push(n)}if(e.devicePassthrough&&e.devicePassthrough.advice.length>0){t.push(``),t.push(`Device passthrough advice:`);for(let n of e.devicePassthrough.advice)t.push(n)}return t.join(`
4
+ `)}var he=`/plugins/signalk-container/api/doctor/deployment`,K={overlay:{position:`fixed`,inset:0,background:`rgba(0,0,0,0.5)`,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:99999},modal:{background:`#fff`,borderRadius:8,boxShadow:`0 10px 25px rgba(0,0,0,0.2)`,width:`min(90vw, 760px)`,maxHeight:`85vh`,display:`flex`,flexDirection:`column`,overflow:`hidden`},header:{padding:`12px 16px`,borderBottom:`1px solid #e5e7eb`,display:`flex`,alignItems:`center`,gap:12},title:{fontSize:16,fontWeight:600,color:`#111`,flex:1},statusDot:{width:10,height:10,borderRadius:`50%`,flexShrink:0},statusGreen:{background:`#10b981`},statusAmber:{background:`#f59e0b`},statusRed:{background:`#ef4444`},toolbarBtn:{padding:`5px 10px`,fontSize:12,background:`#fff`,color:`#374151`,border:`1px solid #d1d5db`,borderRadius:4,cursor:`pointer`},body:{flex:1,overflow:`auto`,padding:`16px`,color:`#111`,fontSize:13},headline:{fontSize:15,fontWeight:600,marginBottom:12},row:{display:`flex`,gap:12,padding:`4px 0`,borderBottom:`1px solid #f3f4f6`},rowLabel:{width:150,flexShrink:0,color:`#6b7280`},rowValue:{color:`#111`,wordBreak:`break-word`},rowValueMissing:{color:`#b45309`,fontWeight:600},dim:{color:`#9ca3af`},sectionLabel:{fontSize:12,fontWeight:600,color:`#374151`,marginTop:16,marginBottom:6},pre:{background:`#1f2937`,color:`#e5e7eb`,fontFamily:`"SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace`,fontSize:12,lineHeight:1.5,padding:`12px`,margin:0,borderRadius:6,whiteSpace:`pre-wrap`,wordBreak:`break-word`},toggle:{marginTop:16,fontSize:12,background:`none`,border:`none`,color:`#3b82f6`,cursor:`pointer`,padding:0},message:{color:`#6b7280`,padding:`8px 0`},error:{color:`#ef4444`,padding:`8px 0`}};function ge(e){return e===`ok`?K.statusGreen:e===`self-id-unresolved`||e===`cgroup-controllers-incomplete`?K.statusAmber:K.statusRed}function q({label:e,value:t,missing:n}){return L(`div`,{style:K.row,children:[I(`span`,{style:K.rowLabel,children:e}),I(`span`,{style:{...K.rowValue,...n?K.rowValueMissing:{}},children:t})]})}function J(e){return e==null||e===``?I(`span`,{style:K.dim,children:`—`}):e}function _e({onClose:e}){let[t,n]=M(null),[r,i]=M(!0),[a,o]=M(null),[s,c]=M(!1),[l,u]=M(!1),d=j(null),f=j(null),p=j(null);D(()=>{let e=!1;return(async()=>{try{let t=await fetch(he);if(e)return;if(!t.ok){o(t.status===401||t.status===403?`HTTP ${t.status} — not authorized. Are you logged in to the admin UI?`:`HTTP ${t.status} fetching the deployment doctor.`),i(!1);return}let r=await t.json();if(e)return;if(!de(r)){o(`Unexpected response shape from the deployment doctor.`),i(!1);return}n(r),i(!1)}catch(t){if(e)return;o(t instanceof Error?t.message:`Failed to reach the server.`),i(!1)}})(),()=>{e=!0}},[]),D(()=>{let t=t=>{t.key===`Escape`&&e()};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e]),D(()=>{p.current=typeof document<`u`?document.activeElement:null;let e=setTimeout(()=>f.current?.focus(),0);return()=>{clearTimeout(e);let t=p.current;if(t instanceof HTMLElement)try{t.focus()}catch{}}},[]);let m=C(e=>{if(e.key!==`Tab`)return;let t=d.current;if(!t)return;let n=Array.from(t.querySelectorAll(`button:not([disabled]), [tabindex]:not([tabindex="-1"])`)).filter(e=>e.offsetParent!==null);if(n.length===0)return;let r=n[0],i=n[n.length-1],a=document.activeElement;e.shiftKey?a!==r&&t.contains(a)||(e.preventDefault(),i.focus()):a===i&&(e.preventDefault(),r.focus())},[]),h=C(t=>{t.target===t.currentTarget&&e()},[e]),g=C(async()=>{t&&await N(me(t))&&u(!0)},[t]);D(()=>{if(!l)return;let e=setTimeout(()=>u(!1),1500);return()=>clearTimeout(e)},[l]);let _=t?.cgroupControllers;return I(`div`,{style:K.overlay,onClick:h,role:`dialog`,"aria-modal":`true`,"aria-label":`Deployment Doctor`,children:L(`div`,{style:K.modal,ref:d,onKeyDown:m,children:[L(`div`,{style:K.header,children:[t&&I(`span`,{style:{...K.statusDot,...ge(t.status)}}),I(`span`,{style:K.title,children:`Deployment Doctor`}),t&&I(`button`,{type:`button`,style:K.toolbarBtn,onClick:g,title:`Copy the full report to the clipboard`,children:l?`Copied!`:`Copy`}),I(`button`,{type:`button`,ref:f,style:K.toolbarBtn,onClick:e,children:`Close`})]}),L(`div`,{style:K.body,children:[r&&I(`div`,{style:K.message,children:`Running diagnostics…`}),a&&I(`div`,{style:K.error,children:a}),t&&L(F,{children:[I(`div`,{style:K.headline,children:H(t.status)}),I(q,{label:`Containerized`,value:t.isContainerized?`yes`:`no`}),t.platform&&I(q,{label:`Platform`,value:U(t.platform)}),I(q,{label:`Runtime`,value:t.binary.name?`${t.binary.name} ${t.binary.version??``}`.trim():J(null)}),I(q,{label:`Daemon reachable`,value:t.daemon.reachable?`yes`:`no`}),I(q,{label:`Rootless`,value:t.daemon.rootless==null?`unknown`:t.daemon.rootless?`yes`:`no`}),I(q,{label:`Socket`,value:J(t.daemon.socketPath)}),t.daemon.error&&I(q,{label:`Daemon error`,value:t.daemon.error,missing:!0}),t.isContainerized&&I(q,{label:`Self container ID`,value:t.selfId.value?`${t.selfId.value}${t.selfId.source?` (via ${t.selfId.source})`:``}`:J(null),missing:!t.selfId.value}),I(q,{label:`cgroup controllers`,value:J(_?.available?.join(` `)??null)}),_&&_.missing.length>0&&I(q,{label:`cgroup MISSING`,value:_.missing.join(` `),missing:!0}),_?.kernelDisabledMemory&&I(q,{label:`Kernel cmdline`,value:`disables the memory controller`,missing:!0}),t.containerStorage&&I(q,{label:`Storage`,value:`${t.containerStorage.fstype??`?`} at ${t.containerStorage.storagePath??`?`}${t.containerStorage.idmapHazard?` (idmap hazard)`:``}`,missing:t.containerStorage.idmapHazard}),t.linger&&I(q,{label:`systemd linger`,value:`${t.linger.enabled?`enabled`:`NOT enabled`}${t.linger.user?` for ${t.linger.user}`:``}`,missing:!t.linger.enabled}),t.devicePassthrough&&t.devicePassthrough.issues.map(e=>e.action===`group-skipped`?I(q,{label:`Group (${e.container})`,value:`${e.entry} ${e.action}`,missing:!0},`${e.container}:group:${e.entry}`):I(q,{label:`Device (${e.container})`,value:`${e.hostPath} ${e.action}`,missing:e.action!==`optimistic`},`${e.container}:${e.hostPath}:${e.entry}:${e.action}`)),I(`div`,{style:K.sectionLabel,children:`Remediation`}),t.remediation.length>0?I(`pre`,{style:K.pre,children:t.remediation.join(`
5
5
  `)}):!((t.containerStorage?.advice.length??0)>0||(t.linger?.advice.length??0)>0||(t.networkDns?.advice.length??0)>0||(t.devicePassthrough?.advice.length??0)>0)&&I(`div`,{style:K.message,children:`No action needed (status ok).`}),t.containerStorage&&t.containerStorage.advice.length>0&&L(F,{children:[I(`div`,{style:K.sectionLabel,children:`Storage advice`}),I(`pre`,{style:K.pre,children:t.containerStorage.advice.join(`
6
6
  `)})]}),t.linger&&t.linger.advice.length>0&&L(F,{children:[I(`div`,{style:K.sectionLabel,children:`Linger advice`}),I(`pre`,{style:K.pre,children:t.linger.advice.join(`
7
7
  `)})]}),t.networkDns&&t.networkDns.advice.length>0&&L(F,{children:[I(`div`,{style:K.sectionLabel,children:`Network DNS advice`}),I(`pre`,{style:K.pre,children:t.networkDns.advice.join(`
@@ -1 +1 @@
1
- import{t as e}from"./chunks/dist-D1jGdgWH.js";import{t}from"./chunks/vite-preload-helper-DHhhL8Zf.js";var n={},r=new Set,i=new Map;function a(e,t){let n=i.get(e);return n||(n=Promise.resolve().then(t).catch(t=>{throw i.delete(e),t}),i.set(e,n)),n}async function o(e){if(typeof document>`u`)return;let t=n[e]||[];await Promise.all(t.map(e=>{let t=new URL(e,import.meta.url).href;return r.has(t)||(r.add(t),document.querySelector(`link[rel="stylesheet"][href="${t}"]`))?Promise.resolve():new Promise((e,n)=>{let r=document.createElement(`link`);r.rel=`stylesheet`,r.href=t,r.onload=()=>e(),r.onerror=()=>n(Error(`[Module Federation] Failed to load CSS asset: ${t}`)),document.head.appendChild(r)})}))}var s={"./PluginConfigurationPanel":async()=>{await o(`./PluginConfigurationPanel`),await Promise.all([]);let e=await a(`./PluginConfigurationPanel`,()=>t(()=>import(`./configpanel-entry.js`),[])),n=e&&e.__mf_remote_dependency_pending;n&&typeof n.then==`function`&&await n;let r={};return Object.assign(r,e),Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),r}};typeof __VUE_HMR_RUNTIME__>`u`&&(globalThis.__VUE_HMR_RUNTIME__={createRecord(){},rerender(){},reload(){}});var c=`__mf_init__virtual:mf:__mfe_internal__signalk_container__mf_owner__176128520841313__mf_v__runtimeInit__mf_v__.js__`,l=globalThis[c];if(!l){let e,t,n=new Promise((n,r)=>{e=n,t=r});l=globalThis[c]={initPromise:n,initResolve:e,initReject:t}}var u=l.initResolve,{initReject:d}=l,f=e=>{throw d(e),e},p=`__mf_module_cache__`;globalThis[p]||={share:{},remote:{}},globalThis[p].share||={},globalThis[p].remote||={};var m=globalThis[p];for(let e of Object.keys(m.share))if(e.startsWith(`default:`)){let t=e.slice(8);m.share[t]===void 0&&(m.share[t]=m.share[e])}else if(!e.includes(`:`)){let t=`default:`+e;m.share[t]===void 0&&(m.share[t]=m.share[e])}var h={},g=Array.isArray(`default`)?`default`:[`default`],_=`default`,v=`signalk_container`,y=[],b,x;async function S(e){for(let t=0;;t++)try{return await e()}catch(e){throw e}}async function C(){return b||=S(()=>t(()=>import(`./chunks/_virtual_mf-localSharedImportMap___mfe_internal__signalk_container__mf_owner__1-_R-vaMcG.js`),[])).catch(e=>{throw b=void 0,e}),b}async function w(){return s}async function T(t={},n=[],r={}){let i=(e,t,n,r)=>{let i=(Array.isArray(r)?r[0]:r)||`default`,a=t||!n?e:e+`@`+n,o={canonical:i+`:`+a};return i==="default"&&(o.aliases=[a]),o},a=(e,t)=>{let n=e[t.canonical];if(n!==void 0)return n;let r=t.aliases||[];for(let n of r){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let r=e[n];if(r!==void 0)return e[t.canonical]=r,r}},o=Symbol.for(`module-federation.shared-cache-listeners`),s=Symbol.for(`module-federation.shared-cache-owners`),c=e=>{let t=e[s];return t===void 0&&(t=Object.create(null),Object.defineProperty(e,s,{value:t,enumerable:!1,configurable:!1,writable:!1})),t},d=(e,t)=>e[s]?.[t.canonical],p=e=>{let t=[e,e?.default];for(let e of t)if(e&&typeof e==`object`){for(let t of[`__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE`,`__TEST_INTERNALS`,`__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED`]){let n=e[t];if(n&&typeof n==`object`)return{internals:n}}if(typeof e.useState==`function`)return{hook:e.useState}}},b=(e,t)=>{if(e===t)return!0;let n=p(e),r=p(t);if(!n||!r)return!1;let i=n.internals,a=r.internals;return i!==void 0||a!==void 0?i!==void 0&&i===a:typeof n.hook==`function`&&n.hook===r.hook},w=(e,t,n,r)=>{let i=a(e,t);if(i!==void 0&&b(i,n))return n;e[t.canonical]=n;let l=t.aliases||[];for(let t of l)Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0});let u=e[s];r===void 0?u&&delete u[t.canonical]:c(e)[t.canonical]=r;let d=e[o]?.[t.canonical];if(d)for(let e of d)e(n);return n},T=Symbol.for(`module-federation.tree-shaking-shared-cache`),E=e=>{let t=e[T];return t===void 0&&(t=Object.create(null),Object.defineProperty(e,T,{value:t,enumerable:!1,configurable:!1,writable:!1})),t},D=(e,t,n,r)=>{if(!Array.isArray(n))return r;let i=[...new Set(n)].sort(),a=E(e),o=a[t.canonical]||=[],s=o.find(e=>e.providedExports.length===i.length&&e.providedExports.every((e,t)=>e===i[t]));return s?s.value=r:o.push({providedExports:i,value:r}),r},O=Symbol.for(`module-federation.tree-shaking-shared-selection-cache`),k=e=>{let t=e[O];return t===void 0&&(t=Object.create(null),Object.defineProperty(e,O,{value:t,enumerable:!1,configurable:!1,writable:!1})),t},A=(e,t,n)=>{let r=a(e,t);return r===void 0?e[O]?.[t.canonical]?.[n]:r},ee=(e,t,n,r)=>{let i=k(e),a=i[t.canonical]||=Object.create(null);return a[n]=r,r},j=globalThis.__FEDERATION__?.__INSTANCES__||[],M=n.find(e=>e?.from)?.from,N=j.find(e=>e?.options?.name===M&&e?.shareScopeMap?.default===t)||j.find(e=>e?.options?.name!==v&&e?.shareScopeMap?.default===t),te=Object.create(null),ne=e=>{let t=Object.create(null);for(let[n,r]of Object.entries(e||{}))t[n]=Object.assign(Object.create(null),r);return t},re=(e,t)=>{for(let[n,r]of Object.entries(U.shareScopeMap?.[e]||{}))for(let[e,i]of Object.entries(r||{})){if(!i||i.get===F[n]?.get)continue;let r=t[n]||={};r[e]===void 0&&(r[e]=i)}},ie=(e,t)=>{re(e,t);let n=!N&&Object.values(t||{}).some(e=>Object.values(e||{}).some(I)),r=n?ne(t):t;return te[e]={host:t,runtime:r,isWebpackScope:n},r},ae=()=>{let e=Object.values(te).filter(({isWebpackScope:e})=>e);if(e.length!==0)for(let{host:t,runtime:n}of e)for(let[e,r]of Object.entries(t||{})){let t=n[e]||=Object.create(null);for(let[e,n]of Object.entries(r||{}))t[e]=n}},P=Object.create(null);for(let[e,n]of Object.entries(t)){let t=P[e]=Object.create(null);for(let[e,r]of Object.entries(n))t[e]=Object.assign({},r)}let{usedShared:F,usedRemotes:oe}=await C();function I(e){if(typeof e?.get!=`function`)return!1;let t=Function.prototype.toString.call(e.get);return t.includes(`__webpack_require__`)||/\.\s*e\s*\([^)]*\)\s*\.then\s*\(/.test(t)}let se=Object.values(P).some(e=>Object.values(e||{}).some(I)),ce=e=>{let t=e.split(`/`);return e.startsWith(`@`)?t.slice(0,2).join(`/`):t[0]},L=(e,n,r,i)=>{if(typeof __mfSelectExternalSharedProvider!=`function`)return;let a=ce(e),o=!i||a===e?[[e,n]]:[[e,n],[a,F[a]]];for(let[n,i]of o){if(!i)continue;let a=r?n===e?r:P[n]:P[n]??t[n],o=__mfSelectExternalSharedProvider(a,n,i,`version-first`);if(o)return o}},le=(e,t,n)=>{let r=L(e,t,n,!0);return r&&I(r)&&!r.lib&&!r.loaded?r:void 0};var R=h[_];if(R||=h[_]={from:v},n.indexOf(R)>=0)return;n.push(R);let z=e=>{let t=e;for(let e=0;e<5;e++){let e=t?.default;if(!e||typeof e!=`object`||Object.keys(e).length===0)break;let n=Object.getPrototypeOf(e);if(n!==null&&n!==Object.prototype)break;let r=Object.keys(t).filter(e=>e!=="default").map(e=>t[e]);if(r.length>0&&r.some(e=>e!==void 0))break;t=e}return t},ue=[],de=globalThis.window===void 0?await Promise.all([]):[],B=`__mf_vite_runtime_share_load_id__`,fe=0,V=new Map,H=new Map,U=e({name:v,remotes:oe,shared:F,plugins:[pe(),me(),...ue,...de],shareStrategy:`version-first`});U.initShareScopeMap(`default`,ie(`default`,t));function pe(){return{name:`vite-share-pin-lifecycle-plugin`,resolveShare(e){let t=e.shareInfo?.[B],n=t===void 0?void 0:H.get(t);if(!n)return e;let r=e.resolver;return e.resolver=(...e)=>(n.pinned.reapply(),r(...e)),n.pinned.reveal(),e}}}function me(){return{name:`vite-real-name-snapshot-plugin`,afterLoadSnapshot(e){let t=e&&e.remoteSnapshot,n=t&&t.globalName,r=t&&t.version;if(!n||!r||!t.remoteEntry)return e;let i=globalThis.__FEDERATION__&&globalThis.__FEDERATION__.moduleInfo,a=n+`:`+r;return i&&!i[a]&&(i[a]=t),e}}}let he=U.sharedHandler.hooks.lifecycle.resolveShare;U.__mfKeepAdoptedProviders||(U.__mfKeepAdoptedProviders=!0,U.sharedHandler?.hooks?.lifecycle?.afterRegisterShare?.on?.(e=>{let{shared:t,previousShared:n,registeredShared:r}=e||{},i=U.shareScopeMap?.[e.scope]?.[e.pkgName];t&&i&&(t.shareConfig?.import===!1?r===t&&n&&n.shareConfig?.import!==!1&&i[t.version]===t&&(i[t.version]=n):r!==t&&r?.shareConfig?.import===!1&&!r.loaded&&i[t.version]===r&&(i[t.version]=t))}));let W=new WeakMap;he.on(e=>{let t=e.shareInfo?.[B],n=e.resolver;return typeof n==`function`&&(e.resolver=(...r)=>{let i=n(...r);if(i?.shared?.shareConfig?.import===!1&&typeof __mfSelectSharedProvider==`function`&&F[e.pkgName]){let t=__mfSelectSharedProvider(e.shareScopeMap?.[e.scope]?.[e.pkgName],e.pkgName,F[e.pkgName],`version-first`);t&&t.shareConfig?.import!==!1&&(i={shared:t,useTreesShaking:i.useTreesShaking})}let a=i?.shared;return a&&(typeof a==`object`||typeof a==`function`)&&!W.has(a)&&W.set(a,{from:a.from}),t!==void 0&&a&&V.set(t,a),i}),e});let ge=(e,t,n,r)=>{if(!e||e[t]!==n)return;let i=Object.assign({},r,{version:r.version??t,scope:r.scope??n?.scope??[`default`],strategy:`loaded-first`}),a=r.from;e[t]=i;let o=()=>n===void 0?e[t]===void 0:e[t]===n;return{provider:i,reveal(){return e[t]===i&&(n===void 0?delete e[t]:e[t]=n,!0)},reapply(){return o()?(e[t]=i,!0):!1},release(s,c=!0){return r.from=a,e[t]===i?c?s?(i.from=a,s&&i.lib&&(i.loaded=!0),r.strategy===void 0?delete i.strategy:i.strategy=r.strategy,!0):(n===void 0?delete e[t]:e[t]=n,!1):(n===void 0?delete e[t]:e[t]=n,!0):!c&&o()}}},_e=e=>Object.entries(e||{}).map(([e,t])=>({provider:t,version:e,from:t.from,registered:!0})),ve=(e,t)=>{if(t===void 0)return;let n;for(let r of e){let e=r.provider,i=e.treeShaking||e;if(r.loadedFactory===t||e.lib===t||i.lib===t){if(n)return;n=r}}return n},ye=async(e,t,n)=>{let r=++fe;H.set(r,{pinned:n});try{let n=await U.loadShare(e,{customShareInfo:{shareConfig:t,[B]:r}});return{factory:n===!1?void 0:n,selectedProvider:V.get(r)}}finally{V.delete(r),H.delete(r)}},G=async(e,t,n,r,i,a,o=!0)=>{let s=a.from,c=ge(n,r,i,a);if(!c)return;let l;try{l=await ye(e,t,c)}catch(e){throw c.release(!1),e}let u=l?.factory;if(u===void 0){c.release(!1);return}let d=_e(n),f=c.provider.treeShaking||c.provider,p=c.provider.lib===u||f.lib===u;if(!o&&p){let e=d.findIndex(e=>e.provider===c.provider);e!==-1&&d.splice(e,1)}!o&&!d.some(e=>e.provider===a)&&d.push({provider:a,version:r,from:s,registered:!1,loadedFactory:p?u:void 0});let m=!o&&l.selectedProvider===c.provider&&p?a:l.selectedProvider;if(m&&!d.some(e=>e.provider===m)){let e=W.get(m),t=typeof m.version==`string`&&m.version?m.version:r;d.push({provider:m,version:t,from:e?e.from:m.from,registered:n?.[t]===m,loadedFactory:u})}let h=d.find(e=>e.provider===m)??ve(d,u);if(!c.release(!0,h?.provider===c.provider)||!h)return;let g=W.get(h.provider);h.from=h.provider===a?s:g?g.from:h.provider.from,g&&(h.provider.from=g.from);let _=typeof u==`function`?u():u,v=await Promise.resolve(_);if(!(h.registered&&n?.[h.version]!==h.provider))return{provider:h.provider,selection:h,resolved:v}},K=new Set,q=new Map,be=async(e,n,r)=>{let o=!!n.shareConfig?.singleton;if(!o&&n.canLiveRebind!==!1)try{let s=__mfSelectExternalSharedProvider(r,e,n,`version-first`),c=__mfFindSharedProviderEntry(r,s);if(!c||n.shareConfig?.import===!1&&__mfMatchesSharedProvider(s,n)||s?.shareConfig?.import===!1)return;let{version:l}=c;if(!o&&l!==n.version||!s.lib&&!s.loading&&!(s.loaded&&typeof s.get==`function`))return;let u=i(e,o,n.version,n.scope);if(a(m.share,u)!==void 0)return;let d=t[e],f=d?.[l];if(c.registered&&!__mfMatchesSharedProvider(f,s))return;let p,h=s.lib;if(!h&&I(s)||(!h&&s.loading&&(h=await s.loading),!h&&s.loaded&&typeof s.get==`function`&&(h=await s.get()),!h))return;let g=typeof h==`function`?h():h,_=await Promise.resolve(g),v=c.registered?f:s;p={provider:v,selection:{provider:v,version:l,from:s.from,registered:c.registered},resolved:_};let y=p?.provider,b=p?.selection;if(!b)return;let x=p?.resolved;if(x===void 0||a(m.share,u)!==void 0||b.registered&&d?.[b.version]!==y)return;w(m.share,u,z(x),b.from),K.add(y)}catch(t){console.error(`[Module Federation] Failed to bridge materialized shared module "`+e+`"`,t)}},J=async(e,n,r,o,s)=>{try{let c=i(e,n.shareConfig?.singleton,n.version,n.scope),l=a(m.share,c),u=d(m.share,c),f=__mfSelectExternalSharedProvider(r,e,n,`version-first`),p=f||__mfSelectSharedProvider(r,e,n,`version-first`)||n,h=__mfFindSharedProviderEntry(r,p);if(!h)return;let g=__mfMatchesSharedProvider(p,n),{version:_}=h;if(!n.shareConfig?.singleton&&_!==n.version)return;let y=o?.[_],b=__mfResolveExternalSharedProvider(j,N,t,`default`,e,h,f,y,`version-first`);if(!b&&!g)return;let{provider:x,scopeRootProvider:S}=b||{provider:p,scopeRootProvider:void 0};if(n.canLiveRebind===!1||n.shareConfig?.import===!1&&__mfMatchesSharedProvider(x,n)||x?.shareConfig?.import===!1||l!==void 0&&u!==v)return;let C=t[e],T=C?.[_];if(h.registered&&!S&&!__mfMatchesSharedProvider(T,x))return;let E=await G(e,n.shareConfig,C,_,T,x,h.registered&&!g),D=E?.provider,O=E?.selection;if(!O||__mfMatchesSharedProvider(D,n)||s&&(s.version!==O.version||!__mfMatchesSharedProvider({from:O.from},s.provider))||K.has(D))return;let k=E?.resolved;if(k===void 0)return;let A=a(m.share,c),ee=d(m.share,c);if(A!==void 0&&ee!==v||O.registered&&C?.[O.version]!==D)return;s||q.set(e,{version:O.version,provider:{from:O.from}}),K.add(D);let M=z(k);w(m.share,c,M,O.from)}catch(t){console.error(`[Module Federation] Failed to bridge external shared module "`+e+`"`,t)}};for(let e of y)await Promise.all(e.map(async e=>{let t=F[e];t&&t.materialize!==!1&&!t.treeShaking&&await be(e,t,P[e])}));for(let[e,t]of Object.entries(F)){if(t.treeShaking)continue;let n=i(e,t.shareConfig?.singleton,t.version,t.scope);if(a(m.share,n)!==void 0)continue;let r=i(e,!0,t.version,t.scope),o=a(m.share,r);o!==void 0&&w(m.share,n,o,d(m.share,r))}let xe=[],Se=[],Y=new Map(xe.map((e,t)=>[e,t])),Ce={},X=xe.filter(e=>F[e]&&(F[e].materialize!==!1||F[e].shareConfig?.import===!1&&!F[e].lazy));m.providerInit||=new Map;let we=(e,t)=>{let n=m.providerInit.get(e);if(n)return n;let r=Promise.resolve().then(t);return m.providerInit.set(e,r),r.catch(()=>m.providerInit.delete(e)),r};var Te=async e=>{let t=new Set(e);for(let e of Se)await Promise.all(e.filter(e=>t.has(e)).map(async e=>{let t=F[e],n=i(e,t.shareConfig?.singleton,t.version,t.scope);if(t.shareConfig?.import===!1||t.treeShaking||a(m.share,n)!==void 0)return;let r=i(e,!0,t.version,t.scope),o=a(m.share,r);if(o!==void 0){w(m.share,n,o,d(m.share,r));return}let s=typeof L==`function`?L(e,t):void 0;if(s){let r=s.lib;if(!r&&s.loading&&(r=await s.loading),!r&&s.loaded&&typeof s.get==`function`&&(r=await s.get()),r){let e=typeof r==`function`?r():r,t=await Promise.resolve(e);w(m.share,n,(e=>{let t=e;for(let e=0;e<5;e++){let e=t?.default;if(!e||typeof e!=`object`||Object.keys(e).length===0)break;let n=Object.getPrototypeOf(e);if(n!==null&&n!==Object.prototype)break;let r=Object.keys(t).filter(e=>e!=="default").map(e=>t[e]);if(r.length>0&&r.some(e=>e!==void 0))break;t=e}return t})(t),s.from);return}if(typeof I==`function`&&I(s)&&(t.shareConfig?.singleton||__mfFindSharedProviderEntry(P[e],s)?.version===t.version))return}let c=n.canonical,l=await we(c,async()=>{let e=await t.get(),n=typeof e==`function`?e():e;return Promise.resolve(n)});for(let n of U.options.shared?.[e]||[])n.get===t.get&&(n.eager=!0);let u=(e=>{let t=e;for(let e=0;e<5;e++){let e=t?.default;if(!e||typeof e!=`object`||Object.keys(e).length===0)break;let n=Object.getPrototypeOf(e);if(n!==null&&n!==Object.prototype)break;let r=Object.keys(t).filter(e=>e!=="default").map(e=>t[e]);if(r.length>0&&r.some(e=>e!==void 0))break;t=e}return t})(l),f=u===l?{...l}:u;f.__esModule!==!0&&Object.defineProperty(f,"__esModule",{value:!0,enumerable:!1}),w(m.share,n,f,v)}))};let Z=e=>{let t=F[e];if(!t.treeShaking&&t.shareConfig?.import!==!1)return!1;let n=i(e,t.shareConfig?.singleton,t.version,t.scope);return t.treeShaking?A(m.share,n,v)===void 0&&a(m.share,n)===void 0:a(m.share,n)===void 0},Ee=e=>{let t=F[e],n=i(e,t.shareConfig?.singleton,t.version,t.scope);return(t.treeShaking?A(m.share,n,v)??a(m.share,n):a(m.share,n))===void 0?t.treeShaking||t.shareConfig?.import===!1?!0:typeof __mfSelectExternalSharedProvider==`function`&&!!__mfSelectExternalSharedProvider(P[e],e,t,`version-first`):!1},De=e=>{let t=!0;for(;t;){t=!1;for(let n of X){let r=Y.get(n);e.has(r)||(Ce[r]||[]).some(t=>e.has(t))&&(e.add(r),t=!0)}}return e},Oe=De(new Set(X.filter(Ee).map(e=>Y.get(e)))),ke=X.filter(e=>!Oe.has(Y.get(e)));var Ae=X.filter(e=>Oe.has(Y.get(e)));await Te(ke).catch(f);try{await S(async()=>{await Promise.all(await U.initializeSharing(`default`,{strategy:`version-first`,from:`build`,initScope:n}))})}catch(e){console.error(`[Module Federation]`,e)}ae();let je=async()=>{for(let e of y)await Promise.all(e.map(async e=>{let n=F[e];n&&n.materialize!==!1&&!n.treeShaking&&await J(e,n,t[e],P[e],void 0)}))};se?x=je:await je();try{let e=globalThis.__FEDERATION__?.__SHARE__,t=Object.create(null);if(e)for(let[,n]of Object.entries(e))for(let e of g){let r=n?.[e];if(r)for(let[e,n]of Object.entries(r)){let r=F?.[e],i=P[e],a=q.get(e);if(!r||!i||!a||r.treeShaking)continue;let o=t[e]||(t[e]=Object.create(null));for(let[e,t]of Object.entries(n)){if(!t.lib||a.version!==e||!__mfMatchesSharedProvider(t,a.provider))continue;let n=i[e];(t===n||n?.from&&t.from===n.from)&&(t===r||r.from&&t.from===r.from||o[e]===void 0&&(o[e]=t))}}}for(let e of y)await Promise.all(e.map(async e=>{let n=t[e];n&&await J(e,F[e],n,P[e],q.get(e))}))}catch(e){console.error(`[Module Federation] Failed to bridge external shared modules`,e)}let Me=async()=>{},Ne=async(e,n)=>{let r=i(e,n.shareConfig?.singleton,n.version,n.scope),o=n.treeShaking?A(m.share,r,v):a(m.share,r);if(n.shareConfig?.import!==!1||o!==void 0||le(e,n,P[e]))return;let s=e=>{let t=e;for(let e=0;e<5;e++){let e=t?.default;if(!e||typeof e!=`object`||Object.keys(e).length===0)break;let n=Object.getPrototypeOf(e);if(n!==null&&n!==Object.prototype)break;let r=Object.keys(t).filter(e=>e!=="default").map(e=>t[e]);if(r.length>0&&r.some(e=>e!==void 0))break;t=e}return t},c=t?.[e],l=__mfSelectSharedProvider(c,e,n,`version-first`)||n,u=__mfFindSharedProviderEntry(c,l);if(!u)return;let d=e=>e===n||e?.shareConfig?.import===!1;if(d(l))return;let{version:f}=u,p=c?.[f],h=await G(e,n.shareConfig,c,f,p,l,u.registered),g=h?.selection,_=h?.provider,y=h?.resolved;if(!g||d(_)||y===void 0||(n.treeShaking?A(m.share,r,v):a(m.share,r))!==void 0||g.registered&&c?.[g.version]!==_)return;let b=s(y);if(n.treeShaking){let e=n.treeShaking.providedExports??n.treeShaking.usedExports??[];D(m.share,r,e,b),ee(m.share,r,v,b)}else w(m.share,r,b,g.from)},Pe=[],Q=new Set;for(let e of Ae){let t=F[e],n=Y.get(e);if(Z(e))try{t.treeShaking?await Me(e,t):t.shareConfig?.import===!1&&await Ne(e,t)}catch(t){console.error(`[Module Federation] Failed to resolve runtime-only shared module "${e}"`,t)}Z(e)&&Q.add(n)}De(Q),Pe.push(...Ae.filter(e=>!Q.has(Y.get(e)))),await Te(Pe).catch(f);let $=new Map;return l.loadLazyShares=async e=>{let n=new Set(e);for(let e of y)await Promise.all(e.filter(e=>n.has(e)).map(e=>{let n=F[e];if(!n||!n.lazy||!Z(e))return;let r=$.get(e);return r||(r=J(e,n,t[e],P[e],void 0).then(()=>Z(e)?Ne(e,n):void 0),r.catch(()=>$.delete(e)),$.set(e,r)),r}))},u(U),U}async function E(e){let t=await w();if(!(e in t))throw Error(`[Module Federation] Module ${e} does not exist in container.`);return x&&await x(),m.pendingShareLoads&&await Promise.all(m.pendingShareLoads),t[e]().then(e=>()=>e)}export{E as get,T as init};
1
+ import{t as e}from"./chunks/dist-B7yMidtt.js";import{t}from"./chunks/vite-preload-helper-DHhhL8Zf.js";var n={},r=new Set,i=new Map;function a(e,t){let n=i.get(e);return n||(n=Promise.resolve().then(t).catch(t=>{throw i.delete(e),t}),i.set(e,n)),n}async function o(e){if(typeof document>`u`)return;let t=n[e]||[];await Promise.all(t.map(e=>{let t=new URL(e,import.meta.url).href;return r.has(t)||(r.add(t),document.querySelector(`link[rel="stylesheet"][href="${t}"]`))?Promise.resolve():new Promise((e,n)=>{let r=document.createElement(`link`);r.rel=`stylesheet`,r.href=t,r.onload=()=>e(),r.onerror=()=>n(Error(`[Module Federation] Failed to load CSS asset: ${t}`)),document.head.appendChild(r)})}))}var s={"./PluginConfigurationPanel":async()=>{await o(`./PluginConfigurationPanel`),await Promise.all([]);let e=await a(`./PluginConfigurationPanel`,()=>t(()=>import(`./configpanel-entry.js`),[])),n=e&&e.__mf_remote_dependency_pending;n&&typeof n.then==`function`&&await n;let r={};return Object.assign(r,e),Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),r}};typeof __VUE_HMR_RUNTIME__>`u`&&(globalThis.__VUE_HMR_RUNTIME__={createRecord(){},rerender(){},reload(){}});var c=`__mf_init__virtual:mf:__mfe_internal__signalk_container__mf_owner__176128520841313__mf_v__runtimeInit__mf_v__.js__`,l=globalThis[c];if(!l){let e,t,n=new Promise((n,r)=>{e=n,t=r});l=globalThis[c]={initPromise:n,initResolve:e,initReject:t}}var u=l.initResolve,{initReject:d}=l,f=e=>{throw d(e),e},p=`__mf_module_cache__`;globalThis[p]||={share:{},remote:{}},globalThis[p].share||={},globalThis[p].remote||={};var m=globalThis[p];for(let e of Object.keys(m.share))if(e.startsWith(`default:`)){let t=e.slice(8);m.share[t]===void 0&&(m.share[t]=m.share[e])}else if(!e.includes(`:`)){let t=`default:`+e;m.share[t]===void 0&&(m.share[t]=m.share[e])}var h={},g=Array.isArray(`default`)?`default`:[`default`],_=`default`,v=`signalk_container`,y=[],b,x;async function S(e){for(let t=0;;t++)try{return await e()}catch(e){throw e}}async function C(){return b||=S(()=>t(()=>import(`./chunks/_virtual_mf-localSharedImportMap___mfe_internal__signalk_container__mf_owner__1-wIqhHrSe.js`),[])).catch(e=>{throw b=void 0,e}),b}async function w(){return s}async function T(t={},n=[],r={}){let i=(e,t,n,r)=>{let i=(Array.isArray(r)?r[0]:r)||`default`,a=t||!n?e:e+`@`+n,o={canonical:i+`:`+a};return i==="default"&&(o.aliases=[a]),o},a=(e,t)=>{let n=e[t.canonical];if(n!==void 0)return n;let r=t.aliases||[];for(let n of r){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let r=e[n];if(r!==void 0)return e[t.canonical]=r,r}},o=Symbol.for(`module-federation.shared-cache-listeners`),s=Symbol.for(`module-federation.shared-cache-owners`),c=e=>{let t=e[s];return t===void 0&&(t=Object.create(null),Object.defineProperty(e,s,{value:t,enumerable:!1,configurable:!1,writable:!1})),t},d=(e,t)=>e[s]?.[t.canonical],p=e=>{let t=[e,e?.default];for(let e of t)if(e&&typeof e==`object`){for(let t of[`__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE`,`__TEST_INTERNALS`,`__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED`]){let n=e[t];if(n&&typeof n==`object`)return{internals:n}}if(typeof e.useState==`function`)return{hook:e.useState}}},b=(e,t)=>{if(e===t)return!0;let n=p(e),r=p(t);if(!n||!r)return!1;let i=n.internals,a=r.internals;return i!==void 0||a!==void 0?i!==void 0&&i===a:typeof n.hook==`function`&&n.hook===r.hook},w=(e,t,n,r)=>{let i=a(e,t);if(i!==void 0&&b(i,n))return n;e[t.canonical]=n;let l=t.aliases||[];for(let t of l)Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0});let u=e[s];r===void 0?u&&delete u[t.canonical]:c(e)[t.canonical]=r;let d=e[o]?.[t.canonical];if(d)for(let e of d)e(n);return n},T=Symbol.for(`module-federation.tree-shaking-shared-cache`),E=e=>{let t=e[T];return t===void 0&&(t=Object.create(null),Object.defineProperty(e,T,{value:t,enumerable:!1,configurable:!1,writable:!1})),t},D=(e,t,n,r)=>{if(!Array.isArray(n))return r;let i=[...new Set(n)].sort(),a=E(e),o=a[t.canonical]||=[],s=o.find(e=>e.providedExports.length===i.length&&e.providedExports.every((e,t)=>e===i[t]));return s?s.value=r:o.push({providedExports:i,value:r}),r},O=Symbol.for(`module-federation.tree-shaking-shared-selection-cache`),k=e=>{let t=e[O];return t===void 0&&(t=Object.create(null),Object.defineProperty(e,O,{value:t,enumerable:!1,configurable:!1,writable:!1})),t},A=(e,t,n)=>{let r=a(e,t);return r===void 0?e[O]?.[t.canonical]?.[n]:r},ee=(e,t,n,r)=>{let i=k(e),a=i[t.canonical]||=Object.create(null);return a[n]=r,r},j=globalThis.__FEDERATION__?.__INSTANCES__||[],M=n.find(e=>e?.from)?.from,N=j.find(e=>e?.options?.name===M&&e?.shareScopeMap?.default===t)||j.find(e=>e?.options?.name!==v&&e?.shareScopeMap?.default===t),te=Object.create(null),ne=e=>{let t=Object.create(null);for(let[n,r]of Object.entries(e||{}))t[n]=Object.assign(Object.create(null),r);return t},re=(e,t)=>{for(let[n,r]of Object.entries(U.shareScopeMap?.[e]||{}))for(let[e,i]of Object.entries(r||{})){if(!i||i.get===F[n]?.get)continue;let r=t[n]||={};r[e]===void 0&&(r[e]=i)}},ie=(e,t)=>{re(e,t);let n=!N&&Object.values(t||{}).some(e=>Object.values(e||{}).some(I)),r=n?ne(t):t;return te[e]={host:t,runtime:r,isWebpackScope:n},r},ae=()=>{let e=Object.values(te).filter(({isWebpackScope:e})=>e);if(e.length!==0)for(let{host:t,runtime:n}of e)for(let[e,r]of Object.entries(t||{})){let t=n[e]||=Object.create(null);for(let[e,n]of Object.entries(r||{}))t[e]=n}},P=Object.create(null);for(let[e,n]of Object.entries(t)){let t=P[e]=Object.create(null);for(let[e,r]of Object.entries(n))t[e]=Object.assign({},r)}let{usedShared:F,usedRemotes:oe}=await C();function I(e){if(typeof e?.get!=`function`)return!1;let t=Function.prototype.toString.call(e.get);return t.includes(`__webpack_require__`)||/\.\s*e\s*\([^)]*\)\s*\.then\s*\(/.test(t)}let se=Object.values(P).some(e=>Object.values(e||{}).some(I)),ce=e=>{let t=e.split(`/`);return e.startsWith(`@`)?t.slice(0,2).join(`/`):t[0]},L=(e,n,r,i)=>{if(typeof __mfSelectExternalSharedProvider!=`function`)return;let a=ce(e),o=!i||a===e?[[e,n]]:[[e,n],[a,F[a]]];for(let[n,i]of o){if(!i)continue;let a=r?n===e?r:P[n]:P[n]??t[n],o=__mfSelectExternalSharedProvider(a,n,i,`version-first`);if(o)return o}},le=(e,t,n)=>{let r=L(e,t,n,!0);return r&&I(r)&&!r.lib&&!r.loaded?r:void 0};var R=h[_];if(R||=h[_]={from:v},n.indexOf(R)>=0)return;n.push(R);let z=e=>{let t=e;for(let e=0;e<5;e++){let e=t?.default;if(!e||typeof e!=`object`||Object.keys(e).length===0)break;let n=Object.getPrototypeOf(e);if(n!==null&&n!==Object.prototype)break;let r=Object.keys(t).filter(e=>e!=="default").map(e=>t[e]);if(r.length>0&&r.some(e=>e!==void 0))break;t=e}return t},ue=[],de=globalThis.window===void 0?await Promise.all([]):[],B=`__mf_vite_runtime_share_load_id__`,fe=0,V=new Map,H=new Map,U=e({name:v,remotes:oe,shared:F,plugins:[pe(),me(),...ue,...de],shareStrategy:`version-first`});U.initShareScopeMap(`default`,ie(`default`,t));function pe(){return{name:`vite-share-pin-lifecycle-plugin`,resolveShare(e){let t=e.shareInfo?.[B],n=t===void 0?void 0:H.get(t);if(!n)return e;let r=e.resolver;return e.resolver=(...e)=>(n.pinned.reapply(),r(...e)),n.pinned.reveal(),e}}}function me(){return{name:`vite-real-name-snapshot-plugin`,afterLoadSnapshot(e){let t=e&&e.remoteSnapshot,n=t&&t.globalName,r=t&&t.version;if(!n||!r||!t.remoteEntry)return e;let i=globalThis.__FEDERATION__&&globalThis.__FEDERATION__.moduleInfo,a=n+`:`+r;return i&&!i[a]&&(i[a]=t),e}}}let he=U.sharedHandler.hooks.lifecycle.resolveShare;U.__mfKeepAdoptedProviders||(U.__mfKeepAdoptedProviders=!0,U.sharedHandler?.hooks?.lifecycle?.afterRegisterShare?.on?.(e=>{let{shared:t,previousShared:n,registeredShared:r}=e||{},i=U.shareScopeMap?.[e.scope]?.[e.pkgName];t&&i&&(t.shareConfig?.import===!1?r===t&&n&&n.shareConfig?.import!==!1&&i[t.version]===t&&(i[t.version]=n):r!==t&&r?.shareConfig?.import===!1&&!r.loaded&&i[t.version]===r&&(i[t.version]=t))}));let W=new WeakMap;he.on(e=>{let t=e.shareInfo?.[B],n=e.resolver;return typeof n==`function`&&(e.resolver=(...r)=>{let i=n(...r);if(i?.shared?.shareConfig?.import===!1&&typeof __mfSelectSharedProvider==`function`&&F[e.pkgName]){let t=__mfSelectSharedProvider(e.shareScopeMap?.[e.scope]?.[e.pkgName],e.pkgName,F[e.pkgName],`version-first`);t&&t.shareConfig?.import!==!1&&(i={shared:t,useTreesShaking:i.useTreesShaking})}let a=i?.shared;return a&&(typeof a==`object`||typeof a==`function`)&&!W.has(a)&&W.set(a,{from:a.from}),t!==void 0&&a&&V.set(t,a),i}),e});let ge=(e,t,n,r)=>{if(!e||e[t]!==n)return;let i=Object.assign({},r,{version:r.version??t,scope:r.scope??n?.scope??[`default`],strategy:`loaded-first`}),a=r.from;e[t]=i;let o=()=>n===void 0?e[t]===void 0:e[t]===n;return{provider:i,reveal(){return e[t]===i&&(n===void 0?delete e[t]:e[t]=n,!0)},reapply(){return o()?(e[t]=i,!0):!1},release(s,c=!0){return r.from=a,e[t]===i?c?s?(i.from=a,s&&i.lib&&(i.loaded=!0),r.strategy===void 0?delete i.strategy:i.strategy=r.strategy,!0):(n===void 0?delete e[t]:e[t]=n,!1):(n===void 0?delete e[t]:e[t]=n,!0):!c&&o()}}},_e=e=>Object.entries(e||{}).map(([e,t])=>({provider:t,version:e,from:t.from,registered:!0})),ve=(e,t)=>{if(t===void 0)return;let n;for(let r of e){let e=r.provider,i=e.treeShaking||e;if(r.loadedFactory===t||e.lib===t||i.lib===t){if(n)return;n=r}}return n},ye=async(e,t,n)=>{let r=++fe;H.set(r,{pinned:n});try{let n=await U.loadShare(e,{customShareInfo:{shareConfig:t,[B]:r}});return{factory:n===!1?void 0:n,selectedProvider:V.get(r)}}finally{V.delete(r),H.delete(r)}},G=async(e,t,n,r,i,a,o=!0)=>{let s=a.from,c=ge(n,r,i,a);if(!c)return;let l;try{l=await ye(e,t,c)}catch(e){throw c.release(!1),e}let u=l?.factory;if(u===void 0){c.release(!1);return}let d=_e(n),f=c.provider.treeShaking||c.provider,p=c.provider.lib===u||f.lib===u;if(!o&&p){let e=d.findIndex(e=>e.provider===c.provider);e!==-1&&d.splice(e,1)}!o&&!d.some(e=>e.provider===a)&&d.push({provider:a,version:r,from:s,registered:!1,loadedFactory:p?u:void 0});let m=!o&&l.selectedProvider===c.provider&&p?a:l.selectedProvider;if(m&&!d.some(e=>e.provider===m)){let e=W.get(m),t=typeof m.version==`string`&&m.version?m.version:r;d.push({provider:m,version:t,from:e?e.from:m.from,registered:n?.[t]===m,loadedFactory:u})}let h=d.find(e=>e.provider===m)??ve(d,u);if(!c.release(!0,h?.provider===c.provider)||!h)return;let g=W.get(h.provider);h.from=h.provider===a?s:g?g.from:h.provider.from,g&&(h.provider.from=g.from);let _=typeof u==`function`?u():u,v=await Promise.resolve(_);if(!(h.registered&&n?.[h.version]!==h.provider))return{provider:h.provider,selection:h,resolved:v}},K=new Set,q=new Map,be=async(e,n,r)=>{let o=!!n.shareConfig?.singleton;if(!o&&n.canLiveRebind!==!1)try{let s=__mfSelectExternalSharedProvider(r,e,n,`version-first`),c=__mfFindSharedProviderEntry(r,s);if(!c||n.shareConfig?.import===!1&&__mfMatchesSharedProvider(s,n)||s?.shareConfig?.import===!1)return;let{version:l}=c;if(!o&&l!==n.version||!s.lib&&!s.loading&&!(s.loaded&&typeof s.get==`function`))return;let u=i(e,o,n.version,n.scope);if(a(m.share,u)!==void 0)return;let d=t[e],f=d?.[l];if(c.registered&&!__mfMatchesSharedProvider(f,s))return;let p,h=s.lib;if(!h&&I(s)||(!h&&s.loading&&(h=await s.loading),!h&&s.loaded&&typeof s.get==`function`&&(h=await s.get()),!h))return;let g=typeof h==`function`?h():h,_=await Promise.resolve(g),v=c.registered?f:s;p={provider:v,selection:{provider:v,version:l,from:s.from,registered:c.registered},resolved:_};let y=p?.provider,b=p?.selection;if(!b)return;let x=p?.resolved;if(x===void 0||a(m.share,u)!==void 0||b.registered&&d?.[b.version]!==y)return;w(m.share,u,z(x),b.from),K.add(y)}catch(t){console.error(`[Module Federation] Failed to bridge materialized shared module "`+e+`"`,t)}},J=async(e,n,r,o,s)=>{try{let c=i(e,n.shareConfig?.singleton,n.version,n.scope),l=a(m.share,c),u=d(m.share,c),f=__mfSelectExternalSharedProvider(r,e,n,`version-first`),p=f||__mfSelectSharedProvider(r,e,n,`version-first`)||n,h=__mfFindSharedProviderEntry(r,p);if(!h)return;let g=__mfMatchesSharedProvider(p,n),{version:_}=h;if(!n.shareConfig?.singleton&&_!==n.version)return;let y=o?.[_],b=__mfResolveExternalSharedProvider(j,N,t,`default`,e,h,f,y,`version-first`);if(!b&&!g)return;let{provider:x,scopeRootProvider:S}=b||{provider:p,scopeRootProvider:void 0};if(n.canLiveRebind===!1||n.shareConfig?.import===!1&&__mfMatchesSharedProvider(x,n)||x?.shareConfig?.import===!1||l!==void 0&&u!==v)return;let C=t[e],T=C?.[_];if(h.registered&&!S&&!__mfMatchesSharedProvider(T,x))return;let E=await G(e,n.shareConfig,C,_,T,x,h.registered&&!g),D=E?.provider,O=E?.selection;if(!O||__mfMatchesSharedProvider(D,n)||s&&(s.version!==O.version||!__mfMatchesSharedProvider({from:O.from},s.provider))||K.has(D))return;let k=E?.resolved;if(k===void 0)return;let A=a(m.share,c),ee=d(m.share,c);if(A!==void 0&&ee!==v||O.registered&&C?.[O.version]!==D)return;s||q.set(e,{version:O.version,provider:{from:O.from}}),K.add(D);let M=z(k);w(m.share,c,M,O.from)}catch(t){console.error(`[Module Federation] Failed to bridge external shared module "`+e+`"`,t)}};for(let e of y)await Promise.all(e.map(async e=>{let t=F[e];t&&t.materialize!==!1&&!t.treeShaking&&await be(e,t,P[e])}));for(let[e,t]of Object.entries(F)){if(t.treeShaking)continue;let n=i(e,t.shareConfig?.singleton,t.version,t.scope);if(a(m.share,n)!==void 0)continue;let r=i(e,!0,t.version,t.scope),o=a(m.share,r);o!==void 0&&w(m.share,n,o,d(m.share,r))}let xe=[],Se=[],Y=new Map(xe.map((e,t)=>[e,t])),Ce={},X=xe.filter(e=>F[e]&&(F[e].materialize!==!1||F[e].shareConfig?.import===!1&&!F[e].lazy));m.providerInit||=new Map;let we=(e,t)=>{let n=m.providerInit.get(e);if(n)return n;let r=Promise.resolve().then(t);return m.providerInit.set(e,r),r.catch(()=>m.providerInit.delete(e)),r};var Te=async e=>{let t=new Set(e);for(let e of Se)await Promise.all(e.filter(e=>t.has(e)).map(async e=>{let t=F[e],n=i(e,t.shareConfig?.singleton,t.version,t.scope);if(t.shareConfig?.import===!1||t.treeShaking||a(m.share,n)!==void 0)return;let r=i(e,!0,t.version,t.scope),o=a(m.share,r);if(o!==void 0){w(m.share,n,o,d(m.share,r));return}let s=typeof L==`function`?L(e,t):void 0;if(s){let r=s.lib;if(!r&&s.loading&&(r=await s.loading),!r&&s.loaded&&typeof s.get==`function`&&(r=await s.get()),r){let e=typeof r==`function`?r():r,t=await Promise.resolve(e);w(m.share,n,(e=>{let t=e;for(let e=0;e<5;e++){let e=t?.default;if(!e||typeof e!=`object`||Object.keys(e).length===0)break;let n=Object.getPrototypeOf(e);if(n!==null&&n!==Object.prototype)break;let r=Object.keys(t).filter(e=>e!=="default").map(e=>t[e]);if(r.length>0&&r.some(e=>e!==void 0))break;t=e}return t})(t),s.from);return}if(typeof I==`function`&&I(s)&&(t.shareConfig?.singleton||__mfFindSharedProviderEntry(P[e],s)?.version===t.version))return}let c=n.canonical,l=await we(c,async()=>{let e=await t.get(),n=typeof e==`function`?e():e;return Promise.resolve(n)});for(let n of U.options.shared?.[e]||[])n.get===t.get&&(n.eager=!0);let u=(e=>{let t=e;for(let e=0;e<5;e++){let e=t?.default;if(!e||typeof e!=`object`||Object.keys(e).length===0)break;let n=Object.getPrototypeOf(e);if(n!==null&&n!==Object.prototype)break;let r=Object.keys(t).filter(e=>e!=="default").map(e=>t[e]);if(r.length>0&&r.some(e=>e!==void 0))break;t=e}return t})(l),f=u===l?{...l}:u;f.__esModule!==!0&&Object.defineProperty(f,"__esModule",{value:!0,enumerable:!1}),w(m.share,n,f,v)}))};let Z=e=>{let t=F[e];if(!t.treeShaking&&t.shareConfig?.import!==!1)return!1;let n=i(e,t.shareConfig?.singleton,t.version,t.scope);return t.treeShaking?A(m.share,n,v)===void 0&&a(m.share,n)===void 0:a(m.share,n)===void 0},Ee=e=>{let t=F[e],n=i(e,t.shareConfig?.singleton,t.version,t.scope);return(t.treeShaking?A(m.share,n,v)??a(m.share,n):a(m.share,n))===void 0?t.treeShaking||t.shareConfig?.import===!1?!0:typeof __mfSelectExternalSharedProvider==`function`&&!!__mfSelectExternalSharedProvider(P[e],e,t,`version-first`):!1},De=e=>{let t=!0;for(;t;){t=!1;for(let n of X){let r=Y.get(n);e.has(r)||(Ce[r]||[]).some(t=>e.has(t))&&(e.add(r),t=!0)}}return e},Oe=De(new Set(X.filter(Ee).map(e=>Y.get(e)))),ke=X.filter(e=>!Oe.has(Y.get(e)));var Ae=X.filter(e=>Oe.has(Y.get(e)));await Te(ke).catch(f);try{await S(async()=>{await Promise.all(await U.initializeSharing(`default`,{strategy:`version-first`,from:`build`,initScope:n}))})}catch(e){console.error(`[Module Federation]`,e)}ae();let je=async()=>{for(let e of y)await Promise.all(e.map(async e=>{let n=F[e];n&&n.materialize!==!1&&!n.treeShaking&&await J(e,n,t[e],P[e],void 0)}))};se?x=je:await je();try{let e=globalThis.__FEDERATION__?.__SHARE__,t=Object.create(null);if(e)for(let[,n]of Object.entries(e))for(let e of g){let r=n?.[e];if(r)for(let[e,n]of Object.entries(r)){let r=F?.[e],i=P[e],a=q.get(e);if(!r||!i||!a||r.treeShaking)continue;let o=t[e]||(t[e]=Object.create(null));for(let[e,t]of Object.entries(n)){if(!t.lib||a.version!==e||!__mfMatchesSharedProvider(t,a.provider))continue;let n=i[e];(t===n||n?.from&&t.from===n.from)&&(t===r||r.from&&t.from===r.from||o[e]===void 0&&(o[e]=t))}}}for(let e of y)await Promise.all(e.map(async e=>{let n=t[e];n&&await J(e,F[e],n,P[e],q.get(e))}))}catch(e){console.error(`[Module Federation] Failed to bridge external shared modules`,e)}let Me=async()=>{},Ne=async(e,n)=>{let r=i(e,n.shareConfig?.singleton,n.version,n.scope),o=n.treeShaking?A(m.share,r,v):a(m.share,r);if(n.shareConfig?.import!==!1||o!==void 0||le(e,n,P[e]))return;let s=e=>{let t=e;for(let e=0;e<5;e++){let e=t?.default;if(!e||typeof e!=`object`||Object.keys(e).length===0)break;let n=Object.getPrototypeOf(e);if(n!==null&&n!==Object.prototype)break;let r=Object.keys(t).filter(e=>e!=="default").map(e=>t[e]);if(r.length>0&&r.some(e=>e!==void 0))break;t=e}return t},c=t?.[e],l=__mfSelectSharedProvider(c,e,n,`version-first`)||n,u=__mfFindSharedProviderEntry(c,l);if(!u)return;let d=e=>e===n||e?.shareConfig?.import===!1;if(d(l))return;let{version:f}=u,p=c?.[f],h=await G(e,n.shareConfig,c,f,p,l,u.registered),g=h?.selection,_=h?.provider,y=h?.resolved;if(!g||d(_)||y===void 0||(n.treeShaking?A(m.share,r,v):a(m.share,r))!==void 0||g.registered&&c?.[g.version]!==_)return;let b=s(y);if(n.treeShaking){let e=n.treeShaking.providedExports??n.treeShaking.usedExports??[];D(m.share,r,e,b),ee(m.share,r,v,b)}else w(m.share,r,b,g.from)},Pe=[],Q=new Set;for(let e of Ae){let t=F[e],n=Y.get(e);if(Z(e))try{t.treeShaking?await Me(e,t):t.shareConfig?.import===!1&&await Ne(e,t)}catch(t){console.error(`[Module Federation] Failed to resolve runtime-only shared module "${e}"`,t)}Z(e)&&Q.add(n)}De(Q),Pe.push(...Ae.filter(e=>!Q.has(Y.get(e)))),await Te(Pe).catch(f);let $=new Map;return l.loadLazyShares=async e=>{let n=new Set(e);for(let e of y)await Promise.all(e.filter(e=>n.has(e)).map(e=>{let n=F[e];if(!n||!n.lazy||!Z(e))return;let r=$.get(e);return r||(r=J(e,n,t[e],P[e],void 0).then(()=>Z(e)?Ne(e,n):void 0),r.catch(()=>$.delete(e)),$.set(e,r)),r}))},u(U),U}async function E(e){let t=await w();if(!(e in t))throw Error(`[Module Federation] Module ${e} does not exist in container.`);return x&&await x(),m.pendingShareLoads&&await Promise.all(m.pendingShareLoads),t[e]().then(e=>()=>e)}export{E as get,T as init};
@@ -1 +0,0 @@
1
- import"./dist-D1jGdgWH.js";var e={},t=[];export{t as usedRemotes,e as usedShared};
@@ -1,4 +0,0 @@
1
- import{t as e}from"./vite-preload-helper-DHhhL8Zf.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(){return typeof navigator<`u`&&navigator?.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 ee(e){return e.replace(/#.*$/,``).replace(/\?.*$/,``).replace(/\/[^\/]+$/,`/`)}function h(e,t={}){let{remotes:n={},overrides:r={},version:i}=t,a,o=()=>`publicPath`in e.metaData?(e.metaData.publicPath===`auto`||e.metaData.publicPath===``)&&i?ee(i):e.metaData.publicPath:e.metaData.getPublicPath,s=Object.keys(r),c={};Object.keys(n).length||(c=e.remotes?.reduce((e,t)=>{let n,i=t.federationContainerName;return n=s.includes(i)?r[i]:`version`in t?t.version:t.entry,e[i]={matchedVersion:n},e},{})||{}),Object.keys(n).forEach(e=>c[e]={matchedVersion:s.includes(e)?r[e]:n[e]});let{remoteEntry:{path:l,name:u,type:d},types:f={path:``,name:``,zip:``,api:``},buildInfo:{buildVersion:p},globalName:h,ssrRemoteEntry:g}=e.metaData,{exposes:te}=e,_={version:i||``,buildVersion:p,globalName:h,remoteEntry:m(l,u),remoteEntryType:d,remoteTypes:m(f.path,f.name),remoteTypesZip:f.zip||``,remoteTypesAPI:f.api||``,remotesInfo:c,shared:e?.shared.map(e=>({assets:e.assets,sharedName:e.name,version:e.version,usedExports:e.referenceExports||[]})),modules:te?.map(e=>({moduleName:e.name,modulePath:e.path,assets:e.assets}))};if(`publicPath`in e.metaData?(a={..._,publicPath:o()},typeof e.metaData.ssrPublicPath==`string`&&(a.ssrPublicPath=e.metaData.ssrPublicPath)):a={..._,getPublicPath:o()},g){let e=m(g.path,g.name);a.ssrRemoteEntry=e,a.ssrRemoteEntryType=g.type||`commonjs-module`}return a}function g(e){return!!(`remoteEntry`in e&&e.remoteEntry.includes(`.json`))}var te=`[ Module Federation ]`,_=console,ne=[`logger.ts`,`logger.js`,`captureStackTrace`,`Logger.emit`,`Logger.log`,`Logger.info`,`Logger.warn`,`Logger.error`,`Logger.debug`];function re(){try{let e=Error().stack;if(!e)return;let[,...t]=e.split(`
2
- `),n=t.filter(e=>!ne.some(t=>e.includes(t)));return n.length?`Stack trace:\n${n.slice(0,5).join(`
3
- `)}`:void 0}catch{return}}var ie=class{constructor(e,t=_){this.prefix=e,this.delegate=t??_}setPrefix(e){this.prefix=e}setDelegate(e){this.delegate=e??_}emit(e,t){let n=this.delegate,r=c()?re():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=_[e];if(typeof t==`function`){t.call(_,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 ae(e){return new ie(e)}function oe(e){let t=new ie(e);return Object.defineProperty(t,"__mf_infrastructure_logger__",{value:!0,enumerable:!1,configurable:!1}),t}ae(te),oe(te);async function se(e,t){try{return await e()}catch(e){!t&&f(e);return}}function ce(e,t){let n=/^(https?:)?\/\//i;return e.replace(n,``).replace(/\/$/,``)===t.replace(n,``).replace(/\/$/,``)}function le(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&&ce(o,e.url)){t=i,n=!1;break}}if(!t){let n=e.attrs;t=document.createElement(`script`),t.type=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&&ce(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?.type===`error`){let t=Error(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?.onErrorCallback&&e?.onErrorCallback(t)}else o?e?.onErrorCallback&&e?.onErrorCallback(o):e?.cb&&e?.cb()};if(t&&(t.onerror=null,t.onload=null,se(()=>{let{needDeleteScript:n=!0}=e;n&&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 ue(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&&ce(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?.cb&&e?.cb()}),{link:t,needAttach:n};let o=(n,r)=>{i&&clearTimeout(i);let a=()=>{if(r?.type===`error`){let t=Error(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?.onErrorCallback&&e?.onErrorCallback(t)}else e?.cb&&e?.cb()};if(t&&(t.onerror=null,t.onload=null,se(()=>{let{needDeleteLink:n=!0}=e;n&&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 de(e,t){let{attrs:n={},createScriptHook:r}=t;return new Promise((t,i)=>{let{script:a,needAttach:o}=le({url:e,cb:t,onErrorCallback:i,attrs:{fetchpriority:`high`,...n},createScriptHook:r,needDeleteScript:!0});o&&document.head.appendChild(a)})}var fe=e=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split(`-`)[0].toLowerCase()}#${e.toLowerCase()}`,pe=(e,t,n,r)=>{let i=[`${[t[e]]} #${e}`];return n&&i.push(`args: ${JSON.stringify(n)}`),i.push(fe(e)),r&&i.push(`Original Error Message:\n ${r}`),i.join(`
4
- `)};function me(e,t,n,r,i,a){return r(pe(e,t,n,i))}var v=`[ Federation Runtime ]`,he=ae(v);function y(e,t,n,r,i){e||(n===void 0?b(t):b(t,n,r,void 0,i))}function b(e,t,n,r,i){if(t!==void 0)return me(e,t,n??{},e=>{throw Error(`${v}: ${e}`)},r,i);let a=e;throw a instanceof Error?(a.message.startsWith(v)||(a.message=`${v}: ${a.message}`),a):Error(`${v}: ${a}`)}function x(e){e instanceof Error&&(e.message.startsWith(v)||(e.message=`${v}: ${e.message}`)),he.warn(e)}function ge(e,t){return e.findIndex(e=>e===t)===-1&&e.push(t),e}function S(e){return`version`in e&&e.version?`${e.name}:${e.version}`:`entry`in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function _e(e){return e.entry!==void 0}function ve(e){return!e.entry.includes(`.json`)}function ye(e){return e&&typeof e==`object`}var be=Object.prototype.toString;function xe(e){return be.call(e)===`[object Object]`}function Se(e){return Array.isArray(e)?e:[e]}function Ce(e){return`remoteEntry`in e?{url:e.remoteEntry,type:e.remoteEntryType,globalName:e.globalName}:{url:``,type:`global`,globalName:``}}var we=(e,t)=>{let n;return n=e.endsWith(`/`)?e.slice(0,-1):e,t.startsWith(`.`)&&(t=t.slice(1)),n+=t,n},Te=2e3,C=typeof globalThis==`object`?globalThis:window,w=(()=>{try{return document.defaultView}catch{return C}})(),T=w;function E(e,t,n){Object.defineProperty(e,t,{value:n,configurable:!1,writable:!0})}function D(e,t){return Object.hasOwnProperty.call(e,t)}D(C,`__GLOBAL_LOADING_REMOTE_ENTRY__`)||E(C,`__GLOBAL_LOADING_REMOTE_ENTRY__`,{});var O=C.__GLOBAL_LOADING_REMOTE_ENTRY__;function Ee(e){D(e,`__VMOK__`)&&!D(e,`__FEDERATION__`)&&E(e,`__FEDERATION__`,e.__VMOK__),D(e,`__FEDERATION__`)||(E(e,`__FEDERATION__`,{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map,__PRELOADED_ASSETS__:new Set}),E(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,e.__FEDERATION__.__PRELOADED_ASSETS__??=new Set}Ee(C),Ee(w);function De(e){C.__FEDERATION__.__INSTANCES__.push(e)}function Oe(){return C.__FEDERATION__.__DEBUG_CONSTRUCTOR__}function ke(e,t=c()){t&&(C.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,C.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__=`2.9.2`)}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}}}b(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`)}var Ae=()=>w.__FEDERATION__.moduleInfo,je=(e,t)=>{let n=k(t,S(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=S(n),i=k(w.__FEDERATION__.moduleInfo,r).value;if(i?.version===t)return i}},A=e=>je(e,w.__FEDERATION__.moduleInfo),Me=(e,t)=>{let n=S(e);return w.__FEDERATION__.moduleInfo[n]=t,w.__FEDERATION__.moduleInfo},Ne=e=>(w.__FEDERATION__.moduleInfo={...w.__FEDERATION__.moduleInfo,...e},()=>{let t=Object.keys(e);for(let e of t)delete w.__FEDERATION__.moduleInfo[e]}),Pe=(e,t)=>{let n=t||`__FEDERATION_${e}:custom__`;return{remoteEntryKey:n,entryExports:C[n]}},Fe=()=>w.__FEDERATION__.__GLOBAL_PLUGIN__,Ie=e=>C.__FEDERATION__.__PRELOADED_MAP__.get(e),Le=e=>C.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),Re=e=>C.__FEDERATION__.__PRELOADED_ASSETS__.has(e),ze=e=>{let t=C.__FEDERATION__.__PRELOADED_ASSETS__;if(t.add(e),t.size>Te){let e=t.values().next().value;e!==void 0&&t.delete(e)}},Be=`[0-9A-Za-z-]+`,Ve=`(?:\\+(${Be}(?:\\.${Be})*))`,j=`0|[1-9]\\d*`,M=`[0-9]+`,He=`\\d*[a-zA-Z-][a-zA-Z0-9-]*`,Ue=`(?:${M}|${He})`,We=`(?:-?(${Ue}(?:\\.${Ue})*))`,Ge=`(?:${j}|${He})`,Ke=`(?:-(${Ge}(?:\\.${Ge})*))`,qe=`${j}|x|X|\\*`,N=`[v=\\s]*(${qe})(?:\\.(${qe})(?:\\.(${qe})(?:${Ke})?${Ve}?)?)?`,Je=`^\\s*(${N})\\s+-\\s+(${N})\\s*$`,Ye=`[v=\\s]*${`(${M})\\.(${M})\\.(${M})`}${We}?${Ve}?`,Xe=`((?:<|>)?=?)`,Ze=`(\\s*)${Xe}\\s*(${Ye}|${N})`,Qe=`(?:~>?)`,$e=`(\\s*)${Qe}\\s+`,et=`(?:\\^)`,tt=`(\\s*)${et}\\s+`,nt=`(<|>)?=?\\s*\\*`,rt=`^${et}${N}$`,it=`v?${`(${j})\\.(${j})\\.(${j})`}${Ke}?${Ve}?`,at=`^${Qe}${N}$`,ot=`^${Xe}\\s*${N}$`,st=`^${Xe}\\s*(${it})$|^$`,ct=`^\\s*>=\\s*0.0.0\\s*$`;function P(e){return new RegExp(e)}function F(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(P(st))}function dt(e,t,n,r){let i=`${e}.${t}.${n}`;return r?`${i}-${r}`:i}function ft(e){return e.replace(P(Je),(e,t,n,r,i,a,o,s,c,l,u,d)=>(t=F(n)?``:F(r)?`>=${n}.0.0`:F(i)?`>=${n}.${r}.0`:`>=${t}`,s=F(c)?``:F(l)?`<${Number(c)+1}.0.0-0`:F(u)?`<${c}.${Number(l)+1}.0-0`:d?`<=${c}.${l}.${u}-${d}`:`<=${s}`,`${t} ${s}`.trim()))}function pt(e){return e.replace(P(Ze),`$1$2$3`)}function mt(e){return e.replace(P($e),`$1~`)}function ht(e){return e.replace(P(tt),`$1^`)}function gt(e){return e.trim().split(/\s+/).map(e=>e.replace(P(rt),(e,t,n,r,i)=>F(t)?``:F(n)?`>=${t}.0.0 <${Number(t)+1}.0.0-0`:F(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(P(at),(e,t,n,r,i)=>F(t)?``:F(n)?`>=${t}.0.0 <${Number(t)+1}.0.0-0`:F(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(P(ot),(e,t,n,r,i,a)=>{let o=F(n),s=o||F(r),c=s||F(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(P(nt),``)}function bt(e){return e.trim().replace(P(ct),``)}function I(e,t){return e=Number(e)||e,t=Number(t)||t,e>t?1:e===t?0:-1}function xt(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?I(t,i):-1:1}return 0}function St(e,t){return I(e.major,t.major)||I(e.minor,t.minor)||I(e.patch,t.patch)||xt(e,t)}function Ct(e,t){return e.version===t.version}function wt(e,t){switch(e.operator){case``:case`=`:return Ct(e,t);case`>`:return St(e,t)<0;case`>=`:return Ct(e,t)||St(e,t)<0;case`<`:return St(e,t)>0;case`<=`:return Ct(e,t)||St(e,t)>0;case void 0:return!0;default:return!1}}function Tt(e){return lt(gt,_t,vt,yt)(e)}function Et(e){return lt(ft,pt,mt,ht)(e.trim()).split(/\s+/).join(` `)}function L(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?.split(`.`)},l=t.split(`||`);for(let e of l){let t=e.trim();if(!t||t===`*`||t===`x`)return!0;try{let e=Et(t);if(!e.trim())return!0;let n=e.split(` `).map(e=>Tt(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(!wt({operator:n,version:dt(r,a,o,s),major:r,minor:a,patch:o,preRelease: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 Dt=`default`,Ot=`global`;function kt(e,t,n,r){let a;return a=`get`in e?e.get:`lib`in e?()=>Promise.resolve(e.lib):()=>Promise.resolve(()=>{b(`Cannot get shared "${n}" from "${t}": neither "get" nor "lib" is provided in the share config.`)}),e.shareConfig?.eager&&e.treeShaking?.mode&&b(`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:a,loaded: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 At(e,t){let n=t.shared||{},r=t.name,i=Object.keys(n).reduce((e,i)=>{let a=Se(n[i]);return e[i]=e[i]||[],a.forEach(n=>{e[i].push(kt(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 R(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 z(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!!L(n(e),`<=${n(t)}`)}var B=(e,t)=>{let n=t||function(e,t){return z(e,t)};return Object.keys(e).reduce((e,t)=>!e||n(e,t)||e===`0`?t:e,0)},jt=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=R(r),s=function(e,t){return o?i[e].treeShaking?i[t].treeShaking?!jt(i[e].treeShaking)&&z(e,t):!1:!0:!jt(i[e])&&z(e,t)};if(o){if(a=B(e[t][n],s),a)return{version:a,useTreesShaking:o};o=!1}return{version:B(e[t][n],s),useTreesShaking:o}}var V=e=>jt(e)||Mt(e);function Ft(e,t,n,r){let i=e[t][n],a=``,o=R(r),s=function(e,t){if(o){if(!i[e].treeShaking)return!0;if(!i[t].treeShaking)return!1;if(V(i[t].treeShaking))return!V(i[e].treeShaking)||!!z(e,t);if(V(i[e].treeShaking))return!1}return V(i[t])?!V(i[e])||!!z(e,t):!V(i[e])&&z(e,t)};if(o){if(a=B(e[t][n],s),a)return{version:a,useTreesShaking:o};o=!1}return{version:B(e[t][n],s),useTreesShaking:o}}function It(e){return e===`loaded-first`?Ft:Pt}function H(e,t,n,r,i){if(!e)return;let{shareConfig:a,scope:o=Dt,strategy:s,treeShaking:c}=n,l=Array.isArray(o)?o:[o];for(let o of l)if(a&&e[o]&&e[o][t]){let{requiredVersion:l}=a,{version:u,useTreesShaking:d}=It(s)(e,o,t,c),f={shareScopeMap:e,scope:o,pkgName:t,version:u,GlobalFederation:T.__FEDERATION__,shareInfo:n,resolver:()=>{let r=e[o][t][u];if(a.singleton){if(typeof l==`string`&&!L(u,l)){let e=`Version ${u} from ${u&&r.from} of shared singleton module ${t} does not satisfy the requirement of ${n.from} which needs ${l})`;a.strictVersion?b(e):x(e)}return{shared:r,useTreesShaking:d}}{if(l===!1||l===`*`||L(u,l))return{shared:r,useTreesShaking:d};let n=R(c);if(n){for(let[r,i]of Object.entries(e[o][t]))if(R(i.treeShaking,c?.usedExports)&&L(r,l))return{shared:i,useTreesShaking:n}}for(let[n,r]of Object.entries(e[o][t]))if(L(n,l))return{shared:r,useTreesShaking:!1}}},loadContext:i};return(r.emit(f)||f).resolver()}}function Lt(){return T.__FEDERATION__.__SHARE__}function Rt(e){let{pkgName:t,extraOptions:n,shareInfos:r}=e,i=n?.resolver??(e=>{if(!e)return;let t={};return e.forEach(e=>{t[e.version]=e}),t[B(t,function(e,n){return!jt(t[e])&&z(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?.customShareInfo)}var U=(e,t)=>{e.useIn||=[],ge(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`,W={[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.`};({...W,...cn,...ln});var un=`.then(callbacks[0]).catch(callbacks[1])`,dn=new WeakMap,fn=[`Failed to fetch dynamically imported module`,`Importing a module script failed`,`error loading dynamically imported module`];function pn(e){return e instanceof TypeError&&fn.some(t=>e.message.includes(t))}function mn(e){return e===`esm`||e===`module`}async function hn({entry:t,remoteEntryExports:n,name:r,getEntryUrl:i}){return new Promise((a,o)=>{let s=e=>{if(pn(e)){let t=e instanceof Error?e.message:String(e);try{b(Xt,W,{remoteName:r,resourceUrl:c},t)}catch(e){o(e);return}}o(e)},c=i?i(t):t;try{n?a(n):typeof FEDERATION_ALLOW_NEW_FUNCTION<`u`?Function(`callbacks`,`import("${c}")${un}`)([a,s]):e(()=>import(c).then(a),[]).catch(s)}catch(e){b(`Failed to load ESM entry from "${c}". ${e instanceof Error?e.message:String(e)}`)}})}async function gn({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){b(`Failed to load SystemJS entry from "${e}". ${t instanceof Error?t.message:String(t)}`)}})}function _n(e,t,n){let{remoteEntryKey:r,entryExports:i}=Pe(e,t);return i||b(Ut,W,{remoteName:e,remoteEntryUrl:n,remoteEntryKey:r}),i}async function vn({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 de(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(()=>_n(e,t,n),t=>{let n=t instanceof Error?t.message:String(t);b(Xt,W,{remoteName:e,resourceUrl:c},n)})}async function yn({remoteInfo:e,remoteEntryExports:t,loaderHook:n,getEntryUrl:r,resourceContext:i}){let{entry:a,entryGlobalName:o,name:s,type:c}=e;return mn(c)?hn({entry:a,remoteEntryExports:t,name:s,getEntryUrl:r}):c===`system`?gn({entry:a,remoteEntryExports:t}):vn({entry:a,globalName:o,name:s,remoteInfo:e,loaderHook:n,getEntryUrl:r,resourceContext:i})}function bn(e){let{entry:t,name:n}=e;return u(n,t)}async function xn(e){let{origin:t,remoteEntryExports:n,remoteInfo:r,getEntryUrl:i,resourceContext:a,_inErrorHandling:o=!1}=e,s=bn(r);if(n)return await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,remoteEntryExports:n,resourceContext:a,cached:!0}),n;if(!O[s]){let e=t.remoteHandler.hooks.lifecycle.loadEntry,c=t.loaderHook,l=e.emit({origin:t,loaderHook:c,remoteInfo:r,remoteEntryExports:n,resourceContext:a}).then(e=>e||yn({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,resourceContext:a}),e)).catch(async e=>{let i=e instanceof Error&&e.message.includes(`ScriptExecutionError`);if(e instanceof Error&&e.message.includes(`RUNTIME-008`)&&!i&&!o){let i=await t.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:e=>xn({...e,_inErrorHandling:!0}),origin:t,remoteInfo:r,remoteEntryExports:n,globalLoading:O,uniqueKey:s});if(i)return await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,remoteEntryExports:i,resourceContext:a,error:e,recovered:!0}),i}throw await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,resourceContext:a,error:e}),e});O[s]=l,l.then(void 0,()=>{O[s]===l&&delete O[s]}),dn.set(l,t)}let c=O[s];if(dn.get(c)!==t)try{let e=await c;return await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,remoteEntryExports:e,resourceContext:a}),e}catch(e){throw await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,resourceContext:a,error:e}),e}return c}function G(e){return{...e,entry:`entry`in e?e.entry:``,type:e.type||`global`,entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||`default`}}function Sn(){return typeof FEDERATION_BUILD_IDENTIFIER<`u`?FEDERATION_BUILD_IDENTIFIER:``}function Cn(e){let t=new Map;return[...e||[],...Fe()].forEach(e=>{e&&(y(xe(e),`Plugin configuration is invalid.`),y(e.name,`A name must be provided by the plugin.`),t.has(e.name)||t.set(e.name,e))}),Array.from(t.values())}function wn(e,t){return t===void 0?e:{...t,name:e.name,version:e.version}}function Tn(e,t){let n=new Map;t.options.plugins.forEach(e=>{e&&n.set(e.name,e)});let r=[t.hooks,t.remoteHandler.hooks,t.sharedHandler.hooks,t.snapshotHandler.hooks,t.loaderHook,t.bridgeHook];return Cn(e).forEach(e=>{if(n.set(e.name,e),t.hooks.registerPlugins[e.name])return;let i=wn(e,e.apply?.(t));r.forEach(e=>{e.applyPlugin(i)})}),Array.from(n.values())}function En(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 K(e){let t={};for(let[n,r]of Object.entries(e.shared)){let e=r[0];e&&(t[n]={version:e.version,singleton:e.shareConfig?.singleton,requiredVersion:e.shareConfig?.requiredVersion!==!1&&e.shareConfig?.requiredVersion,eager:e.eager,strictVersion:e.shareConfig?.strictVersion})}return{project:{name:e.name,mfRole:e.remotes?.length>0?`host`:`unknown`},mfConfig:{name:e.name,remotes:e.remotes?.map(En)??[],shared:t}}}function Dn(e){return{resourceCategory:`sync`,share:!0,depsRemote:!0,recordPreloadedAssets:!0,...e}}function On(e,t){return t.map(t=>{let n=Ht(e,t.nameOrAlias);return y(n,`Unable to preload ${t.nameOrAlias} as it is not included in ${!n&&p({remoteInfo:n,remotes:e})}`),{remote:n,preloadConfig:Dn(t)}})}function kn(e){return e?e.map(e=>e===`.`?e:e.startsWith(`./`)?e.replace(`./`,``):e):[]}function An(e){return e instanceof Error?e.message.includes(`timed out`)||e.name.includes(`Timeout`):!1}function q(e,t,n,r){return{url:t,status:n,resourceType:e.resourceType,initiator:e.initiator,id:e.id,error:r}}function jn(e,t,n,r){return n?Re(t)?Promise.resolve(q(e,t,`cached`)):(ze(t),r()):r()}async function Mn(e,t,n,r){let i=e.moduleCache.get(n.name),a=n.entry;if(i?.remoteEntryExports)return q(r,a,`cached`);try{if(!await xn({origin:e,remoteInfo:n,remoteEntryExports:i?.remoteEntryExports,resourceContext:{...r,url:a}}))throw Error(`Failed to load remoteEntry "${a}".`);return q(r,a,`success`)}catch(e){return q(r,a,An(e)?`timeout`:`error`,e)}}function Nn({host:e,remoteInfo:t,url:n,attrs:r,context:i,needDeleteLink:a}){return new Promise(o=>{let{link:s,needAttach:c}=ue({url:n,cb:()=>{o(q(i,n,c?`success`:`cached`))},onErrorCallback:e=>{o(q(i,n,An(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 Pn({host:e,remoteInfo:t,url:n,attrs:r,context:i}){return new Promise(a=>{let{script:o,needAttach:s}=le({url:n,cb:()=>{a(q(i,n,s?`success`:`cached`))},onErrorCallback:e=>{a(q(i,n,An(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 Fn(e,t){return{...e,resourceType:t}}function In(e,t,n,r=!0,i={initiator:`preloadRemote`,id:e.name},a=!0){let{cssAssets:o,jsAssetsWithoutEntry:s,entryAssets:c}=n,l=[];if(t.options.inBrowser){if(c.forEach(n=>{let{moduleInfo:r}=n;l.push(Mn(t,e,r,Fn(i,`remoteEntry`)))}),r){let n={rel:`preload`,as:`style`};o.forEach(r=>{let o=Fn(i,`css`);l.push(jn(o,r,a,()=>Nn({host:t,remoteInfo:e,url:r,attrs:n,context:o})))})}else{let n={rel:`stylesheet`,type:`text/css`};o.forEach(r=>{let o=Fn(i,`css`);l.push(jn(o,r,a,()=>Nn({host:t,remoteInfo:e,url:r,attrs:n,needDeleteLink:!1,context:o})))})}let n=Pn,u={fetchpriority:`high`,type:`text/javascript`};r?(n=Nn,u={rel:`preload`,as:`script`}):mn(e.type)&&(n=Nn,u={rel:`modulepreload`,fetchpriority:`high`}),s.forEach(r=>{let o=Fn(i,`js`);l.push(jn(o,r,a,()=>n({host:t,remoteInfo:e,url:r,attrs:u,context:o})))})}return Promise.all(l)}function Ln(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 Rn(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 zn=class{constructor({remoteInfo:e,host:t}){this.inited=!1,this.initing=!1,this.lib=void 0,this.remoteInfo=e,this.host=t}async getEntry(e,t){let n=t||{initiator:`loadRemote`,id:Bt(this.remoteInfo.name,e),resourceType:`remoteEntry`,url:this.remoteInfo.entry,expose:e},r=await xn({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,resourceContext:n});return y(r,`remoteEntryExports is undefined \n ${p(this.remoteInfo)}`),this.remoteEntryExports=r,this.remoteEntryExports}async init(e,t,n,r,i){let a=await this.getEntry(r,i);if(this.inited)return await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:a,cached:!0,origin:this.host}),a;if(this.initPromise){try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:a,cached:!0,origin:this.host})}catch(n){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:a,error:n,cached:!0,origin:this.host}),n}return a}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:i,initScope:o}=Rn(this.remoteInfo,this.host.shareScopeMap,n),s=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:i,remoteEntryInitOptions:r,initScope:o,remoteInfo:this.remoteInfo,origin:this.host});a?.init===void 0&&b(Wt,W,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName},void 0,K(this.host.options));try{await a.init(s.shareScope,s.initScope,s.remoteEntryInitOptions)}catch(e){b(rn,W,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName,shareScope:this.remoteInfo.shareScope},`${e}`,K(this.host.options))}await this.host.hooks.lifecycle.initContainer.emit({...s,id:e,remoteSnapshot:t,remoteEntryExports:a}),this.inited=!0})();try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:a,origin:this.host})}catch(n){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:a,error:n,origin:this.host}),n}finally{this.initing=!1,this.initPromise=void 0}return a}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||b(nn,W,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,expose:t,requestId:e,availableExposes:Ln(r)},void 0,K(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=we(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)}}},J=class{constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}applyPlugin(e){y(xe(e),`Plugin configuration is invalid.`);let t=e.name;y(t,`A name must be provided by the plugin.`),this.registerPlugins[t]||(this.registerPlugins[t]=e,this.lifecycleKeys.forEach(t=>{let n=e[t];n&&this.lifecycle[t].on(n)}))}removePlugin(e){y(e,`A name is required.`);let t=this.registerPlugins[e];y(t,`The plugin "${e}" is not registered.`),this.lifecycleKeys.forEach(e=>{let n=t[e];n&&this.lifecycle[e].remove(n)}),delete this.registerPlugins[e]}},Y=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()}},X=class extends Y{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 Bn(e,t){if(!ye(t))return!1;if(e!==t){for(let n in e)if(!(n in t))return!1}return!0}var Z=class extends Y{constructor(e){super(),this.onerror=b,this.type=e}emit(e){ye(e)||b(`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(Bn(e,n))e=n;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(e){x(e),this.onerror(e)}return e}},Q=class extends Y{constructor(e){super(),this.onerror=b,this.type=e}emit(e){ye(e)||b(`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=>(x(t),this.onerror(t),e),i=a=>{if(a!==void 0&&Bn(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)}},$=`Remote loading is disabled by experiments.optimization.disableRemote.`,Vn=class{constructor(){this.hooks=new J({})}formatAndRegisterRemote(){return[]}loadRemote(){throw Error($)}preloadRemote(){throw Error($)}registerRemotes(){throw Error($)}getRemoteModuleAndOptions(){throw Error($)}initRawContainer(){throw Error($)}};function Hn(e,t){let n=Ce(t);n.url||b($t,W,{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 Un(){return{name:`snapshot-plugin`,async afterResolve(e){let{remote:t,pkgNameOrAlias:n,expose:r,origin:i,remoteInfo:a,id:o}=e;if(!_e(t)||!ve(t)){let{remoteSnapshot:s,globalSnapshot:c}=await i.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:t,id:Bt(t.name,r)});Hn(a,s);let l=[{nameOrAlias:n,exposes:[r],resourceCategory:`sync`,share:!1,depsRemote:!1,recordPreloadedAssets:!0}];await i.remoteHandler.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:l,options:i.options,origin:i});let[u]=l;if(u){let e={remote:t,preloadConfig:u},n=await i.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:i,preloadOptions:e,remoteInfo:a,remote:t,remoteSnapshot:s,globalSnapshot:c});n&&In(a,i,n,!1,{initiator:`loadRemote`,id:o},u.recordPreloadedAssets).catch(()=>void 0)}return{...e,remoteSnapshot:s}}return e}}}function Wn(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 Gn(e,t,n,r,i={},a){let{value:o}=k(e,S(t)),s=a||o;if(s&&!g(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=Wn(r),a=s.remotesInfo[r];Gn(e,{name:t.name,version:a.matchedVersion},n,!1,i,void 0)}}}var Kn=(e,t)=>document.querySelector(`${e}[${e===`link`?`href`:`src`}="${t}"]`);function qn(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(Gn(r,n,(t,n,r)=>{let i;if(r)i=f;else if(Array.isArray(p)){let e=p.find(e=>e.nameOrAlias===n.name||e.nameOrAlias===n.alias);if(!e)return;i=Dn(e)}else if(p===!0)i=f;else return;let c=d(t,Ce(t).url);c&&s.push({name:n.name,moduleInfo:{name:n.name,entry:c,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:c});let l=`modules`in t?t.modules:[],u=kn(i.exposes);u.length&&`modules`in t&&(l=t?.modules?.reduce((e,t)=>(u?.indexOf(t.moduleName)!==-1&&e.push(t),e),[]));function m(e){let n=e.map(e=>d(t,e));return i.filter?n.filter(i.filter):n}if(l){let r=l.length;for(let s=0;s<r;s++){let r=l[s],c=`${n.name}/${r.moduleName}`;e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:r.moduleName===`.`?n.name:c,name:n.name,remoteSnapshot:t,preloadConfig:i,remote:n,origin:e}),!Ie(c)&&(i.resourceCategory===`all`?(a.push(...m(r.assets.css.async)),a.push(...m(r.assets.css.sync)),o.push(...m(r.assets.js.async)),o.push(...m(r.assets.js.sync))):i.resourceCategory===`sync`&&(a.push(...m(r.assets.css.sync)),o.push(...m(r.assets.js.sync))),Le(c))}}},!0,{},i),i.shared&&i.shared.length>0){let t=(t,n)=>{let{shared:r}=H(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=>{let n=u.shared?.[e.sharedName];if(!n)return;let r=e.version?n.find(t=>t.version===e.version):n;r&&Se(r).forEach(n=>{t(n,e)})})}let m=o.filter(e=>!c.has(e)&&!Kn(`script`,e));return{cssAssets:a.filter(e=>!l.has(e)&&!Kn(`link`,e)),jsAssetsWithoutEntry:m,entryAssets:s.filter(e=>!Kn(`script`,e.url))}}var Jn=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 _e(i)&&ve(i)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:i.name,url:i.entry,moduleInfo:{name:r.name,entry:i.entry,type:r.type||`global`,entryGlobalName:``,shareScope:``}}]}:(Hn(r,o),qn(t,n,r,a,o))}}};function Yn(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 Xn=class{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new J({beforeLoadRemoteSnapshot:new X(`beforeLoadRemoteSnapshot`),loadSnapshot:new Q(`loadGlobalSnapshot`),loadRemoteSnapshot:new Q(`loadRemoteSnapshot`),afterLoadSnapshot:new Q(`afterLoadSnapshot`),beforeLoadManifest:new X(`beforeLoadManifest`),afterLoadManifest:new X(`afterLoadManifest`)}),this.manifestLoading=T.__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?.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(g(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(_e(e)){let r=await this.loadManifestSnapshot(e.entry,e,{},{initiator:n,id:t||e.name}),i=Me(e,r);u=r,d=i}else b(Yt,W,{remoteName:e.name,remoteVersion:e.version,hostName:this.HostInstance.options.name,globalSnapshot:JSON.stringify(l)},void 0,K(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 Yn(e,this.HostInstance)}async getManifestJson(e,t,n,r){return(async()=>{let n=G(t),i=this.manifestCache.get(e);if(i)return await this.hooks.lifecycle.afterLoadManifest.emit({manifestUrl:e,moduleInfo:t,resourceOptions:r,manifestJson:i,cached:!0,origin:this.HostInstance}),i;await this.hooks.lifecycle.beforeLoadManifest.emit({manifestUrl:e,moduleInfo:t,resourceOptions:r,origin:this.HostInstance});let a,o,s=!1;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,{})),a=t,i=await t.json()}catch(c){o=c,i=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:c,from:`runtime`,lifecycle:`afterResolve`,remote:n,origin:this.HostInstance}),i||(delete this.manifestLoading[e],await this.hooks.lifecycle.afterLoadManifest.emit({manifestUrl:e,moduleInfo:t,resourceOptions:r,response:a,error:c,origin:this.HostInstance}),b(Gt,W,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name},`${c}`,K(this.HostInstance.options))),s=!0}let c=[!i.metaData&&`metaData`,!i.exposes&&`exposes`,!i.shared&&`shared`].filter(Boolean),l=c.length>0?Error(`"${e}" is not a valid federation manifest for remote "${t.name}". Missing required fields: ${c.join(`, `)}.`):void 0;return l&&await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:l,from:`runtime`,lifecycle:`afterResolve`,remote:n,origin:this.HostInstance}),await this.hooks.lifecycle.afterLoadManifest.emit({manifestUrl:e,moduleInfo:t,resourceOptions:r,manifestJson:i,response:a,error:l||o,recovered:l?void 0:s||void 0,origin:this.HostInstance}),l&&b(tn,W,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name,missingFields:c.join(`,`)},void 0,K(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=h(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]}},Zn=class{constructor(){this.hooks=new J({})}},Qn=class{constructor(e){this.hooks=new J({beforeRegisterShare:new Z(`beforeRegisterShare`),afterRegisterShare:new Y(`afterRegisterShare`),afterResolve:new Q(`afterResolve`),beforeLoadShare:new Q(`beforeLoadShare`),loadShare:new X,afterLoadShare:new Y(`afterLoadShare`),errorLoadShare:new Y(`errorLoadShare`),resolveShare:new Z(`resolveShare`),initContainerShareScopeMap:new Z(`initContainerShareScopeMap`)}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}emitAfterRegisterShare(e,t){this.hooks.lifecycle.afterRegisterShare.emit({pkgName:e,...t,shareScopeMap:this.shareScopeMap,origin:this.host})}emitAfterLoadShare({lifecycle:e,pkgName:t,shareInfo:n,selectedShared:r,loadContext:i}){try{this.hooks.lifecycle.afterLoadShare.emit({pkgName:t,shareInfo:n,selectedShared:r,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,loadContext:i,origin:this.host})}catch(e){x(e)}}emitErrorLoadShare({lifecycle:e,pkgName:t,shareInfo:n,error:r,recovered:i,loadContext:a}){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,loadContext:a})}catch(e){x(e)}}registerShared(e,t){let{newShareInfos:n,allShareInfos:r}=At(e,t);return Object.keys(n).forEach(e=>{n[e].forEach(n=>{n.scope.forEach(r=>{this.hooks.lifecycle.beforeRegisterShare.emit({origin:this.host,pkgName:e,shared:n});let i=this.shareScopeMap[r]?.[e],a=i?.[n.version];i||this.setShared({pkgName:e,lib:n.lib,get:n.get,loaded:n.loaded||!!n.lib,shared:n,from:t.name}),this.emitAfterRegisterShare(e,{scope:r,shared:n,previousShared:a,registeredShared:this.shareScopeMap[r]?.[e]?.[n.version],trigger:`runtime`})})})}),{newShareInfos:n,allShareInfos:r}}async loadShare(e,t){let{host:n}=this,r=t?.context,i=Rt({pkgName:e,extraOptions:t,shareInfos:n.options.shared}),a=i;try{i?.scope&&await Promise.all(i.scope.map(async e=>{await Promise.all(this.initializeSharing(e,{strategy:i.strategy,context:r}))}));let o=await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:i,shared:n.options.shared,origin:n,loadContext:r});a=o.shareInfo,r=o.loadContext||r,y(a,`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 s=a,{shared:c,useTreesShaking:l}=H(this.shareScopeMap,e,a,this.hooks.lifecycle.resolveShare,r)||{};if(c){let t=zt(c,l);if(t.lib)return U(t,n.options.name),this.emitAfterLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:s,selectedShared:c,loadContext:r}),t.lib;if(t.loading&&!t.loaded){let i=await t.loading;return t.loaded=!0,t.lib||=i,U(t,n.options.name),this.emitAfterLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:s,selectedShared:c,loadContext:r}),i}{let i=(async()=>{let e=await t.get();return U(t,n.options.name),t.loaded=!0,t.lib=e,e})();this.setShared({pkgName:e,loaded:!1,shared:c,from:n.options.name,lib:null,loading:i,treeShaking:l?t:void 0});let a=await i;return this.emitAfterLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:s,selectedShared:c,loadContext:r}),a}}{if(t?.customShareInfo)return this.emitErrorLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:s,recovered:!0,loadContext:r}),!1;let i=R(s.treeShaking),a=zt(s,i),o=(async()=>{let t=await a.get();a.lib=t,a.loaded=!0,U(a,n.options.name);let{shared:i,useTreesShaking:o}=H(this.shareScopeMap,e,s,this.hooks.lifecycle.resolveShare,r)||{};if(i){let e=zt(i,o);e.lib=t,e.loaded=!0,i.from=s.from}return t})();this.setShared({pkgName:e,loaded:!1,shared:s,from:n.options.name,lib:null,loading:o,treeShaking:i?a:void 0});let c=await o;return this.emitAfterLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:s,selectedShared:s,loadContext:r}),c}}catch(t){throw this.emitErrorLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:a,error:t,loadContext:r}),t}}initializeSharing(e=Dt,t){let{host:n}=this,r=t?.from,i=t?.strategy,a=t?.context?.trigger||r||`runtime`,o=t?.initScope,s=[];if(r!==`build`){let{initTokens:t}=this;o||=[];let n=t[e];if(n||=t[e]={from:this.host.name},o.indexOf(n)>=0)return s;o.push(n)}let c=this.shareScopeMap,l=n.options.name;c[e]||(c[e]={});let u=c[e],d=(t,n)=>{let{version:r,eager:i}=n;u[t]=u[t]||{};let o=u[t],s=o[r],c=s&&zt(s),d=!!(c&&(`eager`in c&&c.eager||`shareConfig`in c&&c.shareConfig?.eager));(!c||c.strategy!==`loaded-first`&&!c.loaded&&(!i==!d?l>o[r].from:i))&&(o[r]=n),this.emitAfterRegisterShare(t,{scope:e,shared:n,previousShared:s,registeredShared:o[r],trigger:a})},f=async e=>{let{module:t}=await n.remoteHandler.getRemoteModuleAndOptions({id:e}),r,i={initiator:`loadShare`,id:e,resourceType:`remoteEntry`,url:t.remoteInfo.entry};try{r=await t.getEntry(void 0,i)}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?.init&&!t.initing&&(t.remoteEntryExports=r,await t.init(void 0,void 0,o,void 0,i))}};return Object.keys(n.options.shared).forEach(t=>{n.options.shared[t].forEach(n=>{n.scope.includes(e)&&d(t,n)})}),(n.options.shareStrategy===`version-first`||i===`version-first`)&&n.options.remotes.forEach(t=>{t.shareScope===e&&s.push(f(t.name))}),s}loadShareSync(e,t){let{host:n}=this,r=t?.context,i=Rt({pkgName:e,extraOptions:t,shareInfos:n.options.shared});try{i?.scope&&i.scope.forEach(e=>{this.initializeSharing(e,{strategy:i.strategy,from:t?.from,context:r})});let{shared:a}=H(this.shareScopeMap,e,i,this.hooks.lifecycle.resolveShare,r)||{};if(a){if(typeof a.lib==`function`)return U(a,n.options.name),a.loaded||(a.loaded=!0,a.from===n.options.name&&(i.loaded=!0)),this.emitAfterLoadShare({lifecycle:`loadShareSync`,pkgName:e,shareInfo:i,selectedShared:a,loadContext:r}),a.lib;if(typeof a.get==`function`){let t=a.get();if(!(t instanceof Promise))return U(a,n.options.name),this.setShared({pkgName:e,loaded:!0,from:n.options.name,lib:t,shared:a}),this.emitAfterLoadShare({lifecycle:`loadShareSync`,pkgName:e,shareInfo:i,selectedShared:a,loadContext:r}),t}}if(i.lib)return i.loaded||=!0,this.emitAfterLoadShare({lifecycle:`loadShareSync`,pkgName:e,shareInfo:i,selectedShared:i,loadContext:r}),i.lib;if(i.get){let a=i.get();return a instanceof Promise&&b(t?.from===`build`?qt:Jt,W,{hostName:n.options.name,sharedPkgName:e},void 0,K(n.options)),i.lib=a,this.setShared({pkgName:e,loaded:!0,from:n.options.name,lib:i.lib,shared:i}),this.emitAfterLoadShare({lifecycle:`loadShareSync`,pkgName:e,shareInfo:i,selectedShared:i,loadContext:r}),i.lib}b(Jt,W,{hostName:n.options.name,sharedPkgName:e},void 0,K(n.options))}catch(t){throw this.emitErrorLoadShare({lifecycle:`loadShareSync`,pkgName:e,shareInfo:i,error:t,loadContext:r}),t}}initShareScopeMap(e,t,n={}){let{host:r}=this;this.shareScopeMap[e]=t,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:t,options:r.options,origin:r,scopeName:e,hostShareScopeMap:n.hostShareScopeMap})}setShared({pkgName:e,shared:t,from:n,lib:r,loading:i,loaded:a,get:o,treeShaking:s}){let{version:c,scope:l=`default`,...u}=t,d=Array.isArray(l)?l:[l],f=e=>{let t=(e,t,n)=>{n&&!e[t]&&(e[t]=n)},n=s?e.treeShaking:e;t(n,`loaded`,a),t(n,`loading`,i),t(n,`get`,o),t(n,`lib`,r)};d.forEach(t=>{this.shareScopeMap[t]||(this.shareScopeMap[t]={}),this.shareScopeMap[t][e]||(this.shareScopeMap[t][e]={}),this.shareScopeMap[t][e][c]||(this.shareScopeMap[t][e][c]={version:c,scope:[t],...u,lib:r});let i=this.shareScopeMap[t][e][c];f(i),n&&i.from!==n&&(i.from=n)})}_setGlobalShareScopeMap(e){let t=Lt(),n=e.id||e.name;n&&!t[n]&&(t[n]=this.shareScopeMap)}},$n=class{constructor(){this.shareScopeMap={},this.hooks=new J({afterResolve:new Q(`afterResolve`)})}registerShared(){return{newShareInfos:{},allShareInfos:{}}}loadShare(){throw Error(`Shared dependency loading is disabled by experiments.optimization.disableShared.`)}loadShareSync(){throw Error(`Shared dependency loading is disabled by experiments.optimization.disableShared.`)}initializeSharing(){return[]}initShareScopeMap(e,t){this.shareScopeMap[e]=t}},er=class{constructor(e){this.hooks=new J({beforeRegisterRemote:new Z(`beforeRegisterRemote`),registerRemote:new Z(`registerRemote`),beforeRequest:new Q(`beforeRequest`),afterMatchRemote:new X(`afterMatchRemote`),onLoad:new X(`onLoad`),afterLoadRemote:new X(`afterLoadRemote`),handlePreloadModule:new Y(`handlePreloadModule`),errorLoadRemote:new X(`errorLoadRemote`),beforePreloadRemote:new X(`beforePreloadRemote`),generatePreloadAssets:new X(`generatePreloadAssets`),afterPreloadRemote:new X(`afterPreloadRemote`),loadEntry:new X}),this.host=e,this.idToRemoteMap={}}formatAndRegisterRemote(e,t){return(t.remotes||[]).reduce((e,t)=>(this.registerRemote(t,e,{force:!1}),e),e.remotes)}setIdToRemoteMap(e,t){let{remote:n,expose:r}=t,{name:i,alias:a}=n;if(this.idToRemoteMap[e]={name:n.name,expose:r},a&&e.startsWith(i)){let t=e.replace(i,a);this.idToRemoteMap[t]={name:n.name,expose:r}}else if(a&&e.startsWith(a)){let t=e.replace(a,i);this.idToRemoteMap[t]={name:n.name,expose:r}}}async loadRemote(e,t){let{host:n}=this,r=Vt(n.options.remotes,e),i=e,a=r?.expose,o=r?G(r.remote):void 0,s;try{let{loadFactory:r=!0}=t||{loadFactory:!0},{module:c,moduleOptions:l,remoteMatchInfo:u}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:d,remote:f,expose:p,id:m,remoteSnapshot:ee}=u;i=m,a=p,o=G(f);let h=await c.get(m,p,t,ee),g=await this.hooks.lifecycle.onLoad.emit({id:m,pkgNameOrAlias:d,expose:p,exposeModule:r?h:void 0,exposeModuleFactory:r?void 0:h,remote:f,options:l,moduleInstance:c,origin:n});return this.setIdToRemoteMap(e,u),s={id:i,expose:a,remote:o,options:t,origin:n},typeof g==`function`?g:h}catch(r){let{from:c=`runtime`}=t||{from:`runtime`},l;try{l=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:r,from:c,lifecycle:`onLoad`,expose:a,remote:o,origin:n})}catch(e){throw s={id:i,expose:a,remote:o,options:t,error:e,origin:n},e}if(!l)throw s={id:i,expose:a,remote:o,options:t,error:r,origin:n},r;return s={id:i,expose:a,remote:o,options:t,error:r,origin:n,recovered:!0},l}finally{s&&await this.hooks.lifecycle.afterLoadRemote.emit(s)}}async preloadRemote(e){let{host:t}=this,n=[];await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:t.options,origin:t});let r=On(t.options.remotes,e),i=e=>{let{preloadConfig:t,remote:n}=e,r=t.exposes||[];return r.length?r.map(r=>({ops:{...e,preloadConfig:{...t,exposes:[r]}},id:Bt(n.name,r)})):[{ops:e,id:`${n.name}/*`}]},a;await Promise.all(r.flatMap(i).map(async e=>{let{ops:r,id:i}=e,{remote:a,preloadConfig:o}=r,s=G(a);try{let{globalSnapshot:e,remoteSnapshot:c}=await t.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:a,id:i,initiator:`preloadRemote`}),l=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:t,preloadOptions:r,remote:a,remoteInfo:s,globalSnapshot:e,remoteSnapshot:c});if(!l)return;let u=await In(s,t,l,!0,{initiator:`preloadRemote`,id:i},o.recordPreloadedAssets);n.push({remote:a,remoteInfo:s,preloadConfig:o,id:i,results:u})}catch(e){n.push({remote:a,remoteInfo:s,preloadConfig:o,id:i,results:[{url:s.entry,status:`error`,resourceType:/\.json(?:$|[?#])/i.test(s.entry)?`manifest`:`remoteEntry`,initiator:`preloadRemote`,id:i,error:e}]})}}));let o=n.flatMap(e=>e.results.filter(e=>e.status===`error`||e.status===`timeout`));if(o.length>0&&(a=Error(`preloadRemote failed to load ${o.length} resource(s).`),Object.assign(a,{results:n,failedResults:o})),await this.hooks.lifecycle.afterPreloadRemote.emit({preloadOps:e,options:t.options,origin:t,results:n,error:a}),a)throw a}registerRemotes(e,t){let{host:n}=this;e.forEach(e=>{this.registerRemote(e,n.options.remotes,{force:t?.force})})}initRawContainer(e,t,n){let{host:r}=this,i=new zn({host:r,remoteInfo:G({name:e,entry:t})});return i.remoteEntryExports=n,r.moduleCache.set(e,i),i}async getRemoteModuleAndOptions(e){let{host:t}=this,{id:n}=e,r;try{r=await this.hooks.lifecycle.beforeRequest.emit({id:n,options:t.options,origin:t})}catch(e){if(r=await this.hooks.lifecycle.errorLoadRemote.emit({id:n,options:t.options,origin:t,from:`runtime`,error:e,lifecycle:`beforeRequest`}),!r)throw e}let{id:i}=r,a=Vt(t.options.remotes,i);if(!a)try{b(Kt,W,{hostName:t.options.name,requestId:i},void 0,K(t.options))}catch(e){throw await this.hooks.lifecycle.afterMatchRemote.emit({id:i,options:t.options,error:e,origin:t}),e}let{remote:o}=a,s=G(o);await this.hooks.lifecycle.afterMatchRemote.emit({id:i,...a,options:t.options,remoteInfo:s,origin:t});let c=await t.sharedHandler.hooks.lifecycle.afterResolve.emit({id:i,...a,options:t.options,origin:t,remoteInfo:s}),{remote:l,expose:u}=c;y(l&&u,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${i}.`);let d=t.moduleCache.get(l.name),f={host:t,remoteInfo:s};return d||(d=new zn(f),t.moduleCache.set(l.name,d)),{module:d,moduleOptions:f,remoteMatchInfo:c}}registerRemote(e,t,n){let{host:r}=this,i=()=>{if(e.alias){let n=t.find(t=>e.alias&&(t.name.startsWith(e.alias)||t.alias?.startsWith(e.alias)));y(!n,`The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${n&&n.name} name or alias`)}`entry`in e&&typeof window<`u`&&!e.entry.startsWith(`http`)&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||=Dt,e.type||=Ot};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:r});let a=t.find(t=>t.name===e.name);if(!a)i(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:r});else{let o=[`The remote "${e.name}" is already registered.`,`Please note that overriding it may cause unexpected errors.`];n?.force&&(this.removeRemote(a),i(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:r}),f(o.join(` `)))}}removeRemote(e){try{let{host:t}=this,{name:n}=e,r=t.options.remotes.findIndex(e=>e.name===n);r!==-1&&t.options.remotes.splice(r,1);let i=k(C.__FEDERATION__.moduleInfo,S(e)).key;delete C.__FEDERATION__.moduleInfo[i],`entry`in e&&(t.snapshotHandler.manifestCache.delete(e.entry),delete T.__FEDERATION__.__MANIFEST_LOADING__[e.entry]);let{hostGlobalSnapshot:a}=Yn(e,t);if(a){let t=a&&`remotesInfo`in a&&a.remotesInfo&&k(a.remotesInfo,e.name).key;t&&delete a.remotesInfo[t]}let o=t.moduleCache.get(e.name);if(o){let n=o.remoteInfo,r=n.entryGlobalName;C[r]&&(Object.getOwnPropertyDescriptor(C,r)?.configurable?delete C[r]:C[r]=void 0);let i=bn(o.remoteInfo);O[i]&&delete O[i];let a=n.buildVersion?u(n.name,n.buildVersion):n.name,s=C.__FEDERATION__.__INSTANCES__.findIndex(e=>n.buildVersion?e.options.id===a:e.name===a);if(s!==-1){let e=C.__FEDERATION__.__INSTANCES__[s];a=e.options.id||a;let t=Lt(),r=!0,i=[];Object.keys(t).forEach(e=>{let a=t[e];a&&Object.keys(a).forEach(t=>{let o=a[t];o&&Object.keys(o).forEach(a=>{let s=o[a];s&&Object.keys(s).forEach(o=>{let c=s[o];c&&typeof c==`object`&&c.from===n.name&&(c.loaded||c.loading?(c.useIn=c.useIn.filter(e=>e!==n.name),c.useIn.length?r=!1:i.push([e,t,a,o])):i.push([e,t,a,o]))})})})}),r&&(e.shareScopeMap={},delete t[a]),i.forEach(([e,n,r,i])=>{delete t[e]?.[n]?.[r]?.[i]}),C.__FEDERATION__.__INSTANCES__.splice(s,1)}t.moduleCache.delete(e.name)}}catch(e){he.error(`removeRemote failed: ${e instanceof Error?e.message:String(e)}`)}}},tr=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN!=`boolean`||!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN,nr=typeof FEDERATION_OPTIMIZE_NO_REMOTE!=`boolean`||!FEDERATION_OPTIMIZE_NO_REMOTE,rr=typeof FEDERATION_OPTIMIZE_NO_SHARED!=`boolean`||!FEDERATION_OPTIMIZE_NO_SHARED,ir=class{constructor(e){this.hooks=new J({beforeInit:new Z(`beforeInit`),init:new Y,beforeInitContainer:new Q(`beforeInitContainer`),initContainer:new Q(`initContainer`)}),this.version=`2.9.2`,this.moduleCache=new Map,this.loaderHook=new J({getModuleInfo:new Y,createScript:new Y,createLink:new Y,fetch:new X,loadEntryError:new X,afterLoadEntry:new X(`afterLoadEntry`),beforeInitRemote:new X(`beforeInitRemote`),afterInitRemote:new X(`afterInitRemote`),beforeGetExpose:new X(`beforeGetExpose`),afterGetExpose:new X(`afterGetExpose`),beforeExecuteFactory:new X(`beforeExecuteFactory`),afterExecuteFactory:new X(`afterExecuteFactory`),getModuleFactory:new X}),this.bridgeHook=new J({beforeBridgeRender:new Y,afterBridgeRender:new Y,beforeBridgeDestroy:new Y,afterBridgeDestroy:new Y,afterBridgeRouteSync:new Y});let t=nr&&tr?[Un(),Jn()]:[],n={id:Sn(),name:e.name,plugins:t,remotes:[],shared:{},inBrowser:!0};this.name=e.name,this.options=n,this.snapshotHandler=nr?new Xn(this):new Zn,this.sharedHandler=rr?new Qn(this):new $n,this.remoteHandler=nr?new er(this):new Vn,this.shareScopeMap=this.sharedHandler.shareScopeMap,this.registerPlugins([...n.plugins,...e.plugins||[]]),this.options=this.formatOptions(n,e)}initOptions(e){e.name&&e.name!==this.options.name&&b(pe(Qt,W)),this.registerPlugins(e.plugins);let 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=Dt,t){return this.sharedHandler.initializeSharing(e,t)}initRawContainer(e,t,n){return this.remoteHandler.initRawContainer(e,t,n)}async loadRemote(e,t){return this.remoteHandler.loadRemote(e,t)}async preloadRemote(e){return this.remoteHandler.preloadRemote(e)}initShareScopeMap(e,t,n={}){this.sharedHandler.initShareScopeMap(e,t,n)}formatOptions(e,t){let n=rr?At(e,t).allShareInfos:{},{userOptions:r,options:i}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:t,options:e,shareInfo:n}),a=this.remoteHandler.formatAndRegisterRemote(i,r),{allShareInfos:o}=this.sharedHandler.registerShared(i,r),s=[...i.plugins];r.plugins&&r.plugins.forEach(e=>{s.includes(e)||s.push(e)});let c={...e,...t,plugins:s,remotes:a,shared:o,id:r.id||e.id};return this.hooks.lifecycle.init.emit({origin:this,options:c}),c}registerPlugins(e){this.options.plugins=Tn(e,this)}registerRemotes(e,t){return this.remoteHandler.registerRemotes(e,t)}registerShared(e){this.sharedHandler.registerShared(this.options,{...this.options,shared:e})}};function ar(){return typeof FEDERATION_BUILD_IDENTIFIER<`u`?FEDERATION_BUILD_IDENTIFIER:``}function or(e,t){let n=ar();return C.__FEDERATION__.__INSTANCES__.find(r=>!!(n&&r.options.id===n||r.options.name===e&&!r.options.version&&!t||r.options.name===e&&t&&r.options.version===t))}function sr(e){let t=new((Oe())||ir)({id:`${e.name}@${e.version||Date.now()}`,...e});return De(t),t}var cr=null;function lr(e){let t=or(e.name,e.version),n={...e,id:e.id||``};return t?(t.initOptions(n),cr||=t,t):(cr=sr(n),cr)}ke(ir);export{lr as t};