@fluixi/dom 1.0.0-alpha.83 → 1.0.0-alpha.84
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/dist/cdn/dom-client.cjs +1427 -1
- package/dist/cdn/dom-client.d.ts +2 -2
- package/dist/cdn/dom-client.global.js +2 -1
- package/dist/cdn/dom-client.js +3 -3
- package/dist/cdn/dom-client.mjs +1430 -1
- package/dist/cdn/dom.cjs +3127 -1
- package/dist/cdn/dom.d.ts +2 -2
- package/dist/cdn/dom.global.js +2 -1
- package/dist/cdn/dom.js +4 -4
- package/dist/cdn/dom.mjs +3133 -1
- package/dist/index.cjs +3155 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +3149 -1
- package/dist/lib/component/index.cjs +128 -1
- package/dist/lib/component/index.mjs +105 -1
- package/dist/lib/component/modifiers.cjs +126 -1
- package/dist/lib/component/modifiers.d.ts +12 -0
- package/dist/lib/component/modifiers.d.ts.map +1 -1
- package/dist/lib/component/modifiers.js +12 -84
- package/dist/lib/component/modifiers.mjs +105 -1
- package/dist/lib/dom/delegate.cjs +60 -1
- package/dist/lib/dom/delegate.js +1 -1
- package/dist/lib/dom/delegate.mjs +39 -1
- package/dist/lib/dom/dynamic-element.cjs +949 -1
- package/dist/lib/dom/dynamic-element.d.ts +3 -3
- package/dist/lib/dom/dynamic-element.js +2 -2
- package/dist/lib/dom/dynamic-element.mjs +928 -1
- package/dist/lib/dom/hydration-state.cjs +93 -1
- package/dist/lib/dom/hydration-state.d.ts +1 -1
- package/dist/lib/dom/hydration-state.js +1 -1
- package/dist/lib/dom/hydration-state.mjs +72 -1
- package/dist/lib/dom/hydration.cjs +685 -1
- package/dist/lib/dom/hydration.js +8 -8
- package/dist/lib/dom/hydration.mjs +664 -1
- package/dist/lib/dom/index.cjs +2040 -1
- package/dist/lib/dom/index.js +1 -1
- package/dist/lib/dom/index.mjs +2020 -1
- package/dist/lib/dom/integration.cjs +71 -1
- package/dist/lib/dom/integration.js +3 -3
- package/dist/lib/dom/integration.mjs +51 -1
- package/dist/lib/dom/island.cjs +790 -1
- package/dist/lib/dom/island.d.ts +1 -1
- package/dist/lib/dom/island.js +11 -11
- package/dist/lib/dom/island.mjs +769 -1
- package/dist/lib/dom/runtime.cjs +1432 -1
- package/dist/lib/dom/runtime.d.ts +60 -17
- package/dist/lib/dom/runtime.d.ts.map +1 -1
- package/dist/lib/dom/runtime.js +122 -79
- package/dist/lib/dom/runtime.mjs +1414 -1
- package/dist/lib/dom/server/fx-data.cjs +53 -1
- package/dist/lib/dom/server/fx-data.d.ts +5 -5
- package/dist/lib/dom/server/fx-data.js +6 -6
- package/dist/lib/dom/server/fx-data.mjs +32 -1
- package/dist/lib/dom/server/host.cjs +66 -1
- package/dist/lib/dom/server/host.d.ts +6 -0
- package/dist/lib/dom/server/host.d.ts.map +1 -1
- package/dist/lib/dom/server/host.js +7 -1
- package/dist/lib/dom/server/host.mjs +45 -1
- package/dist/lib/dom/server/index.cjs +759 -1
- package/dist/lib/dom/server/index.d.ts +1 -1
- package/dist/lib/dom/server/index.js +1 -1
- package/dist/lib/dom/server/index.mjs +743 -1
- package/dist/lib/dom/server/nodes.cjs +302 -1
- package/dist/lib/dom/server/nodes.d.ts +2 -2
- package/dist/lib/dom/server/nodes.d.ts.map +1 -1
- package/dist/lib/dom/server/nodes.js +4 -4
- package/dist/lib/dom/server/nodes.mjs +279 -1
- package/dist/lib/dom/server/parse-template.cjs +395 -1
- package/dist/lib/dom/server/parse-template.d.ts +1 -1
- package/dist/lib/dom/server/parse-template.js +4 -4
- package/dist/lib/dom/server/parse-template.mjs +372 -1
- package/dist/lib/dom/server/render.cjs +691 -1
- package/dist/lib/dom/server/render.d.ts +9 -1
- package/dist/lib/dom/server/render.d.ts.map +1 -1
- package/dist/lib/dom/server/render.js +23 -15
- package/dist/lib/dom/server/render.mjs +677 -1
- package/dist/lib/dom/server/request-context.cjs +110 -1
- package/dist/lib/dom/server/request-context.d.ts +29 -9
- package/dist/lib/dom/server/request-context.d.ts.map +1 -1
- package/dist/lib/dom/server/request-context.js +28 -8
- package/dist/lib/dom/server/request-context.mjs +89 -1
- package/dist/lib/dom/server/serialize.cjs +187 -1
- package/dist/lib/dom/server/serialize.js +3 -3
- package/dist/lib/dom/server/serialize.mjs +164 -1
- package/dist/lib/dom/server-renderer.cjs +760 -1
- package/dist/lib/dom/server-renderer.js +1 -1
- package/dist/lib/dom/server-renderer.mjs +745 -1
- package/dist/lib/dom/types.cjs +18 -1
- package/dist/lib/dom/utils.cjs +381 -1
- package/dist/lib/dom/utils.d.ts +1 -88
- package/dist/lib/dom/utils.d.ts.map +1 -1
- package/dist/lib/dom/utils.js +2 -99
- package/dist/lib/dom/utils.mjs +361 -1
- package/dist/lib/dom/versions.cjs +60 -1
- package/dist/lib/dom/versions.d.ts +3 -3
- package/dist/lib/dom/versions.d.ts.map +1 -1
- package/dist/lib/dom/versions.js +17 -5
- package/dist/lib/dom/versions.mjs +37 -1
- package/dist/lib/element/attributes.cjs +19 -1
- package/dist/lib/element/attributes.d.ts +7 -7
- package/dist/lib/element/attributes.js +1 -1
- package/dist/lib/element/attributes.mjs +1 -0
- package/dist/lib/element/index.cjs +19 -1
- package/dist/lib/element/index.mjs +1 -0
- package/dist/lib/element/types.cjs +18 -1
- package/dist/lib/element/types.d.ts +4 -5
- package/dist/lib/element/types.d.ts.map +1 -1
- package/dist/lib/element/types.js +0 -1
- package/dist/lib/flow/class-map.cjs +38 -1
- package/dist/lib/flow/class-map.d.ts +3 -3
- package/dist/lib/flow/class-map.js +2 -2
- package/dist/lib/flow/class-map.mjs +17 -1
- package/dist/lib/flow/client-only.cjs +57 -1
- package/dist/lib/flow/client-only.d.ts +4 -4
- package/dist/lib/flow/client-only.js +3 -3
- package/dist/lib/flow/client-only.mjs +36 -1
- package/dist/lib/flow/dynamic.cjs +53 -1
- package/dist/lib/flow/dynamic.d.ts +2 -2
- package/dist/lib/flow/dynamic.js +3 -3
- package/dist/lib/flow/dynamic.mjs +32 -1
- package/dist/lib/flow/error-boundary.cjs +43 -1
- package/dist/lib/flow/error-boundary.d.ts +2 -2
- package/dist/lib/flow/error-boundary.js +3 -3
- package/dist/lib/flow/error-boundary.mjs +22 -1
- package/dist/lib/flow/for.cjs +66 -1
- package/dist/lib/flow/for.d.ts +9 -9
- package/dist/lib/flow/for.d.ts.map +1 -1
- package/dist/lib/flow/for.js +2 -2
- package/dist/lib/flow/for.mjs +45 -1
- package/dist/lib/flow/index-flow.cjs +67 -1
- package/dist/lib/flow/index-flow.d.ts +5 -5
- package/dist/lib/flow/index-flow.js +4 -4
- package/dist/lib/flow/index-flow.mjs +46 -1
- package/dist/lib/flow/index.cjs +805 -1
- package/dist/lib/flow/index.mjs +792 -1
- package/dist/lib/flow/portal.cjs +538 -1
- package/dist/lib/flow/portal.mjs +519 -1
- package/dist/lib/flow/show.cjs +81 -1
- package/dist/lib/flow/show.d.ts +1 -1
- package/dist/lib/flow/show.d.ts.map +1 -1
- package/dist/lib/flow/show.js +4 -115
- package/dist/lib/flow/show.mjs +67 -1
- package/dist/lib/flow/style-map.cjs +43 -1
- package/dist/lib/flow/style-map.d.ts +3 -3
- package/dist/lib/flow/style-map.js +3 -3
- package/dist/lib/flow/style-map.mjs +22 -1
- package/dist/lib/flow/switch.cjs +91 -1
- package/dist/lib/flow/switch.d.ts +3 -3
- package/dist/lib/flow/switch.d.ts.map +1 -1
- package/dist/lib/flow/switch.js +6 -6
- package/dist/lib/flow/switch.mjs +70 -1
- package/dist/lib/flow/utils.cjs +44 -1
- package/dist/lib/flow/utils.d.ts +1 -1
- package/dist/lib/flow/utils.js +1 -1
- package/dist/lib/flow/utils.mjs +23 -1
- package/dist/lib/html.cjs +32 -1
- package/dist/lib/html.d.ts +6 -6
- package/dist/lib/html.js +5 -5
- package/dist/lib/html.mjs +11 -1
- package/dist/lib/index.cjs +3104 -1
- package/dist/lib/index.d.ts +0 -1
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +2 -3
- package/dist/lib/index.mjs +3097 -1
- package/dist/lib/shared/types.cjs +18 -1
- package/dist/lib/shared/types.d.ts +8 -8
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/version.generated.cjs +26 -1
- package/dist/version.generated.d.ts +1 -1
- package/dist/version.generated.js +2 -2
- package/dist/version.generated.mjs +5 -1
- package/package.json +7 -6
- package/dist/lib/jsx/control-flow/flow.cjs +0 -1
- package/dist/lib/jsx/control-flow/flow.d.ts +0 -2
- package/dist/lib/jsx/control-flow/flow.d.ts.map +0 -1
- package/dist/lib/jsx/control-flow/flow.js +0 -627
- package/dist/lib/jsx/control-flow/flow.mjs +0 -0
- package/dist/lib/jsx/control-flow/for-flow.cjs +0 -1
- package/dist/lib/jsx/control-flow/for-flow.d.ts +0 -2
- package/dist/lib/jsx/control-flow/for-flow.d.ts.map +0 -1
- package/dist/lib/jsx/control-flow/for-flow.js +0 -1
- package/dist/lib/jsx/control-flow/for-flow.mjs +0 -0
package/dist/cdn/dom-client.d.ts
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Same shape as `dom.global.js` and the same global name, minus the string renderer,
|
|
9
9
|
* node serialisation, template parsing and the request context. A `<script>` tag
|
|
10
|
-
* cannot tree-shake, so anything reachable from the entry ships
|
|
10
|
+
* cannot tree-shake, so anything reachable from the entry ships, which makes the
|
|
11
11
|
* server half pure weight for a page that renders in a browser. Measured against the
|
|
12
|
-
* full build: 21.0 kB gzipped
|
|
12
|
+
* full build: 21.0 kB gzipped -> 12.2 kB.
|
|
13
13
|
*
|
|
14
14
|
* `hydrate` stays: a page hydrating server-rendered HTML runs in the browser, and it
|
|
15
15
|
* is the one thing here that touches SSR output. Use `dom.global.js` if you actually
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
"use strict";var FluixiDOM=(()=>{var He=Object.defineProperty;var rr=Object.getOwnPropertyDescriptor;var or=Object.getOwnPropertyNames;var ir=Object.prototype.hasOwnProperty;var sr=(e,t)=>{for(var n in t)He(e,n,{get:t[n],enumerable:!0})},ur=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of or(t))!ir.call(e,o)&&o!==n&&He(e,o,{get:()=>t[o],enumerable:!(r=rr(t,o))||r.enumerable});return e};var ar=e=>ur(He({},"__esModule",{value:!0}),e);var Jo={};sr(Jo,{Dynamic:()=>Tt,ErrorBoundary:()=>_t,For:()=>vt,Index:()=>wt,Match:()=>St,Portal:()=>At,Show:()=>bt,Switch:()=>Et,batch:()=>q,classMap:()=>Nt,createComponent:()=>Jn,createComputed:()=>In,createContext:()=>Le,createEffect:()=>$e,createElement:()=>Rt,createMemo:()=>ht,createRenderEffect:()=>qn,createResource:()=>$n,createRoot:()=>jn,createSignal:()=>L,delegateEvents:()=>nt,effect:()=>Un,hydrate:()=>gt,indexArray:()=>le,insert:()=>Y,keyArray:()=>ae,mapArray:()=>ue,memo:()=>Vn,onCleanup:()=>ye,render:()=>Ne,setAttribute:()=>N,setClassName:()=>ce,setProperty:()=>J,setStyle:()=>_e,signal:()=>Fn,spread:()=>fn,store:()=>Gn,styleMap:()=>kt,untrack:()=>ee,useContext:()=>On});var Ot="http://www.w3.org/2000/svg";var We=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function N(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 lr(e,t){Object.assign(e.style,t)}function Rt(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,s])=>{if(o==="class"||o==="className")r.className=s;else if(o==="style"&&typeof s=="object")lr(r,s);else if(o.startsWith("on")&&typeof s=="function"){let u=o.slice(2).toLowerCase();r.addEventListener(u,s)}else N(r,o,s)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}var Zo=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;var cr="__fluixi_signal_next_state__",fr=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)},f=globalThis[cr]??={consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:fr,onSuspend:null,onError:null,observer:null},dr="1.0.0-alpha.83";function pr(e){return f.observer=e,()=>{f.observer===e&&(f.observer=null)}}var x=[],hr;function ze(e){let t=f.observer;t&&t.created(e.parents===void 0?{...e,parents:x,origin:e.origin??hr}:e)}function yr(e){return f.observer?(x.push(e),!0):!1}function mr(){x.pop()}function gr(e){f.observer?.ran?.(e)}function br(e,t){f.observer?.wrote?.(e,t)}function k(e,t,n,r){let o=f.observer;!o?.bound||!x.length||o.bound(x[x.length-1],e,t,n,r)}function j(e,t,n,r){let o=f.observer;!o?.directive||!x.length||o.directive(x[x.length-1],e,t,n,r)}function vr(e){f.observer?.contextCreated?.(e)}function wr(e,t,n){let r=f.observer;!r?.context||!x.length||r.context(x[x.length-1],e,t,n)}function Be(e){f.observer?.disposed?.(e)}var xr="__FLUIXI_DEVTOOLS_HOOK__",Mt=globalThis[xr];if(typeof Mt?.inject=="function")try{Mt.inject({observeReactiveNodes:pr,version:dr})}catch{}function It(){return f.observer!=null}var jt=0,Dt=1,oe=2,qt=class{constructor(){this.observers=null,this.watchers=null,this.version=0}updateIfNecessary(){}track(){if(f.untracked)return;let e=f.consumer;e&&((this.observers??=new Set).add(e),(e.sources??=new Set).add(this))}},Sr=class extends qt{constructor(e,t){super(),this._value=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){return this.track(),this._value}set(e){if(!this._equals(this._value,e)){if(this._value=e,this.version++,br(this,f.consumer),this.observers)for(let t of[...this.observers])t.markDirty(oe);Ke(this)}}peek(){return this._value}},Lt=class extends qt{constructor(e,t){super(),this._threw=!1,this._initialized=!1,this.state=oe,this.sources=null,this._fn=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){if(f.consumer===this)throw new Error("Signal.Computed cannot read itself");if(this.track(),this.updateIfNecessary(),this._threw)throw this._error;return this._value}updateIfNecessary(){if(this.state===Dt&&this.sources){for(let e of this.sources)if(e.updateIfNecessary(),this.state===oe)break}(this.state===oe||!this._initialized)&&this.recompute(),this.state=jt}recompute(){if(this.sources){for(let a of this.sources)a.observers?.delete(this);this.sources.clear()}let e=f.consumer,t=f.untracked,n=yr(this);f.consumer=this,f.untracked=!1;let r,o=!1,s;try{r=this._fn()}catch(a){o=!0,s=a,r=this._value}finally{f.consumer=e,f.untracked=t,n&&mr()}let u=!this._initialized||this._threw!==o||(o?s!==this._error:!this._equals(this._value,r));if(this._initialized=!0,this._threw=o,this._error=s,this._value=r,gr(this),u){if(this.version++,this.observers)for(let a of[...this.observers])a.markDirty(oe);Ke(this)}}markDirty(e){if(this.state>=e)return;let t=this.state===jt;if(this.state=e,t){if(this.observers)for(let n of[...this.observers])n.markDirty(Dt);Ke(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};function Ke(e){if(e.watchers)for(let t of[...e.watchers])t._notify(e)}var Er=class{constructor(e){this._watched=new Set,this._pending=new Set,this._notifyFn=e}watch(...e){for(let t of e)this._watched.add(t),(t.watchers??=new Set).add(this)}unwatch(...e){for(let t of e)this._watched.delete(t),t.watchers?.delete(this),this._pending.delete(t)}getPending(){let e=[...this._pending];return this._pending.clear(),e}_notify(e){if(!this._watched.has(e)||this._pending.has(e))return;let t=this._pending.size===0;this._pending.add(e),t&&this._notifyFn()}};function Tr(e){if(f.untracked)return e();f.untracked=!0;try{return e()}finally{f.untracked=!1}}function G(e){let t=we(e);return e&&(e.owned??=[]).push(t),t}function X(e,t=!0){ie(e,t)}function we(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function $t(e,t){let n=Symbol(t??"context");return vr(n),{id:n,defaultValue:e,Provider:r=>{wr(n,"provide",r.value);let o=f.owner,s=we(o);(s.contexts=new Map).set(n,r.value),o&&(o.owned??=[]).push(s),f.owner=s;try{return r.children}finally{f.owner=o}}}}function Ft(e,t){let n=e;for(;n;){if(n.contexts&&n.contexts.has(t.id))return n.contexts.get(t.id);n=n.parent}return t.defaultValue}function Ar(e){f.onSuspend=e}function _r(e){return f.onSuspend?(f.onSuspend(e,f.owner),!0):!1}function Nr(e){f.onError=e}function U(){return f.owner}function P(e,t){let n=f.owner;f.owner=e;try{return t()}finally{f.owner=n}}function C(e){if(f.owner){if(f.owner.disposed){e();return}(f.owner.cleanups??=[]).push(e)}}function ie(e,t=!0){if(!e.disposed){if(e.owned){for(let n=e.owned.length-1;n>=0;n--)ie(e.owned[n]);e.owned=null}if(e.cleanups){for(let n=e.cleanups.length-1;n>=0;n--)e.cleanups[n]();e.cleanups=null}t&&(e.disposed=!0)}}function H(e){let t=we(f.owner);f.owner&&(f.owner.owned??=[]).push(t);let n=f.owner;f.owner=t;try{return e(()=>ie(t))}finally{f.owner=n}}function kr(e){f.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function Pr(e){e.queued||(e.queued=!0,f.queue.push(e),!f.scheduled&&f.batchDepth===0&&(f.scheduled=!0,f.hostSchedule(Ge)))}function Ge(){if(f.scheduled=!1,f.flushing)return;f.flushing=!0;let e=0;try{for(;f.queue.length;){if(++e>1e5)throw new Error("[fluixi] effect flush did not settle (cycle?)");let t=f.queue;f.queue=[];for(let n of t)n.queued=!1,n.disposed||n.run()}}finally{f.flushing=!1}}function Cr(){f.batchDepth===0&&Ge()}function Or(e){f.batchDepth++;try{return e()}finally{--f.batchDepth===0&&Ge()}}var Rr=class{constructor(e,t=!1){this.queued=!1,this.disposed=!1,this.owner=we(f.owner),f.owner&&(f.owner.cleanups??=[]).push(()=>this.dispose()),this.computed=new Lt(()=>{ie(this.owner,!1),P(this.owner,()=>{let n=e();typeof n=="function"&&(this.owner.cleanups??=[]).push(n)})}),ze({kind:"effect",node:this.computed,handle:this,internal:!t}),this.watcher=new Er(()=>Pr(this)),this.run(),this.watcher.watch(this.computed)}run(){if(!this.disposed){this.watcher.getPending();try{this.computed.get()}catch(e){if(e&&typeof e.then=="function"&&f.onSuspend){f.onSuspend(e,this.owner);return}if(f.onError&&f.onError(e,this.owner))return;throw e}}}dispose(){this.disposed||(this.disposed=!0,Be(this.computed),this.watcher.unwatch(this.computed),ie(this.owner))}};function Vt(e,t=!1){let n=new Rr(e,t);return()=>n.dispose()}function Mr(e){return!!e&&typeof e.then=="function"}kr(()=>{});var Ut=Symbol.for("signal"),jr=Symbol.for("memo"),Dr=Symbol.for("signal-node");function D(e,t){let n=new Sr(e,{equals:t?.equals}),r=(()=>n.get()),o=(s=>{let u=typeof s=="function"?s(n.peek()):s;return n.set(u),Cr(),u});return Object.defineProperty(r,Ut,{value:!0,enumerable:!0}),Object.defineProperty(r,Dr,{value:{get value(){return n.peek()},get version(){return n.version}},enumerable:!1}),ze({kind:"signal",node:n,handle:r,name:t?.name,set:o}),It()&&C(()=>Be(n)),[r,o]}function m(e,t,n){let r=t,o=U(),s=new Lt(()=>P(o,()=>{try{return r=e(r)}catch(a){if(Mr(a))return _r(a),r;throw a}}),{equals:n?.equals}),u=(()=>s.get());return Object.defineProperty(u,Ut,{value:!0,enumerable:!0}),Object.defineProperty(u,jr,{value:!0,enumerable:!0}),ze({kind:"memo",node:s,handle:u,name:n?.name}),It()&&C(()=>Be(s)),u}function xe(e,t){let n=t;return Vt(()=>{n=e(n)},!0)}function E(e,t){let n=t;return Vt(()=>{n=e(n)})}function se(e){return Or(e)}function _(e){return Tr(e)}function ue(e,t,n){let r=[];return C(()=>{for(let o of r)o.dispose();r=[]}),m(()=>{let o=e()||[];return _(()=>{if(o.length===0){for(let i of r)i.dispose();return r=[],n?.fallback?n.fallback():[]}let s=new Map;for(let i of r)s.has(i.item)||s.set(i.item,i);let u=[],a=new Set;for(let i=0;i<o.length;i++){let l=o[i],p=s.get(l);if(p&&!a.has(p))p.setIndex(i),u.push(p),a.add(p);else{let d,y,g;H(b=>{g=b;let[z,ne]=D(i,{name:"row index"});y=ne,d=t(l,z)});let S={item:l,rendered:d,dispose:g,setIndex:y};u.push(S),a.add(S)}}for(let i of r)a.has(i)||i.dispose();return r=u,u.map(i=>i.rendered)})},void 0,{name:"mapArray"})}function ae(e,t,n,r){let o=[],s=[];return C(()=>{for(let u of s)u.dispose();o=[],s=[]}),m(()=>{let u=e()||[];return _(()=>{if(u.length===0){for(let d of s)d.dispose();return o=[],s=[],r?.fallback?r.fallback():[]}let a=new Map;for(let d=0;d<o.length;d++)a.set(o[d],s[d]);let i=[],l=[],p=new Set;for(let d=0;d<u.length;d++){let y=t(u[d]),g=a.get(y);if(g&&!p.has(y))g.setIndex(d),i.push(g);else{let S,b,z;H(ne=>{z=ne;let[F,re]=D(d,{name:"row index"});b=re;let me=m(B=>(e()||[])[F()]??B,u[d]);S=n(me,F)}),i.push({rendered:S,dispose:z,setIndex:b})}l.push(y),p.add(y)}for(let[d,y]of a)p.has(d)||y.dispose();return o=l,s=i,i.map(d=>d.rendered)})},void 0,{name:"keyArray"})}function le(e,t,n){let r=[];return C(()=>{for(let o of r)o.dispose();r=[]}),m(()=>{let o=e()||[];return _(()=>{if(o.length===0){for(let i of r)i.dispose();return r=[],n?.fallback?n.fallback():[]}let s=r.length,u=o.length;for(let i=s;i<u;i++){let l,p,d,y=o[i];H(g=>{d=g;let[S,b]=D(y);p=b,l=t(S,i)}),r.push({rendered:l,setItem:p,dispose:d})}for(let i=u;i<s;i++)r[i].dispose();u<s&&(r=r.slice(0,u));let a=Math.min(s,u);for(let i=0;i<a;i++)r[i].setItem(o[i]);return r.map(i=>i.rendered)})},void 0,{name:"indexArray"})}var ei=typeof window>"u"?!1:window.__FLUIXI_PROD__===!0;var Ir=Symbol.for("signal");function T(e){return typeof e=="function"&&e[Ir]===!0}var qr=null;function Ht(e){qr=e}var Lr=null;function Wt(e){Lr=e}var $r=$t();Ar((e,t)=>{let n=Ft(t,$r);n&&(n.increment(),e.finally(()=>n.decrement()))});var Fr=$t();Nr((e,t)=>{let n=Ft(t,Fr);return n?(n.setError(e),!0):!1});var Xe=Symbol.for("fluixi-proxy");var Kt="1.0.0-alpha.83";var zt="1.0.0-alpha.83";var A={dom:Kt,reactive:zt};function Bt(e){A.core&&e.setAttribute("fluixi",A.core),e.setAttribute("fx-dom",A.dom),e.setAttribute("fx-reactive",A.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=A)}function Gt(){let e=[A.core,A.dom,A.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${A.core??"(absent)"}, dom ${A.dom}, reactive ${A.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 Xt(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function W(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var Ye=Symbol.for("fluixi.server-node"),Vr=Symbol.for("fluixi.dom.server-host"),Ur=globalThis,Je=Ur[Vr]??={server:typeof document>"u",nodes:null};function Ze(){return Je.server}function Jt(){if(!Je.nodes)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return Je.nodes}function Se(e){return e!=null&&e[Ye]===!0?!0:typeof Node<"u"&&e instanceof Node}function Yt(e){return e!=null&&e[Ye]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Zt(e){return e!=null&&e[Ye]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var h={active:!1,cursor:null,parents:[]},Qt=null;function en(e){Qt=e}function tn(){return Qt}function Qe(e,t){return h.active&&t.parentNode===e}function et(e){let t=h.parents.lastIndexOf(e);t!==-1&&(h.parents.length=t),h.cursor=e.nextSibling}function Ee(e){if(!h.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&et(t)}var Hr={};var an="__fx_at";var tt=new Set,ln=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function nt(e){if(!Ze())for(let t of e)tt.has(t)||ln.has(t)||(tt.add(t),document.addEventListener(t,Wr))}function Wr(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 Kr(e,t,n){if(e[`$$${t}`]=n,ln.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=s=>{e[`$$${t}`]?.(s)};e.addEventListener(t,o),e[r]=o}return}tt.has(t)||nt([t])}function nn(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function I(e,t=!1){if(Ze())return Jt().createText(e);if(h.active&&!t){let n=tn()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}var R=0,zr=200;function Br(e,t,n,r,o){let s=r,u=new Map;return E(()=>{k(n??t,"content",void 0,e);let a;if(W(e)&&!T(e)){if(!u.has(e)){R++;try{let i=e();u.set(e,i)}finally{R--}}for(a=u.get(e);typeof a=="function"&&T(a);)a=a()}else for(a=e();typeof a=="function"&&T(a);)a=a();{let i=0;for(;typeof a=="function"&&i++<50;)if(W(a)){if(!u.has(a)){let l=a;R++;try{let p=l();u.set(l,p)}finally{R--}}a=u.get(a)}else if(T(a))a=a();else if(a=a(),typeof a!="function"||!T(a)&&!W(a))break}R++;try{s=Ae(t,a,n,s,u),o(s)}finally{R--}})}function Y(e,t,n,r){if(R>zr)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=I("",!0),e.appendChild(n));let o=r??null,s=i=>Array.isArray(i)&&i.some(l=>typeof l=="function"),u=i=>typeof i=="function"?i:()=>i;if(typeof t!="function"&&!s(t)){R++;try{o=Ae(e,t,n,o)}finally{R--}return()=>o}let a=Br(u(t),e,n,o,i=>{o=i});return()=>(a?.(),o)}function Ae(e,t,n,r,o){if(t==null||typeof t=="boolean")return K(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return K(e,r,n);if(Te(t)){let u=I("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(u,r[0]),K(e,r.slice(1),n)):w(e,u,n):r?e.replaceChild(u,r):w(e,u,n),t.then(a=>{u.parentNode===e&&Ae(e,a,u.nextSibling,u)}).catch(a=>{console.error("Error resolving promise in insertExpression:",a)}),u}let s=typeof t;if(s==="string"||s==="number"){if(s==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let a=I(t);return w(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=K(e,r,n)}if(r&&Zt(r))return r.data=t,r;let u=I(t);return r&&r.parentNode===e?e.replaceChild(u,r):Qe(e,u)||w(e,u,n),u}if(Se(t))return Qe(e,t)?(et(t),t):Array.isArray(r)?(r.length===0?w(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),K(e,r.slice(1),n)):w(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):w(e,t,n)):w(e,t,n),t);if(Array.isArray(t)){let u=[],a=Array.isArray(r)?r:r?[r]:[],i=[];O(t,u,e,n,!0,o,i);let l=Gr(e,a,u,n);for(let p of i){let d=Y(e,p.sig,p.marker);C(()=>{K(e,d()),p.marker.parentNode===e&&e.removeChild(p.marker)})}return l}if(s==="object"&&t!==null&&typeof t=="object"){let u=t;if("type"in u&&"props"in u){let a=u;if(typeof a.type=="function"){let i=a.type(a.props||{});return Ae(e,i,n,r)}}}return K(e,r,n)}function O(e,t,n,r,o=!0,s,u){for(let a=0;a<e.length;a++){let i=e[a];if(!(i==null||typeof i=="boolean")){for(;typeof i=="function"&&!Te(i)&&!T(i)&&!W(i)&&(i=i(),!(i==null||typeof i=="boolean")););if(!(i==null||typeof i=="boolean")){if(typeof i=="function"){let l;for(W(i)&&!T(i)?(s||(s=new Map),s.has(i)||s.set(i,i()),l=s.get(i)):l=i();typeof l=="function"&&!Te(l)&&!T(l)&&!W(l);)s||(s=new Map),s.has(l)||s.set(l,l()),l=s.get(l);if(l==null||typeof l=="boolean")continue;if(typeof l=="function"){if(T(l)){if(u){let d=I("",!0);t.push(d),u.push({marker:d,sig:l});continue}let p=l();for(;typeof p=="function"&&T(p);)p=p();if(p==null||typeof p=="boolean")continue;Array.isArray(p)?O(p,t,n,r,o,s):O([p],t,n,r,o,s);continue}continue}Array.isArray(l)?O(l,t,n,r,o,s,u):O([l],t,n,r,o,s,u);continue}if(Te(i)){let l=I("",!0);t.push(l),i.then(p=>{if(l.parentNode){let d=[];if(O([p],d,l.parentNode,void 0,!1,s),d.length>0){l.parentNode.replaceChild(d[0],l);for(let y=1;y<d.length;y++)l.parentNode?.insertBefore(d[y],d[y-1].nextSibling)}}}).catch(p=>console.error("Error resolving promise in array:",p));continue}if(Array.isArray(i)){O(i,t,n,r,o,s,u);continue}if(Se(i)){t.push(i);continue}if(typeof i=="object"&&i!==null&&"type"in i&&"props"in i){let l=i;if(typeof l.type=="function"){let p=l.type(l.props||{});Array.isArray(p)?O(p,t,n,r,!1,s):O([p],t,n,r,!1,s);continue}}if(typeof i=="string"||typeof i=="number"){let l=String(i);if(l.trim()===""&&l!==" ")continue;t.push(I(l));continue}t.push(I(String(i)))}}}}function Gr(e,t,n,r){for(let d=0;d<n.length;d++){let y=n[d].parentNode;y!==null&&y!==e&&y.nodeType!==11&&(n=n.slice(),n[d]=n[d].cloneNode(!0))}let o=n.length,s=t.length,u=o,a=0,i=0,l=s>0?t[s-1].nextSibling??void 0:r,p=null;for(;a<s||i<u;){if(t[a]===n[i]){a++,i++;continue}for(;s>a&&u>i&&t[s-1]===n[u-1];)s--,u--;if(s===a){let d=u<o?i?n[i-1].nextSibling??void 0:n[u-i]:l;for(;i<u;)w(e,n[i++],d)}else if(u===i)for(;a<s;)(!p||!p.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[u-1]&&n[i]===t[s-1]){let d=t[--s].nextSibling;w(e,n[i++],t[a++].nextSibling),w(e,n[--u],d),t[s]=t[a-1]}else{if(!p){p=new Map;let y=i;for(;y<u;)p.set(n[y],y++)}let d=p.get(t[a]);if(d!=null)if(i<d&&d<u){let y=a,g=1;for(;++y<s&&y<u&&!(!p.has(t[y])||p.get(t[y])!==d+g);)g++;if(g>d-i){let S=t[a];for(;i<d;)w(e,n[i++],S)}else t[a].parentNode===e?e.replaceChild(n[i++],t[a++]):(w(e,n[i++],l),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function K(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 w(e,t,n){h.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function J(e,t,n){n==null?delete e[t]:e[t]=n}function Xr(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 cn(e,t){if(!t||typeof t!="function")return;let n=t[an]?.name;if(!n)return;let r=n.indexOf(":");r!==-1&&j(e,n.slice(0,r),n.slice(r+1),t)}function rn(e,t,n){let r=typeof n=="function"?_(()=>n()):n;if(!(!r||typeof r!="object"))for(let o of Object.keys(r))j(e,t,o)}function Jr(e,t){let n=(r,o)=>{typeof r=="function"&&(j(e,"use",r.name||"use",o),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 on(e,t,n,r=!1){return cn(e,n),typeof n!="function"?(N(e,t,n,r),()=>{}):E(()=>{k(e,"attribute",t,n);let o=typeof n=="function"?n():n;N(e,t,o,r)})}function sn(e,t,n){return typeof n!="function"?(J(e,t,n),()=>{}):(cn(e,n),E(()=>{k(e,"property",t,n);let r=typeof n=="function"?n():n;J(e,t,r)}))}function Yr(e,t,n){return typeof n!="function"?(N(e,t,!!n),()=>{}):E(()=>{k(e,"attribute",t,n);let r=n();N(e,t,!!r)})}function ce(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){E(()=>{k(e,"attribute","class",t),ce(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 un(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],s=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push(E(()=>{let u=!!o();for(let a of s)e.classList.toggle(a,u)}));else{let u=!!(typeof o=="function"?o():o);for(let a of s)e.classList.toggle(a,u)}}}function _e(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 fn(e){let{element:t,props:n,prevProps:r=Hr,isSVG:o=!1,skipChildren:s=!1}=e;if(!t||!Yt(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let u=o||t.namespaceURI===Ot,a=[];for(let i in n){if(s&&i==="children")continue;let l=n[i],p=r[i];if(l===p)continue;if(i==="ref"){rt(l,t);continue}if(i==="use"){Jr(t,l);continue}if(i.startsWith("on:")){a.push(Xr(t,i.slice(3),l));continue}if(i.startsWith("prop:")){j(t,"prop",i.slice(5),l),a.push(sn(t,i.slice(5),l));continue}if(i.startsWith("attr:")){j(t,"attr",i.slice(5),l),a.push(on(t,i.slice(5),l,u));continue}if(i.startsWith("bool:")){j(t,"bool",i.slice(5),l),a.push(Yr(t,i.slice(5),l));continue}if(i==="class"||i==="className"){typeof l=="function"?a.push(E(()=>{k(t,"attribute","class",l),ce(t,l())})):ce(t,l);continue}if(i==="classList"){rn(t,"class",l),typeof l=="function"?a.push(E(()=>{k(t,"attribute","class",l),un(t,l())})):un(t,l,a);continue}if(i==="style"){rn(t,"style",l),typeof l=="function"?a.push(E(()=>{k(t,"attribute","style",l),_e(t,l())})):_e(t,l);continue}if(i.startsWith("on")){let y=i.slice(2).toLowerCase();p&&nn(t,y),l&&Kr(t,y,l);continue}let d=We.has(i)||!u&&i in t;typeof l=="function"?a.push(d?sn(t,i,l):on(t,i,l,u)):a.push(E(()=>d?J(t,i,n[i]):N(t,i,n[i],u)))}for(let i in r)if(!(i in n))if(i.startsWith("on")){let l=i.slice(2).toLowerCase();nn(t,l)}else We.has(i)?J(t,i,null):t.removeAttribute(i);return()=>{a.forEach(i=>i())}}function rt(e,t){if(!e)return;let n=e[an]?.name;if(j(t,"ref",n||typeof e=="function"&&e.name||"ref",e),Se(e)){let r=t,o=e;if(!r)return;typeof r=="function"?r(o):typeof r=="object"&&"current"in r&&(r.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}function Te(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Ne(e,t,n){if(!t)throw new Error("Container element is required");let r,o,s=[];return H(u=>{se(()=>{h.active||(t.textContent=""),Bt(t),Gt(),Y(t,e)}),o=u}),()=>{o?.(),r?.(),s.forEach(u=>u()),t.textContent=""}}var Zr="1.0.0-alpha.83";var Qr="__fluixi_signal_next_state__",eo=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)},c=globalThis[Qr]??={consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:eo,onSuspend:null,onError:null,observer:null};function to(e){return c.observer=e,()=>{c.observer===e&&(c.observer=null)}}var M=[],ke;function no(e,t){if(!c.observer)return t();let n=ke;ke=e;try{return t()}finally{ke=n}}function Ie(e){let t=c.observer;t&&t.created(e.parents===void 0?{...e,parents:M,origin:e.origin??ke}:e)}function ro(e){return c.observer?(M.push(e),!0):!1}function oo(){M.pop()}function io(e){c.observer?.ran?.(e)}function so(e,t){c.observer?.wrote?.(e,t)}function kn(e){let t=c.observer;!t?.props||!M.length||!e||t.props(M[M.length-1],e)}function uo(e){c.observer?.contextCreated?.(e)}function st(e,t,n){let r=c.observer;!r?.context||!M.length||r.context(M[M.length-1],e,t,n)}function dn(e,t,n){c.observer?.moved?.(e,t,n)}function pe(e){c.observer?.disposed?.(e)}var ao="__FLUIXI_DEVTOOLS_HOOK__",pn=globalThis[ao];if(typeof pn?.inject=="function")try{pn.inject({observeReactiveNodes:to,version:Zr})}catch{}function qe(){return c.observer!=null}var hn=0,yn=1,fe=2,Pn=class{constructor(){this.observers=null,this.watchers=null,this.version=0}updateIfNecessary(){}track(){if(c.untracked)return;let e=c.consumer;e&&((this.observers??=new Set).add(e),(e.sources??=new Set).add(this))}},lo=class extends Pn{constructor(e,t){super(),this._value=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){return this.track(),this._value}set(e){if(!this._equals(this._value,e)){if(this._value=e,this.version++,so(this,c.consumer),this.observers)for(let t of[...this.observers])t.markDirty(fe);ut(this)}}peek(){return this._value}},Cn=class extends Pn{constructor(e,t){super(),this._threw=!1,this._initialized=!1,this.state=fe,this.sources=null,this._fn=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){if(c.consumer===this)throw new Error("Signal.Computed cannot read itself");if(this.track(),this.updateIfNecessary(),this._threw)throw this._error;return this._value}updateIfNecessary(){if(this.state===yn&&this.sources){for(let e of this.sources)if(e.updateIfNecessary(),this.state===fe)break}(this.state===fe||!this._initialized)&&this.recompute(),this.state=hn}recompute(){if(this.sources){for(let a of this.sources)a.observers?.delete(this);this.sources.clear()}let e=c.consumer,t=c.untracked,n=ro(this);c.consumer=this,c.untracked=!1;let r,o=!1,s;try{r=this._fn()}catch(a){o=!0,s=a,r=this._value}finally{c.consumer=e,c.untracked=t,n&&oo()}let u=!this._initialized||this._threw!==o||(o?s!==this._error:!this._equals(this._value,r));if(this._initialized=!0,this._threw=o,this._error=s,this._value=r,io(this),u){if(this.version++,this.observers)for(let a of[...this.observers])a.markDirty(fe);ut(this)}}markDirty(e){if(this.state>=e)return;let t=this.state===hn;if(this.state=e,t){if(this.observers)for(let n of[...this.observers])n.markDirty(yn);ut(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};function ut(e){if(e.watchers)for(let t of[...e.watchers])t._notify(e)}var co=class{constructor(e){this._watched=new Set,this._pending=new Set,this._notifyFn=e}watch(...e){for(let t of e)this._watched.add(t),(t.watchers??=new Set).add(this)}unwatch(...e){for(let t of e)this._watched.delete(t),t.watchers?.delete(this),this._pending.delete(t)}getPending(){let e=[...this._pending];return this._pending.clear(),e}_notify(e){if(!this._watched.has(e)||this._pending.has(e))return;let t=this._pending.size===0;this._pending.add(e),t&&this._notifyFn()}};function fo(e){if(c.untracked)return e();c.untracked=!0;try{return e()}finally{c.untracked=!1}}function ft(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function Le(e,t){let n=Symbol(t??"context");return uo(n),{id:n,defaultValue:e,Provider:r=>{st(n,"provide",r.value);let o=c.owner,s=ft(o);(s.contexts=new Map).set(n,r.value),o&&(o.owned??=[]).push(s),c.owner=s;try{return r.children}finally{c.owner=o}}}}function On(e){let t=c.owner;for(;t;){if(t.contexts&&t.contexts.has(e.id)){let n=t.contexts.get(e.id);return st(e.id,"read",n),n}t=t.parent}return st(e.id,"read",e.defaultValue),e.defaultValue}function Rn(e,t){let n=e;for(;n;){if(n.contexts&&n.contexts.has(t.id))return n.contexts.get(t.id);n=n.parent}return t.defaultValue}function po(e){c.onSuspend=e}function ho(e){return c.onSuspend?(c.onSuspend(e,c.owner),!0):!1}function yo(e){c.onError=e}function mo(){return c.owner}function Mn(e,t){let n=c.owner;c.owner=e;try{return t()}finally{c.owner=n}}function ye(e){if(c.owner){if(c.owner.disposed){e();return}(c.owner.cleanups??=[]).push(e)}}function Ce(e,t=!0){if(!e.disposed){if(e.owned){for(let n=e.owned.length-1;n>=0;n--)Ce(e.owned[n]);e.owned=null}if(e.cleanups){for(let n=e.cleanups.length-1;n>=0;n--)e.cleanups[n]();e.cleanups=null}t&&(e.disposed=!0)}}function jn(e){let t=ft(c.owner);c.owner&&(c.owner.owned??=[]).push(t);let n=c.owner;c.owner=t;try{return e(()=>Ce(t))}finally{c.owner=n}}function go(e){c.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function bo(e){e.queued||(e.queued=!0,c.queue.push(e),!c.scheduled&&c.batchDepth===0&&(c.scheduled=!0,c.hostSchedule(dt)))}function dt(){if(c.scheduled=!1,c.flushing)return;c.flushing=!0;let e=0;try{for(;c.queue.length;){if(++e>1e5)throw new Error("[fluixi] effect flush did not settle (cycle?)");let t=c.queue;c.queue=[];for(let n of t)n.queued=!1,n.disposed||n.run()}}finally{c.flushing=!1}}function vo(){c.batchDepth===0&&dt()}function wo(e){c.batchDepth++;try{return e()}finally{--c.batchDepth===0&&dt()}}var xo=class{constructor(e,t=!1){this.queued=!1,this.disposed=!1,this.owner=ft(c.owner),c.owner&&(c.owner.cleanups??=[]).push(()=>this.dispose()),this.computed=new Cn(()=>{Ce(this.owner,!1),Mn(this.owner,()=>{let n=e();typeof n=="function"&&(this.owner.cleanups??=[]).push(n)})}),Ie({kind:"effect",node:this.computed,handle:this,internal:!t}),this.watcher=new co(()=>bo(this)),this.run(),this.watcher.watch(this.computed)}run(){if(!this.disposed){this.watcher.getPending();try{this.computed.get()}catch(e){if(e&&typeof e.then=="function"&&c.onSuspend){c.onSuspend(e,this.owner);return}if(c.onError&&c.onError(e,this.owner))return;throw e}}}dispose(){this.disposed||(this.disposed=!0,pe(this.computed),this.watcher.unwatch(this.computed),Ce(this.owner))}};function pt(e,t=!1){let n=new xo(e,t);return()=>n.dispose()}function So(e){return!!e&&typeof e.then=="function"}go(()=>{});var Dn=Symbol.for("signal"),Eo=Symbol.for("memo"),To=Symbol.for("signal-node");function L(e,t){let n=new lo(e,{equals:t?.equals}),r=(()=>n.get()),o=(s=>{let u=typeof s=="function"?s(n.peek()):s;return n.set(u),vo(),u});return Object.defineProperty(r,Dn,{value:!0,enumerable:!0}),Object.defineProperty(r,To,{value:{get value(){return n.peek()},get version(){return n.version}},enumerable:!1}),Ie({kind:"signal",node:n,handle:r,name:t?.name,set:o}),qe()&&ye(()=>pe(n)),[r,o]}function ht(e,t,n){let r=t,o=mo(),s=new Cn(()=>Mn(o,()=>{try{return r=e(r)}catch(a){if(So(a))return ho(a),r;throw a}}),{equals:n?.equals}),u=(()=>s.get());return Object.defineProperty(u,Dn,{value:!0,enumerable:!0}),Object.defineProperty(u,Eo,{value:!0,enumerable:!0}),Ie({kind:"memo",node:s,handle:u,name:n?.name}),qe()&&ye(()=>pe(s)),u}function $e(e,t){let n=t;return pt(()=>{n=e(n)},!0)}function In(e,t){let n=t;pt(()=>{n=e(n)})}function qn(e,t){let n=t;return pt(()=>{n=e(n)})}function q(e){return wo(e)}function ee(e){return fo(e)}var _i=typeof window>"u"?!1:window.__FLUIXI_PROD__===!0;var Ao=Symbol.for("signal");function Ln(e){return typeof e=="function"&&e[Ao]===!0}var mn=null;function _o(e){mn&&mn(e)}var gn=null;function No(e){return gn?gn(e):void 0}var bn=null;function ko(){return bn?bn():void 0}var vn=null;function Po(e,t){vn&&vn(e,t)}function Co(e){return!!e&&typeof e.then=="function"}var ot=Symbol();function $n(e,t,n={}){let r,o;typeof t=="function"?(r=typeof e=="function"?e:()=>e,o=t):(r=()=>!0,o=e,t&&typeof t=="object"&&(n=t));let s=n.transport===!1?void 0:ko(),u=s!==void 0?No(s):void 0,a=u!==void 0,[i,l]=L(u!==void 0?u.value:n.initialValue,{equals:!1}),[p,d]=L(void 0,{equals:!1}),[y,g]=L(u!==void 0||n.initialValue!==void 0?"ready":"unresolved",{equals:!1}),[S,b]=L(void 0,{equals:!1}),[z,ne]=L(void 0,{equals:!1}),F=ot,re=!1;$e(()=>{let v=r();if(z(),v===!1||v===null||v===void 0){F=ot,q(()=>{g("unresolved"),b(void 0),d(void 0)});return}let ge=re;if(re=!1,F!==ot&&v===F&&!ge)return;if(F=v,a){a=!1;return}let be=!1;ye(()=>be=!0);let Pt=ee(y),nr=ee(i),Ct=Pt==="ready"||Pt==="refreshing";q(()=>{g(Ct?"refreshing":"pending"),d(void 0)});try{let V=o(v,{value:nr,refetching:Ct});Co(V)?(b(V),_o(V),V.then(ve=>{be||(s!==void 0&&Po(s,ve),q(()=>{l(()=>ve),g("ready"),b(void 0)}))},ve=>{be||q(()=>{d(ve),g("errored"),b(void 0)})})):q(()=>{l(()=>V),g("ready"),b(void 0)})}catch(V){if(be)return;q(()=>{d(V),g("errored"),b(void 0)})}});let me=()=>{let v=y();return v==="pending"||v==="refreshing"},B=(()=>{let v=p();if(v)throw v;if(me()){let ge=S();if(ge)throw ge}return i()});return Object.defineProperties(B,{state:{get:y},loading:{get:me},error:{get:p},latest:{get:i}}),Object.defineProperty(B,Symbol.for("resource"),{value:!0,enumerable:!0}),Object.defineProperty(B,Symbol.for("signal"),{value:!0,enumerable:!0}),[B,{mutate:l,refetch:()=>{re=!0,ne(void 0)}}]}var Oo=Le();po((e,t)=>{let n=Rn(t,Oo);n&&(n.increment(),e.finally(()=>n.decrement()))});var Ro=Le();yo((e,t)=>{let n=Rn(t,Ro);return n?(n.setError(e),!0):!1});function Fn(e,t){let[n,r]=L(e,t);return Object.assign(n,{set:r})}function Vn(e,t,n){return ht(e,t,n)}function Un(e,t){return $e(e,t)}var Oe=Symbol("store-raw"),wn=Symbol("store-node"),xn=Symbol("store-has"),Sn=Symbol("store-self"),En=Symbol("store-track");var he=new WeakMap,at=new WeakMap,te=new WeakMap,Re=new WeakMap;function Mo(e,t){if(!Q(e)||!qe())return;let n=new Set,r=u=>{if(!(!Q(u)||n.has(u))){n.add(u);for(let a of Object.values(u))r(a)}};r(Re.get(t)??t);let o=new Set,s=u=>{if(!Q(u))return;let a=u;if(n.has(a)||o.has(a))return;o.add(a);let i=he.get(a);if(i){for(let l of i.keys.values())pe(l);i.all&&pe(i.all),he.delete(a),te.delete(a),at.delete(a)}for(let l of Object.values(a))s(l)};s(e)}var Me=(e,t,n)=>n?`${e}[${String(t)}]`:`${e}.${String(t)}`;function Hn(e,t,n){let r=t?.owner,o=r&&n!==void 0?Me(r.name,n,t?.array):void 0,[s,u]=no(r?.store,()=>D(e,o?{name:o}:void 0)),a=s;return a.$=u,a}function je(e){let t=he.get(e);return t?t.owner||(t.owner=te.get(e)):he.set(e,t={keys:new Map,owner:te.get(e),array:Array.isArray(e)}),t}function Tn(e,t,n){let r=e.keys.get(t);return r||e.keys.set(t,r=Hn(n,e,t)),r}function jo(e,t,n,r){let o=te.get(e);if(o&&o.store===t&&o.name===n)return;let s={store:t,name:n};te.set(e,s),Re.set(e,Re.get(r)??r);let u=he.get(e);if(u&&(u.owner=s,!!qe())){for(let[a,i]of u.keys)dn(i,t,Me(n,a,u.array));u.all&&dn(u.all,t,Me(n,"*",u.array))}}function An(e){let t=je(e);(t.all||(t.all=Hn(void 0,t,"*")))()}function _n(e,t){e.$(typeof t=="function"?()=>t:t)}function Q(e){if(e==null||typeof e!="object")return!1;if(Array.isArray(e))return!0;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Pe(e){if(!Q(e))return e;let t=at.get(e);if(t)return t;let n=new Proxy(e,Do);return at.set(e,n),n}var Do={get(e,t,n){if(t===Oe||t===wn)return e;if(t===Xe)return n;if(t===xn)return i=>i in e;if(t==="__proxy")return!0;if(t===En||t===Sn)return An(e),n;let r=e[t];if(typeof r=="function"&&!Object.prototype.hasOwnProperty.call(e,t))return r;let o=Object.getOwnPropertyDescriptor(e,t);if(o&&o.get)return o.get.call(n);let s=je(e),u=Tn(s,t,r),a=u();return Q(a)?(s.owner&&jo(a,u,Me(s.owner.name,t,s.array),e),Pe(a)):a},set(){return!0},deleteProperty(e,t){return t in e&&de(e,t,void 0),!0},has(e,t){return t===Oe||t===Xe||t===wn||t===xn||t===Sn||t===En?!0:(Tn(je(e),t,e[t])(),t in e)},ownKeys(e){return An(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e,t)}};function Wn(e,t=new Set){if(e==null||typeof e!="object")return e;let n=e[Oe]??e;if(t.has(n)||!Q(n))return n;t.add(n);let r=!1,o=u=>{let a=Wn(u,t);return a!==u&&(r=!0),a};if(Array.isArray(n)){let u=n.map(o);return r?u:n}let s={};for(let u of Object.keys(n))s[u]=o(n[u]);return r?s:n}function de(e,t,n){let r=Wn(n),o=e[t];if(o===r&&(r!==void 0||t in e))return;let s=Array.isArray(e),u=s?e.length:0;r===void 0?delete e[t]:e[t]=r;let a=je(e),i=a.keys.get(t);if(i&&_n(i,r),Mo(o,e),s&&e.length!==u){let l=a.keys.get("length");l&&_n(l,e.length)}a.all&&a.all.$(void 0)}function Nn(e,t){return typeof e=="function"?e(t):e}function lt(e,t){for(let n of Object.keys(t)){let r=t[n],o=e[n];r&&typeof r=="object"&&!Array.isArray(r)&&o&&typeof o=="object"&&!Array.isArray(o)?lt(o,r):de(e,n,r)}}function yt(e){let t=[],n=e.replace(/\[([^\]]*)\]/g,".$1");for(let r of n.split("."))r.length&&t.push(r);return t}function Kn(e,t,n){let r=t.length-1;for(let s=0;s<r;s++){let u=t[s];if(u==="*"){let i=t.slice(s+1);if(Array.isArray(e))for(let l=0;l<e.length;l++)Kn(e[l],i,n);return}let a=e[u];(a==null||typeof a!="object")&&(a=/^\d+$/.test(t[s+1])?[]:{},de(e,u,a)),e=a}let o=t[r];if(o==="*"){if(Array.isArray(e))for(let s=0;s<e.length;s++)de(e,s,Nn(n,e[s]));return}de(e,o,Nn(n,e[o]))}function it(e,t,n){Kn(e,yt(t),n)}function Io(e,t){let n=t[0];if(typeof n=="function"&&t.length===1){let r=n(e);r&&r!==e&<(e,r);return}if(Array.isArray(n)&&t.length===1){for(let r of n)Array.isArray(r)&&it(e,r[0],r[1]);return}if(n&&typeof n=="object"&&!Array.isArray(n)&&t.length===1){lt(e,n);return}if(Array.isArray(t[1])&&t.length>=3){it(e,`${n}.${t[1].join(".")}`,t[2]);return}it(e,String(n),t[1])}function ct(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(ct);let t={};for(let n of Object.keys(e))t[n]=ct(e[n]);return t}function Z(e,t){let n=e;for(let r of yt(t)){if(n==null)return;n=n[r]}return n}var zn=class{constructor(e,t={immutable:!0}){this.options=t,this.root=e,this.set=((...n)=>se(()=>Io(this.root,n))),e&&typeof e=="object"&&(te.set(e,{store:this,name:t.name??"store"}),Re.set(e,e)),Ie({kind:"store",node:this,handle:()=>this.root,name:t.name})}get state(){return Pe(this.root)}get proxy(){return Pe(this.root)}get accessor(){return(()=>Pe(this.root))}unwrap(){return this.root}getNode(e){return this.root&&this.root[e]}get(e){if(e==null||e==="")return De(this.state);let t=this.state;for(let n of yt(e)){if(t==null)return;t=t[n]}return De(t)}select(e){return m(()=>e(this.state))}subscribe(e){return xe(()=>e(this.state))}watch(e,t){let n;return xe(()=>{let r=e(this.state);Object.is(r,n)||(t(r,n),n=r)})}reactive(e){return m(()=>this.state[e])}produce(e){this.set((t=>{let n=ct(t);return e(n),n}))}reconcile(e,t={}){this.set(e)}push(e,...t){let n=Z(this.root,e);this.set(e,n.concat(t))}pop(e){let t=Z(this.root,e).slice(),n=t.pop();return this.set(e,t),n}shift(e){let t=Z(this.root,e).slice(),n=t.shift();return this.set(e,t),n}splice(e,t,n,...r){let o=Z(this.root,e).slice(),s=o.splice(t,n,...r);return this.set(e,o),s}insert(e,t,n){let r=Z(this.root,e).slice();r.splice(t,0,n),this.set(e,r)}removeAt(e,t){let n=Z(this.root,e).slice(),r=n.splice(t,1);return this.set(e,n),r}toObservable(){let[e]=D(this.state);return e.toObservable()}dispose(){}},qo=["get","select","watch","subscribe","produce","reconcile","push","pop","shift","splice","insert","removeAt","unwrap","toObservable"];function Lo(e,t){for(let n of qo)e[n]=t[n].bind(t);e.$=t.reactive.bind(t)}function Bn(e,t={immutable:!0}){let n=new zn(e,t);return Lo(n.set,n),[n.proxy,n.set]}function $o(e,t={}){return new zn(e,{...t,immutable:!1})}function De(e){if(e==null||typeof e!="object")return e;let t=e[Oe];return t!==void 0?t:e}function Fo(e){return _(()=>De(e))}var ki=Object.freeze({createStore:Bn,createMutableStore:$o,batch:se,unwrap:De,untrackStore:Fo});function Gn(e,t){let[n,r]=Bn(e,t);return new Proxy(n,{get:(o,s)=>s==="set"?r:o[s],has:(o,s)=>s==="set"||Reflect.has(o,s)})}var Vo="__fx_dom_create_component__",Xn=globalThis[Vo]??={fn:null};function Jn(e,t){if(Xn.fn)return Xn.fn(e,t);t&&kn(t);let n=typeof e=="function"?ee(()=>e(t)):e,r=n!=null&&(typeof n=="function"||typeof n=="object");if(r)try{n.$name=e?.name}catch{}return r&&!Ln(n)?Xt(n):n}var Uo="__FX_DATA__";var mt;function Yn(){let e=globalThis.__FX_DATA__;if(e)return e;if(mt!==void 0)return mt;let t=null;if(typeof document<"u"){let n=document.getElementById(Uo)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return mt=t}function Fe(){for(;;){for(;h.cursor&&h.cursor.nodeType===3&&h.cursor.data==="";)h.cursor=h.cursor.nextSibling;if(h.cursor!=null||!h.parents.length)return;h.cursor=h.parents.pop().nextSibling}}var Ho=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ve=typeof process<"u"&&process.env&&!1;function Ue(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 Wo(e){Fe();let t=h.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Ho.has(e.toLowerCase())?h.cursor=t.nextSibling:(h.parents.push(t),h.cursor=t.firstChild),t):(Ve&&t&&Ue(`<${e}>`,t),null)}function Ko(e){Fe();let t=h.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(h.cursor=t.nextSibling,t):(Ve&&t&&Ue(`<${e}> (static)`,t),null)}function zo(e){if(e===""){let n=h.cursor;return n&&n.nodeType===3&&n.data!==""?(h.cursor=n.nextSibling,n.data="",n):null}Fe();let t=h.cursor;return t&&t.nodeType===3?(h.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(Ve&&t&&Ue(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Bo(e){Fe();let t=h.cursor;return t&&t.nodeType===8&&t.data===e?(h.cursor=t.nextSibling,t):(Ve&&t&&Ue(`marker <!--${e.slice(0,24)}-->`,t),null)}var Zn=!1;function Go(){Zn||(Zn=!0,en({hydrateElement:Wo,hydrateText:zo,hydrateMarker:Bo,hydrateStatic:Ko}))}function gt(e,t,n){Go(),h.active=!0,h.cursor=t.firstChild,h.parents=[];let r=Yn(),o=n?.resourceNamespace,s=0;Wt(()=>o?`${o}:r${s++}`:`r${s++}`),Ht(r?u=>u in r?{value:r[u]}:void 0:null);try{return Ne(e,t)}finally{h.active=!1,h.cursor=null,h.parents=[]}}function Qn(e){return typeof e=="function"?e:(()=>e)}function $(e){return()=>{let t=e();return typeof t=="function"?t():t}}function er(e){return e!=null&&e!==!1}function tr(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function bt(e){let t=$(()=>e.when),n=m(t,void 0,{name:"Show.when"}),r=m(n,void 0,{name:"Show.cond"}),o=U(),s=null,u=null,a=i=>{i!==u&&(s&&X(s),s=G(o),u=i)};return m(()=>{let i=r();return a(i?"when":"fallback"),P(s,()=>{if(i){let l=e.children;return typeof l=="function"&&!tr(l)?typeof n=="function"?_(()=>_(n)?l(n()):e.fallback):l(n):l}return e.fallback});return e.fallback??null},void 0,{name:"Show.result"})}function vt(e){let t=$(()=>e.each),n=()=>e.fallback??null,r=(o,s)=>{let u=e.children,a=Array.isArray(u)?u.map(i=>typeof i=="function"?i(o,s):i):typeof u=="function"?u(o,s):u;return Ee(a),a};return e.by?ae(t,e.by,(o,s)=>r(o,s),{fallback:n}):ue(t,(o,s)=>r(o,s),{fallback:n})}function wt(e){let t=$(()=>e.each);return le(t,(n,r)=>{let o=e.children(n,r);return Ee(o),o},{fallback:()=>e.fallback??null})}var xt=Symbol("match");function St(e){return{[xt]:!0,when:$(()=>e.when),get children(){return e.children}}}function Et(e){let t=Array.isArray(e.children)?e.children:[e.children],n=U(),r=null,o=-1,s=u=>{u!==o&&(r&&X(r),r=G(n),o=u)};return m(()=>{for(let u=0;u<t.length;u+=1){let i=t[u],l=0;for(;typeof i=="function"&&!i[xt]&&l++<10;)i=i();if(!i||typeof i!="object"||i[xt]!==!0)continue;let p=i.when();if(er(p))return s(u),P(r,()=>typeof i.children=="function"?i.children(p):i.children)}return s(-2),P(r,()=>e.fallback??null)},void 0,{name:"Switch"})}function Tt(e){let t=Qn(e.component),{component:n,...r}=e,o=U(),s=null,u;return m(()=>{let a=t();return a!==u&&(s&&X(s),s=G(o),u=a),a==null?null:typeof a=="string"?{tag:a,props:r}:P(s,()=>a(r))},void 0,{name:"Dynamic"})}function At(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return H(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),Y(r,e.children)&&rt(e.ref,r)}),C(()=>{n(),r.remove()}),null}function _t(e){let[t,n]=D(null),r=()=>n(null);return m(()=>{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(s){return n(s),typeof e.fallback=="function"?e.fallback(s,r):e.fallback}},void 0,{name:"ErrorBoundary"})}function Nt(e){return m(()=>{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(" ")},void 0,{name:"ClassMap"})}function Xo(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function kt(e){return m(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;let s=typeof o=="function"?o():o;s!=null&&n.push(`${Xo(r)}: ${s}`)}return n.join("; ")},void 0,{name:"StyleMap"})}return ar(Jo);})();
|
|
1
|
+
/*! @fluixi/dom v1.0.0-alpha.84 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
|
+
"use strict";var FluixiDOM=(()=>{var Ke=Object.defineProperty;var mr=Object.getOwnPropertyDescriptor;var br=Object.getOwnPropertyNames;var gr=Object.prototype.hasOwnProperty;var vr=(e,t)=>{for(var n in t)Ke(e,n,{get:t[n],enumerable:!0})},wr=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of br(t))!gr.call(e,o)&&o!==n&&Ke(e,o,{get:()=>t[o],enumerable:!(r=mr(t,o))||r.enumerable});return e};var xr=e=>wr(Ke({},"__esModule",{value:!0}),e);var li={};vr(li,{Dynamic:()=>Pt,ErrorBoundary:()=>Ct,For:()=>Tt,Index:()=>At,Match:()=>Nt,Portal:()=>kt,Show:()=>Et,Switch:()=>Rt,batch:()=>V,classMap:()=>Ot,createComponent:()=>ar,createComputed:()=>Xn,createContext:()=>Ve,createEffect:()=>Fe,createElement:()=>$t,createMemo:()=>vt,createRenderEffect:()=>Yn,createResource:()=>Zn,createRoot:()=>zn,createSignal:()=>F,delegateEvents:()=>it,effect:()=>tr,hydrate:()=>St,indexArray:()=>le,insert:()=>ee,keyArray:()=>fe,mapArray:()=>ae,memo:()=>er,onCleanup:()=>me,render:()=>Re,setAttribute:()=>N,setClassName:()=>de,setProperty:()=>Q,setStyle:()=>Ne,signal:()=>Qn,spread:()=>xn,store:()=>cr,styleMap:()=>Mt,untrack:()=>ne,useContext:()=>Wn});var jt="http://www.w3.org/2000/svg";var Be=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function N(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 Sr(e,t){Object.assign(e.style,t)}function $t(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,s])=>{if(o==="class"||o==="className")r.className=s;else if(o==="style"&&typeof s=="object")Sr(r,s);else if(o.startsWith("on")&&typeof s=="function"){let c=o.slice(2).toLowerCase();r.addEventListener(c,s)}else N(r,o,s)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}var pi=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;var Ge="1.0.0-alpha.84",Ht=Ge.split(".")[0],Lt=`__fluixi_signal_state_v${Ht}__`,Ut=`__fluixi_signal_builds_v${Ht}__`,Er=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)};function Wt(){return{consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:Er,onSuspend:null,onError:null,observer:null}}var we=globalThis;function Tr(e){let t=Wt(),n=e;for(let r of Object.keys(t))r in e||(n[r]=t[r]);return e}function Ar(){let e=we[Lt];return e?Tr(e):we[Lt]=Wt()}var l=Ar();(we[Ut]??=[]).push(Ge);function Kt(){return[...new Set(we[Ut]??[])]}function _r(e){return l.observer=e,()=>{l.observer===e&&(l.observer=null)}}var x=[],Nr;function Xe(e){let t=l.observer;t&&t.created(e.parents===void 0?{...e,parents:x,origin:e.origin??Nr}:e)}function Rr(e){return l.observer?(x.push(e),!0):!1}function Pr(){x.pop()}function kr(e){l.observer?.ran?.(e)}function Cr(e,t){l.observer?.wrote?.(e,t)}function R(e,t,n,r){let o=l.observer;!o?.bound||!x.length||o.bound(x[x.length-1],e,t,n,r)}function j(e,t,n,r){let o=l.observer;!o?.directive||!x.length||o.directive(x[x.length-1],e,t,n,r)}function Or(e){l.observer?.contextCreated?.(e)}function Mr(e,t,n){let r=l.observer;!r?.context||!x.length||r.context(x[x.length-1],e,t,n)}function Ye(e){l.observer?.disposed?.(e)}var Ir="__FLUIXI_DEVTOOLS_HOOK__",qt=globalThis[Ir];if(typeof qt?.inject=="function")try{qt.inject({observeReactiveNodes:_r,version:Ge})}catch{}function Bt(){return l.observer!=null}var Vt=0,Ft=1,se=2,zt=class{constructor(){this.observers=null,this.watchers=null,this.version=0}updateIfNecessary(){}track(){if(l.untracked)return;let e=l.consumer;e&&((this.observers??=new Set).add(e),(e.sources??=new Set).add(this))}},Dr=class extends zt{constructor(e,t){super(),this._value=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){return this.track(),this._value}set(e){if(!this._equals(this._value,e)){if(this._value=e,this.version++,Cr(this,l.consumer),this.observers)for(let t of[...this.observers])t.markDirty(se);ze(this)}}peek(){return this._value}},Gt=class extends zt{constructor(e,t){super(),this._threw=!1,this._initialized=!1,this.state=se,this.sources=null,this._fn=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){if(l.consumer===this)throw new Error("Signal.Computed cannot read itself");if(this.track(),this.updateIfNecessary(),this._threw)throw this._error;return this._value}updateIfNecessary(){if(this.state===Ft&&this.sources){for(let e of this.sources)if(e.updateIfNecessary(),this.state===se)break}(this.state===se||!this._initialized)&&this.recompute(),this.state=Vt}recompute(){if(this.sources){for(let u of this.sources)u.observers?.delete(this);this.sources.clear()}let e=l.consumer,t=l.untracked,n=Rr(this);l.consumer=this,l.untracked=!1;let r,o=!1,s;try{r=this._fn()}catch(u){o=!0,s=u,r=this._value}finally{l.consumer=e,l.untracked=t,n&&Pr()}let c=!this._initialized||this._threw!==o||(o?s!==this._error:!this._equals(this._value,r));if(this._initialized=!0,this._threw=o,this._error=s,this._value=r,kr(this),c){if(this.version++,this.observers)for(let u of[...this.observers])u.markDirty(se);ze(this)}}markDirty(e){if(this.state>=e)return;let t=this.state===Vt;if(this.state=e,t){if(this.observers)for(let n of[...this.observers])n.markDirty(Ft);ze(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};function ze(e){if(e.watchers)for(let t of[...e.watchers])t._notify(e)}var jr=class{constructor(e){this._watched=new Set,this._pending=new Set,this._notifyFn=e}watch(...e){for(let t of e)this._watched.add(t),(t.watchers??=new Set).add(this)}unwatch(...e){for(let t of e)this._watched.delete(t),t.watchers?.delete(this),this._pending.delete(t)}getPending(){let e=[...this._pending];return this._pending.clear(),e}_notify(e){if(!this._watched.has(e)||this._pending.has(e))return;let t=this._pending.size===0;this._pending.add(e),t&&this._notifyFn()}};function $r(e){if(l.untracked)return e();l.untracked=!0;try{return e()}finally{l.untracked=!1}}function J(e){let t=xe(e);return e&&(e.owned??=[]).push(t),t}function Z(e,t=!0){ce(e,t)}function xe(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function Xt(e,t){let n=Symbol(t??"context");return Or(n),{id:n,defaultValue:e,Provider:o=>{Mr(n,"provide",o.value);let s=l.owner,c=xe(s);(c.contexts=new Map).set(n,o.value),s&&(s.owned??=[]).push(c),l.owner=c;try{return o.children}finally{l.owner=s}}}}function Yt(e,t){let n=e;for(;n;){if(n.contexts&&n.contexts.has(t.id))return n.contexts.get(t.id);n=n.parent}return t.defaultValue}function Lr(e){l.onSuspend=e}function qr(e){return l.onSuspend?(l.onSuspend(e,l.owner),!0):!1}function Vr(e){l.onError=e}function K(){return l.owner}function P(e,t){let n=l.owner;l.owner=e;try{return t()}finally{l.owner=n}}function k(e){if(l.owner){if(l.owner.disposed){e();return}(l.owner.cleanups??=[]).push(e)}}function ce(e,t=!0){if(!e.disposed){if(e.owned){for(let n=e.owned.length-1;n>=0;n--)ce(e.owned[n]);e.owned=null}if(e.cleanups){for(let n=e.cleanups.length-1;n>=0;n--)e.cleanups[n]();e.cleanups=null}t&&(e.disposed=!0)}}function B(e){let t=xe(l.owner);l.owner&&(l.owner.owned??=[]).push(t);let n=l.owner;l.owner=t;try{return e(()=>ce(t))}finally{l.owner=n}}function Fr(e){l.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function Hr(e){e.queued||(e.queued=!0,l.queue.push(e),!l.scheduled&&l.batchDepth===0&&(l.scheduled=!0,l.hostSchedule(Je)))}function Je(){if(l.scheduled=!1,l.flushing)return;l.flushing=!0;let e=0;try{for(;l.queue.length;){if(++e>1e5)throw new Error("[fluixi] effect flush did not settle (cycle?)");let t=l.queue;l.queue=[];for(let n of t)n.queued=!1,n.disposed||n.run()}}finally{l.flushing=!1}}function Ur(){l.batchDepth===0&&Je()}function Wr(e){l.batchDepth++;try{return e()}finally{--l.batchDepth===0&&Je()}}var Kr=class{constructor(e,t=!1){this.queued=!1,this.disposed=!1,this.owner=xe(l.owner),l.owner&&(l.owner.cleanups??=[]).push(()=>this.dispose()),this.computed=new Gt(()=>{ce(this.owner,!1),P(this.owner,()=>{let n=e();typeof n=="function"&&(this.owner.cleanups??=[]).push(n)})}),Xe({kind:"effect",node:this.computed,handle:this,internal:!t}),this.watcher=new jr(()=>Hr(this)),this.run(),this.watcher.watch(this.computed)}run(){if(!this.disposed){this.watcher.getPending();try{this.computed.get()}catch(e){if(e&&typeof e.then=="function"&&l.onSuspend){l.onSuspend(e,this.owner);return}if(l.onError&&l.onError(e,this.owner))return;throw e}}}dispose(){this.disposed||(this.disposed=!0,Ye(this.computed),this.watcher.unwatch(this.computed),ce(this.owner))}};function Jt(e,t=!1){let n=new Kr(e,t);return()=>n.dispose()}function Br(e){return!!e&&typeof e.then=="function"}Fr(()=>{});var Zt=Symbol.for("signal"),zr=Symbol.for("memo"),Gr=Symbol.for("signal-node");function $(e,t){let n=new Dr(e,{equals:t?.equals}),r=(()=>n.get()),o=(s=>{let c=typeof s=="function"?s(n.peek()):s;return n.set(c),Ur(),c});return Object.defineProperty(r,Zt,{value:!0,enumerable:!0}),Object.defineProperty(r,Gr,{value:{get value(){return n.peek()},get version(){return n.version}},enumerable:!1}),Xe({kind:"signal",node:n,handle:r,name:t?.name,set:o}),Bt()&&k(()=>Ye(n)),[r,o]}function m(e,t,n){let r=t,o=K(),s=new Gt(()=>P(o,()=>{try{return r=e(r)}catch(u){if(Br(u))return qr(u),r;throw u}}),{equals:n?.equals}),c=(()=>s.get());return Object.defineProperty(c,Zt,{value:!0,enumerable:!0}),Object.defineProperty(c,zr,{value:!0,enumerable:!0}),Xe({kind:"memo",node:s,handle:c,name:n?.name}),Bt()&&k(()=>Ye(s)),c}function Se(e,t){let n=t;return Jt(()=>{n=e(n)},!0)}function E(e,t){let n=t;return Jt(()=>{n=e(n)})}function ue(e){return Wr(e)}function _(e){return $r(e)}function ae(e,t,n){let r=[];return k(()=>{for(let o of r)o.dispose();r=[]}),m(()=>{let o=e()||[];return _(()=>{if(o.length===0){for(let i of r)i.dispose();return r=[],n?.fallback?n.fallback():[]}let s=new Map;for(let i of r)s.has(i.item)||s.set(i.item,i);let c=[],u=new Set;for(let i=0;i<o.length;i++){let a=o[i],p=s.get(a);if(p&&!u.has(p))p.setIndex(i),c.push(p),u.add(p);else{let d,y,b;B(g=>{b=g;let[X,oe]=$(i,{name:"row index"});y=oe,d=t(a,X)});let S={item:a,rendered:d,dispose:b,setIndex:y};c.push(S),u.add(S)}}for(let i of r)u.has(i)||i.dispose();return r=c,c.map(i=>i.rendered)})},void 0,{name:"mapArray"})}function fe(e,t,n,r){let o=[],s=[];return k(()=>{for(let c of s)c.dispose();o=[],s=[]}),m(()=>{let c=e()||[];return _(()=>{if(c.length===0){for(let d of s)d.dispose();return o=[],s=[],r?.fallback?r.fallback():[]}let u=new Map;for(let d=0;d<o.length;d++)u.set(o[d],s[d]);let i=[],a=[],p=new Set;for(let d=0;d<c.length;d++){let y=t(c[d]),b=u.get(y);if(b&&!p.has(y))b.setIndex(d),i.push(b);else{let S,g,X;B(oe=>{X=oe;let[U,ie]=$(d,{name:"row index"});g=ie;let be=m(Y=>{let D=(e()||[])[U()];return D??Y},c[d]);S=n(be,U)}),i.push({rendered:S,dispose:X,setIndex:g})}a.push(y),p.add(y)}for(let[d,y]of u)p.has(d)||y.dispose();return o=a,s=i,i.map(d=>d.rendered)})},void 0,{name:"keyArray"})}function le(e,t,n){let r=[];return k(()=>{for(let o of r)o.dispose();r=[]}),m(()=>{let o=e()||[];return _(()=>{if(o.length===0){for(let i of r)i.dispose();return r=[],n?.fallback?n.fallback():[]}let s=r.length,c=o.length;for(let i=s;i<c;i++){let a,p,d,y=o[i];B(b=>{d=b;let[S,g]=$(y);p=g,a=t(S,i)}),r.push({rendered:a,setItem:p,dispose:d})}for(let i=c;i<s;i++)r[i].dispose();c<s&&(r=r.slice(0,c));let u=Math.min(s,c);for(let i=0;i<u;i++)r[i].setItem(o[i]);return r.map(i=>i.rendered)})},void 0,{name:"indexArray"})}var yi=typeof window>"u"?!1:window.__FLUIXI_PROD__===!0;var Xr=Symbol.for("signal");function T(e){return typeof e=="function"&&e[Xr]===!0}var Yr=null;function Qt(e){Yr=e}var Jr=null;function en(e){Jr=e}var Zr=Xt();Lr((e,t)=>{let n=Yt(t,Zr);n&&(n.increment(),e.finally(()=>n.decrement()))});var Qr=Xt();Vr((e,t)=>{let n=Yt(t,Qr);return n?(n.setError(e),!0):!1});var Ze=Symbol.for("fluixi-proxy");var tn="1.0.0-alpha.84";var nn="1.0.0-alpha.84";var A={dom:tn,reactive:nn};function rn(e){A.core&&e.setAttribute("fluixi",A.core),e.setAttribute("fx-dom",A.dom),e.setAttribute("fx-reactive",A.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=A)}function on(){let e=Kt();e.length>1&&console.warn(`[fluixi] ${e.length} builds of @fluixi/reactive are driving one reactive graph: ${e.join(", ")}. They share it on purpose, so signals still cross between them, but the oldest one decided what the graph looks like. Build the components on one release, or load them as shared-runtime bundles.`);let t=[A.core,A.dom,A.reactive].filter(n=>n!==void 0);new Set(t).size<=1||console.warn(`[fluixi] package versions disagree: core ${A.core??"(absent)"}, dom ${A.dom}, reactive ${A.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 sn(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function z(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var et=Symbol.for("fluixi.server-node"),eo=Symbol.for("fluixi.dom.server-host"),to=globalThis,Qe=to[eo]??={server:typeof document>"u",nodes:null};function tt(){return Qe.server}function cn(){if(!Qe.nodes)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return Qe.nodes}function Ee(e){return e!=null&&e[et]===!0?!0:typeof Node<"u"&&e instanceof Node}function un(e){return e!=null&&e[et]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function an(e){return e!=null&&e[et]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var h={active:!1,cursor:null,parents:[]},fn=null;function ln(e){fn=e}function dn(){return fn}function nt(e,t){return h.active&&t.parentNode===e}function rt(e){let t=h.parents.lastIndexOf(e);t!==-1&&(h.parents.length=t),h.cursor=e.nextSibling}function Te(e){if(!h.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&rt(t)}var no={};var gn="__fx_at";var ot=new Set,vn=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function it(e){if(!tt())for(let t of e)ot.has(t)||vn.has(t)||(ot.add(t),document.addEventListener(t,ro))}function ro(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 oo(e,t,n){if(e[`$$${t}`]=n,vn.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=s=>{e[`$$${t}`]?.(s)};e.addEventListener(t,o),e[r]=o}return}ot.has(t)||it([t])}function pn(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function L(e,t=!1){if(tt())return cn().createText(e);if(h.active&&!t){let n=dn()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}var O=0,io=200;function so(e,t,n,r,o){let s=r,c=new Map;return E(()=>{R(n??t,"content",void 0,e);let u;if(z(e)&&!T(e)){if(!c.has(e)){O++;try{let i=e();c.set(e,i)}finally{O--}}for(u=c.get(e);typeof u=="function"&&T(u);)u=u()}else for(u=e();typeof u=="function"&&T(u);)u=u();{let i=0;for(;typeof u=="function"&&i++<50;)if(z(u)){if(!c.has(u)){let a=u;O++;try{let p=a();c.set(a,p)}finally{O--}}u=c.get(u)}else if(T(u))u=u();else if(u=u(),typeof u!="function"||!T(u)&&!z(u))break}O++;try{s=_e(t,u,n,s,c),o(s)}finally{O--}})}function ee(e,t,n,r){if(O>io)return console.error("[insert] Exceeded max call depth, possible infinite loop."),()=>null;n!==void 0&&!n&&(n=L("",!0),e.appendChild(n));let o=r??null,s=i=>Array.isArray(i)&&i.some(a=>typeof a=="function"),c=i=>typeof i=="function"?i:()=>i;if(typeof t!="function"&&!s(t)){O++;try{o=_e(e,t,n,o)}finally{O--}return()=>o}let u=so(c(t),e,n,o,i=>{o=i});return()=>(u?.(),o)}function _e(e,t,n,r,o){if(t==null||typeof t=="boolean")return G(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return G(e,r,n);if(Ae(t)){let c=L("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(c,r[0]),G(e,r.slice(1),n)):w(e,c,n):r?e.replaceChild(c,r):w(e,c,n),t.then(u=>{c.parentNode===e&&_e(e,u,c.nextSibling,c)}).catch(u=>{console.error("Error resolving promise in insertExpression:",u)}),c}let s=typeof t;if(s==="string"||s==="number"){if(s==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let u=L(t);return w(e,u,n),u}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=G(e,r,n)}if(r&&an(r))return r.data=t,r;let c=L(t);return r&&r.parentNode===e?e.replaceChild(c,r):nt(e,c)||w(e,c,n),c}if(Ee(t))return nt(e,t)?(rt(t),t):Array.isArray(r)?(r.length===0?w(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),G(e,r.slice(1),n)):w(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):w(e,t,n)):w(e,t,n),t);if(Array.isArray(t)){let c=[],u=Array.isArray(r)?r:r?[r]:[],i=[];C(t,c,e,n,!0,o,i);let a=co(e,u,c,n);for(let p of i){let d=ee(e,p.sig,p.marker);k(()=>{G(e,d()),p.marker.parentNode===e&&e.removeChild(p.marker)})}return a}if(s==="object"&&t!==null&&typeof t=="object"){let c=t;if("type"in c&&"props"in c){let u=c;if(typeof u.type=="function"){let i=u.type(u.props||{});return _e(e,i,n,r)}}}return G(e,r,n)}function C(e,t,n,r,o=!0,s,c){for(let u=0;u<e.length;u++){let i=e[u];if(!(i==null||typeof i=="boolean")){for(;typeof i=="function"&&!Ae(i)&&!T(i)&&!z(i)&&(i=i(),!(i==null||typeof i=="boolean")););if(!(i==null||typeof i=="boolean")){if(typeof i=="function"){let a;for(z(i)&&!T(i)?(s||(s=new Map),s.has(i)||s.set(i,i()),a=s.get(i)):a=i();typeof a=="function"&&!Ae(a)&&!T(a)&&!z(a);)s||(s=new Map),s.has(a)||s.set(a,a()),a=s.get(a);if(a==null||typeof a=="boolean")continue;if(typeof a=="function"){if(T(a)){if(c){let d=L("",!0);t.push(d),c.push({marker:d,sig:a});continue}let p=a();for(;typeof p=="function"&&T(p);)p=p();if(p==null||typeof p=="boolean")continue;Array.isArray(p)?C(p,t,n,r,o,s):C([p],t,n,r,o,s);continue}continue}Array.isArray(a)?C(a,t,n,r,o,s,c):C([a],t,n,r,o,s,c);continue}if(Ae(i)){let a=L("",!0);t.push(a),i.then(p=>{if(a.parentNode){let d=[];if(C([p],d,a.parentNode,void 0,!1,s),d.length>0){a.parentNode.replaceChild(d[0],a);for(let y=1;y<d.length;y++)a.parentNode?.insertBefore(d[y],d[y-1].nextSibling)}}}).catch(p=>console.error("Error resolving promise in array:",p));continue}if(Array.isArray(i)){C(i,t,n,r,o,s,c);continue}if(Ee(i)){t.push(i);continue}if(typeof i=="object"&&i!==null&&"type"in i&&"props"in i){let a=i;if(typeof a.type=="function"){let p=a.type(a.props||{});Array.isArray(p)?C(p,t,n,r,!1,s):C([p],t,n,r,!1,s);continue}}if(typeof i=="string"||typeof i=="number"){let a=String(i);if(a.trim()===""&&a!==" ")continue;t.push(L(a));continue}t.push(L(String(i)))}}}}function co(e,t,n,r){for(let d=0;d<n.length;d++){let y=n[d].parentNode;y!==null&&y!==e&&y.nodeType!==11&&(n=n.slice(),n[d]=n[d].cloneNode(!0))}let o=n.length,s=t.length,c=o,u=0,i=0,a=s>0?t[s-1].nextSibling??void 0:r,p=null;for(;u<s||i<c;){if(t[u]===n[i]){u++,i++;continue}for(;s>u&&c>i&&t[s-1]===n[c-1];)s--,c--;if(s===u){let d=c<o?i?n[i-1].nextSibling??void 0:n[c-i]:a;for(;i<c;)w(e,n[i++],d)}else if(c===i)for(;u<s;)(!p||!p.has(t[u]))&&t[u].parentNode===e&&e.removeChild(t[u]),u++;else if(t[u]===n[c-1]&&n[i]===t[s-1]){let d=t[--s].nextSibling;w(e,n[i++],t[u++].nextSibling),w(e,n[--c],d),t[s]=t[u-1]}else{if(!p){p=new Map;let y=i;for(;y<c;)p.set(n[y],y++)}let d=p.get(t[u]);if(d!=null)if(i<d&&d<c){let y=u,b=1;for(;++y<s&&y<c&&!(!p.has(t[y])||p.get(t[y])!==d+b);)b++;if(b>d-i){let S=t[u];for(;i<d;)w(e,n[i++],S)}else t[u].parentNode===e?e.replaceChild(n[i++],t[u++]):(w(e,n[i++],a),u++)}else u++;else t[u].parentNode===e&&e.removeChild(t[u]),u++}}return n}function G(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 w(e,t,n){h.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function Q(e,t,n){n==null?delete e[t]:e[t]=n}function uo(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 wn(e,t){if(!t||typeof t!="function")return;let n=t[gn]?.name;if(!n)return;let r=n.indexOf(":");r!==-1&&j(e,n.slice(0,r),n.slice(r+1),t)}function hn(e,t,n){let r=typeof n=="function"?_(()=>n()):n;if(!(!r||typeof r!="object"))for(let o of Object.keys(r))j(e,t,o)}function ao(e,t){let n=(r,o)=>{typeof r=="function"&&(j(e,"use",r.name||"use",o),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 yn(e,t,n,r=!1){return wn(e,n),typeof n!="function"?(N(e,t,n,r),()=>{}):E(()=>{R(e,"attribute",t,n);let o=typeof n=="function"?n():n;N(e,t,o,r)})}function mn(e,t,n){return typeof n!="function"?(Q(e,t,n),()=>{}):(wn(e,n),E(()=>{R(e,"property",t,n);let r=typeof n=="function"?n():n;Q(e,t,r)}))}function fo(e,t,n){return typeof n!="function"?(N(e,t,!!n),()=>{}):E(()=>{R(e,"attribute",t,n);let r=n();N(e,t,!!r)})}function de(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){E(()=>{R(e,"attribute","class",t),de(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 bn(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],s=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push(E(()=>{let c=!!o();for(let u of s)e.classList.toggle(u,c)}));else{let c=!!(typeof o=="function"?o():o);for(let u of s)e.classList.toggle(u,c)}}}function Ne(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 xn(e){let{element:t,props:n,prevProps:r=no,isSVG:o=!1,skipChildren:s=!1}=e;if(!t||!un(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let c=o||t.namespaceURI===jt,u=[];for(let i in n){if(s&&i==="children")continue;let a=n[i],p=r[i];if(a===p)continue;if(i==="ref"){st(a,t);continue}if(i==="use"){ao(t,a);continue}if(i.startsWith("on:")){u.push(uo(t,i.slice(3),a));continue}if(i.startsWith("prop:")){j(t,"prop",i.slice(5),a),u.push(mn(t,i.slice(5),a));continue}if(i.startsWith("attr:")){j(t,"attr",i.slice(5),a),u.push(yn(t,i.slice(5),a,c));continue}if(i.startsWith("bool:")){j(t,"bool",i.slice(5),a),u.push(fo(t,i.slice(5),a));continue}if(i==="class"||i==="className"){typeof a=="function"?u.push(E(()=>{R(t,"attribute","class",a),de(t,a())})):de(t,a);continue}if(i==="classList"){hn(t,"class",a),typeof a=="function"?u.push(E(()=>{R(t,"attribute","class",a),bn(t,a())})):bn(t,a,u);continue}if(i==="style"){hn(t,"style",a),typeof a=="function"?u.push(E(()=>{R(t,"attribute","style",a),Ne(t,a())})):Ne(t,a);continue}if(i.startsWith("on")){let y=i.slice(2).toLowerCase();p&&pn(t,y),a&&oo(t,y,a);continue}let d=Be.has(i)||!c&&i in t;typeof a=="function"?u.push(d?mn(t,i,a):yn(t,i,a,c)):u.push(E(()=>d?Q(t,i,n[i]):N(t,i,n[i],c)))}for(let i in r)if(!(i in n))if(i.startsWith("on")){let a=i.slice(2).toLowerCase();pn(t,a)}else Be.has(i)?Q(t,i,null):t.removeAttribute(i);return()=>{u.forEach(i=>i())}}function st(e,t){if(!e)return;let n=e[gn]?.name;if(j(t,"ref",n||typeof e=="function"&&e.name||"ref",e),Ee(e)){let r=t,o=e;if(!r)return;typeof r=="function"?r(o):typeof r=="object"&&"current"in r&&(r.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}function Ae(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Re(e,t,n){if(!t)throw new Error("Container element is required");let r,o,s=[];return B(c=>{ue(()=>{h.active||(t.textContent=""),rn(t),on(),ee(t,e)}),o=c}),()=>{o?.(),r?.(),s.forEach(c=>c()),t.textContent=""}}var yt="1.0.0-alpha.84";var qn=yt.split(".")[0],Sn=`__fluixi_signal_state_v${qn}__`,lo=`__fluixi_signal_builds_v${qn}__`,po=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)};function Vn(){return{consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:po,onSuspend:null,onError:null,observer:null}}var at=globalThis;function ho(e){let t=Vn(),n=e;for(let r of Object.keys(t))r in e||(n[r]=t[r]);return e}function yo(){let e=at[Sn];return e?ho(e):at[Sn]=Vn()}var f=yo();(at[lo]??=[]).push(yt);function mo(e){return f.observer=e,()=>{f.observer===e&&(f.observer=null)}}var M=[],Pe;function bo(e,t){if(!f.observer)return t();let n=Pe;Pe=e;try{return t()}finally{Pe=n}}function Le(e){let t=f.observer;t&&t.created(e.parents===void 0?{...e,parents:M,origin:e.origin??Pe}:e)}function go(e){return f.observer?(M.push(e),!0):!1}function vo(){M.pop()}function wo(e){f.observer?.ran?.(e)}function xo(e,t){f.observer?.wrote?.(e,t)}function Fn(e){let t=f.observer;!t?.props||!M.length||!e||t.props(M[M.length-1],e)}function So(e){f.observer?.contextCreated?.(e)}function ft(e,t,n){let r=f.observer;!r?.context||!M.length||r.context(M[M.length-1],e,t,n)}function En(e,t,n){f.observer?.moved?.(e,t,n)}function he(e){f.observer?.disposed?.(e)}var Eo="__FLUIXI_DEVTOOLS_HOOK__",Tn=globalThis[Eo];if(typeof Tn?.inject=="function")try{Tn.inject({observeReactiveNodes:mo,version:yt})}catch{}function qe(){return f.observer!=null}var An=0,_n=1,pe=2,Hn=class{constructor(){this.observers=null,this.watchers=null,this.version=0}updateIfNecessary(){}track(){if(f.untracked)return;let e=f.consumer;e&&((this.observers??=new Set).add(e),(e.sources??=new Set).add(this))}},To=class extends Hn{constructor(e,t){super(),this._value=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){return this.track(),this._value}set(e){if(!this._equals(this._value,e)){if(this._value=e,this.version++,xo(this,f.consumer),this.observers)for(let t of[...this.observers])t.markDirty(pe);lt(this)}}peek(){return this._value}},Un=class extends Hn{constructor(e,t){super(),this._threw=!1,this._initialized=!1,this.state=pe,this.sources=null,this._fn=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){if(f.consumer===this)throw new Error("Signal.Computed cannot read itself");if(this.track(),this.updateIfNecessary(),this._threw)throw this._error;return this._value}updateIfNecessary(){if(this.state===_n&&this.sources){for(let e of this.sources)if(e.updateIfNecessary(),this.state===pe)break}(this.state===pe||!this._initialized)&&this.recompute(),this.state=An}recompute(){if(this.sources){for(let u of this.sources)u.observers?.delete(this);this.sources.clear()}let e=f.consumer,t=f.untracked,n=go(this);f.consumer=this,f.untracked=!1;let r,o=!1,s;try{r=this._fn()}catch(u){o=!0,s=u,r=this._value}finally{f.consumer=e,f.untracked=t,n&&vo()}let c=!this._initialized||this._threw!==o||(o?s!==this._error:!this._equals(this._value,r));if(this._initialized=!0,this._threw=o,this._error=s,this._value=r,wo(this),c){if(this.version++,this.observers)for(let u of[...this.observers])u.markDirty(pe);lt(this)}}markDirty(e){if(this.state>=e)return;let t=this.state===An;if(this.state=e,t){if(this.observers)for(let n of[...this.observers])n.markDirty(_n);lt(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};function lt(e){if(e.watchers)for(let t of[...e.watchers])t._notify(e)}var Ao=class{constructor(e){this._watched=new Set,this._pending=new Set,this._notifyFn=e}watch(...e){for(let t of e)this._watched.add(t),(t.watchers??=new Set).add(this)}unwatch(...e){for(let t of e)this._watched.delete(t),t.watchers?.delete(this),this._pending.delete(t)}getPending(){let e=[...this._pending];return this._pending.clear(),e}_notify(e){if(!this._watched.has(e)||this._pending.has(e))return;let t=this._pending.size===0;this._pending.add(e),t&&this._notifyFn()}};function _o(e){if(f.untracked)return e();f.untracked=!0;try{return e()}finally{f.untracked=!1}}function mt(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function Ve(e,t){let n=Symbol(t??"context");return So(n),{id:n,defaultValue:e,Provider:o=>{ft(n,"provide",o.value);let s=f.owner,c=mt(s);(c.contexts=new Map).set(n,o.value),s&&(s.owned??=[]).push(c),f.owner=c;try{return o.children}finally{f.owner=s}}}}function Wn(e){let t=f.owner;for(;t;){if(t.contexts&&t.contexts.has(e.id)){let n=t.contexts.get(e.id);return ft(e.id,"read",n),n}t=t.parent}return ft(e.id,"read",e.defaultValue),e.defaultValue}function Kn(e,t){let n=e;for(;n;){if(n.contexts&&n.contexts.has(t.id))return n.contexts.get(t.id);n=n.parent}return t.defaultValue}function No(e){f.onSuspend=e}function Ro(e){return f.onSuspend?(f.onSuspend(e,f.owner),!0):!1}function Po(e){f.onError=e}function ko(){return f.owner}function Bn(e,t){let n=f.owner;f.owner=e;try{return t()}finally{f.owner=n}}function me(e){if(f.owner){if(f.owner.disposed){e();return}(f.owner.cleanups??=[]).push(e)}}function Oe(e,t=!0){if(!e.disposed){if(e.owned){for(let n=e.owned.length-1;n>=0;n--)Oe(e.owned[n]);e.owned=null}if(e.cleanups){for(let n=e.cleanups.length-1;n>=0;n--)e.cleanups[n]();e.cleanups=null}t&&(e.disposed=!0)}}function zn(e){let t=mt(f.owner);f.owner&&(f.owner.owned??=[]).push(t);let n=f.owner;f.owner=t;try{return e(()=>Oe(t))}finally{f.owner=n}}function Co(e){f.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function Oo(e){e.queued||(e.queued=!0,f.queue.push(e),!f.scheduled&&f.batchDepth===0&&(f.scheduled=!0,f.hostSchedule(bt)))}function bt(){if(f.scheduled=!1,f.flushing)return;f.flushing=!0;let e=0;try{for(;f.queue.length;){if(++e>1e5)throw new Error("[fluixi] effect flush did not settle (cycle?)");let t=f.queue;f.queue=[];for(let n of t)n.queued=!1,n.disposed||n.run()}}finally{f.flushing=!1}}function Mo(){f.batchDepth===0&&bt()}function Io(e){f.batchDepth++;try{return e()}finally{--f.batchDepth===0&&bt()}}var Do=class{constructor(e,t=!1){this.queued=!1,this.disposed=!1,this.owner=mt(f.owner),f.owner&&(f.owner.cleanups??=[]).push(()=>this.dispose()),this.computed=new Un(()=>{Oe(this.owner,!1),Bn(this.owner,()=>{let n=e();typeof n=="function"&&(this.owner.cleanups??=[]).push(n)})}),Le({kind:"effect",node:this.computed,handle:this,internal:!t}),this.watcher=new Ao(()=>Oo(this)),this.run(),this.watcher.watch(this.computed)}run(){if(!this.disposed){this.watcher.getPending();try{this.computed.get()}catch(e){if(e&&typeof e.then=="function"&&f.onSuspend){f.onSuspend(e,this.owner);return}if(f.onError&&f.onError(e,this.owner))return;throw e}}}dispose(){this.disposed||(this.disposed=!0,he(this.computed),this.watcher.unwatch(this.computed),Oe(this.owner))}};function gt(e,t=!1){let n=new Do(e,t);return()=>n.dispose()}function jo(e){return!!e&&typeof e.then=="function"}Co(()=>{});var Gn=Symbol.for("signal"),$o=Symbol.for("memo"),Lo=Symbol.for("signal-node");function F(e,t){let n=new To(e,{equals:t?.equals}),r=(()=>n.get()),o=(s=>{let c=typeof s=="function"?s(n.peek()):s;return n.set(c),Mo(),c});return Object.defineProperty(r,Gn,{value:!0,enumerable:!0}),Object.defineProperty(r,Lo,{value:{get value(){return n.peek()},get version(){return n.version}},enumerable:!1}),Le({kind:"signal",node:n,handle:r,name:t?.name,set:o}),qe()&&me(()=>he(n)),[r,o]}function vt(e,t,n){let r=t,o=ko(),s=new Un(()=>Bn(o,()=>{try{return r=e(r)}catch(u){if(jo(u))return Ro(u),r;throw u}}),{equals:n?.equals}),c=(()=>s.get());return Object.defineProperty(c,Gn,{value:!0,enumerable:!0}),Object.defineProperty(c,$o,{value:!0,enumerable:!0}),Le({kind:"memo",node:s,handle:c,name:n?.name}),qe()&&me(()=>he(s)),c}function Fe(e,t){let n=t;return gt(()=>{n=e(n)},!0)}function Xn(e,t){let n=t;gt(()=>{n=e(n)})}function Yn(e,t){let n=t;return gt(()=>{n=e(n)})}function V(e){return Io(e)}function ne(e){return _o(e)}var Hi=typeof window>"u"?!1:window.__FLUIXI_PROD__===!0;var qo=Symbol.for("signal");function Jn(e){return typeof e=="function"&&e[qo]===!0}var Nn=null;function Vo(e){Nn&&Nn(e)}var Rn=null;function Fo(e){return Rn?Rn(e):void 0}var Pn=null;function Ho(){return Pn?Pn():void 0}var kn=null;function Uo(e,t){kn&&kn(e,t)}function Wo(e){return!!e&&typeof e.then=="function"}var ct=Symbol();function Zn(e,t,n={}){let r,o;typeof t=="function"?(r=typeof e=="function"?e:()=>e,o=t):(r=()=>!0,o=e,t&&typeof t=="object"&&(n=t));let s=n.transport===!1?void 0:Ho(),c=s!==void 0?Fo(s):void 0,u=c!==void 0,[i,a]=F(c!==void 0?c.value:n.initialValue,{equals:!1}),[p,d]=F(void 0,{equals:!1}),[y,b]=F(c!==void 0||n.initialValue!==void 0?"ready":"unresolved",{equals:!1}),[S,g]=F(void 0,{equals:!1}),[X,oe]=F(void 0,{equals:!1}),U=ct,ie=!1;Fe(()=>{let v=r();if(X(),v===!1||v===null||v===void 0){U=ct,V(()=>{b("unresolved"),g(void 0),d(void 0)});return}let D=ie;if(ie=!1,U!==ct&&v===U&&!D)return;if(U=v,u){u=!1;return}let ge=!1;me(()=>ge=!0);let It=ne(y),yr=ne(i),Dt=It==="ready"||It==="refreshing";V(()=>{b(Dt?"refreshing":"pending"),d(void 0)});try{let W=o(v,{value:yr,refetching:Dt});Wo(W)?(g(W),Vo(W),W.then(ve=>{ge||(s!==void 0&&Uo(s,ve),V(()=>{a(()=>ve),b("ready"),g(void 0)}))},ve=>{ge||V(()=>{d(ve),b("errored"),g(void 0)})})):V(()=>{a(()=>W),b("ready"),g(void 0)})}catch(W){if(ge)return;V(()=>{d(W),b("errored"),g(void 0)})}});let be=()=>{let v=y();return v==="pending"||v==="refreshing"},Y=(()=>{let v=p();if(v)throw v;if(be()){let D=S();if(D)throw D}return i()});return Object.defineProperties(Y,{state:{get:y},loading:{get:be},error:{get:p},latest:{get:i}}),Object.defineProperty(Y,Symbol.for("resource"),{value:!0,enumerable:!0}),Object.defineProperty(Y,Symbol.for("signal"),{value:!0,enumerable:!0}),[Y,{mutate:a,refetch:()=>{ie=!0,oe(void 0)}}]}var Ko=Ve();No((e,t)=>{let n=Kn(t,Ko);n&&(n.increment(),e.finally(()=>n.decrement()))});var Bo=Ve();Po((e,t)=>{let n=Kn(t,Bo);return n?(n.setError(e),!0):!1});function Qn(e,t){let[n,r]=F(e,t);return Object.assign(n,{set:r})}function er(e,t,n){return vt(e,t,n)}function tr(e,t){return Fe(e,t)}var Me=Symbol("store-raw"),Cn=Symbol("store-node"),On=Symbol("store-has"),Mn=Symbol("store-self"),In=Symbol("store-track");var ye=new WeakMap,dt=new WeakMap,re=new WeakMap,Ie=new WeakMap;function zo(e,t){if(!te(e)||!qe())return;let n=new Set,r=c=>{if(!(!te(c)||n.has(c))){n.add(c);for(let u of Object.values(c))r(u)}};r(Ie.get(t)??t);let o=new Set,s=c=>{if(!te(c))return;let u=c;if(n.has(u)||o.has(u))return;o.add(u);let i=ye.get(u);if(i){for(let a of i.keys.values())he(a);i.all&&he(i.all),ye.delete(u),re.delete(u),dt.delete(u)}for(let a of Object.values(u))s(a)};s(e)}var De=(e,t,n)=>n?`${e}[${String(t)}]`:`${e}.${String(t)}`;function nr(e,t,n){let r=t?.owner,o=r&&n!==void 0?De(r.name,n,t?.array):void 0,[s,c]=bo(r?.store,()=>$(e,o?{name:o}:void 0)),u=s;return u.$=c,u}function je(e){let t=ye.get(e);return t?t.owner||(t.owner=re.get(e)):ye.set(e,t={keys:new Map,owner:re.get(e),array:Array.isArray(e)}),t}function Dn(e,t,n){let r=e.keys.get(t);return r||e.keys.set(t,r=nr(n,e,t)),r}function Go(e,t,n,r){let o=re.get(e);if(o&&o.store===t&&o.name===n)return;let s={store:t,name:n};re.set(e,s),Ie.set(e,Ie.get(r)??r);let c=ye.get(e);if(c&&(c.owner=s,!!qe())){for(let[u,i]of c.keys)En(i,t,De(n,u,c.array));c.all&&En(c.all,t,De(n,"*",c.array))}}function jn(e){let t=je(e);(t.all||(t.all=nr(void 0,t,"*")))()}function $n(e,t){e.$(typeof t=="function"?()=>t:t)}function te(e){if(e==null||typeof e!="object")return!1;if(Array.isArray(e))return!0;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function ke(e){if(!te(e))return e;let t=dt.get(e);if(t)return t;let n=new Proxy(e,Xo);return dt.set(e,n),n}var Xo={get(e,t,n){if(t===Me||t===Cn)return e;if(t===Ze)return n;if(t===On)return i=>i in e;if(t==="__proxy")return!0;if(t===In||t===Mn)return jn(e),n;let r=e[t];if(typeof r=="function"&&!Object.prototype.hasOwnProperty.call(e,t))return r;let o=Object.getOwnPropertyDescriptor(e,t);if(o&&o.get)return o.get.call(n);let s=je(e),c=Dn(s,t,r),u=c();return te(u)?(s.owner&&Go(u,c,De(s.owner.name,t,s.array),e),ke(u)):u},set(){return!0},deleteProperty(e,t){return t in e&&I(e,t,void 0),!0},has(e,t){return t===Me||t===Ze||t===Cn||t===On||t===Mn||t===In?!0:(Dn(je(e),t,e[t])(),t in e)},ownKeys(e){return jn(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e,t)}};function rr(e,t=new Set){if(e==null||typeof e!="object")return e;let n=e[Me]??e;if(t.has(n)||!te(n))return n;t.add(n);let r=!1,o=c=>{let u=rr(c,t);return u!==c&&(r=!0),u};if(Array.isArray(n)){let c=n.map(o);return r?c:n}let s={};for(let c of Object.keys(n))s[c]=o(n[c]);return r?s:n}function I(e,t,n){let r=rr(n),o=e[t];if(o===r&&(r!==void 0||t in e))return;let s=Array.isArray(e),c=s?e.length:0;r===void 0?delete e[t]:e[t]=r;let u=je(e),i=u.keys.get(t);if(i&&$n(i,r),zo(o,e),s&&e.length!==c){let a=u.keys.get("length");a&&$n(a,e.length)}u.all&&u.all.$(void 0)}function Ln(e,t){return typeof e=="function"?e(t):e}function pt(e,t){for(let n of Object.keys(t)){let r=t[n],o=e[n];r&&typeof r=="object"&&!Array.isArray(r)&&o&&typeof o=="object"&&!Array.isArray(o)?pt(o,r):I(e,n,r)}}function wt(e){let t=[],n=e.replace(/\[([^\]]*)\]/g,".$1");for(let r of n.split("."))r.length&&t.push(r);return t}function or(e,t,n){let r=t.length-1;for(let s=0;s<r;s++){let c=t[s];if(c==="*"){let i=t.slice(s+1);if(Array.isArray(e))for(let a=0;a<e.length;a++)or(e[a],i,n);return}let u=e[c];(u==null||typeof u!="object")&&(u=/^\d+$/.test(t[s+1])?[]:{},I(e,c,u)),e=u}let o=t[r];if(o==="*"){if(Array.isArray(e))for(let s=0;s<e.length;s++)I(e,s,Ln(n,e[s]));return}I(e,o,Ln(n,e[o]))}function ut(e,t,n){or(e,wt(t),n)}function Yo(e){return Array.isArray(e)&&e.length>0&&e.every(t=>Array.isArray(t)&&t.length>=2&&typeof t[0]=="string")}function Ce(e,t){for(let n=e.length-1;n>=t.length;n--)I(e,String(n),void 0);e.length!==t.length&&I(e,"length",t.length);for(let n=0;n<t.length;n++)I(e,String(n),t[n])}function Jo(e,t){let n=t[0];if(typeof n=="function"&&t.length===1){let r=n(e);r&&r!==e&&pt(e,r);return}if(Array.isArray(n)&&t.length===1){if(Yo(n)){for(let r of n)ut(e,r[0],r[1]);return}if(Array.isArray(e)){Ce(e,n);return}if(n.length===0)return;throw new TypeError("[fluixi] set() was given an array that is neither a batch of [path, value] pairs nor a replacement for an array root. Name the path you meant, as in set('items', [...]).")}if(n&&typeof n=="object"&&!Array.isArray(n)&&t.length===1){pt(e,n);return}if(Array.isArray(t[1])&&t.length>=3){ut(e,`${n}.${t[1].join(".")}`,t[2]);return}ut(e,String(n),t[1])}function ht(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(ht);let t={};for(let n of Object.keys(e))t[n]=ht(e[n]);return t}function q(e,t){let n=e;for(let r of wt(t)){if(n==null)return;n=n[r]}return n}var ir=class{constructor(e,t={immutable:!0}){this.options=t,this.root=e,this.set=((...n)=>ue(()=>Jo(this.root,n))),e&&typeof e=="object"&&(re.set(e,{store:this,name:t.name??"store"}),Ie.set(e,e)),Le({kind:"store",node:this,handle:()=>this.root,name:t.name})}get state(){return ke(this.root)}get proxy(){return ke(this.root)}get accessor(){return(()=>ke(this.root))}unwrap(){return this.root}getNode(e){return this.root&&this.root[e]}get(e){if(e==null||e==="")return $e(this.state);let t=this.state;for(let n of wt(e)){if(t==null)return;t=t[n]}return $e(t)}select(e){return m(()=>e(this.state))}subscribe(e){return Se(()=>e(this.state))}watch(e,t){let n;return Se(()=>{let r=e(this.state);Object.is(r,n)||(t(r,n),n=r)})}reactive(e){return m(()=>this.state[e])}produce(e){this.set((t=>{let n=ht(t);return e(n),n}))}reconcile(e,t={}){this.set(e)}push(e,...t){let n=q(this.root,e);this.set(e,n.concat(t))}pop(e){let t=q(this.root,e).slice(),n=t.pop();return this.set(e,t),n}shift(e){let t=q(this.root,e).slice(),n=t.shift();return this.set(e,t),n}splice(e,t,n,...r){let o=q(this.root,e).slice(),s=o.splice(t,n,...r);return this.set(e,o),s}insert(e,t,n){let r=q(this.root,e).slice();r.splice(t,0,n),this.set(e,r)}removeAt(e,t){let n=q(this.root,e).slice(),r=n.splice(t,1);return this.set(e,n),r}replace(e,t){if(arguments.length>=2){let r=q(this.root,String(e)),o=t;if(Array.isArray(r)&&Array.isArray(o)){Ce(r,o);return}this.set(e,o);return}let n=this.root;if(Array.isArray(n)&&Array.isArray(e)){Ce(n,e);return}this.set(e)}clear(e){let t=e===void 0?this.root:q(this.root,e);if(Array.isArray(t)){Ce(t,[]);return}if(t&&typeof t=="object")for(let n of Object.keys(t))I(t,n,void 0)}toObservable(){let[e]=$(this.state);return e.toObservable()}dispose(){}},Zo=["get","select","watch","subscribe","produce","reconcile","push","pop","shift","splice","insert","removeAt","replace","clear","unwrap","toObservable"];function Qo(e,t){for(let n of Zo)e[n]=t[n].bind(t);e.$=t.reactive.bind(t)}function sr(e,t={immutable:!0}){let n=new ir(e,t);return Qo(n.set,n),[n.proxy,n.set]}function ei(e,t={}){return new ir(e,{...t,immutable:!1})}function $e(e){if(e==null||typeof e!="object")return e;let t=e[Me];return t!==void 0?t:e}function ti(e){return _(()=>$e(e))}var Wi=Object.freeze({createStore:sr,createMutableStore:ei,batch:ue,unwrap:$e,untrackStore:ti});function cr(e,t){let[n,r]=sr(e,t);return new Proxy(n,{get:(o,s)=>s==="set"?r:o[s],has:(o,s)=>s==="set"||Reflect.has(o,s)})}var ni="__fx_dom_create_component__",ur=globalThis[ni]??={fn:null};function ar(e,t){if(ur.fn)return ur.fn(e,t);t&&Fn(t);let n=typeof e=="function"?ne(()=>e(t)):e,r=n!=null&&(typeof n=="function"||typeof n=="object");if(r)try{n.$name=e?.name}catch{}return r&&!Jn(n)?sn(n):n}var ri="__FX_DATA__";var xt;function fr(){let e=globalThis.__FX_DATA__;if(e)return e;if(xt!==void 0)return xt;let t=null;if(typeof document<"u"){let n=document.getElementById(ri)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return xt=t}function He(){for(;;){for(;h.cursor&&h.cursor.nodeType===3&&h.cursor.data==="";)h.cursor=h.cursor.nextSibling;if(h.cursor!=null||!h.parents.length)return;h.cursor=h.parents.pop().nextSibling}}var oi=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ue=typeof process<"u"&&process.env&&!1;function We(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 ii(e){He();let t=h.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(oi.has(e.toLowerCase())?h.cursor=t.nextSibling:(h.parents.push(t),h.cursor=t.firstChild),t):(Ue&&t&&We(`<${e}>`,t),null)}function si(e){He();let t=h.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(h.cursor=t.nextSibling,t):(Ue&&t&&We(`<${e}> (static)`,t),null)}function ci(e){if(e===""){let n=h.cursor;return n&&n.nodeType===3&&n.data!==""?(h.cursor=n.nextSibling,n.data="",n):null}He();let t=h.cursor;return t&&t.nodeType===3?(h.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(Ue&&t&&We(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function ui(e){He();let t=h.cursor;return t&&t.nodeType===8&&t.data===e?(h.cursor=t.nextSibling,t):(Ue&&t&&We(`marker <!--${e.slice(0,24)}-->`,t),null)}var lr=!1;function ai(){lr||(lr=!0,ln({hydrateElement:ii,hydrateText:ci,hydrateMarker:ui,hydrateStatic:si}))}function St(e,t,n){ai(),h.active=!0,h.cursor=t.firstChild,h.parents=[];let r=fr(),o=n?.resourceNamespace,s=0;en(()=>o?`${o}:r${s++}`:`r${s++}`),Qt(r?c=>c in r?{value:r[c]}:void 0:null);try{return Re(e,t)}finally{h.active=!1,h.cursor=null,h.parents=[]}}function dr(e){return typeof e=="function"?e:(()=>e)}function H(e){return()=>{let t=e();return typeof t=="function"?t():t}}function pr(e){return e!=null&&e!==!1}function hr(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function Et(e){let t=H(()=>e.when),n=m(t,void 0,{name:"Show.when"}),r=m(n,void 0,{name:"Show.cond"}),o=K(),s=null,c=null,u=i=>{i!==c&&(s&&Z(s),s=J(o),c=i)};return m(()=>{let i=r();return u(i?"when":"fallback"),P(s,()=>{if(i){let a=e.children;return typeof a=="function"&&!hr(a)?typeof n=="function"?_(()=>_(n)?a(n()):e.fallback):a(n):a}return e.fallback});return e.fallback??null},void 0,{name:"Show.result"})}function Tt(e){let t=H(()=>e.each),n=()=>e.fallback??null,r=(o,s)=>{let c=e.children,u=Array.isArray(c)?c.map(i=>typeof i=="function"?i(o,s):i):typeof c=="function"?c(o,s):c;return Te(u),u};return e.by?fe(t,e.by,(o,s)=>r(o,s),{fallback:n}):ae(t,(o,s)=>r(o,s),{fallback:n})}function At(e){let t=H(()=>e.each);return le(t,(n,r)=>{let o=e.children(n,r);return Te(o),o},{fallback:()=>e.fallback??null})}var _t=Symbol("match");function Nt(e){return{[_t]:!0,when:H(()=>e.when),get children(){return e.children}}}function Rt(e){let t=Array.isArray(e.children)?e.children:[e.children],n=K(),r=null,o=-1,s=c=>{c!==o&&(r&&Z(r),r=J(n),o=c)};return m(()=>{for(let c=0;c<t.length;c+=1){let i=t[c],a=0;for(;typeof i=="function"&&!i[_t]&&a++<10;)i=i();if(!i||typeof i!="object"||i[_t]!==!0)continue;let p=i.when();if(pr(p))return s(c),P(r,()=>typeof i.children=="function"?i.children(p):i.children)}return s(-2),P(r,()=>e.fallback??null)},void 0,{name:"Switch"})}function Pt(e){let t=dr(e.component),{component:n,...r}=e,o=K(),s=null,c;return m(()=>{let u=t();return u!==c&&(s&&Z(s),s=J(o),c=u),u==null?null:typeof u=="string"?{tag:u,props:r}:P(s,()=>u(r))},void 0,{name:"Dynamic"})}function kt(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return B(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),ee(r,e.children)&&st(e.ref,r)}),k(()=>{n(),r.remove()}),null}function Ct(e){let[t,n]=$(null),r=()=>n(null);return m(()=>{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(s){return n(s),typeof e.fallback=="function"?e.fallback(s,r):e.fallback}},void 0,{name:"ErrorBoundary"})}function Ot(e){return m(()=>{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(" ")},void 0,{name:"ClassMap"})}function fi(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Mt(e){return m(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;let s=typeof o=="function"?o():o;s!=null&&n.push(`${fi(r)}: ${s}`)}return n.join("; ")},void 0,{name:"StyleMap"})}return xr(li);})();
|
package/dist/cdn/dom-client.js
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Same shape as `dom.global.js` and the same global name, minus the string renderer,
|
|
9
9
|
* node serialisation, template parsing and the request context. A `<script>` tag
|
|
10
|
-
* cannot tree-shake, so anything reachable from the entry ships
|
|
10
|
+
* cannot tree-shake, so anything reachable from the entry ships, which makes the
|
|
11
11
|
* server half pure weight for a page that renders in a browser. Measured against the
|
|
12
|
-
* full build: 21.0 kB gzipped
|
|
12
|
+
* full build: 21.0 kB gzipped -> 12.2 kB.
|
|
13
13
|
*
|
|
14
14
|
* `hydrate` stays: a page hydrating server-rendered HTML runs in the browser, and it
|
|
15
15
|
* is the one thing here that touches SSR output. Use `dom.global.js` if you actually
|
|
@@ -27,5 +27,5 @@ Show, For, Index, Switch, Match, Portal, Dynamic, ErrorBoundary,
|
|
|
27
27
|
// lists
|
|
28
28
|
mapArray, indexArray, keyArray, } from '../lib/index.js';
|
|
29
29
|
export {
|
|
30
|
-
// reactive primitives
|
|
30
|
+
// reactive primitives, the short API and the tuple form, as the full entry does
|
|
31
31
|
signal, memo, effect, store, createSignal, createMemo, createEffect, createComputed, createRenderEffect, createRoot, createResource, createContext, useContext, onCleanup, batch, untrack, } from '@fluixi/reactive';
|