@fluixi/dom 1.0.0-alpha.53
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/LICENSE +21 -0
- package/README.md +657 -0
- package/dist/cdn/dom.cjs +1 -0
- package/dist/cdn/dom.d.ts +16 -0
- package/dist/cdn/dom.d.ts.map +1 -0
- package/dist/cdn/dom.global.js +1 -0
- package/dist/cdn/dom.js +15 -0
- package/dist/cdn/dom.mjs +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +39 -0
- package/dist/index.mjs +1 -0
- package/dist/lib/component/index.cjs +1 -0
- package/dist/lib/component/index.d.ts +2 -0
- package/dist/lib/component/index.d.ts.map +1 -0
- package/dist/lib/component/index.js +1 -0
- package/dist/lib/component/index.mjs +1 -0
- package/dist/lib/component/modifiers.cjs +1 -0
- package/dist/lib/component/modifiers.d.ts +21 -0
- package/dist/lib/component/modifiers.d.ts.map +1 -0
- package/dist/lib/component/modifiers.js +171 -0
- package/dist/lib/component/modifiers.mjs +1 -0
- package/dist/lib/dom/delegate.cjs +1 -0
- package/dist/lib/dom/delegate.d.ts +17 -0
- package/dist/lib/dom/delegate.d.ts.map +1 -0
- package/dist/lib/dom/delegate.js +50 -0
- package/dist/lib/dom/delegate.mjs +1 -0
- package/dist/lib/dom/hydration-state.cjs +1 -0
- package/dist/lib/dom/hydration-state.d.ts +45 -0
- package/dist/lib/dom/hydration-state.d.ts.map +1 -0
- package/dist/lib/dom/hydration-state.js +94 -0
- package/dist/lib/dom/hydration-state.mjs +1 -0
- package/dist/lib/dom/hydration.cjs +1 -0
- package/dist/lib/dom/hydration.d.ts +10 -0
- package/dist/lib/dom/hydration.d.ts.map +1 -0
- package/dist/lib/dom/hydration.js +143 -0
- package/dist/lib/dom/hydration.mjs +1 -0
- package/dist/lib/dom/index.cjs +1 -0
- package/dist/lib/dom/index.d.ts +9 -0
- package/dist/lib/dom/index.d.ts.map +1 -0
- package/dist/lib/dom/index.js +12 -0
- package/dist/lib/dom/index.mjs +1 -0
- package/dist/lib/dom/integration.cjs +1 -0
- package/dist/lib/dom/integration.d.ts +16 -0
- package/dist/lib/dom/integration.d.ts.map +1 -0
- package/dist/lib/dom/integration.js +25 -0
- package/dist/lib/dom/integration.mjs +1 -0
- package/dist/lib/dom/island.cjs +1 -0
- package/dist/lib/dom/island.d.ts +23 -0
- package/dist/lib/dom/island.d.ts.map +1 -0
- package/dist/lib/dom/island.js +100 -0
- package/dist/lib/dom/island.mjs +1 -0
- package/dist/lib/dom/runtime.cjs +1 -0
- package/dist/lib/dom/runtime.d.ts +131 -0
- package/dist/lib/dom/runtime.d.ts.map +1 -0
- package/dist/lib/dom/runtime.js +1425 -0
- package/dist/lib/dom/runtime.mjs +1 -0
- package/dist/lib/dom/server/fx-data.cjs +1 -0
- package/dist/lib/dom/server/fx-data.d.ts +36 -0
- package/dist/lib/dom/server/fx-data.d.ts.map +1 -0
- package/dist/lib/dom/server/fx-data.js +60 -0
- package/dist/lib/dom/server/fx-data.mjs +1 -0
- package/dist/lib/dom/server/host.cjs +1 -0
- package/dist/lib/dom/server/host.d.ts +14 -0
- package/dist/lib/dom/server/host.d.ts.map +1 -0
- package/dist/lib/dom/server/host.js +38 -0
- package/dist/lib/dom/server/host.mjs +1 -0
- package/dist/lib/dom/server/index.cjs +1 -0
- package/dist/lib/dom/server/index.d.ts +13 -0
- package/dist/lib/dom/server/index.d.ts.map +1 -0
- package/dist/lib/dom/server/index.js +12 -0
- package/dist/lib/dom/server/index.mjs +1 -0
- package/dist/lib/dom/server/nodes.cjs +1 -0
- package/dist/lib/dom/server/nodes.d.ts +105 -0
- package/dist/lib/dom/server/nodes.d.ts.map +1 -0
- package/dist/lib/dom/server/nodes.js +304 -0
- package/dist/lib/dom/server/nodes.mjs +1 -0
- package/dist/lib/dom/server/render.cjs +1 -0
- package/dist/lib/dom/server/render.d.ts +45 -0
- package/dist/lib/dom/server/render.d.ts.map +1 -0
- package/dist/lib/dom/server/render.js +174 -0
- package/dist/lib/dom/server/render.mjs +1 -0
- package/dist/lib/dom/server/request-context.cjs +1 -0
- package/dist/lib/dom/server/request-context.d.ts +85 -0
- package/dist/lib/dom/server/request-context.d.ts.map +1 -0
- package/dist/lib/dom/server/request-context.js +122 -0
- package/dist/lib/dom/server/request-context.mjs +1 -0
- package/dist/lib/dom/server/serialize.cjs +1 -0
- package/dist/lib/dom/server/serialize.d.ts +2 -0
- package/dist/lib/dom/server/serialize.d.ts.map +1 -0
- package/dist/lib/dom/server/serialize.js +98 -0
- package/dist/lib/dom/server/serialize.mjs +1 -0
- package/dist/lib/dom/server-renderer.cjs +1 -0
- package/dist/lib/dom/server-renderer.d.ts +2 -0
- package/dist/lib/dom/server-renderer.d.ts.map +1 -0
- package/dist/lib/dom/server-renderer.js +5 -0
- package/dist/lib/dom/server-renderer.mjs +1 -0
- package/dist/lib/dom/types.cjs +1 -0
- package/dist/lib/dom/types.d.ts +119 -0
- package/dist/lib/dom/types.d.ts.map +1 -0
- package/dist/lib/dom/types.js +1 -0
- package/dist/lib/dom/types.mjs +0 -0
- package/dist/lib/dom/utils.cjs +1 -0
- package/dist/lib/dom/utils.d.ts +411 -0
- package/dist/lib/dom/utils.d.ts.map +1 -0
- package/dist/lib/dom/utils.js +746 -0
- package/dist/lib/dom/utils.mjs +1 -0
- package/dist/lib/element/index.cjs +1 -0
- package/dist/lib/element/index.d.ts +2 -0
- package/dist/lib/element/index.d.ts.map +1 -0
- package/dist/lib/element/index.js +1 -0
- package/dist/lib/element/index.mjs +0 -0
- package/dist/lib/element/types.cjs +1 -0
- package/dist/lib/element/types.d.ts +129 -0
- package/dist/lib/element/types.d.ts.map +1 -0
- package/dist/lib/element/types.js +5 -0
- package/dist/lib/element/types.mjs +0 -0
- package/dist/lib/flow/class-map.cjs +1 -0
- package/dist/lib/flow/class-map.d.ts +40 -0
- package/dist/lib/flow/class-map.d.ts.map +1 -0
- package/dist/lib/flow/class-map.js +44 -0
- package/dist/lib/flow/class-map.mjs +1 -0
- package/dist/lib/flow/dynamic.cjs +1 -0
- package/dist/lib/flow/dynamic.d.ts +27 -0
- package/dist/lib/flow/dynamic.d.ts.map +1 -0
- package/dist/lib/flow/dynamic.js +30 -0
- package/dist/lib/flow/dynamic.mjs +1 -0
- package/dist/lib/flow/error-boundary.cjs +1 -0
- package/dist/lib/flow/error-boundary.d.ts +34 -0
- package/dist/lib/flow/error-boundary.d.ts.map +1 -0
- package/dist/lib/flow/error-boundary.js +49 -0
- package/dist/lib/flow/error-boundary.mjs +1 -0
- package/dist/lib/flow/for.cjs +1 -0
- package/dist/lib/flow/for.d.ts +64 -0
- package/dist/lib/flow/for.d.ts.map +1 -0
- package/dist/lib/flow/for.js +28 -0
- package/dist/lib/flow/for.mjs +1 -0
- package/dist/lib/flow/index-flow.cjs +1 -0
- package/dist/lib/flow/index-flow.d.ts +34 -0
- package/dist/lib/flow/index-flow.d.ts.map +1 -0
- package/dist/lib/flow/index-flow.js +27 -0
- package/dist/lib/flow/index-flow.mjs +1 -0
- package/dist/lib/flow/index.cjs +1 -0
- package/dist/lib/flow/index.d.ts +20 -0
- package/dist/lib/flow/index.d.ts.map +1 -0
- package/dist/lib/flow/index.js +11 -0
- package/dist/lib/flow/index.mjs +1 -0
- package/dist/lib/flow/portal.cjs +1 -0
- package/dist/lib/flow/portal.d.ts +30 -0
- package/dist/lib/flow/portal.d.ts.map +1 -0
- package/dist/lib/flow/portal.js +44 -0
- package/dist/lib/flow/portal.mjs +1 -0
- package/dist/lib/flow/show.cjs +1 -0
- package/dist/lib/flow/show.d.ts +35 -0
- package/dist/lib/flow/show.d.ts.map +1 -0
- package/dist/lib/flow/show.js +162 -0
- package/dist/lib/flow/show.mjs +1 -0
- package/dist/lib/flow/style-map.cjs +1 -0
- package/dist/lib/flow/style-map.d.ts +49 -0
- package/dist/lib/flow/style-map.d.ts.map +1 -0
- package/dist/lib/flow/style-map.js +58 -0
- package/dist/lib/flow/style-map.mjs +1 -0
- package/dist/lib/flow/switch.cjs +1 -0
- package/dist/lib/flow/switch.d.ts +63 -0
- package/dist/lib/flow/switch.d.ts.map +1 -0
- package/dist/lib/flow/switch.js +69 -0
- package/dist/lib/flow/switch.mjs +1 -0
- package/dist/lib/flow/utils.cjs +1 -0
- package/dist/lib/flow/utils.d.ts +19 -0
- package/dist/lib/flow/utils.d.ts.map +1 -0
- package/dist/lib/flow/utils.js +34 -0
- package/dist/lib/flow/utils.mjs +1 -0
- package/dist/lib/index.cjs +1 -0
- package/dist/lib/index.d.ts +21 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/index.js +30 -0
- package/dist/lib/index.mjs +1 -0
- package/dist/lib/jsx/control-flow/flow.cjs +1 -0
- package/dist/lib/jsx/control-flow/flow.d.ts +2 -0
- package/dist/lib/jsx/control-flow/flow.d.ts.map +1 -0
- package/dist/lib/jsx/control-flow/flow.js +627 -0
- package/dist/lib/jsx/control-flow/flow.mjs +0 -0
- package/dist/lib/jsx/control-flow/for-flow.cjs +1 -0
- package/dist/lib/jsx/control-flow/for-flow.d.ts +2 -0
- package/dist/lib/jsx/control-flow/for-flow.d.ts.map +1 -0
- package/dist/lib/jsx/control-flow/for-flow.js +1 -0
- package/dist/lib/jsx/control-flow/for-flow.mjs +0 -0
- package/dist/lib/shared/types.cjs +1 -0
- package/dist/lib/shared/types.d.ts +47 -0
- package/dist/lib/shared/types.d.ts.map +1 -0
- package/dist/lib/shared/types.js +1 -0
- package/dist/lib/shared/types.mjs +0 -0
- package/dist/tsconfig.lib.tsbuildinfo +1 -0
- package/package.json +99 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Accessor } from '@fluixi/reactive/signal';
|
|
2
|
+
declare const MATCH_MARKER: unique symbol;
|
|
3
|
+
export interface MatchProps<T> {
|
|
4
|
+
/** Condition that activates this branch. */
|
|
5
|
+
when: T | Accessor<T> | null | undefined | false;
|
|
6
|
+
/**
|
|
7
|
+
* Content for this branch.
|
|
8
|
+
* Can be a function receiving the truthy value.
|
|
9
|
+
*/
|
|
10
|
+
children: any | ((val: NonNullable<T>) => any);
|
|
11
|
+
}
|
|
12
|
+
/** @internal Opaque shape returned by Match — consumed by Switch. */
|
|
13
|
+
export interface MatchNode<T = any> {
|
|
14
|
+
[MATCH_MARKER]: true;
|
|
15
|
+
when: Accessor<T | null | undefined | false>;
|
|
16
|
+
children: any | ((val: NonNullable<T>) => any);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Declare a conditional branch inside `Switch`.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* <Switch fallback={<p>Unknown</p>}>
|
|
23
|
+
* <Match when={status() === 'loading'}><Spinner /></Match>
|
|
24
|
+
* <Match when={status() === 'error'}>{(s) => <Error />}</Match>
|
|
25
|
+
* <Match when={status() === 'ok'}><Content /></Match>
|
|
26
|
+
* </Switch>
|
|
27
|
+
*/
|
|
28
|
+
export declare function Match<T>(props: MatchProps<T>): MatchNode<T>;
|
|
29
|
+
export interface SwitchProps {
|
|
30
|
+
/** Rendered when no `Match` branch is active. */
|
|
31
|
+
fallback?: any;
|
|
32
|
+
/**
|
|
33
|
+
* One or more `Match` nodes (or an array of them).
|
|
34
|
+
*
|
|
35
|
+
* JSX: children are <Match> elements
|
|
36
|
+
* lit: children array of Match({...}) results
|
|
37
|
+
*/
|
|
38
|
+
children: MatchNode | MatchNode[];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Multi-branch conditional rendering — mirrors SolidJS `<Switch>/<Match>`.
|
|
42
|
+
*
|
|
43
|
+
* Evaluates `Match` branches in order and renders the first truthy one.
|
|
44
|
+
* Returns a memo — works in both JSX and lit-html.
|
|
45
|
+
*
|
|
46
|
+
* @example JSX
|
|
47
|
+
* <Switch fallback={<p>Nothing</p>}>
|
|
48
|
+
* <Match when={a()}><A /></Match>
|
|
49
|
+
* <Match when={b()}><B /></Match>
|
|
50
|
+
* </Switch>
|
|
51
|
+
*
|
|
52
|
+
* @example lit-html
|
|
53
|
+
* Switch({
|
|
54
|
+
* fallback: html`<p>Nothing</p>`,
|
|
55
|
+
* children: [
|
|
56
|
+
* Match({ when: a, children: html`<p>A</p>` }),
|
|
57
|
+
* Match({ when: b, children: html`<p>B</p>` }),
|
|
58
|
+
* ],
|
|
59
|
+
* })
|
|
60
|
+
*/
|
|
61
|
+
export declare function Switch(props: SwitchProps): Accessor<any>;
|
|
62
|
+
export {};
|
|
63
|
+
//# sourceMappingURL=switch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../src/lib/flow/switch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAc,MAAM,yBAAyB,CAAC;AAI/D,QAAA,MAAM,YAAY,eAAkB,CAAC;AAErC,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,4CAA4C;IAC5C,IAAI,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,KAAK,CAAC;IACjD;;;OAGG;IACH,QAAQ,EAAE,GAAG,GAAG,CAAC,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;CAChD;AAED,qEAAqE;AACrE,MAAM,WAAW,SAAS,CAAC,CAAC,GAAG,GAAG;IAChC,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC;IACrB,IAAI,EAAE,QAAQ,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,KAAK,CAAC,CAAC;IAC7C,QAAQ,EAAE,GAAG,GAAG,CAAC,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;CAChD;AAED;;;;;;;;;GASG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAQ3D;AAED,MAAM,WAAW,WAAW;IAC1B,iDAAiD;IACjD,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf;;;;;OAKG;IACH,QAAQ,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;CACnC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,QAAQ,CAAC,GAAG,CAAC,CAyBxD"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { createMemo } from '@fluixi/reactive/signal';
|
|
2
|
+
import { resolveReactiveProp, isTruthy } from './utils.js';
|
|
3
|
+
// Internal marker used by Switch to identify Match nodes.
|
|
4
|
+
const MATCH_MARKER = Symbol('match');
|
|
5
|
+
/**
|
|
6
|
+
* Declare a conditional branch inside `Switch`.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* <Switch fallback={<p>Unknown</p>}>
|
|
10
|
+
* <Match when={status() === 'loading'}><Spinner /></Match>
|
|
11
|
+
* <Match when={status() === 'error'}>{(s) => <Error />}</Match>
|
|
12
|
+
* <Match when={status() === 'ok'}><Content /></Match>
|
|
13
|
+
* </Switch>
|
|
14
|
+
*/
|
|
15
|
+
export function Match(props) {
|
|
16
|
+
return {
|
|
17
|
+
[MATCH_MARKER]: true,
|
|
18
|
+
// Lazy read through the prop getter — Switch calls `branch.when()` inside its memo,
|
|
19
|
+
// so `when={cond()}` reacts; `when={cond}` unwraps via resolveReactiveProp.
|
|
20
|
+
when: resolveReactiveProp(() => props.when),
|
|
21
|
+
children: props.children,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Multi-branch conditional rendering — mirrors SolidJS `<Switch>/<Match>`.
|
|
26
|
+
*
|
|
27
|
+
* Evaluates `Match` branches in order and renders the first truthy one.
|
|
28
|
+
* Returns a memo — works in both JSX and lit-html.
|
|
29
|
+
*
|
|
30
|
+
* @example JSX
|
|
31
|
+
* <Switch fallback={<p>Nothing</p>}>
|
|
32
|
+
* <Match when={a()}><A /></Match>
|
|
33
|
+
* <Match when={b()}><B /></Match>
|
|
34
|
+
* </Switch>
|
|
35
|
+
*
|
|
36
|
+
* @example lit-html
|
|
37
|
+
* Switch({
|
|
38
|
+
* fallback: html`<p>Nothing</p>`,
|
|
39
|
+
* children: [
|
|
40
|
+
* Match({ when: a, children: html`<p>A</p>` }),
|
|
41
|
+
* Match({ when: b, children: html`<p>B</p>` }),
|
|
42
|
+
* ],
|
|
43
|
+
* })
|
|
44
|
+
*/
|
|
45
|
+
export function Switch(props) {
|
|
46
|
+
const branches = Array.isArray(props.children) ? props.children : [props.children];
|
|
47
|
+
return createMemo(() => {
|
|
48
|
+
for (const raw of branches) {
|
|
49
|
+
// The JSX compiler wraps <Match> in createMemo(createComponent(...)); unwrap
|
|
50
|
+
// those (and skip whitespace/other children) to reach the MatchNode. Direct
|
|
51
|
+
// Match({...}) results (lit syntax) pass through unchanged.
|
|
52
|
+
let branch = raw;
|
|
53
|
+
let guard = 0;
|
|
54
|
+
while (typeof branch === 'function' && !branch[MATCH_MARKER] && guard++ < 10) {
|
|
55
|
+
branch = branch();
|
|
56
|
+
}
|
|
57
|
+
if (!branch || typeof branch !== 'object' || branch[MATCH_MARKER] !== true) {
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
const value = branch.when();
|
|
61
|
+
if (isTruthy(value)) {
|
|
62
|
+
return typeof branch.children === 'function'
|
|
63
|
+
? branch.children(value)
|
|
64
|
+
: branch.children;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return props.fallback ?? null;
|
|
68
|
+
});
|
|
69
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createMemo as l}from"@fluixi/reactive/signal";function o(e){return()=>{let r=e();return typeof r=="function"?r():r}}function i(e){return e!=null&&e!==!1}var t=Symbol("match");function d(e){return{[t]:!0,when:o(()=>e.when),children:e.children}}function y(e){let r=Array.isArray(e.children)?e.children:[e.children];return l(()=>{for(let s of r){let n=s,a=0;for(;typeof n=="function"&&!n[t]&&a++<10;)n=n();if(!n||typeof n!="object"||n[t]!==!0)continue;let c=n.when();if(i(c))return typeof n.children=="function"?n.children(c):n.children}return e.fallback??null})}export{d as Match,y as Switch};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var s=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var T=(e,r)=>{for(var o in r)s(e,o,{get:r[o],enumerable:!0})},u=(e,r,o,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of c(r))!f.call(e,n)&&n!==o&&s(e,n,{get:()=>r[n],enumerable:!(t=i(r,n))||t.enumerable});return e};var p=e=>u(s({},"__esModule",{value:!0}),e);var d={};T(d,{isLitResult:()=>l,isTruthy:()=>a,normalizeAccessor:()=>y,resolveReactiveProp:()=>A});module.exports=p(d);function y(e){return typeof e=="function"?e:(()=>e)}function A(e){return()=>{let r=e();return typeof r=="function"?r():r}}function a(e){return e!=null&&e!==!1}function l(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Accessor } from '@fluixi/reactive/signal';
|
|
2
|
+
/** Normalize a value or accessor to an accessor function */
|
|
3
|
+
export declare function normalizeAccessor<T>(value: T | Accessor<T>): Accessor<T>;
|
|
4
|
+
/**
|
|
5
|
+
* Resolve a control-flow reactive prop to an accessor, whatever shape the caller passed:
|
|
6
|
+
* a value, a called accessor (via the prop getter), or a bare accessor/arrow. `read` is a
|
|
7
|
+
* thunk that reads the prop, e.g. `() => props.each`.
|
|
8
|
+
*
|
|
9
|
+
* The compiler emits control-flow value props (each/when/component/mount) as getters, so
|
|
10
|
+
* `read()` re-runs the caller's expression INSIDE the tracking scope where the returned
|
|
11
|
+
* accessor is invoked — this is what makes `each={items()}` reactive. If the read value is
|
|
12
|
+
* itself a function (the `each={items}` accessor form), it is called once. This unwraps at
|
|
13
|
+
* most one level, so `each={() => items()}` doesn't double-call.
|
|
14
|
+
*/
|
|
15
|
+
export declare function resolveReactiveProp<T>(read: () => T | (() => T)): Accessor<T>;
|
|
16
|
+
/** Type-safe truthiness check */
|
|
17
|
+
export declare function isTruthy<T>(value: T | undefined | null | false): value is NonNullable<T>;
|
|
18
|
+
export declare function isLitResult(value: any): boolean;
|
|
19
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/lib/flow/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEnD,4DAA4D;AAC5D,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAIxE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAK7E;AAED,iCAAiC;AACjC,wBAAgB,QAAQ,CAAC,CAAC,EACxB,KAAK,EAAE,CAAC,GAAG,SAAS,GAAG,IAAI,GAAG,KAAK,GAClC,KAAK,IAAI,WAAW,CAAC,CAAC,CAAC,CAEzB;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAO/C"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** Normalize a value or accessor to an accessor function */
|
|
2
|
+
export function normalizeAccessor(value) {
|
|
3
|
+
return typeof value === 'function'
|
|
4
|
+
? value
|
|
5
|
+
: (() => value);
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Resolve a control-flow reactive prop to an accessor, whatever shape the caller passed:
|
|
9
|
+
* a value, a called accessor (via the prop getter), or a bare accessor/arrow. `read` is a
|
|
10
|
+
* thunk that reads the prop, e.g. `() => props.each`.
|
|
11
|
+
*
|
|
12
|
+
* The compiler emits control-flow value props (each/when/component/mount) as getters, so
|
|
13
|
+
* `read()` re-runs the caller's expression INSIDE the tracking scope where the returned
|
|
14
|
+
* accessor is invoked — this is what makes `each={items()}` reactive. If the read value is
|
|
15
|
+
* itself a function (the `each={items}` accessor form), it is called once. This unwraps at
|
|
16
|
+
* most one level, so `each={() => items()}` doesn't double-call.
|
|
17
|
+
*/
|
|
18
|
+
export function resolveReactiveProp(read) {
|
|
19
|
+
return () => {
|
|
20
|
+
const value = read();
|
|
21
|
+
return typeof value === 'function' ? value() : value;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/** Type-safe truthiness check */
|
|
25
|
+
export function isTruthy(value) {
|
|
26
|
+
return value !== null && value !== undefined && value !== false;
|
|
27
|
+
}
|
|
28
|
+
export function isLitResult(value) {
|
|
29
|
+
if (!value || typeof value !== 'object')
|
|
30
|
+
return false;
|
|
31
|
+
return !!(typeof value['_$litType$'] !== 'undefined' ||
|
|
32
|
+
typeof value['_$litDirective$'] !== 'undefined' ||
|
|
33
|
+
(Array.isArray(value.strings) && Array.isArray(value.values)));
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function n(e){return typeof e=="function"?e:(()=>e)}function o(e){return()=>{let r=e();return typeof r=="function"?r():r}}function s(e){return e!=null&&e!==!1}function t(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}export{t as isLitResult,s as isTruthy,n as normalizeAccessor,o as resolveReactiveProp};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var me=Object.defineProperty;var zt=Object.getOwnPropertyDescriptor;var Bt=Object.getOwnPropertyNames;var Gt=Object.prototype.hasOwnProperty;var Xt=(e,t)=>{for(var n in t)me(e,n,{get:t[n],enumerable:!0})},Jt=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Bt(t))!Gt.call(e,o)&&o!==n&&me(e,o,{get:()=>t[o],enumerable:!(r=zt(t,o))||r.enumerable});return e};var Yt=e=>Jt(me({},"__esModule",{value:!0}),e);var Dr={};Xt(Dr,{Dynamic:()=>_t,ErrorBoundary:()=>Dt,FX_DATA_ID:()=>I,For:()=>wt,Index:()=>Ct,Island:()=>bt,JSX_PROPERTIES:()=>J,Match:()=>Mt,Portal:()=>kt,SVG_ELEMENTS:()=>rn,SVG_NAMESPACE:()=>G,Show:()=>vt,Switch:()=>Pt,VOID_ELEMENTS:()=>nn,addClass:()=>an,addDelegatedEventListener:()=>ft,appendChildren:()=>hn,applyElementProp:()=>X,applyProps:()=>nr,asComponent:()=>In,asContext:()=>On,asOutlet:()=>Dn,asProvider:()=>$n,asRoute:()=>kn,asRouter:()=>Ln,asRoutes:()=>_n,asSuspense:()=>qn,captureHydrationCursor:()=>at,checkRenderType:()=>jn,classMap:()=>Ot,cleanChildren:()=>w,cloneTemplate:()=>Xn,closest:()=>sn,createComponent:()=>yr,createElement:()=>yn,createNativeElement:()=>we,createPortal:()=>sr,createRequestContext:()=>$,createTemplate:()=>Gn,delegate:()=>Tn,delegateEvents:()=>ve,escapeFxJson:()=>W,escapeHTML:()=>cr,fnName:()=>Jn,generateID:()=>Un,getAttribute:()=>fn,getGlobal:()=>Pn,getLitEventName:()=>en,getLocals:()=>Pe,getOffset:()=>bn,getRequestContext:()=>N,getRequestEvent:()=>oe,getRequestLocals:()=>ie,getServerData:()=>K,getStableElementId:()=>Vn,getStyle:()=>pn,handleRef:()=>U,hasClass:()=>un,hydrate:()=>ae,hydrateAdvancePast:()=>k,hydrateIslands:()=>Tt,indexArray:()=>q.indexArray,initializeIntegration:()=>pr,insert:()=>C,insertExpression:()=>D,intergartionInitialized:()=>mr,isAccessor:()=>ur,isComponent:()=>b,isContext:()=>nt,isCustomElement:()=>Ge,isDOMNode:()=>Rn,isDelegatedEvent:()=>zn,isDomElement:()=>Y,isDomNode:()=>P,isDomText:()=>Z,isEventHandler:()=>Qt,isFunction:()=>Bn,isIntegrationInitialized:()=>hr,isJSXTemplate:()=>Cn,isLitTemplateResult:()=>Je,isNativeElement:()=>ar,isOutlet:()=>et,isPromise:()=>F,isProvider:()=>tt,isReactElement:()=>wn,isRoute:()=>Qe,isRouter:()=>Ye,isRoutes:()=>Ze,isSVGElement:()=>lr,isServer:()=>x,isSuspense:()=>rt,isTemplateFactory:()=>An,isVisible:()=>gn,iterateFn:()=>Yn,keyArray:()=>q.keyArray,makeArrayFlat:()=>dt,mapArray:()=>q.mapArray,mergeProps:()=>rr,observeIntersection:()=>En,observeResize:()=>Sn,query:()=>he,queryAll:()=>on,registerCreateComponent:()=>dr,registerGlobal:()=>Mn,registerLitRender:()=>ir,removeAttribute:()=>dn,removeChildren:()=>mn,removeClass:()=>ln,removeDelegatedEventListener:()=>Ee,render:()=>Ce,renderLitToNodes:()=>Ae,renderToString:()=>Ke,renderToStringAsync:()=>Be,resetIntegration:()=>gr,runHydrationAt:()=>lt,runWithRequestContext:()=>O,runWithoutHydration:()=>ct,scrollIntoView:()=>xn,serializeNode:()=>T,serializeResourceData:()=>pe,setAttribute:()=>E,setClassList:()=>V,setClassName:()=>H,setDataRedactor:()=>ze,setDynamicAttribute:()=>pt,setDynamicProperty:()=>yt,setProperty:()=>ee,setRequestStore:()=>Me,setServerMode:()=>M,setStyle:()=>te,setStyles:()=>Xe,shouldSetAsProperty:()=>tn,splitProps:()=>or,spread:()=>tr,styleMap:()=>qt,toAttributeName:()=>Zt,toggleClass:()=>cn,waitForElement:()=>Nn});module.exports=Yt(Dr);function Zt(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function Qt(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function en(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function tn(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),r={input:new Set(["value","checked","indeterminate"]),textarea:new Set(["value"]),select:new Set(["value"]),option:new Set(["selected","value"]),audio:new Set(["volume","currentTime","paused"]),video:new Set(["volume","currentTime","paused"]),img:new Set(["src","srcset"]),iframe:new Set(["src"]),a:new Set(["href"])};return n.has(t)||r[e]&&r[e].has(t)}var nn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),rn=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),G="http://www.w3.org/2000/svg";function Ge(e){return e.localName.includes("-")}function X(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(Ge(e)){e[t]=n;return}E(e,t,n,r)}var J=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function he(e,t=document){return t.querySelector(e)}function on(e,t=document){return Array.from(t.querySelectorAll(e))}function sn(e,t){return e.closest(t)}function an(e,...t){e.classList.add(...t)}function ln(e,...t){e.classList.remove(...t)}function cn(e,...t){t.forEach(n=>e.classList.toggle(n))}function un(e,t){return e.classList.contains(t)}function E(e,t,n,r=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function fn(e,t){return e.getAttribute(t)}function dn(e,t){e.removeAttribute(t)}function Xe(e,t){Object.assign(e.style,t)}function pn(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function yn(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,i])=>{if(o==="class"||o==="className")r.className=i;else if(o==="style"&&typeof i=="object")Xe(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else E(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function mn(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function hn(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function gn(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function xn(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function bn(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function Tn(e,t,n,r){let o=i=>{let s=i.target.closest(n);s&&e.contains(s)&&r(i,s)};return e.addEventListener(t,o),()=>{e.removeEventListener(t,o)}}function Nn(e,t=5e3){return new Promise((n,r)=>{let o=he(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=he(e);a&&(i.disconnect(),clearTimeout(s),n(a))});i.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{i.disconnect(),r(new Error(`Element ${e} not found within ${t}ms`))},t)})}function En(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function Sn(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var vn=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function wn(e){return typeof e=="object"&&e!==null&&e.$$typeof===vn}function Je(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function An(e){if(typeof e!="function")return!1;try{let t=e();return Je(t)}catch{return!1}}function Cn(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Rn(e){return e instanceof Node}function Mn(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function Pn(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}var y=require("@fluixi/reactive/signal");function Ln(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function _n(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function kn(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function Dn(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function $n(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function On(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function In(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function qn(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function Ye(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function Ze(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function Qe(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function et(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function tt(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function nt(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function b(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function rt(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function jn(e){return Ye(e)?{type:"router",value:e}:Qe(e)?{type:"route",value:e}:Ze(e)?{type:"routes",value:e}:et(e)?{type:"outlet",value:e}:b(e)?{type:"component",value:e}:rt(e)?{type:"suspense",value:e}:tt(e)?{type:"provider",value:e}:nt(e)?{type:"context",value:e}:{type:"none",value:e}}var p=require("@fluixi/reactive/signal");var x=typeof document>"u";function M(e){x=e}var j=Symbol.for("fluixi.server-node"),ge=null;function ot(e){ge=e}function xe(){if(!ge)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return ge}function P(e){return e!=null&&e[j]===!0?!0:typeof Node<"u"&&e instanceof Node}function Y(e){return e!=null&&e[j]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Z(e){return e!=null&&e[j]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},it=null;function st(e){it=e}function be(){return it}function Te(e,t){return u.active&&t.parentNode===e}function Ne(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function at(){return u.active?u.cursor:null}function lt(e,t){if(!e||e.parentNode==null)return t();let n=u.active,r=u.cursor,o=u.parents;u.active=!0,u.cursor=e,u.parents=[];try{return t()}finally{u.active=n,u.cursor=r,u.parents=o}}function ct(e){if(!u.active)return e();let t=u.cursor,n=u.parents;u.active=!1,u.parents=[];try{return e()}finally{u.active=!0,u.cursor=t,u.parents=n}}function k(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Ne(t)}function Fn(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let r=0,o=e;for(;o=o.previousElementSibling;)o.tagName===e.tagName&&r++;n+=`:nth-of-type(${r+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function Hn(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return`el_${Math.abs(t)}`}function Vn(e){return Hn(Fn(e))}var Un=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Wn={};var ut=new Map,Q=new Set,ne=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function ve(e){if(!x)for(let t of e)Q.has(t)||ne.has(t)||(Q.add(t),document.addEventListener(t,Kn))}function Kn(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let r=n[t];if(r&&!n.disabled&&(r(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function ft(e,t,n){if(e[`$$${t}`]=n,ne.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}Q.has(t)||ve([t])}function Ee(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function zn(e){return!ne.has(e)}function Bn(e){return typeof e=="function"}function A(e){if(x)return xe().createText(e);if(u.active){let t=be()?.hydrateText(e);if(t)return t}return document.createTextNode(e)}function we(e,t=!1){if(x)return xe().createElement(e,t);if(u.active){let n=be()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(G,e):document.createElement(e)}function Gn(e,t=!1){let n=ut.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,ut.set(e,r),r}function Xn(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function dt(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?dt(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Jn(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Yn(e){if((0,y.isSignal)(e)||b(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,y.isSignal)(t)&&!b(t);)t=t();return t}var v=0,Zn=200;function Qn(e,t,n,r,o){let i=r,s=new Map;return(0,p.createRenderEffect)(()=>{let a;if(b(e)&&!(0,y.isSignal)(e)){if(!s.has(e)){v++;try{let l=e();s.set(e,l)}finally{v--}}for(a=s.get(e);typeof a=="function"&&(0,y.isSignal)(a);)a=a()}else for(a=e();typeof a=="function"&&(0,y.isSignal)(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(b(a)){if(!s.has(a)){let c=a;v++;try{let f=c();s.set(c,f)}finally{v--}}a=s.get(a)}else if((0,y.isSignal)(a))a=a();else if(a=a(),typeof a!="function"||!(0,y.isSignal)(a)&&!b(a))break}v++;try{i=D(t,a,n,i,s),o(i)}finally{v--}})}function C(e,t,n,r){if(v>Zn)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=A(""),e.appendChild(n));let o=r??null;if(typeof t!="function"){v++;try{o=D(e,t,n,null)}finally{v--}return()=>o}let i=Qn(t,e,n,o,s=>{o=s});return()=>(i?.(),o)}function D(e,t,n,r,o){if(t==null||typeof t=="boolean")return w(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return w(e,r,n);if(F(t)){let s=A("");return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),w(e,r.slice(1),n)):h(e,s,n):r?e.replaceChild(s,r):h(e,s,n),t.then(a=>{s.parentNode===e&&D(e,a,s.nextSibling,s)}).catch(a=>{console.error("Error resolving promise in insertExpression:",a)}),s}let i=typeof t;if(i==="string"||i==="number"){if(i==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let a=A(t);return h(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=w(e,r,n)}if(r&&Z(r))return r.data=t,r;let s=A(t);return r&&r.parentNode===e?e.replaceChild(s,r):Te(e,s)||h(e,s,n),s}if(P(t))return Te(e,t)?(Ne(t),t):Array.isArray(r)?(r.length===0?h(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),w(e,r.slice(1),n)):h(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):h(e,t,n)):h(e,t,n),t);if(Array.isArray(t)){let s=[],a=Array.isArray(r)?r:r?[r]:[],l=[];S(t,s,e,n,!0,o,l);let c=er(e,a,s,n);for(let f of l){let d=C(e,f.sig,f.marker);(0,p.onCleanup)(()=>{w(e,d()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(i==="object"&&t!==null&&typeof t=="object"){let s=t;if("_$litType$"in s||"_$litDirective$"in s)return D(e,Ae(t),n,r);if("type"in s&&"props"in s){let a=s;if(typeof a.type=="function"){let l=a.type(a.props||{});return D(e,l,n,r)}}}return w(e,r,n)}function S(e,t,n,r,o=!0,i,s){for(let a=0;a<e.length;a++){let l=e[a];if(!(l==null||typeof l=="boolean")){for(;typeof l=="function"&&!F(l)&&!(0,y.isSignal)(l)&&!b(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(b(l)&&!(0,y.isSignal)(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!F(c)&&!(0,y.isSignal)(c)&&!b(c);)i||(i=new Map),i.has(c)||i.set(c,c()),c=i.get(c);if(c==null||typeof c=="boolean")continue;if(typeof c=="function"){if((0,y.isSignal)(c)){if(s){let d=A("");t.push(d),s.push({marker:d,sig:c});continue}let f=c();for(;typeof f=="function"&&(0,y.isSignal)(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?S(f,t,n,r,o,i):S([f],t,n,r,o,i);continue}continue}Array.isArray(c)?S(c,t,n,r,o,i,s):S([c],t,n,r,o,i,s);continue}if(F(l)){let c=A("");t.push(c),l.then(f=>{if(c.parentNode){let d=[];if(S([f],d,c.parentNode,void 0,!1,i),d.length>0){c.parentNode.replaceChild(d[0],c);for(let m=1;m<d.length;m++)c.parentNode?.insertBefore(d[m],d[m-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){S(l,t,n,r,o,i,s);continue}if(P(l)){t.push(l);continue}if(typeof l=="object"&&l!==null&&("_$litType$"in l||"_$litDirective$"in l)){let c=Ae(l);for(let f of c)t.push(f);continue}if(typeof l=="object"&&l!==null&&"type"in l&&"props"in l){let c=l;if(typeof c.type=="function"){let f=c.type(c.props||{});Array.isArray(f)?S(f,t,n,r,!1,i):S([f],t,n,r,!1,i);continue}}if(typeof l=="string"||typeof l=="number"){let c=String(l);if(c.trim()===""&&c!==" ")continue;t.push(A(c));continue}t.push(A(String(l)))}}}}function er(e,t,n,r){for(let d=0;d<n.length;d++)n[d].parentNode!==null&&n[d].parentNode!==e&&(n=n.slice(),n[d]=n[d].cloneNode(!0));let o=n.length,i=t.length,s=o,a=0,l=0,c=i>0?t[i-1].nextSibling??void 0:r,f=null;for(;a<i||l<s;){if(t[a]===n[l]){a++,l++;continue}for(;i>a&&s>l&&t[i-1]===n[s-1];)i--,s--;if(i===a){let d=s<o?l?n[l-1].nextSibling??void 0:n[s-l]:c;for(;l<s;)h(e,n[l++],d)}else if(s===l)for(;a<i;)(!f||!f.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[s-1]&&n[l]===t[i-1]){let d=t[--i].nextSibling;h(e,n[l++],t[a++].nextSibling),h(e,n[--s],d),t[i]=t[a-1]}else{if(!f){f=new Map;let m=l;for(;m<s;)f.set(n[m],m++)}let d=f.get(t[a]);if(d!=null)if(l<d&&d<s){let m=a,ye=1;for(;++m<i&&m<s&&!(!f.has(t[m])||f.get(t[m])!==d+ye);)ye++;if(ye>d-l){let Kt=t[a];for(;l<d;)h(e,n[l++],Kt)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(h(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function w(e,t,n){if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r].parentNode===e&&e.removeChild(t[r]);else t.parentNode===e&&e.removeChild(t);return null}function h(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function ee(e,t,n){n==null?delete e[t]:e[t]=n}function pt(e,t,n,r=!1){return typeof n!="function"?(E(e,t,n,r),()=>{}):(0,p.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;E(e,t,o,r)})}function yt(e,t,n){return typeof n!="function"?(ee(e,t,n),()=>{}):(0,p.createRenderEffect)(()=>{let r=typeof n=="function"?n():n;ee(e,t,r)})}function H(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,p.createEffect)(()=>{H(e,t())});return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(r=>{let o=t[r];return typeof o=="function"?o():!!o}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function V(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],i=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push((0,p.createRenderEffect)(()=>{let s=!!o();for(let a of i)e.classList.toggle(a,s)}));else{let s=!!(typeof o=="function"?o():o);for(let a of i)e.classList.toggle(a,s)}}}function te(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let r in n){let o=n[r];o==null?e.style[r]="":e.style[r]=o}}function tr(e){let{element:t,props:n,prevProps:r=Wn,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!Y(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=o||t.namespaceURI===G,a=[];for(let l in n){if(i&&l==="children")continue;let c=n[l],f=r[l];if(c!==f){if(l==="ref"){U(c,t);continue}if(l==="class"||l==="className"){typeof c=="function"?a.push((0,p.createRenderEffect)(()=>H(t,c()))):H(t,c);continue}if(l==="classList"){typeof c=="function"?a.push((0,p.createRenderEffect)(()=>V(t,c()))):V(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push((0,p.createRenderEffect)(()=>te(t,c()))):te(t,c);continue}if(l.startsWith("on")){let d=l.slice(2).toLowerCase();f&&Ee(t,d),c&&ft(t,d,c);continue}J.has(l)||!s&&l in t?a.push(yt(t,l,c)):a.push(pt(t,l,c,s))}}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();Ee(t,c)}else J.has(l)?ee(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function nr(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){U(o,e);continue}if(r!=="children"){if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(ne.has(i)){e[`$$${i}`]=o;let s=`__fx_${i}`;if(!e[s]){let a=l=>{e[`$$${i}`]?.(l)};e.addEventListener(i,a),e[s]=a}}else e[`$$${i}`]=o,Q.has(i)||ve([i]);continue}if(r==="class"||r==="className"){H(e,o);continue}if(r==="classList"){typeof o=="function"?(0,p.createRenderEffect)(()=>V(e,o())):V(e,o);continue}if(r==="style"){te(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=(0,p.createEffect)(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});(0,p.onCleanup)(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=(0,p.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});(0,p.onCleanup)(()=>{i()})}else e.value=o??"";continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=(0,p.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});(0,p.onCleanup)(()=>{i()})}else e.checked=o??"";continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=(0,p.createEffect)(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});(0,p.onCleanup)(()=>{s()})}else queueMicrotask(()=>{e.value=o??""});continue}if(typeof o=="function"){let i=(0,p.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();X(e,r,s,n)});(0,p.onCleanup)(()=>{i()})}else X(e,r,o,n)}}}function rr(...e){let t=r=>{for(let o=e.length-1;o>=0;o--){let i=e[o];if(i&&r in i&&i[r]!==void 0)return i[r]}},n=r=>{for(let o of e)if(o&&r in o)return!0;return!1};return new Proxy({},{get:(r,o)=>t(o),has:(r,o)=>n(o),ownKeys:()=>{let r=new Set;for(let o of e)if(o)for(let i of Reflect.ownKeys(o))r.add(i);return[...r]},getOwnPropertyDescriptor:(r,o)=>n(o)?{enumerable:!0,configurable:!0,get:()=>t(o)}:void 0})}function or(e,...t){let n=new Set;for(let s of t)for(let a of s)n.add(a);let r=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),o=t.map(s=>{let a=new Set(s);return new Proxy({},{get:(l,c)=>a.has(c)?e[c]:void 0,has:(l,c)=>a.has(c)&&c in e,ownKeys:()=>Array.from(a).filter(l=>l in e),getOwnPropertyDescriptor:(l,c)=>a.has(c)&&c in e?r(c):void 0})}),i=new Proxy({},{get:(s,a)=>n.has(a)?void 0:e[a],has:(s,a)=>!n.has(a)&&a in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,a)=>!n.has(a)&&a in e?r(a):void 0});return[...o,i]}function U(e,t){if(e){if(P(e)){let n=t,r=e;if(!n)return;typeof n=="function"?n(r):typeof n=="object"&&"current"in n&&(n.current=r);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}var Se=null;function ir(e){Se=e}function Ae(e){let t=[];if(!Se)return console.warn("Lit render not registered. Call registerLitRender first."),t;try{let n=document.createElement("div");for(Se(e,n);n.firstChild;)t.push(n.firstChild),n.removeChild(n.firstChild)}catch(n){console.warn("Could not render Lit template:",n)}return t}function sr(e,t,n){let r=t||document.body,o=(0,p.readChildren)(()=>e),i=[];return(0,p.batch)(()=>{let s=(0,p.createRenderEffect)(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),i.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):P(a)&&(r.appendChild(a),i.push(()=>{a.parentNode===r&&r.removeChild(a)}))});i.push(s),(0,p.onCleanup)(()=>{i.forEach(a=>a())})}),null}function ar(e){return typeof e=="string"&&e.toLowerCase()===e}function lr(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function cr(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function F(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function ur(e){return typeof e=="function"&&e.length===0&&(0,y.isSignal)(e)}function Ce(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return(0,p.createRoot)(s=>{(0,p.batch)(()=>{u.active||(t.textContent=""),C(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}var fr="__fx_dom_create_component__",L=globalThis[fr]??={fn:null};function dr(e){L.fn=e}function pr(e={}){let t=e.signalSystem?.createComponent;t&&(L.fn=t)}function yr(e,t){return L.fn?L.fn(e,t):(()=>e(t))}var mr=()=>L.fn!==null,hr=()=>L.fn!==null;function gr(){L.fn=null}var re,ht={getStore:()=>re,run(e,t){let n=re;re=e;try{return t()}finally{re=n}}},Re=ht;function Me(e){Re=e??ht}function $(e={}){e.locals||(e.locals=e.request?ie(e.request):{});let t=0,n=0,r=null,o=new Map,i=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${t++}`,nextResourceId:()=>{if(r===null)return`r${n++}`;let s=o.get(r)??0;return o.set(r,s+1),`${r}:r${s}`},nextIslandNamespace:s=>{let a=i.get(s)??0;return i.set(s,a+1),`${s}#${a}`},withResourceScope(s,a){let l=r;r=s;try{return a()}finally{r=l}},pending:new Set,data:new Map}}function O(e,t){return Re.run(e,t)}function N(){return Re.getStore()}function oe(){return N()?.event}function Pe(){let e=oe();return e?(e.locals||(e.locals={}),e.locals):{}}var mt=new WeakMap;function ie(e){let t=mt.get(e);return t||(t={},mt.set(e,t)),t}var se=require("@fluixi/reactive/signal");var I="__FX_DATA__";function W(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var Le;function K(){let e=globalThis.__FX_DATA__;if(e)return e;if(Le!==void 0)return Le;let t=null;if(typeof document<"u"){let n=document.getElementById(I)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return Le=t}function _e(){for(;;){for(;u.cursor&&u.cursor.nodeType===3&&u.cursor.data==="";)u.cursor=u.cursor.nextSibling;if(u.cursor!=null||!u.parents.length)return;u.cursor=u.parents.pop().nextSibling}}var xr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ke=typeof process<"u"&&process.env&&!1;function De(e,t){let n=t.nodeType===1?`<${t.tagName.toLowerCase()}>`:t.nodeType===3?`text ${JSON.stringify((t.nodeValue??"").slice(0,24))}`:t.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${n}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function br(e){_e();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(xr.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(ke&&t&&De(`<${e}>`,t),null)}function Tr(e){if(e==="")return null;_e();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(ke&&t&&De(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Nr(e){_e();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(ke&&t&&De(`marker <!--${e.slice(0,24)}-->`,t),null)}var gt=!1;function Er(){gt||(gt=!0,st({hydrateElement:br,hydrateText:Tr,hydrateMarker:Nr}))}function ae(e,t,n){Er(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=K(),o=n?.resourceNamespace,i=0;(0,se.setResourceIdSource)(()=>o?`${o}:r${i++}`:`r${i++}`),(0,se.setServerDataGetter)(r?s=>s in r?{value:r[s]}:void 0:null);try{return Ce(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var $e="fluixi-island";function bt(e){let{component:t,props:n={},name:r}=e,o=we($e),i=r??t.name??"Island";E(o,"name",i),E(o,"props",JSON.stringify(n??{}));let s=x?N():void 0;if(s){let a=s.nextIslandNamespace(i);C(o,()=>s.withResourceScope(a,()=>t(n)))}else C(o,()=>t(n));return o}var xt=!1;function Sr(){if(xt||typeof document>"u")return;xt=!0;let e=document.createElement("style");e.textContent=`${$e}{display:contents}`,document.head.appendChild(e)}function Tt(e){if(typeof document>"u")return;Sr();let t=document.querySelectorAll($e),n=new Map;t.forEach(r=>{let o=r.getAttribute("name")??"",i=n.get(o)??0;n.set(o,i+1);let s=e[o];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${o}" has no component in the registry — left static.`);return}let a={};try{a=JSON.parse(r.getAttribute("props")||"{}")}catch{}ae(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}var _=require("@fluixi/reactive/signal");function Nt(e){return typeof e=="function"?e:(()=>e)}function R(e){return()=>{let t=e();return typeof t=="function"?t():t}}function Et(e){return e!=null&&e!==!1}function St(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function vt(e){let t=R(()=>e.when),n=(0,_.createMemo)(t,void 0),r=(0,_.createMemo)(n,void 0);return(0,_.createMemo)(()=>{if(r()){let i=e.children;return typeof i=="function"&&!St(i)?typeof n=="function"?(0,_.untrack)(()=>(0,_.untrack)(n)?i(n()):e.fallback):i(n):i}return e.fallback},void 0,{name:"show"})}var le=require("@fluixi/reactive/signal");function wt(e){let t=R(()=>e.each),n=()=>e.fallback??null,r=(o,i)=>{let s=e.children,a=Array.isArray(s)?s.map(l=>typeof l=="function"?l(o,i):l):typeof s=="function"?s(o,i):s;return k(a),a};return e.by?(0,le.keyArray)(t,e.by,(o,i)=>r(o,i),{fallback:n}):(0,le.mapArray)(t,(o,i)=>r(o,i),{fallback:n})}var At=require("@fluixi/reactive/signal");function Ct(e){let t=R(()=>e.each);return(0,At.indexArray)(t,(n,r)=>{let o=e.children(n,r);return k(o),o},{fallback:()=>e.fallback??null})}var q=require("@fluixi/reactive/signal");var Rt=require("@fluixi/reactive/signal");var Oe=Symbol("match");function Mt(e){return{[Oe]:!0,when:R(()=>e.when),children:e.children}}function Pt(e){let t=Array.isArray(e.children)?e.children:[e.children];return(0,Rt.createMemo)(()=>{for(let n of t){let r=n,o=0;for(;typeof r=="function"&&!r[Oe]&&o++<10;)r=r();if(!r||typeof r!="object"||r[Oe]!==!0)continue;let i=r.when();if(Et(i))return typeof r.children=="function"?r.children(i):r.children}return e.fallback??null})}var Lt=require("@fluixi/reactive/signal");function _t(e){let t=Nt(e.component),{component:n,...r}=e;return(0,Lt.createMemo)(()=>{let o=t();return o==null?null:typeof o=="string"?{tag:o,props:r}:o(r)})}var ce=require("@fluixi/reactive/signal");function kt(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return(0,ce.createRoot)(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),C(r,e.children)&&U(e.ref,r)}),(0,ce.onCleanup)(()=>{n(),r.remove()}),null}var ue=require("@fluixi/reactive/signal");function Dt(e){let[t,n]=(0,ue.createSignal)(null),r=()=>n(null);return(0,ue.createMemo)(()=>{let o=t();if(o!==null)return typeof e.fallback=="function"?e.fallback(o,r):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(i){return n(i),typeof e.fallback=="function"?e.fallback(i,r):e.fallback}})}var $t=require("@fluixi/reactive/signal");function Ot(e){return(0,$t.createMemo)(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;(typeof o=="function"?o():o)&&n.push(r)}return n.join(" ")})}var It=require("@fluixi/reactive/signal");function vr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function qt(e){return(0,It.createMemo)(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;let i=typeof o=="function"?o():o;i!=null&&n.push(`${vr(r)}: ${i}`)}return n.join("; ")})}var je=1,Fe=3,He=8,jt;jt=j;var z=class{constructor(){this[jt]=!0;this.parentNode=null;this.childNodes=[]}get firstChild(){return this.childNodes[0]??null}get lastChild(){return this.childNodes[this.childNodes.length-1]??null}get nextSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>=0?t.childNodes[n+1]??null:null}get previousSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>0?t.childNodes[n-1]??null:null}get parentElement(){return this.parentNode}appendChild(t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes.push(t),t}insertBefore(t,n){if(n==null)return this.appendChild(t);t.parentNode&&t.parentNode.removeChild(t);let r=this.childNodes.indexOf(n);return t.parentNode=this,r<0?this.childNodes.push(t):this.childNodes.splice(r,0,t),t}removeChild(t){let n=this.childNodes.indexOf(t);return n>=0&&this.childNodes.splice(n,1),t.parentNode=null,t}replaceChild(t,n){let r=this.childNodes.indexOf(n);return r>=0&&(t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes[r]=t,n.parentNode=null),n}addEventListener(){}removeEventListener(){}},B=class e extends z{constructor(n){super();this.nodeType=Fe;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}get textContent(){return this.data}set textContent(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},fe=class e extends z{constructor(n){super();this.nodeType=He;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},Ie=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},qe=class{constructor(t){this.el=t}list(){let t=this.el.getAttribute("class");return t?t.split(/\s+/).filter(Boolean):[]}write(t){t.length?this.el.setAttribute("class",t.join(" ")):this.el.removeAttribute("class")}add(...t){let n=this.list();for(let r of t)n.includes(r)||n.push(r);this.write(n)}remove(...t){this.write(this.list().filter(n=>!t.includes(n)))}contains(t){return this.list().includes(t)}toggle(t,n){let r=this.contains(t),o=n===void 0?!r:n;return o?this.add(t):this.remove(t),o}},de=class e extends z{constructor(n,r=!1){super();this.nodeType=je;this.attributes=new Map;this.style=new Ie;this.classList=new qe(this);this.rawHTML=null;this.localName=n.toLowerCase(),this.tagName=r?n:n.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(n,r){this.attributes.set(n,String(r))}removeAttribute(n){this.attributes.delete(n)}getAttribute(n){return this.attributes.has(n)?this.attributes.get(n):null}hasAttribute(n){return this.attributes.has(n)}get id(){return this.getAttribute("id")??""}set id(n){n==null?this.removeAttribute("id"):this.setAttribute("id",n)}get className(){return this.getAttribute("class")??""}set className(n){n==null?this.removeAttribute("class"):this.setAttribute("class",n)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(n){n==null?this.removeAttribute("for"):this.setAttribute("for",n)}set value(n){n==null?this.removeAttribute("value"):this.setAttribute("value",String(n))}set checked(n){n?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(n){n?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(n){}get textContent(){return this.childNodes.map(n=>n.textContent??"").join("")}set textContent(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,n!=null&&n!==""&&this.appendChild(new B(String(n)))}set innerText(n){this.textContent=n}set innerHTML(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=n==null?"":String(n)}cloneNode(n=!1){let r=new e(this.localName,this.isSVG);if(r.attributes=new Map(this.attributes),r.style.cssText=this.style.cssText,r.rawHTML=this.rawHTML,n)for(let o of this.childNodes)r.appendChild(o.cloneNode(!0));return r}};var wr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ht=/&/g,Ar=/</g,Cr=/>/g,Rr=/"/g;function Ve(e){return e.replace(Ht,"&").replace(Ar,"<").replace(Cr,">")}function Ft(e){return e.replace(Ht,"&").replace(Rr,""")}function Mr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function Pr(e){if(!e)return"";let t=[];e.cssText&&t.push(e.cssText.trim().replace(/;\s*$/,""));for(let n of Object.keys(e)){if(n==="cssText")continue;let r=e[n];r==null||r===""||t.push(`${Mr(n)}: ${r}`)}return t.join("; ")}function Lr(e){let t="",n=Pr(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${Ft(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${Ft(o)}"`}return t}function T(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return Ve(e);if(typeof e=="number")return Ve(String(e));if(typeof e=="function")return T(e());if(Array.isArray(e))return e.map(T).join("");switch(e.nodeType){case Fe:return Ve(e.data??"");case He:return`<!--${e.data??""}-->`;case je:{let t=e.localName,n=`<${t}${Lr(e)}>`;if(wr.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(T).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(T).join(""):""}var We=require("@fluixi/reactive/signal"),g=require("@fluixi/reactive/signal");var Vt=!1;function Wt(){Vt||(Vt=!0,ot({createElement:(e,t)=>new de(e,t),createText:e=>new B(e),createComment:e=>new fe(e)}))}function Ke(e,t={}){let n=x;Wt(),M(!0);let r=$(t.event);try{return O(r,()=>(0,We.createRoot)(o=>{try{let i=typeof e=="function"?e():e;return T(i)}finally{o()}}))}finally{M(n)}}var Ut=!1;function _r(){Ut||(Ut=!0,(0,g.setResourceTracker)(e=>{N()?.pending.add(e)}),(0,g.setResourceIdSource)(()=>N()?.nextResourceId()??""),(0,g.setResourceDataSink)((e,t)=>{e&&N()?.data.set(e,t)}))}var Ue=null;function ze(e){Ue=e}function pe(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(Ue)try{i=Ue(o,r)}catch{continue}i!==void 0&&(t[r]=i)}if(Object.keys(t).length===0)return"";let n=W(JSON.stringify(t));return`<script type="application/json" id="${I}">${n}<\/script>`}var kr=50;async function Be(e,t={}){let n=x;Wt(),M(!0),_r();let r=$(t.event);try{return await O(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};(0,We.createRoot)(f=>{s=f,i=(0,g.getOwner)(),o=typeof e=="function"?e():e});let a=()=>{try{(0,g.runWithOwner)(i,()=>T(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<kr;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await(0,g.flush)(),a()}let c=(0,g.runWithOwner)(i,()=>T(o))+pe(r);return s(),c})}finally{M(n)}}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Main entry point for @fluixi/dom package
|
|
3
|
+
* @module @fluixi/dom
|
|
4
|
+
*
|
|
5
|
+
* This package provides a comprehensive reactive DOM runtime with fine-grained updates
|
|
6
|
+
* similar to SolidJS's dom-expressions. It includes:
|
|
7
|
+
* - Core DOM manipulation utilities
|
|
8
|
+
* - Reactive rendering with signal/store support
|
|
9
|
+
* - Control flow components (Show, For, Switch, etc.)
|
|
10
|
+
* - Event delegation
|
|
11
|
+
* - Template caching and optimization
|
|
12
|
+
* - Integration with signal and store systems
|
|
13
|
+
*/
|
|
14
|
+
export * from './dom/index.js';
|
|
15
|
+
export * from './dom/integration.js';
|
|
16
|
+
export * from './shared/types.js';
|
|
17
|
+
export * from './component/index.js';
|
|
18
|
+
export * from './flow/index.js';
|
|
19
|
+
export type { ComponentObserver, } from './dom/types.js';
|
|
20
|
+
export { renderToString, renderToStringAsync, serializeNode, serializeResourceData, setDataRedactor, getServerData, escapeFxJson, FX_DATA_ID, setRequestStore, createRequestContext, runWithRequestContext, getRequestContext, getRequestEvent, getLocals, getRequestLocals, type RenderOptions, type RequestStore, type RequestContext, type RequestEvent, type RequestLocals, } from './dom/server/index.js';
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAOH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAEhC,YAAY,EACV,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AASxB,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,qBAAqB,EACrB,eAAe,EACf,aAAa,EACb,YAAY,EACZ,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,eAAe,EACf,SAAS,EACT,gBAAgB,EAChB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,aAAa,GACnB,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Main entry point for @fluixi/dom package
|
|
3
|
+
* @module @fluixi/dom
|
|
4
|
+
*
|
|
5
|
+
* This package provides a comprehensive reactive DOM runtime with fine-grained updates
|
|
6
|
+
* similar to SolidJS's dom-expressions. It includes:
|
|
7
|
+
* - Core DOM manipulation utilities
|
|
8
|
+
* - Reactive rendering with signal/store support
|
|
9
|
+
* - Control flow components (Show, For, Switch, etc.)
|
|
10
|
+
* - Event delegation
|
|
11
|
+
* - Template caching and optimization
|
|
12
|
+
* - Integration with signal and store systems
|
|
13
|
+
*/
|
|
14
|
+
// Core imperative runtime + Solid-style control flow (flow/). The lit renderer
|
|
15
|
+
// (templates, directives, lit control-flow) is intentionally NOT re-exported
|
|
16
|
+
// here so the core barrel stays lit-free and separable — import it from
|
|
17
|
+
// '@fluixi/lit' (and its subpaths). This also removes the Show/For name
|
|
18
|
+
// collision that arose from re-exporting both flow/ and lit/control-flow/.
|
|
19
|
+
export * from './dom/index.js';
|
|
20
|
+
export * from './dom/integration.js';
|
|
21
|
+
export * from './shared/types.js';
|
|
22
|
+
export * from './component/index.js';
|
|
23
|
+
export * from './flow/index.js';
|
|
24
|
+
// No reactive primitives re-exported here — import createSignal/createMemo/… from
|
|
25
|
+
// @fluixi/reactive. dom only owns createComponent (./dom/integration.js).
|
|
26
|
+
// SSR string renderer + request context. Re-exported as named bindings (not spread into a
|
|
27
|
+
// barrel), so a client-only bundle that never references them tree-shakes them out — they
|
|
28
|
+
// also live on the `@fluixi/dom/server` subpath. The node classes/guards (isServer, etc.)
|
|
29
|
+
// come from the runtime barrel above; keep them out of this list to avoid duplicate exports.
|
|
30
|
+
export { renderToString, renderToStringAsync, serializeNode, serializeResourceData, setDataRedactor, getServerData, escapeFxJson, FX_DATA_ID, setRequestStore, createRequestContext, runWithRequestContext, getRequestContext, getRequestEvent, getLocals, getRequestLocals, } from './dom/server/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function Ln(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function _n(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function kn(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function Dn(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),r={input:new Set(["value","checked","indeterminate"]),textarea:new Set(["value"]),select:new Set(["value"]),option:new Set(["selected","value"]),audio:new Set(["volume","currentTime","paused"]),video:new Set(["volume","currentTime","paused"]),img:new Set(["src","srcset"]),iframe:new Set(["src"]),a:new Set(["href"])};return n.has(t)||r[e]&&r[e].has(t)}var $n=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),On=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),Q="http://www.w3.org/2000/svg";function ut(e){return e.localName.includes("-")}function ee(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(ut(e)){e[t]=n;return}S(e,t,n,r)}var te=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function Le(e,t=document){return t.querySelector(e)}function In(e,t=document){return Array.from(t.querySelectorAll(e))}function qn(e,t){return e.closest(t)}function jn(e,...t){e.classList.add(...t)}function Fn(e,...t){e.classList.remove(...t)}function Hn(e,...t){t.forEach(n=>e.classList.toggle(n))}function Vn(e,t){return e.classList.contains(t)}function S(e,t,n,r=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function Un(e,t){return e.getAttribute(t)}function Wn(e,t){e.removeAttribute(t)}function ft(e,t){Object.assign(e.style,t)}function Kn(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function zn(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,i])=>{if(o==="class"||o==="className")r.className=i;else if(o==="style"&&typeof i=="object")ft(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else S(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function Bn(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Gn(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function Xn(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Jn(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Yn(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function Zn(e,t,n,r){let o=i=>{let s=i.target.closest(n);s&&e.contains(s)&&r(i,s)};return e.addEventListener(t,o),()=>{e.removeEventListener(t,o)}}function Qn(e,t=5e3){return new Promise((n,r)=>{let o=Le(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=Le(e);a&&(i.disconnect(),clearTimeout(s),n(a))});i.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{i.disconnect(),r(new Error(`Element ${e} not found within ${t}ms`))},t)})}function er(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function tr(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var dt=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function nr(e){return typeof e=="object"&&e!==null&&e.$$typeof===dt}function pt(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function rr(e){if(typeof e!="function")return!1;try{let t=e();return pt(t)}catch{return!1}}function or(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function ir(e){return e instanceof Node}function sr(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function ar(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as m}from"@fluixi/reactive/signal";function cr(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function ur(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function fr(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function dr(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function pr(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function yr(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function mr(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function hr(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function yt(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function mt(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function ht(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function gt(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function xt(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function bt(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function g(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function Tt(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function gr(e){return yt(e)?{type:"router",value:e}:ht(e)?{type:"route",value:e}:mt(e)?{type:"routes",value:e}:gt(e)?{type:"outlet",value:e}:g(e)?{type:"component",value:e}:Tt(e)?{type:"suspense",value:e}:xt(e)?{type:"provider",value:e}:bt(e)?{type:"context",value:e}:{type:"none",value:e}}import{batch as Ie,createEffect as _,createRenderEffect as N,createRoot as vt,onCleanup as C,readChildren as wt}from"@fluixi/reactive/signal";var h=typeof document>"u";function P(e){h=e}var k=Symbol.for("fluixi.server-node"),ne=null;function _e(e){ne=e}function re(){if(!ne)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return ne}function L(e){return e!=null&&e[k]===!0?!0:typeof Node<"u"&&e instanceof Node}function oe(e){return e!=null&&e[k]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function ie(e){return e!=null&&e[k]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},ke=null;function De(e){ke=e}function se(){return ke}function ae(e,t){return u.active&&t.parentNode===e}function le(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function Nt(){return u.active?u.cursor:null}function Et(e,t){if(!e||e.parentNode==null)return t();let n=u.active,r=u.cursor,o=u.parents;u.active=!0,u.cursor=e,u.parents=[];try{return t()}finally{u.active=n,u.cursor=r,u.parents=o}}function St(e){if(!u.active)return e();let t=u.cursor,n=u.parents;u.active=!1,u.parents=[];try{return e()}finally{u.active=!0,u.cursor=t,u.parents=n}}function D(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&le(t)}function At(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let r=0,o=e;for(;o=o.previousElementSibling;)o.tagName===e.tagName&&r++;n+=`:nth-of-type(${r+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function Ct(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return`el_${Math.abs(t)}`}function Rr(e){return Ct(At(e))}var Mr=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Rt={};var $e=new Map,V=new Set,K=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function qe(e){if(!h)for(let t of e)V.has(t)||K.has(t)||(V.add(t),document.addEventListener(t,Mt))}function Mt(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let r=n[t];if(r&&!n.disabled&&(r(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function Pt(e,t,n){if(e[`$$${t}`]=n,K.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}V.has(t)||qe([t])}function Oe(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function Pr(e){return!K.has(e)}function Lr(e){return typeof e=="function"}function v(e){if(h)return re().createText(e);if(u.active){let t=se()?.hydrateText(e);if(t)return t}return document.createTextNode(e)}function je(e,t=!1){if(h)return re().createElement(e,t);if(u.active){let n=se()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(Q,e):document.createElement(e)}function _r(e,t=!1){let n=$e.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,$e.set(e,r),r}function kr(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function Lt(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Lt(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Dr(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function $r(e){if(m(e)||g(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!m(t)&&!g(t);)t=t();return t}var T=0,_t=200;function kt(e,t,n,r,o){let i=r,s=new Map;return N(()=>{let a;if(g(e)&&!m(e)){if(!s.has(e)){T++;try{let l=e();s.set(e,l)}finally{T--}}for(a=s.get(e);typeof a=="function"&&m(a);)a=a()}else for(a=e();typeof a=="function"&&m(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(g(a)){if(!s.has(a)){let c=a;T++;try{let f=c();s.set(c,f)}finally{T--}}a=s.get(a)}else if(m(a))a=a();else if(a=a(),typeof a!="function"||!m(a)&&!g(a))break}T++;try{i=$(t,a,n,i,s),o(i)}finally{T--}})}function R(e,t,n,r){if(T>_t)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=v(""),e.appendChild(n));let o=r??null;if(typeof t!="function"){T++;try{o=$(e,t,n,null)}finally{T--}return()=>o}let i=kt(t,e,n,o,s=>{o=s});return()=>(i?.(),o)}function $(e,t,n,r,o){if(t==null||typeof t=="boolean")return A(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return A(e,r,n);if(H(t)){let s=v("");return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),A(e,r.slice(1),n)):y(e,s,n):r?e.replaceChild(s,r):y(e,s,n),t.then(a=>{s.parentNode===e&&$(e,a,s.nextSibling,s)}).catch(a=>{console.error("Error resolving promise in insertExpression:",a)}),s}let i=typeof t;if(i==="string"||i==="number"){if(i==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let a=v(t);return y(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=A(e,r,n)}if(r&&ie(r))return r.data=t,r;let s=v(t);return r&&r.parentNode===e?e.replaceChild(s,r):ae(e,s)||y(e,s,n),s}if(L(t))return ae(e,t)?(le(t),t):Array.isArray(r)?(r.length===0?y(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),A(e,r.slice(1),n)):y(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):y(e,t,n)):y(e,t,n),t);if(Array.isArray(t)){let s=[],a=Array.isArray(r)?r:r?[r]:[],l=[];b(t,s,e,n,!0,o,l);let c=Dt(e,a,s,n);for(let f of l){let d=R(e,f.sig,f.marker);C(()=>{A(e,d()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(i==="object"&&t!==null&&typeof t=="object"){let s=t;if("_$litType$"in s||"_$litDirective$"in s)return $(e,Fe(t),n,r);if("type"in s&&"props"in s){let a=s;if(typeof a.type=="function"){let l=a.type(a.props||{});return $(e,l,n,r)}}}return A(e,r,n)}function b(e,t,n,r,o=!0,i,s){for(let a=0;a<e.length;a++){let l=e[a];if(!(l==null||typeof l=="boolean")){for(;typeof l=="function"&&!H(l)&&!m(l)&&!g(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(g(l)&&!m(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!H(c)&&!m(c)&&!g(c);)i||(i=new Map),i.has(c)||i.set(c,c()),c=i.get(c);if(c==null||typeof c=="boolean")continue;if(typeof c=="function"){if(m(c)){if(s){let d=v("");t.push(d),s.push({marker:d,sig:c});continue}let f=c();for(;typeof f=="function"&&m(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?b(f,t,n,r,o,i):b([f],t,n,r,o,i);continue}continue}Array.isArray(c)?b(c,t,n,r,o,i,s):b([c],t,n,r,o,i,s);continue}if(H(l)){let c=v("");t.push(c),l.then(f=>{if(c.parentNode){let d=[];if(b([f],d,c.parentNode,void 0,!1,i),d.length>0){c.parentNode.replaceChild(d[0],c);for(let p=1;p<d.length;p++)c.parentNode?.insertBefore(d[p],d[p-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){b(l,t,n,r,o,i,s);continue}if(L(l)){t.push(l);continue}if(typeof l=="object"&&l!==null&&("_$litType$"in l||"_$litDirective$"in l)){let c=Fe(l);for(let f of c)t.push(f);continue}if(typeof l=="object"&&l!==null&&"type"in l&&"props"in l){let c=l;if(typeof c.type=="function"){let f=c.type(c.props||{});Array.isArray(f)?b(f,t,n,r,!1,i):b([f],t,n,r,!1,i);continue}}if(typeof l=="string"||typeof l=="number"){let c=String(l);if(c.trim()===""&&c!==" ")continue;t.push(v(c));continue}t.push(v(String(l)))}}}}function Dt(e,t,n,r){for(let d=0;d<n.length;d++)n[d].parentNode!==null&&n[d].parentNode!==e&&(n=n.slice(),n[d]=n[d].cloneNode(!0));let o=n.length,i=t.length,s=o,a=0,l=0,c=i>0?t[i-1].nextSibling??void 0:r,f=null;for(;a<i||l<s;){if(t[a]===n[l]){a++,l++;continue}for(;i>a&&s>l&&t[i-1]===n[s-1];)i--,s--;if(i===a){let d=s<o?l?n[l-1].nextSibling??void 0:n[s-l]:c;for(;l<s;)y(e,n[l++],d)}else if(s===l)for(;a<i;)(!f||!f.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[s-1]&&n[l]===t[i-1]){let d=t[--i].nextSibling;y(e,n[l++],t[a++].nextSibling),y(e,n[--s],d),t[i]=t[a-1]}else{if(!f){f=new Map;let p=l;for(;p<s;)f.set(n[p],p++)}let d=f.get(t[a]);if(d!=null)if(l<d&&d<s){let p=a,Z=1;for(;++p<i&&p<s&&!(!f.has(t[p])||f.get(t[p])!==d+Z);)Z++;if(Z>d-l){let ct=t[a];for(;l<d;)y(e,n[l++],ct)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(y(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function A(e,t,n){if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r].parentNode===e&&e.removeChild(t[r]);else t.parentNode===e&&e.removeChild(t);return null}function y(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function ce(e,t,n){n==null?delete e[t]:e[t]=n}function $t(e,t,n,r=!1){return typeof n!="function"?(S(e,t,n,r),()=>{}):N(()=>{let o=typeof n=="function"?n():n;S(e,t,o,r)})}function Ot(e,t,n){return typeof n!="function"?(ce(e,t,n),()=>{}):N(()=>{let r=typeof n=="function"?n():n;ce(e,t,r)})}function U(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){_(()=>{U(e,t())});return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(r=>{let o=t[r];return typeof o=="function"?o():!!o}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function W(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],i=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push(N(()=>{let s=!!o();for(let a of i)e.classList.toggle(a,s)}));else{let s=!!(typeof o=="function"?o():o);for(let a of i)e.classList.toggle(a,s)}}}function ue(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let r in n){let o=n[r];o==null?e.style[r]="":e.style[r]=o}}function Or(e){let{element:t,props:n,prevProps:r=Rt,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!oe(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=o||t.namespaceURI===Q,a=[];for(let l in n){if(i&&l==="children")continue;let c=n[l],f=r[l];if(c!==f){if(l==="ref"){z(c,t);continue}if(l==="class"||l==="className"){typeof c=="function"?a.push(N(()=>U(t,c()))):U(t,c);continue}if(l==="classList"){typeof c=="function"?a.push(N(()=>W(t,c()))):W(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push(N(()=>ue(t,c()))):ue(t,c);continue}if(l.startsWith("on")){let d=l.slice(2).toLowerCase();f&&Oe(t,d),c&&Pt(t,d,c);continue}te.has(l)||!s&&l in t?a.push(Ot(t,l,c)):a.push($t(t,l,c,s))}}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();Oe(t,c)}else te.has(l)?ce(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function Ir(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){z(o,e);continue}if(r!=="children"){if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(K.has(i)){e[`$$${i}`]=o;let s=`__fx_${i}`;if(!e[s]){let a=l=>{e[`$$${i}`]?.(l)};e.addEventListener(i,a),e[s]=a}}else e[`$$${i}`]=o,V.has(i)||qe([i]);continue}if(r==="class"||r==="className"){U(e,o);continue}if(r==="classList"){typeof o=="function"?N(()=>W(e,o())):W(e,o);continue}if(r==="style"){ue(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=_(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});C(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=_(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});C(()=>{i()})}else e.value=o??"";continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=_(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});C(()=>{i()})}else e.checked=o??"";continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=_(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});C(()=>{s()})}else queueMicrotask(()=>{e.value=o??""});continue}if(typeof o=="function"){let i=_(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();ee(e,r,s,n)});C(()=>{i()})}else ee(e,r,o,n)}}}function qr(...e){let t=r=>{for(let o=e.length-1;o>=0;o--){let i=e[o];if(i&&r in i&&i[r]!==void 0)return i[r]}},n=r=>{for(let o of e)if(o&&r in o)return!0;return!1};return new Proxy({},{get:(r,o)=>t(o),has:(r,o)=>n(o),ownKeys:()=>{let r=new Set;for(let o of e)if(o)for(let i of Reflect.ownKeys(o))r.add(i);return[...r]},getOwnPropertyDescriptor:(r,o)=>n(o)?{enumerable:!0,configurable:!0,get:()=>t(o)}:void 0})}function jr(e,...t){let n=new Set;for(let s of t)for(let a of s)n.add(a);let r=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),o=t.map(s=>{let a=new Set(s);return new Proxy({},{get:(l,c)=>a.has(c)?e[c]:void 0,has:(l,c)=>a.has(c)&&c in e,ownKeys:()=>Array.from(a).filter(l=>l in e),getOwnPropertyDescriptor:(l,c)=>a.has(c)&&c in e?r(c):void 0})}),i=new Proxy({},{get:(s,a)=>n.has(a)?void 0:e[a],has:(s,a)=>!n.has(a)&&a in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,a)=>!n.has(a)&&a in e?r(a):void 0});return[...o,i]}function z(e,t){if(e){if(L(e)){let n=t,r=e;if(!n)return;typeof n=="function"?n(r):typeof n=="object"&&"current"in n&&(n.current=r);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}var fe=null;function Fr(e){fe=e}function Fe(e){let t=[];if(!fe)return console.warn("Lit render not registered. Call registerLitRender first."),t;try{let n=document.createElement("div");for(fe(e,n);n.firstChild;)t.push(n.firstChild),n.removeChild(n.firstChild)}catch(n){console.warn("Could not render Lit template:",n)}return t}function Hr(e,t,n){let r=t||document.body,o=wt(()=>e),i=[];return Ie(()=>{let s=N(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),i.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):L(a)&&(r.appendChild(a),i.push(()=>{a.parentNode===r&&r.removeChild(a)}))});i.push(s),C(()=>{i.forEach(a=>a())})}),null}function Vr(e){return typeof e=="string"&&e.toLowerCase()===e}function Ur(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function Wr(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function H(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Kr(e){return typeof e=="function"&&e.length===0&&m(e)}function He(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return vt(s=>{Ie(()=>{u.active||(t.textContent=""),R(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}var It="__fx_dom_create_component__",M=globalThis[It]??={fn:null};function Br(e){M.fn=e}function Gr(e={}){let t=e.signalSystem?.createComponent;t&&(M.fn=t)}function Xr(e,t){return M.fn?M.fn(e,t):(()=>e(t))}var Jr=()=>M.fn!==null,Yr=()=>M.fn!==null;function Zr(){M.fn=null}var B,Ue={getStore:()=>B,run(e,t){let n=B;B=e;try{return t()}finally{B=n}}},de=Ue;function We(e){de=e??Ue}function O(e={}){e.locals||(e.locals=e.request?ye(e.request):{});let t=0,n=0,r=null,o=new Map,i=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${t++}`,nextResourceId:()=>{if(r===null)return`r${n++}`;let s=o.get(r)??0;return o.set(r,s+1),`${r}:r${s}`},nextIslandNamespace:s=>{let a=i.get(s)??0;return i.set(s,a+1),`${s}#${a}`},withResourceScope(s,a){let l=r;r=s;try{return a()}finally{r=l}},pending:new Set,data:new Map}}function I(e,t){return de.run(e,t)}function E(){return de.getStore()}function pe(){return E()?.event}function Ke(){let e=pe();return e?(e.locals||(e.locals={}),e.locals):{}}var Ve=new WeakMap;function ye(e){let t=Ve.get(e);return t||(t={},Ve.set(e,t)),t}import{setResourceIdSource as qt,setServerDataGetter as jt}from"@fluixi/reactive/signal";var q="__FX_DATA__";function G(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var me;function X(){let e=globalThis.__FX_DATA__;if(e)return e;if(me!==void 0)return me;let t=null;if(typeof document<"u"){let n=document.getElementById(q)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return me=t}function he(){for(;;){for(;u.cursor&&u.cursor.nodeType===3&&u.cursor.data==="";)u.cursor=u.cursor.nextSibling;if(u.cursor!=null||!u.parents.length)return;u.cursor=u.parents.pop().nextSibling}}var Ft=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ge=typeof process<"u"&&process.env&&!1;function xe(e,t){let n=t.nodeType===1?`<${t.tagName.toLowerCase()}>`:t.nodeType===3?`text ${JSON.stringify((t.nodeValue??"").slice(0,24))}`:t.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${n}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function Ht(e){he();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Ft.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(ge&&t&&xe(`<${e}>`,t),null)}function Vt(e){if(e==="")return null;he();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(ge&&t&&xe(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Ut(e){he();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(ge&&t&&xe(`marker <!--${e.slice(0,24)}-->`,t),null)}var ze=!1;function Wt(){ze||(ze=!0,De({hydrateElement:Ht,hydrateText:Vt,hydrateMarker:Ut}))}function be(e,t,n){Wt(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=X(),o=n?.resourceNamespace,i=0;qt(()=>o?`${o}:r${i++}`:`r${i++}`),jt(r?s=>s in r?{value:r[s]}:void 0:null);try{return He(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Te="fluixi-island";function Kt(e){let{component:t,props:n={},name:r}=e,o=je(Te),i=r??t.name??"Island";S(o,"name",i),S(o,"props",JSON.stringify(n??{}));let s=h?E():void 0;if(s){let a=s.nextIslandNamespace(i);R(o,()=>s.withResourceScope(a,()=>t(n)))}else R(o,()=>t(n));return o}var Be=!1;function zt(){if(Be||typeof document>"u")return;Be=!0;let e=document.createElement("style");e.textContent=`${Te}{display:contents}`,document.head.appendChild(e)}function Bt(e){if(typeof document>"u")return;zt();let t=document.querySelectorAll(Te),n=new Map;t.forEach(r=>{let o=r.getAttribute("name")??"",i=n.get(o)??0;n.set(o,i+1);let s=e[o];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${o}" has no component in the registry — left static.`);return}let a={};try{a=JSON.parse(r.getAttribute("props")||"{}")}catch{}be(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}import{createMemo as Ne,untrack as Ye}from"@fluixi/reactive/signal";function Ge(e){return typeof e=="function"?e:(()=>e)}function w(e){return()=>{let t=e();return typeof t=="function"?t():t}}function Xe(e){return e!=null&&e!==!1}function Je(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function Gt(e){let t=w(()=>e.when),n=Ne(t,void 0),r=Ne(n,void 0);return Ne(()=>{if(r()){let i=e.children;return typeof i=="function"&&!Je(i)?typeof n=="function"?Ye(()=>Ye(n)?i(n()):e.fallback):i(n):i}return e.fallback},void 0,{name:"show"})}import{mapArray as Xt,keyArray as Jt}from"@fluixi/reactive/signal";function Yt(e){let t=w(()=>e.each),n=()=>e.fallback??null,r=(o,i)=>{let s=e.children,a=Array.isArray(s)?s.map(l=>typeof l=="function"?l(o,i):l):typeof s=="function"?s(o,i):s;return D(a),a};return e.by?Jt(t,e.by,(o,i)=>r(o,i),{fallback:n}):Xt(t,(o,i)=>r(o,i),{fallback:n})}import{indexArray as Zt}from"@fluixi/reactive/signal";function Qt(e){let t=w(()=>e.each);return Zt(t,(n,r)=>{let o=e.children(n,r);return D(o),o},{fallback:()=>e.fallback??null})}import{mapArray as di,keyArray as pi,indexArray as yi}from"@fluixi/reactive/signal";import{createMemo as en}from"@fluixi/reactive/signal";var Ee=Symbol("match");function tn(e){return{[Ee]:!0,when:w(()=>e.when),children:e.children}}function nn(e){let t=Array.isArray(e.children)?e.children:[e.children];return en(()=>{for(let n of t){let r=n,o=0;for(;typeof r=="function"&&!r[Ee]&&o++<10;)r=r();if(!r||typeof r!="object"||r[Ee]!==!0)continue;let i=r.when();if(Xe(i))return typeof r.children=="function"?r.children(i):r.children}return e.fallback??null})}import{createMemo as rn}from"@fluixi/reactive/signal";function on(e){let t=Ge(e.component),{component:n,...r}=e;return rn(()=>{let o=t();return o==null?null:typeof o=="string"?{tag:o,props:r}:o(r)})}import{createRoot as sn,onCleanup as an}from"@fluixi/reactive/signal";function ln(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return sn(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),R(r,e.children)&&z(e.ref,r)}),an(()=>{n(),r.remove()}),null}import{createMemo as cn,createSignal as un}from"@fluixi/reactive/signal";function fn(e){let[t,n]=un(null),r=()=>n(null);return cn(()=>{let o=t();if(o!==null)return typeof e.fallback=="function"?e.fallback(o,r):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(i){return n(i),typeof e.fallback=="function"?e.fallback(i,r):e.fallback}})}import{createMemo as dn}from"@fluixi/reactive/signal";function pn(e){return dn(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;(typeof o=="function"?o():o)&&n.push(r)}return n.join(" ")})}import{createMemo as yn}from"@fluixi/reactive/signal";function mn(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function hn(e){return yn(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;let i=typeof o=="function"?o():o;i!=null&&n.push(`${mn(r)}: ${i}`)}return n.join("; ")})}var we=1,Ae=3,Ce=8,Ze;Ze=k;var j=class{constructor(){this[Ze]=!0;this.parentNode=null;this.childNodes=[]}get firstChild(){return this.childNodes[0]??null}get lastChild(){return this.childNodes[this.childNodes.length-1]??null}get nextSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>=0?t.childNodes[n+1]??null:null}get previousSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>0?t.childNodes[n-1]??null:null}get parentElement(){return this.parentNode}appendChild(t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes.push(t),t}insertBefore(t,n){if(n==null)return this.appendChild(t);t.parentNode&&t.parentNode.removeChild(t);let r=this.childNodes.indexOf(n);return t.parentNode=this,r<0?this.childNodes.push(t):this.childNodes.splice(r,0,t),t}removeChild(t){let n=this.childNodes.indexOf(t);return n>=0&&this.childNodes.splice(n,1),t.parentNode=null,t}replaceChild(t,n){let r=this.childNodes.indexOf(n);return r>=0&&(t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes[r]=t,n.parentNode=null),n}addEventListener(){}removeEventListener(){}},F=class e extends j{constructor(n){super();this.nodeType=Ae;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}get textContent(){return this.data}set textContent(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},J=class e extends j{constructor(n){super();this.nodeType=Ce;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},Se=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},ve=class{constructor(t){this.el=t}list(){let t=this.el.getAttribute("class");return t?t.split(/\s+/).filter(Boolean):[]}write(t){t.length?this.el.setAttribute("class",t.join(" ")):this.el.removeAttribute("class")}add(...t){let n=this.list();for(let r of t)n.includes(r)||n.push(r);this.write(n)}remove(...t){this.write(this.list().filter(n=>!t.includes(n)))}contains(t){return this.list().includes(t)}toggle(t,n){let r=this.contains(t),o=n===void 0?!r:n;return o?this.add(t):this.remove(t),o}},Y=class e extends j{constructor(n,r=!1){super();this.nodeType=we;this.attributes=new Map;this.style=new Se;this.classList=new ve(this);this.rawHTML=null;this.localName=n.toLowerCase(),this.tagName=r?n:n.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(n,r){this.attributes.set(n,String(r))}removeAttribute(n){this.attributes.delete(n)}getAttribute(n){return this.attributes.has(n)?this.attributes.get(n):null}hasAttribute(n){return this.attributes.has(n)}get id(){return this.getAttribute("id")??""}set id(n){n==null?this.removeAttribute("id"):this.setAttribute("id",n)}get className(){return this.getAttribute("class")??""}set className(n){n==null?this.removeAttribute("class"):this.setAttribute("class",n)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(n){n==null?this.removeAttribute("for"):this.setAttribute("for",n)}set value(n){n==null?this.removeAttribute("value"):this.setAttribute("value",String(n))}set checked(n){n?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(n){n?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(n){}get textContent(){return this.childNodes.map(n=>n.textContent??"").join("")}set textContent(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,n!=null&&n!==""&&this.appendChild(new F(String(n)))}set innerText(n){this.textContent=n}set innerHTML(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=n==null?"":String(n)}cloneNode(n=!1){let r=new e(this.localName,this.isSVG);if(r.attributes=new Map(this.attributes),r.style.cssText=this.style.cssText,r.rawHTML=this.rawHTML,n)for(let o of this.childNodes)r.appendChild(o.cloneNode(!0));return r}};var gn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),et=/&/g,xn=/</g,bn=/>/g,Tn=/"/g;function Re(e){return e.replace(et,"&").replace(xn,"<").replace(bn,">")}function Qe(e){return e.replace(et,"&").replace(Tn,""")}function Nn(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function En(e){if(!e)return"";let t=[];e.cssText&&t.push(e.cssText.trim().replace(/;\s*$/,""));for(let n of Object.keys(e)){if(n==="cssText")continue;let r=e[n];r==null||r===""||t.push(`${Nn(n)}: ${r}`)}return t.join("; ")}function Sn(e){let t="",n=En(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${Qe(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${Qe(o)}"`}return t}function x(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return Re(e);if(typeof e=="number")return Re(String(e));if(typeof e=="function")return x(e());if(Array.isArray(e))return e.map(x).join("");switch(e.nodeType){case Ae:return Re(e.data??"");case Ce:return`<!--${e.data??""}-->`;case we:{let t=e.localName,n=`<${t}${Sn(e)}>`;if(gn.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(x).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(x).join(""):""}import{createRoot as ot}from"@fluixi/reactive/signal";import{setResourceTracker as vn,setResourceIdSource as wn,setResourceDataSink as An,getOwner as Cn,runWithOwner as tt,flush as Rn}from"@fluixi/reactive/signal";var nt=!1;function it(){nt||(nt=!0,_e({createElement:(e,t)=>new Y(e,t),createText:e=>new F(e),createComment:e=>new J(e)}))}function st(e,t={}){let n=h;it(),P(!0);let r=O(t.event);try{return I(r,()=>ot(o=>{try{let i=typeof e=="function"?e():e;return x(i)}finally{o()}}))}finally{P(n)}}var rt=!1;function Mn(){rt||(rt=!0,vn(e=>{E()?.pending.add(e)}),wn(()=>E()?.nextResourceId()??""),An((e,t)=>{e&&E()?.data.set(e,t)}))}var Me=null;function at(e){Me=e}function Pe(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(Me)try{i=Me(o,r)}catch{continue}i!==void 0&&(t[r]=i)}if(Object.keys(t).length===0)return"";let n=G(JSON.stringify(t));return`<script type="application/json" id="${q}">${n}<\/script>`}var Pn=50;async function lt(e,t={}){let n=h;it(),P(!0),Mn();let r=O(t.event);try{return await I(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};ot(f=>{s=f,i=Cn(),o=typeof e=="function"?e():e});let a=()=>{try{tt(i,()=>x(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<Pn;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await Rn(),a()}let c=tt(i,()=>x(o))+Pe(r);return s(),c})}finally{P(n)}}export{on as Dynamic,fn as ErrorBoundary,q as FX_DATA_ID,Yt as For,Qt as Index,Kt as Island,te as JSX_PROPERTIES,tn as Match,ln as Portal,On as SVG_ELEMENTS,Q as SVG_NAMESPACE,Gt as Show,nn as Switch,$n as VOID_ELEMENTS,jn as addClass,Pt as addDelegatedEventListener,Gn as appendChildren,ee as applyElementProp,Ir as applyProps,mr as asComponent,yr as asContext,dr as asOutlet,pr as asProvider,fr as asRoute,cr as asRouter,ur as asRoutes,hr as asSuspense,Nt as captureHydrationCursor,gr as checkRenderType,pn as classMap,A as cleanChildren,kr as cloneTemplate,qn as closest,Xr as createComponent,zn as createElement,je as createNativeElement,Hr as createPortal,O as createRequestContext,_r as createTemplate,Zn as delegate,qe as delegateEvents,G as escapeFxJson,Wr as escapeHTML,Dr as fnName,Mr as generateID,Un as getAttribute,ar as getGlobal,kn as getLitEventName,Ke as getLocals,Yn as getOffset,E as getRequestContext,pe as getRequestEvent,ye as getRequestLocals,X as getServerData,Rr as getStableElementId,Kn as getStyle,z as handleRef,Vn as hasClass,be as hydrate,D as hydrateAdvancePast,Bt as hydrateIslands,yi as indexArray,Gr as initializeIntegration,R as insert,$ as insertExpression,Jr as intergartionInitialized,Kr as isAccessor,g as isComponent,bt as isContext,ut as isCustomElement,ir as isDOMNode,Pr as isDelegatedEvent,oe as isDomElement,L as isDomNode,ie as isDomText,_n as isEventHandler,Lr as isFunction,Yr as isIntegrationInitialized,or as isJSXTemplate,pt as isLitTemplateResult,Vr as isNativeElement,gt as isOutlet,H as isPromise,xt as isProvider,nr as isReactElement,ht as isRoute,yt as isRouter,mt as isRoutes,Ur as isSVGElement,h as isServer,Tt as isSuspense,rr as isTemplateFactory,Xn as isVisible,$r as iterateFn,pi as keyArray,Lt as makeArrayFlat,di as mapArray,qr as mergeProps,er as observeIntersection,tr as observeResize,Le as query,In as queryAll,Br as registerCreateComponent,sr as registerGlobal,Fr as registerLitRender,Wn as removeAttribute,Bn as removeChildren,Fn as removeClass,Oe as removeDelegatedEventListener,He as render,Fe as renderLitToNodes,st as renderToString,lt as renderToStringAsync,Zr as resetIntegration,Et as runHydrationAt,I as runWithRequestContext,St as runWithoutHydration,Jn as scrollIntoView,x as serializeNode,Pe as serializeResourceData,S as setAttribute,W as setClassList,U as setClassName,at as setDataRedactor,$t as setDynamicAttribute,Ot as setDynamicProperty,ce as setProperty,We as setRequestStore,P as setServerMode,ue as setStyle,ft as setStyles,Dn as shouldSetAsProperty,jr as splitProps,Or as spread,hn as styleMap,Ln as toAttributeName,Hn as toggleClass,Qn as waitForElement};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow.d.ts","sourceRoot":"","sources":["../../../../src/lib/jsx/control-flow/flow.ts"],"names":[],"mappings":""}
|