transone 0.3.0 → 0.4.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 +241 -10
- package/README.zh-CN.md +19 -0
- package/dist/core/component/base.d.ts +3 -1
- package/dist/{index-d5wsetxf.js → index-qmpx307q.js} +3 -3
- package/dist/{index-d5wsetxf.js.map → index-qmpx307q.js.map} +3 -3
- package/dist/{index-49z4707x.js → index-rmgr0qs2.js} +6 -6
- package/dist/{index-49z4707x.js.map → index-rmgr0qs2.js.map} +5 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +2 -2
- package/dist/router/index.js +1 -1
- package/dist/style/index.js +1 -1
- package/dist/style/units.d.ts +3 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,17 +1,248 @@
|
|
|
1
1
|
# transone
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**English** · [简体中文](./README.zh-CN.md)
|
|
4
4
|
|
|
5
|
-
-
|
|
6
|
-
- 面向对象组件:`Component<Props, State>`、生命周期、事件、插槽
|
|
7
|
-
- 策略化渲染:`RenderStrategy` 按 VNode 类型分发(文本 / 元素 / 组件 / 插槽)
|
|
8
|
-
- 内置路由:`createRouter`、`RouterView`、`RouterLink`
|
|
9
|
-
- 样式管理:`StyleManager`
|
|
5
|
+
TransOne core framework package — a cross-platform front-end framework that compiles **one TypeScript source** into Web and multi-platform mini-program native projects at build time. Emitted artifacts carry **no framework runtime**: code is statically transformed (transpile/transform), so the output stays small and close to native.
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
The core public API is same-origin with [TSone](https://github.com/geektech-team/tsone): Web output can directly reuse TSone rendering strategies and its component ecosystem. The multi-target compiler lives in [`transone-cli`](../transone-cli).
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- **Reactive system** — `reactive`, `readonly`, `effect`, `computed`, `ref`, `isRef`, `unref`, `stop`, `watch`, `nextTick`, `flushSync`, backed by a reactive scheduler
|
|
12
|
+
- **OOP component model** — `Component<Props, State>` with lifecycle hooks, custom events, slots, and `provide` / `inject`
|
|
13
|
+
- **Strategy-based renderer** — `RenderStrategy` dispatches by VNode type (text / element / component / slot)
|
|
14
|
+
- **Built-in router** — `createRouter`, `RouterView`, `RouterLink` with history / hash modes, base path, navigation guards, redirects and route metadata
|
|
15
|
+
- **Cross-platform request** — one unified API over `fetch` (Web), `wx.request` (WeChat), `my.request` (Alipay) and `tt.request` (ByteDance), with request / response interceptors and platform auto-detection
|
|
16
|
+
- **Style management** — `StyleManager` with class / id / sheet style units
|
|
17
|
+
- **DOM abstractions** — `createDomWindow`, `installDomGlobals`, `parseHtmlFragment` for headless and test environments
|
|
18
|
+
|
|
19
|
+
## Install
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
bun add transone
|
|
23
|
+
# or npm / pnpm / yarn
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Requires Bun >= 1.3.0.
|
|
27
|
+
|
|
28
|
+
## Quick start
|
|
29
|
+
|
|
30
|
+
A counter component — the same source builds to every supported target:
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import { Component, VNode, createApp } from 'transone';
|
|
34
|
+
|
|
35
|
+
interface AppState {
|
|
36
|
+
count: number;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
class App extends Component<Record<string, never>, AppState> {
|
|
40
|
+
protected initState(): AppState {
|
|
41
|
+
return { count: 0 };
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
protected initStyles(): void {}
|
|
45
|
+
|
|
46
|
+
protected render(): VNode {
|
|
47
|
+
return {
|
|
48
|
+
tag: 'main',
|
|
49
|
+
children: [
|
|
50
|
+
{ tag: 'h1', children: ['TransOne'] },
|
|
51
|
+
{
|
|
52
|
+
tag: 'button',
|
|
53
|
+
listeners: {
|
|
54
|
+
click: () => {
|
|
55
|
+
this.state.count += 1;
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
children: [`count: {{count}}`],
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const app = createApp({ root: App });
|
|
66
|
+
app.mount();
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Build the same source to different targets with `transone-cli`:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
transone build --target web # H5 site / SPA
|
|
73
|
+
transone build --target mp-weixin # WeChat mini-program project (WXML/WXSS/JS)
|
|
74
|
+
transone build --target mp-alipay # Alipay mini-program project (AXML/ACSS)
|
|
75
|
+
transone build --target mp-bytedance # ByteDance mini-program project (TTML/TTSS)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Reactivity
|
|
79
|
+
|
|
80
|
+
```ts
|
|
81
|
+
import { reactive, computed, effect, ref, watch, nextTick } from 'transone';
|
|
82
|
+
|
|
83
|
+
const state = reactive({ count: 0 });
|
|
84
|
+
|
|
85
|
+
const doubled = computed(() => state.count * 2);
|
|
86
|
+
|
|
87
|
+
effect(() => {
|
|
88
|
+
console.log(`count is ${state.count}, doubled is ${doubled.value}`);
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
state.count += 1; // triggers the effect
|
|
92
|
+
|
|
93
|
+
const message = ref('hello');
|
|
94
|
+
watch(message, (value, oldValue) => {
|
|
95
|
+
console.log(`message changed: ${oldValue} -> ${value}`);
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
await nextTick(); // flush pending reactive updates
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Component model
|
|
102
|
+
|
|
103
|
+
```ts
|
|
104
|
+
import { Component, h, type VNode } from 'transone';
|
|
105
|
+
|
|
106
|
+
interface GreetingProps {
|
|
107
|
+
name: string;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
class Greeting extends Component<GreetingProps, { shown: boolean }> {
|
|
111
|
+
protected initState() {
|
|
112
|
+
return { shown: false };
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
protected initStyles(): void {}
|
|
116
|
+
|
|
117
|
+
protected onMounted(): void {
|
|
118
|
+
this.setState({ shown: true });
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
protected render(): VNode {
|
|
122
|
+
return h('p', {}, [`Hello, ${this.props.name}!`]);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Lifecycle hooks: `beforeMount`, `onMounted`, `beforeUpdate`, `onUpdated`, `onPropsChange`, `beforeUnmount`, `onUnmounted`, `onErrorCaptured`. Components communicate through custom events (`emit` / `on` / `off`) and dependency injection (`provide` / `inject`).
|
|
128
|
+
|
|
129
|
+
## Router
|
|
130
|
+
|
|
131
|
+
```ts
|
|
132
|
+
import { createRouter, RouterView, RouterLink } from 'transone/router';
|
|
133
|
+
|
|
134
|
+
const router = createRouter({
|
|
135
|
+
mode: 'history',
|
|
136
|
+
base: '/app',
|
|
137
|
+
routes: [
|
|
138
|
+
{ path: '/', component: Home, name: 'home' },
|
|
139
|
+
{ path: '/about', component: About, name: 'about' },
|
|
140
|
+
{ path: '/old', redirect: '/about' },
|
|
141
|
+
{ path: '/users/:id', component: UserDetail },
|
|
142
|
+
],
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
router.beforeEach((to, from) => {
|
|
146
|
+
// return false to cancel, a path string to redirect, or undefined to continue
|
|
147
|
+
});
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Render the matched route with `RouterView` and link with `RouterLink`:
|
|
151
|
+
|
|
152
|
+
```ts
|
|
153
|
+
import { Component, h, createComponent, type VNode } from 'transone';
|
|
154
|
+
|
|
155
|
+
class Layout extends Component {
|
|
156
|
+
protected initStyles(): void {}
|
|
157
|
+
|
|
158
|
+
protected render(): VNode {
|
|
159
|
+
return h('div', {}, [
|
|
160
|
+
createComponent({
|
|
161
|
+
component: RouterLink,
|
|
162
|
+
props: { to: '/', activeClass: 'active' },
|
|
163
|
+
children: ['Home'],
|
|
164
|
+
}),
|
|
165
|
+
createComponent({ component: RouterView }),
|
|
166
|
+
]);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## Cross-platform request
|
|
172
|
+
|
|
173
|
+
`transone/request` (also re-exported from the root entry) wraps each platform's request API: Web uses `fetch`, while WeChat / Alipay / ByteDance mini-programs use `wx.request` / `my.request` / `tt.request` respectively. The runtime detects the environment automatically, so one source works across targets without changes; you can also pin a platform explicitly or inject a custom adapter.
|
|
174
|
+
|
|
175
|
+
```ts
|
|
176
|
+
import { createRequest, RequestError } from 'transone/request';
|
|
177
|
+
|
|
178
|
+
const http = createRequest({ baseURL: '/api', timeout: 10000 });
|
|
179
|
+
|
|
180
|
+
// Request interceptors run in registration order (e.g. inject auth state)
|
|
181
|
+
http.interceptors.request.use((config) => {
|
|
182
|
+
config.headers.Authorization = `Bearer ${token}`;
|
|
183
|
+
return config;
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
// Response interceptors: later-registered ones run first
|
|
187
|
+
http.interceptors.response.use(
|
|
188
|
+
(response) => {
|
|
189
|
+
if (response.data?.code !== 0) {
|
|
190
|
+
throw new RequestError({
|
|
191
|
+
code: 'BAD_REQUEST',
|
|
192
|
+
message: response.data?.message ?? 'Business error',
|
|
193
|
+
config: response.config,
|
|
194
|
+
response,
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
return response;
|
|
198
|
+
},
|
|
199
|
+
(error) => {
|
|
200
|
+
// error is a RequestError; branch on code: TIMEOUT / ABORTED / NETWORK_ERROR ...
|
|
201
|
+
throw error;
|
|
202
|
+
}
|
|
203
|
+
);
|
|
204
|
+
|
|
205
|
+
const res = await http.get<{ list: Item[] }>('/items', { params: { page: 1 } });
|
|
206
|
+
await http.post('/users', { name: 'a' });
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
A global default instance and per-target overrides are also available:
|
|
210
|
+
|
|
211
|
+
```ts
|
|
212
|
+
import { request, detectPlatform } from 'transone/request';
|
|
213
|
+
|
|
214
|
+
await request.get('/ping'); // auto-detect target platform
|
|
215
|
+
await request.get('/x', { platform: 'weixin' }); // explicit platform
|
|
216
|
+
console.log(detectPlatform()); // 'web' | 'weixin' | 'alipay' | 'bytedance'
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
Errors are normalized to `RequestError` (`code` / `config` / `response` / `cause`). HTTP 4xx / 5xx are not treated as exceptions (consistent with mini-program `success` semantics); inspect `statusCode` on the caller side.
|
|
220
|
+
|
|
221
|
+
## Sub-path exports
|
|
222
|
+
|
|
223
|
+
| Entry | Contents |
|
|
224
|
+
| --- | --- |
|
|
225
|
+
| `transone` | Core (reactivity, components, renderer) + router + request |
|
|
226
|
+
| `transone/router` | `createRouter`, `Router`, `RouterView`, `RouterLink`, `useRouter` |
|
|
227
|
+
| `transone/request` | `createRequest`, `request`, `Request`, `InterceptorManager`, `RequestError`, `detectPlatform` |
|
|
228
|
+
| `transone/style` | `StyleManager`, style sheets and units |
|
|
229
|
+
| `transone/dom` | DOM abstractions: `createDomWindow`, `installDomGlobals`, `parseHtmlFragment` |
|
|
230
|
+
|
|
231
|
+
## Relationship with TSone
|
|
232
|
+
|
|
233
|
+
- **TransOne is the multi-target generalization of TSone**: TSone focuses on the Web runtime; TransOne compiles the same reactive / component / rendering model to multiple targets through compile-time transformation.
|
|
234
|
+
- TSone's `build --mp-weixin` served as the prototype for TransOne's WeChat target; its output shape and constraints migrate into TransOne's multi-target abstraction.
|
|
235
|
+
- The One family: `TSone` (front-end framework) · `TransOne` (cross-platform framework) · `BackOne` (back-end framework).
|
|
236
|
+
|
|
237
|
+
## Development
|
|
13
238
|
|
|
14
239
|
```bash
|
|
15
|
-
bun test #
|
|
16
|
-
bun run build #
|
|
240
|
+
bun test # run tests (Bun's test runner)
|
|
241
|
+
bun run build # build dist (ESM + .d.ts)
|
|
242
|
+
bun run build:types
|
|
243
|
+
bun run lint
|
|
17
244
|
```
|
|
245
|
+
|
|
246
|
+
## License
|
|
247
|
+
|
|
248
|
+
MIT
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# transone
|
|
2
|
+
|
|
3
|
+
**简体中文** · [English](./README.md)
|
|
4
|
+
|
|
5
|
+
TransOne 核心框架包:一份 TypeScript 源码,跨端框架的核心运行时模型。
|
|
6
|
+
|
|
7
|
+
- 响应式系统:`reactive`、`readonly`、`effect`、`stop`、`computed`、`ref`、`watch`
|
|
8
|
+
- 面向对象组件:`Component<Props, State>`、生命周期、事件、插槽
|
|
9
|
+
- 策略化渲染:`RenderStrategy` 按 VNode 类型分发(文本 / 元素 / 组件 / 插槽)
|
|
10
|
+
- 内置路由:`createRouter`、`RouterView`、`RouterLink`
|
|
11
|
+
- 样式管理:`StyleManager`
|
|
12
|
+
|
|
13
|
+
与 TSone 同源:核心公开 API 复用 TSone,Web 产物可直接复用 TSone 渲染策略。
|
|
14
|
+
编译器见 [transone-cli](../transone-cli)。
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
bun test # 测试
|
|
18
|
+
bun run build # 构建 dist(ESM + .d.ts)
|
|
19
|
+
```
|
|
@@ -16,7 +16,7 @@ export type AnyComponentConstructor = new (props?: never) => Component<Component
|
|
|
16
16
|
export declare abstract class Component<TProps extends ComponentProps = ComponentProps, TState extends ComponentState = ComponentState> implements ComponentInstance {
|
|
17
17
|
protected props: TProps;
|
|
18
18
|
private vnode;
|
|
19
|
-
|
|
19
|
+
protected el: Node | null;
|
|
20
20
|
private readonly renderer;
|
|
21
21
|
private readonly templateEngine;
|
|
22
22
|
private readonly childComponents;
|
|
@@ -52,6 +52,8 @@ export declare abstract class Component<TProps extends ComponentProps = Componen
|
|
|
52
52
|
protected onMounted(): void;
|
|
53
53
|
protected beforeUpdate(): void;
|
|
54
54
|
protected onUpdated(): void;
|
|
55
|
+
/** props 更新钩子:Web 端在每次更新(setProps/setState)后调用;小程序端由 observers 在 properties 变化时触发。 */
|
|
56
|
+
protected onPropsChange(): void;
|
|
55
57
|
protected beforeUnmount(): void;
|
|
56
58
|
protected onUnmounted(): void;
|
|
57
59
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var l=":root{--
|
|
1
|
+
var l=":root{--tu-rpx:calc(min(100vw, 750px) / 750);}",c=/(-?\d+(?:\.\d+)?)rpx/g;function i(e){return String(e).replace(c,(t,r)=>`calc(${r} * var(--tu-rpx))`)}class p{styleElement=null;styles=new Map;constructor(){}addStyle(e,t){this.styles.set(e,t),this.updateStyles()}removeStyle(e){this.styles.delete(e),this.updateStyles()}clearStyles(){if(this.styles.clear(),this.styleElement)this.styleElement.textContent=""}destroy(){if(this.clearStyles(),this.styleElement)this.styleElement.remove(),this.styleElement=null}ensureStyleElement(){if(!this.styleElement){let e=document.createElement("style");document.head.appendChild(e),this.styleElement=e}return this.styleElement}convertToCSS(e){return Object.entries(e).map(([t,r])=>`${t.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${i(r)};`).join(`
|
|
2
2
|
`)}updateStyles(){if(this.styles.size===0){if(this.styleElement)this.styleElement.textContent="";return}let e=this.ensureStyleElement(),t=l+`
|
|
3
3
|
`;this.styles.forEach((r)=>{if(t+=`${r.selector} {
|
|
4
4
|
${this.convertToCSS(r.properties)}
|
|
@@ -23,5 +23,5 @@ ${r}
|
|
|
23
23
|
${t}}`}function u(e){if(e.startsWith("--")||e.includes("-"))return e;return e.replace(/[A-Z]/g,(t)=>`-${t.toLowerCase()}`)}
|
|
24
24
|
export{i as Ca,p as Da,m as Ea};
|
|
25
25
|
|
|
26
|
-
//# debugId=
|
|
27
|
-
//# sourceMappingURL=index-
|
|
26
|
+
//# debugId=4D73144E690F1BEE64756E2164756E21
|
|
27
|
+
//# sourceMappingURL=index-qmpx307q.js.map
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../lib/style/units.ts", "../lib/style/StyleManager.ts", "../lib/style/sheet.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"/** 跨端尺寸单位换算:rpx(微信 750 设计宽)在 H5 端转换为视口相对值。\n *\n * 1rpx = 视口宽度 / 750,且视口宽度上限 750px(桌面端不再放大,页面按\n * 750px 基准居中显示,与小程序设计宽一致)。\n */\n\n/** 根 CSS 变量:--
|
|
5
|
+
"/** 跨端尺寸单位换算:rpx(微信 750 设计宽)在 H5 端转换为视口相对值。\n *\n * 1rpx = 视口宽度 / 750,且视口宽度上限 750px(桌面端不再放大,页面按\n * 750px 基准居中显示,与小程序设计宽一致)。\n */\n\n/** 根 CSS 变量:--tu-rpx 为 1rpx 的等效长度 */\nexport const ROOT_RPX_RULE =\n ':root{--tu-rpx:calc(min(100vw, 750px) / 750);}';\n\nconst RPX_PATTERN = /(-?\\d+(?:\\.\\d+)?)rpx/g;\n\n/** 把字符串/数值中的 `N rpx` 替换为 `calc(N * var(--tu-rpx))` */\nexport function convertRpx(value: string | number): string {\n return String(value).replace(\n RPX_PATTERN,\n (_match, number: string) => `calc(${number} * var(--tu-rpx))`\n );\n}\n",
|
|
6
6
|
"export interface StyleOptions {\n selector: string;\n properties: Record<string, string | number>;\n hover?: Record<string, string | number>;\n media?: Record<string, Record<string, string | number>>;\n}\n\nimport { convertRpx, ROOT_RPX_RULE } from './units';\n\nexport class StyleManager {\n public styleElement: HTMLStyleElement | null = null;\n public styles: Map<string, StyleOptions> = new Map();\n\n constructor() {\n // style 元素延迟到首次 addStyle 时创建,避免无样式组件产生空 <style> 节点\n }\n\n public addStyle(name: string, options: StyleOptions): void {\n this.styles.set(name, options);\n this.updateStyles();\n }\n\n public removeStyle(name: string): void {\n this.styles.delete(name);\n this.updateStyles();\n }\n\n public clearStyles(): void {\n this.styles.clear();\n if (this.styleElement) {\n this.styleElement.textContent = '';\n }\n }\n\n public destroy(): void {\n this.clearStyles();\n if (this.styleElement) {\n this.styleElement.remove();\n this.styleElement = null;\n }\n }\n\n private ensureStyleElement(): HTMLStyleElement {\n if (!this.styleElement) {\n const element = document.createElement('style');\n document.head.appendChild(element);\n this.styleElement = element;\n }\n return this.styleElement;\n }\n\n private convertToCSS(properties: Record<string, string | number>): string {\n return Object.entries(properties)\n .map(([key, value]) => {\n const cssKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n return `${cssKey}: ${convertRpx(value)};`;\n })\n .join('\\n');\n }\n\n private updateStyles(): void {\n if (this.styles.size === 0) {\n if (this.styleElement) {\n this.styleElement.textContent = '';\n }\n return;\n }\n\n const element = this.ensureStyleElement();\n let cssText = ROOT_RPX_RULE + '\\n';\n\n this.styles.forEach((style) => {\n // 基础样式\n cssText += `${style.selector} {\\n${this.convertToCSS(style.properties)}\\n}\\n`;\n\n // hover 样式\n if (style.hover) {\n cssText += `${style.selector}:hover {\\n${this.convertToCSS(style.hover)}\\n}\\n`;\n }\n\n // media 查询\n if (style.media) {\n Object.entries(style.media).forEach(([query, properties]) => {\n cssText += `@media ${query} {\\n${style.selector} {\\n${this.convertToCSS(properties)}\\n}\\n}\\n`;\n });\n }\n });\n\n element.textContent = cssText;\n }\n}\n",
|
|
7
7
|
"export type StyleValue = string | number;\n\nexport type StyleProperties = Record<string, StyleValue>;\n\nexport interface StyleRule {\n selector: string;\n properties: StyleProperties;\n}\n\nexport interface StyleAtRule {\n atRule: string;\n rules: StyleRule[];\n}\n\nexport type StyleSheetEntry = StyleRule | StyleAtRule;\n\nexport type StyleSheet = StyleSheetEntry[];\n\nexport function renderStyleSheet(styles: StyleSheet): string {\n return styles.map((entry) => renderStyleEntry(entry)).join('\\n\\n');\n}\n\nfunction renderStyleEntry(entry: StyleSheetEntry, indent = ''): string {\n if ('atRule' in entry) {\n const rules = entry.rules\n .map((rule) => renderStyleEntry(rule, `${indent} `))\n .join('\\n\\n');\n\n return `${indent}${entry.atRule} {\\n${rules}\\n${indent}}`;\n }\n\n const declarations = Object.entries(entry.properties)\n .map(\n ([property, value]) =>\n `${indent} ${toCssProperty(property)}: ${String(value)};`\n )\n .join('\\n');\n\n return `${indent}${entry.selector} {\\n${declarations}\\n${indent}}`;\n}\n\nfunction toCssProperty(property: string): string {\n if (property.startsWith('--') || property.includes('-')) {\n return property;\n }\n\n return property.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`);\n}\n"
|
|
8
8
|
],
|
|
9
|
-
"mappings": "AAOO,IAAM,EACX,
|
|
10
|
-
"debugId": "
|
|
9
|
+
"mappings": "AAOO,IAAM,EACX,iDAEI,EAAc,wBAGb,SAAS,CAAU,CAAC,EAAgC,CACzD,OAAO,OAAO,CAAK,EAAE,QACnB,EACA,CAAC,EAAQ,IAAmB,QAAQ,oBACtC,ECRK,MAAM,CAAa,CACjB,aAAwC,KACxC,OAAoC,IAAI,IAE/C,WAAW,EAAG,EAIP,QAAQ,CAAC,EAAc,EAA6B,CACzD,KAAK,OAAO,IAAI,EAAM,CAAO,EAC7B,KAAK,aAAa,EAGb,WAAW,CAAC,EAAoB,CACrC,KAAK,OAAO,OAAO,CAAI,EACvB,KAAK,aAAa,EAGb,WAAW,EAAS,CAEzB,GADA,KAAK,OAAO,MAAM,EACd,KAAK,aACP,KAAK,aAAa,YAAc,GAI7B,OAAO,EAAS,CAErB,GADA,KAAK,YAAY,EACb,KAAK,aACP,KAAK,aAAa,OAAO,EACzB,KAAK,aAAe,KAIhB,kBAAkB,EAAqB,CAC7C,GAAI,CAAC,KAAK,aAAc,CACtB,IAAM,EAAU,SAAS,cAAc,OAAO,EAC9C,SAAS,KAAK,YAAY,CAAO,EACjC,KAAK,aAAe,EAEtB,OAAO,KAAK,aAGN,YAAY,CAAC,EAAqD,CACxE,OAAO,OAAO,QAAQ,CAAU,EAC7B,IAAI,EAAE,EAAK,KAEH,GADQ,EAAI,QAAQ,WAAY,KAAK,EAAE,YAAY,MACrC,EAAW,CAAK,IACtC,EACA,KAAK;AAAA,CAAI,EAGN,YAAY,EAAS,CAC3B,GAAI,KAAK,OAAO,OAAS,EAAG,CAC1B,GAAI,KAAK,aACP,KAAK,aAAa,YAAc,GAElC,OAGF,IAAM,EAAU,KAAK,mBAAmB,EACpC,EAAU,EAAgB;AAAA,EAE9B,KAAK,OAAO,QAAQ,CAAC,IAAU,CAK7B,GAHA,GAAW,GAAG,EAAM;AAAA,EAAe,KAAK,aAAa,EAAM,UAAU;AAAA;AAAA,EAGjE,EAAM,MACR,GAAW,GAAG,EAAM;AAAA,EAAqB,KAAK,aAAa,EAAM,KAAK;AAAA;AAAA,EAIxE,GAAI,EAAM,MACR,OAAO,QAAQ,EAAM,KAAK,EAAE,QAAQ,EAAE,EAAO,KAAgB,CAC3D,GAAW,UAAU;AAAA,EAAY,EAAM;AAAA,EAAe,KAAK,aAAa,CAAU;AAAA;AAAA;AAAA,EACnF,EAEJ,EAED,EAAQ,YAAc,EAE1B,CCxEO,SAAS,CAAgB,CAAC,EAA4B,CAC3D,OAAO,EAAO,IAAI,CAAC,IAAU,EAAiB,CAAK,CAAC,EAAE,KAAK;AAAA;AAAA,CAAM,EAGnE,SAAS,CAAgB,CAAC,EAAwB,EAAS,GAAY,CACrE,GAAI,WAAY,EAAO,CACrB,IAAM,EAAQ,EAAM,MACjB,IAAI,CAAC,IAAS,EAAiB,EAAM,GAAG,KAAU,CAAC,EACnD,KAAK;AAAA;AAAA,CAAM,EAEd,MAAO,GAAG,IAAS,EAAM;AAAA,EAAa;AAAA,EAAU,KAGlD,IAAM,EAAe,OAAO,QAAQ,EAAM,UAAU,EACjD,IACC,EAAE,EAAU,KACV,GAAG,MAAW,EAAc,CAAQ,MAAM,OAAO,CAAK,IAC1D,EACC,KAAK;AAAA,CAAI,EAEZ,MAAO,GAAG,IAAS,EAAM;AAAA,EAAe;AAAA,EAAiB,KAG3D,SAAS,CAAa,CAAC,EAA0B,CAC/C,GAAI,EAAS,WAAW,IAAI,GAAK,EAAS,SAAS,GAAG,EACpD,OAAO,EAGT,OAAO,EAAS,QAAQ,SAAU,CAAC,IAAU,IAAI,EAAM,YAAY,GAAG",
|
|
10
|
+
"debugId": "4D73144E690F1BEE64756E2164756E21",
|
|
11
11
|
"names": []
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{Ca as ee,Da as le,Ea as W}from"./index-d5wsetxf.js";var R=Symbol("is_reactive"),d=Symbol("is_readonly"),j=Symbol("is_ref"),G=["push","pop","shift","unshift","splice","sort","reverse"];function h(e,t){return Boolean(Reflect.get(e,t))}function f(e){return e!==null&&typeof e==="object"}class O{pending=new Set;flushing=!1;flushPromise=null;flushResolve=null;enqueue(e){if(this.pending.has(e))return;if(this.pending.add(e),!this.flushing)queueMicrotask(()=>this.flush())}flush(){if(this.flushing)return;this.flushing=!0;try{while(this.pending.size>0){let e=Array.from(this.pending);this.pending.clear();for(let t of e)if(t.active)t()}}finally{this.flushing=!1;let e=this.flushResolve;this.flushResolve=null,this.flushPromise=null,e?.()}}nextTick(){if(!this.flushing&&this.pending.size===0)return Promise.resolve();if(this.flushPromise)return this.flushPromise;return this.flushPromise=new Promise((e)=>{this.flushResolve=e}),this.flushPromise}}var ve=0,E=new O;function Fe(){return E.nextTick()}function Ge(){E.flush()}class m{static instance;activeEffect=null;effectStack=[];targetMap=new WeakMap;reactiveMap=new WeakMap;readonlyMap=new WeakMap;proxyMap=new WeakMap;constructor(){}static getInstance(){if(!m.instance)m.instance=new m;return m.instance}reactive(e){if(!f(e))return console.warn("reactive: target must be an object"),e;if(ye(e))return e;if(this.reactiveMap.has(e))return this.reactiveMap.get(e);if(Array.isArray(e))return this.createReactiveArray(e);let t=new Proxy(e,{get:(n,r)=>{if(r===R)return!0;if(r===d)return!1;this.track(n,r);let o=Reflect.get(n,r);if(f(o)&&!h(o,d))return this.reactive(o);return o},set:(n,r,o)=>{if(h(n,d))return console.warn(`Cannot set property ${String(r)} on readonly object`),!1;let i=Reflect.get(n,r);if(f(o)&&!h(o,R)&&!h(o,d))o=this.reactive(o);let s=Reflect.set(n,r,o);if(i!==o)this.trigger(n,r);return s},deleteProperty:(n,r)=>{if(h(n,d))return console.warn(`Cannot delete property ${String(r)} on readonly object`),!1;let o=r in n,i=Reflect.deleteProperty(n,r);if(o)this.trigger(n,r);return i}});return this.reactiveMap.set(e,t),this.proxyMap.set(t,e),t}toRawValue(e){if(f(e)&&this.proxyMap.has(e))return this.proxyMap.get(e);return e}createReactiveArray(e){if(this.reactiveMap.has(e))return this.reactiveMap.get(e);let t=new Proxy(e,{get:(n,r)=>{if(r===R)return!0;if(r===d)return!1;this.track(n,r);let o=Reflect.get(n,r);if(typeof r==="string"&&(r==="includes"||r==="indexOf"||r==="lastIndexOf")){this.track(n,"length");for(let s=0;s<n.length;s++)this.track(n,String(s));let i=o;return(...s)=>{let a=i.apply(n,s);if(a===!1||a===-1){let c=n.map((l)=>this.toRawValue(l));return c[r].apply(c,s.map((l)=>this.toRawValue(l)))}return a}}if(typeof r==="string"&&G.includes(r))return(...i)=>{let a=o.apply(n,i);return this.trigger(n,"length"),this.trigger(n,r),a};if(f(o)&&!h(o,d))return this.reactive(o);return o},set:(n,r,o)=>{if(h(n,d))return console.warn(`Cannot set property ${String(r)} on readonly object`),!1;let i=Reflect.get(n,r);if(f(o)&&!h(o,R)&&!h(o,d))o=this.reactive(o);let s=Reflect.set(n,r,o);if(i!==o){if(this.trigger(n,r),typeof r==="string"&&!isNaN(Number(r)))this.trigger(n,"length")}return s},deleteProperty:(n,r)=>{if(h(n,d))return console.warn(`Cannot delete property ${String(r)} on readonly object`),!1;let o=r in n,i=Reflect.deleteProperty(n,r);if(o)this.trigger(n,r),this.trigger(n,"length");return i}});return this.reactiveMap.set(e,t),this.proxyMap.set(t,e),t}readonly(e){if(!f(e))return console.warn("readonly: target must be an object"),e;if(h(e,d))return e;if(this.readonlyMap.has(e))return this.readonlyMap.get(e);let t=new Proxy(e,{get:(n,r)=>{if(r===R)return!1;if(r===d)return!0;let o=Reflect.get(n,r);if(f(o))return this.readonly(o);return o},set:()=>(console.warn("Cannot set property on readonly object"),!1),deleteProperty:()=>(console.warn("Cannot delete property on readonly object"),!1)});return this.readonlyMap.set(e,t),t}effect(e,t){let{lazy:n=!1,scheduler:r,throwOnError:o=!1}=t||{},i=()=>{if(!i.active)return e();try{return this.cleanup(i),this.effectStack.push(i),this.activeEffect=i,e()}catch(s){if(o)throw s;console.error("Effect error:",s);return}finally{this.effectStack.pop(),this.activeEffect=this.effectStack[this.effectStack.length-1]??null}};if(i.id=ve++,i.deps=[],i.active=!0,i.scheduler=r,!n)i();return i}runWithEffect(e,t){this.effectStack.push(e),this.activeEffect=e;try{return t()}finally{this.effectStack.pop(),this.activeEffect=this.effectStack[this.effectStack.length-1]??null}}computed(e){let t=!0,n,r={},o=()=>{this.track(r,"value")},i=this.effect(()=>{n=e(),t=!1},{lazy:!0,scheduler:()=>{if(!t)t=!0,this.trigger(r,"value")}});return{get value(){if(t)i();return o(),n}}}cleanup(e){e.deps.forEach((t)=>{t.delete(e)}),e.deps.length=0}track(e,t){if(!this.activeEffect||!this.activeEffect.active)return;let n=this.targetMap.get(e);if(!n)n=new Map,this.targetMap.set(e,n);let r=n.get(t);if(!r)r=new Set,n.set(t,r);if(!r.has(this.activeEffect))r.add(this.activeEffect),this.activeEffect.deps.push(r)}trigger(e,t){let n=this.targetMap.get(e);if(!n)return;let r=n.get(t);if(!r)return;new Set(r).forEach((i)=>{if(i.active)if(i.scheduler)i.scheduler(i);else i()})}stop(e){if(e.active)this.cleanup(e),e.active=!1}}function B(e){return m.getInstance().reactive(e)}function qe(e){return m.getInstance().readonly(e)}function g(e,t){return m.getInstance().effect(e,t)}function ze(e){return m.getInstance().computed(e)}function Ye(e){let t={value:e};return Object.defineProperty(t,j,{configurable:!1,enumerable:!1,value:!0}),B(t)}function q(e){return f(e)&&Boolean(Reflect.get(e,j))}function Qe(e){return q(e)?e.value:e}function y(e){m.getInstance().stop(e)}function V(e,t){if(!f(e)||t.has(e))return;if(t.add(e),Array.isArray(e)){e.forEach((n)=>V(n,t));return}Object.keys(e).forEach((n)=>{V(e[n],t)})}function Ze(e,t,n={}){let r=m.getInstance(),o=q(e)?()=>e.value:e,i,s=null,a=()=>{if(!u.active)return;s?.(),s=null;let l=c();t(l,i,(b)=>{s=b}),i=l},c=g(()=>{let l=o();if(n.deep&&f(l))V(l,new Set);return l},{lazy:!0,scheduler:()=>{if(n.sync)a();else E.enqueue(u)}}),u=g(()=>{a()},{lazy:!0});if(n.immediate)a();else i=c();return()=>{r.stop(c),r.stop(u)}}function ye(e){return f(e)&&h(e,R)}function Je(e){return f(e)&&h(e,d)}function v(e){if(e===void 0||e===null)return[];return Array.isArray(e)?e:[e]}function z(e){return typeof e==="object"&&e!==null&&"component"in e}function Y(e){return typeof e==="object"&&e!==null&&"tag"in e&&e.tag!=="slot"}function Q(e){return typeof e==="object"&&e!==null&&"tag"in e&&e.tag==="slot"}function et(e,t,n,r,o,i){return{tag:e,props:t,children:n,listeners:r,key:o,directions:i}}function Re(e,t={}){return{tag:e,...t}}function p(e){return(t={})=>Re(e,t)}var w=p("div"),tt=p("span"),nt=p("p"),rt=p("button"),ot=p("input"),it=p("section"),st=p("main"),at=p("header"),pt=p("footer"),ct=p("nav"),ut=p("article"),lt=p("aside"),dt=p("h1"),ht=p("h2"),ft=p("h3"),mt=p("h4"),gt=p("h5"),vt=p("h6"),yt=p("strong"),Rt=p("em"),Ct=p("small"),bt=p("pre"),Et=p("code"),xt=p("blockquote"),Tt=p("ul"),wt=p("ol"),St=p("li"),Pt=p("a"),Lt=p("img"),Mt=p("form"),Nt=p("label"),At=p("textarea"),kt=p("select"),It=p("option"),Ht=p("table"),jt=p("thead"),Ot=p("tbody"),Vt=p("tr"),Bt=p("th"),_t=p("td");function Dt(e,t,n,r,o){if(typeof e==="function")return{component:e,props:t,children:n,key:r,directions:o};return{component:e.component,props:e.props,children:e.children,key:e.key,directions:e.directions,emitters:e.emitters}}function Ut(e,t,n){return{tag:"slot",props:{name:e},key:t,directions:n}}function $t(e,t,n){return e.map((r,o)=>{let i=t(r,o);if(typeof i==="string")throw Error("each render callback must return a VNode");if(!n)return i;return{...i,key:n(r,o)}})}function J(e){let t=e.split(".");if(e.length===0||t.some((n)=>n.length===0||n==="__proto__"||n==="prototype"||n==="constructor"))throw Error(`Invalid model path "${e}"`);return t}function D(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function X(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Ce(e){return typeof e==="string"?e:e.path}function Z(e,t){let n=e;for(let r of J(t)){if(!D(n))throw Error(`Invalid model path "${t}"`);if(!X(n,r)){if(r in n)throw Error(`Invalid model path "${t}"`);return}n=n[r]}return n}function be(e,t,n){let r=J(t),o=e;for(let s of r.slice(0,-1)){if(!X(o,s)){if(s in o)throw Error(`Invalid model path "${t}"`);o[s]={}}else if(!D(o[s]))throw Error(`Invalid model path "${t}"`);let a=o[s];if(!D(a))throw Error(`Invalid model path "${t}"`);o=a}let i=r[r.length-1];o[i]=n}function _(e,t){if(typeof e!=="string"&&e.format)return e.format(t);return t===void 0||t===null?"":String(t)}function Ee(e,t){if(typeof e!=="string"&&e.parse)return e.parse(t);return t}function xe(e,t,n){if(e instanceof HTMLInputElement){if(e.type==="checkbox"){e.checked=Array.isArray(n)?n.some((r)=>String(r)===e.value):Boolean(n);return}if(e.type==="radio"){e.checked=n===e.value;return}e.value=_(t,n);return}if(e instanceof HTMLTextAreaElement){e.value=_(t,n);return}if(e instanceof HTMLSelectElement){if(e.multiple){let r=Array.isArray(n)?new Set(n.map(String)):new Set;for(let o=0;o<e.options.length;o+=1){let i=e.options.item(o);if(!i)continue;i.selected=r.has(i.value)}return}e.value=_(t,n)}}function Te(e,t){if(e instanceof HTMLInputElement){if(e.type==="checkbox"){if(Array.isArray(t)){let n=t.filter((r)=>String(r)!==e.value);return e.checked?[...n,e.value]:n}return e.checked}if(e.type==="radio")return e.checked?e.value:t;return e.value}if(e instanceof HTMLTextAreaElement)return e.value;if(e instanceof HTMLSelectElement){if(!e.multiple)return e.value;let n=[];for(let r=0;r<e.selectedOptions.length;r+=1){let o=e.selectedOptions.item(r);if(o)n.push(o.value)}return n}return}class U{bindings=new WeakMap;bind(e,t,n){if(!this.isSupportedControl(e))return;let r=this.bindings.get(e);if(r&&this.sameBinding(r,t))return;this.cleanup(e);let o=Ce(t),i=()=>xe(e,t,Z(n,o)),s=e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&!["checkbox","radio"].includes(e.type)?"input":"change",a=()=>{let u=Z(n,o);be(n,o,Ee(t,Te(e,u)))};e.addEventListener(s,a);let c=g(i);this.bindings.set(e,{binding:t,path:o,parse:typeof t==="string"?void 0:t.parse,format:typeof t==="string"?void 0:t.format,eventName:s,listener:a,effect:c})}cleanup(e){let t=this.bindings.get(e);if(!t)return;e.removeEventListener(t.eventName,t.listener),y(t.effect),this.bindings.delete(e)}isSupportedControl(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement}sameBinding(e,t){if(typeof e.binding==="string"||typeof t==="string")return e.binding===t;return e.path===t.path&&e.parse===t.parse&&e.format===t.format}}function L(e){return/^on[A-Z]/.test(e)||/^on[a-z]/.test(e)}function te(e){return e.slice(2).toLowerCase()}function ne(e){let[t,...n]=e.split(".");return{eventName:t,modifiers:new Set(n)}}function re(e,t){let n=(r)=>{if(t.has("stop"))r.stopPropagation();if(t.has("prevent"))r.preventDefault();if(t.has("self")&&r.currentTarget!==r.target)return;if(t.has("once"))r.currentTarget.removeEventListener(r.type,n);e(r)};return n}function oe(e,t,n){let r=t.includes("-")?t:t.replace(/[A-Z]/g,(o)=>`-${o.toLowerCase()}`);e.setProperty(r,ee(n))}var M=null;function ie(e){if(!e||!(e instanceof N))throw Error("Invalid router instance");M=e}function we(){if(!M)throw Error("Router is not initialized. Please make sure you have installed the router plugin.");return M}function se(){return M}var ae="http://www.w3.org/2000/svg",Se=new Set(["svg","g","defs","rect","circle","ellipse","line","polyline","polygon","path","text","tspan","textPath","use","symbol","marker","linearGradient","radialGradient","stop","pattern","mask","clipPath","foreignObject"]);class k{listeners=new WeakMap;effects=new WeakMap;modelBindings=new U;matches(e){return typeof e==="object"&&e!==null&&Y(e)}mount(e,t){if(e.directions?.if===!1)return document.createComment("if");let n=e.tag==="navigator",r=n?document.createElement("a"):Se.has(e.tag)?document.createElementNS(ae,e.tag):document.createElement(e.tag),o=e.props??{};if(n){let{url:i,openType:s,...a}=o,c=typeof i==="string"?i:"#";r.setAttribute("href",c),r.addEventListener("click",(u)=>{let l=se();if(l)u.preventDefault(),l.push(r.getAttribute("href")??"#")}),this.applyProps(r,{},a,t)}else this.applyProps(r,{},o,t);return this.updateListeners(r,{},this.collectListeners(e)),this.mountChildren(r,e,t),this.applyDirections(r,void 0,e.directions,t),r}patch(e,t,n,r){if(e.tag!==t.tag||n.nodeType===Node.COMMENT_NODE){let i=this.mount(t,r);return n.parentNode?.replaceChild(i,n),this.unmount(e,n,r),i}if(!(n instanceof Element))return n;if(t.directions?.if===!1){let i=document.createComment("if");return n.parentNode?.replaceChild(i,n),this.unmount(e,n,r),i}if(t.tag==="navigator"||e.tag==="navigator"){let i=e.props??{},s=t.props??{},a=typeof i.url==="string"?i.url:"",c=typeof s.url==="string"?s.url:"";if(a!==c)n.setAttribute("href",c);let u={...s};delete u.url,delete u.openType,this.applyProps(n,i,u,r)}else this.applyProps(n,e.props??{},t.props??{},r);return this.updateListeners(n,this.collectListeners(e),this.collectListeners(t)),this.updateChildren(n,e,t,r),this.applyDirections(n,e.directions,t.directions,r),n}unmount(e,t,n){if(!(t instanceof Element))return;this.effects.get(t)?.forEach((r)=>y(r)),this.effects.delete(t),this.listeners.get(t)?.forEach(({eventName:r,listener:o})=>{t.removeEventListener(r,o)}),this.listeners.delete(t),this.modelBindings.cleanup(t),this.unmountChildren(t,e,n)}mountChildren(e,t,n){v(t.children).forEach((r)=>{e.appendChild(n.renderer.mount(r,n))})}updateChildren(e,t,n,r){this.updateOrdinaryChildren(e,v(t.children),v(n.children),r)}unmountChildren(e,t,n){v(t.children).forEach((r,o)=>{let i=e.childNodes[o];if(i)n.renderer.unmount(r,i,n)})}applyProps(e,t,n,r){Object.keys(t).forEach((o)=>{if(L(o)||o in n)return;if(o==="className"||o==="class")e.removeAttribute("class");else if(o==="style")e.removeAttribute("style");else if(o==="value"&&typeof e==="object"&&e!==null&&"value"in e)e.value="";else e.removeAttribute(A(o))}),Object.entries(n).forEach(([o,i])=>{if(L(o))return;if(t[o]===i)return;if(o==="className"||o==="class"){if(e.namespaceURI===ae)e.setAttribute("class",String(i??""));else e.className=String(i??"");return}if(o==="value"&&typeof e==="object"&&e!==null&&"value"in e){e.value=String(i??"");return}if(o==="style"&&typeof i==="object"&&i!==null){e.removeAttribute("style");let s=e.style;Object.entries(i).forEach(([a,c])=>{oe(s,a,c)});return}if(i===!1||i===void 0||i===null){e.removeAttribute(A(o));return}if(i===!0){e.setAttribute(A(o),"");return}if(typeof i==="string"&&r.templateEngine.hasExpressions(i)){this.setupReactiveAttribute(e,o,i,r);return}e.setAttribute(A(o),String(i))})}applyDirections(e,t,n,r){if(n&&"show"in n)e.style.display=n.show?"":"none";else if(t&&"show"in t)e.style.display="";if(!n?.model){this.modelBindings.cleanup(e);return}this.modelBindings.bind(e,n.model,r.templateEngine.state)}updateOrdinaryChildren(e,t,n,r){if(this.assertNoDuplicateKeys(t),this.assertNoDuplicateKeys(n),this.hasOnlyKeyedChildren(t,n)){this.updateKeyedChildren(e,t,n,r);return}let o=Math.min(t.length,n.length);for(let i=0;i<o;i+=1){let s=e.childNodes[i];if(!s){e.appendChild(r.renderer.mount(n[i],r));continue}r.renderer.patch(t[i],n[i],s,r)}for(let i=o;i<n.length;i+=1)e.appendChild(r.renderer.mount(n[i],r));for(let i=t.length-1;i>=n.length;i-=1){let s=e.childNodes[i];if(s){if(r.renderer.unmount(t[i],s,r),s.parentNode===e)e.removeChild(s)}}}updateKeyedChildren(e,t,n,r){let o=t.map((a,c)=>({vnode:a,node:e.childNodes[c],index:c})),i=new Map,s=new Set;o.forEach((a)=>{let c=this.getVNodeKey(a.vnode);if(c!==void 0&&a.node)i.set(c,{vnode:a.vnode,node:a.node,index:a.index})}),n.forEach((a,c)=>{let u=this.getVNodeKey(a),l=u===void 0?void 0:i.get(u),b;if(l)b=r.renderer.patch(l.vnode,a,l.node,r),s.add(l.index);else b=r.renderer.mount(a,r);let F=e.childNodes[c]??null;if(b!==F)e.insertBefore(b,F)}),o.forEach((a)=>{if(!a.node||s.has(a.index))return;if(r.renderer.unmount(a.vnode,a.node,r),a.node.parentNode===e)e.removeChild(a.node)})}hasOnlyKeyedChildren(e,t){return[...e,...t].every((n)=>this.getVNodeKey(n)!==void 0)}assertNoDuplicateKeys(e){let t=new Set;e.forEach((n)=>{let r=this.getVNodeKey(n);if(r===void 0)return;if(t.has(r))throw Error(`Duplicate key "${r}"`);t.add(r)})}getVNodeKey(e){if(typeof e==="string")return;return e.key}collectListeners(e){let t={};return Object.entries(e.props??{}).forEach(([n,r])=>{if(L(n)&&typeof r==="function")t[te(n)]=r}),{...t,...e.listeners??{}}}updateListeners(e,t,n){let r=this.listeners.get(e)??new Map,o=new Set(Object.keys(t)),i=new Set(Object.keys(n));o.forEach((s)=>{if(!i.has(s)||t[s]!==n[s]){let a=r.get(s);if(a)e.removeEventListener(a.eventName,a.listener),r.delete(s)}}),i.forEach((s)=>{if(!o.has(s)||t[s]!==n[s]){let{eventName:a,modifiers:c}=ne(s),u=re(n[s],c);e.addEventListener(a,u),r.set(s,{eventName:a,listener:u})}}),this.listeners.set(e,r)}setupReactiveAttribute(e,t,n,r){let o=g(()=>{e.setAttribute(t,r.templateEngine.evaluateTemplateValue(n))});this.trackEffect(e,o)}trackEffect(e,t){let n=this.effects.get(e)??new Set;n.add(t),this.effects.set(e,n)}}function A(e){if(e.startsWith("data")&&e.length>4)return`data${e.slice(4).replace(/[A-Z]/g,(t)=>`-${t.toLowerCase()}`)}`;if(e==="tabIndex"||e==="colSpan"||e==="htmlFor")return e.toLowerCase();return e}class S{strategies;constructor(){this.strategies=[new pe,new ce,new ue,new k]}mount(e,t){return this.findStrategy(e).mount(e,t)}patch(e,t,n,r){let o=this.findStrategy(e),i=this.findStrategy(t);if(o!==i){let s=i.mount(t,r);return n.parentNode?.replaceChild(s,n),o.unmount(e,n,r),s}return o.patch(e,t,n,r)}unmount(e,t,n){this.findStrategy(e).unmount(e,t,n)}findStrategy(e){let t=this.strategies.find((n)=>n.matches(e));if(!t)throw Error("No render strategy found for vnode");return t}}class pe{matches(e){return typeof e==="string"}mount(e,t){return t.templateEngine.parseTemplate(e)}patch(e,t,n,r){if(e===t)return n;let o=this.mount(t,r);return n.parentNode?.replaceChild(o,n),o}unmount(){}}class ce{instances=new WeakMap;instanceNodes=new Map;emitterUnsubscribers=new WeakMap;matches(e){return typeof e==="object"&&e!==null&&z(e)}mount(e,t){if(e.directions?.if===!1)return document.createComment("if");let r=new e.component(this.createProps(e));if(t.appContext&&r.setAppContext)r.setAppContext(t.appContext);this.syncEmitters(r,e.emitters??{}),t.registerChild(r);let o=r.mountToNode();return this.trackInstanceNode(r,o),r.setElementChangeListener?.((i,s)=>{this.trackInstanceNode(r,i),this.trackInstanceNode(r,s)}),o}patch(e,t,n,r){if(n.nodeType===Node.COMMENT_NODE){let s=this.mount(t,r);return n.parentNode?.replaceChild(s,n),s}if(t.directions?.if===!1){let s=document.createComment("if");return n.parentNode?.replaceChild(s,n),this.unmount(e,n,r),s}let o=this.instances.get(n);if(o&&e.component===t.component){this.syncEmitters(o,t.emitters??{}),o.setProps(this.createProps(t));let s=o.getElement()??n;return this.trackInstanceNode(o,s),s}let i=this.mount(t,r);return n.parentNode?.replaceChild(i,n),this.unmount(e,n,r),i}unmount(e,t,n){let r=this.instances.get(t);if(r)this.clearEmitters(r),r.unmount(),this.clearInstanceNodes(r),n.unregisterChild(r)}createProps(e){return{...e.props??{},children:v(e.children)}}syncEmitters(e,t){let n=this.emitterUnsubscribers.get(e)??new Map;n.forEach(({listener:r,unsubscribe:o},i)=>{let s=t[i];if(!s||s!==r)o(),n.delete(i)}),Object.entries(t).forEach(([r,o])=>{if(n.get(r)?.listener===o)return;n.set(r,{listener:o,unsubscribe:e.on(r,o)})}),this.emitterUnsubscribers.set(e,n)}clearEmitters(e){this.emitterUnsubscribers.get(e)?.forEach(({unsubscribe:t})=>{t()}),this.emitterUnsubscribers.delete(e)}trackInstanceNode(e,t){this.instances.set(t,e);let n=this.instanceNodes.get(e)??new Set;n.add(t),this.instanceNodes.set(e,n)}clearInstanceNodes(e){this.instanceNodes.get(e)?.forEach((t)=>{this.instances.delete(t)}),this.instanceNodes.delete(e)}}class ue{renderedChildren=new WeakMap;matches(e){return typeof e==="object"&&e!==null&&Q(e)}mount(e,t){if(e.directions?.if===!1)return document.createComment("if");let n=document.createElement("div");return n.setAttribute("data-slot",e.props.name),this.mountSlotChildren(n,this.resolveChildren(e,t),t),n}patch(e,t,n,r){if(n.nodeType===Node.COMMENT_NODE){let o=this.mount(t,r);return n.parentNode?.replaceChild(o,n),o}if(t.directions?.if===!1){let o=document.createComment("if");return n.parentNode?.replaceChild(o,n),this.unmount(e,n,r),o}if(n instanceof HTMLElement)n.setAttribute("data-slot",t.props.name),this.replaceSlotChildren(n,e,t,r);return n}unmount(e,t,n){if(!(t instanceof HTMLElement))return;this.unmountSlotChildren(t,n),this.renderedChildren.delete(t)}resolveChildren(e,t){return t.slots[e.props.name]??v(e.children)}replaceSlotChildren(e,t,n,r){let o=this.renderedChildren.get(e)??[],i=this.resolveChildren(n,r),s=Math.min(o.length,i.length);for(let a=0;a<s;a+=1){let c=e.childNodes[a];if(!c){e.appendChild(r.renderer.mount(i[a],r));continue}r.renderer.patch(o[a],i[a],c,r)}for(let a=s;a<i.length;a+=1)e.appendChild(r.renderer.mount(i[a],r));for(let a=o.length-1;a>=i.length;a-=1){let c=e.childNodes[a];if(c){if(r.renderer.unmount(o[a],c,r),c.parentNode===e)e.removeChild(c)}}this.renderedChildren.set(e,i)}mountSlotChildren(e,t,n){t.forEach((r)=>{e.appendChild(n.renderer.mount(r,n))}),this.renderedChildren.set(e,t)}unmountSlotChildren(e,t){(this.renderedChildren.get(e)??[]).forEach((r,o)=>{let i=e.childNodes[o];if(i)t.renderer.unmount(r,i,t)})}}class C{state;bindings=[];templateRegex=/{{(.*?)}}/g;constructor(e){this.state=e;if(!e||typeof e!=="object")throw Error("TemplateEngine requires a valid state object")}parseTemplate(e){if(typeof e!=="string")e=String(e);let t=document.createTextNode("");this.templateRegex.lastIndex=0;let n=Array.from(e.matchAll(this.templateRegex));if(n&&n.length>0)this.setupReactiveBindings(t,e,n);else t.textContent=e;return t}setupReactiveBindings(e,t,n){let r=new Set,o=this.evaluateTemplate(t,n,r);e.textContent=o;let i=g(()=>{try{let s=this.evaluateTemplate(t,n,r);if(e.textContent!==s)e.textContent=s}catch(s){console.error("Template update error:",s),e.textContent=`Error: ${s instanceof Error?s.message:"Unknown error"}`}});this.bindings.push({node:e,originalText:t,effect:i})}evaluateTemplate(e,t,n){let r=e;return t.forEach((o)=>{let i=o[1]?.trim();if(i){n.add(i);let s=this.getValueFromState(i),a=s===void 0||s===null?"":String(s);r=r.replace(o[0],a)}}),r}getValueFromState(e){if(!e)return;let t=e.split("."),n=this.state;for(let r of t){if(!n||typeof n!=="object")return;n=n[r]}return n}clearBindings(){this.bindings.forEach((e)=>{y(e.effect)}),this.bindings=[]}getBindingCount(){return this.bindings.length}hasExpressions(e){return this.templateRegex.lastIndex=0,this.templateRegex.test(e)}extractKeys(e){let t=[],n,r=new RegExp(this.templateRegex,"g");while((n=r.exec(e))!==null){let o=n[1]?.trim();if(o)t.push(o)}return t}evaluateTemplateValue(e){this.templateRegex.lastIndex=0;let t=Array.from(e.matchAll(this.templateRegex));if(!t||t.length===0)return e;let n=new Set;return this.evaluateTemplate(e,t,n)}}class P{props;vnode=null;el=null;renderer=new S;templateEngine;childComponents=new Set;eventListeners={};providers=new Map;updateEffect;appContext=null;parentComponent=null;elementChangeListener=null;styleManager;state;mounted=!1;constructor(e={}){this.props=e;this.styleManager=new le,this.state=B(this.initState()??{}),this.templateEngine=new C(this.state),this.initStyles(),this.updateEffect=g(()=>{if(this.mounted)try{this.update()}catch(t){if(!this.dispatchError(t))throw t}},{throwOnError:!0,scheduler:(t)=>{E.enqueue(t)}})}mount(e){if(!e||!(e instanceof HTMLElement))throw Error("Invalid container element");try{e.appendChild(this.mountToNode())}catch(t){throw console.error("组件渲染错误:",t),t}}mountToNode(){if(this.mounted&&this.el)return this.el;return this.beforeMount(),this.el=m.getInstance().runWithEffect(this.updateEffect,()=>{try{return this.vnode=this.render(),this.renderer.mount(this.vnode,this.createRenderContext())}catch(e){if(this.dispatchError(e))return document.createComment("error-boundary");throw e}}),this.mounted=!0,this.onMounted(),this.el}update(){if(!this.el||!this.vnode)return;this.beforeUpdate();let e=this.vnode,t=this.el;if(this.el=m.getInstance().runWithEffect(this.updateEffect,()=>{let n=this.render(),r=this.renderer.patch(e,n,t,this.createRenderContext());return this.vnode=n,r}),t!==this.el)this.elementChangeListener?.(t,this.el);this.onUpdated()}unmount(){if(!this.mounted)return;if(this.beforeUnmount(),this.vnode&&this.el)this.renderer.unmount(this.vnode,this.el,this.createRenderContext());if(this.childComponents.clear(),Object.keys(this.eventListeners).forEach((e)=>{this.eventListeners[e].clear(),delete this.eventListeners[e]}),this.providers.clear(),this.parentComponent=null,this.elementChangeListener=null,this.templateEngine.clearBindings(),this.styleManager.destroy(),y(this.updateEffect),this.el?.parentNode)this.el.parentNode.removeChild(this.el);this.el=null,this.vnode=null,this.mounted=!1,this.onUnmounted()}setProps(e){if(this.props={...this.props,...e},this.mounted)E.enqueue(this.updateEffect)}setState(e){Object.assign(this.state,e)}setAppContext(e){this.appContext=e,this.childComponents.forEach((t)=>{t.setAppContext?.(e)})}setParentComponent(e){this.parentComponent=e}getParentComponent(){return this.parentComponent}setElementChangeListener(e){this.elementChangeListener=e}provide(e,t){this.providers.set(e,t)}inject(e,t){let n=this.resolveInjection(e);return n.found?n.value:t}resolveInjection(e){if(this.providers.has(e))return{found:!0,value:this.providers.get(e)};if(this.parentComponent?.resolveInjection)return this.parentComponent.resolveInjection(e);return this.resolveAppInjection(e)}getElement(){return this.el}beforeMount(){}onMounted(){}beforeUpdate(){}onUpdated(){}beforeUnmount(){}onUnmounted(){}dispatchError(e){let t=this.getParentComponent();while(t){let n=t;if(typeof n.onErrorCaptured==="function"){if(n.onErrorCaptured(e,this)===!1)return!0}t=t.getParentComponent?.()??null}return!1}getContext(){return this.appContext}get router(){return this.getRouterFrom(this.appContext)??this.getRouterFromGlobalApp()}emit(e,...t){this.eventListeners[e]?.forEach((n)=>{n(...t)})}on(e,t){if(!this.eventListeners[e])this.eventListeners[e]=new Set;return this.eventListeners[e].add(t),()=>this.off(e,t)}off(e,t){this.eventListeners[e]?.delete(t)}createRenderContext(){return{appContext:this.appContext,templateEngine:this.templateEngine,renderer:this.renderer,slots:this.collectSlots(),registerChild:(e)=>{this.childComponents.add(e),e.setParentComponent?.(this),e.setAppContext?.(this.appContext)},unregisterChild:(e)=>{this.childComponents.delete(e),e.setParentComponent?.(null)}}}collectSlots(){let e={default:[]};return v(this.props.children).forEach((n)=>{let r=this.getSlotName(n);if(!e[r])e[r]=[];e[r].push(this.normalizeSlotChild(n))}),e}getSlotName(e){if(typeof e==="string")return"default";return"slot"in e&&typeof e.slot==="string"?e.slot:"default"}normalizeSlotChild(e){if(typeof e==="string"||!("slot"in e))return e;let t={...e};return delete t.slot,t}getRouterFrom(e){if(!e||typeof e!=="object"||!("router"in e))return;return e.router}getRouterFromGlobalApp(){let e=globalThis.__APP__;return this.getRouterFrom(e)}resolveAppInjection(e){if(!this.appContext||typeof this.appContext!=="object")return{found:!1,value:void 0};return this.appContext.app?.resolveInjection?.(e)??{found:!1,value:void 0}}}function x(e){if(!e.startsWith("/"))return`/${e}`;return e||"/"}function I(e,t){let n=x(t.split("?")[0]);for(let i of e){if(i.path==="*")continue;let s=Pe(i.path,n);if(s)return{route:i,params:s}}let r=e.find((i)=>i.path==="*");if(r)return{route:r,params:{pathMatch:n}};let o=e.find((i)=>i.path==="/");return o?{route:o,params:{}}:null}function Pe(e,t){let n=de(e),r=de(t);if(n.length!==r.length)return null;let o={};for(let i=0;i<n.length;i+=1){let s=n[i],a=r[i];if(s.startsWith(":")){let c=s.slice(1);if(!c)return null;o[decodeURIComponent(c)]=decodeURIComponent(a);continue}if(s!==a)return null}return o}function de(e){let t=x(e);if(t==="/")return[];return t.split("/").filter(Boolean)}function he(e,t,n){let r=x(e),o=n==="/"?r:n+r;return t==="hash"?`#${o}`:o}function fe(e,t){let n,r,o;if(e==="history")r=window.location.pathname+window.location.search,n=window.location.pathname,o=window.location.search;else{r=window.location.hash||"#/",n=r.startsWith("#")?r.slice(1):r;let s=n.indexOf("?");o=s>=0?n.slice(s+1):"",n=s>=0?n.slice(0,s):n}if(n.startsWith(t)&&t!=="/"&&n!=="/")n=n.slice(t.length);return n=x(n),{path:n,fullPath:r,query:Le(o),params:{}}}function K(e,t,n,r){let o=x(e),i=r==="/"?o:r+o;if(n==="history"){if(t)window.history.replaceState({},"",i);else window.history.pushState({},"",i);return}if(t){let s=window.location.href.split("#")[0];window.location.replace(`${s}#${i}`);return}window.location.hash=i}function Le(e){let t={},n=e.startsWith("?")?e.slice(1):e;if(!n)return t;return n.split("&").forEach((r)=>{let[o,i]=r.split("=");if(o)t[decodeURIComponent(o)]=i?decodeURIComponent(i):""}),t}function Me(e){let t=e.indexOf("?");if(t<0)return{};let n=e.slice(t+1),r={};if(!n)return r;return n.split("&").forEach((o)=>{let[i,s]=o.split("=");if(i)r[decodeURIComponent(i)]=s?decodeURIComponent(s):""}),r}class N{currentRoute=null;currentLocation=null;routes=[];app=null;mode;base;routeChangeListeners=[];beforeGuards=[];afterHooks=[];removeWindowListener;constructor(e){let t=Array.isArray(e)?{routes:e}:e;this.routes=t.routes||[],this.mode=t.mode||"history",this.base=t.base||"/",this.validateRoutes(),this.initEvents(),this.resolveCurrentRoute()}install(e){this.app=e,e.router=this,ie(this);let t=e.getContext();t.router=this,this.resolveCurrentRoute()}push(e){this.navigate(e,!1)}replace(e){this.navigate(e,!0)}forward(){window.history.forward()}back(){window.history.back()}go(e){window.history.go(e)}getCurrentRoute(){if(!this.currentLocation)this.resolveCurrentRoute();return this.currentLocation}getCurrentRouteRecord(){if(!this.currentRoute)this.resolveCurrentRoute();return this.currentRoute}onRouteChange(e){return this.routeChangeListeners.push(e),()=>{let t=this.routeChangeListeners.indexOf(e);if(t>-1)this.routeChangeListeners.splice(t,1)}}beforeEach(e){return this.beforeGuards.push(e),()=>{let t=this.beforeGuards.indexOf(e);if(t>-1)this.beforeGuards.splice(t,1)}}afterEach(e){return this.afterHooks.push(e),()=>{let t=this.afterHooks.indexOf(e);if(t>-1)this.afterHooks.splice(t,1)}}getRoutes(){return[...this.routes]}addRoute(e){if(this.routes.some((n)=>n.path===e.path))throw Error(`Route already exists: ${e.path}`);if(this.routes.push(e),this.getCurrentLocation().path===e.path)this.handleRouteChange()}createHref(e){return he(e,this.mode,this.base)}destroy(){if(this.removeWindowListener?.(),this.removeWindowListener=void 0,this.app?.router===this)this.app.router=void 0;this.app=null}navigate(e,t){if(!e||typeof e!=="string")throw Error("Path must be a non-empty string");let n=this.currentLocation,r=this.resolveTarget(e);if(!r)return;let o=r.location;for(let i of this.beforeGuards){let s=i(o,n);if(s===!1)return;if(typeof s==="string"&&s!==e){this.navigate(s,t);return}}if(n&&this.isSameLocation(n,o))return;K(r.path,t,this.mode,this.base),this.currentRoute=r.route,this.currentLocation=o,this.triggerRouteChangeListeners(o,n),this.afterHooks.forEach((i)=>{try{i(o,n)}catch(s){console.error("Route afterEach error:",s)}})}resolveTarget(e){let t=I(this.routes,e.split("?")[0]);if(!t)return null;let n=this.applyRedirect(t),r=n?.path??e,o=n?.route??t.route;return{path:r,route:o,location:{path:r.split("?")[0],query:Me(r),params:n?.params??t.params,fullPath:r,name:o?.name,meta:o?.meta}}}applyRedirect(e){let t=new Set,n=e,r="";while(n.route.redirect){if(t.has(n.route.path))throw Error(`Redirect loop detected for route: ${n.route.path}`);t.add(n.route.path),r=n.route.redirect;let o=I(this.routes,r.split("?")[0]);if(!o)return null;n=o}return r?{route:n.route,params:n.params,path:r}:null}validateRoutes(){if(!Array.isArray(this.routes))throw Error("Router routes must be an array");let e=new Set;this.routes.forEach((t)=>{if(!t.component&&!t.redirect)throw Error(`Route ${t.path} must define a component or redirect`);if(e.has(t.path))throw Error(`Duplicate route path: ${t.path}`);e.add(t.path)})}initEvents(){if(typeof window>"u")return;let e=this.mode==="history"?"popstate":"hashchange",t=()=>{this.handleRouteChange()};window.addEventListener(e,t),this.removeWindowListener=()=>{window.removeEventListener(e,t)}}handleRouteChange(){let e=this.currentLocation,t=this.resolveCurrentRoute();if(!this.isSameLocation(e,t))this.triggerRouteChangeListeners(t,e)}resolveCurrentRoute(){let e=this.getCurrentLocation(),t=I(this.routes,e.path),n=t?this.applyRedirect(t):null,r=n?.route??t?.route??null;if(n&&n.path!==e.path)K(n.path,!0,this.mode,this.base);if(this.currentRoute=r,this.currentLocation={...e,params:n?.params??t?.params??{},name:r?.name,meta:r?.meta},this.afterHooks.length>0){let o=this.currentLocation;this.afterHooks.forEach((i)=>{try{i(o,null)}catch(s){console.error("Route afterEach error:",s)}})}return this.currentLocation}getCurrentLocation(){return fe(this.mode,this.base)}isSameLocation(e,t){return e?.fullPath===t?.fullPath&&e?.name===t?.name}triggerRouteChangeListeners(e,t){this.routeChangeListeners.forEach((n)=>{try{n(e,t)}catch(r){console.error("Route change listener error:",r)}})}}class Ne extends P{unsubscribe;initState(){return{currentPath:this.router?.getCurrentRoute()?.path??window.location.pathname}}initStyles(){}onMounted(){let e=this.router;this.unsubscribe=e?.onRouteChange((t)=>{this.state.currentPath=t.path})}onUnmounted(){this.unsubscribe?.()}render(){let e=this.router,t=this.props.activeClass??"active",n=this.state.currentPath===this.props.to,r=[this.props.className,n?t:void 0].filter(Boolean).join(" ");return{tag:"a",props:{href:e?.createHref(this.props.to)??this.props.to,className:r},listeners:{click:(o)=>{if(o.preventDefault(),this.props.replace)e?.replace(this.props.to);else e?.push(this.props.to)}},children:this.props.children&&this.props.children.length>0?this.props.children:[this.props.to]}}}class Ae extends P{unsubscribe;initState(){let e=this.router;return{route:e?.getCurrentRoute()??null,record:e?.getCurrentRouteRecord()??null}}initStyles(){}onMounted(){let e=this.router;this.unsubscribe=e?.onRouteChange((t)=>{this.state.route=t,this.state.record=e.getCurrentRouteRecord()})}onUnmounted(){this.unsubscribe?.()}render(){let e=this.state.record??this.router?.getCurrentRouteRecord();return{tag:"div",props:{"data-router-view":""},children:e?.component?[{component:e.component}]:[]}}}function Dn(e){return new N(e)}var ke=new Set(["base","link","meta"]);function me(e){let t=e.lang??"en",n=e.charset??"utf-8",r=e.viewport??"width=device-width, initial-scale=1",o=H({lang:t,...e.htmlAttributes??{}}),i=H(e.bodyAttributes),s=Ie(e.body);return["<!doctype html>",`<html${o}>`,"<head>",` <meta charset="${T(n)}">`,` <meta name="viewport" content="${T(r)}">`,` <title>${T(e.title)}</title>`,e.description?` <meta name="description" content="${T(e.description)}">`:"",...(e.head??[]).map((a)=>` ${He(a)}`),e.styles&&e.styles.length>0?` <style>${W(e.styles)}</style>`:"","</head>",`<body${i}>`,s,...(e.scripts??[]).map((a)=>` ${je(a)}`),"</body>","</html>"].filter((a)=>a!=="").join(`
|
|
2
|
-
`)}function Ie(e){if(typeof document>"u")throw Error("renderHtmlDocument requires a DOM-like document");let t=document.createElement("div"),n=new
|
|
1
|
+
import{Ca as ee,Da as le,Ea as F}from"./index-qmpx307q.js";var C=Symbol("is_reactive"),d=Symbol("is_readonly"),O=Symbol("is_ref"),G=["push","pop","shift","unshift","splice","sort","reverse"];function h(e,t){return Boolean(Reflect.get(e,t))}function f(e){return e!==null&&typeof e==="object"}class V{pending=new Set;flushing=!1;flushPromise=null;flushResolve=null;enqueue(e){if(this.pending.has(e))return;if(this.pending.add(e),!this.flushing)queueMicrotask(()=>this.flush())}flush(){if(this.flushing)return;this.flushing=!0;try{while(this.pending.size>0){let e=Array.from(this.pending);this.pending.clear();for(let t of e)if(t.active)t()}}finally{this.flushing=!1;let e=this.flushResolve;this.flushResolve=null,this.flushPromise=null,e?.()}}nextTick(){if(!this.flushing&&this.pending.size===0)return Promise.resolve();if(this.flushPromise)return this.flushPromise;return this.flushPromise=new Promise((e)=>{this.flushResolve=e}),this.flushPromise}}var ve=0,E=new V;function Ge(){return E.nextTick()}function qe(){E.flush()}class m{static instance;activeEffect=null;effectStack=[];targetMap=new WeakMap;reactiveMap=new WeakMap;readonlyMap=new WeakMap;proxyMap=new WeakMap;constructor(){}static getInstance(){if(!m.instance)m.instance=new m;return m.instance}reactive(e){if(!f(e))return console.warn("reactive: target must be an object"),e;if(ye(e))return e;if(this.reactiveMap.has(e))return this.reactiveMap.get(e);if(Array.isArray(e))return this.createReactiveArray(e);let t=new Proxy(e,{get:(n,r)=>{if(r===C)return!0;if(r===d)return!1;this.track(n,r);let o=Reflect.get(n,r);if(f(o)&&!h(o,d))return this.reactive(o);return o},set:(n,r,o)=>{if(h(n,d))return console.warn(`Cannot set property ${String(r)} on readonly object`),!1;let i=Reflect.get(n,r);if(f(o)&&!h(o,C)&&!h(o,d))o=this.reactive(o);let s=Reflect.set(n,r,o);if(i!==o)this.trigger(n,r);return s},deleteProperty:(n,r)=>{if(h(n,d))return console.warn(`Cannot delete property ${String(r)} on readonly object`),!1;let o=r in n,i=Reflect.deleteProperty(n,r);if(o)this.trigger(n,r);return i}});return this.reactiveMap.set(e,t),this.proxyMap.set(t,e),t}toRawValue(e){if(f(e)&&this.proxyMap.has(e))return this.proxyMap.get(e);return e}createReactiveArray(e){if(this.reactiveMap.has(e))return this.reactiveMap.get(e);let t=new Proxy(e,{get:(n,r)=>{if(r===C)return!0;if(r===d)return!1;this.track(n,r);let o=Reflect.get(n,r);if(typeof r==="string"&&(r==="includes"||r==="indexOf"||r==="lastIndexOf")){this.track(n,"length");for(let s=0;s<n.length;s++)this.track(n,String(s));let i=o;return(...s)=>{let a=i.apply(n,s);if(a===!1||a===-1){let c=n.map((u)=>this.toRawValue(u));return c[r].apply(c,s.map((u)=>this.toRawValue(u)))}return a}}if(typeof r==="string"&&G.includes(r))return(...i)=>{let a=o.apply(n,i);return this.trigger(n,"length"),this.trigger(n,r),a};if(f(o)&&!h(o,d))return this.reactive(o);return o},set:(n,r,o)=>{if(h(n,d))return console.warn(`Cannot set property ${String(r)} on readonly object`),!1;let i=Reflect.get(n,r);if(f(o)&&!h(o,C)&&!h(o,d))o=this.reactive(o);let s=Reflect.set(n,r,o);if(i!==o){if(this.trigger(n,r),typeof r==="string"&&!isNaN(Number(r)))this.trigger(n,"length")}return s},deleteProperty:(n,r)=>{if(h(n,d))return console.warn(`Cannot delete property ${String(r)} on readonly object`),!1;let o=r in n,i=Reflect.deleteProperty(n,r);if(o)this.trigger(n,r),this.trigger(n,"length");return i}});return this.reactiveMap.set(e,t),this.proxyMap.set(t,e),t}readonly(e){if(!f(e))return console.warn("readonly: target must be an object"),e;if(h(e,d))return e;if(this.readonlyMap.has(e))return this.readonlyMap.get(e);let t=new Proxy(e,{get:(n,r)=>{if(r===C)return!1;if(r===d)return!0;let o=Reflect.get(n,r);if(f(o))return this.readonly(o);return o},set:()=>(console.warn("Cannot set property on readonly object"),!1),deleteProperty:()=>(console.warn("Cannot delete property on readonly object"),!1)});return this.readonlyMap.set(e,t),t}effect(e,t){let{lazy:n=!1,scheduler:r,throwOnError:o=!1}=t||{},i=()=>{if(!i.active)return e();try{return this.cleanup(i),this.effectStack.push(i),this.activeEffect=i,e()}catch(s){if(o)throw s;console.error("Effect error:",s);return}finally{this.effectStack.pop(),this.activeEffect=this.effectStack[this.effectStack.length-1]??null}};if(i.id=ve++,i.deps=[],i.active=!0,i.scheduler=r,!n)i();return i}runWithEffect(e,t){this.effectStack.push(e),this.activeEffect=e;try{return t()}finally{this.effectStack.pop(),this.activeEffect=this.effectStack[this.effectStack.length-1]??null}}computed(e){let t=!0,n,r={},o=()=>{this.track(r,"value")},i=this.effect(()=>{n=e(),t=!1},{lazy:!0,scheduler:()=>{if(!t)t=!0,this.trigger(r,"value")}});return{get value(){if(t)i();return o(),n}}}cleanup(e){e.deps.forEach((t)=>{t.delete(e)}),e.deps.length=0}track(e,t){if(!this.activeEffect||!this.activeEffect.active)return;let n=this.targetMap.get(e);if(!n)n=new Map,this.targetMap.set(e,n);let r=n.get(t);if(!r)r=new Set,n.set(t,r);if(!r.has(this.activeEffect))r.add(this.activeEffect),this.activeEffect.deps.push(r)}trigger(e,t){let n=this.targetMap.get(e);if(!n)return;let r=n.get(t);if(!r)return;new Set(r).forEach((i)=>{if(i.active)if(i.scheduler)i.scheduler(i);else i()})}stop(e){if(e.active)this.cleanup(e),e.active=!1}}function _(e){return m.getInstance().reactive(e)}function ze(e){return m.getInstance().readonly(e)}function g(e,t){return m.getInstance().effect(e,t)}function Ye(e){return m.getInstance().computed(e)}function Qe(e){let t={value:e};return Object.defineProperty(t,O,{configurable:!1,enumerable:!1,value:!0}),_(t)}function q(e){return f(e)&&Boolean(Reflect.get(e,O))}function Ze(e){return q(e)?e.value:e}function R(e){m.getInstance().stop(e)}function B(e,t){if(!f(e)||t.has(e))return;if(t.add(e),Array.isArray(e)){e.forEach((n)=>B(n,t));return}Object.keys(e).forEach((n)=>{B(e[n],t)})}function Je(e,t,n={}){let r=m.getInstance(),o=q(e)?()=>e.value:e,i,s=null,a=()=>{if(!l.active)return;s?.(),s=null;let u=c();t(u,i,(y)=>{s=y}),i=u},c=g(()=>{let u=o();if(n.deep&&f(u))B(u,new Set);return u},{lazy:!0,scheduler:()=>{if(n.sync)a();else E.enqueue(l)}}),l=g(()=>{a()},{lazy:!0});if(n.immediate)a();else i=c();return()=>{r.stop(c),r.stop(l)}}function ye(e){return f(e)&&h(e,C)}function Xe(e){return f(e)&&h(e,d)}function v(e){if(e===void 0||e===null)return[];return Array.isArray(e)?e:[e]}function z(e){return typeof e==="object"&&e!==null&&"component"in e}function Y(e){return typeof e==="object"&&e!==null&&"tag"in e&&e.tag!=="slot"}function Q(e){return typeof e==="object"&&e!==null&&"tag"in e&&e.tag==="slot"}function tt(e,t,n,r,o,i){return{tag:e,props:t,children:n,listeners:r,key:o,directions:i}}function Re(e,t={}){return{tag:e,...t}}function p(e){return(t={})=>Re(e,t)}var S=p("div"),nt=p("span"),rt=p("p"),ot=p("button"),it=p("input"),st=p("section"),at=p("main"),pt=p("header"),ct=p("footer"),ut=p("nav"),lt=p("article"),dt=p("aside"),ht=p("h1"),ft=p("h2"),mt=p("h3"),gt=p("h4"),vt=p("h5"),yt=p("h6"),Rt=p("strong"),Ct=p("em"),bt=p("small"),Et=p("pre"),xt=p("code"),Tt=p("blockquote"),wt=p("ul"),St=p("ol"),Pt=p("li"),Lt=p("a"),Mt=p("img"),Nt=p("form"),At=p("label"),kt=p("textarea"),It=p("select"),Ht=p("option"),jt=p("table"),Ot=p("thead"),Vt=p("tbody"),Bt=p("tr"),_t=p("th"),Dt=p("td");function Ut(e,t,n,r,o){if(typeof e==="function")return{component:e,props:t,children:n,key:r,directions:o};return{component:e.component,props:e.props,children:e.children,key:e.key,directions:e.directions,emitters:e.emitters}}function $t(e,t,n){return{tag:"slot",props:{name:e},key:t,directions:n}}function Kt(e,t,n){return e.map((r,o)=>{let i=t(r,o);if(typeof i==="string")throw Error("each render callback must return a VNode");if(!n)return i;return{...i,key:n(r,o)}})}function J(e){let t=e.split(".");if(e.length===0||t.some((n)=>n.length===0||n==="__proto__"||n==="prototype"||n==="constructor"))throw Error(`Invalid model path "${e}"`);return t}function U(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function X(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Ce(e){return typeof e==="string"?e:e.path}function Z(e,t){let n=e;for(let r of J(t)){if(!U(n))throw Error(`Invalid model path "${t}"`);if(!X(n,r)){if(r in n)throw Error(`Invalid model path "${t}"`);return}n=n[r]}return n}function be(e,t,n){let r=J(t),o=e;for(let s of r.slice(0,-1)){if(!X(o,s)){if(s in o)throw Error(`Invalid model path "${t}"`);o[s]={}}else if(!U(o[s]))throw Error(`Invalid model path "${t}"`);let a=o[s];if(!U(a))throw Error(`Invalid model path "${t}"`);o=a}let i=r[r.length-1];o[i]=n}function D(e,t){if(typeof e!=="string"&&e.format)return e.format(t);return t===void 0||t===null?"":String(t)}function Ee(e,t){if(typeof e!=="string"&&e.parse)return e.parse(t);return t}function xe(e,t,n){if(e instanceof HTMLInputElement){if(e.type==="checkbox"){e.checked=Array.isArray(n)?n.some((r)=>String(r)===e.value):Boolean(n);return}if(e.type==="radio"){e.checked=n===e.value;return}e.value=D(t,n);return}if(e instanceof HTMLTextAreaElement){e.value=D(t,n);return}if(e instanceof HTMLSelectElement){if(e.multiple){let r=Array.isArray(n)?new Set(n.map(String)):new Set;for(let o=0;o<e.options.length;o+=1){let i=e.options.item(o);if(!i)continue;i.selected=r.has(i.value)}return}e.value=D(t,n)}}function Te(e,t){if(e instanceof HTMLInputElement){if(e.type==="checkbox"){if(Array.isArray(t)){let n=t.filter((r)=>String(r)!==e.value);return e.checked?[...n,e.value]:n}return e.checked}if(e.type==="radio")return e.checked?e.value:t;return e.value}if(e instanceof HTMLTextAreaElement)return e.value;if(e instanceof HTMLSelectElement){if(!e.multiple)return e.value;let n=[];for(let r=0;r<e.selectedOptions.length;r+=1){let o=e.selectedOptions.item(r);if(o)n.push(o.value)}return n}return}class K{bindings=new WeakMap;bind(e,t,n){if(!this.isSupportedControl(e))return;let r=this.bindings.get(e);if(r&&this.sameBinding(r,t))return;this.cleanup(e);let o=Ce(t),i=()=>xe(e,t,Z(n,o)),s=e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&!["checkbox","radio"].includes(e.type)?"input":"change",a=()=>{let l=Z(n,o);be(n,o,Ee(t,Te(e,l)))};e.addEventListener(s,a);let c=g(i);this.bindings.set(e,{binding:t,path:o,parse:typeof t==="string"?void 0:t.parse,format:typeof t==="string"?void 0:t.format,eventName:s,listener:a,effect:c})}cleanup(e){let t=this.bindings.get(e);if(!t)return;e.removeEventListener(t.eventName,t.listener),R(t.effect),this.bindings.delete(e)}isSupportedControl(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement}sameBinding(e,t){if(typeof e.binding==="string"||typeof t==="string")return e.binding===t;return e.path===t.path&&e.parse===t.parse&&e.format===t.format}}function M(e){return/^on[A-Z]/.test(e)||/^on[a-z]/.test(e)}function te(e){return e.slice(2).toLowerCase()}function ne(e){let[t,...n]=e.split(".");return{eventName:t,modifiers:new Set(n)}}function re(e,t){let n=(r)=>{if(t.has("stop"))r.stopPropagation();if(t.has("prevent"))r.preventDefault();if(t.has("self")&&r.currentTarget!==r.target)return;if(t.has("once"))r.currentTarget.removeEventListener(r.type,n);e(r)};return n}function oe(e,t,n){let r=t.includes("-")?t:t.replace(/[A-Z]/g,(o)=>`-${o.toLowerCase()}`);e.setProperty(r,ee(n))}var N=null;function ie(e){if(!e||!(e instanceof A))throw Error("Invalid router instance");N=e}function we(){if(!N)throw Error("Router is not initialized. Please make sure you have installed the router plugin.");return N}function se(){return N}var ae="http://www.w3.org/2000/svg",Se=new Set(["svg","g","defs","rect","circle","ellipse","line","polyline","polygon","path","text","tspan","textPath","use","symbol","marker","linearGradient","radialGradient","stop","pattern","mask","clipPath","foreignObject"]);class I{listeners=new WeakMap;effects=new WeakMap;modelBindings=new K;matches(e){return typeof e==="object"&&e!==null&&Y(e)}mount(e,t){if(e.directions?.if===!1)return document.createComment("if");let n=e.tag==="navigator",r=n?document.createElement("a"):Se.has(e.tag)?document.createElementNS(ae,e.tag):document.createElement(e.tag),o=e.props??{};if(n){let{url:i,openType:s,...a}=o,c=typeof i==="string"?i:"#";r.setAttribute("href",c),r.addEventListener("click",(l)=>{let u=se();if(u)l.preventDefault(),u.push(r.getAttribute("href")??"#")}),this.applyProps(r,{},a,t)}else this.applyProps(r,{},o,t);return this.updateListeners(r,{},this.collectListeners(e)),this.mountChildren(r,e,t),this.applyDirections(r,void 0,e.directions,t),r}patch(e,t,n,r){if(e.tag!==t.tag||n.nodeType===Node.COMMENT_NODE){let i=this.mount(t,r);return n.parentNode?.replaceChild(i,n),this.unmount(e,n,r),i}if(!(n instanceof Element))return n;if(t.directions?.if===!1){let i=document.createComment("if");return n.parentNode?.replaceChild(i,n),this.unmount(e,n,r),i}if(t.tag==="navigator"||e.tag==="navigator"){let i=e.props??{},s=t.props??{},a=typeof i.url==="string"?i.url:"",c=typeof s.url==="string"?s.url:"";if(a!==c)n.setAttribute("href",c);let l={...s};delete l.url,delete l.openType,this.applyProps(n,i,l,r)}else this.applyProps(n,e.props??{},t.props??{},r);return this.updateListeners(n,this.collectListeners(e),this.collectListeners(t)),this.updateChildren(n,e,t,r),this.applyDirections(n,e.directions,t.directions,r),n}unmount(e,t,n){if(!(t instanceof Element))return;this.effects.get(t)?.forEach((r)=>R(r)),this.effects.delete(t),this.listeners.get(t)?.forEach(({eventName:r,listener:o})=>{t.removeEventListener(r,o)}),this.listeners.delete(t),this.modelBindings.cleanup(t),this.unmountChildren(t,e,n)}mountChildren(e,t,n){v(t.children).forEach((r)=>{e.appendChild(n.renderer.mount(r,n))})}updateChildren(e,t,n,r){this.updateOrdinaryChildren(e,v(t.children),v(n.children),r)}unmountChildren(e,t,n){v(t.children).forEach((r,o)=>{let i=e.childNodes[o];if(i)n.renderer.unmount(r,i,n)})}applyProps(e,t,n,r){Object.keys(t).forEach((o)=>{if(M(o)||o in n)return;if(o==="className"||o==="class")e.removeAttribute("class");else if(o==="style")e.removeAttribute("style");else if(o==="value"&&typeof e==="object"&&e!==null&&"value"in e)e.value="";else e.removeAttribute(k(o))}),Object.entries(n).forEach(([o,i])=>{if(M(o))return;if(t[o]===i)return;if(o==="className"||o==="class"){if(e.namespaceURI===ae)e.setAttribute("class",String(i??""));else e.className=String(i??"");return}if(o==="value"&&typeof e==="object"&&e!==null&&"value"in e){e.value=String(i??"");return}if(o==="style"&&typeof i==="object"&&i!==null){e.removeAttribute("style");let s=e.style;Object.entries(i).forEach(([a,c])=>{oe(s,a,c)});return}if(i===!1||i===void 0||i===null){e.removeAttribute(k(o));return}if(i===!0){e.setAttribute(k(o),"");return}if(typeof i==="string"&&r.templateEngine.hasExpressions(i)){this.setupReactiveAttribute(e,o,i,r);return}e.setAttribute(k(o),String(i))})}applyDirections(e,t,n,r){if(n&&"show"in n)e.style.display=n.show?"":"none";else if(t&&"show"in t)e.style.display="";if(!n?.model){this.modelBindings.cleanup(e);return}this.modelBindings.bind(e,n.model,r.templateEngine.state)}updateOrdinaryChildren(e,t,n,r){if(this.assertNoDuplicateKeys(t),this.assertNoDuplicateKeys(n),this.hasOnlyKeyedChildren(t,n)){this.updateKeyedChildren(e,t,n,r);return}let o=Math.min(t.length,n.length);for(let i=0;i<o;i+=1){let s=e.childNodes[i];if(!s){e.appendChild(r.renderer.mount(n[i],r));continue}r.renderer.patch(t[i],n[i],s,r)}for(let i=o;i<n.length;i+=1)e.appendChild(r.renderer.mount(n[i],r));for(let i=t.length-1;i>=n.length;i-=1){let s=e.childNodes[i];if(s){if(r.renderer.unmount(t[i],s,r),s.parentNode===e)e.removeChild(s)}}}updateKeyedChildren(e,t,n,r){let o=t.map((a,c)=>({vnode:a,node:e.childNodes[c],index:c})),i=new Map,s=new Set;o.forEach((a)=>{let c=this.getVNodeKey(a.vnode);if(c!==void 0&&a.node)i.set(c,{vnode:a.vnode,node:a.node,index:a.index})}),n.forEach((a,c)=>{let l=this.getVNodeKey(a),u=l===void 0?void 0:i.get(l),y;if(u)y=r.renderer.patch(u.vnode,a,u.node,r),s.add(u.index);else y=r.renderer.mount(a,r);let w=e.childNodes[c]??null;if(y!==w)e.insertBefore(y,w)}),o.forEach((a)=>{if(!a.node||s.has(a.index))return;if(r.renderer.unmount(a.vnode,a.node,r),a.node.parentNode===e)e.removeChild(a.node)})}hasOnlyKeyedChildren(e,t){return[...e,...t].every((n)=>this.getVNodeKey(n)!==void 0)}assertNoDuplicateKeys(e){let t=new Set;e.forEach((n)=>{let r=this.getVNodeKey(n);if(r===void 0)return;if(t.has(r))throw Error(`Duplicate key "${r}"`);t.add(r)})}getVNodeKey(e){if(typeof e==="string")return;return e.key}collectListeners(e){let t={};return Object.entries(e.props??{}).forEach(([n,r])=>{if(M(n)&&typeof r==="function")t[te(n)]=r}),{...t,...e.listeners??{}}}updateListeners(e,t,n){let r=this.listeners.get(e)??new Map,o=new Set(Object.keys(t)),i=new Set(Object.keys(n));o.forEach((s)=>{if(!i.has(s)||t[s]!==n[s]){let a=r.get(s);if(a)e.removeEventListener(a.eventName,a.listener),r.delete(s)}}),i.forEach((s)=>{if(!o.has(s)||t[s]!==n[s]){let{eventName:a,modifiers:c}=ne(s),l=typeof e.tagName==="string"&&e.tagName.toLowerCase()==="textarea",u=a==="confirm"&&!l?"keydown":a,y=re((w)=>{if(u==="keydown"){if(w.key!=="Enter")return}n[s](w)},c);e.addEventListener(u,y),r.set(s,{eventName:u,listener:y})}}),this.listeners.set(e,r)}setupReactiveAttribute(e,t,n,r){let o=g(()=>{e.setAttribute(t,r.templateEngine.evaluateTemplateValue(n))});this.trackEffect(e,o)}trackEffect(e,t){let n=this.effects.get(e)??new Set;n.add(t),this.effects.set(e,n)}}function k(e){if(e.startsWith("data")&&e.length>4)return`data${e.slice(4).replace(/[A-Z]/g,(t)=>`-${t.toLowerCase()}`)}`;if(e==="tabIndex"||e==="colSpan"||e==="htmlFor")return e.toLowerCase();return e}class P{strategies;constructor(){this.strategies=[new pe,new ce,new ue,new I]}mount(e,t){return this.findStrategy(e).mount(e,t)}patch(e,t,n,r){let o=this.findStrategy(e),i=this.findStrategy(t);if(o!==i){let s=i.mount(t,r);return n.parentNode?.replaceChild(s,n),o.unmount(e,n,r),s}return o.patch(e,t,n,r)}unmount(e,t,n){this.findStrategy(e).unmount(e,t,n)}findStrategy(e){let t=this.strategies.find((n)=>n.matches(e));if(!t)throw Error("No render strategy found for vnode");return t}}class pe{matches(e){return typeof e==="string"}mount(e,t){return t.templateEngine.parseTemplate(e)}patch(e,t,n,r){if(e===t)return n;let o=this.mount(t,r);return n.parentNode?.replaceChild(o,n),o}unmount(){}}class ce{instances=new WeakMap;instanceNodes=new Map;emitterUnsubscribers=new WeakMap;matches(e){return typeof e==="object"&&e!==null&&z(e)}mount(e,t){if(e.directions?.if===!1)return document.createComment("if");let r=new e.component(this.createProps(e));if(t.appContext&&r.setAppContext)r.setAppContext(t.appContext);this.syncEmitters(r,e.emitters??{}),t.registerChild(r);let o=r.mountToNode();return this.trackInstanceNode(r,o),r.setElementChangeListener?.((i,s)=>{this.trackInstanceNode(r,i),this.trackInstanceNode(r,s)}),o}patch(e,t,n,r){if(n.nodeType===Node.COMMENT_NODE){let s=this.mount(t,r);return n.parentNode?.replaceChild(s,n),s}if(t.directions?.if===!1){let s=document.createComment("if");return n.parentNode?.replaceChild(s,n),this.unmount(e,n,r),s}let o=this.instances.get(n);if(o&&e.component===t.component){this.syncEmitters(o,t.emitters??{}),o.setProps(this.createProps(t));let s=o.getElement()??n;return this.trackInstanceNode(o,s),s}let i=this.mount(t,r);return n.parentNode?.replaceChild(i,n),this.unmount(e,n,r),i}unmount(e,t,n){let r=this.instances.get(t);if(r)this.clearEmitters(r),r.unmount(),this.clearInstanceNodes(r),n.unregisterChild(r)}createProps(e){return{...e.props??{},children:v(e.children)}}syncEmitters(e,t){let n=this.emitterUnsubscribers.get(e)??new Map;n.forEach(({listener:r,unsubscribe:o},i)=>{let s=t[i];if(!s||s!==r)o(),n.delete(i)}),Object.entries(t).forEach(([r,o])=>{if(n.get(r)?.listener===o)return;n.set(r,{listener:o,unsubscribe:e.on(r,o)})}),this.emitterUnsubscribers.set(e,n)}clearEmitters(e){this.emitterUnsubscribers.get(e)?.forEach(({unsubscribe:t})=>{t()}),this.emitterUnsubscribers.delete(e)}trackInstanceNode(e,t){this.instances.set(t,e);let n=this.instanceNodes.get(e)??new Set;n.add(t),this.instanceNodes.set(e,n)}clearInstanceNodes(e){this.instanceNodes.get(e)?.forEach((t)=>{this.instances.delete(t)}),this.instanceNodes.delete(e)}}class ue{renderedChildren=new WeakMap;matches(e){return typeof e==="object"&&e!==null&&Q(e)}mount(e,t){if(e.directions?.if===!1)return document.createComment("if");let n=document.createElement("div");return n.setAttribute("data-slot",e.props.name),this.mountSlotChildren(n,this.resolveChildren(e,t),t),n}patch(e,t,n,r){if(n.nodeType===Node.COMMENT_NODE){let o=this.mount(t,r);return n.parentNode?.replaceChild(o,n),o}if(t.directions?.if===!1){let o=document.createComment("if");return n.parentNode?.replaceChild(o,n),this.unmount(e,n,r),o}if(n instanceof HTMLElement)n.setAttribute("data-slot",t.props.name),this.replaceSlotChildren(n,e,t,r);return n}unmount(e,t,n){if(!(t instanceof HTMLElement))return;this.unmountSlotChildren(t,n),this.renderedChildren.delete(t)}resolveChildren(e,t){return t.slots[e.props.name]??v(e.children)}replaceSlotChildren(e,t,n,r){let o=this.renderedChildren.get(e)??[],i=this.resolveChildren(n,r),s=Math.min(o.length,i.length);for(let a=0;a<s;a+=1){let c=e.childNodes[a];if(!c){e.appendChild(r.renderer.mount(i[a],r));continue}r.renderer.patch(o[a],i[a],c,r)}for(let a=s;a<i.length;a+=1)e.appendChild(r.renderer.mount(i[a],r));for(let a=o.length-1;a>=i.length;a-=1){let c=e.childNodes[a];if(c){if(r.renderer.unmount(o[a],c,r),c.parentNode===e)e.removeChild(c)}}this.renderedChildren.set(e,i)}mountSlotChildren(e,t,n){t.forEach((r)=>{e.appendChild(n.renderer.mount(r,n))}),this.renderedChildren.set(e,t)}unmountSlotChildren(e,t){(this.renderedChildren.get(e)??[]).forEach((r,o)=>{let i=e.childNodes[o];if(i)t.renderer.unmount(r,i,t)})}}class b{state;bindings=[];templateRegex=/{{(.*?)}}/g;constructor(e){this.state=e;if(!e||typeof e!=="object")throw Error("TemplateEngine requires a valid state object")}parseTemplate(e){if(typeof e!=="string")e=String(e);let t=document.createTextNode("");this.templateRegex.lastIndex=0;let n=Array.from(e.matchAll(this.templateRegex));if(n&&n.length>0)this.setupReactiveBindings(t,e,n);else t.textContent=e;return t}setupReactiveBindings(e,t,n){let r=new Set,o=this.evaluateTemplate(t,n,r);e.textContent=o;let i=g(()=>{try{let s=this.evaluateTemplate(t,n,r);if(e.textContent!==s)e.textContent=s}catch(s){console.error("Template update error:",s),e.textContent=`Error: ${s instanceof Error?s.message:"Unknown error"}`}});this.bindings.push({node:e,originalText:t,effect:i})}evaluateTemplate(e,t,n){let r=e;return t.forEach((o)=>{let i=o[1]?.trim();if(i){n.add(i);let s=this.getValueFromState(i),a=s===void 0||s===null?"":String(s);r=r.replace(o[0],a)}}),r}getValueFromState(e){if(!e)return;let t=e.split("."),n=this.state;for(let r of t){if(!n||typeof n!=="object")return;n=n[r]}return n}clearBindings(){this.bindings.forEach((e)=>{R(e.effect)}),this.bindings=[]}getBindingCount(){return this.bindings.length}hasExpressions(e){return this.templateRegex.lastIndex=0,this.templateRegex.test(e)}extractKeys(e){let t=[],n,r=new RegExp(this.templateRegex,"g");while((n=r.exec(e))!==null){let o=n[1]?.trim();if(o)t.push(o)}return t}evaluateTemplateValue(e){this.templateRegex.lastIndex=0;let t=Array.from(e.matchAll(this.templateRegex));if(!t||t.length===0)return e;let n=new Set;return this.evaluateTemplate(e,t,n)}}class L{props;vnode=null;el=null;renderer=new P;templateEngine;childComponents=new Set;eventListeners={};providers=new Map;updateEffect;appContext=null;parentComponent=null;elementChangeListener=null;styleManager;state;mounted=!1;constructor(e={}){this.props=e;this.styleManager=new le,this.state=_(this.initState()??{}),this.templateEngine=new b(this.state),this.initStyles(),this.updateEffect=g(()=>{if(this.mounted)try{this.update()}catch(t){if(!this.dispatchError(t))throw t}},{throwOnError:!0,scheduler:(t)=>{E.enqueue(t)}})}mount(e){if(!e||!(e instanceof HTMLElement))throw Error("Invalid container element");try{e.appendChild(this.mountToNode())}catch(t){throw console.error("组件渲染错误:",t),t}}mountToNode(){if(this.mounted&&this.el)return this.el;return this.beforeMount(),this.el=m.getInstance().runWithEffect(this.updateEffect,()=>{try{return this.vnode=this.render(),this.renderer.mount(this.vnode,this.createRenderContext())}catch(e){if(this.dispatchError(e))return document.createComment("error-boundary");throw e}}),this.mounted=!0,this.onMounted(),this.el}update(){if(!this.el||!this.vnode)return;this.beforeUpdate();let e=this.vnode,t=this.el;if(this.el=m.getInstance().runWithEffect(this.updateEffect,()=>{let n=this.render(),r=this.renderer.patch(e,n,t,this.createRenderContext());return this.vnode=n,r}),t!==this.el)this.elementChangeListener?.(t,this.el);this.onUpdated(),this.onPropsChange()}unmount(){if(!this.mounted)return;if(this.beforeUnmount(),this.vnode&&this.el)this.renderer.unmount(this.vnode,this.el,this.createRenderContext());if(this.childComponents.clear(),Object.keys(this.eventListeners).forEach((e)=>{this.eventListeners[e].clear(),delete this.eventListeners[e]}),this.providers.clear(),this.parentComponent=null,this.elementChangeListener=null,this.templateEngine.clearBindings(),this.styleManager.destroy(),R(this.updateEffect),this.el?.parentNode)this.el.parentNode.removeChild(this.el);this.el=null,this.vnode=null,this.mounted=!1,this.onUnmounted()}setProps(e){if(this.props={...this.props,...e},this.mounted)E.enqueue(this.updateEffect)}setState(e){Object.assign(this.state,e)}setAppContext(e){this.appContext=e,this.childComponents.forEach((t)=>{t.setAppContext?.(e)})}setParentComponent(e){this.parentComponent=e}getParentComponent(){return this.parentComponent}setElementChangeListener(e){this.elementChangeListener=e}provide(e,t){this.providers.set(e,t)}inject(e,t){let n=this.resolveInjection(e);return n.found?n.value:t}resolveInjection(e){if(this.providers.has(e))return{found:!0,value:this.providers.get(e)};if(this.parentComponent?.resolveInjection)return this.parentComponent.resolveInjection(e);return this.resolveAppInjection(e)}getElement(){return this.el}beforeMount(){}onMounted(){}beforeUpdate(){}onUpdated(){}onPropsChange(){}beforeUnmount(){}onUnmounted(){}dispatchError(e){let t=this.getParentComponent();while(t){let n=t;if(typeof n.onErrorCaptured==="function"){if(n.onErrorCaptured(e,this)===!1)return!0}t=t.getParentComponent?.()??null}return!1}getContext(){return this.appContext}get router(){return this.getRouterFrom(this.appContext)??this.getRouterFromGlobalApp()}emit(e,...t){this.eventListeners[e]?.forEach((n)=>{n(...t)})}on(e,t){if(!this.eventListeners[e])this.eventListeners[e]=new Set;return this.eventListeners[e].add(t),()=>this.off(e,t)}off(e,t){this.eventListeners[e]?.delete(t)}createRenderContext(){return{appContext:this.appContext,templateEngine:this.templateEngine,renderer:this.renderer,slots:this.collectSlots(),registerChild:(e)=>{this.childComponents.add(e),e.setParentComponent?.(this),e.setAppContext?.(this.appContext)},unregisterChild:(e)=>{this.childComponents.delete(e),e.setParentComponent?.(null)}}}collectSlots(){let e={default:[]};return v(this.props.children).forEach((n)=>{let r=this.getSlotName(n);if(!e[r])e[r]=[];e[r].push(this.normalizeSlotChild(n))}),e}getSlotName(e){if(typeof e==="string")return"default";return"slot"in e&&typeof e.slot==="string"?e.slot:"default"}normalizeSlotChild(e){if(typeof e==="string"||!("slot"in e))return e;let t={...e};return delete t.slot,t}getRouterFrom(e){if(!e||typeof e!=="object"||!("router"in e))return;return e.router}getRouterFromGlobalApp(){let e=globalThis.__APP__;return this.getRouterFrom(e)}resolveAppInjection(e){if(!this.appContext||typeof this.appContext!=="object")return{found:!1,value:void 0};return this.appContext.app?.resolveInjection?.(e)??{found:!1,value:void 0}}}function x(e){if(!e.startsWith("/"))return`/${e}`;return e||"/"}function H(e,t){let n=x(t.split("?")[0]);for(let i of e){if(i.path==="*")continue;let s=Pe(i.path,n);if(s)return{route:i,params:s}}let r=e.find((i)=>i.path==="*");if(r)return{route:r,params:{pathMatch:n}};let o=e.find((i)=>i.path==="/");return o?{route:o,params:{}}:null}function Pe(e,t){let n=de(e),r=de(t);if(n.length!==r.length)return null;let o={};for(let i=0;i<n.length;i+=1){let s=n[i],a=r[i];if(s.startsWith(":")){let c=s.slice(1);if(!c)return null;o[decodeURIComponent(c)]=decodeURIComponent(a);continue}if(s!==a)return null}return o}function de(e){let t=x(e);if(t==="/")return[];return t.split("/").filter(Boolean)}function he(e,t,n){let r=x(e),o=n==="/"?r:n+r;return t==="hash"?`#${o}`:o}function fe(e,t){let n,r,o;if(e==="history")r=window.location.pathname+window.location.search,n=window.location.pathname,o=window.location.search;else{r=window.location.hash||"#/",n=r.startsWith("#")?r.slice(1):r;let s=n.indexOf("?");o=s>=0?n.slice(s+1):"",n=s>=0?n.slice(0,s):n}if(n.startsWith(t)&&t!=="/"&&n!=="/")n=n.slice(t.length);return n=x(n),{path:n,fullPath:r,query:Le(o),params:{}}}function W(e,t,n,r){let o=x(e),i=r==="/"?o:r+o;if(n==="history"){if(t)window.history.replaceState({},"",i);else window.history.pushState({},"",i);return}if(t){let s=window.location.href.split("#")[0];window.location.replace(`${s}#${i}`);return}window.location.hash=i}function Le(e){let t={},n=e.startsWith("?")?e.slice(1):e;if(!n)return t;return n.split("&").forEach((r)=>{let[o,i]=r.split("=");if(o)t[decodeURIComponent(o)]=i?decodeURIComponent(i):""}),t}function Me(e){let t=e.indexOf("?");if(t<0)return{};let n=e.slice(t+1),r={};if(!n)return r;return n.split("&").forEach((o)=>{let[i,s]=o.split("=");if(i)r[decodeURIComponent(i)]=s?decodeURIComponent(s):""}),r}class A{currentRoute=null;currentLocation=null;routes=[];app=null;mode;base;routeChangeListeners=[];beforeGuards=[];afterHooks=[];removeWindowListener;constructor(e){let t=Array.isArray(e)?{routes:e}:e;this.routes=t.routes||[],this.mode=t.mode||"history",this.base=t.base||"/",this.validateRoutes(),this.initEvents(),this.resolveCurrentRoute()}install(e){this.app=e,e.router=this,ie(this);let t=e.getContext();t.router=this,this.resolveCurrentRoute()}push(e){this.navigate(e,!1)}replace(e){this.navigate(e,!0)}forward(){window.history.forward()}back(){window.history.back()}go(e){window.history.go(e)}getCurrentRoute(){if(!this.currentLocation)this.resolveCurrentRoute();return this.currentLocation}getCurrentRouteRecord(){if(!this.currentRoute)this.resolveCurrentRoute();return this.currentRoute}onRouteChange(e){return this.routeChangeListeners.push(e),()=>{let t=this.routeChangeListeners.indexOf(e);if(t>-1)this.routeChangeListeners.splice(t,1)}}beforeEach(e){return this.beforeGuards.push(e),()=>{let t=this.beforeGuards.indexOf(e);if(t>-1)this.beforeGuards.splice(t,1)}}afterEach(e){return this.afterHooks.push(e),()=>{let t=this.afterHooks.indexOf(e);if(t>-1)this.afterHooks.splice(t,1)}}getRoutes(){return[...this.routes]}addRoute(e){if(this.routes.some((n)=>n.path===e.path))throw Error(`Route already exists: ${e.path}`);if(this.routes.push(e),this.getCurrentLocation().path===e.path)this.handleRouteChange()}createHref(e){return he(e,this.mode,this.base)}destroy(){if(this.removeWindowListener?.(),this.removeWindowListener=void 0,this.app?.router===this)this.app.router=void 0;this.app=null}navigate(e,t){if(!e||typeof e!=="string")throw Error("Path must be a non-empty string");let n=this.currentLocation,r=this.resolveTarget(e);if(!r)return;let o=r.location;for(let i of this.beforeGuards){let s=i(o,n);if(s===!1)return;if(typeof s==="string"&&s!==e){this.navigate(s,t);return}}if(n&&this.isSameLocation(n,o))return;W(r.path,t,this.mode,this.base),this.currentRoute=r.route,this.currentLocation=o,this.triggerRouteChangeListeners(o,n),this.afterHooks.forEach((i)=>{try{i(o,n)}catch(s){console.error("Route afterEach error:",s)}})}resolveTarget(e){let t=H(this.routes,e.split("?")[0]);if(!t)return null;let n=this.applyRedirect(t),r=n?.path??e,o=n?.route??t.route;return{path:r,route:o,location:{path:r.split("?")[0],query:Me(r),params:n?.params??t.params,fullPath:r,name:o?.name,meta:o?.meta}}}applyRedirect(e){let t=new Set,n=e,r="";while(n.route.redirect){if(t.has(n.route.path))throw Error(`Redirect loop detected for route: ${n.route.path}`);t.add(n.route.path),r=n.route.redirect;let o=H(this.routes,r.split("?")[0]);if(!o)return null;n=o}return r?{route:n.route,params:n.params,path:r}:null}validateRoutes(){if(!Array.isArray(this.routes))throw Error("Router routes must be an array");let e=new Set;this.routes.forEach((t)=>{if(!t.component&&!t.redirect)throw Error(`Route ${t.path} must define a component or redirect`);if(e.has(t.path))throw Error(`Duplicate route path: ${t.path}`);e.add(t.path)})}initEvents(){if(typeof window>"u")return;let e=this.mode==="history"?"popstate":"hashchange",t=()=>{this.handleRouteChange()};window.addEventListener(e,t),this.removeWindowListener=()=>{window.removeEventListener(e,t)}}handleRouteChange(){let e=this.currentLocation,t=this.resolveCurrentRoute();if(!this.isSameLocation(e,t))this.triggerRouteChangeListeners(t,e)}resolveCurrentRoute(){let e=this.getCurrentLocation(),t=H(this.routes,e.path),n=t?this.applyRedirect(t):null,r=n?.route??t?.route??null;if(n&&n.path!==e.path)W(n.path,!0,this.mode,this.base);if(this.currentRoute=r,this.currentLocation={...e,params:n?.params??t?.params??{},name:r?.name,meta:r?.meta},this.afterHooks.length>0){let o=this.currentLocation;this.afterHooks.forEach((i)=>{try{i(o,null)}catch(s){console.error("Route afterEach error:",s)}})}return this.currentLocation}getCurrentLocation(){return fe(this.mode,this.base)}isSameLocation(e,t){return e?.fullPath===t?.fullPath&&e?.name===t?.name}triggerRouteChangeListeners(e,t){this.routeChangeListeners.forEach((n)=>{try{n(e,t)}catch(r){console.error("Route change listener error:",r)}})}}class Ne extends L{unsubscribe;initState(){return{currentPath:this.router?.getCurrentRoute()?.path??window.location.pathname}}initStyles(){}onMounted(){let e=this.router;this.unsubscribe=e?.onRouteChange((t)=>{this.state.currentPath=t.path})}onUnmounted(){this.unsubscribe?.()}render(){let e=this.router,t=this.props.activeClass??"active",n=this.state.currentPath===this.props.to,r=[this.props.className,n?t:void 0].filter(Boolean).join(" ");return{tag:"a",props:{href:e?.createHref(this.props.to)??this.props.to,className:r},listeners:{click:(o)=>{if(o.preventDefault(),this.props.replace)e?.replace(this.props.to);else e?.push(this.props.to)}},children:this.props.children&&this.props.children.length>0?this.props.children:[this.props.to]}}}class Ae extends L{unsubscribe;initState(){let e=this.router;return{route:e?.getCurrentRoute()??null,record:e?.getCurrentRouteRecord()??null}}initStyles(){}onMounted(){let e=this.router;this.unsubscribe=e?.onRouteChange((t)=>{this.state.route=t,this.state.record=e.getCurrentRouteRecord()})}onUnmounted(){this.unsubscribe?.()}render(){let e=this.state.record??this.router?.getCurrentRouteRecord();return{tag:"div",props:{"data-router-view":""},children:e?.component?[{component:e.component}]:[]}}}function Un(e){return new A(e)}var ke=new Set(["base","link","meta"]);function me(e){let t=e.lang??"en",n=e.charset??"utf-8",r=e.viewport??"width=device-width, initial-scale=1",o=j({lang:t,...e.htmlAttributes??{}}),i=j(e.bodyAttributes),s=Ie(e.body);return["<!doctype html>",`<html${o}>`,"<head>",` <meta charset="${T(n)}">`,` <meta name="viewport" content="${T(r)}">`,` <title>${T(e.title)}</title>`,e.description?` <meta name="description" content="${T(e.description)}">`:"",...(e.head??[]).map((a)=>` ${He(a)}`),e.styles&&e.styles.length>0?` <style>${F(e.styles)}</style>`:"","</head>",`<body${i}>`,s,...(e.scripts??[]).map((a)=>` ${je(a)}`),"</body>","</html>"].filter((a)=>a!=="").join(`
|
|
2
|
+
`)}function Ie(e){if(typeof document>"u")throw Error("renderHtmlDocument requires a DOM-like document");let t=document.createElement("div"),n=new P,r=new Set,o=Array.isArray(e)?e:[e],i={templateEngine:new b({}),renderer:n,slots:{default:[]},registerChild:(a)=>{r.add(a)},unregisterChild:(a)=>{r.delete(a)}};o.forEach((a)=>{t.appendChild(n.mount(a,i))});let s=t.innerHTML;return r.forEach((a)=>{a.unmount()}),s}function He(e){let t=j(e.attributes);if(ke.has(e.tag)&&!e.text)return`<${e.tag}${t}>`;return`<${e.tag}${t}>${T(e.text??"")}</${e.tag}>`}function je(e){return`<script${j({type:e.type,src:e.src,async:e.async,defer:e.defer,...e.attributes??{}})}></script>`}function j(e={}){let t=Object.entries(e).flatMap(([n,r])=>{if(r===!1||r===null||r===void 0)return[];return r===!0?[n]:[`${n}="${T(String(r))}"`]}).join(" ");return t?` ${t}`:""}function T(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}var ge="#app";class Oe{options;container=null;rootInstance=null;mounted=!1;templateEngine=null;appContext;providers=new Map;plugins=[];unmountedCallback;router;constructor(e={}){this.options=e;this.appContext={app:this,version:"0.4.0",config:e.config||{}}}handleError(e){console.error("应用错误:",e),this.renderErrorUI(e)}renderErrorUI(e){if(!this.container)return;this.container.innerHTML=`
|
|
3
3
|
<div style="padding: 20px; background-color: #ffebee; color: #c62828; font-family: Arial, sans-serif;">
|
|
4
4
|
<h3>应用错误</h3>
|
|
5
5
|
<p>${e.message}</p>
|
|
6
6
|
<pre style="background-color: #fff; padding: 10px; border-radius: 4px; overflow: auto;">${e.stack}</pre>
|
|
7
7
|
</div>
|
|
8
|
-
`}use(e,...t){if(typeof e.install!=="function")throw Error("插件必须提供 install 方法");return e.install(this,...t),this.plugins.push({plugin:e,args:t}),this}mount(){if(this.mounted){console.warn("应用已经处于运行状态");return}let e=this.resolveMountContainer();if(!e)return;try{if(this.container=e,globalThis.__APP__=this,this.options.root){if(this.rootInstance=new this.options.root(this.options.rootProps),"setAppContext"in this.rootInstance)this.rootInstance.setAppContext(this.appContext);if(this.options.state&&"setState"in this.rootInstance)this.rootInstance.setState(this.options.state);this.rootInstance.mount(this.container),this.templateEngine=new
|
|
9
|
-
export{E as a,
|
|
8
|
+
`}use(e,...t){if(typeof e.install!=="function")throw Error("插件必须提供 install 方法");return e.install(this,...t),this.plugins.push({plugin:e,args:t}),this}mount(){if(this.mounted){console.warn("应用已经处于运行状态");return}let e=this.resolveMountContainer();if(!e)return;try{if(this.container=e,globalThis.__APP__=this,this.options.root){if(this.rootInstance=new this.options.root(this.options.rootProps),"setAppContext"in this.rootInstance)this.rootInstance.setAppContext(this.appContext);if(this.options.state&&"setState"in this.rootInstance)this.rootInstance.setState(this.options.state);this.rootInstance.mount(this.container),this.templateEngine=new b(this.options.state||{})}this.mounted=!0,this.onMounted()}catch(t){this.handleError(t)}}unmount(){if(!this.mounted){console.warn("应用未处于运行状态");return}try{if(this.onBeforeUnmount(),this.rootInstance){if("unmount"in this.rootInstance)this.rootInstance.unmount();this.rootInstance=null,this.mounted=!1,delete globalThis.__APP__}if(this.templateEngine)this.templateEngine.clearBindings(),this.templateEngine=null;if(this.container)this.container.innerHTML="";if(this.unmountedCallback)this.unmountedCallback()}catch(e){console.error("Failed to unmount app:",e)}}isRunning(){return this.mounted}updateRootComponent(e){if(this.mounted)this.unmount();this.options.root=e,this.mount()}update(e){if(!this.mounted)return console.warn("Cannot update unmounted app"),this;try{if(e&&this.options.state){if(this.options.state={...this.options.state,...e},this.rootInstance&&"setState"in this.rootInstance)this.rootInstance.setState(e);if(this.templateEngine)this.templateEngine.state=this.options.state}this.onUpdated()}catch(t){console.error("Failed to update app:",t)}return this}getContext(){return this.appContext}provide(e,t){return this.providers.set(e,t),this}inject(e,t){let n=this.resolveInjection(e);return n.found?n.value:t}resolveInjection(e){if(!this.providers.has(e))return{found:!1,value:void 0};return{found:!0,value:this.providers.get(e)}}getState(){return this.options.state}setState(e){if(this.options.state=e,this.mounted)this.update();return this}onUnmounted(e){return this.unmountedCallback=e,this}renderHtmlDocument(e={}){let t=this.options.document??{},n=this.mergeDocumentScripts(t.scripts,e.scripts);return me({...t,...e,title:e.title??t.title??"TransOne App",body:e.body??t.body??this.createMountDocumentBody(),scripts:n})}resolveRootElement(e){if(!e)return null;if(typeof e==="string"){if(typeof document>"u")return null;return document.querySelector(e)}return typeof Element<"u"&&e instanceof Element?e:null}resolveMountContainer(){if(typeof document>"u")return null;let e=this.resolveRootElement(this.options.rootElement??ge);return e instanceof HTMLElement?e:null}createMountDocumentBody(){let e=this.options.rootElement??ge;if(typeof e==="string")return this.createMountElementFromSelector(e);if(typeof Element<"u"&&e instanceof Element){let t={};if(e.id)t.id=e.id;if(e.className)t.className=e.className;return{tag:e.tagName.toLowerCase(),props:t}}return S({props:{id:"app"}})}createMountElementFromSelector(e){if(e.startsWith("#")&&e.length>1)return S({props:{id:e.slice(1)}});if(e.startsWith(".")&&e.length>1)return S({props:{className:e.slice(1)}});return S({props:{"data-transone-root":e}})}mergeDocumentScripts(e,t){if(!e&&!t)return;return[...e??[],...t??[]]}onMounted(){this.plugins.forEach(({plugin:e})=>{if(e&&typeof e.onMounted==="function")e.onMounted(this)})}onUpdated(){this.plugins.forEach(({plugin:e})=>{if(e&&typeof e.onUpdated==="function")e.onUpdated(this)})}onBeforeUnmount(){this.plugins.forEach(({plugin:e})=>{if(e&&typeof e.onBeforeUnmount==="function")e.onBeforeUnmount(this)})}}
|
|
9
|
+
export{E as a,Ge as b,qe as c,m as d,_ as e,ze as f,g,Ye as h,Qe as i,q as j,Ze as k,R as l,Je as m,ye as n,Xe as o,v as p,z as q,Y as r,Q as s,tt as t,Re as u,S as v,nt as w,rt as x,ot as y,it as z,st as A,at as B,pt as C,ct as D,ut as E,lt as F,dt as G,ht as H,ft as I,mt as J,gt as K,vt as L,yt as M,Rt as N,Ct as O,bt as P,Et as Q,xt as R,Tt as S,wt as T,St as U,Pt as V,Lt as W,Mt as X,Nt as Y,At as Z,kt as _,It as $,Ht as aa,jt as ba,Ot as ca,Vt as da,Bt as ea,_t as fa,Dt as ga,Ut as ha,$t as ia,Kt as ja,Ce as ka,Z as la,be as ma,K as na,A as oa,Ne as pa,Ae as qa,Un as ra,we as sa,I as ta,P as ua,pe as va,ce as wa,ue as xa,b as ya,L as za,me as Aa,Oe as Ba};
|
|
10
10
|
|
|
11
|
-
//# debugId=
|
|
12
|
-
//# sourceMappingURL=index-
|
|
11
|
+
//# debugId=98B66F57AFBD15A264756E2164756E21
|
|
12
|
+
//# sourceMappingURL=index-rmgr0qs2.js.map
|