@fluixi/dom 1.0.0-alpha.76 → 1.0.0-alpha.77

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,22 +4,24 @@
4
4
 
5
5
  # @fluixi/dom
6
6
 
7
- **Reactive DOM runtime with surgical fine-grained updates, SSR and lit-html integration.**
7
+ **The DOM runtime the compiler targets — surgical fine-grained updates, hydration and SSR.**
8
8
 
9
9
  [![License: MIT](https://img.shields.io/badge/License-MIT-22c55e.svg)](./LICENSE)
10
10
  ![TypeScript](https://img.shields.io/badge/TypeScript-strict-3178c6?logo=typescript&logoColor=white)
11
11
  [![npm](https://img.shields.io/npm/v/@fluixi/dom?logo=npm)](https://www.npmjs.com/package/@fluixi/dom)
12
- ![lit-html](https://img.shields.io/badge/lit--html-compatible-324fff)
13
12
 
14
13
  ---
15
14
 
16
- A comprehensive reactive DOM runtime with fine-grained updates, inspired by SolidJS's dom-expressions. This package provides low-level DOM manipulation utilities that work seamlessly with signal and store systems to enable optimal, surgical DOM updates.
15
+ The runtime `@fluixi/compiler` emits calls into. It provides the low-level DOM operations
16
+ element creation, reactive attributes and properties, insertion, control flow, hydration —
17
+ that make a change update exactly the binding depending on it. Usable directly, though most
18
+ code reaches it through compiled JSX or `` html`` `` templates.
17
19
 
18
20
  ## Features
19
21
 
20
22
  - 🎯 **Fine-Grained Reactivity**: Only updates the exact DOM nodes that need to change
21
23
  - 🔄 **Signal & Store Integration**: Works with any reactive system (signals, stores, observables)
22
- - 🎨 **Lit-HTML Support**: Seamlessly integrate lit-html templates with native JSX
24
+ - 🔁 **Hydration**: adopts server-rendered nodes in place rather than rebuilding beside them
23
25
  - 🚀 **Optimized Performance**: Template caching, event delegation, and minimal re-renders
24
26
  - 🧩 **Control Flow Components**: Built-in Show, For, Switch, Portal, and more
25
27
  - 📦 **Zero Dependencies**: Core runtime has no external dependencies on reactive systems
@@ -72,21 +74,18 @@ document.body.appendChild(div);
72
74
  setCount(1); // DOM updates to "Count: 1"
73
75
  ```
74
76
 
75
- ### Initialize Integration
77
+ ### Components
78
+
79
+ Bindings work as soon as you import — the example above needs no setup. Rendering
80
+ *components* needs one seam filled in, so a component call is owned and disposable:
76
81
 
77
82
  ```typescript
78
- import { initializeIntegration } from '@fluixi/dom';
79
- import { createEffect, batch } from '@fluixi/reactive/signal';
80
-
81
- // Initialize with your reactive system
82
- initializeIntegration({
83
- signalSystem: {
84
- createEffect,
85
- batch,
86
- },
87
- });
83
+ import '@fluixi/core'; // wires it for you at import time
88
84
  ```
89
85
 
86
+ Using `@fluixi/dom` without `@fluixi/core`? Fill the seam yourself — see
87
+ [Integration](#integration).
88
+
90
89
  ## Core API
91
90
 
92
91
  ### DOM Manipulation
@@ -96,7 +95,7 @@ initializeIntegration({
96
95
  Insert dynamic content with automatic reactivity tracking.
97
96
 
98
97
  ```typescript
99
- import { insert, createTextNode } from '@fluixi/dom';
98
+ import { insert } from '@fluixi/dom';
100
99
  import { createSignal } from '@fluixi/reactive/signal';
101
100
 
102
101
  const [text, setText] = createSignal('Hello');
@@ -109,7 +108,7 @@ insert(div, () => text());
109
108
  insert(div, 'Static text');
110
109
 
111
110
  // With a marker for positioning
112
- const marker = createTextNode('');
111
+ const marker = document.createTextNode('');
113
112
  div.appendChild(marker);
114
113
  insert(div, () => text(), marker);
115
114
  ```
@@ -334,193 +333,66 @@ ErrorBoundary({
334
333
  });
335
334
  ```
336
335
 
337
- ## Integration System
338
-
339
- The package provides a flexible integration system that works with any reactive library.
336
+ ## Integration
340
337
 
341
- ### Initialize with Signal System
338
+ This package renders; it doesn't own a reactive system. One seam connects the two — how a
339
+ component call is wrapped — and it is a single function:
342
340
 
343
341
  ```typescript
344
- import { initializeIntegration } from '@fluixi/dom';
345
- import * as signals from '@fluixi/reactive/signal';
346
-
347
- initializeIntegration({
348
- signalSystem: {
349
- createEffect: signals.createEffect,
350
- batch: signals.batch,
351
- createMemo: signals.createMemo,
352
- untrack: signals.untrack,
353
- getOwner: signals.getOwner,
354
- runWithOwner: signals.runWithOwner,
355
- createRoot: signals.createRoot,
356
- onCleanup: signals.onCleanup,
357
- },
358
- });
359
- ```
360
-
361
- ### Initialize with Store System
342
+ import { registerCreateComponent } from '@fluixi/dom';
362
343
 
363
- ```typescript
364
- import { initializeIntegration } from '@fluixi/dom';
365
- import * as store from '@fluixi/reactive/store';
366
-
367
- initializeIntegration({
368
- storeSystem: {
369
- isStore: store.isStore,
370
- unwrap: store.unwrap,
371
- isStoreProxy: store.isStoreProxy,
372
- },
373
- });
344
+ registerCreateComponent((Comp, props) => myOwnedCall(Comp, props));
374
345
  ```
375
346
 
376
- ### Auto-initialization
377
-
378
- The package attempts to auto-initialize by detecting available reactive systems:
347
+ **You almost never call this.** Importing `@fluixi/core` wires `@fluixi/reactive` in for
348
+ you at import time, so an app just imports and renders. It matters if you use `@fluixi/dom`
349
+ on its own, or drive it with a different reactive library.
379
350
 
380
351
  ```typescript
381
- import { autoInitialize } from '@fluixi/dom';
352
+ import { isIntegrationInitialized, resetIntegration } from '@fluixi/dom';
382
353
 
383
- // Manually trigger auto-initialization
384
- autoInitialize();
354
+ isIntegrationInitialized(); // has something claimed the seam?
355
+ resetIntegration(); // drop it again — tests
385
356
  ```
386
357
 
387
- ### Global Registration
358
+ `initializeIntegration({ signalSystem })` is the older entry point and still works; it picks
359
+ `createComponent` off what you pass and ignores the rest.
388
360
 
389
- Register your reactive systems globally for automatic detection:
361
+ ## Templates
390
362
 
391
- ```typescript
392
- import { registerSignalSystem, registerStoreSystem } from '@fluixi/dom';
363
+ `` html`` `` templates are compiled, not interpreted: `@fluixi/compiler` turns them into the
364
+ same calls this package exposes, so they cost nothing at runtime and need no template
365
+ library.
393
366
 
394
- registerSignalSystem({
395
- createEffect: myCreateEffect,
396
- batch: myBatch,
397
- });
367
+ ```ts
368
+ import { html } from '@fluixi/core';
398
369
 
399
- registerStoreSystem({
400
- isStore: myIsStore,
401
- unwrap: myUnwrap,
402
- });
370
+ function Counter() {
371
+ const n = $signal(0);
372
+ return html`<button @click=${() => n.set(n() + 1)}>${n()}</button>`;
373
+ }
403
374
  ```
404
375
 
405
- ## Lit-HTML Integration
406
-
407
- Seamlessly use lit-html templates with reactive updates.
408
-
409
- ### Basic Usage
410
-
411
- ```typescript
412
- import { signal } from '@fluixi/dom/reactive';
413
- import { html } from 'lit';
414
- import { createSignal } from '@fluixi/reactive/signal';
415
-
416
- const [count, setCount] = createSignal(0);
417
-
418
- const template = html`
419
- <div>
420
- <p>Count: ${signal(count)}</p>
421
- <button @click=${() => setCount(count() + 1)}>Increment</button>
422
- </div>
423
- `;
424
- ```
425
-
426
- ### Reactive Directives
427
-
428
- ```typescript
429
- import { signal, $if, $each } from '@fluixi/dom/reactive';
430
- import { html } from 'lit';
431
-
432
- const [items, setItems] = createSignal(['a', 'b', 'c']);
433
- const [show, setShow] = createSignal(true);
434
-
435
- const template = html`
436
- <div>
437
- ${$if(show,
438
- html`<p>Visible content</p>`,
439
- html`<p>Hidden</p>`
440
- )}
441
-
442
- ${$each(items,
443
- (item) => item,
444
- (item) => html`<li>${item}</li>`
445
- )}
446
- </div>
447
- `;
448
- ```
449
-
450
- ### Auto-wrapping with `rx`
451
-
452
- ```typescript
453
- import { rx } from '@fluixi/dom/reactive';
454
-
455
- const [name, setName] = createSignal('World');
456
-
457
- // Automatically wraps signal accessors
458
- const template = rx`
459
- <div>Hello, ${name}!</div>
460
- `;
461
- ```
376
+ The lit-html bridge this package once carried is gone — `lit` is not a dependency, and the
377
+ `@fluixi/dom/reactive` entry with its `$if`/`$each`/`rx` helpers no longer exists. Templates
378
+ go through the compiler now.
462
379
 
463
380
  ## Advanced Usage
464
381
 
465
- ### Custom Effect System
466
-
467
- ```typescript
468
- import { registerEffectCreator } from '@fluixi/dom';
469
-
470
- registerEffectCreator((fn) => {
471
- // Your custom effect implementation
472
- const dispose = myCustomEffect(fn);
473
- return dispose;
474
- });
475
- ```
476
-
477
- ### Custom Batch Function
478
-
479
- ```typescript
480
- import { registerBatch } from '@fluixi/dom';
481
-
482
- registerBatch((fn) => {
483
- // Your custom batching logic
484
- myCustomBatch(fn);
485
- });
486
- ```
487
-
488
- ### Reactive Bindings
489
-
490
- ```typescript
491
- import { createReactiveBinding } from '@fluixi/dom';
492
-
493
- const cleanup = createReactiveBinding(
494
- () => mySignal(), // getter
495
- (value) => {
496
- // Update handler
497
- console.log('Value changed:', value);
498
- }
499
- );
500
-
501
- // Cleanup when done
502
- cleanup();
503
- ```
504
-
505
382
  ### Memory Management
506
383
 
384
+ Bindings live and die with the owner they were created under, so tearing down a scope
385
+ removes its listeners and effects with it:
386
+
507
387
  ```typescript
508
- import { createRoot, onCleanup } from '@fluixi/dom';
388
+ import { createRoot, onCleanup } from '@fluixi/reactive';
389
+ import { insert } from '@fluixi/dom';
509
390
 
510
391
  createRoot((dispose) => {
511
- // Set up reactive scope
512
- const effect = createEffect(() => {
513
- // Effect logic
514
- });
515
-
516
- // Register cleanup
517
- onCleanup(() => {
518
- effect();
519
- console.log('Cleaned up!');
520
- });
521
-
522
- // Dispose when done
523
- dispose();
392
+ insert(container, () => text());
393
+ onCleanup(() => console.log('bindings gone'));
394
+
395
+ dispose(); // runs the cleanups, drops the bindings
524
396
  });
525
397
  ```
526
398
 
@@ -587,28 +459,11 @@ const mySignalSystem: SignalSystem = {
587
459
 
588
460
  ## Debugging
589
461
 
590
- ### Check Integration Status
591
-
592
462
  ```typescript
593
- import { getIntegrationStatus, logIntegrationStatus } from '@fluixi/dom';
594
-
595
- // Get status object
596
- const status = getIntegrationStatus();
597
- console.log(status);
463
+ import { isIntegrationInitialized } from '@fluixi/dom';
598
464
 
599
- // Pretty print to console
600
- logIntegrationStatus();
601
- ```
602
-
603
- ### Development Mode
604
-
605
- Set the `development` flag when initializing:
606
-
607
- ```typescript
608
- initializeIntegration({
609
- signalSystem: mySignalSystem,
610
- development: true, // Enables additional checks and warnings
611
- });
465
+ // A component rendering as a bare function usually means nothing claimed the seam
466
+ isIntegrationInitialized();
612
467
  ```
613
468
 
614
469
  ## Comparison with Other Libraries
@@ -617,9 +472,8 @@ initializeIntegration({
617
472
 
618
473
  This package is heavily inspired by SolidJS's dom-expressions but:
619
474
  - Works as a standalone library
620
- - Doesn't require a specific compiler
621
- - Can integrate with any reactive system
622
- - Supports both lit-html and native JSX
475
+ - Can be driven by another reactive system through `registerCreateComponent`
476
+ - Serves both JSX and `` html`` `` templates, which compile to the same calls
623
477
 
624
478
  ### vs React
625
479
 
@@ -629,13 +483,6 @@ This package is heavily inspired by SolidJS's dom-expressions but:
629
483
  - Smaller runtime size
630
484
  - Better performance for many use cases
631
485
 
632
- ### vs Lit
633
-
634
- - Works with lit-html templates
635
- - Adds fine-grained reactivity on top
636
- - Can be used standalone without Lit components
637
- - More flexible control flow
638
-
639
486
  ## Contributing
640
487
 
641
488
  Contributions are welcome! Please see the main repository for guidelines.
@@ -648,10 +495,10 @@ MIT
648
495
 
649
496
  - `@fluixi/jsx` - JSX runtime using this DOM package
650
497
  - `@fluixi/reactive` - Signal and store implementations
651
- - `lit` - Template literals for HTML
498
+ - `@fluixi/compiler` - Compiles JSX and `` html`` `` into these calls
652
499
 
653
500
  ## Resources
654
501
 
655
- - [SolidJS Documentation](https://www.solidjs.com/)
502
+ - [SolidJS Documentation](https://www.solidjs.com/) — dom-expressions is the closest prior art
656
503
  - [dom-expressions](https://github.com/ryansolid/dom-expressions)
657
- - [Lit Documentation](https://lit.dev/)
504
+ - [Fluixi docs](https://docs.fluixi.com)
package/dist/cdn/dom.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var De=Object.defineProperty;var bn=Object.getOwnPropertyDescriptor;var En=Object.getOwnPropertyNames;var wn=Object.prototype.hasOwnProperty;var Nn=(e,t)=>{for(var n in t)De(e,n,{get:t[n],enumerable:!0})},Sn=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of En(t))!wn.call(e,o)&&o!==n&&De(e,o,{get:()=>t[o],enumerable:!(r=bn(t,o))||r.enumerable});return e};var vn=e=>Sn(De({},"__esModule",{value:!0}),e);var co={};Nn(co,{ClientOnly:()=>tt,Dynamic:()=>en,ErrorBoundary:()=>rn,FX_DATA_ID:()=>K,For:()=>Xt,Index:()=>Yt,Island:()=>Ft,JSX_PROPERTIES:()=>ce,Match:()=>Zt,NoSsr:()=>nn,Portal:()=>tn,SVG_ELEMENTS:()=>kn,SVG_NAMESPACE:()=>H,Show:()=>Gt,Switch:()=>Qt,VOID_ELEMENTS:()=>Pn,addClass:()=>Dn,addDelegatedEventListener:()=>Lt,addNativeEventListener:()=>Ve,appendChildren:()=>Wn,applyElementProp:()=>le,applyProps:()=>Be,applyUse:()=>We,asComponent:()=>ur,asContext:()=>cr,asOutlet:()=>ar,asProvider:()=>lr,asRoute:()=>sr,asRouter:()=>or,asRoutes:()=>ir,asSuspense:()=>fr,batch:()=>g.batch,bindPair:()=>Ir,captureHydrationCursor:()=>Mt,checkRenderType:()=>dr,classMap:()=>sn,cleanChildren:()=>O,cloneTemplate:()=>Dt,closest:()=>On,createComponent:()=>Ge,createComputed:()=>g.createComputed,createContext:()=>g.createContext,createDynamicElement:()=>Yr,createEffect:()=>g.createEffect,createElement:()=>Hn,createMemo:()=>g.createMemo,createNativeElement:()=>He,createPortal:()=>Or,createRenderEffect:()=>g.createRenderEffect,createRequestContext:()=>U,createResource:()=>g.createResource,createRoot:()=>g.createRoot,createSignal:()=>g.createSignal,createStore:()=>Tn.createStore,createTemplate:()=>Ot,delegate:()=>zn,delegateEvents:()=>Fe,escapeFxJson:()=>se,escapeHTML:()=>_r,fnName:()=>vr,generateID:()=>gr,getAttribute:()=>qn,getGlobal:()=>rr,getLitEventName:()=>Rn,getLocals:()=>Ye,getOffset:()=>Kn,getRequestContext:()=>M,getRequestEvent:()=>xe,getRequestLocals:()=>Te,getServerData:()=>ae,getStableElementId:()=>mr,getStyle:()=>Fn,handleRef:()=>ie,hasClass:()=>In,holeContent:()=>Sr,holeEnd:()=>Nr,holeScope:()=>wr,html:()=>Vt,hydrate:()=>Se,hydrateAdvancePast:()=>W,hydrateIslands:()=>Ht,indexArray:()=>z.indexArray,initializeIntegration:()=>Fr,insert:()=>R,insertExpression:()=>ee,intergartionInitialized:()=>Hr,isAccessor:()=>$r,isComponent:()=>S,isContext:()=>St,isCustomElement:()=>dt,isDOMNode:()=>tr,isDelegatedEvent:()=>Tr,isDomElement:()=>ue,isDomNode:()=>I,isDomText:()=>fe,isEventHandler:()=>Cn,isFunction:()=>br,isIntegrationInitialized:()=>Vr,isJSXTemplate:()=>er,isLitTemplateResult:()=>yt,isNativeElement:()=>Dr,isOutlet:()=>wt,isPromise:()=>Q,isProvider:()=>Nt,isReactElement:()=>Zn,isRoute:()=>Et,isRouter:()=>Tt,isRoutes:()=>bt,isSVGElement:()=>Ke,isServer:()=>h,isSuspense:()=>vt,isTemplateFactory:()=>Qn,isVisible:()=>Un,iterateFn:()=>Ar,keyArray:()=>z.keyArray,makeArrayFlat:()=>_t,mapArray:()=>z.mapArray,mergeProps:()=>kr,observeIntersection:()=>Xn,observeResize:()=>Jn,onCleanup:()=>g.onCleanup,query:()=>_e,queryAll:()=>Ln,registerCreateComponent:()=>jr,registerGlobal:()=>nr,removeAttribute:()=>jn,removeChildren:()=>Vn,removeClass:()=>_n,removeDelegatedEventListener:()=>je,render:()=>ze,renderToString:()=>ct,renderToStringAsync:()=>ft,resetIntegration:()=>Wr,runHydrationAt:()=>Z,runWithRequestContext:()=>B,runWithoutHydration:()=>Pt,scrollIntoView:()=>Bn,serializeNode:()=>A,serializeResourceData:()=>ke,setAttribute:()=>w,setClassList:()=>re,setClassName:()=>ne,setDataRedactor:()=>ut,setDynamicAttribute:()=>ye,setDynamicBoolAttribute:()=>Ue,setDynamicProperty:()=>me,setProperty:()=>te,setRequestStore:()=>Je,setServerMode:()=>$,setStyle:()=>oe,setStyles:()=>pt,shouldSetAsProperty:()=>Mn,splitProps:()=>Lr,spread:()=>Pr,styleMap:()=>ln,svg:()=>Wt,templateNode:()=>Er,toAttributeName:()=>An,toggleClass:()=>$n,untrack:()=>g.untrack,useContext:()=>g.useContext,waitForElement:()=>Gn});module.exports=vn(co);function An(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function Cn(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function Rn(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function Mn(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 Pn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),kn=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"]),H="http://www.w3.org/2000/svg";function dt(e){return e.localName.includes("-")}function le(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(dt(e)){e[t]=n;return}w(e,t,n,r)}var ce=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function _e(e,t=document){return t.querySelector(e)}function Ln(e,t=document){return Array.from(t.querySelectorAll(e))}function On(e,t){return e.closest(t)}function Dn(e,...t){e.classList.add(...t)}function _n(e,...t){e.classList.remove(...t)}function $n(e,...t){t.forEach(n=>e.classList.toggle(n))}function In(e,t){return e.classList.contains(t)}function w(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 qn(e,t){return e.getAttribute(t)}function jn(e,t){e.removeAttribute(t)}function pt(e,t){Object.assign(e.style,t)}function Fn(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function Hn(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")pt(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else w(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function Vn(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Wn(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function Un(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Bn(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Kn(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 Gn(e,t=5e3){return new Promise((n,r)=>{let o=_e(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=_e(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 Xn(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function Jn(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Yn=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function Zn(e){return typeof e=="object"&&e!==null&&e.$$typeof===Yn}function yt(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Qn(e){if(typeof e!="function")return!1;try{let t=e();return yt(t)}catch{return!1}}function er(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function tr(e){return e instanceof Node}function nr(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function rr(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}var T=require("@fluixi/reactive/signal");var mt="1.0.0-alpha.76";var gt=require("@fluixi/reactive"),N={dom:mt,reactive:gt.VERSION};function ht(e){N.core&&e.setAttribute("fluixi",N.core),e.setAttribute("fx-dom",N.dom),e.setAttribute("fx-reactive",N.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=N)}function xt(){let e=[N.core,N.dom,N.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${N.core??"(absent)"}, dom ${N.dom}, reactive ${N.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function or(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function ir(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function sr(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function ar(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function lr(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function cr(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function ur(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function fr(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function Tt(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function bt(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function Et(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function wt(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function Nt(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function St(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function S(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function vt(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function dr(e){return Tt(e)?{type:"router",value:e}:Et(e)?{type:"route",value:e}:bt(e)?{type:"routes",value:e}:wt(e)?{type:"outlet",value:e}:S(e)?{type:"component",value:e}:vt(e)?{type:"suspense",value:e}:Nt(e)?{type:"provider",value:e}:St(e)?{type:"context",value:e}:{type:"none",value:e}}var d=require("@fluixi/reactive/signal");var h=typeof document>"u";function $(e){h=e}var Y=Symbol.for("fluixi.server-node"),$e=null;function At(e){$e=e}function V(){if(!$e)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return $e}function I(e){return e!=null&&e[Y]===!0?!0:typeof Node<"u"&&e instanceof Node}function ue(e){return e!=null&&e[Y]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function fe(e){return e!=null&&e[Y]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},Ct=null;function Rt(e){Ct=e}function de(){return Ct}function Ie(e,t){return u.active&&t.parentNode===e}function qe(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function Mt(){return u.active?u.cursor:null}function Z(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 Pt(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 W(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&qe(t)}function pr(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 yr(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 mr(e){return yr(pr(e))}var gr=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),hr={};var kt=new Map,pe=new Set,ge=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function Fe(e){if(!h)for(let t of e)pe.has(t)||ge.has(t)||(pe.add(t),document.addEventListener(t,xr))}function xr(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 Lt(e,t,n){if(e[`$$${t}`]=n,ge.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}pe.has(t)||Fe([t])}function je(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function Tr(e){return!ge.has(e)}function br(e){return typeof e=="function"}function D(e,t=!1){if(h)return V().createText(e);if(u.active&&!t){let n=de()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function He(e,t=!1){if(h)return V().createElement(e,t);if(u.active){let n=de()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(H,e):document.createElement(e)}function Ot(e,t=!1){let n=kt.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,kt.set(e,r),r}function Er(e,t,n=!1,r=!1){if(h){let o=V();return n?o.parseTemplate(e,r):o.createRaw(e)}if(u.active){let o=de()?.hydrateStatic(t);if(o)return o}return Dt(Ot(e,r),r).firstChild}function wr(e,t){if(!u.active)return t();let n=Z(e.nextSibling,t);if(typeof n=="function"){let r=n;return((...o)=>u.active?Z(e.nextSibling,()=>r(...o)):r(...o))}return n}function Nr(e){for(let t=e.nextSibling;t;t=t.nextSibling)if(t.nodeType===8&&t.data==="fx/")return t;throw new Error("[fluixi] template hole is missing its closing marker")}function Sr(e,t){let n=[];for(let r=e.nextSibling;r&&r!==t;r=r.nextSibling)n.push(r);return n}function Dt(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function _t(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?_t(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function vr(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Ar(e){if((0,T.isSignal)(e)||S(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,T.isSignal)(t)&&!S(t);)t=t();return t}var L=0,Cr=200;function Rr(e,t,n,r,o){let i=r,s=new Map;return(0,d.createRenderEffect)(()=>{let a;if(S(e)&&!(0,T.isSignal)(e)){if(!s.has(e)){L++;try{let l=e();s.set(e,l)}finally{L--}}for(a=s.get(e);typeof a=="function"&&(0,T.isSignal)(a);)a=a()}else for(a=e();typeof a=="function"&&(0,T.isSignal)(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(S(a)){if(!s.has(a)){let c=a;L++;try{let f=c();s.set(c,f)}finally{L--}}a=s.get(a)}else if((0,T.isSignal)(a))a=a();else if(a=a(),typeof a!="function"||!(0,T.isSignal)(a)&&!S(a))break}L++;try{i=ee(t,a,n,i,s),o(i)}finally{L--}})}function R(e,t,n,r){if(L>Cr)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=D("",!0),e.appendChild(n));let o=r??null,i=l=>Array.isArray(l)&&l.some(c=>typeof c=="function"),s=l=>typeof l=="function"?l:()=>l;if(typeof t!="function"&&!i(t)){L++;try{o=ee(e,t,n,o)}finally{L--}return()=>o}let a=Rr(s(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function ee(e,t,n,r,o){if(t==null||typeof t=="boolean")return O(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return O(e,r,n);if(Q(t)){let s=D("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),O(e,r.slice(1),n)):b(e,s,n):r?e.replaceChild(s,r):b(e,s,n),t.then(a=>{s.parentNode===e&&ee(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=D(t);return b(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=O(e,r,n)}if(r&&fe(r))return r.data=t,r;let s=D(t);return r&&r.parentNode===e?e.replaceChild(s,r):Ie(e,s)||b(e,s,n),s}if(I(t))return Ie(e,t)?(qe(t),t):Array.isArray(r)?(r.length===0?b(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),O(e,r.slice(1),n)):b(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):b(e,t,n)):b(e,t,n),t);if(Array.isArray(t)){let s=[],a=Array.isArray(r)?r:r?[r]:[],l=[];k(t,s,e,n,!0,o,l);let c=Mr(e,a,s,n);for(let f of l){let p=R(e,f.sig,f.marker);(0,d.onCleanup)(()=>{O(e,p()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(i==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let a=s;if(typeof a.type=="function"){let l=a.type(a.props||{});return ee(e,l,n,r)}}}return O(e,r,n)}function k(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"&&!Q(l)&&!(0,T.isSignal)(l)&&!S(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(S(l)&&!(0,T.isSignal)(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!Q(c)&&!(0,T.isSignal)(c)&&!S(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,T.isSignal)(c)){if(s){let p=D("",!0);t.push(p),s.push({marker:p,sig:c});continue}let f=c();for(;typeof f=="function"&&(0,T.isSignal)(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?k(f,t,n,r,o,i):k([f],t,n,r,o,i);continue}continue}Array.isArray(c)?k(c,t,n,r,o,i,s):k([c],t,n,r,o,i,s);continue}if(Q(l)){let c=D("",!0);t.push(c),l.then(f=>{if(c.parentNode){let p=[];if(k([f],p,c.parentNode,void 0,!1,i),p.length>0){c.parentNode.replaceChild(p[0],c);for(let y=1;y<p.length;y++)c.parentNode?.insertBefore(p[y],p[y-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){k(l,t,n,r,o,i,s);continue}if(I(l)){t.push(l);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)?k(f,t,n,r,!1,i):k([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(D(c));continue}t.push(D(String(l)))}}}}function Mr(e,t,n,r){for(let p=0;p<n.length;p++){let y=n[p].parentNode;y!==null&&y!==e&&y.nodeType!==11&&(n=n.slice(),n[p]=n[p].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 p=s<o?l?n[l-1].nextSibling??void 0:n[s-l]:c;for(;l<s;)b(e,n[l++],p)}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 p=t[--i].nextSibling;b(e,n[l++],t[a++].nextSibling),b(e,n[--s],p),t[i]=t[a-1]}else{if(!f){f=new Map;let y=l;for(;y<s;)f.set(n[y],y++)}let p=f.get(t[a]);if(p!=null)if(l<p&&p<s){let y=a,m=1;for(;++y<i&&y<s&&!(!f.has(t[y])||f.get(t[y])!==p+m);)m++;if(m>p-l){let Le=t[a];for(;l<p;)b(e,n[l++],Le)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(b(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function O(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 b(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function te(e,t,n){n==null?delete e[t]:e[t]=n}function Ve(e,t,n){let r=n,o;return Array.isArray(n)&&(r=n[0],o=n[1]),typeof r!="function"?()=>{}:(e.addEventListener(t,r,o),()=>e.removeEventListener(t,r,o))}function We(e,t){let n=(r,o)=>{typeof r=="function"&&r(e,o??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let r of t)Array.isArray(r)?n(r[0],r[1]):n(r)}}function ye(e,t,n,r=!1){return typeof n!="function"?(w(e,t,n,r),()=>{}):(0,d.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;w(e,t,o,r)})}function me(e,t,n){return typeof n!="function"?(te(e,t,n),()=>{}):(0,d.createRenderEffect)(()=>{let r=typeof n=="function"?n():n;te(e,t,r)})}function Ue(e,t,n){return typeof n!="function"?(w(e,t,!!n),()=>{}):(0,d.createRenderEffect)(()=>{let r=n();w(e,t,!!r)})}function ne(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,d.createRenderEffect)(()=>ne(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 re(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,d.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 oe(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 Pr(e){let{element:t,props:n,prevProps:r=hr,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!ue(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===H,a=[];for(let l in n){if(i&&l==="children")continue;let c=n[l],f=r[l];if(c===f)continue;if(l==="ref"){ie(c,t);continue}if(l==="use"){We(t,c);continue}if(l.startsWith("on:")){a.push(Ve(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(me(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(ye(t,l.slice(5),c,s));continue}if(l.startsWith("bool:")){a.push(Ue(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>ne(t,c()))):ne(t,c);continue}if(l==="classList"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>re(t,c()))):re(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>oe(t,c()))):oe(t,c);continue}if(l.startsWith("on")){let y=l.slice(2).toLowerCase();f&&je(t,y),c&&Lt(t,y,c);continue}let p=ce.has(l)||!s&&l in t;typeof c=="function"?a.push(p?me(t,l,c):ye(t,l,c,s)):a.push((0,d.createRenderEffect)(()=>p?te(t,l,n[l]):w(t,l,n[l],s)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();je(t,c)}else ce.has(l)?te(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function Be(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){ie(o,e);continue}if(r!=="children"){if(r==="use"){We(e,o);continue}if(r.startsWith("on:")){Ve(e,r.slice(3),o);continue}if(r.startsWith("prop:")){me(e,r.slice(5),o);continue}if(r.startsWith("attr:")){ye(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){Ue(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(ge.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,pe.has(i)||Fe([i]);continue}if(r==="class"||r==="className"){ne(e,o);continue}if(r==="classList"){typeof o=="function"?(0,d.createRenderEffect)(()=>re(e,o())):re(e,o);continue}if(r==="style"){typeof o=="function"?(0,d.createRenderEffect)(()=>oe(e,o())):oe(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});(0,d.onCleanup)(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});(0,d.onCleanup)(()=>{i()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});(0,d.onCleanup)(()=>{i()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=(0,d.createEffect)(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});(0,d.onCleanup)(()=>{s()})}else{let i=!0;(0,d.createRenderEffect)(()=>{let s=t[r];i?(i=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();le(e,r,s,n)});(0,d.onCleanup)(()=>{i()})}else(0,d.createRenderEffect)(()=>le(e,r,t[r],n))}}}function kr(...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 Lr(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 ie(e,t){if(e){if(I(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)}}function Or(e,t,n){let r=t||document.body,o=(0,d.readChildren)(()=>e),i=[];return(0,d.batch)(()=>{let s=(0,d.createRenderEffect)(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),i.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):I(a)&&(r.appendChild(a),i.push(()=>{a.parentNode===r&&r.removeChild(a)}))});i.push(s),(0,d.onCleanup)(()=>{i.forEach(a=>a())})}),null}function Dr(e){return typeof e=="string"&&e.toLowerCase()===e}function Ke(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 _r(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Q(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function $r(e){return typeof e=="function"&&e.length===0&&(0,T.isSignal)(e)}function ze(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return(0,d.createRoot)(s=>{(0,d.batch)(()=>{u.active||(t.textContent=""),ht(t),xt(),R(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}function Ir(e){if(Array.isArray(e))return e;if(typeof e=="function"&&typeof e.set=="function")return[e,e.set];throw new TypeError("[fluixi] bind: needs a signal — either `signal(…)` or the `[get, set]` pair from `createSignal(…)`.")}var qr="__fx_dom_create_component__",q=globalThis[qr]??={fn:null};function jr(e){q.fn=e}function Fr(e={}){let t=e.signalSystem?.createComponent;t&&(q.fn=t)}function Ge(e,t){return q.fn?q.fn(e,t):(()=>e(t))}var Hr=()=>q.fn!==null,Vr=()=>q.fn!==null;function Wr(){q.fn=null}var he,It={getStore:()=>he,run(e,t){let n=he;he=e;try{return t()}finally{he=n}}},Xe=It;function Je(e){Xe=e??It}function U(e={}){e.locals||(e.locals=e.request?Te(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 B(e,t){return Xe.run(e,t)}function M(){return Xe.getStore()}function xe(){return M()?.event}function Ye(){let e=xe();return e?(e.locals||(e.locals={}),e.locals):{}}var $t=new WeakMap;function Te(e){let t=$t.get(e);return t||(t={},$t.set(e,t)),t}var be=require("@fluixi/reactive/signal");var K="__FX_DATA__";function se(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var Ze;function ae(){let e=globalThis.__FX_DATA__;if(e)return e;if(Ze!==void 0)return Ze;let t=null;if(typeof document<"u"){let n=document.getElementById(K)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return Ze=t}function Ee(){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 Ur=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),we=typeof process<"u"&&process.env&&!1;function Ne(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){Ee();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Ur.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(we&&t&&Ne(`<${e}>`,t),null)}function Kr(e){Ee();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(u.cursor=t.nextSibling,t):(we&&t&&Ne(`<${e}> (static)`,t),null)}function zr(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}Ee();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(we&&t&&Ne(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Gr(e){Ee();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(we&&t&&Ne(`marker <!--${e.slice(0,24)}-->`,t),null)}var qt=!1;function Xr(){qt||(qt=!0,Rt({hydrateElement:Br,hydrateText:zr,hydrateMarker:Gr,hydrateStatic:Kr}))}function Se(e,t,n){Xr(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=ae(),o=n?.resourceNamespace,i=0;(0,be.setResourceIdSource)(()=>o?`${o}:r${i++}`:`r${i++}`),(0,be.setServerDataGetter)(r?s=>s in r?{value:r[s]}:void 0:null);try{return ze(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Qe="fluixi-island";function Ft(e){let{component:t,props:n={},name:r}=e,o=He(Qe),i=r??t.name??"Island";w(o,"name",i),w(o,"props",JSON.stringify(n??{}));let s=h?M():void 0;if(s){let a=s.nextIslandNamespace(i);R(o,()=>s.withResourceScope(a,()=>t(n)))}else R(o,()=>t(n));return o}var jt=!1;function Jr(){if(jt||typeof document>"u")return;jt=!0;let e=document.createElement("style");e.textContent=`${Qe}{display:contents}`,document.head.appendChild(e)}function Ht(e){if(typeof document>"u")return;Jr();let t=document.querySelectorAll(Qe),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{}Se(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}function Vt(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function Wt(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}var Ut=require("@fluixi/reactive/signal");function Yr(e,t={}){if(typeof e=="function")return Ge(e,t);if(typeof e!="string"||e.length===0)return null;let n=Ke(e);if(h)return V().createElement(e,n);let r=n?document.createElementNS(H,e):document.createElement(e);return Be(r,t,n),Zr(r,t),r}function Zr(e,t){if(!t||t.children===void 0)return;let n=(0,Ut.readChildren)(()=>t.children),r=o=>{R(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}var x=require("@fluixi/reactive/signal");function Bt(e){return typeof e=="function"?e:(()=>e)}function _(e){return()=>{let t=e();return typeof t=="function"?t():t}}function Kt(e){return e!=null&&e!==!1}function zt(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=_(()=>e.when),n=(0,x.createMemo)(t,void 0),r=(0,x.createMemo)(n,void 0),o=(0,x.getOwner)(),i=null,s=null,a=l=>{l!==s&&(i&&(0,x.disposeScope)(i),i=(0,x.createChildOwner)(o),s=l)};return(0,x.createMemo)(()=>{let l=r();return a(l?"when":"fallback"),(0,x.runWithOwner)(i,()=>{if(l){let c=e.children;return typeof c=="function"&&!zt(c)?typeof n=="function"?(0,x.untrack)(()=>(0,x.untrack)(n)?c(n()):e.fallback):c(n):c}return e.fallback});return e.fallback??null},void 0,{name:"show"})}var ve=require("@fluixi/reactive/signal");function Xt(e){let t=_(()=>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 W(a),a};return e.by?(0,ve.keyArray)(t,e.by,(o,i)=>r(o,i),{fallback:n}):(0,ve.mapArray)(t,(o,i)=>r(o,i),{fallback:n})}var Jt=require("@fluixi/reactive/signal");function Yt(e){let t=_(()=>e.each);return(0,Jt.indexArray)(t,(n,r)=>{let o=e.children(n,r);return W(o),o},{fallback:()=>e.fallback??null})}var z=require("@fluixi/reactive/signal");var v=require("@fluixi/reactive/signal");var et=Symbol("match");function Zt(e){return{[et]:!0,when:_(()=>e.when),get children(){return e.children}}}function Qt(e){let t=Array.isArray(e.children)?e.children:[e.children],n=(0,v.getOwner)(),r=null,o=-1,i=s=>{s!==o&&(r&&(0,v.disposeScope)(r),r=(0,v.createChildOwner)(n),o=s)};return(0,v.createMemo)(()=>{for(let s=0;s<t.length;s+=1){let l=t[s],c=0;for(;typeof l=="function"&&!l[et]&&c++<10;)l=l();if(!l||typeof l!="object"||l[et]!==!0)continue;let f=l.when();if(Kt(f))return i(s),(0,v.runWithOwner)(r,()=>typeof l.children=="function"?l.children(f):l.children)}return i(-2),(0,v.runWithOwner)(r,()=>e.fallback??null)})}var P=require("@fluixi/reactive/signal");function en(e){let t=Bt(e.component),{component:n,...r}=e,o=(0,P.getOwner)(),i=null,s;return(0,P.createMemo)(()=>{let a=t();return a!==s&&(i&&(0,P.disposeScope)(i),i=(0,P.createChildOwner)(o),s=a),a==null?null:typeof a=="string"?{tag:a,props:r}:(0,P.runWithOwner)(i,()=>a(r))})}var Ae=require("@fluixi/reactive/signal");function tn(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return(0,Ae.createRoot)(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),R(r,e.children)&&ie(e.ref,r)}),(0,Ae.onCleanup)(()=>{n(),r.remove()}),null}var Ce=require("@fluixi/reactive/signal");function tt(e){if(h)return e.fallback??null;let t=u.active,[n,r]=(0,Ce.createSignal)(!t);return t&&queueMicrotask(()=>r(!0)),(0,Ce.createMemo)(()=>n()?e.children:e.fallback??null,void 0,{name:"client-only"})}var nn=tt;var Re=require("@fluixi/reactive/signal");function rn(e){let[t,n]=(0,Re.createSignal)(null),r=()=>n(null);return(0,Re.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 on=require("@fluixi/reactive/signal");function sn(e){return(0,on.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 an=require("@fluixi/reactive/signal");function Qr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function ln(e){return(0,an.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(`${Qr(r)}: ${i}`)}return n.join("; ")})}var Pe=1,ot=3,it=8,cn;cn=Y;var G=class{constructor(){this[cn]=!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(){}},j=class e extends G{constructor(n){super();this.nodeType=ot;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)}},Me=class e extends G{constructor(n){super();this.nodeType=Pe;this.rawOuterHTML=n}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},X=class e extends G{constructor(n){super();this.nodeType=it;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},nt=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},rt=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}},F=class e extends G{constructor(n,r=!1){super();this.nodeType=Pe;this.attributes=new Map;this.style=new nt;this.classList=new rt(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 j(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 eo=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),fn=/&/g,dn=/</g,pn=/>/g,to=/"/g;function st(e){return e.replace(fn,"&amp;").replace(dn,"&lt;").replace(pn,"&gt;")}function un(e){return e.replace(fn,"&amp;").replace(to,"&quot;").replace(dn,"&lt;").replace(pn,"&gt;")}function no(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function ro(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(`${no(n)}: ${r}`)}return t.join("; ")}function oo(e){let t="",n=ro(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${un(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${un(o)}"`}return t}function A(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return st(e);if(typeof e=="number")return st(String(e));if(typeof e=="function")return A(e());if(Array.isArray(e))return e.map(A).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case ot:return st(e.data??"");case it:return`<!--${e.data??""}-->`;case Pe:{let t=e.localName,n=`<${t}${oo(e)}>`;if(eo.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(A).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(A).join(""):""}var lt=require("@fluixi/reactive/signal"),E=require("@fluixi/reactive/signal");var io=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),so={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function yn(e){return e.replace(/&(#?\w+);/g,(t,n)=>so[n]??t)}var C=class extends Error{};function mn(e,t=!1){let n=0,r=[],o=[],i=c=>{let f=o[o.length-1];f?f.appendChild(c):r.push(c)};for(;n<e.length;){let c=e.indexOf("<",n);if(c===-1){a(e.slice(n));break}if(c>n&&a(e.slice(n,c)),e.startsWith("<!--",c)){let f=e.indexOf("-->",c);if(f===-1)throw new C(`unterminated comment at ${c}`);i(new X(e.slice(c+4,f))),n=f+3;continue}if(e[c+1]==="/"){let f=e.indexOf(">",c);if(f===-1)throw new C(`unterminated closing tag at ${c}`);let p=e.slice(c+2,f).trim().toLowerCase(),y=o.pop();if(!y||y.localName!==p)throw new C(`</${p}> does not close <${y?.localName??"nothing"}>`);n=f+1;continue}n=l(c)}if(o.length>0)throw new C(`unclosed <${o[o.length-1].localName}>`);let s=r[0];if(r.length!==1||!(s instanceof F))throw new C(`expected exactly one root element, got ${r.length}`);return s;function a(c){c!==""&&i(new j(yn(c)))}function l(c){let f=/[\s/>]/.exec(e.slice(c+1));if(!f)throw new C(`unterminated tag at ${c}`);let p=e.slice(c+1,c+1+f.index).toLowerCase(),y=new F(p,t),m=c+1+f.index;for(;m<e.length;){for(;m<e.length&&/\s/.test(e[m]);)m++;if(e[m]===">"){m++;break}if(e[m]==="/"&&e[m+1]===">"){m+=2;break}let Le=m;for(;m<e.length&&!/[\s=/>]/.test(e[m]);)m++;let J=e.slice(Le,m);if(J==="")throw new C(`malformed attribute at ${m}`);if(e[m]==="="){if(e[m+1]!=='"')throw new C(`attribute ${J} must have a double-quoted value`);let Oe=e.indexOf('"',m+2);if(Oe===-1)throw new C(`unterminated value for ${J}`);y.setAttribute(J,yn(e.slice(m+2,Oe))),m=Oe+1}else y.setAttribute(J,"")}return i(y),io.has(p)||o.push(y),m}}var gn=!1;function xn(){gn||(gn=!0,At({createElement:(e,t)=>new F(e,t),createText:e=>new j(e),createRaw:e=>new Me(e),parseTemplate:(e,t)=>mn(e,t),createComment:e=>new X(e)}))}function ct(e,t={}){let n=h;xn(),$(!0);let r=U(t.event);try{return B(r,()=>(0,lt.createRoot)(o=>{try{let i=typeof e=="function"?e():e;return A(i)}finally{o()}}))}finally{$(n)}}var hn=!1;function ao(){hn||(hn=!0,(0,E.setResourceTracker)(e=>{M()?.pending.add(e)}),(0,E.setResourceIdSource)(()=>M()?.nextResourceId()??""),(0,E.setResourceDataSink)((e,t)=>{e&&M()?.data.set(e,t)}))}var at=null;function ut(e){at=e}function ke(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(at)try{i=at(o,r)}catch{continue}i!==void 0&&(typeof i=="function"||typeof i=="symbol"||(t[r]=i))}if(Object.keys(t).length===0)return"";let n=se(JSON.stringify(t));return n==="{}"?"":`<script type="application/json" id="${K}">${n}<\/script>`}var lo=50;async function ft(e,t={}){let n=h;xn(),$(!0),ao();let r=U(t.event);try{return await B(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};(0,lt.createRoot)(f=>{s=f,i=(0,E.getOwner)(),o=typeof e=="function"?e():e});let a=()=>{try{(0,E.runWithOwner)(i,()=>A(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<lo;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await(0,E.flush)(),a()}let c=(0,E.runWithOwner)(i,()=>A(o))+ke(r);return s(),c})}finally{$(n)}}var g=require("@fluixi/reactive/signal"),Tn=require("@fluixi/reactive/store");
1
+ "use strict";var De=Object.defineProperty;var bn=Object.getOwnPropertyDescriptor;var En=Object.getOwnPropertyNames;var wn=Object.prototype.hasOwnProperty;var Nn=(e,t)=>{for(var n in t)De(e,n,{get:t[n],enumerable:!0})},Sn=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of En(t))!wn.call(e,o)&&o!==n&&De(e,o,{get:()=>t[o],enumerable:!(r=bn(t,o))||r.enumerable});return e};var vn=e=>Sn(De({},"__esModule",{value:!0}),e);var co={};Nn(co,{ClientOnly:()=>tt,Dynamic:()=>en,ErrorBoundary:()=>rn,FX_DATA_ID:()=>K,For:()=>Xt,Index:()=>Yt,Island:()=>Ft,JSX_PROPERTIES:()=>ce,Match:()=>Zt,NoSsr:()=>nn,Portal:()=>tn,SVG_ELEMENTS:()=>kn,SVG_NAMESPACE:()=>H,Show:()=>Gt,Switch:()=>Qt,VOID_ELEMENTS:()=>Pn,addClass:()=>Dn,addDelegatedEventListener:()=>Lt,addNativeEventListener:()=>Ve,appendChildren:()=>Wn,applyElementProp:()=>le,applyProps:()=>Be,applyUse:()=>We,asComponent:()=>ur,asContext:()=>cr,asOutlet:()=>ar,asProvider:()=>lr,asRoute:()=>sr,asRouter:()=>or,asRoutes:()=>ir,asSuspense:()=>fr,batch:()=>g.batch,bindPair:()=>Ir,captureHydrationCursor:()=>Mt,checkRenderType:()=>dr,classMap:()=>sn,cleanChildren:()=>O,cloneTemplate:()=>Dt,closest:()=>On,createComponent:()=>Ge,createComputed:()=>g.createComputed,createContext:()=>g.createContext,createDynamicElement:()=>Yr,createEffect:()=>g.createEffect,createElement:()=>Hn,createMemo:()=>g.createMemo,createNativeElement:()=>He,createPortal:()=>Or,createRenderEffect:()=>g.createRenderEffect,createRequestContext:()=>U,createResource:()=>g.createResource,createRoot:()=>g.createRoot,createSignal:()=>g.createSignal,createStore:()=>Tn.createStore,createTemplate:()=>Ot,delegate:()=>zn,delegateEvents:()=>Fe,escapeFxJson:()=>se,escapeHTML:()=>_r,fnName:()=>vr,generateID:()=>gr,getAttribute:()=>qn,getGlobal:()=>rr,getLitEventName:()=>Rn,getLocals:()=>Ye,getOffset:()=>Kn,getRequestContext:()=>M,getRequestEvent:()=>xe,getRequestLocals:()=>Te,getServerData:()=>ae,getStableElementId:()=>mr,getStyle:()=>Fn,handleRef:()=>ie,hasClass:()=>In,holeContent:()=>Sr,holeEnd:()=>Nr,holeScope:()=>wr,html:()=>Vt,hydrate:()=>Se,hydrateAdvancePast:()=>W,hydrateIslands:()=>Ht,indexArray:()=>z.indexArray,initializeIntegration:()=>Fr,insert:()=>R,insertExpression:()=>ee,intergartionInitialized:()=>Hr,isAccessor:()=>$r,isComponent:()=>S,isContext:()=>St,isCustomElement:()=>dt,isDOMNode:()=>tr,isDelegatedEvent:()=>Tr,isDomElement:()=>ue,isDomNode:()=>I,isDomText:()=>fe,isEventHandler:()=>Cn,isFunction:()=>br,isIntegrationInitialized:()=>Vr,isJSXTemplate:()=>er,isLitTemplateResult:()=>yt,isNativeElement:()=>Dr,isOutlet:()=>wt,isPromise:()=>Q,isProvider:()=>Nt,isReactElement:()=>Zn,isRoute:()=>Et,isRouter:()=>Tt,isRoutes:()=>bt,isSVGElement:()=>Ke,isServer:()=>h,isSuspense:()=>vt,isTemplateFactory:()=>Qn,isVisible:()=>Un,iterateFn:()=>Ar,keyArray:()=>z.keyArray,makeArrayFlat:()=>_t,mapArray:()=>z.mapArray,mergeProps:()=>kr,observeIntersection:()=>Xn,observeResize:()=>Jn,onCleanup:()=>g.onCleanup,query:()=>_e,queryAll:()=>Ln,registerCreateComponent:()=>jr,registerGlobal:()=>nr,removeAttribute:()=>jn,removeChildren:()=>Vn,removeClass:()=>_n,removeDelegatedEventListener:()=>je,render:()=>ze,renderToString:()=>ct,renderToStringAsync:()=>ft,resetIntegration:()=>Wr,runHydrationAt:()=>Z,runWithRequestContext:()=>B,runWithoutHydration:()=>Pt,scrollIntoView:()=>Bn,serializeNode:()=>A,serializeResourceData:()=>ke,setAttribute:()=>w,setClassList:()=>re,setClassName:()=>ne,setDataRedactor:()=>ut,setDynamicAttribute:()=>ye,setDynamicBoolAttribute:()=>Ue,setDynamicProperty:()=>me,setProperty:()=>te,setRequestStore:()=>Je,setServerMode:()=>$,setStyle:()=>oe,setStyles:()=>pt,shouldSetAsProperty:()=>Mn,splitProps:()=>Lr,spread:()=>Pr,styleMap:()=>ln,svg:()=>Wt,templateNode:()=>Er,toAttributeName:()=>An,toggleClass:()=>$n,untrack:()=>g.untrack,useContext:()=>g.useContext,waitForElement:()=>Gn});module.exports=vn(co);function An(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function Cn(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function Rn(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function Mn(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 Pn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),kn=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"]),H="http://www.w3.org/2000/svg";function dt(e){return e.localName.includes("-")}function le(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(dt(e)){e[t]=n;return}w(e,t,n,r)}var ce=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function _e(e,t=document){return t.querySelector(e)}function Ln(e,t=document){return Array.from(t.querySelectorAll(e))}function On(e,t){return e.closest(t)}function Dn(e,...t){e.classList.add(...t)}function _n(e,...t){e.classList.remove(...t)}function $n(e,...t){t.forEach(n=>e.classList.toggle(n))}function In(e,t){return e.classList.contains(t)}function w(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 qn(e,t){return e.getAttribute(t)}function jn(e,t){e.removeAttribute(t)}function pt(e,t){Object.assign(e.style,t)}function Fn(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function Hn(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")pt(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else w(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function Vn(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Wn(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function Un(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Bn(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Kn(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 Gn(e,t=5e3){return new Promise((n,r)=>{let o=_e(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=_e(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 Xn(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function Jn(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Yn=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function Zn(e){return typeof e=="object"&&e!==null&&e.$$typeof===Yn}function yt(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Qn(e){if(typeof e!="function")return!1;try{let t=e();return yt(t)}catch{return!1}}function er(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function tr(e){return e instanceof Node}function nr(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function rr(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}var T=require("@fluixi/reactive/signal");var mt="1.0.0-alpha.77";var gt=require("@fluixi/reactive"),N={dom:mt,reactive:gt.VERSION};function ht(e){N.core&&e.setAttribute("fluixi",N.core),e.setAttribute("fx-dom",N.dom),e.setAttribute("fx-reactive",N.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=N)}function xt(){let e=[N.core,N.dom,N.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${N.core??"(absent)"}, dom ${N.dom}, reactive ${N.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function or(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function ir(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function sr(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function ar(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function lr(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function cr(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function ur(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function fr(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function Tt(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function bt(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function Et(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function wt(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function Nt(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function St(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function S(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function vt(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function dr(e){return Tt(e)?{type:"router",value:e}:Et(e)?{type:"route",value:e}:bt(e)?{type:"routes",value:e}:wt(e)?{type:"outlet",value:e}:S(e)?{type:"component",value:e}:vt(e)?{type:"suspense",value:e}:Nt(e)?{type:"provider",value:e}:St(e)?{type:"context",value:e}:{type:"none",value:e}}var d=require("@fluixi/reactive/signal");var h=typeof document>"u";function $(e){h=e}var Y=Symbol.for("fluixi.server-node"),$e=null;function At(e){$e=e}function V(){if(!$e)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return $e}function I(e){return e!=null&&e[Y]===!0?!0:typeof Node<"u"&&e instanceof Node}function ue(e){return e!=null&&e[Y]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function fe(e){return e!=null&&e[Y]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},Ct=null;function Rt(e){Ct=e}function de(){return Ct}function Ie(e,t){return u.active&&t.parentNode===e}function qe(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function Mt(){return u.active?u.cursor:null}function Z(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 Pt(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 W(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&qe(t)}function pr(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 yr(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 mr(e){return yr(pr(e))}var gr=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),hr={};var kt=new Map,pe=new Set,ge=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function Fe(e){if(!h)for(let t of e)pe.has(t)||ge.has(t)||(pe.add(t),document.addEventListener(t,xr))}function xr(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 Lt(e,t,n){if(e[`$$${t}`]=n,ge.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}pe.has(t)||Fe([t])}function je(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function Tr(e){return!ge.has(e)}function br(e){return typeof e=="function"}function D(e,t=!1){if(h)return V().createText(e);if(u.active&&!t){let n=de()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function He(e,t=!1){if(h)return V().createElement(e,t);if(u.active){let n=de()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(H,e):document.createElement(e)}function Ot(e,t=!1){let n=kt.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,kt.set(e,r),r}function Er(e,t,n=!1,r=!1){if(h){let o=V();return n?o.parseTemplate(e,r):o.createRaw(e)}if(u.active){let o=de()?.hydrateStatic(t);if(o)return o}return Dt(Ot(e,r),r).firstChild}function wr(e,t){if(!u.active)return t();let n=Z(e.nextSibling,t);if(typeof n=="function"){let r=n;return((...o)=>u.active?Z(e.nextSibling,()=>r(...o)):r(...o))}return n}function Nr(e){for(let t=e.nextSibling;t;t=t.nextSibling)if(t.nodeType===8&&t.data==="fx/")return t;throw new Error("[fluixi] template hole is missing its closing marker")}function Sr(e,t){let n=[];for(let r=e.nextSibling;r&&r!==t;r=r.nextSibling)n.push(r);return n}function Dt(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function _t(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?_t(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function vr(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Ar(e){if((0,T.isSignal)(e)||S(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,T.isSignal)(t)&&!S(t);)t=t();return t}var L=0,Cr=200;function Rr(e,t,n,r,o){let i=r,s=new Map;return(0,d.createRenderEffect)(()=>{let a;if(S(e)&&!(0,T.isSignal)(e)){if(!s.has(e)){L++;try{let l=e();s.set(e,l)}finally{L--}}for(a=s.get(e);typeof a=="function"&&(0,T.isSignal)(a);)a=a()}else for(a=e();typeof a=="function"&&(0,T.isSignal)(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(S(a)){if(!s.has(a)){let c=a;L++;try{let f=c();s.set(c,f)}finally{L--}}a=s.get(a)}else if((0,T.isSignal)(a))a=a();else if(a=a(),typeof a!="function"||!(0,T.isSignal)(a)&&!S(a))break}L++;try{i=ee(t,a,n,i,s),o(i)}finally{L--}})}function R(e,t,n,r){if(L>Cr)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=D("",!0),e.appendChild(n));let o=r??null,i=l=>Array.isArray(l)&&l.some(c=>typeof c=="function"),s=l=>typeof l=="function"?l:()=>l;if(typeof t!="function"&&!i(t)){L++;try{o=ee(e,t,n,o)}finally{L--}return()=>o}let a=Rr(s(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function ee(e,t,n,r,o){if(t==null||typeof t=="boolean")return O(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return O(e,r,n);if(Q(t)){let s=D("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),O(e,r.slice(1),n)):b(e,s,n):r?e.replaceChild(s,r):b(e,s,n),t.then(a=>{s.parentNode===e&&ee(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=D(t);return b(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=O(e,r,n)}if(r&&fe(r))return r.data=t,r;let s=D(t);return r&&r.parentNode===e?e.replaceChild(s,r):Ie(e,s)||b(e,s,n),s}if(I(t))return Ie(e,t)?(qe(t),t):Array.isArray(r)?(r.length===0?b(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),O(e,r.slice(1),n)):b(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):b(e,t,n)):b(e,t,n),t);if(Array.isArray(t)){let s=[],a=Array.isArray(r)?r:r?[r]:[],l=[];k(t,s,e,n,!0,o,l);let c=Mr(e,a,s,n);for(let f of l){let p=R(e,f.sig,f.marker);(0,d.onCleanup)(()=>{O(e,p()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(i==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let a=s;if(typeof a.type=="function"){let l=a.type(a.props||{});return ee(e,l,n,r)}}}return O(e,r,n)}function k(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"&&!Q(l)&&!(0,T.isSignal)(l)&&!S(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(S(l)&&!(0,T.isSignal)(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!Q(c)&&!(0,T.isSignal)(c)&&!S(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,T.isSignal)(c)){if(s){let p=D("",!0);t.push(p),s.push({marker:p,sig:c});continue}let f=c();for(;typeof f=="function"&&(0,T.isSignal)(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?k(f,t,n,r,o,i):k([f],t,n,r,o,i);continue}continue}Array.isArray(c)?k(c,t,n,r,o,i,s):k([c],t,n,r,o,i,s);continue}if(Q(l)){let c=D("",!0);t.push(c),l.then(f=>{if(c.parentNode){let p=[];if(k([f],p,c.parentNode,void 0,!1,i),p.length>0){c.parentNode.replaceChild(p[0],c);for(let y=1;y<p.length;y++)c.parentNode?.insertBefore(p[y],p[y-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){k(l,t,n,r,o,i,s);continue}if(I(l)){t.push(l);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)?k(f,t,n,r,!1,i):k([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(D(c));continue}t.push(D(String(l)))}}}}function Mr(e,t,n,r){for(let p=0;p<n.length;p++){let y=n[p].parentNode;y!==null&&y!==e&&y.nodeType!==11&&(n=n.slice(),n[p]=n[p].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 p=s<o?l?n[l-1].nextSibling??void 0:n[s-l]:c;for(;l<s;)b(e,n[l++],p)}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 p=t[--i].nextSibling;b(e,n[l++],t[a++].nextSibling),b(e,n[--s],p),t[i]=t[a-1]}else{if(!f){f=new Map;let y=l;for(;y<s;)f.set(n[y],y++)}let p=f.get(t[a]);if(p!=null)if(l<p&&p<s){let y=a,m=1;for(;++y<i&&y<s&&!(!f.has(t[y])||f.get(t[y])!==p+m);)m++;if(m>p-l){let Le=t[a];for(;l<p;)b(e,n[l++],Le)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(b(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function O(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 b(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function te(e,t,n){n==null?delete e[t]:e[t]=n}function Ve(e,t,n){let r=n,o;return Array.isArray(n)&&(r=n[0],o=n[1]),typeof r!="function"?()=>{}:(e.addEventListener(t,r,o),()=>e.removeEventListener(t,r,o))}function We(e,t){let n=(r,o)=>{typeof r=="function"&&r(e,o??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let r of t)Array.isArray(r)?n(r[0],r[1]):n(r)}}function ye(e,t,n,r=!1){return typeof n!="function"?(w(e,t,n,r),()=>{}):(0,d.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;w(e,t,o,r)})}function me(e,t,n){return typeof n!="function"?(te(e,t,n),()=>{}):(0,d.createRenderEffect)(()=>{let r=typeof n=="function"?n():n;te(e,t,r)})}function Ue(e,t,n){return typeof n!="function"?(w(e,t,!!n),()=>{}):(0,d.createRenderEffect)(()=>{let r=n();w(e,t,!!r)})}function ne(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,d.createRenderEffect)(()=>ne(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 re(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,d.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 oe(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 Pr(e){let{element:t,props:n,prevProps:r=hr,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!ue(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===H,a=[];for(let l in n){if(i&&l==="children")continue;let c=n[l],f=r[l];if(c===f)continue;if(l==="ref"){ie(c,t);continue}if(l==="use"){We(t,c);continue}if(l.startsWith("on:")){a.push(Ve(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(me(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(ye(t,l.slice(5),c,s));continue}if(l.startsWith("bool:")){a.push(Ue(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>ne(t,c()))):ne(t,c);continue}if(l==="classList"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>re(t,c()))):re(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>oe(t,c()))):oe(t,c);continue}if(l.startsWith("on")){let y=l.slice(2).toLowerCase();f&&je(t,y),c&&Lt(t,y,c);continue}let p=ce.has(l)||!s&&l in t;typeof c=="function"?a.push(p?me(t,l,c):ye(t,l,c,s)):a.push((0,d.createRenderEffect)(()=>p?te(t,l,n[l]):w(t,l,n[l],s)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();je(t,c)}else ce.has(l)?te(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function Be(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){ie(o,e);continue}if(r!=="children"){if(r==="use"){We(e,o);continue}if(r.startsWith("on:")){Ve(e,r.slice(3),o);continue}if(r.startsWith("prop:")){me(e,r.slice(5),o);continue}if(r.startsWith("attr:")){ye(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){Ue(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(ge.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,pe.has(i)||Fe([i]);continue}if(r==="class"||r==="className"){ne(e,o);continue}if(r==="classList"){typeof o=="function"?(0,d.createRenderEffect)(()=>re(e,o())):re(e,o);continue}if(r==="style"){typeof o=="function"?(0,d.createRenderEffect)(()=>oe(e,o())):oe(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});(0,d.onCleanup)(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});(0,d.onCleanup)(()=>{i()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});(0,d.onCleanup)(()=>{i()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=(0,d.createEffect)(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});(0,d.onCleanup)(()=>{s()})}else{let i=!0;(0,d.createRenderEffect)(()=>{let s=t[r];i?(i=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();le(e,r,s,n)});(0,d.onCleanup)(()=>{i()})}else(0,d.createRenderEffect)(()=>le(e,r,t[r],n))}}}function kr(...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 Lr(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 ie(e,t){if(e){if(I(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)}}function Or(e,t,n){let r=t||document.body,o=(0,d.readChildren)(()=>e),i=[];return(0,d.batch)(()=>{let s=(0,d.createRenderEffect)(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),i.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):I(a)&&(r.appendChild(a),i.push(()=>{a.parentNode===r&&r.removeChild(a)}))});i.push(s),(0,d.onCleanup)(()=>{i.forEach(a=>a())})}),null}function Dr(e){return typeof e=="string"&&e.toLowerCase()===e}function Ke(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 _r(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Q(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function $r(e){return typeof e=="function"&&e.length===0&&(0,T.isSignal)(e)}function ze(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return(0,d.createRoot)(s=>{(0,d.batch)(()=>{u.active||(t.textContent=""),ht(t),xt(),R(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}function Ir(e){if(Array.isArray(e))return e;if(typeof e=="function"&&typeof e.set=="function")return[e,e.set];throw new TypeError("[fluixi] bind: needs a signal — either `signal(…)` or the `[get, set]` pair from `createSignal(…)`.")}var qr="__fx_dom_create_component__",q=globalThis[qr]??={fn:null};function jr(e){q.fn=e}function Fr(e={}){let t=e.signalSystem?.createComponent;t&&(q.fn=t)}function Ge(e,t){return q.fn?q.fn(e,t):(()=>e(t))}var Hr=()=>q.fn!==null,Vr=()=>q.fn!==null;function Wr(){q.fn=null}var he,It={getStore:()=>he,run(e,t){let n=he;he=e;try{return t()}finally{he=n}}},Xe=It;function Je(e){Xe=e??It}function U(e={}){e.locals||(e.locals=e.request?Te(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 B(e,t){return Xe.run(e,t)}function M(){return Xe.getStore()}function xe(){return M()?.event}function Ye(){let e=xe();return e?(e.locals||(e.locals={}),e.locals):{}}var $t=new WeakMap;function Te(e){let t=$t.get(e);return t||(t={},$t.set(e,t)),t}var be=require("@fluixi/reactive/signal");var K="__FX_DATA__";function se(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var Ze;function ae(){let e=globalThis.__FX_DATA__;if(e)return e;if(Ze!==void 0)return Ze;let t=null;if(typeof document<"u"){let n=document.getElementById(K)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return Ze=t}function Ee(){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 Ur=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),we=typeof process<"u"&&process.env&&!1;function Ne(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){Ee();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Ur.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(we&&t&&Ne(`<${e}>`,t),null)}function Kr(e){Ee();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(u.cursor=t.nextSibling,t):(we&&t&&Ne(`<${e}> (static)`,t),null)}function zr(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}Ee();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(we&&t&&Ne(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Gr(e){Ee();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(we&&t&&Ne(`marker <!--${e.slice(0,24)}-->`,t),null)}var qt=!1;function Xr(){qt||(qt=!0,Rt({hydrateElement:Br,hydrateText:zr,hydrateMarker:Gr,hydrateStatic:Kr}))}function Se(e,t,n){Xr(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=ae(),o=n?.resourceNamespace,i=0;(0,be.setResourceIdSource)(()=>o?`${o}:r${i++}`:`r${i++}`),(0,be.setServerDataGetter)(r?s=>s in r?{value:r[s]}:void 0:null);try{return ze(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Qe="fluixi-island";function Ft(e){let{component:t,props:n={},name:r}=e,o=He(Qe),i=r??t.name??"Island";w(o,"name",i),w(o,"props",JSON.stringify(n??{}));let s=h?M():void 0;if(s){let a=s.nextIslandNamespace(i);R(o,()=>s.withResourceScope(a,()=>t(n)))}else R(o,()=>t(n));return o}var jt=!1;function Jr(){if(jt||typeof document>"u")return;jt=!0;let e=document.createElement("style");e.textContent=`${Qe}{display:contents}`,document.head.appendChild(e)}function Ht(e){if(typeof document>"u")return;Jr();let t=document.querySelectorAll(Qe),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{}Se(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}function Vt(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function Wt(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}var Ut=require("@fluixi/reactive/signal");function Yr(e,t={}){if(typeof e=="function")return Ge(e,t);if(typeof e!="string"||e.length===0)return null;let n=Ke(e);if(h)return V().createElement(e,n);let r=n?document.createElementNS(H,e):document.createElement(e);return Be(r,t,n),Zr(r,t),r}function Zr(e,t){if(!t||t.children===void 0)return;let n=(0,Ut.readChildren)(()=>t.children),r=o=>{R(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}var x=require("@fluixi/reactive/signal");function Bt(e){return typeof e=="function"?e:(()=>e)}function _(e){return()=>{let t=e();return typeof t=="function"?t():t}}function Kt(e){return e!=null&&e!==!1}function zt(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=_(()=>e.when),n=(0,x.createMemo)(t,void 0),r=(0,x.createMemo)(n,void 0),o=(0,x.getOwner)(),i=null,s=null,a=l=>{l!==s&&(i&&(0,x.disposeScope)(i),i=(0,x.createChildOwner)(o),s=l)};return(0,x.createMemo)(()=>{let l=r();return a(l?"when":"fallback"),(0,x.runWithOwner)(i,()=>{if(l){let c=e.children;return typeof c=="function"&&!zt(c)?typeof n=="function"?(0,x.untrack)(()=>(0,x.untrack)(n)?c(n()):e.fallback):c(n):c}return e.fallback});return e.fallback??null},void 0,{name:"show"})}var ve=require("@fluixi/reactive/signal");function Xt(e){let t=_(()=>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 W(a),a};return e.by?(0,ve.keyArray)(t,e.by,(o,i)=>r(o,i),{fallback:n}):(0,ve.mapArray)(t,(o,i)=>r(o,i),{fallback:n})}var Jt=require("@fluixi/reactive/signal");function Yt(e){let t=_(()=>e.each);return(0,Jt.indexArray)(t,(n,r)=>{let o=e.children(n,r);return W(o),o},{fallback:()=>e.fallback??null})}var z=require("@fluixi/reactive/signal");var v=require("@fluixi/reactive/signal");var et=Symbol("match");function Zt(e){return{[et]:!0,when:_(()=>e.when),get children(){return e.children}}}function Qt(e){let t=Array.isArray(e.children)?e.children:[e.children],n=(0,v.getOwner)(),r=null,o=-1,i=s=>{s!==o&&(r&&(0,v.disposeScope)(r),r=(0,v.createChildOwner)(n),o=s)};return(0,v.createMemo)(()=>{for(let s=0;s<t.length;s+=1){let l=t[s],c=0;for(;typeof l=="function"&&!l[et]&&c++<10;)l=l();if(!l||typeof l!="object"||l[et]!==!0)continue;let f=l.when();if(Kt(f))return i(s),(0,v.runWithOwner)(r,()=>typeof l.children=="function"?l.children(f):l.children)}return i(-2),(0,v.runWithOwner)(r,()=>e.fallback??null)})}var P=require("@fluixi/reactive/signal");function en(e){let t=Bt(e.component),{component:n,...r}=e,o=(0,P.getOwner)(),i=null,s;return(0,P.createMemo)(()=>{let a=t();return a!==s&&(i&&(0,P.disposeScope)(i),i=(0,P.createChildOwner)(o),s=a),a==null?null:typeof a=="string"?{tag:a,props:r}:(0,P.runWithOwner)(i,()=>a(r))})}var Ae=require("@fluixi/reactive/signal");function tn(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return(0,Ae.createRoot)(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),R(r,e.children)&&ie(e.ref,r)}),(0,Ae.onCleanup)(()=>{n(),r.remove()}),null}var Ce=require("@fluixi/reactive/signal");function tt(e){if(h)return e.fallback??null;let t=u.active,[n,r]=(0,Ce.createSignal)(!t);return t&&queueMicrotask(()=>r(!0)),(0,Ce.createMemo)(()=>n()?e.children:e.fallback??null,void 0,{name:"client-only"})}var nn=tt;var Re=require("@fluixi/reactive/signal");function rn(e){let[t,n]=(0,Re.createSignal)(null),r=()=>n(null);return(0,Re.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 on=require("@fluixi/reactive/signal");function sn(e){return(0,on.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 an=require("@fluixi/reactive/signal");function Qr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function ln(e){return(0,an.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(`${Qr(r)}: ${i}`)}return n.join("; ")})}var Pe=1,ot=3,it=8,cn;cn=Y;var G=class{constructor(){this[cn]=!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(){}},j=class e extends G{constructor(n){super();this.nodeType=ot;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)}},Me=class e extends G{constructor(n){super();this.nodeType=Pe;this.rawOuterHTML=n}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},X=class e extends G{constructor(n){super();this.nodeType=it;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},nt=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},rt=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}},F=class e extends G{constructor(n,r=!1){super();this.nodeType=Pe;this.attributes=new Map;this.style=new nt;this.classList=new rt(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 j(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 eo=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),fn=/&/g,dn=/</g,pn=/>/g,to=/"/g;function st(e){return e.replace(fn,"&amp;").replace(dn,"&lt;").replace(pn,"&gt;")}function un(e){return e.replace(fn,"&amp;").replace(to,"&quot;").replace(dn,"&lt;").replace(pn,"&gt;")}function no(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function ro(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(`${no(n)}: ${r}`)}return t.join("; ")}function oo(e){let t="",n=ro(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${un(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${un(o)}"`}return t}function A(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return st(e);if(typeof e=="number")return st(String(e));if(typeof e=="function")return A(e());if(Array.isArray(e))return e.map(A).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case ot:return st(e.data??"");case it:return`<!--${e.data??""}-->`;case Pe:{let t=e.localName,n=`<${t}${oo(e)}>`;if(eo.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(A).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(A).join(""):""}var lt=require("@fluixi/reactive/signal"),E=require("@fluixi/reactive/signal");var io=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),so={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function yn(e){return e.replace(/&(#?\w+);/g,(t,n)=>so[n]??t)}var C=class extends Error{};function mn(e,t=!1){let n=0,r=[],o=[],i=c=>{let f=o[o.length-1];f?f.appendChild(c):r.push(c)};for(;n<e.length;){let c=e.indexOf("<",n);if(c===-1){a(e.slice(n));break}if(c>n&&a(e.slice(n,c)),e.startsWith("<!--",c)){let f=e.indexOf("-->",c);if(f===-1)throw new C(`unterminated comment at ${c}`);i(new X(e.slice(c+4,f))),n=f+3;continue}if(e[c+1]==="/"){let f=e.indexOf(">",c);if(f===-1)throw new C(`unterminated closing tag at ${c}`);let p=e.slice(c+2,f).trim().toLowerCase(),y=o.pop();if(!y||y.localName!==p)throw new C(`</${p}> does not close <${y?.localName??"nothing"}>`);n=f+1;continue}n=l(c)}if(o.length>0)throw new C(`unclosed <${o[o.length-1].localName}>`);let s=r[0];if(r.length!==1||!(s instanceof F))throw new C(`expected exactly one root element, got ${r.length}`);return s;function a(c){c!==""&&i(new j(yn(c)))}function l(c){let f=/[\s/>]/.exec(e.slice(c+1));if(!f)throw new C(`unterminated tag at ${c}`);let p=e.slice(c+1,c+1+f.index).toLowerCase(),y=new F(p,t),m=c+1+f.index;for(;m<e.length;){for(;m<e.length&&/\s/.test(e[m]);)m++;if(e[m]===">"){m++;break}if(e[m]==="/"&&e[m+1]===">"){m+=2;break}let Le=m;for(;m<e.length&&!/[\s=/>]/.test(e[m]);)m++;let J=e.slice(Le,m);if(J==="")throw new C(`malformed attribute at ${m}`);if(e[m]==="="){if(e[m+1]!=='"')throw new C(`attribute ${J} must have a double-quoted value`);let Oe=e.indexOf('"',m+2);if(Oe===-1)throw new C(`unterminated value for ${J}`);y.setAttribute(J,yn(e.slice(m+2,Oe))),m=Oe+1}else y.setAttribute(J,"")}return i(y),io.has(p)||o.push(y),m}}var gn=!1;function xn(){gn||(gn=!0,At({createElement:(e,t)=>new F(e,t),createText:e=>new j(e),createRaw:e=>new Me(e),parseTemplate:(e,t)=>mn(e,t),createComment:e=>new X(e)}))}function ct(e,t={}){let n=h;xn(),$(!0);let r=U(t.event);try{return B(r,()=>(0,lt.createRoot)(o=>{try{let i=typeof e=="function"?e():e;return A(i)}finally{o()}}))}finally{$(n)}}var hn=!1;function ao(){hn||(hn=!0,(0,E.setResourceTracker)(e=>{M()?.pending.add(e)}),(0,E.setResourceIdSource)(()=>M()?.nextResourceId()??""),(0,E.setResourceDataSink)((e,t)=>{e&&M()?.data.set(e,t)}))}var at=null;function ut(e){at=e}function ke(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(at)try{i=at(o,r)}catch{continue}i!==void 0&&(typeof i=="function"||typeof i=="symbol"||(t[r]=i))}if(Object.keys(t).length===0)return"";let n=se(JSON.stringify(t));return n==="{}"?"":`<script type="application/json" id="${K}">${n}<\/script>`}var lo=50;async function ft(e,t={}){let n=h;xn(),$(!0),ao();let r=U(t.event);try{return await B(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};(0,lt.createRoot)(f=>{s=f,i=(0,E.getOwner)(),o=typeof e=="function"?e():e});let a=()=>{try{(0,E.runWithOwner)(i,()=>A(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<lo;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await(0,E.flush)(),a()}let c=(0,E.runWithOwner)(i,()=>A(o))+ke(r);return s(),c})}finally{$(n)}}var g=require("@fluixi/reactive/signal"),Tn=require("@fluixi/reactive/store");