@signalk/app-dock 1.5.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -91
- package/dist/plugin/index.js +3 -3
- package/package.json +2 -2
- package/public/configpanel/PluginConfigurationPanel.js +1 -1
- package/public/configpanel/_virtual_mf-localSharedImportMap___mfe_internal___signalk_app_dock__mf_owner__1-GfsGDlYi.js +1 -0
- package/public/configpanel/dist-BL3MB09X.js +4 -0
- package/public/configpanel/hostInit-BrNJcg9W.js +1 -0
- package/public/configpanel/pendingShares-CC8Bq8-F.js +1 -0
- package/public/configpanel/{vite-preload-helper-DHhhL8Zf.js → vite-preload-helper-DygEbaNj.js} +1 -1
- package/public/dock.js +1 -1
- package/public/icon-more.svg +14 -0
- package/public/index.html +2 -2
- package/public/remoteEntry.js +1 -1
- package/public/configpanel/_virtual_mf-localSharedImportMap___mfe_internal___signalk_app_dock__mf_owner__1-_R-vaMcG.js +0 -1
- package/public/configpanel/dist-D1jGdgWH.js +0 -4
- package/public/configpanel/hostInit-D-z9PzRy.js +0 -1
- package/public/configpanel/pendingShares-BqCOmgFj.js +0 -1
package/README.md
CHANGED
|
@@ -6,28 +6,23 @@ A macOS-style app dock for switching between Signal K webapps on touch screens.
|
|
|
6
6
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
9
|
-
- **
|
|
9
|
+
- **Magnifying icons** -- icons grow as your finger moves along the dock, like the macOS dock
|
|
10
10
|
- **Frosted glass pill** with spring bounce animation, positioned on any screen edge
|
|
11
11
|
- **Lazy loading** -- apps load only when first tapped (important for Raspberry Pi and low-power devices)
|
|
12
|
-
- **Double-tap anywhere** to reveal the dock -- works on touch and mouse. Single taps and clicks pass through to the underlying webapp unchanged, so interactive elements (e.g. KIP's corner widgets) keep working.
|
|
12
|
+
- **Double-tap anywhere** to reveal the dock -- works on touch and mouse. Single taps and clicks pass through to the underlying webapp unchanged, so interactive elements (e.g. KIP's corner widgets) keep working. Double-tap also works when one webapp shows another inside it (e.g. KIP's split view with Freeboard-SK).
|
|
13
13
|
- **Autostart** -- optionally load a default app immediately on open
|
|
14
|
-
- **
|
|
15
|
-
- **Night/day mode toggle** -- optional sun/moon button that
|
|
16
|
-
- **Fullscreen toggle** -- optional button that hides browser
|
|
17
|
-
- **Installable as an app** --
|
|
14
|
+
- **Keep apps running** in the background, or reload each app every time you open it
|
|
15
|
+
- **Night/day mode toggle** -- optional sun/moon button that switches every app that follows Signal K's day/night mode
|
|
16
|
+
- **Fullscreen toggle** -- optional button that hides the browser's address bar and tabs; not shown where the browser can't do it (notably Safari on iPad -- use Add to Home Screen there)
|
|
17
|
+
- **Installable as an app** -- add the dock to the home screen of an iPad, phone or computer and open it like any other app, without the browser around it. Works over plain HTTP
|
|
18
18
|
- **Active dot indicator**, label tooltip, haptic feedback
|
|
19
|
-
- **
|
|
19
|
+
- **Setup in the admin UI** with webapp discovery, drag-to-reorder, and live preview
|
|
20
20
|
|
|
21
21
|
## Installation
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
cd ~/.signalk
|
|
25
|
-
npm install @signalk/app-dock
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
Restart Signal K, enable in **Plugin Config > App Dock**, click **Discover Installed Webapps**.
|
|
23
|
+
In the Signal K admin UI, open **Appstore**, find **App Dock** and install it. Restart the server when asked. It comes with a starting set of apps, which you can change in **Plugin Config > App Dock**.
|
|
29
24
|
|
|
30
|
-
Open
|
|
25
|
+
Open the dock at `http://your-sk-server:3000/@signalk/app-dock/`, or from the admin UI's **Webapps** page.
|
|
31
26
|
|
|
32
27
|
## Usage
|
|
33
28
|
|
|
@@ -35,37 +30,9 @@ Open: `http://your-sk-server:3000/@signalk/app-dock/`
|
|
|
35
30
|
|
|
36
31
|
Tip: double-tapping a clickable element in the underlying webapp will activate that element once before the dock opens -- aim double-taps at non-interactive regions (maps, gauge backgrounds, empty space).
|
|
37
32
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
## Apps on another origin
|
|
41
|
-
|
|
42
|
-
The dock notices a double-tap by listening inside each app's page, and a browser allows that only for pages on the same origin (scheme, host and port) as the dock. A page from another port or host is out of reach: the app itself, a page the app moves its frame to (such as a radar display opened directly on its own server), or one the app shows in a frame of its own. While any such page in the app on screen does not forward its taps, a small tab at the dock's edge opens the dock with a single tap.
|
|
43
|
-
|
|
44
|
-
An app on another origin can bring back double-tap by forwarding its pointerdowns to the dock:
|
|
45
|
-
|
|
46
|
-
```js
|
|
47
|
-
if (window.self !== window.top) {
|
|
48
|
-
document.addEventListener(
|
|
49
|
-
'pointerdown',
|
|
50
|
-
(e) => {
|
|
51
|
-
window.top.postMessage(
|
|
52
|
-
{
|
|
53
|
-
type: 'signalk-app-dock:pointerdown',
|
|
54
|
-
x: e.clientX,
|
|
55
|
-
y: e.clientY,
|
|
56
|
-
t: performance.timeOrigin + e.timeStamp
|
|
57
|
-
},
|
|
58
|
-
'*'
|
|
59
|
-
)
|
|
60
|
-
},
|
|
61
|
-
{ passive: true, capture: true }
|
|
62
|
-
)
|
|
63
|
-
}
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
`t` is when the tap happened. It is optional, but a page that is busy, rendering a radar display for example, can post its messages late, and without `t` the dock can only go by when they arrive, which can split a double-tap in two.
|
|
33
|
+
Some apps run on another address (another port or another device), a radar display for example. The dock cannot hear double-taps on those, so while one is on screen a small tab shows at the dock's edge: tap it once to open the dock.
|
|
67
34
|
|
|
68
|
-
|
|
35
|
+
Config changes made in **Plugin Config** apply automatically within ~5 seconds: structural changes (position, icon size, etc.) reload the dock page; changes to the app list hot-update in place.
|
|
69
36
|
|
|
70
37
|
## Install as an app
|
|
71
38
|
|
|
@@ -77,13 +44,13 @@ The dock ships a web app manifest, so iOS and Android can install it to the home
|
|
|
77
44
|
|
|
78
45
|
HTTPS is **not required** for Add-to-Home-Screen -- the dock installs cleanly over plain `http://your-sk-server:3000/`. It works equally over HTTPS with a self-signed or local-CA cert, provided the device has been configured to trust that CA (the usual iPad profile flow: Settings > General > VPN & Device Management > trust the profile > Settings > General > About > Certificate Trust Settings > enable full trust).
|
|
79
46
|
|
|
80
|
-
If the installed dock ever displays a blank screen after a long idle period (rare
|
|
47
|
+
If the installed dock ever displays a blank screen after a long idle period (rare), remove the home-screen icon and re-add it from Safari.
|
|
81
48
|
|
|
82
49
|
## Configuration
|
|
83
50
|
|
|
84
51
|
Open **Plugin Config > App Dock** in the admin UI. The embedded configurator provides:
|
|
85
52
|
|
|
86
|
-
- **Discover** button to find all installed webapps (including
|
|
53
|
+
- **Discover** button to find all installed webapps (including the admin UI as a **More** tile, which opens the list of your other webapps and the server's settings)
|
|
87
54
|
- **Drag-to-reorder** the app list
|
|
88
55
|
- **Enable/disable** individual apps
|
|
89
56
|
- **Autostart** flag (play button) -- set one app to load automatically on open
|
|
@@ -102,7 +69,7 @@ Open **Plugin Config > App Dock** in the admin UI. The embedded configurator pro
|
|
|
102
69
|
| `showFullscreenButton` | `false` | Show fullscreen toggle in dock; hidden automatically where the Fullscreen API is unavailable |
|
|
103
70
|
| `showExitButton` | `false` | Show X button that returns to the Signal K admin UI |
|
|
104
71
|
|
|
105
|
-
In either `iframeMode`, the server's admin UI (an app whose URL is under `/admin/`, such as the
|
|
72
|
+
In either `iframeMode`, the server's admin UI (an app whose URL is under `/admin/`, such as the More tile) opens fresh every time, at the URL its tile points to. A webapp or page opened from inside the admin UI does not come back the next time More is tapped.
|
|
106
73
|
|
|
107
74
|
## Access
|
|
108
75
|
|
|
@@ -118,58 +85,39 @@ With security enabled, what the dock offers depends on the visitor:
|
|
|
118
85
|
|
|
119
86
|
Visitors who are not admins reach the plugin's routes through `router.access()`, which signalk-server 2.31 added. On older servers they get the built-in list, the same apps the plugin seeds on its first start. Only admins can open **Plugin Config**, and "Don't show again" hides the tour for every visitor. Everyone who gets the configured apps can also read their URLs from the plugin's `/settings`, so keep credentials out of app URLs.
|
|
120
87
|
|
|
121
|
-
##
|
|
88
|
+
## For webapp authors: apps on another origin
|
|
122
89
|
|
|
123
|
-
|
|
124
|
-
cd /path/to/app-dock
|
|
125
|
-
npm install
|
|
126
|
-
npm run build # the server loads dist/ and serves public/; rebuild after a change
|
|
127
|
-
|
|
128
|
-
cd ~/.signalk # or a throwaway SK config dir for dev, e.g. ~/.signalk-app-dock
|
|
129
|
-
npm link /path/to/app-dock
|
|
130
|
-
```
|
|
90
|
+
The dock notices a double-tap by listening inside each app's page, and a browser allows that only for pages on the same origin (scheme, host and port) as the dock. A page from another port or host is out of reach: the app itself, a page the app moves its frame to (such as a radar display opened directly on its own server), or one the app shows in a frame of its own. While any such page in the app on screen does not forward its taps, a small tab at the dock's edge opens the dock with a single tap.
|
|
131
91
|
|
|
132
|
-
|
|
92
|
+
An app on another origin can bring back double-tap by forwarding its pointerdowns to the dock:
|
|
133
93
|
|
|
134
|
-
```
|
|
135
|
-
|
|
94
|
+
```js
|
|
95
|
+
if (window.self !== window.top) {
|
|
96
|
+
document.addEventListener(
|
|
97
|
+
'pointerdown',
|
|
98
|
+
(e) => {
|
|
99
|
+
window.top.postMessage(
|
|
100
|
+
{
|
|
101
|
+
type: 'signalk-app-dock:pointerdown',
|
|
102
|
+
x: e.clientX,
|
|
103
|
+
y: e.clientY,
|
|
104
|
+
t: performance.timeOrigin + e.timeStamp
|
|
105
|
+
},
|
|
106
|
+
'*'
|
|
107
|
+
)
|
|
108
|
+
},
|
|
109
|
+
{ passive: true, capture: true }
|
|
110
|
+
)
|
|
111
|
+
}
|
|
136
112
|
```
|
|
137
113
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
The repo ships three cooperating surfaces:
|
|
141
|
-
|
|
142
|
-
- **`src/plugin/`** -- the SK-server plugin, an ES module compiled by `tsc` to `dist/plugin/`. Defines the configuration schema with TypeBox, seeds default apps on first run, exposes HTTP endpoints for the dock and config panel, and owns the `environment.mode` PUT handler.
|
|
143
|
-
- **`src/dock/`** -- the dock UI (`index.html`, `dock.ts`, `dock.css`) and the standalone configurator (`config.html`, `config.ts`), built by Vite into `public/`, which the server serves at `/@signalk/app-dock/`. `src/dock/static/` holds the icons and the web manifest, copied as they are.
|
|
144
|
-
- **`src/configpanel/`** -- React 19 component exposed to the admin UI via Module Federation (`@module-federation/vite`), built into `public/remoteEntry.js` and `public/configpanel/`. It uses the admin UI's own React, which signalk-server 2.27 and later expose.
|
|
145
|
-
|
|
146
|
-
Everything is strict TypeScript. Vite only transpiles, so both Vite builds run the type checker (`vite-plugin-checker`) and fail on a type error. `public/` and `dist/` are build output and not committed; `npm run build` creates them.
|
|
147
|
-
|
|
148
|
-
### Scripts
|
|
149
|
-
|
|
150
|
-
| Command | Description |
|
|
151
|
-
| -------------------------- | ----------------------------------------------------------------- |
|
|
152
|
-
| `npm run build` | Build the plugin, the dock pages and the config panel |
|
|
153
|
-
| `npm run typecheck:config` | Type-check the Vite and ESLint configs |
|
|
154
|
-
| `npm run build:server` | Compile the plugin and its tests to `dist/` |
|
|
155
|
-
| `npm run build:dock` | Build the dock pages into `public/` (empties it first) |
|
|
156
|
-
| `npm run build:config` | Build the admin UI config panel into `public/` |
|
|
157
|
-
| `npm test` | Run the plugin tests (`node --test`) against `dist/`; build first |
|
|
158
|
-
| `npm run format` | Prettier + ESLint fix |
|
|
159
|
-
| `npm run format:check` | Prettier check + ESLint, as CI runs them |
|
|
160
|
-
| `npm run lint` | ESLint check |
|
|
161
|
-
|
|
162
|
-
### Icon assets
|
|
163
|
-
|
|
164
|
-
`app-icon.svg` has a transparent background: the artwork sits straight on whatever page shows it, so its colours have to read on light and dark backgrounds alike. Check a change on both before committing.
|
|
114
|
+
`t` is when the tap happened. It is optional, but a page that is busy, rendering a radar display for example, can post its messages late, and without `t` the dock can only go by when they arrive, which can split a double-tap in two.
|
|
165
115
|
|
|
166
|
-
The
|
|
116
|
+
The dock accepts these messages only from a page of the app on screen that it cannot listen to itself, or a frame inside that page, and all they do is count towards a double-tap. The tab goes away once every such page has sent one. A page that loads again starts over: the tab is back until its first tap.
|
|
167
117
|
|
|
168
|
-
|
|
169
|
-
rsvg-convert -w 132 -h 132 app-icon.svg | magick - -background '#0f172a' -gravity center -extent 180x180 -alpha remove -alpha off PNG24:src/dock/static/app-icon-180.png
|
|
170
|
-
```
|
|
118
|
+
## Building from source
|
|
171
119
|
|
|
172
|
-
|
|
120
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
173
121
|
|
|
174
122
|
## License
|
|
175
123
|
|
package/dist/plugin/index.js
CHANGED
|
@@ -19,9 +19,9 @@ const DEFAULT_APPS = [
|
|
|
19
19
|
{
|
|
20
20
|
enabled: true,
|
|
21
21
|
autostart: false,
|
|
22
|
-
url: '/admin
|
|
23
|
-
label: '
|
|
24
|
-
icon: '/@signalk/app-dock/icon-
|
|
22
|
+
url: '/admin/#/webapps',
|
|
23
|
+
label: 'More',
|
|
24
|
+
icon: '/@signalk/app-dock/icon-more.svg',
|
|
25
25
|
color: '#78788c'
|
|
26
26
|
}
|
|
27
27
|
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signalk/app-dock",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "macOS-style configurable app dock for switching between SignalK webapps on touch screens",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "https://github.com/SignalK/app-dock"
|
|
@@ -66,6 +66,6 @@
|
|
|
66
66
|
"typescript": "~6.0.3",
|
|
67
67
|
"typescript-eslint": "^8.71.2",
|
|
68
68
|
"vite": "^8.3.4",
|
|
69
|
-
"vite-plugin-checker": "^0.
|
|
69
|
+
"vite-plugin-checker": "^1.0.0"
|
|
70
70
|
}
|
|
71
71
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=window.__SK_REACT__;if(!e)throw Error(`App Dock: 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{Activity:t,Children:n,Component:r,Fragment:i,Profiler:a,PureComponent:o,StrictMode:s,Suspense:ee,cache:c,cacheSignal:l,cloneElement:u,createContext:te,createElement:d,createRef:f,forwardRef:p,isValidElement:m,lazy:h,memo:g,startTransition:_,use:v,useActionState:y,useCallback:b,useContext:x,useDebugValue:S,useDeferredValue:C,useEffect:w,useEffectEvent:T,useId:E,useImperativeHandle:D,useInsertionEffect:O,useLayoutEffect:k,useMemo:A,useOptimistic:j,useReducer:M,useRef:N,useState:P,useSyncExternalStore:F,useTransition:I,version:L}=e,R=(e,t)=>`<svg class="dock-svg-icon dock-svg-${e}" width="100%" height="100%" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${t}</svg>`,z={sun:R(`sun`,`<circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/>`),moon:R(`moon`,`<path d="M20.5 14A9 9 0 1 1 10 3.5a7.5 7.5 0 0 0 10.5 10.5z"/>`),fullscreen:R(`fullscreen`,`<path d="M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5"/>`),exitFullscreen:R(`exit-fullscreen`,`<path d="M9 4v5H4M20 9h-5V4M15 20v-5h5M4 15h5v5"/>`),close:R(`close`,`<path d="M6 6l12 12M18 6L6 18"/>`)},B=window.__SK_REACT_JSX_RUNTIME__;if(!B)throw Error(`App Dock: window.__SK_REACT_JSX_RUNTIME__ is not set by the host.`);var V=B,{Fragment:H,jsx:U,jsxs:W}=V;V.jsxDEV;function G(e){return e instanceof Error?e.message:String(e)}var K={root:{fontFamily:`-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif`,color:`#333`,padding:`16px 0`},sectionTitle:{fontSize:13,fontWeight:600,color:`#888`,textTransform:`uppercase`,letterSpacing:`0.05em`,marginBottom:10,marginTop:24},btn:{display:`inline-flex`,alignItems:`center`,gap:8,padding:`8px 16px`,border:`none`,borderRadius:6,fontSize:13,fontWeight:600,cursor:`pointer`},btnPrimary:{background:`#3b82f6`,color:`#fff`},btnSave:{background:`#10b981`,color:`#fff`},btnDanger:{background:`#ef4444`,color:`#fff`,padding:`4px 10px`,fontSize:11},status:{marginTop:8,fontSize:12,minHeight:18},item:{display:`flex`,alignItems:`center`,gap:10,padding:`8px 12px`,background:`#f8f9fa`,border:`1px solid #e0e0e0`,borderRadius:8,marginBottom:6,cursor:`grab`},itemDisabled:{opacity:.4},dragOver:{borderColor:`#3b82f6`,background:`#eef4ff`},handle:{color:`#bbb`,fontSize:16,cursor:`grab`,userSelect:`none`,flexShrink:0,width:18,textAlign:`center`},iconBox:{width:36,height:36,borderRadius:8,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`#e2e8f0`,overflow:`hidden`,flexShrink:0,fontSize:18},iconImg:{width:`100%`,height:`100%`,objectFit:`contain`,padding:5},info:{flex:1,minWidth:0},name:{fontSize:13,fontWeight:600,color:`#333`},url:{fontSize:10,color:`#999`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},toggle:{flexShrink:0},checkbox:{width:16,height:16,cursor:`pointer`,accentColor:`#3b82f6`},preview:{display:`flex`,alignItems:`flex-end`,justifyContent:`center`,gap:6,padding:`12px 18px`,background:`rgba(30,30,32,0.85)`,border:`1px solid rgba(255,255,255,0.18)`,borderRadius:18,margin:`16px auto`,width:`fit-content`},actions:{display:`flex`,gap:10,alignItems:`center`,marginTop:16},empty:{textAlign:`center`,padding:`30px 16px`,color:`#999`,fontSize:13},fieldRow:{display:`flex`,alignItems:`center`,gap:12,marginBottom:10},label:{fontSize:13,fontWeight:500,color:`#555`,width:160,flexShrink:0},select:{padding:`6px 10px`,borderRadius:6,border:`1px solid #ccc`,fontSize:13,background:`#fff`,color:`#333`},input:{padding:`6px 10px`,borderRadius:6,border:`1px solid #ccc`,fontSize:13,width:80,background:`#fff`,color:`#333`},checkboxField:{width:16,height:16,accentColor:`#3b82f6`},hint:{fontSize:11,color:`#aaa`,marginLeft:8}};function q({icon:e,label:t,color:n,size:r}){let i=r||36,a={...K.iconBox,width:i,height:i,borderRadius:i*.22,...n?{background:n}:{}},o=e||``;return o.startsWith(`/`)||o.startsWith(`http`)?U(`div`,{style:a,children:U(`img`,{src:o,alt:t,style:{...K.iconImg,padding:i*.12},onError:e=>{let n=e.currentTarget;n.style.display=`none`,n.parentElement&&(n.parentElement.textContent=(t||`??`).slice(0,2).toUpperCase())}})}):U(`div`,{style:a,children:o||(t||`??`).slice(0,2).toUpperCase()})}function J({name:e,color:t}){return U(`span`,{style:{display:`flex`,width:`55%`,height:`55%`,color:t||`#fff`},dangerouslySetInnerHTML:{__html:z[e]}})}function Y({label:e,value:t,options:n,onChange:r,hint:i}){return W(`div`,{style:K.fieldRow,children:[U(`span`,{style:K.label,children:e}),U(`select`,{style:K.select,value:t,onChange:e=>r(e.target.value),children:n.map(e=>U(`option`,{value:e.value,children:e.label},e.value))}),i&&U(`span`,{style:K.hint,children:i})]})}function X({label:e,value:t,onChange:n,hint:r}){return W(`div`,{style:K.fieldRow,children:[U(`span`,{style:K.label,children:e}),U(`input`,{style:K.input,type:`number`,value:t,onChange:e=>n(Number(e.target.value))}),r&&U(`span`,{style:K.hint,children:r})]})}function Z({label:e,checked:t,onChange:n,hint:r}){return W(`div`,{style:K.fieldRow,children:[U(`span`,{style:K.label,children:e}),U(`input`,{type:`checkbox`,style:K.checkboxField,checked:t,onChange:e=>n(e.target.checked)}),r&&U(`span`,{style:K.hint,children:r})]})}function Q({configuration:e,save:t}){let n=e||{},[r,i]=P(()=>n.apps||[]),[a,o]=P(n.position||`bottom`),[s,ee]=P(n.iframeMode||`destroy`),[c,l]=P(n.iconSize||56),[u,te]=P(n.magnification!==!1),[d,f]=P(n.magnificationScale||1.7),[p,m]=P(n.showNightModeButton||!1),[h,g]=P(n.showFullscreenButton||!1),[_,v]=P(n.showExitButton||!1),y=n.tourDismissed||!1,[x,S]=P(``),[C,T]=P(!1),[E,D]=P(!1),[O,k]=P(!1),[A,j]=P(null),[M,F]=P(null),I=N(r);w(()=>{I.current=r},[r]);let L=N(null);w(()=>()=>{L.current&&clearTimeout(L.current)},[]);let R=b(e=>({position:a,iframeMode:s,iconSize:c,magnification:u,magnificationScale:d,showNightModeButton:p,showFullscreenButton:h,showExitButton:_,tourDismissed:y,apps:e}),[a,s,c,u,d,p,h,_,y]),z=b(async()=>{L.current&&clearTimeout(L.current),k(!0),S(`Saving…`),T(!1);try{await t(R(r)),S(`Configuration saved — plugin will restart`),T(!1),L.current=setTimeout(()=>S(``),5e3)}catch(e){S(`Save failed: `+G(e)),T(!0)}finally{k(!1)}},[r,R,t]),B=async()=>{D(!0),S(``),T(!1);try{let e=(await(await fetch(`/skServer/webapps`)).json()).filter(e=>e.name!==`@signalk/app-dock`).map(e=>e.name===`@signalk/server-admin-ui`?{name:e.name,label:`Settings`,url:`/admin/`,icon:`/@signalk/app-dock/icon-settings.svg`,isAdmin:!0}:{name:e.name,label:e.signalk?.displayName||e.name,url:`/${e.name}/`,icon:e.signalk?.appIcon?`/${e.name}/${e.signalk.appIcon}`:null});if(e.length===0){S(`No webapps found. Is the server fully started?`),T(!0),D(!1);return}let t=I.current,n=new Set(t.map(e=>e.url)),r=0,a=[...t];for(let t of e)n.has(t.url)||(a.push({enabled:!0,autostart:!1,url:t.url,label:t.label||``,icon:t.icon||``,color:t.isAdmin?`#78788c`:``}),r++);i(a),S(r>0?`Found ${e.length} webapps, added ${r} new.`:`All ${e.length} webapps already in list.`),T(!1)}catch(e){S(`Discovery failed: `+G(e)),T(!0)}D(!1)},V=e=>i(r.map((t,n)=>n===e?{...t,enabled:!t.enabled}:t)),Q=e=>i(r.map((t,n)=>n===e?{...t,autostart:!t.autostart}:{...t,autostart:!1})),ne=e=>i(r.filter((t,n)=>n!==e)),re=e=>j(e),ie=(e,t)=>{e.preventDefault(),F(t)},ae=()=>F(null),oe=(e,t)=>{if(e.preventDefault(),F(null),A!==null&&A!==t){let e=[...r],[n]=e.splice(A,1);e.splice(t,0,n),i(e)}j(null)},se=()=>{j(null),F(null)},$=r.filter(e=>e.enabled!==!1);return W(`div`,{style:K.root,children:[U(`div`,{style:K.sectionTitle,children:`Dock Settings`}),U(Y,{label:`Dock position`,value:a,onChange:o,options:[{value:`bottom`,label:`Bottom`},{value:`top`,label:`Top`},{value:`left`,label:`Left`},{value:`right`,label:`Right`}]}),U(Y,{label:`iFrame lifecycle`,value:s,onChange:ee,options:[{value:`destroy`,label:`Destroy (reload each time, less RAM and CPU)`},{value:`keep-alive`,label:`Keep-alive (faster switching, hidden apps keep running)`}]}),U(X,{label:`Icon size`,value:c,onChange:l,hint:`px`}),U(Z,{label:`Magnification effect`,checked:u,onChange:te}),u&&U(X,{label:`Magnification scale`,value:d,onChange:f,hint:`1.0 - 2.5`}),U(`div`,{style:K.sectionTitle,children:`Utility Buttons`}),U(Z,{label:`Night/Day mode toggle`,checked:p,onChange:m,hint:`Sun/moon button to toggle environment.mode`}),U(Z,{label:`Fullscreen toggle`,checked:h,onChange:g,hint:`Toggles browser fullscreen. Hidden on devices without Fullscreen API support (e.g. iPadOS Safari).`}),U(Z,{label:`Exit button`,checked:_,onChange:v,hint:`X button to return to Signal K admin UI`}),U(`div`,{style:K.sectionTitle,children:`Webapps`}),U(`button`,{style:{...K.btn,...K.btnPrimary,...E?{opacity:.6}:{}},onClick:()=>void B(),disabled:E,children:E?`Discovering…`:`Discover Installed Webapps`}),x&&U(`div`,{style:{...K.status,color:C?`#ef4444`:`#10b981`},children:x}),U(`div`,{style:K.sectionTitle,children:`Dock Apps (drag to reorder)`}),r.length===0?U(`div`,{style:K.empty,children:`No apps yet. Click Discover above.`}):U(`div`,{children:r.map((e,t)=>W(`div`,{draggable:!0,onDragStart:()=>re(t),onDragOver:e=>ie(e,t),onDragLeave:ae,onDrop:e=>oe(e,t),onDragEnd:se,style:{...K.item,...e.enabled===!1?K.itemDisabled:{},...M===t?K.dragOver:{},...A===t?{opacity:.4}:{}},children:[U(`span`,{style:K.handle,children:`≡`}),U(q,{icon:e.icon,label:e.label||e.url,color:e.color}),W(`div`,{style:K.info,children:[U(`div`,{style:K.name,children:e.label||e.url}),U(`div`,{style:K.url,children:e.url})]}),U(`div`,{style:K.toggle,title:`Enabled`,children:U(`input`,{type:`checkbox`,checked:e.enabled!==!1,onChange:()=>V(t),style:K.checkbox})}),U(`div`,{style:{...K.toggle,cursor:`pointer`,fontSize:16,opacity:e.autostart?1:.25},onClick:()=>Q(t),title:e.autostart?`Autostart: ON (click to disable)`:`Click to set as autostart app`,children:`▶`}),U(`button`,{style:{...K.btn,...K.btnDanger},onClick:()=>ne(t),children:`Remove`})]},e.url+t))}),($.length>0||p||h||_)&&W(H,{children:[U(`div`,{style:K.sectionTitle,children:`Preview`}),W(`div`,{style:K.preview,children:[p&&U(`div`,{style:{...K.iconBox,width:40,height:40,background:`rgba(255,255,255,0.08)`,border:`1px solid rgba(255,255,255,0.12)`,fontSize:20,borderRadius:10},children:U(J,{name:`sun`,color:`#fbbf24`})}),h&&U(`div`,{style:{...K.iconBox,width:40,height:40,background:`rgba(255,255,255,0.08)`,border:`1px solid rgba(255,255,255,0.12)`,fontSize:20,borderRadius:10,color:`#fff`},children:U(J,{name:`fullscreen`})}),(p||h)&&U(`div`,{style:{width:1,height:24,background:`rgba(255,255,255,0.15)`,alignSelf:`center`}}),$.map((e,t)=>U(q,{icon:e.icon,label:e.label||e.url,color:e.color,size:40},t)),_&&W(H,{children:[U(`div`,{style:{width:1,height:24,background:`rgba(255,255,255,0.15)`,alignSelf:`center`}}),U(`div`,{style:{...K.iconBox,width:40,height:40,background:`rgba(255,255,255,0.08)`,border:`1px solid rgba(255,255,255,0.12)`,fontSize:16,borderRadius:10,color:`#fff`},children:U(J,{name:`close`})})]})]})]}),W(`div`,{style:K.actions,children:[U(`button`,{style:{...K.btn,...K.btnSave,...O?{opacity:.6}:{}},onClick:()=>void z(),disabled:O,children:O?`Saving…`:`Save Configuration`}),x&&U(`div`,{style:{...K.status,color:C?`#ef4444`:`#10b981`},children:x})]})]})}export{Q as default};
|
|
1
|
+
var e=window.__SK_REACT__;if(!e)throw Error(`App Dock: 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{Activity:t,Children:n,Component:r,Fragment:i,Profiler:a,PureComponent:o,StrictMode:s,Suspense:ee,cache:c,cacheSignal:l,cloneElement:u,createContext:te,createElement:d,createRef:f,forwardRef:p,isValidElement:m,lazy:h,memo:g,startTransition:_,use:v,useActionState:y,useCallback:b,useContext:x,useDebugValue:S,useDeferredValue:C,useEffect:w,useEffectEvent:T,useId:E,useImperativeHandle:D,useInsertionEffect:O,useLayoutEffect:k,useMemo:A,useOptimistic:j,useReducer:M,useRef:N,useState:P,useSyncExternalStore:F,useTransition:I,version:L}=e,R=(e,t)=>`<svg class="dock-svg-icon dock-svg-${e}" width="100%" height="100%" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${t}</svg>`,z={sun:R(`sun`,`<circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/>`),moon:R(`moon`,`<path d="M20.5 14A9 9 0 1 1 10 3.5a7.5 7.5 0 0 0 10.5 10.5z"/>`),fullscreen:R(`fullscreen`,`<path d="M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5"/>`),exitFullscreen:R(`exit-fullscreen`,`<path d="M9 4v5H4M20 9h-5V4M15 20v-5h5M4 15h5v5"/>`),close:R(`close`,`<path d="M6 6l12 12M18 6L6 18"/>`)},B=window.__SK_REACT_JSX_RUNTIME__;if(!B)throw Error(`App Dock: window.__SK_REACT_JSX_RUNTIME__ is not set by the host.`);var V=B,{Fragment:H,jsx:U,jsxs:W}=V;V.jsxDEV;function G(e){return e instanceof Error?e.message:String(e)}var K={root:{fontFamily:`-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif`,color:`#333`,padding:`16px 0`},sectionTitle:{fontSize:13,fontWeight:600,color:`#888`,textTransform:`uppercase`,letterSpacing:`0.05em`,marginBottom:10,marginTop:24},btn:{display:`inline-flex`,alignItems:`center`,gap:8,padding:`8px 16px`,border:`none`,borderRadius:6,fontSize:13,fontWeight:600,cursor:`pointer`},btnPrimary:{background:`#3b82f6`,color:`#fff`},btnSave:{background:`#10b981`,color:`#fff`},btnDanger:{background:`#ef4444`,color:`#fff`,padding:`4px 10px`,fontSize:11},status:{marginTop:8,fontSize:12,minHeight:18},item:{display:`flex`,alignItems:`center`,gap:10,padding:`8px 12px`,background:`#f8f9fa`,border:`1px solid #e0e0e0`,borderRadius:8,marginBottom:6,cursor:`grab`},itemDisabled:{opacity:.4},dragOver:{borderColor:`#3b82f6`,background:`#eef4ff`},handle:{color:`#bbb`,fontSize:16,cursor:`grab`,userSelect:`none`,flexShrink:0,width:18,textAlign:`center`},iconBox:{width:36,height:36,borderRadius:8,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`#e2e8f0`,overflow:`hidden`,flexShrink:0,fontSize:18},iconImg:{width:`100%`,height:`100%`,objectFit:`contain`,padding:5},info:{flex:1,minWidth:0},name:{fontSize:13,fontWeight:600,color:`#333`},url:{fontSize:10,color:`#999`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},toggle:{flexShrink:0},checkbox:{width:16,height:16,cursor:`pointer`,accentColor:`#3b82f6`},preview:{display:`flex`,alignItems:`flex-end`,justifyContent:`center`,gap:6,padding:`12px 18px`,background:`rgba(30,30,32,0.85)`,border:`1px solid rgba(255,255,255,0.18)`,borderRadius:18,margin:`16px auto`,width:`fit-content`},actions:{display:`flex`,gap:10,alignItems:`center`,marginTop:16},empty:{textAlign:`center`,padding:`30px 16px`,color:`#999`,fontSize:13},fieldRow:{display:`flex`,alignItems:`center`,gap:12,marginBottom:10},label:{fontSize:13,fontWeight:500,color:`#555`,width:160,flexShrink:0},select:{padding:`6px 10px`,borderRadius:6,border:`1px solid #ccc`,fontSize:13,background:`#fff`,color:`#333`},input:{padding:`6px 10px`,borderRadius:6,border:`1px solid #ccc`,fontSize:13,width:80,background:`#fff`,color:`#333`},checkboxField:{width:16,height:16,accentColor:`#3b82f6`},hint:{fontSize:11,color:`#aaa`,marginLeft:8}};function q({icon:e,label:t,color:n,size:r}){let i=r||36,a={...K.iconBox,width:i,height:i,borderRadius:i*.22,...n?{background:n}:{}},o=e||``;return o.startsWith(`/`)||o.startsWith(`http`)?U(`div`,{style:a,children:U(`img`,{src:o,alt:t,style:{...K.iconImg,padding:i*.12},onError:e=>{let n=e.currentTarget;n.style.display=`none`,n.parentElement&&(n.parentElement.textContent=(t||`??`).slice(0,2).toUpperCase())}})}):U(`div`,{style:a,children:o||(t||`??`).slice(0,2).toUpperCase()})}function J({name:e,color:t}){return U(`span`,{style:{display:`flex`,width:`55%`,height:`55%`,color:t||`#fff`},dangerouslySetInnerHTML:{__html:z[e]}})}function Y({label:e,value:t,options:n,onChange:r,hint:i}){return W(`div`,{style:K.fieldRow,children:[U(`span`,{style:K.label,children:e}),U(`select`,{style:K.select,value:t,onChange:e=>r(e.target.value),children:n.map(e=>U(`option`,{value:e.value,children:e.label},e.value))}),i&&U(`span`,{style:K.hint,children:i})]})}function X({label:e,value:t,onChange:n,hint:r}){return W(`div`,{style:K.fieldRow,children:[U(`span`,{style:K.label,children:e}),U(`input`,{style:K.input,type:`number`,value:t,onChange:e=>n(Number(e.target.value))}),r&&U(`span`,{style:K.hint,children:r})]})}function Z({label:e,checked:t,onChange:n,hint:r}){return W(`div`,{style:K.fieldRow,children:[U(`span`,{style:K.label,children:e}),U(`input`,{type:`checkbox`,style:K.checkboxField,checked:t,onChange:e=>n(e.target.checked)}),r&&U(`span`,{style:K.hint,children:r})]})}function Q({configuration:e,save:t}){let n=e||{},[r,i]=P(()=>n.apps||[]),[a,o]=P(n.position||`bottom`),[s,ee]=P(n.iframeMode||`destroy`),[c,l]=P(n.iconSize||56),[u,te]=P(n.magnification!==!1),[d,f]=P(n.magnificationScale||1.7),[p,m]=P(n.showNightModeButton||!1),[h,g]=P(n.showFullscreenButton||!1),[_,v]=P(n.showExitButton||!1),y=n.tourDismissed||!1,[x,S]=P(``),[C,T]=P(!1),[E,D]=P(!1),[O,k]=P(!1),[A,j]=P(null),[M,F]=P(null),I=N(r);w(()=>{I.current=r},[r]);let L=N(null);w(()=>()=>{L.current&&clearTimeout(L.current)},[]);let R=b(e=>({position:a,iframeMode:s,iconSize:c,magnification:u,magnificationScale:d,showNightModeButton:p,showFullscreenButton:h,showExitButton:_,tourDismissed:y,apps:e}),[a,s,c,u,d,p,h,_,y]),z=b(async()=>{L.current&&clearTimeout(L.current),k(!0),S(`Saving…`),T(!1);try{await t(R(r)),S(`Configuration saved — plugin will restart`),T(!1),L.current=setTimeout(()=>S(``),5e3)}catch(e){S(`Save failed: `+G(e)),T(!0)}finally{k(!1)}},[r,R,t]),B=async()=>{D(!0),S(``),T(!1);try{let e=(await(await fetch(`/skServer/webapps`)).json()).filter(e=>e.name!==`@signalk/app-dock`).map(e=>e.name===`@signalk/server-admin-ui`?{name:e.name,label:`More`,url:`/admin/#/webapps`,icon:`/@signalk/app-dock/icon-more.svg`,isAdmin:!0}:{name:e.name,label:e.signalk?.displayName||e.name,url:`/${e.name}/`,icon:e.signalk?.appIcon?`/${e.name}/${e.signalk.appIcon}`:null});if(e.length===0){S(`No webapps found. Is the server fully started?`),T(!0),D(!1);return}let t=I.current,n=new Set(t.map(e=>e.url)),r=0,a=[...t];for(let t of e)n.has(t.url)||(a.push({enabled:!0,autostart:!1,url:t.url,label:t.label||``,icon:t.icon||``,color:t.isAdmin?`#78788c`:``}),r++);i(a),S(r>0?`Found ${e.length} webapps, added ${r} new.`:`All ${e.length} webapps already in list.`),T(!1)}catch(e){S(`Discovery failed: `+G(e)),T(!0)}D(!1)},V=e=>i(r.map((t,n)=>n===e?{...t,enabled:!t.enabled}:t)),Q=e=>i(r.map((t,n)=>n===e?{...t,autostart:!t.autostart}:{...t,autostart:!1})),ne=e=>i(r.filter((t,n)=>n!==e)),re=e=>j(e),ie=(e,t)=>{e.preventDefault(),F(t)},ae=()=>F(null),oe=(e,t)=>{if(e.preventDefault(),F(null),A!==null&&A!==t){let e=[...r],[n]=e.splice(A,1);e.splice(t,0,n),i(e)}j(null)},se=()=>{j(null),F(null)},$=r.filter(e=>e.enabled!==!1);return W(`div`,{style:K.root,children:[U(`div`,{style:K.sectionTitle,children:`Dock Settings`}),U(Y,{label:`Dock position`,value:a,onChange:o,options:[{value:`bottom`,label:`Bottom`},{value:`top`,label:`Top`},{value:`left`,label:`Left`},{value:`right`,label:`Right`}]}),U(Y,{label:`iFrame lifecycle`,value:s,onChange:ee,options:[{value:`destroy`,label:`Destroy (reload each time, less RAM and CPU)`},{value:`keep-alive`,label:`Keep-alive (faster switching, hidden apps keep running)`}]}),U(X,{label:`Icon size`,value:c,onChange:l,hint:`px`}),U(Z,{label:`Magnification effect`,checked:u,onChange:te}),u&&U(X,{label:`Magnification scale`,value:d,onChange:f,hint:`1.0 - 2.5`}),U(`div`,{style:K.sectionTitle,children:`Utility Buttons`}),U(Z,{label:`Night/Day mode toggle`,checked:p,onChange:m,hint:`Sun/moon button to toggle environment.mode`}),U(Z,{label:`Fullscreen toggle`,checked:h,onChange:g,hint:`Toggles browser fullscreen. Hidden on devices without Fullscreen API support (e.g. iPadOS Safari).`}),U(Z,{label:`Exit button`,checked:_,onChange:v,hint:`X button to return to Signal K admin UI`}),U(`div`,{style:K.sectionTitle,children:`Webapps`}),U(`button`,{style:{...K.btn,...K.btnPrimary,...E?{opacity:.6}:{}},onClick:()=>void B(),disabled:E,children:E?`Discovering…`:`Discover Installed Webapps`}),x&&U(`div`,{style:{...K.status,color:C?`#ef4444`:`#10b981`},children:x}),U(`div`,{style:K.sectionTitle,children:`Dock Apps (drag to reorder)`}),r.length===0?U(`div`,{style:K.empty,children:`No apps yet. Click Discover above.`}):U(`div`,{children:r.map((e,t)=>W(`div`,{draggable:!0,onDragStart:()=>re(t),onDragOver:e=>ie(e,t),onDragLeave:ae,onDrop:e=>oe(e,t),onDragEnd:se,style:{...K.item,...e.enabled===!1?K.itemDisabled:{},...M===t?K.dragOver:{},...A===t?{opacity:.4}:{}},children:[U(`span`,{style:K.handle,children:`≡`}),U(q,{icon:e.icon,label:e.label||e.url,color:e.color}),W(`div`,{style:K.info,children:[U(`div`,{style:K.name,children:e.label||e.url}),U(`div`,{style:K.url,children:e.url})]}),U(`div`,{style:K.toggle,title:`Enabled`,children:U(`input`,{type:`checkbox`,checked:e.enabled!==!1,onChange:()=>V(t),style:K.checkbox})}),U(`div`,{style:{...K.toggle,cursor:`pointer`,fontSize:16,opacity:e.autostart?1:.25},onClick:()=>Q(t),title:e.autostart?`Autostart: ON (click to disable)`:`Click to set as autostart app`,children:`▶`}),U(`button`,{style:{...K.btn,...K.btnDanger},onClick:()=>ne(t),children:`Remove`})]},e.url+t))}),($.length>0||p||h||_)&&W(H,{children:[U(`div`,{style:K.sectionTitle,children:`Preview`}),W(`div`,{style:K.preview,children:[p&&U(`div`,{style:{...K.iconBox,width:40,height:40,background:`rgba(255,255,255,0.08)`,border:`1px solid rgba(255,255,255,0.12)`,fontSize:20,borderRadius:10},children:U(J,{name:`sun`,color:`#fbbf24`})}),h&&U(`div`,{style:{...K.iconBox,width:40,height:40,background:`rgba(255,255,255,0.08)`,border:`1px solid rgba(255,255,255,0.12)`,fontSize:20,borderRadius:10,color:`#fff`},children:U(J,{name:`fullscreen`})}),(p||h)&&U(`div`,{style:{width:1,height:24,background:`rgba(255,255,255,0.15)`,alignSelf:`center`}}),$.map((e,t)=>U(q,{icon:e.icon,label:e.label||e.url,color:e.color,size:40},t)),_&&W(H,{children:[U(`div`,{style:{width:1,height:24,background:`rgba(255,255,255,0.15)`,alignSelf:`center`}}),U(`div`,{style:{...K.iconBox,width:40,height:40,background:`rgba(255,255,255,0.08)`,border:`1px solid rgba(255,255,255,0.12)`,fontSize:16,borderRadius:10,color:`#fff`},children:U(J,{name:`close`})})]})]})]}),W(`div`,{style:K.actions,children:[U(`button`,{style:{...K.btn,...K.btnSave,...O?{opacity:.6}:{}},onClick:()=>void z(),disabled:O,children:O?`Saving…`:`Save Configuration`}),x&&U(`div`,{style:{...K.status,color:C?`#ef4444`:`#10b981`},children:x})]})]})}export{Q as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./dist-BL3MB09X.js";var e={},t=[];export{t as usedRemotes,e as usedShared};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var e={AT:`@`,HYPHEN:`-`,SLASH:`/`},t={[e.AT]:`scope_`,[e.HYPHEN]:`_`,[e.SLASH]:`__`};t[e.AT],e.AT,t[e.HYPHEN],e.HYPHEN,t[e.SLASH],e.SLASH;var n=function(e){return e[e.UNKNOWN=1]=`UNKNOWN`,e[e.CALCULATED=2]=`CALCULATED`,e[e.NO_USE=0]=`NO_USE`,e}({});function r(){return!0}function i(){return typeof navigator<`u`&&navigator?.product===`ReactNative`}function a(){try{if(r()&&window.localStorage)return!!localStorage.getItem(`FEDERATION_DEBUG`)}catch{return!1}return!1}function o(){return typeof process<`u`&&{}.FEDERATION_DEBUG?!!{}.FEDERATION_DEBUG:typeof FEDERATION_DEBUG<`u`&&FEDERATION_DEBUG?!0:a()}var s=`[ Federation Runtime ]`,c=function(...e){return e.length?e.reduce((e,t)=>t?e?`${e}:${t}`:t:e,``):``};function l(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?!r()&&!i()&&`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 u=e=>{console.warn(`${s}: ${e}`)};function d(e){try{return JSON.stringify(e,null,2)}catch{return``}}var f=(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 p(e){return e.replace(/#.*$/,``).replace(/\?.*$/,``).replace(/\/[^\/]+$/,`/`)}function m(e,t={}){let{remotes:n={},overrides:r={},version:i}=t,a,o=()=>`publicPath`in e.metaData?(e.metaData.publicPath===`auto`||e.metaData.publicPath===``)&&i?p(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:m={path:``,name:``,zip:``,api:``},buildInfo:{buildVersion:ee},globalName:h,ssrRemoteEntry:g}=e.metaData,{exposes:te}=e,ne={version:i||``,buildVersion:ee,globalName:h,remoteEntry:f(l,u),remoteEntryType:d,remoteTypes:f(m.path,m.name),remoteTypesZip:m.zip||``,remoteTypesAPI:m.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={...ne,publicPath:o()},typeof e.metaData.ssrPublicPath==`string`&&(a.ssrPublicPath=e.metaData.ssrPublicPath)):a={...ne,getPublicPath:o()},g){let e=f(g.path,g.name);a.ssrRemoteEntry=e,a.ssrRemoteEntryType=g.type||`commonjs-module`}return a}function ee(e){return!!(`remoteEntry`in e&&e.remoteEntry.includes(`.json`))}var h=`[ Module Federation ]`,g=console,te=[`logger.ts`,`logger.js`,`captureStackTrace`,`Logger.emit`,`Logger.log`,`Logger.info`,`Logger.warn`,`Logger.error`,`Logger.debug`];function ne(){try{let e=Error().stack;if(!e)return;let[,...t]=e.split(`
|
|
2
|
+
`),n=t.filter(e=>!te.some(t=>e.includes(t)));return n.length?`Stack trace:\n${n.slice(0,5).join(`
|
|
3
|
+
`)}`:void 0}catch{return}}var re=class{constructor(e,t=g){this.prefix=e,this.delegate=t??g}setPrefix(e){this.prefix=e}setDelegate(e){this.delegate=e??g}emit(e,t){let n=this.delegate,r=o()?ne():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=g[e];if(typeof t==`function`){t.call(g,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){o()&&this.emit(`debug`,e)}};function ie(e){return new re(e)}function ae(e){let t=new re(e);return Object.defineProperty(t,"__mf_infrastructure_logger__",{value:!0,enumerable:!1,configurable:!1}),t}ie(h),ae(h);async function oe(e,t){try{return await e()}catch(e){!t&&u(e);return}}function se(e,t){let n=/^(https?:)?\/\//i;return e.replace(n,``).replace(/\/$/,``)===t.replace(n,``).replace(/\/$/,``)}function ce(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&&se(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&&se(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,oe(()=>{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 le(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&&se(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,oe(()=>{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 ue(e,t){let{attrs:n={},createScriptHook:r}=t;return new Promise((t,i)=>{let{script:a,needAttach:o}=ce({url:e,cb:t,onErrorCallback:i,attrs:{fetchpriority:`high`,...n},createScriptHook:r,needDeleteScript:!0});o&&document.head.appendChild(a)})}var de=e=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split(`-`)[0].toLowerCase()}#${e.toLowerCase()}`,fe=(e,t,n,r)=>{let i=[`${[t[e]]} #${e}`];return n&&i.push(`args: ${JSON.stringify(n)}`),i.push(de(e)),r&&i.push(`Original Error Message:\n ${r}`),i.join(`
|
|
4
|
+
`)};function pe(e,t,n,r,i,a){return r(fe(e,t,n,i))}var _=`[ Federation Runtime ]`,me=ie(_);function v(e,t,n,r,i){e||(n===void 0?y(t):y(t,n,r,void 0,i))}function y(e,t,n,r,i){if(t!==void 0)return pe(e,t,n??{},e=>{throw Error(`${_}: ${e}`)},r,i);let a=e;throw a instanceof Error?(a.message.startsWith(_)||(a.message=`${_}: ${a.message}`),a):Error(`${_}: ${a}`)}function b(e){e instanceof Error&&(e.message.startsWith(_)||(e.message=`${_}: ${e.message}`)),me.warn(e)}function he(e,t){return e.findIndex(e=>e===t)===-1&&e.push(t),e}function x(e){return`version`in e&&e.version?`${e.name}:${e.version}`:`entry`in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function ge(e){return e.entry!==void 0}function _e(e){return!e.entry.includes(`.json`)}function ve(e){return e&&typeof e==`object`}var ye=Object.prototype.toString;function be(e){return ye.call(e)===`[object Object]`}function xe(e){return Array.isArray(e)?e:[e]}function Se(e){return`remoteEntry`in e?{url:e.remoteEntry,type:e.remoteEntryType,globalName:e.globalName}:{url:``,type:`global`,globalName:``}}var Ce=(e,t)=>{let n;return n=e.endsWith(`/`)?e.slice(0,-1):e,t.startsWith(`.`)&&(t=t.slice(1)),n+=t,n},we=2e3,S=typeof globalThis==`object`?globalThis:window,C=(()=>{try{return document.defaultView}catch{return S}})(),Te=C;function Ee(e,t,n){Object.defineProperty(e,t,{value:n,configurable:!1,writable:!0})}function De(e,t){return Object.hasOwnProperty.call(e,t)}De(S,`__GLOBAL_LOADING_REMOTE_ENTRY__`)||Ee(S,`__GLOBAL_LOADING_REMOTE_ENTRY__`,{});var w=S.__GLOBAL_LOADING_REMOTE_ENTRY__;function Oe(e){De(e,`__VMOK__`)&&!De(e,`__FEDERATION__`)&&Ee(e,`__FEDERATION__`,e.__VMOK__),De(e,`__FEDERATION__`)||(Ee(e,`__FEDERATION__`,{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map,__PRELOADED_ASSETS__:new Set}),Ee(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}Oe(S),Oe(C);function ke(e){S.__FEDERATION__.__INSTANCES__.push(e)}function Ae(){return S.__FEDERATION__.__DEBUG_CONSTRUCTOR__}function je(e,t=o()){t&&(S.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,S.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__=`2.9.3`)}function T(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}}}y(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`)}var Me=()=>C.__FEDERATION__.moduleInfo,Ne=(e,t)=>{let n=T(t,x(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=x(n),i=T(C.__FEDERATION__.moduleInfo,r).value;if(i?.version===t)return i}},E=e=>Ne(e,C.__FEDERATION__.moduleInfo),Pe=(e,t)=>{let n=x(e);return C.__FEDERATION__.moduleInfo[n]=t,C.__FEDERATION__.moduleInfo},Fe=e=>(C.__FEDERATION__.moduleInfo={...C.__FEDERATION__.moduleInfo,...e},()=>{let t=Object.keys(e);for(let e of t)delete C.__FEDERATION__.moduleInfo[e]}),Ie=(e,t)=>{let n=t||`__FEDERATION_${e}:custom__`;return{remoteEntryKey:n,entryExports:S[n]}},Le=()=>C.__FEDERATION__.__GLOBAL_PLUGIN__,Re=e=>S.__FEDERATION__.__PRELOADED_MAP__.get(e),ze=e=>S.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),Be=e=>S.__FEDERATION__.__PRELOADED_ASSETS__.has(e),Ve=e=>{let t=S.__FEDERATION__.__PRELOADED_ASSETS__;if(t.add(e),t.size>we){let e=t.values().next().value;e!==void 0&&t.delete(e)}},He=`[0-9A-Za-z-]+`,Ue=`(?:\\+(${He}(?:\\.${He})*))`,D=`0|[1-9]\\d*`,O=`[0-9]+`,We=`\\d*[a-zA-Z-][a-zA-Z0-9-]*`,Ge=`(?:${O}|${We})`,Ke=`(?:-?(${Ge}(?:\\.${Ge})*))`,qe=`(?:${D}|${We})`,Je=`(?:-(${qe}(?:\\.${qe})*))`,Ye=`${D}|x|X|\\*`,k=`[v=\\s]*(${Ye})(?:\\.(${Ye})(?:\\.(${Ye})(?:${Je})?${Ue}?)?)?`,Xe=`^\\s*(${k})\\s+-\\s+(${k})\\s*$`,Ze=`[v=\\s]*${`(${O})\\.(${O})\\.(${O})`}${Ke}?${Ue}?`,Qe=`((?:<|>)?=?)`,$e=`(\\s*)${Qe}\\s*(${Ze}|${k})`,et=`(?:~>?)`,tt=`(\\s*)${et}\\s+`,nt=`(?:\\^)`,rt=`(\\s*)${nt}\\s+`,it=`(<|>)?=?\\s*\\*`,at=`^${nt}${k}$`,ot=`v?${`(${D})\\.(${D})\\.(${D})`}${Je}?${Ue}?`,st=`^${et}${k}$`,ct=`^${Qe}\\s*${k}$`,lt=`^${Qe}\\s*(${ot})$|^$`,ut=`^\\s*>=\\s*0.0.0\\s*$`;function A(e){return new RegExp(e)}function j(e){return!e||e.toLowerCase()===`x`||e===`*`}function dt(...e){return t=>e.reduce((e,t)=>t(e),t)}function ft(e){return e.match(A(lt))}function pt(e,t,n,r){let i=`${e}.${t}.${n}`;return r?`${i}-${r}`:i}function mt(e){return e.replace(A(Xe),(e,t,n,r,i,a,o,s,c,l,u,d)=>(t=j(n)?``:j(r)?`>=${n}.0.0`:j(i)?`>=${n}.${r}.0`:`>=${t}`,s=j(c)?``:j(l)?`<${Number(c)+1}.0.0-0`:j(u)?`<${c}.${Number(l)+1}.0-0`:d?`<=${c}.${l}.${u}-${d}`:`<=${s}`,`${t} ${s}`.trim()))}function ht(e){return e.replace(A($e),`$1$2$3`)}function gt(e){return e.replace(A(tt),`$1~`)}function _t(e){return e.replace(A(rt),`$1^`)}function vt(e){return e.trim().split(/\s+/).map(e=>e.replace(A(at),(e,t,n,r,i)=>j(t)?``:j(n)?`>=${t}.0.0 <${Number(t)+1}.0.0-0`:j(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 yt(e){return e.trim().split(/\s+/).map(e=>e.replace(A(st),(e,t,n,r,i)=>j(t)?``:j(n)?`>=${t}.0.0 <${Number(t)+1}.0.0-0`:j(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 bt(e){return e.split(/\s+/).map(e=>e.trim().replace(A(ct),(e,t,n,r,i,a)=>{let o=j(n),s=o||j(r),c=s||j(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 xt(e){return e.trim().replace(A(it),``)}function St(e){return e.trim().replace(A(ut),``)}function M(e,t){return e=Number(e)||e,t=Number(t)||t,e>t?1:e===t?0:-1}function Ct(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?M(t,i):-1:1}return 0}function wt(e,t){return M(e.major,t.major)||M(e.minor,t.minor)||M(e.patch,t.patch)||Ct(e,t)}function Tt(e,t){return e.version===t.version}function Et(e,t){switch(e.operator){case``:case`=`:return Tt(e,t);case`>`:return wt(e,t)<0;case`>=`:return Tt(e,t)||wt(e,t)<0;case`<`:return wt(e,t)>0;case`<=`:return Tt(e,t)||wt(e,t)>0;case void 0:return!0;default:return!1}}function Dt(e){return dt(vt,yt,bt,xt)(e)}function Ot(e){return dt(mt,ht,gt,_t)(e.trim()).split(/\s+/).join(` `)}function N(e,t){if(!e)return!1;let n=ft(e);if(!n)return!1;let[,r,,i,a,o,s]=n,c={operator:r,version:pt(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=Ot(t);if(!e.trim())return!0;let n=e.split(` `).map(e=>Dt(e)).join(` `);if(!n.trim())return!0;let r=n.split(/\s+/).map(e=>St(e)).filter(Boolean);if(r.length===0)continue;let i=!0;for(let e of r){let t=ft(e);if(!t){i=!1;break}let[,n,,r,a,o,s]=t;if(!Et({operator:n,version:pt(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 kt=`default`,At=`global`;function jt(e,t,r,i){let a;return a=`get`in e?e.get:`lib`in e?()=>Promise.resolve(e.lib):()=>Promise.resolve(()=>{y(`Cannot get shared "${r}" from "${t}": neither "get" nor "lib" is provided in the share config.`)}),e.shareConfig?.eager&&e.treeShaking?.mode&&y(`Invalid shared config for "${r}" from "${t}": cannot use both "eager: true" and "treeShaking.mode" simultaneously. Choose one strategy.`),{deps:[],useIn:[],from:t,loading:null,...e,shareConfig:{requiredVersion:`^${e.version}`,singleton:!1,eager:!1,strictVersion:!1,...e.shareConfig},get: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??i)||`version-first`,treeShaking:e.treeShaking?{...e.treeShaking,mode:e.treeShaking.mode??`server-calc`,status:e.treeShaking.status??n.UNKNOWN,useIn:[]}:void 0}}function Mt(e,t){let n=t.shared||{},r=t.name,i=Object.keys(n).reduce((e,i)=>{let a=xe(n[i]);return e[i]=e[i]||[],a.forEach(n=>{e[i].push(jt(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 P(e,t){if(!e)return!1;let{status:r,mode:i}=e;return r===n.NO_USE?!1:r===n.CALCULATED?!0:i===`runtime-infer`?!t||Pt(e,t):!1}function F(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!!N(n(e),`<=${n(t)}`)}var I=(e,t)=>{let n=t||function(e,t){return F(e,t)};return Object.keys(e).reduce((e,t)=>!e||n(e,t)||e===`0`?t:e,0)},L=e=>!!e.loaded||typeof e.lib==`function`,Nt=e=>!!e.loading,Pt=(e,t)=>{if(!e||!t)return!1;let{usedExports:n}=e;return n?!!t.every(e=>n.includes(e)):!1};function Ft(e,t,n,r){let i=e[t][n],a=``,o=P(r),s=function(e,t){return o?i[e].treeShaking?i[t].treeShaking?!L(i[e].treeShaking)&&F(e,t):!1:!0:!L(i[e])&&F(e,t)};if(o){if(a=I(e[t][n],s),a)return{version:a,useTreesShaking:o};o=!1}return{version:I(e[t][n],s),useTreesShaking:o}}var R=e=>L(e)||Nt(e);function It(e,t,n,r){let i=e[t][n],a=``,o=P(r),s=function(e,t){if(o){if(!i[e].treeShaking)return!0;if(!i[t].treeShaking)return!1;if(R(i[t].treeShaking))return!R(i[e].treeShaking)||!!F(e,t);if(R(i[e].treeShaking))return!1}return R(i[t])?!R(i[e])||!!F(e,t):!R(i[e])&&F(e,t)};if(o){if(a=I(e[t][n],s),a)return{version:a,useTreesShaking:o};o=!1}return{version:I(e[t][n],s),useTreesShaking:o}}function Lt(e){return e===`loaded-first`?It:Ft}function z(e,t,n,r,i){if(!e)return;let{shareConfig:a,scope:o=kt,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}=Lt(s)(e,o,t,c),f={shareScopeMap:e,scope:o,pkgName:t,version:u,GlobalFederation:Te.__FEDERATION__,shareInfo:n,resolver:()=>{let r=e[o][t][u];if(a.singleton){if(typeof l==`string`&&!N(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?y(e):b(e)}return{shared:r,useTreesShaking:d}}{if(l===!1||l===`*`||N(u,l))return{shared:r,useTreesShaking:d};let n=P(c);if(n){for(let[r,i]of Object.entries(e[o][t]))if(P(i.treeShaking,c?.usedExports)&&N(r,l))return{shared:i,useTreesShaking:n}}for(let[n,r]of Object.entries(e[o][t]))if(N(n,l))return{shared:r,useTreesShaking:!1}}},loadContext:i};return(r.emit(f)||f).resolver()}}function Rt(){return Te.__FEDERATION__.__SHARE__}function zt(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[I(t,function(e,n){return!L(t[e])&&F(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 B=(e,t)=>{e.useIn||=[],he(e.useIn,t)};function V(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`,H={[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.`};({...H,...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:e,remoteEntryExports:t,name:n,getEntryUrl:r}){return new Promise((i,a)=>{let o=e=>{if(pn(e)){let t=e instanceof Error?e.message:String(e);try{y(Xt,H,{remoteName:n,resourceUrl:s},t)}catch(e){a(e);return}}a(e)},s=r?r(e):e;try{t?i(t):typeof FEDERATION_ALLOW_NEW_FUNCTION<`u`?Function(`callbacks`,`import("${s}")${un}`)([i,o]):import(s).then(i).catch(o)}catch(e){y(`Failed to load ESM entry from "${s}". ${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){y(`Failed to load SystemJS entry from "${e}". ${t instanceof Error?t.message:String(t)}`)}})}function _n(e,t,n){let{remoteEntryKey:r,entryExports:i}=Ie(e,t);return i||y(Ut,H,{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}=Ie(e,t);if(s)return s;let c=a?a(n):n;return ue(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);y(Xt,H,{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 c(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(!w[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:w,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});w[s]=l,l.then(void 0,()=>{w[s]===l&&delete w[s]}),dn.set(l,t)}let c=w[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 U(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||[],...Le()].forEach(e=>{e&&(v(be(e),`Plugin configuration is invalid.`),v(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 W(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 v(n,`Unable to preload ${t.nameOrAlias} as it is not included in ${!n&&d({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 G(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?Be(t)?Promise.resolve(G(e,t,`cached`)):(Ve(t),r()):r()}async function Mn(e,t,n,r){let i=e.moduleCache.get(n.name),a=n.entry;if(i?.remoteEntryExports)return G(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 G(r,a,`success`)}catch(e){return G(r,a,An(e)?`timeout`:`error`,e)}}function K({host:e,remoteInfo:t,url:n,attrs:r,context:i,needDeleteLink:a}){return new Promise(o=>{let{link:s,needAttach:c}=le({url:n,cb:()=>{o(G(i,n,c?`success`:`cached`))},onErrorCallback:e=>{o(G(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 Nn({host:e,remoteInfo:t,url:n,attrs:r,context:i}){return new Promise(a=>{let{script:o,needAttach:s}=ce({url:n,cb:()=>{a(G(i,n,s?`success`:`cached`))},onErrorCallback:e=>{a(G(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 q(e,t){return{...e,resourceType:t}}function Pn(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,q(i,`remoteEntry`)))}),r){let n={rel:`preload`,as:`style`};o.forEach(r=>{let o=q(i,`css`);l.push(jn(o,r,a,()=>K({host:t,remoteInfo:e,url:r,attrs:n,context:o})))})}else{let n={rel:`stylesheet`,type:`text/css`};o.forEach(r=>{let o=q(i,`css`);l.push(jn(o,r,a,()=>K({host:t,remoteInfo:e,url:r,attrs:n,needDeleteLink:!1,context:o})))})}let n=Nn,u={fetchpriority:`high`,type:`text/javascript`};r?(n=K,u={rel:`preload`,as:`script`}):mn(e.type)&&(n=K,u={rel:`modulepreload`,fetchpriority:`high`}),s.forEach(r=>{let o=q(i,`js`);l.push(jn(o,r,a,()=>n({host:t,remoteInfo:e,url:r,attrs:u,context:o})))})}return Promise.all(l)}function Fn(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 In(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 Ln=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 v(r,`remoteEntryExports is undefined \n ${d(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}=In(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&&y(Wt,H,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName},void 0,W(this.host.options));try{await a.init(s.shareScope,s.initScope,s.remoteEntryInitOptions)}catch(e){y(rn,H,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName,shareScope:this.remoteInfo.shareScope},`${e}`,W(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||y(nn,H,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,expose:t,requestId:e,availableExposes:Fn(r)},void 0,W(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=Ce(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){v(be(e),`Plugin configuration is invalid.`);let t=e.name;v(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){v(e,`A name is required.`);let t=this.registerPlugins[e];v(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 Rn(e,t){if(!ve(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=y,this.type=e}emit(e){ve(e)||y(`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(Rn(e,n))e=n;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(e){b(e),this.onerror(e)}return e}},Q=class extends Y{constructor(e){super(),this.onerror=y,this.type=e}emit(e){ve(e)||y(`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=>(b(t),this.onerror(t),e),i=a=>{if(a!==void 0&&Rn(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.`,zn=class{constructor(){this.hooks=new J({})}formatAndRegisterRemote(){return[]}loadRemote(){throw Error($)}preloadRemote(){throw Error($)}registerRemotes(){throw Error($)}getRemoteModuleAndOptions(){throw Error($)}initRawContainer(){throw Error($)}};function Bn(e,t){let n=Se(t);n.url||y($t,H,{remoteName:e.name});let r=l(t,n.url);e.type=n.type,e.entryGlobalName=n.globalName,e.entry=r,e.version=t.version,e.buildVersion=t.buildVersion}function Vn(){return{name:`snapshot-plugin`,async afterResolve(e){let{remote:t,pkgNameOrAlias:n,expose:r,origin:i,remoteInfo:a,id:o}=e;if(!ge(t)||!_e(t)){let{remoteSnapshot:s,globalSnapshot:c}=await i.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:t,id:Bt(t.name,r)});Bn(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&&Pn(a,i,n,!1,{initiator:`loadRemote`,id:o},u.recordPreloadedAssets).catch(()=>void 0)}return{...e,remoteSnapshot:s}}return e}}}function Hn(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 Un(e,t,n,r,i={},a){let{value:o}=T(e,x(t)),s=a||o;if(s&&!ee(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=Hn(r),a=s.remotesInfo[r];Un(e,{name:t.name,version:a.matchedVersion},n,!1,i,void 0)}}}var Wn=(e,t)=>document.querySelector(`${e}[${e===`link`?`href`:`src`}="${t}"]`);function Gn(e,t,n,r,i){let a=[],o=[],s=[],c=new Set,u=new Set,{options:d}=e,{preloadConfig:f}=t,{depsRemote:p}=f;if(Un(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=l(t,Se(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 u=`modules`in t?t.modules:[],d=kn(i.exposes);d.length&&`modules`in t&&(u=t?.modules?.reduce((e,t)=>(d?.indexOf(t.moduleName)!==-1&&e.push(t),e),[]));function m(e){let n=e.map(e=>l(t,e));return i.filter?n.filter(i.filter):n}if(u){let r=u.length;for(let s=0;s<r;s++){let r=u[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}),Re(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))),ze(c))}}},!0,{},i),i.shared&&i.shared.length>0){let t=(t,n)=>{let{shared:r}=z(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=>{u.add(e)}))};i.shared.forEach(e=>{let n=d.shared?.[e.sharedName];if(!n)return;let r=e.version?n.find(t=>t.version===e.version):n;r&&xe(r).forEach(n=>{t(n,e)})})}let m=o.filter(e=>!c.has(e)&&!Wn(`script`,e));return{cssAssets:a.filter(e=>!u.has(e)&&!Wn(`link`,e)),jsAssetsWithoutEntry:m,entryAssets:s.filter(e=>!Wn(`script`,e.url))}}var Kn=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 ge(i)&&_e(i)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:i.name,url:i.entry,moduleInfo:{name:r.name,entry:i.entry,type:r.type||`global`,entryGlobalName:``,shareScope:``}}]}:(Bn(r,o),Gn(t,n,r,a,o))}}};function qn(e,t){let n=E({name:t.name,version:t.options.version}),r=n&&`remotesInfo`in n&&n.remotesInfo&&T(n.remotesInfo,e.name).value;return r&&r.matchedVersion?{hostGlobalSnapshot:n,globalSnapshot:Me(),remoteSnapshot:E({name:e.name,version:r.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:Me(),remoteSnapshot:E({name:e.name,version:`version`in e?e.version:void 0})}}var Jn=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=Te.__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=E({name:this.HostInstance.options.name,version:this.HostInstance.options.version});i||(i={version:this.HostInstance.options.version||``,remoteEntry:``,remotesInfo:{}},Fe({[this.HostInstance.options.name]:i})),i&&`remotesInfo`in i&&!T(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(ee(c)){let r=c.remoteEntry,i=await this.loadManifestSnapshot(r,e,{},{initiator:n,id:t||e.name}),a=Pe({...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(ge(e)){let r=await this.loadManifestSnapshot(e.entry,e,{},{initiator:n,id:t||e.name}),i=Pe(e,r);u=r,d=i}else y(Yt,H,{remoteName:e.name,remoteVersion:e.version,hostName:this.HostInstance.options.name,globalSnapshot:JSON.stringify(l)},void 0,W(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 qn(e,this.HostInstance)}async getManifestJson(e,t,n,r){return(async()=>{let n=U(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}),y(Gt,H,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name},`${c}`,W(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&&y(tn,H,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name,missingFields:c.join(`,`)},void 0,W(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=m(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]}},Yn=class{constructor(){this.hooks=new J({})}},Xn=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){b(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){b(e)}}registerShared(e,t){let{newShareInfos:n,allShareInfos:r}=Mt(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=zt({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,v(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}=z(this.shareScopeMap,e,a,this.hooks.lifecycle.resolveShare,r)||{};if(c){let t=V(c,l);if(t.lib)return B(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,B(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 B(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=P(s.treeShaking),a=V(s,i),o=(async()=>{let t=await a.get();a.lib=t,a.loaded=!0,B(a,n.options.name);let{shared:i,useTreesShaking:o}=z(this.shareScopeMap,e,s,this.hooks.lifecycle.resolveShare,r)||{};if(i){let e=V(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=kt,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&&V(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=zt({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}=z(this.shareScopeMap,e,i,this.hooks.lifecycle.resolveShare,r)||{};if(a){if(typeof a.lib==`function`)return B(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 B(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&&y(t?.from===`build`?qt:Jt,H,{hostName:n.options.name,sharedPkgName:e},void 0,W(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}y(Jt,H,{hostName:n.options.name,sharedPkgName:e},void 0,W(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=Rt(),n=e.id||e.name;n&&!t[n]&&(t[n]=this.shareScopeMap)}},Zn=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}},Qn=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?U(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=U(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=U(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 Pn(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 Ln({host:r,remoteInfo:U({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{y(Kt,H,{hostName:t.options.name,requestId:i},void 0,W(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=U(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;v(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 Ln(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)));v(!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||=kt,e.type||=At};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}),u(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=T(S.__FEDERATION__.moduleInfo,x(e)).key;delete S.__FEDERATION__.moduleInfo[i],`entry`in e&&(t.snapshotHandler.manifestCache.delete(e.entry),delete Te.__FEDERATION__.__MANIFEST_LOADING__[e.entry]);let{hostGlobalSnapshot:a}=qn(e,t);if(a){let t=a&&`remotesInfo`in a&&a.remotesInfo&&T(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;S[r]&&(Object.getOwnPropertyDescriptor(S,r)?.configurable?delete S[r]:S[r]=void 0);let i=bn(o.remoteInfo);w[i]&&delete w[i];let a=n.buildVersion?c(n.name,n.buildVersion):n.name,s=S.__FEDERATION__.__INSTANCES__.findIndex(e=>n.buildVersion?e.options.id===a:e.name===a);if(s!==-1){let e=S.__FEDERATION__.__INSTANCES__[s];a=e.options.id||a;let t=Rt(),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]}),S.__FEDERATION__.__INSTANCES__.splice(s,1)}t.moduleCache.delete(e.name)}}catch(e){me.error(`removeRemote failed: ${e instanceof Error?e.message:String(e)}`)}}},$n=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN!=`boolean`||!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN,er=typeof FEDERATION_OPTIMIZE_NO_REMOTE!=`boolean`||!FEDERATION_OPTIMIZE_NO_REMOTE,tr=typeof FEDERATION_OPTIMIZE_NO_SHARED!=`boolean`||!FEDERATION_OPTIMIZE_NO_SHARED,nr=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.3`,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=er&&$n?[Vn(),Kn()]:[],n={id:Sn(),name:e.name,plugins:t,remotes:[],shared:{},inBrowser:!0};this.name=e.name,this.options=n,this.snapshotHandler=er?new Jn(this):new Yn,this.sharedHandler=tr?new Xn(this):new Zn,this.remoteHandler=er?new Qn(this):new zn,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&&y(fe(Qt,H)),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=kt,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=tr?Mt(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 rr(){return typeof FEDERATION_BUILD_IDENTIFIER<`u`?FEDERATION_BUILD_IDENTIFIER:``}function ir(e,t){let n=rr();return S.__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 ar(e){let t=new((Ae())||nr)({id:`${e.name}@${e.version||Date.now()}`,...e});return ke(t),t}var or=null;function sr(e){let t=ir(e.name,e.version),n={...e,id:e.id||``};return t?(t.initOptions(n),or||=t,t):(or=ar(n),or)}je(nr);export{sr as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./vite-preload-helper-DygEbaNj.js";var t=`__mf_module_cache__`;globalThis[t]||={share:{},remote:{}},globalThis[t].share||={},globalThis[t].remote||={};var n=globalThis[t];for(let e of Object.keys(n.share))if(e.startsWith(`default:`)){let t=e.slice(8);n.share[t]===void 0&&(n.share[t]=n.share[e])}else if(!e.includes(`:`)){let t=`default:`+e;n.share[t]===void 0&&(n.share[t]=n.share[e])}var r;async function i(){return r||=(async()=>{let t=function(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},r=(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}},i=Symbol.for(`module-federation.shared-cache-listeners`),a=Symbol.for(`module-federation.shared-cache-owners`),o=e=>{let t=e[a];return t===void 0&&(t=Object.create(null),Object.defineProperty(e,a,{value:t,enumerable:!1,configurable:!1,writable:!1})),t},s=(e,t)=>e[a]?.[t.canonical],c=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}}},l=(e,t)=>{if(e===t)return!0;let n=c(e),r=c(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},u=(e,t,n,s)=>{let c=r(e,t);if(c!==void 0&&l(c,n))return n;e[t.canonical]=n;let u=t.aliases||[];for(let t of u)Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0});let d=e[a];s===void 0?d&&delete d[t.canonical]:o(e)[t.canonical]=s;let f=e[i]?.[t.canonical];if(f)for(let e of f)e(n);return n},d=await(await e(()=>import(`../remoteEntry.js`),[])).init(),{usedShared:f}=await e(async()=>{let{usedShared:e}=await import(`./_virtual_mf-localSharedImportMap___mfe_internal___signalk_app_dock__mf_owner__1-GfsGDlYi.js`);return{usedShared:e}},[]),p=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},m=(e,t)=>__mfGetShareScopeNames(t).some(n=>Object.keys(d.shareScopeMap?.[n]?.[e]||{}).some(e=>e!==t.version)),h=[];{let e=new Set(h.flat()),t=Object.keys(f).filter(t=>!e.has(t));t.length&&h.push(t)}let g=n.pinnedShareOwners||=new Set,_=n.hostShareInit,v;n.hostShareInit=new Promise(e=>{v=e}),await _;try{for(let e of h)await Promise.all(e.map(async e=>{let i=f[e];if(!i||i.materialize===!1&&!i.lazy||i.treeShaking)return;let a=t(e,i.shareConfig?.singleton,i.version,i.scope),o=()=>{if(!i.shareConfig?.singleton||r(n.share,a)===void 0)return!1;let e=s(n.share,a);return e===void 0?!1:e===`_signalk_app_dock`?g.has(e):!(d.options?.remotes||[]).some(t=>t.name===e)&&(g.add(e),!0)};if(!o()&&(r(n.share,a)===void 0||m(e,i)||!i.shareConfig?.singleton&&s(n.share,a)!==`_signalk_app_dock`)){if(i.shareConfig?.import===!1){let t=__mfGetShareScopeNames(i),n=t=>!__mfHasUsableProvider(d.shareScopeMap?.[t]?.[e],e,i,t);if(t.some(n)){d.__mfKeepAdoptedProviders||(d.__mfKeepAdoptedProviders=!0,d.sharedHandler?.hooks?.lifecycle?.afterRegisterShare?.on?.(e=>{let{shared:t,previousShared:n,registeredShared:r}=e||{},i=d.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))}));for(let r of globalThis.__FEDERATION__?.__INSTANCES__||[])for(let a of t){let t=r?.shareScopeMap?.[a]?.[e];if(!__mfHasUsableProvider(t,e,i,a)||!n(a))continue;let o=(d.shareScopeMap[a]||={})[e]||={};for(let[e,n]of Object.entries(t))n?.shareConfig?.import!==!1&&(o[e]&&o[e].shareConfig?.import!==!1||(o[e]=n))}}if(t.every(n))return}await d.loadShare(e,{customShareInfo:{shareConfig:i.shareConfig}}).then(async e=>{if(e===!1||o())return;let t=typeof e==`function`?e():e,r=p(await Promise.resolve(t));u(n.share,a,r,`_signalk_app_dock`)})}}))}finally{v()}for(let[e,r]of Object.entries(f)){if(!r.lib||r.treeShaking||r.shareConfig?.import===!1)continue;let i=t(e,r.shareConfig?.singleton,r.version,r.scope);if(s(n.share,i)===`_signalk_app_dock`)for(let t of Array.isArray(r.scope)?r.scope:[r.scope||`default`]){let n=d.shareScopeMap?.[t]?.[e],i=n?.[r.version];i&&i.get===r.get&&!i.lib&&(Object.values(n).some(e=>e!==i&&(e?.lib||e?.loaded))||(i.lib=r.lib,i.loaded=!0))}}return d})(),r}r=i();export{r as hostInitPromise,i as initHost};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./vite-preload-helper-DygEbaNj.js";var t=`__mf_module_cache__`;globalThis[t]||={share:{},remote:{}},globalThis[t].share||={},globalThis[t].remote||={};var n=globalThis[t];for(let e of Object.keys(n.share))if(e.startsWith(`default:`)){let t=e.slice(8);n.share[t]===void 0&&(n.share[t]=n.share[e])}else if(!e.includes(`:`)){let t=`default:`+e;n.share[t]===void 0&&(n.share[t]=n.share[e])}var r=function(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},i=(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}},a=[];async function o(){if(a.length===0)return;let t=`react-dom/client`,{usedShared:o}=await e(async()=>{let{usedShared:e}=await import(`./_virtual_mf-localSharedImportMap___mfe_internal___signalk_app_dock__mf_owner__1-GfsGDlYi.js`);return{usedShared:e}},[]);await Promise.all(a.map(async([e,a])=>{let s=o[e],c=s??(e===t?o[`react-dom`]:void 0);if(!c||c.treeShaking||c.shareConfig?.import===!1||s&&s.materialize===!1&&e!==t)return;let l=r(e,c.shareConfig?.singleton,c.version,c.scope);i(n.share,l)===void 0&&await a().catch(t=>console.warn(`[module-federation] shared preload failed:`,e,t))}))}export{o as preloadPendingShares};
|
package/public/configpanel/{vite-preload-helper-DHhhL8Zf.js → vite-preload-helper-DygEbaNj.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=(function(){let e=typeof document<`u`&&document.createElement(`link`).relList;return e&&e.supports&&e.supports(`modulepreload`)?`modulepreload`:`preload`})(),t=function(e){return new URL("..\u002F"+e,import.meta.url).href},n={},r=function(e){return e.pathname.endsWith(`.css`)},i=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},a=function(a,o,s){let c=Promise.resolve();if(o&&o.length>0){let a,l=document.querySelector(`meta[property=csp-nonce]`),u=l?.nonce||l?.getAttribute(`nonce`);function d(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function f(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}c=d(o.map(o=>{o=t(o,s);let c=f(o),l=r(c);return i(n,c.href,()=>{if(a===void 0){a={all:new Set,styles:new Set};let e=document.getElementsByTagName(`link`);for(let t=e.length-1;t>=0;t--){let n=e[t];a.all.add(n.href),n.rel===`stylesheet`&&a.styles.add(n.href)}}if((l?a.styles:a.all).has(c.href))return;let t=document.createElement(`link`);if(t.rel=l?`stylesheet`:e,l||(t.as=`script`),t.crossOrigin=``,t.href=c.href,u&&t.setAttribute(`nonce`,u),document.head.appendChild(t),l)return new Promise((e,n)=>{t.
|
|
1
|
+
var e=(function(){let e=typeof document<`u`&&document.createElement(`link`).relList;return e&&e.supports&&e.supports(`modulepreload`)?`modulepreload`:`preload`})(),t=function(e){return new URL("..\u002F"+e,import.meta.url).href},n={},r=function(e){return e.pathname.endsWith(`.css`)},i=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},a=function(a,o,s){let c=Promise.resolve();if(o&&o.length>0){let a,l=document.querySelector(`meta[property=csp-nonce]`),u=l?.nonce||l?.getAttribute(`nonce`);function d(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function f(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}c=d(o.map(o=>{o=t(o,s);let c=f(o),l=r(c);return i(n,c.href,()=>{if(a===void 0){a={all:new Set,styles:new Set};let e=document.getElementsByTagName(`link`);for(let t=e.length-1;t>=0;t--){let n=e[t];a.all.add(n.href),n.rel===`stylesheet`&&a.styles.add(n.href)}}if((l?a.styles:a.all).has(c.href))return;let t=document.createElement(`link`);if(t.rel=l?`stylesheet`:e,l||(t.as=`script`),t.crossOrigin=``,t.href=c.href,u&&t.setAttribute(`nonce`,u),document.head.appendChild(t),l)return new Promise((e,n)=>{let r=i=>{t.removeEventListener(`load`,r),t.removeEventListener(`error`,r),i.type===`error`?n(Error(`Unable to preload CSS for ${c}`)):e(i)};t.addEventListener(`load`,r),t.addEventListener(`error`,r)})})}).filter(e=>e!==void 0))}function l(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return c.then(e=>{for(let t of e||[])t.status===`rejected`&&l(t.reason);return a().catch(l)})};export{a as t};
|
package/public/dock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=(e,t)=>`<svg class="dock-svg-icon dock-svg-${e}" width="100%" height="100%" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${t}</svg>`,t={sun:e(`sun`,`<circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/>`),moon:e(`moon`,`<path d="M20.5 14A9 9 0 1 1 10 3.5a7.5 7.5 0 0 0 10.5 10.5z"/>`),fullscreen:e(`fullscreen`,`<path d="M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5"/>`),exitFullscreen:e(`exit-fullscreen`,`<path d="M9 4v5H4M20 9h-5V4M15 20v-5h5M4 15h5v5"/>`),close:e(`close`,`<path d="M6 6l12 12M18 6L6 18"/>`)};function n(e){let t=document.getElementById(e);if(!t)throw Error(`[Dock] #${e} is missing from index.html`);return t}function r(e){return typeof e==`number`&&Number.isFinite(e)}(async function(){if(window.self!==window.top){let e=window.location.href;try{window.top?.location.replace(e)}catch{}document.body.innerHTML=`<div style="display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;height:100vh;color:#fff;background:#000;font-family:-apple-system,BlinkMacSystemFont,sans-serif;text-align:center;padding:16px"><img src="app-icon.svg" alt="App Dock" style="width:72px;height:72px;border-radius:16px;opacity:0.85" /><a href="`+e+`" target="_top" style="color:#fff;text-decoration:underline;font-size:16px">Open App Dock</a></div>`;return}let e={position:`bottom`,iframeMode:`destroy`,iconSize:56,magnification:!0,magnificationScale:1.7,showNightModeButton:!0,showFullscreenButton:!1,showExitButton:!1,apps:[]},i={showNightModeButton:!0,apps:[{enabled:!0,autostart:!0,url:`/@signalk/freeboard-sk/`,label:`Freeboard-SK`,icon:`/@signalk/freeboard-sk/assets/icons/icon-72x72.png`,color:``},{enabled:!0,autostart:!1,url:`/@halos-org/skip/`,label:`Skip`,icon:`/@halos-org/skip/assets/icon-72x72.png`,color:``},{enabled:!0,autostart:!1,url:`/admin/`,label:`Settings`,icon:`/@signalk/app-dock/icon-settings.svg`,color:`#78788c`}]},a=!1,o=!0;for(let e of[`/skServer/loginStatus`,`/loginStatus`])try{let t=await fetch(e);if(t.ok){let e=await t.json(),n=e.authenticationRequired===!1,r=e.status===`loggedIn`?e.userLevel:void 0;a=!n&&r!==`admin`,o=n||r===`admin`||r===`readwrite`;break}}catch{}async function s(){try{let t=await fetch(`/plugins/signalk-app-dock/settings`);if(!t.ok)return null;let n=await t.json();return Array.isArray(n.apps)?{...e,...n}:null}catch{return null}}let c={...e},l=!a;if(a){let t=await s();l=t!==null,c=t||{...e,...i}}else try{let[t,n]=await Promise.all([fetch(`/plugins/signalk-app-dock/config`),fetch(`/plugins/signalk-app-dock/settings`)]);if(t.ok){let n=await t.json(),r=n.configuration||n;c={...e,...r}}if(n.ok){let e=await n.json();Array.isArray(e.apps)&&e.apps.length>0&&(c.apps=e.apps)}}catch(e){console.warn(`[Dock] Could not load config, using defaults.`,e)}(!Array.isArray(c.apps)||c.apps.length===0)&&console.warn(`[Dock] No apps configured — open Plugin Config to add webapps.`);let u=n(`iframe-container`),d=n(`dock-backdrop`),f=n(`dock`),p=n(`dock-inner`),ee=n(`loading-overlay`),te=n(`loading-label`),ne=document.getElementById(`idle-hint`),m=n(`idle-hint-text`),h=n(`dock-handle`),g=!1,_={},v=`day`,y=l&&o;async function b(){if(l)try{let e=await fetch(`/plugins/signalk-app-dock/mode`);e.ok&&(v=(await e.json()).value||`day`,x())}catch(e){console.warn(`[Dock] Could not fetch environment.mode`,e)}}function x(){let e=document.querySelector(`.dock-item-nightmode .dock-icon`);if(!e)return;e.innerHTML=t[v===`night`?`moon`:`sun`];let n=document.querySelector(`.dock-item-nightmode .dock-label`);n&&(n.textContent=v===`night`?`Day mode`:`Night mode`)}async function re(){if(!y)return;await b();let e=v===`night`?`day`:`night`;try{(await fetch(`/signalk/v1/api/vessels/self/environment/mode`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({value:e})})).ok&&(v=e,x())}catch(e){console.warn(`[Dock] Failed to toggle mode`,e)}}function S(){return!!(document.fullscreenEnabled&&document.documentElement.requestFullscreen)}function C(){return!!document.fullscreenElement}function ie(){S()&&(C()?document.exitFullscreen().catch(e=>console.warn(`[Dock] exitFullscreen`,e)):document.documentElement.requestFullscreen().catch(e=>console.warn(`[Dock] requestFullscreen`,e)))}function ae(){let e=document.querySelector(`.dock-item-fullscreen .dock-icon`);if(!e)return;e.innerHTML=t[C()?`exitFullscreen`:`fullscreen`];let n=document.querySelector(`.dock-item-fullscreen .dock-label`);n&&(n.textContent=C()?`Exit fullscreen`:`Fullscreen`)}let w=c.position;f.classList.add(`pos-${w}`),p.classList.add(`align-${w}`),h.classList.add(`pos-${w}`);let T=w===`left`||w===`right`;T&&p.classList.add(`layout-vertical`);let oe=c.magnification!==!1,se=Math.max(1,Math.min(c.magnificationScale||1.7,2.5)),ce=c.iconSize*3.5;function le(){let e=document.getElementById(`idle-version`);e&&fetch(`/skServer/webapps`).then(e=>e.json()).then(t=>{let n=t.find(e=>e.name===`@signalk/app-dock`);n&&(e.textContent=`v`+n.version)}).catch(()=>{}),!c.apps||c.apps.length===0?a?m.innerHTML=`App Dock can only be customised by an administrator.<br>Ask an admin to set up apps in <strong>Plugin Config</strong>.`:m.innerHTML=`No apps configured yet.<br>Open <strong>Admin UI → Plugin Config → App Dock</strong><br>and click <strong>Discover Installed Webapps</strong> to get started.`:m.innerHTML=`Double-tap <strong>anywhere</strong> to open the dock`+(a?`<br><br><span style="font-size:12px;opacity:0.6">Customisation is admin-only</span>`:`<br><br><span style="font-size:12px;opacity:0.6">Configure in Admin UI → Plugin Config → App Dock</span>`)}function ue(){ne&&ne.classList.add(`hidden`)}function de(){switch(w){case`top`:return`dock-label-below`;case`left`:return`dock-label-right`;case`right`:return`dock-label-left`;default:return``}}function E(e,n,r,i){let a=c.iconSize,o=Math.round(a*.25)+`px`,s=de(),l=document.createElement(`div`);l.className=`dock-item dock-item-utility `+e;let u=document.createElement(`div`);u.className=`dock-icon dock-icon-utility`,u.style.width=a+`px`,u.style.height=a+`px`,u.style.borderRadius=o,u.innerHTML=t[n];let d=document.createElement(`div`);d.className=`dock-dot`;let f=document.createElement(`div`);return f.className=`dock-label`+(s?` `+s:``),f.textContent=r,l.appendChild(u),l.appendChild(d),l.appendChild(f),l.addEventListener(`touchstart`,()=>l.classList.add(`pressing`),{passive:!0}),l.addEventListener(`touchend`,()=>l.classList.remove(`pressing`),{passive:!0}),l.addEventListener(`touchcancel`,()=>l.classList.remove(`pressing`),{passive:!0}),l.addEventListener(`click`,e=>{O?e.preventDefault():i()}),l}function fe(){let e=document.createElement(`div`);return e.className=`dock-separator`,e}function pe(){p.innerHTML=``;let e=c.iconSize,t=Math.round(e*.25)+`px`,n=de(),r=c.showNightModeButton&&y;r&&p.appendChild(E(`dock-item-nightmode`,`sun`,`Night mode`,()=>void re())),c.showFullscreenButton&&S()&&p.appendChild(E(`dock-item-fullscreen`,`fullscreen`,`Fullscreen`,ie)),(r||c.showFullscreenButton&&S())&&p.appendChild(fe()),c.apps.forEach((r,i)=>{let a=document.createElement(`div`);a.className=`dock-item`,a.dataset.index=String(i);let o=document.createElement(`div`);o.className=`dock-icon`,o.style.width=e+`px`,o.style.height=e+`px`,o.style.borderRadius=t,r.color&&(o.style.background=r.color);let s=r.icon||``;if(s.startsWith(`/`)||s.startsWith(`http`)){let t=document.createElement(`img`);t.src=s,t.alt=r.label,t.onerror=()=>{o.removeChild(t),o.style.fontSize=Math.round(e*.42)+`px`,o.textContent=r.label.slice(0,2).toUpperCase()},o.appendChild(t)}else o.style.fontSize=Math.round(e*.48)+`px`,o.textContent=s||r.label.slice(0,2).toUpperCase();let c=document.createElement(`div`);c.className=`dock-dot`;let l=document.createElement(`div`);l.className=`dock-label`+(n?` `+n:``),l.textContent=r.label,a.appendChild(o),a.appendChild(c),a.appendChild(l),a.addEventListener(`touchstart`,()=>a.classList.add(`pressing`),{passive:!0}),a.addEventListener(`touchend`,()=>a.classList.remove(`pressing`),{passive:!0}),a.addEventListener(`touchcancel`,()=>a.classList.remove(`pressing`),{passive:!0}),a.addEventListener(`click`,e=>{O?e.preventDefault():I(i)}),p.appendChild(a)}),c.showExitButton&&(p.appendChild(fe()),p.appendChild(E(`dock-item-exit`,`close`,`Exit to Admin`,()=>{window.location.href=`/admin/`}))),c.showNightModeButton&&x(),c.showFullscreenButton&&S()&&ae()}let D=!1,O=!1,me=0;function he(e){let t=p.querySelectorAll(`.dock-item`),n=-1,r=1/0;t.forEach((t,i)=>{let a=t.querySelector(`.dock-icon`);if(!a)return;let o=t.getBoundingClientRect(),s=T?o.top+o.height/2:o.left+o.width/2,l=T?e.y:e.x,u=Math.abs(l-s);u<r&&(r=u,n=i);let d=Math.min(u/ce,1),f=1+(se-1)*(1-d*d),p=Math.round(c.iconSize*f);a.classList.remove(`settling`),a.style.width=p+`px`,a.style.height=p+`px`,a.style.borderRadius=Math.round(p*.25)+`px`,a.querySelector(`img`)||(a.style.fontSize=Math.round(p*.48)+`px`)}),t.forEach((e,t)=>{e.classList.toggle(`mag-closest`,t===n)})}function k(){let e=p.querySelectorAll(`.dock-item`),t=c.iconSize;e.forEach(e=>{let n=e.querySelector(`.dock-icon`);n&&(n.classList.add(`settling`),n.style.width=t+`px`,n.style.height=t+`px`,n.style.borderRadius=Math.round(t*.25)+`px`,n.querySelector(`img`)||(n.style.fontSize=Math.round(t*.48)+`px`),e.classList.remove(`mag-closest`))})}oe&&(p.addEventListener(`mousemove`,e=>{if(D)return;D=!0;let t={x:e.clientX,y:e.clientY};requestAnimationFrame(()=>{he(t),D=!1})}),p.addEventListener(`mouseleave`,()=>{D=!1,k()}),p.addEventListener(`touchstart`,e=>{let t=e.touches[0];O=!1,me=T?t.clientY:t.clientX},{passive:!0}),p.addEventListener(`touchmove`,e=>{let t=e.touches[0],n=T?t.clientY:t.clientX;if(Math.abs(n-me)>10&&(O=!0),D)return;D=!0;let r={x:t.clientX,y:t.clientY};requestAnimationFrame(()=>{he(r),D=!1})},{passive:!0}),p.addEventListener(`touchend`,()=>{D=!1,k(),setTimeout(()=>{O=!1},50)},{passive:!0}));let A=0;function j(){g||(g=!0,A=Date.now(),f.classList.add(`visible`),d.classList.add(`visible`),Y())}function M(){g&&(X&&X.classList.contains(`visible`)||(g=!1,f.classList.remove(`visible`),d.classList.remove(`visible`),k(),Y()))}d.addEventListener(`click`,e=>{Date.now()-A<500?e.stopPropagation():M()});function N(e){te.textContent=`Loading ${e}\u2026`,ee.classList.add(`visible`)}function P(){ee.classList.remove(`visible`)}let F=`allow-same-origin allow-scripts allow-forms allow-popups allow-pointer-lock allow-top-navigation-by-user-activation`;function ge(e){try{let t=new URL(e.url,window.location.href);return t.origin===window.location.origin&&/^\/admin(\/|$)/.test(t.pathname)}catch{return!1}}function _e(e,t){N(t.label),e.addEventListener(`load`,P,{once:!0});try{e.contentWindow?.location.reload()}catch{e.src=t.url}}function I(e){let t=c.apps[e];if(!t)return;ue(),document.querySelectorAll(`.dock-item`).forEach(t=>{t.classList.toggle(`active`,t.dataset.index===String(e))});let n=ge(t),r=!n&&!!_[t.url];if(r&&c.iframeMode!==`destroy`&&_[t.url].classList.contains(`active`))_e(_[t.url],t),Y(),M();else{if(c.iframeMode===`destroy`?(u.innerHTML=``,Object.keys(_).forEach(e=>delete _[e])):Object.values(_).forEach(e=>e.classList.remove(`active`)),n&&_[t.url]&&(_[t.url].remove(),delete _[t.url]),!_[t.url]){r||N(t.label);let e=document.createElement(`iframe`);e.allow=`fullscreen; geolocation`,e.setAttribute(`sandbox`,F),e.style.touchAction=`auto`,e.addEventListener(`load`,P,{once:!0}),u.appendChild(e),e.src=t.url,_[t.url]=e}_[t.url].classList.add(`active`),Y(),M()}}let L=0,R=0,z=0,B=null;function V(){return performance.timeOrigin+performance.now()}function ve(e,t){let n=e.defaultView&&e.defaultView.performance;return n?n.timeOrigin+t.timeStamp:V()}function ye(){if(H&&console.log(`[Dock] triggerDock called, dockVisible=`,g),!g){if(j(),H){let e=f.getBoundingClientRect();console.log(`[Dock] after showDock: dock rect`,e,`classes`,f.className)}navigator.vibrate&&navigator.vibrate(8)}}let H=new URLSearchParams(location.search).has(`debugDock`);function U(e,t,n=null,r=V()){if(g)return;let i=e-R,a=t-z,o=Math.round(Math.sqrt(i*i+a*a)),s=o<=60&&n===B,c=r-L,l=c>=0&&c<600&&s;H&&console.log(`[Dock] tap`,{x:Math.round(e),y:Math.round(t),gap:c,dist:o,close:s,match:l}),l?(L=0,ye()):(L=r,R=e,z=t,B=n)}let be=new WeakSet;function xe(e,t){if(be.has(e))return;be.add(e);let n=()=>{if(!t)return{x:0,y:0};let e=t.getBoundingClientRect();return{x:e.left,y:e.top}},r=-1/0,i=(e,t,n)=>{Math.abs(n-r)<50||(r=n,U(e,t,null,n))};e.addEventListener(`pointerdown`,t=>{let r=n();i(t.clientX+r.x,t.clientY+r.y,ve(e,t))},{passive:!0,capture:!0}),e.addEventListener(`touchstart`,t=>{if(!t.touches||t.touches.length===0)return;let r=t.touches[0],a=n();i(r.clientX+a.x,r.clientY+a.y,ve(e,t))},{passive:!0,capture:!0})}let W=new WeakSet;function G(e){let t=()=>{let t=null;try{t=e.contentDocument}catch{}let n=we(e);n&&Te(n,e,t!==null),t&&!W.has(t)&&(W.add(t),xe(t,e),Se(t))};e.addEventListener(`load`,t),t()}function Se(e){e.querySelectorAll(`iframe`).forEach(e=>G(e));let t=e.documentElement||e.body||e;new MutationObserver(e=>{for(let t of e)t.addedNodes.forEach(e=>{if(!e||e.nodeType!==Node.ELEMENT_NODE)return;let t=e;t.tagName===`IFRAME`&&G(t),t.querySelectorAll(`iframe`).forEach(e=>G(e))}),t.removedNodes.length>0&&Y()}).observe(t,{childList:!0,subtree:!0})}let K=new WeakMap,q=new WeakSet,Ce=-1/0;function we(e){let t=e;for(;t&&t.parentElement!==u;){let e=t.ownerDocument&&t.ownerDocument.defaultView;t=e?e.frameElement:null}return t}function Te(e,t,n){q.delete(t);let r=K.get(e);(t===e||!r)&&(r=new Set,K.set(e,r)),n?r.delete(t):r.add(t),Y()}function J(e){let t=e&&K.get(e)||new Set;for(let e of t)(!e.isConnected||!e.ownerDocument.defaultView)&&t.delete(e);return t}function Y(){let e=u.querySelector(`iframe.active`),t=!1;if(!g)for(let n of J(e))q.has(n)||(t=!0);h.classList.toggle(`visible`,t)}function Ee(e){let t=0,n=0;for(let r=e;r;){let e=r.getBoundingClientRect();if(t+=e.left,n+=e.top,r.parentElement===u)break;let i=r.ownerDocument.defaultView;r=i?i.frameElement:null}return{x:t,y:n}}function De(e,t){for(let n=e;n;n=n.parent){if(n===t)return!0;if(n===n.parent)return!1}return!1}window.addEventListener(`message`,e=>{let t=e.data;if(!t||t.type!==`signalk-app-dock:pointerdown`||!r(t.x)||!r(t.y))return;let n=u.querySelector(`iframe.active`);if(!n||!e.source)return;let i=null;for(let t of J(n))De(e.source,t.contentWindow)&&(i=t);if(!i)return;e.source===i.contentWindow&&(q.add(i),Y());let a=V(),o=r(t.t)&&t.t<=a?t.t:a;if(!(Math.abs(o-Ce)<50)){if(Ce=o,e.source===i.contentWindow){let e=Ee(i);U(t.x+e.x,t.y+e.y,null,o)}else U(t.x,t.y,e.source,o)}}),h.addEventListener(`click`,ye),xe(document,null),W.add(document),Se(document),pe(),c.showNightModeButton&&y&&(b(),setInterval(b,5e3)),c.showFullscreenButton&&S()&&document.addEventListener(`fullscreenchange`,ae);let Oe=[`position`,`iframeMode`,`iconSize`,`magnification`,`magnificationScale`,`showNightModeButton`,`showFullscreenButton`,`showExitButton`];async function ke(){try{let t=c,n=c;if(a)n=await s()||t;else{let[r,i]=await Promise.all([fetch(`/plugins/signalk-app-dock/config`),fetch(`/plugins/signalk-app-dock/settings`)]);if(r.ok){let i=await r.json(),a=i.configuration||i;n={...e,...a,apps:t.apps}}if(i.ok){let e=await i.json();Array.isArray(e.apps)&&e.apps.length>0&&(n={...n,apps:e.apps})}}if(Oe.some(e=>t[e]!==n[e])){window.location.reload();return}JSON.stringify(n.apps)===JSON.stringify(t.apps)?c=n:(c=n,pe())}catch{}}l&&setInterval(ke,5e3);let X=document.getElementById(`tour-overlay`),Ae=document.getElementById(`tour-btn-got-it`),Z=document.getElementById(`tour-btn-dismiss`);function Q(){X?.classList.remove(`visible`),M()}function je(){X?.classList.add(`visible`),j()}Ae&&Ae.addEventListener(`click`,Q),!l||!o?(Z&&Z.remove(),document.getElementById(`tour-buttons`)?.style.setProperty(`justify-content`,`center`)):Z&&Z.addEventListener(`click`,()=>{Q(),fetch(`/plugins/signalk-app-dock/dismiss-tour`,{method:`POST`}).catch(()=>{})});let $=document.getElementById(`tour-link`);$&&(a?$.replaceWith(document.createTextNode(`Plugin Config (admin only)`)):$.addEventListener(`click`,e=>{e.preventDefault();let t=`/admin/#/serverConfiguration/plugins/signalk-app-dock`;ue();let n=document.createElement(`iframe`);n.allow=`fullscreen; geolocation`,n.setAttribute(`sandbox`,F),n.style.touchAction=`auto`,n.classList.add(`active`),u.innerHTML=``,Object.keys(_).forEach(e=>delete _[e]),u.appendChild(n),n.src=t,_[t]=n,Q()})),c.tourDismissed||je();let Me=c.apps.findIndex(e=>e.autostart);Me>=0?I(Me):le()})().catch(e=>console.error(`[Dock] failed to start`,e));
|
|
1
|
+
var e=(e,t)=>`<svg class="dock-svg-icon dock-svg-${e}" width="100%" height="100%" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${t}</svg>`,t={sun:e(`sun`,`<circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/>`),moon:e(`moon`,`<path d="M20.5 14A9 9 0 1 1 10 3.5a7.5 7.5 0 0 0 10.5 10.5z"/>`),fullscreen:e(`fullscreen`,`<path d="M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5"/>`),exitFullscreen:e(`exit-fullscreen`,`<path d="M9 4v5H4M20 9h-5V4M15 20v-5h5M4 15h5v5"/>`),close:e(`close`,`<path d="M6 6l12 12M18 6L6 18"/>`)};function n(e){let t=document.getElementById(e);if(!t)throw Error(`[Dock] #${e} is missing from index.html`);return t}function r(e){return typeof e==`number`&&Number.isFinite(e)}(async function(){if(window.self!==window.top){let e=window.location.href;try{window.top?.location.replace(e)}catch{}document.body.innerHTML=`<div style="display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;height:100vh;color:#fff;background:#000;font-family:-apple-system,BlinkMacSystemFont,sans-serif;text-align:center;padding:16px"><img src="app-icon.svg" alt="App Dock" style="width:72px;height:72px;border-radius:16px;opacity:0.85" /><a href="`+e+`" target="_top" style="color:#fff;text-decoration:underline;font-size:16px">Open App Dock</a></div>`;return}let e={position:`bottom`,iframeMode:`destroy`,iconSize:56,magnification:!0,magnificationScale:1.7,showNightModeButton:!0,showFullscreenButton:!1,showExitButton:!1,apps:[]},i={showNightModeButton:!0,apps:[{enabled:!0,autostart:!0,url:`/@signalk/freeboard-sk/`,label:`Freeboard-SK`,icon:`/@signalk/freeboard-sk/assets/icons/icon-72x72.png`,color:``},{enabled:!0,autostart:!1,url:`/@halos-org/skip/`,label:`Skip`,icon:`/@halos-org/skip/assets/icon-72x72.png`,color:``},{enabled:!0,autostart:!1,url:`/admin/#/webapps`,label:`More`,icon:`/@signalk/app-dock/icon-more.svg`,color:`#78788c`}]},a=!1,o=!0;for(let e of[`/skServer/loginStatus`,`/loginStatus`])try{let t=await fetch(e);if(t.ok){let e=await t.json(),n=e.authenticationRequired===!1,r=e.status===`loggedIn`?e.userLevel:void 0;a=!n&&r!==`admin`,o=n||r===`admin`||r===`readwrite`;break}}catch{}async function s(){try{let t=await fetch(`/plugins/signalk-app-dock/settings`);if(!t.ok)return null;let n=await t.json();return Array.isArray(n.apps)?{...e,...n}:null}catch{return null}}let c={...e},l=!a;if(a){let t=await s();l=t!==null,c=t||{...e,...i}}else try{let[t,n]=await Promise.all([fetch(`/plugins/signalk-app-dock/config`),fetch(`/plugins/signalk-app-dock/settings`)]);if(t.ok){let n=await t.json(),r=n.configuration||n;c={...e,...r}}if(n.ok){let e=await n.json();Array.isArray(e.apps)&&e.apps.length>0&&(c.apps=e.apps)}}catch(e){console.warn(`[Dock] Could not load config, using defaults.`,e)}Array.isArray(c.apps)&&c.apps.length!==0||console.warn(`[Dock] No apps configured — open Plugin Config to add webapps.`);let u=n(`iframe-container`),d=n(`dock-backdrop`),f=n(`dock`),p=n(`dock-inner`),ee=n(`loading-overlay`),te=n(`loading-label`),ne=document.getElementById(`idle-hint`),m=n(`idle-hint-text`),h=n(`dock-handle`),g=!1,_={},v=`day`,y=l&&o;async function b(){if(l)try{let e=await fetch(`/plugins/signalk-app-dock/mode`);e.ok&&(v=(await e.json()).value||`day`,x())}catch(e){console.warn(`[Dock] Could not fetch environment.mode`,e)}}function x(){let e=document.querySelector(`.dock-item-nightmode .dock-icon`);if(!e)return;e.innerHTML=t[v===`night`?`moon`:`sun`];let n=document.querySelector(`.dock-item-nightmode .dock-label`);n&&(n.textContent=v===`night`?`Day mode`:`Night mode`)}async function re(){if(!y)return;await b();let e=v===`night`?`day`:`night`;try{(await fetch(`/signalk/v1/api/vessels/self/environment/mode`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({value:e})})).ok&&(v=e,x())}catch(e){console.warn(`[Dock] Failed to toggle mode`,e)}}function S(){return!!(document.fullscreenEnabled&&document.documentElement.requestFullscreen)}function C(){return!!document.fullscreenElement}function ie(){S()&&(C()?document.exitFullscreen().catch(e=>console.warn(`[Dock] exitFullscreen`,e)):document.documentElement.requestFullscreen().catch(e=>console.warn(`[Dock] requestFullscreen`,e)))}function ae(){let e=document.querySelector(`.dock-item-fullscreen .dock-icon`);if(!e)return;e.innerHTML=t[C()?`exitFullscreen`:`fullscreen`];let n=document.querySelector(`.dock-item-fullscreen .dock-label`);n&&(n.textContent=C()?`Exit fullscreen`:`Fullscreen`)}let w=c.position;f.classList.add(`pos-${w}`),p.classList.add(`align-${w}`),h.classList.add(`pos-${w}`);let T=w===`left`||w===`right`;T&&p.classList.add(`layout-vertical`);let oe=c.magnification!==!1,se=Math.max(1,Math.min(c.magnificationScale||1.7,2.5)),ce=c.iconSize*3.5;function le(){let e=document.getElementById(`idle-version`);e&&fetch(`/skServer/webapps`).then(e=>e.json()).then(t=>{let n=t.find(e=>e.name===`@signalk/app-dock`);n&&(e.textContent=`v`+n.version)}).catch(()=>{}),!c.apps||c.apps.length===0?a?m.innerHTML=`App Dock can only be customised by an administrator.<br>Ask an admin to set up apps in <strong>Plugin Config</strong>.`:m.innerHTML=`No apps configured yet.<br>Open <strong>Admin UI → Plugin Config → App Dock</strong><br>and click <strong>Discover Installed Webapps</strong> to get started.`:m.innerHTML=`Double-tap <strong>anywhere</strong> to open the dock`+(a?`<br><br><span style="font-size:12px;opacity:0.6">Customisation is admin-only</span>`:`<br><br><span style="font-size:12px;opacity:0.6">Configure in Admin UI → Plugin Config → App Dock</span>`)}function ue(){ne&&ne.classList.add(`hidden`)}function de(){switch(w){case`top`:return`dock-label-below`;case`left`:return`dock-label-right`;case`right`:return`dock-label-left`;default:return``}}function E(e,n,r,i){let a=c.iconSize,o=Math.round(a*.25)+`px`,s=de(),l=document.createElement(`div`);l.className=`dock-item dock-item-utility `+e;let u=document.createElement(`div`);u.className=`dock-icon dock-icon-utility`,u.style.width=a+`px`,u.style.height=a+`px`,u.style.borderRadius=o,u.innerHTML=t[n];let d=document.createElement(`div`);d.className=`dock-dot`;let f=document.createElement(`div`);return f.className=`dock-label`+(s?` `+s:``),f.textContent=r,l.appendChild(u),l.appendChild(d),l.appendChild(f),l.addEventListener(`touchstart`,()=>l.classList.add(`pressing`),{passive:!0}),l.addEventListener(`touchend`,()=>l.classList.remove(`pressing`),{passive:!0}),l.addEventListener(`touchcancel`,()=>l.classList.remove(`pressing`),{passive:!0}),l.addEventListener(`click`,e=>{O?e.preventDefault():i()}),l}function fe(){let e=document.createElement(`div`);return e.className=`dock-separator`,e}function pe(){p.innerHTML=``;let e=c.iconSize,t=Math.round(e*.25)+`px`,n=de(),r=c.showNightModeButton&&y;r&&p.appendChild(E(`dock-item-nightmode`,`sun`,`Night mode`,()=>void re())),c.showFullscreenButton&&S()&&p.appendChild(E(`dock-item-fullscreen`,`fullscreen`,`Fullscreen`,ie)),(r||c.showFullscreenButton&&S())&&p.appendChild(fe()),c.apps.forEach((r,i)=>{let a=document.createElement(`div`);a.className=`dock-item`,a.dataset.index=String(i);let o=document.createElement(`div`);o.className=`dock-icon`,o.style.width=e+`px`,o.style.height=e+`px`,o.style.borderRadius=t,r.color&&(o.style.background=r.color);let s=r.icon||``;if(s.startsWith(`/`)||s.startsWith(`http`)){let t=document.createElement(`img`);t.src=s,t.alt=r.label,t.onerror=()=>{o.removeChild(t),o.style.fontSize=Math.round(e*.42)+`px`,o.textContent=r.label.slice(0,2).toUpperCase()},o.appendChild(t)}else o.style.fontSize=Math.round(e*.48)+`px`,o.textContent=s||r.label.slice(0,2).toUpperCase();let c=document.createElement(`div`);c.className=`dock-dot`;let l=document.createElement(`div`);l.className=`dock-label`+(n?` `+n:``),l.textContent=r.label,a.appendChild(o),a.appendChild(c),a.appendChild(l),a.addEventListener(`touchstart`,()=>a.classList.add(`pressing`),{passive:!0}),a.addEventListener(`touchend`,()=>a.classList.remove(`pressing`),{passive:!0}),a.addEventListener(`touchcancel`,()=>a.classList.remove(`pressing`),{passive:!0}),a.addEventListener(`click`,e=>{O?e.preventDefault():I(i)}),p.appendChild(a)}),c.showExitButton&&(p.appendChild(fe()),p.appendChild(E(`dock-item-exit`,`close`,`Exit to Admin`,()=>{window.location.href=`/admin/`}))),c.showNightModeButton&&x(),c.showFullscreenButton&&S()&&ae()}let D=!1,O=!1,me=0;function he(e){let t=p.querySelectorAll(`.dock-item`),n=-1,r=1/0;t.forEach((t,i)=>{let a=t.querySelector(`.dock-icon`);if(!a)return;let o=t.getBoundingClientRect(),s=T?o.top+o.height/2:o.left+o.width/2,l=T?e.y:e.x,u=Math.abs(l-s);u<r&&(r=u,n=i);let d=Math.min(u/ce,1),f=1+(se-1)*(1-d*d),p=Math.round(c.iconSize*f);a.classList.remove(`settling`),a.style.width=p+`px`,a.style.height=p+`px`,a.style.borderRadius=Math.round(p*.25)+`px`,a.querySelector(`img`)||(a.style.fontSize=Math.round(p*.48)+`px`)}),t.forEach((e,t)=>{e.classList.toggle(`mag-closest`,t===n)})}function k(){let e=p.querySelectorAll(`.dock-item`),t=c.iconSize;e.forEach(e=>{let n=e.querySelector(`.dock-icon`);n&&(n.classList.add(`settling`),n.style.width=t+`px`,n.style.height=t+`px`,n.style.borderRadius=Math.round(t*.25)+`px`,n.querySelector(`img`)||(n.style.fontSize=Math.round(t*.48)+`px`),e.classList.remove(`mag-closest`))})}oe&&(p.addEventListener(`mousemove`,e=>{if(D)return;D=!0;let t={x:e.clientX,y:e.clientY};requestAnimationFrame(()=>{he(t),D=!1})}),p.addEventListener(`mouseleave`,()=>{D=!1,k()}),p.addEventListener(`touchstart`,e=>{let t=e.touches[0];O=!1,me=T?t.clientY:t.clientX},{passive:!0}),p.addEventListener(`touchmove`,e=>{let t=e.touches[0],n=T?t.clientY:t.clientX;if(Math.abs(n-me)>10&&(O=!0),D)return;D=!0;let r={x:t.clientX,y:t.clientY};requestAnimationFrame(()=>{he(r),D=!1})},{passive:!0}),p.addEventListener(`touchend`,()=>{D=!1,k(),setTimeout(()=>{O=!1},50)},{passive:!0}));let A=0;function j(){g||(g=!0,A=Date.now(),f.classList.add(`visible`),d.classList.add(`visible`),Y())}function M(){g&&(X&&X.classList.contains(`visible`)||(g=!1,f.classList.remove(`visible`),d.classList.remove(`visible`),k(),Y()))}d.addEventListener(`click`,e=>{Date.now()-A<500?e.stopPropagation():M()});function N(e){te.textContent=`Loading ${e}\u2026`,ee.classList.add(`visible`)}function P(){ee.classList.remove(`visible`)}let F=`allow-same-origin allow-scripts allow-forms allow-popups allow-pointer-lock allow-top-navigation-by-user-activation`;function ge(e){try{let t=new URL(e.url,window.location.href);return t.origin===window.location.origin&&/^\/admin(\/|$)/.test(t.pathname)}catch{return!1}}function _e(e,t){N(t.label),e.addEventListener(`load`,P,{once:!0});try{e.contentWindow?.location.reload()}catch{e.src=t.url}}function I(e){let t=c.apps[e];if(!t)return;ue(),document.querySelectorAll(`.dock-item`).forEach(t=>{t.classList.toggle(`active`,t.dataset.index===String(e))});let n=ge(t),r=!n&&!!_[t.url];if(r&&c.iframeMode!==`destroy`&&_[t.url].classList.contains(`active`))_e(_[t.url],t),Y(),M();else{if(c.iframeMode===`destroy`?(u.innerHTML=``,Object.keys(_).forEach(e=>delete _[e])):Object.values(_).forEach(e=>e.classList.remove(`active`)),n&&_[t.url]&&(_[t.url].remove(),delete _[t.url]),!_[t.url]){r||N(t.label);let e=document.createElement(`iframe`);e.allow=`fullscreen; geolocation`,e.setAttribute(`sandbox`,F),e.style.touchAction=`auto`,e.addEventListener(`load`,P,{once:!0}),u.appendChild(e),e.src=t.url,_[t.url]=e}_[t.url].classList.add(`active`),Y(),M()}}let L=0,R=0,z=0,B=null;function V(){return performance.timeOrigin+performance.now()}function ve(e,t){let n=e.defaultView&&e.defaultView.performance;return n?n.timeOrigin+t.timeStamp:V()}function ye(){if(H&&console.log(`[Dock] triggerDock called, dockVisible=`,g),!g){if(j(),H){let e=f.getBoundingClientRect();console.log(`[Dock] after showDock: dock rect`,e,`classes`,f.className)}navigator.vibrate&&navigator.vibrate(8)}}let H=new URLSearchParams(location.search).has(`debugDock`);function U(e,t,n=null,r=V()){if(g)return;let i=e-R,a=t-z,o=Math.round(Math.sqrt(i*i+a*a)),s=o<=40&&n===B,c=r-L,l=c>=0&&c<450&&s;H&&console.log(`[Dock] tap`,{x:Math.round(e),y:Math.round(t),gap:c,dist:o,close:s,match:l}),l?(L=0,ye()):(L=r,R=e,z=t,B=n)}let be=new WeakSet;function xe(e,t){if(be.has(e))return;be.add(e);let n=()=>{if(!t)return{x:0,y:0};let e=t.getBoundingClientRect();return{x:e.left,y:e.top}},r=-1/0,i=(e,t,n)=>{Math.abs(n-r)<50||(r=n,U(e,t,null,n))};e.addEventListener(`pointerdown`,t=>{let r=n();i(t.clientX+r.x,t.clientY+r.y,ve(e,t))},{passive:!0,capture:!0}),e.addEventListener(`touchstart`,t=>{if(!t.touches||t.touches.length===0)return;let r=t.touches[0],a=n();i(r.clientX+a.x,r.clientY+a.y,ve(e,t))},{passive:!0,capture:!0})}let W=new WeakSet;function G(e){let t=()=>{let t=null;try{t=e.contentDocument}catch{}let n=we(e);n&&Te(n,e,t!==null),t&&!W.has(t)&&(W.add(t),xe(t,e),Se(t))};e.addEventListener(`load`,t),t()}function Se(e){e.querySelectorAll(`iframe`).forEach(e=>G(e));let t=e.documentElement||e.body||e;new MutationObserver(e=>{for(let t of e)t.addedNodes.forEach(e=>{if(!e||e.nodeType!==Node.ELEMENT_NODE)return;let t=e;t.tagName===`IFRAME`&&G(t),t.querySelectorAll(`iframe`).forEach(e=>G(e))}),t.removedNodes.length>0&&Y()}).observe(t,{childList:!0,subtree:!0})}let K=new WeakMap,q=new WeakSet,Ce=-1/0;function we(e){let t=e;for(;t&&t.parentElement!==u;){let e=t.ownerDocument&&t.ownerDocument.defaultView;t=e?e.frameElement:null}return t}function Te(e,t,n){q.delete(t);let r=K.get(e);t!==e&&r||(r=new Set,K.set(e,r)),n?r.delete(t):r.add(t),Y()}function J(e){let t=e&&K.get(e)||new Set;for(let e of t)e.isConnected&&e.ownerDocument.defaultView||t.delete(e);return t}function Y(){let e=u.querySelector(`iframe.active`),t=!1;if(!g)for(let n of J(e))q.has(n)||(t=!0);h.classList.toggle(`visible`,t)}function Ee(e){let t=0,n=0;for(let r=e;r;){let e=r.getBoundingClientRect();if(t+=e.left,n+=e.top,r.parentElement===u)break;let i=r.ownerDocument.defaultView;r=i?i.frameElement:null}return{x:t,y:n}}function De(e,t){for(let n=e;n;n=n.parent){if(n===t)return!0;if(n===n.parent)return!1}return!1}window.addEventListener(`message`,e=>{let t=e.data;if(!t||t.type!==`signalk-app-dock:pointerdown`||!r(t.x)||!r(t.y))return;let n=u.querySelector(`iframe.active`);if(!n||!e.source)return;let i=null;for(let t of J(n))De(e.source,t.contentWindow)&&(i=t);if(!i)return;e.source===i.contentWindow&&(q.add(i),Y());let a=V(),o=r(t.t)&&t.t<=a?t.t:a;if(!(Math.abs(o-Ce)<50)){if(Ce=o,e.source===i.contentWindow){let e=Ee(i);U(t.x+e.x,t.y+e.y,null,o)}else U(t.x,t.y,e.source,o)}}),h.addEventListener(`click`,ye),xe(document,null),W.add(document),Se(document),pe(),c.showNightModeButton&&y&&(b(),setInterval(b,5e3)),c.showFullscreenButton&&S()&&document.addEventListener(`fullscreenchange`,ae);let Oe=[`position`,`iframeMode`,`iconSize`,`magnification`,`magnificationScale`,`showNightModeButton`,`showFullscreenButton`,`showExitButton`];async function ke(){try{let t=c,n=c;if(a)n=await s()||t;else{let[r,i]=await Promise.all([fetch(`/plugins/signalk-app-dock/config`),fetch(`/plugins/signalk-app-dock/settings`)]);if(r.ok){let i=await r.json(),a=i.configuration||i;n={...e,...a,apps:t.apps}}if(i.ok){let e=await i.json();Array.isArray(e.apps)&&e.apps.length>0&&(n={...n,apps:e.apps})}}if(Oe.some(e=>t[e]!==n[e])){window.location.reload();return}JSON.stringify(n.apps)===JSON.stringify(t.apps)?c=n:(c=n,pe())}catch{}}l&&setInterval(ke,5e3);let X=document.getElementById(`tour-overlay`),Ae=document.getElementById(`tour-btn-got-it`),Z=document.getElementById(`tour-btn-dismiss`);function Q(){X?.classList.remove(`visible`),M()}function je(){X?.classList.add(`visible`),j()}Ae&&Ae.addEventListener(`click`,Q),!l||!o?(Z&&Z.remove(),document.getElementById(`tour-buttons`)?.style.setProperty(`justify-content`,`center`)):Z&&Z.addEventListener(`click`,()=>{Q(),fetch(`/plugins/signalk-app-dock/dismiss-tour`,{method:`POST`}).catch(()=>{})});let $=document.getElementById(`tour-link`);$&&(a?$.replaceWith(document.createTextNode(`Plugin Config (admin only)`)):$.addEventListener(`click`,e=>{e.preventDefault();let t=`/admin/#/serverConfiguration/plugins/signalk-app-dock`;ue();let n=document.createElement(`iframe`);n.allow=`fullscreen; geolocation`,n.setAttribute(`sandbox`,F),n.style.touchAction=`auto`,n.classList.add(`active`),u.innerHTML=``,Object.keys(_).forEach(e=>delete _[e]),u.appendChild(n),n.src=t,_[t]=n,Q()})),c.tourDismissed||je();let Me=c.apps.findIndex(e=>e.autostart);Me>=0?I(Me):le()})().catch(e=>console.error(`[Dock] failed to start`,e));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 72 72" width="72" height="72">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="bg" x1="0" y1="0" x2="0" y2="1">
|
|
4
|
+
<stop offset="0%" stop-color="#8e8e93"/>
|
|
5
|
+
<stop offset="100%" stop-color="#636366"/>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
</defs>
|
|
8
|
+
<rect width="72" height="72" rx="16" fill="url(#bg)"/>
|
|
9
|
+
<g fill="#e5e5ea">
|
|
10
|
+
<circle cx="20" cy="36" r="5.5"/>
|
|
11
|
+
<circle cx="36" cy="36" r="5.5"/>
|
|
12
|
+
<circle cx="52" cy="36" r="5.5"/>
|
|
13
|
+
</g>
|
|
14
|
+
</svg>
|
package/public/index.html
CHANGED
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
<strong>Double-tap anywhere</strong> on the screen to open the dock, then tap an icon to launch that app.
|
|
58
58
|
</p>
|
|
59
59
|
<p>
|
|
60
|
-
Freeboard-SK is loading in the background and Skip is one tap away.
|
|
61
|
-
more in
|
|
60
|
+
Freeboard-SK is loading in the background and Skip is one tap away. <strong>More</strong> opens your other
|
|
61
|
+
webapps and the server's settings. Customize the apps, dock position, and more in
|
|
62
62
|
<a id="tour-link" href="#">Plugin Config</a>.
|
|
63
63
|
</p>
|
|
64
64
|
</div>
|
package/public/remoteEntry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./configpanel/dist-D1jGdgWH.js";import{t}from"./configpanel/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/PluginConfigurationPanel.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_app_dock__mf_owner__279176739321140__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_app_dock`,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(`./configpanel/_virtual_mf-localSharedImportMap___mfe_internal___signalk_app_dock__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"./configpanel/dist-BL3MB09X.js";import{t}from"./configpanel/vite-preload-helper-DygEbaNj.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 i=document.createElement(`link`);i.rel=`stylesheet`,i.href=t,i.onload=()=>e(),i.onerror=()=>{r.delete(t),i.remove(),n(Error(`[Module Federation] Failed to load CSS asset: ${t}`))},document.head.appendChild(i)})}))}var s={"./PluginConfigurationPanel":async()=>{await o(`./PluginConfigurationPanel`),await Promise.all([]);let e=await a(`./PluginConfigurationPanel`,()=>t(()=>import(`./configpanel/PluginConfigurationPanel.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_app_dock__mf_owner__37493208337476__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_app_dock`,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(`./configpanel/_virtual_mf-localSharedImportMap___mfe_internal___signalk_app_dock__mf_owner__1-GfsGDlYi.js`),[])).catch(e=>{throw b=void 0,e}),b}async function w(){return s}var T=0,E=Promise.resolve(),D=()=>{};async function O(t={},n=[],r={}){T++===0&&(E=new Promise(e=>D=e));try{let r=function(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},s=(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}},c=Symbol.for(`module-federation.shared-cache-listeners`),d=Symbol.for(`module-federation.shared-cache-owners`),p=e=>{let t=e[d];return t===void 0&&(t=Object.create(null),Object.defineProperty(e,d,{value:t,enumerable:!1,configurable:!1,writable:!1})),t},b=(e,t)=>e[d]?.[t.canonical],w=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}}},T=(e,t)=>{if(e===t)return!0;let n=w(e),r=w(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},E=(e,t,n,r)=>{let i=s(e,t);if(i!==void 0&&T(i,n))return n;e[t.canonical]=n;let a=t.aliases||[];for(let t of a)Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0});let o=e[d];r===void 0?o&&delete o[t.canonical]:p(e)[t.canonical]=r;let l=e[c]?.[t.canonical];if(l)for(let e of l)e(n);return n},D=Symbol.for(`module-federation.tree-shaking-shared-cache`),O=e=>{let t=e[D];return t===void 0&&(t=Object.create(null),Object.defineProperty(e,D,{value:t,enumerable:!1,configurable:!1,writable:!1})),t},k=(e,t,n,r)=>{if(!Array.isArray(n))return r;let i=[...new Set(n)].sort(),a=O(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},A=Symbol.for(`module-federation.tree-shaking-shared-selection-cache`),j=e=>{let t=e[A];return t===void 0&&(t=Object.create(null),Object.defineProperty(e,A,{value:t,enumerable:!1,configurable:!1,writable:!1})),t},M=(e,t,n)=>{let r=s(e,t);return r===void 0?e[A]?.[t.canonical]?.[n]:r},ee=(e,t,n,r)=>{let i=j(e),a=i[t.canonical]||=Object.create(null);return a[n]=r,r},N=globalThis.__FEDERATION__?.__INSTANCES__||[],te=n.find(e=>e?.from)?.from,ne=N.find(e=>e?.options?.name===te&&e?.shareScopeMap?.default===t)||N.find(e=>e?.options?.name!==v&&e?.shareScopeMap?.default===t),P=Object.create(null),re=e=>{let t=Object.create(null);for(let[n,r]of Object.entries(e||{}))t[n]=Object.assign(Object.create(null),r);return t},ie=(e,t)=>{for(let[n,r]of Object.entries(U.shareScopeMap?.[e]||{}))for(let[e,i]of Object.entries(r||{})){if(!i||i.get===I[n]?.get)continue;let r=t[n]||={};r[e]===void 0&&(r[e]=i)}},ae=(e,t)=>{ie(e,t);let n=!ne&&Object.values(t||{}).some(e=>Object.values(e||{}).some(L)),r=n?re(t):t;return P[e]={host:t,runtime:r,isWebpackScope:n},r},oe=()=>{let e=Object.values(P).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}},F=Object.create(null);for(let[e,n]of Object.entries(t)){let t=F[e]=Object.create(null);for(let[e,r]of Object.entries(n))t[e]=Object.assign({},r)}let{usedShared:I,usedRemotes:se}=await C();function L(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 ce=Object.values(F).some(e=>Object.values(e||{}).some(L)),le=e=>{let t=e.split(`/`);return e.startsWith(`@`)?t.slice(0,2).join(`/`):t[0]},R=(e,n,r,i)=>{if(typeof __mfSelectExternalSharedProvider!=`function`)return;let a=le(e),o=!i||a===e?[[e,n]]:[[e,n],[a,I[a]]];for(let[n,i]of o){if(!i)continue;let a=r?n===e?r:F[n]:F[n]??t[n],o=__mfSelectExternalSharedProvider(a,n,i,`version-first`);if(o)return o}},ue=(e,t,n)=>{let r=R(e,t,n,!0);return r&&L(r)&&!r.lib&&!r.loaded?r:void 0};var i=h[_];if(i||=h[_]={from:v},n.indexOf(i)>=0)return;n.push(i);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},de=[],fe=globalThis.window===void 0?await Promise.all([]):[],B=`__mf_vite_runtime_share_load_id__`,pe=0,V=new Map,H=new Map,U=e({name:v,remotes:se,shared:I,plugins:[me(),he(),...de,...fe],shareStrategy:`version-first`});U.initShareScopeMap(`default`,ae(`default`,t));function me(){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 he(){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 ge=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;ge.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`&&I[e.pkgName]){let t=__mfSelectSharedProvider(e.shareScopeMap?.[e.scope]?.[e.pkgName],e.pkgName,I[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 _e=(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()}}},ve=e=>Object.entries(e||{}).map(([e,t])=>({provider:t,version:e,from:t.from,registered:!0})),ye=(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},be=async(e,t,n)=>{let r=++pe;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=_e(n,r,i,a);if(!c)return;let l;try{l=await be(e,t,c)}catch(e){throw c.release(!1),e}let u=l?.factory;if(u===void 0){c.release(!1);return}let d=ve(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)??ye(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,xe=async(e,n,i)=>{let a=!!n.shareConfig?.singleton;if(!a&&n.canLiveRebind!==!1)try{let o=__mfSelectExternalSharedProvider(i,e,n,`version-first`),c=__mfFindSharedProviderEntry(i,o);if(!c||n.shareConfig?.import===!1&&__mfMatchesSharedProvider(o,n)||o?.shareConfig?.import===!1)return;let{version:l}=c;if(!a&&l!==n.version||!o.lib&&!o.loading&&!(o.loaded&&typeof o.get==`function`))return;let u=r(e,a,n.version,n.scope);if(s(m.share,u)!==void 0)return;let d=t[e],f=d?.[l];if(c.registered&&!__mfMatchesSharedProvider(f,o))return;let p,h=o.lib;if(!h&&L(o)||(!h&&o.loading&&(h=await o.loading),!h&&o.loaded&&typeof o.get==`function`&&(h=await o.get()),!h))return;let g=typeof h==`function`?h():h,_=await Promise.resolve(g),v=c.registered?f:o;p={provider:v,selection:{provider:v,version:l,from:o.from,registered:c.registered},resolved:_};let y=p?.provider,b=p?.selection;if(!b)return;let x=p?.resolved;if(x===void 0||s(m.share,u)!==void 0||b.registered&&d?.[b.version]!==y)return;E(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,i,a,o)=>{try{let c=r(e,n.shareConfig?.singleton,n.version,n.scope),l=s(m.share,c),u=b(m.share,c),d=__mfSelectExternalSharedProvider(i,e,n,`version-first`),f=d||__mfSelectSharedProvider(i,e,n,`version-first`)||n,p=__mfFindSharedProviderEntry(i,f);if(!p)return;let h=__mfMatchesSharedProvider(f,n),{version:g}=p;if(!n.shareConfig?.singleton&&g!==n.version)return;let _=a?.[g],y=__mfResolveExternalSharedProvider(N,ne,t,`default`,e,p,d,_,`version-first`);if(!y&&!h)return;let{provider:x,scopeRootProvider:S}=y||{provider:f,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],w=C?.[g];if(p.registered&&!S&&!__mfMatchesSharedProvider(w,x))return;let T=await G(e,n.shareConfig,C,g,w,x,p.registered&&!h),D=T?.provider,O=T?.selection;if(!O||o&&(o.version!==O.version||!__mfMatchesSharedProvider({from:O.from},o.provider))||K.has(D))return;let k=T?.resolved;if(k===void 0)return;let A=s(m.share,c),j=b(m.share,c);if(A!==void 0&&j!==v||O.registered&&C?.[O.version]!==D)return;!o&&!__mfMatchesSharedProvider(D,n)&&q.set(e,{version:O.version,provider:{from:O.from}}),K.add(D);let M=z(k);E(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=I[e];t&&t.materialize!==!1&&!t.treeShaking&&await xe(e,t,F[e])}));for(let[e,t]of Object.entries(I)){if(t.treeShaking)continue;let n=r(e,t.shareConfig?.singleton,t.version,t.scope);if(s(m.share,n)!==void 0)continue;let i=r(e,!0,t.version,t.scope),a=s(m.share,i);a!==void 0&&E(m.share,n,a,b(m.share,i))}let Se=[],Ce=new Set([]),we=[],Y=new Map(Se.map((e,t)=>[e,t])),Te={},X=Se.filter(e=>I[e]&&(I[e].materialize!==!1||I[e].shareConfig?.import===!1&&!I[e].lazy));m.providerInit||=new Map;let Ee=(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 a=async e=>{let t=new Set(e),n=new Set;for(let e of we)await Promise.all(e.filter(e=>t.has(e)).map(async e=>{let t=I[e],i=Y.get(e);if((Te[i]||[]).some(e=>n.has(e))){n.add(i);return}let a=r(e,t.shareConfig?.singleton,t.version,t.scope);if(t.shareConfig?.import===!1||t.treeShaking||s(m.share,a)!==void 0)return;let o=r(e,!0,t.version,t.scope),c=s(m.share,o);if(c!==void 0){E(m.share,a,c,b(m.share,o));return}let l=typeof R==`function`?R(e,t):void 0;if(l){let o=l.lib;if(!o&&l.loading&&(o=await l.loading),!o&&l.loaded&&typeof l.get==`function`&&(o=await l.get()),o){let e=typeof o==`function`?o():o,t=await Promise.resolve(e);E(m.share,a,(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),l.from);return}if(!t.shareConfig?.singleton&&typeof l.version==`string`){let n=s(m.share,r(e,!1,l.version,t.scope));if(n!==void 0){E(m.share,a,n,l.from);return}}if(typeof L==`function`&&L(l)&&(t.shareConfig?.singleton||__mfFindSharedProviderEntry(F[e],l)?.version===t.version)){n.add(i);return}}let u=a.canonical,d=await Ee(u,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 f=(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})(d),p=f===d?{...d}:f;p.__esModule!==!0&&Object.defineProperty(p,"__esModule",{value:!0,enumerable:!1}),s(m.share,a)===void 0&&E(m.share,a,p,v)}))};let Z=e=>{let t=I[e];if(!t.treeShaking&&t.shareConfig?.import!==!1)return!1;let n=r(e,t.shareConfig?.singleton,t.version,t.scope);return t.treeShaking?M(m.share,n,v)===void 0&&s(m.share,n)===void 0:s(m.share,n)===void 0},De=e=>{let t=I[e],n=r(e,t.shareConfig?.singleton,t.version,t.scope);return(t.treeShaking?M(m.share,n,v)??s(m.share,n):s(m.share,n))===void 0?t.treeShaking||t.shareConfig?.import===!1||Ce.has(e)&&t.shareConfig?.singleton?!0:typeof __mfSelectExternalSharedProvider==`function`&&!!__mfSelectExternalSharedProvider(F[e],e,t,`version-first`):!1},Oe=e=>{let t=!0;for(;t;){t=!1;for(let n of X){let r=Y.get(n);e.has(r)||(Te[r]||[]).some(t=>e.has(t))&&(e.add(r),t=!0)}}return e},ke=Oe(new Set(X.filter(De).map(e=>Y.get(e)))),Ae=X.filter(e=>!ke.has(Y.get(e)));var o=X.filter(e=>ke.has(Y.get(e)));await a(Ae).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)}oe();let je=async()=>{for(let e of y)await Promise.all(e.map(async e=>{let n=I[e];n&&n.materialize!==!1&&!n.treeShaking&&await J(e,n,t[e],F[e],void 0)}))};ce?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=I?.[e],i=F[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,I[e],n,F[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 i=r(e,n.shareConfig?.singleton,n.version,n.scope),a=n.treeShaking?M(m.share,i,v):s(m.share,i);if(n.shareConfig?.import!==!1||a!==void 0||ue(e,n,F[e]))return;let o=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?M(m.share,i,v):s(m.share,i))!==void 0||g.registered&&c?.[g.version]!==_)return;let b=o(y);if(n.treeShaking){let e=n.treeShaking.providedExports??n.treeShaking.usedExports??[];k(m.share,i,e,b),ee(m.share,i,v,b)}else E(m.share,i,b,g.from)},Pe=[],Q=new Set;for(let e of o){let t=I[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)}Oe(Q),Pe.push(...o.filter(e=>!Q.has(Y.get(e)))),await a(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=I[e];if(!n||!n.lazy||!Z(e))return;let r=$.get(e);return r||(r=J(e,n,t[e],F[e],void 0).then(()=>Z(e)?Ne(e,n):void 0),r.catch(()=>$.delete(e)),$.set(e,r)),r}))},u(U),U}finally{--T===0&&D()}}async function k(e){T&&await E;let t=await w();if(!(e in t))throw Error(`[Module Federation] Module ${e} does not exist in container.`);x&&await x(),m.pendingShareLoads&&await Promise.all(m.pendingShareLoads);let n=await t[e]();return m.pendingShareLoads&&await Promise.all(m.pendingShareLoads),()=>n}export{k as get,O 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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./vite-preload-helper-DHhhL8Zf.js";var t=`__mf_module_cache__`;globalThis[t]||={share:{},remote:{}},globalThis[t].share||={},globalThis[t].remote||={};var n=globalThis[t];for(let e of Object.keys(n.share))if(e.startsWith(`default:`)){let t=e.slice(8);n.share[t]===void 0&&(n.share[t]=n.share[e])}else if(!e.includes(`:`)){let t=`default:`+e;n.share[t]===void 0&&(n.share[t]=n.share[e])}var r;async function i(){return r||=(async()=>{let t=(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},r=(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}},i=Symbol.for(`module-federation.shared-cache-listeners`),a=Symbol.for(`module-federation.shared-cache-owners`),o=e=>{let t=e[a];return t===void 0&&(t=Object.create(null),Object.defineProperty(e,a,{value:t,enumerable:!1,configurable:!1,writable:!1})),t},s=(e,t)=>e[a]?.[t.canonical],c=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}}},l=(e,t)=>{if(e===t)return!0;let n=c(e),r=c(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},u=(e,t,n,s)=>{let c=r(e,t);if(c!==void 0&&l(c,n))return n;e[t.canonical]=n;let u=t.aliases||[];for(let t of u)Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0});let d=e[a];s===void 0?d&&delete d[t.canonical]:o(e)[t.canonical]=s;let f=e[i]?.[t.canonical];if(f)for(let e of f)e(n);return n},d=await(await e(()=>import(`../remoteEntry.js`),[])).init(),{usedShared:f}=await e(async()=>{let{usedShared:e}=await import(`./_virtual_mf-localSharedImportMap___mfe_internal___signalk_app_dock__mf_owner__1-_R-vaMcG.js`);return{usedShared:e}},[]),p=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},m=(e,t)=>__mfGetShareScopeNames(t).some(n=>Object.keys(d.shareScopeMap?.[n]?.[e]||{}).some(e=>e!==t.version));for(let e of[])await Promise.all(e.map(async e=>{let i=f[e];if(!i||i.materialize===!1&&!i.lazy||i.treeShaking)return;let a=t(e,i.shareConfig?.singleton,i.version,i.scope);if(!(r(n.share,a)!==void 0&&(!i.shareConfig?.singleton&&s(n.share,a)===`_signalk_app_dock`||i.shareConfig?.singleton&&!m(e,i)))){if(i.shareConfig?.import===!1){let t=__mfGetShareScopeNames(i),n=t=>!__mfHasUsableProvider(d.shareScopeMap?.[t]?.[e],e,i,t);if(t.some(n)){d.__mfKeepAdoptedProviders||(d.__mfKeepAdoptedProviders=!0,d.sharedHandler?.hooks?.lifecycle?.afterRegisterShare?.on?.(e=>{let{shared:t,previousShared:n,registeredShared:r}=e||{},i=d.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))}));for(let r of globalThis.__FEDERATION__?.__INSTANCES__||[])for(let a of t){let t=r?.shareScopeMap?.[a]?.[e];if(!__mfHasUsableProvider(t,e,i,a)||!n(a))continue;let o=(d.shareScopeMap[a]||={})[e]||={};for(let[e,n]of Object.entries(t))n?.shareConfig?.import!==!1&&(o[e]&&o[e].shareConfig?.import!==!1||(o[e]=n))}}if(t.every(n))return}await d.loadShare(e,{customShareInfo:{shareConfig:i.shareConfig}}).then(async e=>{if(e===!1)return;let t=typeof e==`function`?e():e,r=p(await Promise.resolve(t));u(n.share,a,r,`_signalk_app_dock`)})}}));for(let[e,r]of Object.entries(f)){if(!r.lib||r.treeShaking||r.shareConfig?.import===!1)continue;let i=t(e,r.shareConfig?.singleton,r.version,r.scope);if(s(n.share,i)===`_signalk_app_dock`)for(let t of Array.isArray(r.scope)?r.scope:[r.scope||`default`]){let n=d.shareScopeMap?.[t]?.[e],i=n?.[r.version];i&&i.get===r.get&&!i.lib&&(Object.values(n).some(e=>e!==i&&(e?.lib||e?.loaded))||(i.lib=r.lib,i.loaded=!0))}}return d})(),r}r=i();export{r as hostInitPromise,i as initHost};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./vite-preload-helper-DHhhL8Zf.js";var t=`__mf_module_cache__`;globalThis[t]||={share:{},remote:{}},globalThis[t].share||={},globalThis[t].remote||={};var n=globalThis[t];for(let e of Object.keys(n.share))if(e.startsWith(`default:`)){let t=e.slice(8);n.share[t]===void 0&&(n.share[t]=n.share[e])}else if(!e.includes(`:`)){let t=`default:`+e;n.share[t]===void 0&&(n.share[t]=n.share[e])}var r=(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},i=(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}},a=[];async function o(){if(a.length===0)return;let t=`react-dom/client`,{usedShared:o}=await e(async()=>{let{usedShared:e}=await import(`./_virtual_mf-localSharedImportMap___mfe_internal___signalk_app_dock__mf_owner__1-_R-vaMcG.js`);return{usedShared:e}},[]);await Promise.all(a.map(async([e,a])=>{let s=o[e],c=s??(e===t?o[`react-dom`]:void 0);if(!c||c.treeShaking||c.shareConfig?.import===!1||s&&s.materialize===!1&&e!==t)return;let l=r(e,c.shareConfig?.singleton,c.version,c.scope);i(n.share,l)===void 0&&await a().catch(t=>console.warn(`[module-federation] shared preload failed:`,e,t))}))}export{o as preloadPendingShares};
|