@fluixi/core 1.0.0-alpha.97 → 1.0.0-alpha.99
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/core.global.js +2 -2
- package/dist/src/cdn/core.cjs +1 -1
- package/dist/src/cdn/core.mjs +1 -1
- package/dist/src/index.cjs +2 -2
- package/dist/src/index.mjs +2 -2
- package/dist/src/lib/client/{chunk-KYWKPX6I.mjs → chunk-EW4WTB66.mjs} +1 -1
- package/dist/src/lib/client/index.cjs +2 -2
- package/dist/src/lib/client/index.mjs +4 -4
- package/dist/src/lib/client/{router-EHDYEGDF.mjs → router-WU7QUZBN.mjs} +2 -2
- package/dist/src/lib/core.cjs +1 -1
- package/dist/src/lib/core.mjs +1 -1
- package/dist/src/lib/i18n/index.cjs +1 -1
- package/dist/src/lib/i18n/index.mjs +1 -1
- package/dist/src/lib/index.cjs +1 -1
- package/dist/src/lib/index.mjs +1 -1
- package/dist/src/lib/jsx-runtime/index.cjs +1 -1
- package/dist/src/lib/jsx-runtime/index.mjs +1 -1
- package/dist/src/lib/jsx-runtime/jsx-dev-runtime.cjs +1 -1
- package/dist/src/lib/jsx-runtime/jsx-dev-runtime.mjs +1 -1
- package/dist/src/lib/plugins/index.cjs +1 -1
- package/dist/src/lib/plugins/index.mjs +1 -1
- package/dist/src/lib/render/index.cjs +1 -1
- package/dist/src/lib/render/index.mjs +1 -1
- package/dist/src/lib/render/versions.cjs +1 -1
- package/dist/src/lib/render/versions.mjs +1 -1
- package/dist/src/lib/router/index.cjs +1 -1
- package/dist/src/lib/router/index.mjs +1 -1
- package/dist/src/lib/server/index.cjs +1 -1
- package/dist/src/lib/server/index.mjs +1 -1
- package/dist/src/lib/storage/index.cjs +1 -1
- package/dist/src/lib/storage/index.mjs +1 -1
- package/dist/src/routes.cjs +1 -1
- package/dist/src/routes.mjs +1 -1
- package/dist/src/utils.cjs +1 -1
- package/dist/src/utils.mjs +1 -1
- package/dist/src/version.generated.cjs +1 -1
- package/dist/src/version.generated.d.ts +1 -1
- package/dist/src/version.generated.js +1 -1
- package/dist/src/version.generated.mjs +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +20 -13
package/dist/cdn/core.global.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! @fluixi/core v1.0.0-alpha.
|
|
2
|
-
"use strict";var Fluixi=(()=>{var ar=Object.defineProperty;var Aa=Object.getOwnPropertyDescriptor;var xa=Object.getOwnPropertyNames;var ka=Object.prototype.hasOwnProperty;var F=(e,t)=>()=>(e&&(t=e(e=0)),t);var jn=(e,t)=>{for(var r in t)ar(e,r,{get:t[r],enumerable:!0})},_a=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of xa(t))!ka.call(e,o)&&o!==r&&ar(e,o,{get:()=>t[o],enumerable:!(n=Aa(t,o))||n.enumerable});return e};var Oa=e=>_a(ar({},"__esModule",{value:!0}),e);function eo(){return{consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:Ea,onSuspend:null,onError:null,observer:null}}function Ta(e){let t=eo(),r=e;for(let n of Object.keys(t))n in e||(r[n]=t[n]);return e}function Ra(){let e=it[Fn];return e?Ta(e):it[Fn]=eo()}function to(){return[...new Set(it[Qn]??[])]}function Ca(e){return m.observer=e,()=>{m.observer===e&&(m.observer=null)}}function yr(e){let t=m.observer;t&&t.created(e.parents===void 0?{...e,parents:X,origin:e.origin??Pa,scope:e.scope??Un}:{...e,scope:e.scope??Un})}function $a(e){return m.observer?(X.push(e),!0):!1}function Na(){X.pop()}function Ma(e){m.observer?.ran?.(e)}function La(e,t){m.observer?.wrote?.(e,t)}function Z(e,t,r,n){let o=m.observer;!o?.bound||!X.length||o.bound(X[X.length-1],e,t,r,n)}function Q(e,t,r,n){let o=m.observer;!o?.directive||!X.length||o.directive(X[X.length-1],e,t,r,n)}function Ia(e){m.observer?.contextCreated?.(e)}function ur(e,t,r){let n=m.observer;!n?.context||!X.length||n.context(X[X.length-1],e,t,r)}function hr(e){m.observer?.disposed?.(e)}function ro(){return m.observer!=null}function fr(e){if(e.watchers)for(let t of[...e.watchers])t._notify(e)}function io(e){if(m.untracked)return e();m.untracked=!0;try{return e()}finally{m.untracked=!1}}function ue(e){let t=Ve(e);return e&&(e.owned??=[]).push(t),t}function ke(e,t=!0){qe(e,t)}function so(e){return!!e&&e.disposed===!0}function Ve(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function ee(e,t){let r=Symbol(t??"context");return Ia(r),{id:r,defaultValue:e,Provider:o=>{ur(r,"provide",o.value);let a=m.owner,i=Ve(a);(i.contexts=new Map).set(r,o.value),a&&(a.owned??=[]).push(i),m.owner=i;try{return o.children}finally{m.owner=a}}}}function H(e){let t=m.owner;for(;t;){if(t.contexts&&t.contexts.has(e.id)){let r=t.contexts.get(e.id);return ur(e.id,"read",r),r}t=t.parent}return ur(e.id,"read",e.defaultValue),e.defaultValue}function ao(e,t){let r=e;for(;r;){if(r.contexts&&r.contexts.has(t.id))return r.contexts.get(t.id);r=r.parent}return t.defaultValue}function co(e,t,r){let n=Ve(m.owner);(n.contexts=new Map).set(e.id,t),m.owner&&(m.owner.owned??=[]).push(n);let o=m.owner;m.owner=n;try{return r()}finally{m.owner=o}}function Wa(e){m.onSuspend=e}function Ha(e){return m.onSuspend?(m.onSuspend(e,m.owner),!0):!1}function Ka(e){m.onError=e}function P(){return m.owner}function uo(e){let t=m.owner;return m.owner=e,t}function M(e,t){let r=m.owner;m.owner=e;try{return t()}finally{m.owner=r}}function S(e){if(m.owner){if(m.owner.disposed){e();return}(m.owner.cleanups??=[]).push(e)}}function qe(e,t=!0){if(!e.disposed){if(e.owned){for(let r=e.owned.length-1;r>=0;r--)qe(e.owned[r]);e.owned=null}if(e.cleanups){for(let r=e.cleanups.length-1;r>=0;r--)e.cleanups[r]();e.cleanups=null}t&&(e.disposed=!0)}}function W(e){let t=Ve(m.owner);m.owner&&(m.owner.owned??=[]).push(t);let r=m.owner;m.owner=t;try{return io(()=>e(()=>qe(t)))}finally{m.owner=r}}function ja(e){m.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function Fa(e){e.queued||(e.queued=!0,m.queue.push(e),!m.scheduled&&m.batchDepth===0&&(m.scheduled=!0,m.hostSchedule(at)))}function at(){if(m.scheduled=!1,m.flushing)return;m.flushing=!0;let e=0,t=!1,r;try{for(;m.queue.length;){if(++e>1e5)throw new Error("[fluixi] effect flush did not settle (cycle?)");let n=m.queue;m.queue=[];for(let o of n)if(o.queued=!1,!o.disposed)try{o.run()}catch(a){t||(t=!0,r=a)}}}finally{m.flushing=!1}if(t)throw r}function Ua(){m.batchDepth===0&&at()}function za(e){m.batchDepth++;try{return e()}finally{--m.batchDepth===0&&at()}}function mr(e,t=!1,r){let n=new Ba(e,t,r);return()=>n.dispose()}function Ja(e){return!!e&&typeof e.then=="function"}function b(e,t){let r=new qa(e,{equals:t?.equals}),n=(()=>r.get()),o=(a=>{let i=typeof a=="function"?a(r.peek()):a;return r.set(i),Ua(),i});return Object.defineProperty(n,fo,{value:!0,enumerable:!0}),Object.defineProperty(n,Xa,{value:{get value(){return r.peek()},get version(){return r.version}},enumerable:!1}),yr({kind:"signal",node:r,handle:n,name:t?.name,set:o}),ro()&&S(()=>hr(r)),[n,o]}function w(e,t,r){let n=t,o=P(),a=new oo(()=>M(o,()=>{try{return n=e(n)}catch(s){if(Ja(s))return Ha(s),n;throw s}}),{equals:r?.equals}),i=(()=>a.get());return Object.defineProperty(i,fo,{value:!0,enumerable:!0}),Object.defineProperty(i,Ya,{value:!0,enumerable:!0}),yr({kind:"memo",node:a,handle:i,name:r?.name}),ro()&&S(()=>hr(a)),i}function k(e,t,r){let n=t;return mr(()=>{n=e(n)},!0,r?.name)}function lo(e,t){let r=t;mr(()=>{r=e(r)})}function $(e,t){let r=t;return mr(()=>{r=e(r)})}function D(e){return za(e)}function A(e){return io(e)}function po(){return at(),Promise.resolve()}function yo(e,t,r){let n=[];return S(()=>{for(let o of n)o.dispose();n=[]}),w(()=>{let o=e()||[];return A(()=>{if(o.length===0){for(let u of n)u.dispose();return n=[],r?.fallback?r.fallback():[]}let a=new Map;for(let u of n)a.has(u.item)||a.set(u.item,u);let i=[],s=new Set;for(let u=0;u<o.length;u++){let c=o[u],f=a.get(c);if(f&&!s.has(f))f.setIndex(u),i.push(f),s.add(f);else{let l,d,h;W(p=>{h=p;let[v,_]=b(u,{name:"row index"});d=_,l=t(c,v)});let y={item:c,rendered:l,dispose:h,setIndex:d};i.push(y),s.add(y)}}for(let u of n)s.has(u)||u.dispose();return n=i,i.map(u=>u.rendered)})},void 0,{name:"mapArray"})}function ho(e,t,r,n){let o=[],a=[];return S(()=>{for(let i of a)i.dispose();o=[],a=[]}),w(()=>{let i=e()||[];return A(()=>{if(i.length===0){for(let l of a)l.dispose();return o=[],a=[],n?.fallback?n.fallback():[]}let s=new Map;for(let l=0;l<o.length;l++)s.set(o[l],a[l]);let u=[],c=[],f=new Set;for(let l=0;l<i.length;l++){let d=t(i[l]),h=s.get(d);if(h&&!f.has(d))h.setIndex(l),u.push(h);else{let y,p,v;W(_=>{v=_;let[O,Y]=b(l,{name:"row index"});p=Y;let T=w(E=>{let j=(e()||[])[O()];return j??E},i[l]);y=r(T,O)}),u.push({rendered:y,dispose:v,setIndex:p})}c.push(d),f.add(d)}for(let[l,d]of s)f.has(l)||d.dispose();return o=c,a=u,u.map(l=>l.rendered)})},void 0,{name:"keyArray"})}function mo(e,t,r){let n=[];return S(()=>{for(let o of n)o.dispose();n=[]}),w(()=>{let o=e()||[];return A(()=>{if(o.length===0){for(let u of n)u.dispose();return n=[],r?.fallback?r.fallback():[]}let a=n.length,i=o.length;for(let u=a;u<i;u++){let c,f,l,d=o[u];W(h=>{l=h;let[y,p]=b(d);f=p,c=t(y,u)}),n.push({rendered:c,setItem:f,dispose:l})}for(let u=i;u<a;u++)n[u].dispose();i<a&&(n=n.slice(0,i));let s=Math.min(a,i);for(let u=0;u<s;u++)n[u].setItem(o[u]);return n.map(u=>u.rendered)})},void 0,{name:"indexArray"})}function I(e){return typeof e=="function"&&e[Qa]===!0}function ec(e){Yn&&Yn(e)}function go(e){lr=e}function tc(e){return lr?lr(e):void 0}function vo(e){dr=e}function rc(){return dr?dr():void 0}function nc(e,t){Xn&&Xn(e,t)}function Gn(){let e=new Map,t=new Map;return{get:r=>e.get(r),set:(r,n)=>{e.set(r,n)},delete:r=>{e.delete(r)},keys:()=>e.keys(),clear:()=>{e.clear(),t.clear()},inflight:t}}function ct(){let e=oc?.();return e||(typeof window>"u"?Gn():ic??=Gn())}function wo(e,t=(r,n)=>r===n){let r=new Map;return k(()=>{let n=e();for(let[o,a]of r){let[i,s]=a,u=t(o,n);i()!==u&&s(u)}}),n=>{let o=r.get(n);if(!o){let[a,i]=b(!1);o=[a,i],r.set(n,o);let s=e();i(t(n,s))}return o[0]()}}function bo(e,t){let[r,n]=b(e(),t);return k(()=>{let o=e();t?.timeoutMs?setTimeout(()=>n(()=>o),t.timeoutMs):typeof requestIdleCallback=="function"?requestIdleCallback(()=>n(()=>o)):Promise.resolve().then(()=>n(()=>o))}),r}function So(e,t){let r,n=(...o)=>{r!==void 0&&clearTimeout(r),r=setTimeout(()=>{r=void 0,e(...o)},t)};return S(()=>{r!==void 0&&clearTimeout(r)}),n}function sc(e){return!!e&&typeof e.then=="function"}function fe(e,t,r={}){let n,o;typeof t=="function"?(n=typeof e=="function"?e:()=>e,o=t):(n=()=>!0,o=e,t&&typeof t=="object"&&(r=t));let a=r.transport===!1?void 0:rc(),i=a!==void 0?tc(a):void 0,s=i!==void 0,[u,c]=b(i!==void 0?i.value:r.initialValue,{equals:!1}),[f,l]=b(void 0,{equals:!1}),[d,h]=b(i!==void 0||r.initialValue!==void 0?"ready":"unresolved",{equals:!1}),[y,p]=b(void 0,{equals:!1}),[v,_]=b(void 0,{equals:!1}),O=cr,Y=!1;k(()=>{let C=n();if(v(),C===!1||C===null||C===void 0){O=cr,D(()=>{h("unresolved"),p(void 0),l(void 0)});return}let j=Y;if(Y=!1,O!==cr&&C===O&&!j)return;if(O=C,s){s=!1;return}let ne=!1;S(()=>ne=!0);let xe=A(d),Sa=A(u),Kn=xe==="ready"||xe==="refreshing";D(()=>{h(Kn?"refreshing":"pending"),l(void 0)});try{let me=o(C,{value:Sa,refetching:Kn});sc(me)?(p(me),ec(me),me.then(ot=>{ne||(a!==void 0&&nc(a,ot),D(()=>{c(()=>ot),h("ready"),p(void 0)}))},ot=>{ne||D(()=>{l(ot),h("errored"),p(void 0)})})):D(()=>{c(()=>me),h("ready"),p(void 0)})}catch(me){if(ne)return;D(()=>{l(me),h("errored"),p(void 0)})}});let T=()=>{let C=d();return C==="pending"||C==="refreshing"},E=(()=>{let C=f();if(C)throw C;if(T()){let j=y();if(j)throw j}return u()});return Object.defineProperties(E,{state:{get:d},loading:{get:T},error:{get:f},latest:{get:u}}),Object.defineProperty(E,Symbol.for("resource"),{value:!0,enumerable:!0}),Object.defineProperty(E,Symbol.for("signal"),{value:!0,enumerable:!0}),[E,{mutate:c,refetch:()=>{Y=!0,_(void 0)}}]}function st(e){if(typeof e=="function"&&!e.length){let t=e();return I(t)?t:st(t)}if(Array.isArray(e)){let t=[];for(let r=0;r<e.length;r++){let n=st(e[r]);Array.isArray(n)?t.push.apply(t,n):t.push(n)}return t}return e}function We(e){let t=w(e);return Za?w(()=>st(t()),void 0,{name:"children"}):w(()=>st(t()))}function xo(){let[e,t]=b(0),r=0;return{increment:()=>t(r+=1),decrement:()=>t(r-=1),inFallback:()=>e()>0}}function gr(e,t){return co(Ao,e,t)}function _o(){let[e,t]=b(void 0,{equals:!1});return{error:e,reset:()=>t(()=>{}),setError:n=>t(()=>n)}}function Oo(e,t){return co(ko,e,t)}var pr,Zn,Fn,Qn,Ea,it,m,X,Pa,Un,Da,zn,Bn,Jn,De,no,qa,oo,Va,Ba,fo,Ya,Xa,Ga,Za,Qa,Yn,lr,dr,Xn,oc,ic,cr,Ao,ko,_e,x=F(()=>{"use strict";pr="1.0.0-alpha.97",Zn=pr.split(".")[0],Fn=`__fluixi_signal_state_v${Zn}__`,Qn=`__fluixi_signal_builds_v${Zn}__`,Ea=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)};it=globalThis;m=Ra();(it[Qn]??=[]).push(pr);X=[];Da="__FLUIXI_DEVTOOLS_HOOK__",zn=globalThis[Da];if(typeof zn?.inject=="function")try{zn.inject({observeReactiveNodes:Ca,version:pr})}catch{}Bn=0,Jn=1,De=2,no=class{constructor(){this.observers=null,this.watchers=null,this.version=0}updateIfNecessary(){}track(){if(m.untracked)return;let e=m.consumer;e&&((this.observers??=new Set).add(e),(e.sources??=new Set).add(this))}},qa=class extends no{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++,La(this,m.consumer),this.observers)for(let t of[...this.observers])t.markDirty(De);fr(this)}}peek(){return this._value}},oo=class extends no{constructor(e,t){super(),this._threw=!1,this._initialized=!1,this.state=De,this.sources=null,this._fn=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){if(m.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===Jn&&this.sources){for(let e of this.sources)if(e.updateIfNecessary(),this.state===De)break}(this.state===De||!this._initialized)&&this.recompute(),this.state=Bn}recompute(){if(this.sources){for(let s of this.sources)s.observers?.delete(this);this.sources.clear()}let e=m.consumer,t=m.untracked,r=$a(this);m.consumer=this,m.untracked=!1;let n,o=!1,a;try{n=this._fn()}catch(s){o=!0,a=s,n=this._value}finally{m.consumer=e,m.untracked=t,r&&Na()}let i=!this._initialized||this._threw!==o||(o?a!==this._error:!this._equals(this._value,n));if(this._initialized=!0,this._threw=o,this._error=a,this._value=n,Ma(this),i){if(this.version++,this.observers)for(let s of[...this.observers])s.markDirty(De);fr(this)}}markDirty(e){if(this.state>=e)return;let t=this.state===Bn;if(this.state=e,t){if(this.observers)for(let r of[...this.observers])r.markDirty(Jn);fr(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};Va=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()}};Ba=class{constructor(e,t=!1,r){this.queued=!1,this.disposed=!1,this.owner=Ve(m.owner),m.owner&&(m.owner.cleanups??=[]).push(()=>this.dispose()),this.computed=new oo(()=>{qe(this.owner,!1),M(this.owner,()=>{let n=e();typeof n=="function"&&(this.owner.cleanups??=[]).push(n)})}),yr({kind:"effect",node:this.computed,handle:this,internal:!t,...r?{name:r}:{}}),this.watcher=new Va(()=>Fa(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"&&m.onSuspend){m.onSuspend(e,this.owner);return}if(m.onError&&m.onError(e,this.owner))return;throw e}}}dispose(){this.disposed||(this.disposed=!0,hr(this.computed),this.watcher.unwatch(this.computed),qe(this.owner))}};ja(()=>{});fo=Symbol.for("signal"),Ya=Symbol.for("memo"),Xa=Symbol.for("signal-node");Ga=typeof window>"u"?!1:window.__FLUIXI_PROD__===!0,Za=typeof process>"u"?Ga:!1,Qa=Symbol.for("signal");Yn=null;lr=null;dr=null;Xn=null;oc=null;cr=Symbol();Ao=ee();Wa((e,t)=>{let r=ao(t,Ao);r&&(r.increment(),e.finally(()=>r.decrement()))});ko=ee();Ka((e,t)=>{let r=ao(t,ko);return r?(r.setError(e),!0):!1});_e=Symbol.for("fluixi-proxy")});var ri,ni=F(()=>{"use strict";ri="1.0.0-alpha.97"});function vi(){return{consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:Xc,onSuspend:null,onError:null,observer:null}}function Gc(e){let t=vi(),r=e;for(let n of Object.keys(t))n in e||(r[n]=t[n]);return e}function Zc(){let e=Cr[oi];return e?Gc(e):Cr[oi]=vi()}function Qc(e){return L.observer=e,()=>{L.observer===e&&(L.observer=null)}}function eu(e,t){if(!L.observer)return t();let r=bt;bt=e;try{return t()}finally{bt=r}}function tu(e){let t=L.observer;t&&t.created(e.parents===void 0?{...e,parents:ge,origin:e.origin??bt,scope:e.scope??ii}:{...e,scope:e.scope??ii})}function wi(e){let t=L.observer;!t?.props||!ge.length||!e||t.props(ge[ge.length-1],e)}function ru(e){L.observer?.contextCreated?.(e)}function nu(e,t,r){let n=L.observer;!n?.context||!ge.length||n.context(ge[ge.length-1],e,t,r)}function si(e,t,r){L.observer?.moved?.(e,t,r)}function ai(e){L.observer?.disposed?.(e)}function bi(){return L.observer!=null}function iu(e){if(L.untracked)return e();L.untracked=!0;try{return e()}finally{L.untracked=!1}}function su(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function Si(e,t){let r=Symbol(t??"context");return ru(r),{id:r,defaultValue:e,Provider:o=>{nu(r,"provide",o.value);let a=L.owner,i=su(a);(i.contexts=new Map).set(r,o.value),a&&(a.owned??=[]).push(i),L.owner=i;try{return o.children}finally{L.owner=a}}}}function Ai(e,t){let r=e;for(;r;){if(r.contexts&&r.contexts.has(t.id))return r.contexts.get(t.id);r=r.parent}return t.defaultValue}function au(e){L.onSuspend=e}function cu(e){L.onError=e}function uu(e){L.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function xi(e){return iu(e)}function ki(e){return typeof e=="function"&&e[fu]===!0}function pu(e,t){if(!Te(e)||!bi())return;let r=new Set,n=i=>{if(!(!Te(i)||r.has(i))){r.add(i);for(let s of Object.values(i))n(s)}};n(kt.get(t)??t);let o=new Set,a=i=>{if(!Te(i))return;let s=i;if(r.has(s)||o.has(s))return;o.add(s);let u=Ke.get(s);if(u){for(let c of u.keys.values())ai(c);u.all&&ai(u.all),Ke.delete(s),Re.delete(s),Pr.delete(s)}for(let c of Object.values(s))a(c)};a(e)}function _i(e,t,r){let n=t?.owner,o=n&&r!==void 0?_t(n.name,r,t?.array):void 0,[a,i]=eu(n?.store,()=>b(e,o?{name:o}:void 0)),s=a;return s.$=i,s}function Ot(e){let t=Ke.get(e);return t?t.owner||(t.owner=Re.get(e)):Ke.set(e,t={keys:new Map,owner:Re.get(e),array:Array.isArray(e)}),t}function pi(e,t,r){let n=e.keys.get(t);return n||e.keys.set(t,n=_i(r,e,t)),n}function yu(e,t,r,n){let o=Re.get(e);if(o&&o.store===t&&o.name===r)return;let a={store:t,name:r};Re.set(e,a),kt.set(e,kt.get(n)??n);let i=Ke.get(e);if(i&&(i.owner=a,!!bi())){for(let[s,u]of i.keys)si(u,t,_t(r,s,i.array));i.all&&si(i.all,t,_t(r,"*",i.array))}}function yi(e){let t=Ot(e);(t.all||(t.all=_i(void 0,t,"*")))()}function hi(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 St(e){if(!Te(e))return e;let t=Pr.get(e);if(t)return t;let r=new Proxy(e,hu);return Pr.set(e,r),r}function Oi(e,t=new Set){if(e==null||typeof e!="object")return e;let r=e[xt]??e;if(t.has(r)||!Te(r))return r;t.add(r);let n=!1,o=i=>{let s=Oi(i,t);return s!==i&&(n=!0),s};if(Array.isArray(r)){let i=r.map(o);return n?i:r}let a={};for(let i of Object.keys(r))a[i]=o(r[i]);return n?a:r}function re(e,t,r){let n=Oi(r),o=e[t];if(o===n&&(n!==void 0||t in e))return;let a=Array.isArray(e),i=a?e.length:0;n===void 0?delete e[t]:e[t]=n;let s=Ot(e),u=s.keys.get(t);if(u&&hi(u,n),pu(o,e),a&&e.length!==i){let c=s.keys.get("length");c&&hi(c,e.length)}s.all&&s.all.$(void 0)}function $r(e,t){return typeof e=="function"?e(t):e}function Nr(e,t){for(let r of Object.keys(t)){let n=t[r],o=e[r];n&&typeof n=="object"&&!Array.isArray(n)&&o&&typeof o=="object"&&!Array.isArray(o)?Nr(o,n):re(e,r,n)}}function Tt(e){let t=[],r=e.replace(/\[([^\]]*)\]/g,".$1");for(let n of r.split("."))n.length&&t.push(n);return t}function Ei(e,t,r){let n=t.length-1;for(let a=0;a<n;a++){let i=t[a];if(i==="*"){let u=t.slice(a+1);if(Array.isArray(e))for(let c=0;c<e.length;c++)Ei(e[c],u,r);return}let s=e[i];(s==null||typeof s!="object")&&(s=/^\d+$/.test(t[a+1])?[]:{},re(e,i,s)),e=s}let o=t[n];if(o==="*"){if(Array.isArray(e))for(let a=0;a<e.length;a++)re(e,a,$r(r,e[a]));return}re(e,o,$r(r,e[o]))}function mi(e,t,r){Ei(e,Tt(t),r)}function mu(e){return Array.isArray(e)&&e.length>0&&e.every(t=>Array.isArray(t)&&t.length>=2&&typeof t[0]=="string")}function At(e,t){for(let r=e.length-1;r>=t.length;r--)re(e,String(r),void 0);e.length!==t.length&&re(e,"length",t.length);for(let r=0;r<t.length;r++)re(e,String(r),t[r])}function gu(e,t){let r=t[0];if(typeof r=="function"&&t.length===1){let n=r(e);n&&n!==e&&Nr(e,n);return}if(Array.isArray(r)&&t.length===1){if(mu(r)){for(let n of r)mi(e,n[0],n[1]);return}if(Array.isArray(e)){At(e,r);return}if(r.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(r&&typeof r=="object"&&!Array.isArray(r)&&t.length===1){Nr(e,r);return}if(t.length>=3){Mr(e,t.slice(0,-1),t[t.length-1]);return}mi(e,String(r),t[1])}function vu(e,t){if(typeof t=="function"){if(!Array.isArray(e))return[];let r=[];for(let n=0;n<e.length;n++)t(e[n],n)&&r.push(n);return r}if(Array.isArray(t))return Array.isArray(e)?t.map(Number):t.map(String);if(t&&typeof t=="object"&&("from"in t||"to"in t||"by"in t)){if(!Array.isArray(e))return[];let r=t.by??1,n=t.from??0,o=t.to??e.length-1,a=[];for(let i=n;i<=o;i+=r)i>=0&&i<e.length&&a.push(i);return a}return t==="*"?Array.isArray(e)?e.map((r,n)=>n):Object.keys(e??{}):[t]}function Mr(e,t,r){if(e==null)return;let[n,...o]=t;if(typeof n=="string"){let i=Tt(n);if(i.length>1){Mr(e,[...i,...o],r);return}}let a=vu(e,n);if(o.length===0){for(let i of a)re(e,i,$r(r,e[i]));return}for(let i of a){let s=e[i];if(s==null||typeof s!="object"){let u=o[0];s=typeof u=="number"||/^\d+$/.test(String(u))?[]:{},re(e,i,s)}Mr(s,o,r)}}function Lr(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(Lr);let t={};for(let r of Object.keys(e))t[r]=Lr(e[r]);return t}function pe(e,t){let r=e;for(let n of Tt(t)){if(r==null)return;r=r[n]}return r}function bu(e,t){for(let r of wu)e[r]=t[r].bind(t);e.$=t.reactive.bind(t)}function Su(e,t={immutable:!0}){let r=new Ti(e,t);return bu(r.set,r),[r.proxy,r.set]}function Au(e,t={}){return new Ti(e,{...t,immutable:!1})}function Et(e){if(e==null||typeof e!="object")return e;let t=e[xt];return t!==void 0?t:e}function xu(e){return A(()=>Et(e))}var Ir,gi,oi,Yc,Xc,Cr,L,ge,bt,ii,ou,ci,Jl,fu,lu,du,xt,ui,fi,li,di,Ke,Pr,Re,kt,_t,hu,Ti,wu,Xl,Ri=F(()=>{"use strict";x();Ir="1.0.0-alpha.97",gi=Ir.split(".")[0],oi=`__fluixi_signal_state_v${gi}__`,Yc=`__fluixi_signal_builds_v${gi}__`,Xc=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)};Cr=globalThis;L=Zc();(Cr[Yc]??=[]).push(Ir);ge=[];ou="__FLUIXI_DEVTOOLS_HOOK__",ci=globalThis[ou];if(typeof ci?.inject=="function")try{ci.inject({observeReactiveNodes:Qc,version:Ir})}catch{}uu(()=>{});Jl=typeof window>"u"?!1:window.__FLUIXI_PROD__===!0,fu=Symbol.for("signal");lu=Si();au((e,t)=>{let r=Ai(t,lu);r&&(r.increment(),e.finally(()=>r.decrement()))});du=Si();cu((e,t)=>{let r=Ai(t,du);return r?(r.setError(e),!0):!1});xt=Symbol("store-raw"),ui=Symbol("store-node"),fi=Symbol("store-has"),li=Symbol("store-self"),di=Symbol("store-track"),Ke=new WeakMap,Pr=new WeakMap,Re=new WeakMap,kt=new WeakMap;_t=(e,t,r)=>r?`${e}[${String(t)}]`:`${e}.${String(t)}`;hu={get(e,t,r){if(t===xt||t===ui)return e;if(t===_e)return r;if(t===fi)return u=>u in e;if(t==="__proxy")return!0;if(t===di||t===li)return yi(e),r;let n=e[t];if(typeof n=="function"&&!Object.prototype.hasOwnProperty.call(e,t))return n;let o=Object.getOwnPropertyDescriptor(e,t);if(o&&o.get)return o.get.call(r);let a=Ot(e),i=pi(a,t,n),s=i();return Te(s)?(a.owner&&yu(s,i,_t(a.owner.name,t,a.array),e),St(s)):s},set(){return!0},deleteProperty(e,t){return t in e&&re(e,t,void 0),!0},has(e,t){return t===xt||t===_e||t===ui||t===fi||t===li||t===di?!0:(pi(Ot(e),t,e[t])(),t in e)},ownKeys(e){return yi(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e,t)}};Ti=class{constructor(e,t={immutable:!0}){this.options=t,this.root=e,this.set=((...r)=>D(()=>gu(this.root,r))),e&&typeof e=="object"&&(Re.set(e,{store:this,name:t.name??"store"}),kt.set(e,e)),tu({kind:"store",node:this,handle:()=>this.root,name:t.name})}get state(){return St(this.root)}get proxy(){return St(this.root)}get accessor(){return(()=>St(this.root))}unwrap(){return this.root}getNode(e){return this.root&&this.root[e]}get(e){if(e==null||e==="")return Et(this.state);let t=this.state;for(let r of Tt(e)){if(t==null)return;t=t[r]}return Et(t)}select(e){return w(()=>e(this.state))}subscribe(e){return k(()=>e(this.state))}watch(e,t){let r;return k(()=>{let n=e(this.state);Object.is(n,r)||(t(n,r),r=n)})}reactive(e){return w(()=>this.state[e])}produce(e){this.set((t=>{let r=Lr(t);return e(r),r}))}reconcile(e,t={}){this.set(e)}push(e,...t){let r=pe(this.root,e);this.set(e,r.concat(t))}pop(e){let t=pe(this.root,e).slice(),r=t.pop();return this.set(e,t),r}shift(e){let t=pe(this.root,e).slice(),r=t.shift();return this.set(e,t),r}splice(e,t,r,...n){let o=pe(this.root,e).slice(),a=o.splice(t,r,...n);return this.set(e,o),a}insert(e,t,r){let n=pe(this.root,e).slice();n.splice(t,0,r),this.set(e,n)}removeAt(e,t){let r=pe(this.root,e).slice(),n=r.splice(t,1);return this.set(e,r),n}replace(e,t){if(arguments.length>=2){let n=pe(this.root,String(e)),o=t;if(Array.isArray(n)&&Array.isArray(o)){At(n,o);return}this.set(e,o);return}let r=this.root;if(Array.isArray(r)&&Array.isArray(e)){At(r,e);return}this.set(e)}clear(e){let t=e===void 0?this.root:pe(this.root,e);if(Array.isArray(t)){At(t,[]);return}if(t&&typeof t=="object")for(let r of Object.keys(t))re(t,r,void 0)}toObservable(){let[e]=b(this.state);return e.toObservable()}dispose(){}},wu=["get","select","watch","subscribe","produce","reconcile","push","pop","shift","splice","insert","removeAt","replace","clear","unwrap","toObservable"];Xl=Object.freeze({createStore:Su,createMutableStore:Au,batch:D,unwrap:Et,untrackStore:xu})});function V(){return Kr.server}function Gr(){if(!Kr.nodes)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return Kr.nodes}function Zr(e){return e!=null&&e[qt]===!0?!0:typeof Node<"u"&&e instanceof Node}function Ou(e){return e!=null&&e[qt]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Eu(e){return e!=null&&e[qt]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}function Tu(e){return e.localName.includes("-")}function Ci(e,t,r,n=!1){if(r==null){e.removeAttribute(t);return}if(Tu(e)){if(V()){jr(e,t,r);return}e[t]=r;return}N(e,t,r,n)}function jr(e,t,r){let n=e[Ru]??={};n[t]=r,r==null||r===!1?e.removeAttribute(t):r===!0?e.setAttribute(t,""):(typeof r=="string"||typeof r=="number")&&e.setAttribute(t,String(r))}function Dr(e){return Cu.has(e)||e.startsWith("aria-")||e.startsWith("data-")}function Hi(e,...t){e.classList.add(...t)}function Ki(e,...t){e.classList.remove(...t)}function ji(e,...t){t.forEach(r=>e.classList.toggle(r))}function N(e,t,r,n=!1){if(r==null||r===!1){e.removeAttribute(t);return}if(r===!0){e.setAttribute(t,"");return}if(typeof r=="object"){e.setAttribute(t,JSON.stringify(r));return}e.setAttribute(t,String(r))}function Fi(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Vt(e){return e instanceof Node}function Ui(e){z.core=e}function Wt(e){z.core&&e.setAttribute("fluixi",z.core),e.setAttribute("fx-dom",z.dom),e.setAttribute("fx-reactive",z.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=z)}function Ht(){let e=to();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=[z.core,z.dom,z.reactive].filter(r=>r!==void 0);new Set(t).size<=1||console.warn(`[fluixi] package versions disagree: core ${z.core??"(absent)"}, dom ${z.dom}, reactive ${z.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 zi(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function Be(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function Bi(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function $u(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function Nu(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function Mu(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function Lu(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function Iu(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function Du(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function se(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function qu(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function Ji(e){return $u(e)?{type:"router",value:e}:Mu(e)?{type:"route",value:e}:Nu(e)?{type:"routes",value:e}:Lu(e)?{type:"outlet",value:e}:se(e)?{type:"component",value:e}:qu(e)?{type:"suspense",value:e}:Iu(e)?{type:"provider",value:e}:Du(e)?{type:"context",value:e}:{type:"none",value:e}}function Hu(){return Wu.getStore()}function Ku(e){Yi=e}function Fr(){return Yi}function $i(e,t){return g.active&&t.parentNode===e}function Qr(e){let t=g.parents.lastIndexOf(e);t!==-1&&(g.parents.length=t),g.cursor=e.nextSibling}function Ur(e,t){if(!e||e.parentNode==null)return t();let r=g.active,n=g.cursor,o=g.parents;g.active=!0,g.cursor=e,g.parents=[];try{return t()}finally{g.active=r,g.cursor=n,g.parents=o}}function Xi(e){if(!g.active)return e();let t=g.cursor,r=g.parents;g.active=!1,g.parents=[];try{return e()}finally{g.active=!0,g.cursor=t,g.parents=r}}function Gi(e){if(!g.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Qr(t)}function Zi(){let e=globalThis;return e[Symbol.for("fluixi.appHydration")]??={pending:0,waiting:new Set}}function Qi(){Zi().pending++}function es(){let e=Zi();if(e.pending>0&&e.pending--,e.pending>0)return;let t=[...e.waiting];e.waiting.clear();for(let r of t)r()}function ts(e){let t=e;for(;t;){let r=t.contexts?.get(zr);if(r)return r;if(!t.parent){let n={id:"",next:0};return(t.contexts??=new Map).set(zr,n),n}t=t.parent}return{id:"",next:0}}function rs(){return V()?Hu()?.hydrationKeys!==!1:g.active}function Ni(e){let t=3735928559,r=1103547991;for(let n=0;n<e.length;n++){let o=e.charCodeAt(n);t=Math.imul(t^o,2654435761),r=Math.imul(r^o,1597334677)}return t=Math.imul(t^t>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507)^Math.imul(t^t>>>13,3266489909),(4294967296*(2097151&r)+(t>>>0)).toString(36)}function ju(e){if(!rs())return null;let t=ts(P()),r=t.id+(t.next++).toString(36);return e?`${Ni(r)}-${e}`:Ni(r)}function Fu(e){let t=e.getAttribute(Fe)??"",r=t.indexOf("-");return r<0?"":t.slice(r+1)}function ns(e){let t=e.getAttribute(Fe);t&&B?.get(t)===e&&B.delete(t)}function Uu(){if(!rs())return null;let e=P();if(!e)return null;let t=ts(e),r={id:t.id+(t.next++).toString(36)+".",next:0},n=ue(e);return(n.contexts=new Map).set(zr,r),n}function zu(e){B??=new Map;for(let t of e.querySelectorAll(`[${Fe}]`)){let r=t.getAttribute(Fe);B.has(r)||B.set(r,t)}}function en(){B=null}function os(e){if(!B)return 0;let t=0;for(let[r,n]of B){if(!n.isConnected){B.delete(r);continue}e&&!e.contains(n)||n.parentElement?.closest("[data-fx-ssr]")||(B.delete(r),n.remove(),t++)}return t}function Bu(e,t){if(!e||!B)return null;let r=B.get(e);return!r||r.localName!==t.toLowerCase()?null:(B.delete(e),r)}function qr(e,t){return t&&(e[Yu]=t),e}function Mi(e){let t=P();t&&(e[Xu]=t)}function we(e){if(!V())for(let t of e)$t.has(t)||tn.has(t)||($t.add(t),Br.dispatch??=Zu,document.addEventListener(t,Br.dispatch))}function Zu(e){let t=`$$${e.type}`,r=e.composedPath&&e.composedPath()[0]||e.target;Object.defineProperty(e,"currentTarget",{configurable:!0,get:()=>r??document});try{for(;r;){let n=r[t];if(n&&!r.disabled&&(n(e),e.cancelBubble))return;r=r.host&&r.host!==r&&r.host instanceof Element?r.host:r.parentNode}}finally{delete e.currentTarget}}function Qu(e,t,r){if(e[`$$${t}`]=r,tn.has(t)){let n=`__fx_${t}`;if(!e[n]){let o=a=>{e[`$$${t}`]?.(a)};e.addEventListener(t,o),e[n]=o}return}$t.has(t)||we([t])}function Li(e,t){delete e[`$$${t}`];let r=`__fx_${t}`,n=e[r];n&&(e.removeEventListener(t,n),delete e[r])}function he(e,t=!1){if(V())return Gr().createText(e);if(g.active&&!t){let r=Fr()?.hydrateText(e);if(r)return r}return document.createTextNode(e)}function be(e,t=!1,r){let n=ju();if(V()){let o=Gr().createElement(e,t);return n&&o.setAttribute(Fe,n),o}if(g.active){let o=Bu(n,e);if(o)return Fr()?.enterElement(o),e.includes("-")&&Mi(o),r?qr(o,r):o;let a=Fr()?.hydrateElement(e);if(a)return e.includes("-")&&Mi(a),r?qr(a,r):a}return qr(t?document.createElementNS(Wi,e):document.createElement(e),r)}function ef(e,t){if(!g.active)return t();let r=Ur(e.nextSibling,t);if(typeof r=="function"){let n=r;return tf(n,(...a)=>g.active?Ur(e.nextSibling,()=>{let i=n(...a);for(;typeof i=="function";)i=i();return i}):n(...a))}return r}function tf(e,t){let r=e[Pt];return r!==void 0&&(t[Pt]=r),t}function rf(e){for(let t=e.nextSibling;t;t=t.nextSibling)if(t.nodeType===8&&t.data==="fx/")return t;throw new Error("[fluixi] template hole is missing its closing marker")}function nf(e,t){let r=[];for(let n=e.nextSibling;n&&n!==t;n=n.nextSibling)r.push(n);return r}function sf(e,t,r,n,o){let a=n,i=new Map,s=!1;return $(()=>{let c=s&&g.active;if(s=!0,!c)return u();g.active=!1;try{return u()}finally{g.active=!0}});function u(){Z(r??t,"content",void 0,e);let c;if(se(e)&&!I(e)){if(!i.has(e)){ie++;try{let f=e();i.set(e,f)}finally{ie--}}for(c=i.get(e);typeof c=="function"&&I(c);)c=c()}else for(c=e();typeof c=="function"&&I(c);)c=c();{let f=0;for(;typeof c=="function"&&f++<50;)if(se(c)){if(!i.has(c)){let l=c;ie++;try{let d=l();i.set(l,d)}finally{ie--}}c=i.get(c)}else if(I(c))c=c();else if(c=c(),typeof c!="function"||!I(c)&&!se(c))break}ie++;try{a=Nt(t,c,r,a,i),o(a)}finally{ie--}}}function K(e,t,r,n){if(ie>of)return console.error("[insert] Exceeded max call depth, possible infinite loop."),()=>null;let o=r!==void 0&&!r&&g.active;r!==void 0&&!r&&(r=he("",!0),o||e.appendChild(r));let a=()=>{if(!o||r.parentNode)return;let f=g.cursor;e.insertBefore(r,f&&f.parentNode===e?f:null)},i=n??null,s=f=>Array.isArray(f)&&f.some(l=>typeof l=="function"),u=f=>typeof f=="function"?f:()=>f;if(typeof t!="function"&&!s(t)){ie++;try{i=Nt(e,t,r,i)}finally{ie--}return a(),()=>i}let c=sf(u(t),e,r,i,f=>{i=f});return a(),()=>(c?.(),i)}function Nt(e,t,r,n,o){if(t==null||typeof t=="boolean")return ye(e,n,r);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return ye(e,n,r);if(Ct(t)){let i=he("",!0);return Array.isArray(n)?n.length>0?(e.replaceChild(i,n[0]),ye(e,n.slice(1),r)):U(e,i,r):n?e.replaceChild(i,n):U(e,i,r),t.then(s=>{i.parentNode===e&&Nt(e,s,i.nextSibling,i)}).catch(s=>{console.error("Error resolving promise in insertExpression:",s)}),i}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(n)){if(n.length===0){let s=he(t);return U(e,s,r),s}if(n.length===1&&n[0].nodeType===3)return n[0].data=t,n;n=ye(e,n,r)}if(n&&Eu(n))return n.data=t,n;let i=he(t);return n&&n.parentNode===e?e.replaceChild(i,n):$i(e,i)||U(e,i,r),i}if(Zr(t))return $i(e,t)?(Qr(t),t):Array.isArray(n)?(n.length===0?U(e,t,r):n[0].parentNode===e?(e.replaceChild(t,n[0]),ye(e,n.slice(1),r)):U(e,t,r),t):(n?n!==t&&(n.parentNode===e?e.replaceChild(t,n):U(e,t,r)):U(e,t,r),t);if(Array.isArray(t)){let i=[],s=Array.isArray(n)?n:n?[n]:[],u=[],c=new Set,f=()=>oe(t,i,e,r,!0,o,u,c);g.active&&s.length?Ur(s[0],f):f();let l=af(e,c.size?s.filter(d=>!c.has(d)):s,i,r);for(let d of u){if(d.wired)continue;let h=K(e,d.sig,d.marker);S(()=>ye(e,h()))}return l}if(a==="object"&&t!==null&&typeof t=="object"){let i=t;if("type"in i&&"props"in i){let s=i;if(typeof s.type=="function"){let u=s.type(s.props||{});return Nt(e,u,r,n)}}}return ye(e,n,r)}function oe(e,t,r,n,o=!0,a,i,s){for(let u=0;u<e.length;u++){let c=e[u];if(!(c==null||typeof c=="boolean")){for(;typeof c=="function"&&!Ct(c)&&!I(c)&&!se(c)&&(c=c(),!(c==null||typeof c=="boolean")););if(!(c==null||typeof c=="boolean")){if(typeof c=="function"){let f;for(se(c)&&!I(c)?(a||(a=new Map),a.has(c)||a.set(c,c()),f=a.get(c)):f=c();typeof f=="function"&&!Ct(f)&&!I(f)&&!se(f);)a||(a=new Map),a.has(f)||a.set(f,f()),f=a.get(f);if(f==null||typeof f=="boolean")continue;if(typeof f=="function"){if(I(f)){if(i){let d=he("",!0);if(t.push(d),g.active&&s&&g.cursor?.parentNode===r){let h=()=>g.cursor&&g.cursor.parentNode===r?g.cursor:null;r.insertBefore(d,h());let y=K(r,f,d),p=y();for(let v of Array.isArray(p)?p:p?[p]:[])s.add(v);r.insertBefore(d,h()),S(()=>ye(r,y())),i.push({marker:d,sig:f,wired:!0});continue}i.push({marker:d,sig:f});continue}let l=f();for(;typeof l=="function"&&I(l);)l=l();if(l==null||typeof l=="boolean")continue;Array.isArray(l)?oe(l,t,r,n,o,a):oe([l],t,r,n,o,a);continue}continue}Array.isArray(f)?oe(f,t,r,n,o,a,i,s):oe([f],t,r,n,o,a,i,s);continue}if(Ct(c)){let f=he("",!0);t.push(f),c.then(l=>{if(f.parentNode){let d=[];if(oe([l],d,f.parentNode,void 0,!1,a),d.length>0){f.parentNode.replaceChild(d[0],f);for(let h=1;h<d.length;h++)f.parentNode?.insertBefore(d[h],d[h-1].nextSibling)}}}).catch(l=>console.error("Error resolving promise in array:",l));continue}if(Array.isArray(c)){oe(c,t,r,n,o,a,i,s);continue}if(Zr(c)){g.active&&(g.cursor===c||g.parents.includes(c))&&Qr(c),t.push(c);continue}if(typeof c=="object"&&c!==null&&"type"in c&&"props"in c){let f=c;if(typeof f.type=="function"){let l=f.type(f.props||{});Array.isArray(l)?oe(l,t,r,n,!1,a):oe([l],t,r,n,!1,a);continue}}if(typeof c=="string"||typeof c=="number"){let f=String(c);if(f.trim()===""&&f!==" ")continue;t.push(he(f));continue}t.push(he(String(c)))}}}}function af(e,t,r,n){for(let l=0;l<r.length;l++){let d=r[l].parentNode;d!==null&&d!==e&&d.nodeType!==11&&(r=r.slice(),r[l]=r[l].cloneNode(!0))}let o=r.length,a=t.length,i=o,s=0,u=0,c=a>0?t[a-1].nextSibling??void 0:n,f=null;for(;s<a||u<i;){if(t[s]===r[u]){s++,u++;continue}for(;a>s&&i>u&&t[a-1]===r[i-1];)a--,i--;if(a===s){let l=i<o?u?r[u-1].nextSibling??void 0:r[i-u]:c;for(;u<i;)U(e,r[u++],l)}else if(i===u)for(;s<a;)(!f||!f.has(t[s]))&&t[s].parentNode===e&&e.removeChild(t[s]),s++;else if(t[s]===r[i-1]&&r[u]===t[a-1]){let l=t[--a].nextSibling;U(e,r[u++],t[s++].nextSibling),U(e,r[--i],l),t[a]=t[s-1]}else{if(!f){f=new Map;let d=u;for(;d<i;)f.set(r[d],d++)}let l=f.get(t[s]);if(l!=null)if(u<l&&l<i){let d=s,h=1;for(;++d<a&&d<i&&!(!f.has(t[d])||f.get(t[d])!==l+h);)h++;if(h>l-u){let y=t[s];for(;u<l;)U(e,r[u++],y)}else t[s].parentNode===e?e.replaceChild(r[u++],t[s++]):(U(e,r[u++],c),s++)}else s++;else t[s].parentNode===e&&e.removeChild(t[s]),s++}}return r}function ye(e,t,r){if(t)if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n].parentNode===e&&e.removeChild(t[n]);else t.parentNode===e&&e.removeChild(t);return null}function U(e,t,r){g.active&&t.parentNode===e||(r&&r.parentNode===e?e.insertBefore(t,r):e.appendChild(t))}function ve(e,t,r){r==null?delete e[t]:e[t]=r}function is(e,t,r){let n=r,o;return Array.isArray(r)&&(n=r[0],o=r[1]),typeof n!="function"?()=>{}:(e.addEventListener(t,n,o),()=>e.removeEventListener(t,n,o))}function ss(e,t){if(!t||typeof t!="function")return;let r=t[Pt]?.name;if(!r)return;let n=r.indexOf(":");n!==-1&&Q(e,r.slice(0,n),r.slice(n+1),t)}function Mt(e,t,r){let n=typeof r=="function"?A(()=>r()):r;if(!(!n||typeof n!="object"))for(let o of Object.keys(n))Q(e,t,o)}function as(e,t){let r=(n,o)=>{typeof n=="function"&&(Q(e,"use",n.name||"use",o),n(e,o??(()=>{})))};if(typeof t=="function"){r(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){r(t[0],t[1]);return}for(let n of t)Array.isArray(n)?r(n[0],n[1]):r(n)}}function Jr(e,t,r,n=!1){return ss(e,r),typeof r!="function"?(N(e,t,r,n),()=>{}):$(()=>{Z(e,"attribute",t,r);let o=typeof r=="function"?r():r;N(e,t,o,n)})}function Yr(e,t,r){return typeof r!="function"?(ve(e,t,r),()=>{}):(ss(e,r),$(()=>{Z(e,"property",t,r);let n=typeof r=="function"?r():r;ve(e,t,n)}))}function cs(e,t,r){return typeof r!="function"?(N(e,t,!!r),()=>{}):$(()=>{Z(e,"attribute",t,r);let n=r();N(e,t,!!n)})}function Lt(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){$(()=>{Z(e,"attribute","class",t),Lt(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 r=Object.keys(t).filter(n=>{let o=t[n];return typeof o=="function"?o():!!o}).join(" ");e.setAttribute("class",r);return}e.setAttribute("class",String(t))}function It(e,t,r){if(!(!t||typeof t!="object"))for(let n in t){let o=t[n],a=n.split(/\s+/).filter(Boolean);if(typeof o=="function"&&r)r.push($(()=>{let i=!!o();for(let s of a)e.classList.toggle(s,i)}));else{let i=!!(typeof o=="function"?o():o);for(let s of a)e.classList.toggle(s,i)}}}function Vr(e,t,r){t.includes("-")?r==null?e.removeProperty(t):e.setProperty(t,String(r)):e[t]=r??""}function je(e){for(;typeof e=="function";)e=e();return e}function Dt(e,t,r){let n=je(t),o=Wr.get(e);if(n==null){Wr.delete(e),e.removeAttribute("style");return}let a=new Set,i=s=>{if(typeof s=="function"&&r){r.push($(()=>i(je(s))));return}if(s=je(s),s!=null){if(typeof s=="string")e.style.cssText=s;else if(Array.isArray(s))for(let u of s)i(u);else if(typeof s=="object")for(let u in s){a.add(u);let c=s[u];typeof c=="function"&&r?r.push($(()=>Vr(e.style,u,je(c)))):Vr(e.style,u,je(c))}}};if(Array.isArray(n))for(let s of n)i(s);else i(n);if(o)for(let s of o)a.has(s)||Vr(e.style,s,null);Wr.set(e,a)}function us(e){let{element:t,props:r,prevProps:n=Ju,isSVG:o=!1,skipChildren:a=!1,isCustomElement:i,accessors:s}=e;if(!t||!Ou(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!r)return console.warn("[spread] Warning: props is undefined!"),()=>{};let u=o||t.namespaceURI===Wi,c=[];for(let f in r){if(a&&f==="children")continue;let l=r[f],d=n[f];if(l===d)continue;if(f==="ref"){rn(l,t);continue}if(f==="use"){as(t,l);continue}if(f.startsWith("on:")){c.push(is(t,f.slice(3),l));continue}if(f.startsWith("prop:")){Q(t,"prop",f.slice(5),l),c.push(Yr(t,f.slice(5),l));continue}if(f.startsWith("attr:")){Q(t,"attr",f.slice(5),l),c.push(Jr(t,f.slice(5),l,u));continue}if(f.startsWith("bool:")){Q(t,"bool",f.slice(5),l),c.push(cs(t,f.slice(5),l));continue}if(f==="class"||f==="className"){typeof l=="function"?c.push($(()=>{Z(t,"attribute","class",l),Lt(t,l())})):Lt(t,l);continue}if(f==="classList"){Mt(t,"class",l),typeof l=="function"?c.push($(()=>{Z(t,"attribute","class",l),It(t,l())})):It(t,l,c);continue}if(f==="style"){Mt(t,"style",l),typeof l=="function"?c.push($(()=>{Z(t,"attribute","style",l),Dt(t,l())})):Dt(t,l,c);continue}if(f.startsWith("on")){let v=f.slice(2).toLowerCase();d&&Li(t,v),l&&Qu(t,v,l);continue}let h=i??t.localName.includes("-"),y=Pi.has(f)||!u&&f in t||h&&!u&&!Dr(f);if(h&&!u&&!Dr(f)&&s!==void 0&&typeof l=="function"&&!s.includes(f)){V()?jr(t,f,l):ve(t,f,l);continue}if(h&&!u&&!Dr(f)&&V()){c.push($(()=>{let v=typeof l=="function"?l():r[f];for(;typeof v=="function"&&v.length===0;)v=v();jr(t,f,v)}));continue}typeof l=="function"?c.push(y?Yr(t,f,l):Jr(t,f,l,u)):c.push($(()=>y?ve(t,f,r[f]):N(t,f,r[f],u)))}for(let f in n)if(!(f in r))if(f.startsWith("on")){let l=f.slice(2).toLowerCase();Li(t,l)}else Pi.has(f)?ve(t,f,null):t.removeAttribute(f);return()=>{c.forEach(f=>f())}}function cf(e,t,r=!1){for(let n in t){let o=t[n];if(n==="ref"){rn(o,e);continue}if(n!=="children"){if(n==="use"){as(e,o);continue}if(n.startsWith("on:")){is(e,n.slice(3),o);continue}if(n.startsWith("prop:")){Q(e,"prop",n.slice(5),o),Yr(e,n.slice(5),o);continue}if(n.startsWith("attr:")){Q(e,"attr",n.slice(5),o),Jr(e,n.slice(5),o,r);continue}if(n.startsWith("bool:")){Q(e,"bool",n.slice(5),o),cs(e,n.slice(5),o);continue}if(n.startsWith("on")&&n.length>2){let a=n.slice(2).toLowerCase();if(typeof o=="function")if(tn.has(a)){e[`$$${a}`]=o;let i=`__fx_${a}`;if(!e[i]){let s=u=>{e[`$$${a}`]?.(u)};e.addEventListener(a,s),e[i]=s}}else e[`$$${a}`]=o,$t.has(a)||we([a]);continue}if(n==="class"||n==="className"){Lt(e,o);continue}if(n==="classList"){Mt(e,"class",o),typeof o=="function"?$(()=>{Z(e,"attribute","class",o),It(e,o())}):It(e,o,[]);continue}if(n==="style"){Mt(e,"style",o),typeof o=="function"?$(()=>{Z(e,"attribute","style",o),Dt(e,o())}):Dt(e,o,[]);continue}if(n==="innerHTML"){if(typeof o=="function"){let a=k(()=>{let i=o();for(;typeof i=="function";)i=i();e.innerHTML=i});S(()=>a())}else e.innerHTML=o;continue}if(n==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let a=k(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();document.activeElement!==e&&(e.value=i??"")});S(()=>{a()})}else $(()=>{document.activeElement!==e&&(e.value=t[n]??"")});continue}if(n==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let a=k(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();document.activeElement!==e&&(e.checked=i??"")});S(()=>{a()})}else $(()=>{document.activeElement!==e&&(e.checked=t[n]??"")});continue}if(n==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let a=!0,i=k(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();a?(a=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""});S(()=>{i()})}else{let a=!0;$(()=>{let i=t[n];a?(a=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""})}continue}if(typeof o=="function"){let a=k(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();Ci(e,n,i,r)});S(()=>{a()})}else $(()=>Ci(e,n,t[n],r))}}}function uf(e,...t){let r=new Set;for(let i of t)for(let s of i)r.add(s);let n=i=>({enumerable:!0,configurable:!0,get:()=>e[i]}),o=t.map(i=>{let s=new Set(i);return new Proxy({},{get:(u,c)=>s.has(c)?e[c]:void 0,has:(u,c)=>s.has(c)&&c in e,ownKeys:()=>Array.from(s).filter(u=>u in e),getOwnPropertyDescriptor:(u,c)=>s.has(c)&&c in e?n(c):void 0})}),a=new Proxy({},{get:(i,s)=>r.has(s)?void 0:e[s],has:(i,s)=>!r.has(s)&&s in e,ownKeys:()=>Reflect.ownKeys(e).filter(i=>!r.has(i)),getOwnPropertyDescriptor:(i,s)=>!r.has(s)&&s in e?n(s):void 0});return[...o,a]}function rn(e,t){if(!e)return;let r=e[Pt]?.name;if(Q(t,"ref",r||typeof e=="function"&&e.name||"ref",e),Zr(e)){let n=t,o=e;if(!n)return;typeof n=="function"?n(o):typeof n=="object"&&"current"in n&&(n.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}function ff(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function Ct(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function nn(e,t,r){if(!t)throw new Error("Container element is required");let n,o,a=[];return W(i=>{D(()=>{g.active||(t.textContent=""),Wt(t),Ht(),K(t,e)}),o=i}),()=>{o?.(),n?.(),a.forEach(i=>i()),t.textContent=""}}function J(e,t){let r=Uu();return r?M(r,()=>Di(e,t)):Di(e,t)}function Di(e,t){if(Ii.fn)return Ii.fn(e,t);t&&wi(t);let r=typeof e=="function"?xi(()=>e(t)):e,n=r!=null&&(typeof r=="function"||typeof r=="object");if(n)try{r.$name=e?.name}catch{}return n&&!ki(r)?Be(r):r}function on(){let e=globalThis.__FX_DATA__;if(e&&typeof e.nodeType!="number")return e;if(Hr!==void 0)return Hr;let t=null;if(typeof document<"u"){let r=document.getElementById(df)?.textContent;if(r)try{t=JSON.parse(r)}catch{t=null}}return Hr=t}function Kt(){for(;;){for(;g.cursor&&g.cursor.nodeType===3&&g.cursor.data==="";)g.cursor=g.cursor.nextSibling;if(g.cursor!=null||!g.parents.length)return;g.cursor=g.parents.pop().nextSibling}}function ze(e,t){let r=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 ${r}. 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 ls(e){return e.localName.includes("-")?e.hasAttribute("data-fx-ssr")||e[pf]===!0:!1}function yf(e){Kt();let t=g.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(ns(t),fs.has(e.toLowerCase())||ls(t)?g.cursor=t.nextSibling:(g.parents.push(t),g.cursor=t.firstChild),t):(Ue&&t&&ze(`<${e}>`,t),null)}function hf(e){fs.has(e.localName)||ls(e)?g.cursor=e.nextSibling:(g.parents.push(e),g.cursor=e.firstChild)}function mf(e,t){Kt();let r=g.cursor;if(r&&r.nodeType===1&&r.tagName.toLowerCase()===e.toLowerCase()){let n=Fu(r);return t&&n&&n!==t?(Ue&&ze(`<${e}> (another template)`,r),null):(ns(r),g.cursor=r.nextSibling,r)}return Ue&&r&&ze(`<${e}> (static)`,r),null}function gf(e){if(e===""){let r=g.cursor;return r&&r.nodeType===3&&r.data!==""?(g.cursor=r.nextSibling,r.data="",r):null}Kt();let t=g.cursor;if(t&&t.nodeType===3){let r=t.data;return r.length>e.length&&r.startsWith(e)?(g.cursor=t.splitText(e.length),t):(g.cursor=t.nextSibling,r!==e&&(t.data=e),t)}return Ue&&t&&ze(`text ${JSON.stringify(e.slice(0,24))}`,t),null}function vf(e){Kt();let t=g.cursor;return t&&t.nodeType===8&&t.data===e?(g.cursor=t.nextSibling,t):(Ue&&t&&ze(`marker <!--${e.slice(0,24)}-->`,t),null)}function wf(){qi||(qi=!0,Ku({hydrateElement:yf,hydrateText:gf,hydrateMarker:vf,hydrateStatic:mf,enterElement:hf}))}function jt(e,t,r){wf(),g.active=!0,g.cursor=t.firstChild,g.parents=[],en(),zu(t);let n=on(),o=r?.resourceNamespace,a=0;vo(()=>o?`${o}:r${a++}`:`r${a++}`),go(n?i=>i in n?{value:n[i]}:void 0:null);try{return nn(e,t)}finally{g.active=!1,g.cursor=null,g.parents=[]}}function sn(e,t={}){if(typeof e=="function")return J(e,t);if(typeof e!="string"||e.length===0)return null;let r=ff(e),n=be(e,r);return cf(n,t,r),bf(n,t),n}function bf(e,t){if(!t||t.children===void 0)return;let r=e.firstChild,n;g.active&&r?.nodeType===8&&r.data==="fx"?n=rf(r):(r=Vi("fx"),n=Vi("fx/"),e.appendChild(r),e.appendChild(n));let o=r;K(e,ef(o,()=>We(()=>t.children)),n,nf(o,n))}function Vi(e){return V()?Gr().createComment(e):document.createComment(e)}function Ft(e){return()=>{let t=e();return typeof t=="function"?t():t}}function Sf(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function ds(e){let t=Ft(()=>e.when),r=w(t,void 0,{name:"Show.when"}),n=w(()=>!!r(),void 0,{name:"Show.cond"}),o=P(),a=null,i=null,s=u=>{u!==i&&(a&&ke(a),a=ue(o),i=u)};return w(()=>{let u=n();return s(u?"when":"fallback"),M(a,()=>{if(!u)return e.fallback;let c=e.children;if(typeof c=="function"&&!Sf(c)){let f=c;if(f.length===0)return A(()=>f(A(r)));let l=r();return A(()=>f(l))}return c})},void 0,{name:"Show.result"})}function ps(e){let t=Ft(()=>e.each),r=()=>e.fallback??null,n=(o,a)=>{let i=e.children,s=Array.isArray(i)?i.map(u=>typeof u=="function"?u(o,a):u):typeof i=="function"?i(o,a):i;return Gi(s),s};return e.by?ho(t,e.by,(o,a)=>n(o,a),{fallback:r}):yo(t,(o,a)=>n(o,a),{fallback:r})}function ys(e){let t=Ft(()=>e.each);return mo(t,(r,n)=>{let o=e.children(r,n);return Gi(o),o},{fallback:()=>e.fallback??null})}function hs(e){return{[Xr]:!0,when:Ft(()=>e.when),get children(){return e.children}}}function ms(e){let t=Array.isArray(e.children)?e.children:[e.children],r=P(),n=null,o=-1,a=i=>{i!==o&&(n&&ke(n),n=ue(r),o=i)};return w(()=>{for(let i=0;i<t.length;i+=1){let u=t[i],c=0;for(;typeof u=="function"&&!u[Xr]&&c++<10;)u=u();if(!u||typeof u!="object"||u[Xr]!==!0)continue;let f=u.when();if(f)return a(i),M(n,()=>{let l=u.children;return typeof l=="function"?l(f):l})}return a(-2),M(n,()=>e.fallback??null)},void 0,{name:"Switch"})}function gs(e){let t=()=>{let s=e.component;return I(s)?s():s},[,r]=uf(e,["component"]),n=P(),o=null,a,i;return w(()=>{let s=t();return s===a||(o&&ke(o),o=ue(n),a=s,i=s==null?null:M(o,()=>A(()=>typeof s=="string"?sn(s,r):J(s,r)))),i},void 0,{name:"Dynamic"})}function vs(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,r,n;return W(o=>{r=o,n=document.createElement("div"),n.style.display="contents",t().appendChild(n),K(n,e.children)&&rn(e.ref,n)}),S(()=>{r(),n.remove()}),null}function an(e){if(V())return e.fallback??null;let t=g.active,[r,n]=b(!t);return t&&queueMicrotask(()=>n(!0)),w(()=>r()?e.children:e.fallback??null,void 0,{name:"client-only"})}function bs(e){let t=_o(),r=i=>!!i&&typeof i.then=="function",n=i=>typeof e.fallback=="function"?e.fallback(i,t.reset):e.fallback,o=i=>{if(r(i))throw i;return queueMicrotask(()=>t.setError(i)),null},a=i=>{if(Array.isArray(i))return i.map(a);if(typeof i!="function")return i;let s=i;return()=>{try{return a(s())}catch(u){return o(u)}}};return w(()=>{let i=t.error();if(i!==void 0)return n(i);try{return Oo(t,()=>{let s=e.children;return a(typeof s=="function"?s():s)})}catch(s){return o(s),n(s)}},void 0,{name:"ErrorBoundary"})}function Ss(e){return w(()=>{let t=typeof e=="function"?e():e,r=[];for(let[n,o]of Object.entries(t)){if(!n)continue;(typeof o=="function"?o():o)&&r.push(n)}return r.join(" ")},void 0,{name:"ClassMap"})}function Af(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function As(e){return w(()=>{let t=typeof e=="function"?e():e,r=[];for(let[n,o]of Object.entries(t)){if(!n)continue;let a=typeof o=="function"?o():o;a!=null&&r.push(`${Af(n)}: ${a}`)}return r.join("; ")},void 0,{name:"StyleMap"})}var qt,ku,_u,Kr,Wi,Ru,Pi,Cu,Ql,Pu,z,Rt,Vu,Wu,id,sd,g,Yi,zr,Fe,B,Ju,Pt,Yu,Xu,Gu,Br,$t,tn,ie,of,Wr,lf,Ii,df,Hr,fs,Ue,pf,qi,Xr,ws,xf,q=F(()=>{"use strict";x();ni();x();x();x();Ri();x();x();x();x();x();x();x();x();x();x();x();x();x();qt=Symbol.for("fluixi.server-node"),ku=Symbol.for("fluixi.dom.server-host"),_u=globalThis,Kr=_u[ku]??={server:typeof document>"u",nodes:null};Wi="http://www.w3.org/2000/svg";Ru=Symbol.for("fluixi.serverProps");Pi=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]),Cu=new Set(["id","class","className","style","slot","part","exportparts","is","title","role","lang","dir","tabindex","hidden"]);Ql=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;Pu="1.0.0-alpha.97",z={dom:Pu,reactive:ri};Vu={getStore:()=>Rt,run(e,t){let r=Rt;Rt=e;try{return t()}finally{Rt=r}}},Wu=Vu;id=globalThis[Symbol.for("fluixi.requestLocals")]??=new WeakMap,sd=globalThis[Symbol.for("fluixi.responseHeaders")]??=new WeakMap,g={active:!1,cursor:null,parents:[]},Yi=null;zr=Symbol.for("fluixi.hydrationKeys"),Fe="data-hk";B=null;Ju={},Pt="__fx_at",Yu="__fx_loc";Xu=Symbol.for("fluixi.owner");Gu="__fluixi_delegated_events__",Br=globalThis[Gu]??={names:new Set},$t=Br.names,tn=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);ie=0,of=200;Wr=new WeakMap;lf="__fx_dom_create_component__",Ii=globalThis[lf]??={fn:null};df="__FX_DATA__";fs=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ue=typeof process<"u"&&process.env&&!1;pf=Symbol.for("fluixi.ownsContent");qi=!1;Xr=Symbol("match");ws=an;xf=qt});function Es(e){if(e!=null&&(typeof e=="object"||typeof e=="function"))try{e.$lazy=!0}catch{}return e}function Pe(e,t){let r,n,o;function a(){return n||(n=e().then(s=>r=s.default)),n}t?.preload&&a();let i=(s=>{if(r){let u=r;return Es(A(()=>u(s)))}if(!o){let[u]=fe(()=>a(),{transport:!1});if(o=u,u.error)throw u.error}return w(()=>{let u=o();return u?Es(J(u,s)):void 0})});return i.preload=()=>a().then(()=>{}),i.$lazy=!0,i.loader=e,i}var Zt=F(()=>{"use strict";q();x()});function Ge(e,t){let r=ee(e,t),n=o=>r.Provider({value:o.value,get children(){return o.children},debug:o.debug});return{id:r.id,Provider:zi(n),defaultValue:e}}function Ze(e){let t=H(e);return t!==void 0?t:e.defaultValue}function pn(e,t,r){let n=typeof t=="function"?t():t;return e.Provider({value:n,get children(){return r.children}})}function $s(e,t){return e.reduceRight((n,[o,a])=>({get children(){return pn(o,a,n)}}),t).children}function Ns(e,t){for(let r=P();r;r=r.parent)if(r.contexts?.has(e.id))return Ze(e);throw new Error(t??`[fluixi] No Provider for ${e.id.description??"this context"} above this component.`)}var yn=F(()=>{"use strict";q();x()});function An(){return typeof document<"u"&&typeof document.startViewTransition=="function"}function xn(){if(typeof window>"u"||typeof window.matchMedia!="function")return!1;try{return window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}function nl(e){return e!=="none"&&An()&&!xn()}function Bs(e){let t=[];for(let r of e){let n=r?.preload;if(typeof n=="function")try{let o=n();o&&typeof o.then=="function"&&t.push(o.catch(()=>{}))}catch{}}return t.length?Promise.all(t).then(()=>{}):null}function kn(e,t){if(!nl(e))return Promise.resolve(t()).then(()=>{});let r=document.startViewTransition;try{let n=r.call(document,()=>t());return n.finished?.catch(()=>{}),n.ready?.catch(()=>{}),n.updateCallbackDone.catch(()=>{})}catch{return Promise.resolve(t()).then(()=>{})}}var _n=F(()=>{"use strict"});function er(e,t,r={}){let{preserveStructure:n,multiple:o,throwOnError:a=!1,defaultValue:i,maxDepth:s=20}=r;if(!e||typeof e!="object")return i;if(!t)return e;if(Array.isArray(t))if(n){let f={};for(let l of t){let d=er(e,l,{...r,preserveStructure:!1});d!==void 0&&il(f,l,d)}return f}else return t.map(f=>er(e,f,{...r,preserveStructure:!1}));let u=On(t,{...r,throwOnError:a});if(u.length===0)return e;if(typeof n>"u"||n===!1){let f=sl(e,t);return o===!1&&Array.isArray(f)?f[0]:f===void 0&&i!==void 0?i:f}let c=G(e,u,0,s);return c===void 0&&i!==void 0?i:c}function sl(e,t,r={}){let{createMissing:n=!1,add:o=!1,debug:a=!1}=r,i=On(t),s=e,u=!1,c="",f=t;if(typeof s=="object"&&!Array.isArray(s)&&f.length>0&&s[f])return s=s[f],s;for(let l=0;l<i.length;l++){let d=i[l],h=i.length>1?l===i.length-1:!1;if(s===null&&!n)return;let y=i[l+1];switch(d.type){case"property":if(s&&typeof s=="object")if(Array.isArray(s)){if(typeof d.value=="number"){let p=d.value;if(n&&p>=s.length)for(let v=s.length;v<=p;v++)s.push(void 0);if(n&&(s[p]===null||s[p]===void 0)&&(!h||u)&&(y?s[p]=y.type==="index"||y.type==="slice"||y.type==="union"||y.type==="wildcard"?[]:{}:s[p]=null,u=!1),s=s[p],y){u=!0;continue}}else o?s.push({[String(d.value)]:null}):s=s.map(p=>p[String(d.value)]);if(y)continue;return Js(s)}else{if(s[c]&&c.split(".").length>=2){s=s[c];continue}if(n&&(s[String(d.value)]===null||s[String(d.value)]===void 0)&&(!h||u)&&(y?s[String(d.value)]=y.type==="index"||y.type==="slice"||y.type==="union"||y.type==="wildcard"?[]:{}:s[String(d.value)]=null,u=!1,s=s[String(d.value)],y)){u=!0;continue}if(s?(!s[String(d.value)]&&n&&(s[String(d.value)]=null),s=s[String(d.value)]):s={[String(d.value)]:null},y)continue}else if(n)s={},s[String(d.value)]=y.type==="index"||y.type==="slice"||y.type==="union"||y.type==="wildcard"||r.type==="array"?[]:{},s=s[String(d.value)];else return;break;case"index":case"wildcard":if(Array.isArray(s)){if(d.type==="index"){let p=d.value;if(p<0){s=s[s.length-Math.abs(p)];continue}if(n&&(p>=s.length||s[p]==null||s[p]==null)&&!h){for(let v=s.length;v<=p;v++)s.push(void 0);y&&(s[p]=y.type==="index"||y.type==="slice"||y.type==="union"||y.type==="wildcard"?[]:{})}s=s[p]}else if(!h)continue}else if(n){let p=i[l+1];s=[];let v=d.value;for(let _=0;_<=v;_++)s.push(void 0);s[v]=p.type==="index"||p.type==="slice"||p.type==="union"||p.type==="wildcard"||r.type==="array"?[]:{},s=s[v]}else{if(d.type==="index"&&typeof s=="object"&&s&&s[String(d.value)]!==void 0){s=s[String(d.value)];continue}if(typeof s=="object"){s=Object.values(s);continue}return}break;default:return}}return Js(s)}function Js(e){return Array.isArray(e)?e.filter(t=>typeof t<"u"):e}var tr,G,On,ol,il,En=F(()=>{"use strict";tr=e=>e==null||Array.isArray(e)||typeof e=="function"||e instanceof Date||e instanceof RegExp||e instanceof Map||e instanceof Set||e instanceof Error?!1:typeof e=="object",G=(e,t,r,n)=>{if(r>n)return;if(t.length===0)return e;let o=t[0],a=t.slice(1);if(o.type==="descendant"){let i=G(e,a,r+1,n);if(i!==void 0)return i;if(e&&typeof e=="object")if(Array.isArray(e)){let s=[];for(let u=0;u<e.length;u++){let c=G(e[u],t,r+1,n);c!==void 0&&(s[u]=c)}return s.length>0?s:void 0}else{let s={};for(let u in e)if(e.hasOwnProperty(u)){let c=G(e[u],t,r+1,n);c!==void 0&&(s[u]=c)}return Object.keys(s).length>0?s:void 0}return}switch(o.type){case"property":if(tr(e)&&o.value&&String(o.value)in e){let i=e[String(o.value)],s=G(i,a,r+1,n);if(s!==void 0)return{[String(o.value)]:s}}break;case"index":if(Array.isArray(e)){let i=o.value;if(i>=0&&i<e.length){let s=G(e[i],a,r+1,n);if(s!==void 0){let u=new Array(e.length).filter(c=>c!==void 0);return u[i]=s,u}}}else if(e&&typeof e=="object"){let i=String(o.value);if(i in e){let s=G(e[i],a,r+1,n);if(s!==void 0)return{[i]:s}}}break;case"wildcard":if(e&&typeof e=="object")if(Array.isArray(e)){let i=[],s=!1;for(let u=0;u<e.length;u++){let c=G(e[u],a,r+1,n);c!==void 0&&(i[u]=c,s=!0)}return s?i:void 0}else{let i={},s=!1;for(let u in e)if(e.hasOwnProperty(u)){let c=G(e[u],a,r+1,n);c!==void 0&&(i[u]=c,s=!0)}return s?i:void 0}break;case"slice":if(Array.isArray(e)){let[i,s]=o.value,u=Math.max(0,i),c=Math.min(e.length,s===1/0?e.length:s),f=[],l=!1;for(let d=u;d<c;d++){let h=G(e[d],a,r+1,n);h!==void 0&&(f[d]=h,l=!0)}return l?f:void 0}break;case"union":if(Array.isArray(e)){let i=o.value,s=[],u=!1;for(let c of i)if(c>=0&&c<e.length){let f=G(e[c],a,r+1,n);f!==void 0&&(s[c]=f,u=!0)}return u?s:void 0}break;case"filter":if(Array.isArray(e)){let i=o.value,s=[],u=!1;for(let c=0;c<e.length;c++)if(i(e[c])){let f=G(e[c],a,r+1,n);f!==void 0&&(s[c]=f,u=!0)}return u?s:void 0}break}},On=(e,t={})=>{let{type:r="auto",throwOnError:n=!1}=t;if(!e||typeof e!="string")return[];let o=[],a="",i=!1,s=!1,u="",c="",f=0,d=r==="auto"?(y=>y.includes("..")?"descendant":y.includes("[?(")?"filter":y.includes("[:")||y.includes("[0:")?"slice":y.includes("[,")||y.includes("[0,1]")?"union":y.includes("[*]")||y.includes(".*.")?"wildcard":y.includes("[]")?"array-wildcard":y.includes("[")&&y.includes("]")?"bracket":"dot")(e):r,h=y=>{let p=y.trim();if(p==="*"||p==="")return{type:"wildcard",value:p===""?"[]":"*",raw:p===""?"[]":y};if(p==="[]")return{type:"wildcard",value:"[]",raw:y};if(/^-?\d+$/.test(p))return{type:"index",value:parseInt(p,10),raw:y};if(p.includes(":")){let v=p.split(":").map(Y=>Y.trim()),_=v[0]===""?0:parseInt(v[0],10),O=v[1]===""?1/0:parseInt(v[1],10);if(isNaN(_)||isNaN(O)){if(n)throw new Error(`Invalid slice notation: ${y}`);return{type:"wildcard",value:"*",raw:y}}return{type:"slice",value:[_,O],raw:y}}if(p.includes(",")){let v=p.split(",").map(_=>{let O=parseInt(_.trim(),10);return isNaN(O)?-1:O}).filter(_=>_>=0);if(v.length===0){if(n)throw new Error(`Invalid union notation: ${y}`);return{type:"wildcard",value:"*",raw:y}}return{type:"union",value:v,raw:y}}if(p.startsWith("?(")&&p.endsWith(")")){let v=p.slice(2,-1);try{return{type:"filter",value:ol(v),raw:y}}catch(_){if(n)throw _;return{type:"wildcard",value:"*",raw:y}}}return p.startsWith('"')&&p.endsWith('"')||p.startsWith("'")&&p.endsWith("'")?{type:"property",value:p.slice(1,-1),raw:y}:{type:"property",value:p,raw:y}};for(let y=0;y<e.length;y++){let p=e[y],v=e[y+1];if((p==='"'||p==="'")&&!s){s=!0,u=p;continue}else if(p===u&&s){s=!1,u="",p==='"'||p==="'"||(i?c+=p:a+=p);continue}if(s){i?c+=p:a+=p;continue}if(p==="["&&!i){a&&(o.push({type:"property",value:a,raw:a}),a=""),i=!0,c="";continue}if(p==="]"&&i&&!s){i=!1;let O=h(c);o.push(O);continue}let _=o.length>0?o[o.length-1]:null;if(p==="."&&!i&&!s){if(v==="."){let O=e.split("..")[0];o.push({type:"property",value:O,raw:O}),o.push({type:"descendant",value:"..",raw:".."}),y++}else a&&(a==="*"?o.push({type:"wildcard",value:a,raw:a}):o.push({type:"property",value:a,raw:a}),a="");continue}if(i)c+=p;else if(_&&_.type!=="descendant")a+=p;else{let O=e.split(_?.raw)[1];O!==void 0?a=O:a+=p}}return a&&o.push({type:"property",value:a,raw:a}),o.map(y=>{if(y.type==="property"&&typeof y.value=="string"&&/^-?\d+$/.test(y.value)){let p=parseInt(y.value,10);if(!isNaN(p))return{...y,type:"index",value:p}}return y})},ol=e=>{let t=e.replace(/@\.([a-zA-Z_$][\w$]*)/g,(r,n)=>`item.${n}`).replace(/@/g,"item");try{return new Function("item",`return ${t}`)}catch{throw new Error(`Invalid filter expression: ${e}`)}},il=(e,t,r)=>{let n=On(t),o=e;for(let a=0;a<n.length;a++){let i=n[a],s=a===n.length-1;switch(i.type){case"property":if(s)o[String(i.value)]=r;else{if(!o[String(i.value)]){let c=n[a+1];o[String(i.value)]=c.type==="index"||c.type==="slice"||c.type==="union"||c.type==="wildcard"?[]:{}}o=o[String(i.value)]}break;case"index":Array.isArray(o)||(o=[]);let u=i.value;if(s){if(u>=o.length)for(let c=o.length;c<=u;c++)o.push(void 0);o[u]=r}else{if(!o[u]){let c=n[a+1];o[u]=c.type==="index"||c.type==="slice"||c.type==="union"||c.type==="wildcard"?[]:{}}o=o[u]}break;case"wildcard":if(Array.isArray(o))if(s)for(let c=0;c<o.length;c++)o[c]=r;else{let c=n[a+1];for(let f=0;f<o.length;f++)o[f]||(o[f]=c.type==="index"||c.type==="slice"||c.type==="union"||c.type==="wildcard"?[]:{});o.length>0&&(o=o[0])}break}}}});function al(e,t,r){let n=new Uint8Array(t.length);e:for(let o=0;o<e.length;o++){for(let a=0;a<t.length;a++)if(!n[a]&&Se(e[o],t[a],r)){n[a]=1;continue e}return!1}return!0}var Se,Ys=F(()=>{"use strict";En();Se=(e,t,r={})=>{if(e===t)return!0;if(e==null||t==null||typeof e!=typeof t)return!1;let n=Array.isArray(e),o=Array.isArray(t);if(n!==o)return!1;if(n&&o)return e.length!==t.length?!1:r.unordered?al(e,t,r):e.every((p,v)=>Se(p,t[v],r));if(typeof e!="object")return e===t;let a=e instanceof Date,i=t instanceof Date;if(a!==i)return!1;if(a)return e.getTime()===t.getTime();let s=e instanceof RegExp,u=t instanceof RegExp;if(s!==u)return!1;if(s)return e.toString()===t.toString();let c=e instanceof Map,f=t instanceof Map;if(c!==f)return!1;if(c){if(e.size!==t.size)return!1;for(let[p,v]of e)if(!t.has(p)||!Se(v,t.get(p),r))return!1;return!0}let l=e instanceof Set,d=t instanceof Set;if(l!==d)return!1;if(l){if(e.size!==t.size)return!1;let p=[...t],v=new Uint8Array(p.length);e:for(let _ of e){for(let O=0;O<p.length;O++)if(!v[O]&&Se(_,p[O],r)){v[O]=1;continue e}return!1}return!0}if(!tr(e)||!tr(t))return!1;let h=Object.keys(e),y=Object.keys(t);if(h.length!==y.length)return!1;for(let p of h)if(!Object.prototype.hasOwnProperty.call(t,p)||!Se(e[p],t[p],r))return!1;return!0}});function Gs(e){let r=(()=>{try{return JSON.parse(sessionStorage.getItem(Xs)??"{}")}catch{return{}}})(),n=()=>{let c=Object.keys(r);for(let f of c.slice(0,Math.max(0,c.length-100)))delete r[f];try{sessionStorage.setItem(Xs,JSON.stringify(r))}catch{}},o=e.key,a=()=>{o!==void 0&&(delete r[o],r[o]=window.scrollY,n())},i=history.scrollRestoration;history.scrollRestoration="manual",window.addEventListener("pagehide",a);let s=c=>window.scrollTo({top:c,left:0,behavior:"instant"}),u=c=>{if(!c||c==="#")return!1;let f=document.getElementById(decodeURIComponent(c.slice(1)));return f?.scrollIntoView({behavior:"instant"}),f!==null};return{leave:a,arrive(c,f){if(o=c.key,c.action==="pop"||f===void 0){let l=c.key===void 0?void 0:r[c.key];l!==void 0&&s(l);return}c.action==="replace"&&c.pathname===f.pathname||u(c.hash)||s(0)},dispose(){window.removeEventListener("pagehide",a),history.scrollRestoration=i}}}var Xs,Zs=F(()=>{"use strict";Xs="fx:scroll"});function cl(e){return e.startsWith("//")?e.replace(/^\/+/,"/"):e}function et(e,t,r=!1){let n=[];if(e===t)return{params:{},path:t};if(!r&&e==="/"&&t.startsWith("/"))return{params:{},path:"/"};let o=e.replace(/:([a-zA-Z0-9_]+)/g,(u,c)=>(n.push(c),"([^/]+)")).replace(/\*([a-zA-Z0-9_]*)/g,(u,c)=>(c&&n.push(c),"(.*)"));o.startsWith("/")||(o="/"+o),o===""&&(o="/");let a=new RegExp(`^${o}${r?"$":"(?=/|$)"}`),i=t.match(a);if(!i)return null;let s={};return n.forEach((u,c)=>{s[u]=i[c+1]}),{params:s,path:i[0]}}function Qs(e){let t=e.path.split("/").filter(Boolean);if(t.length===0)return 5;let r=0;for(let n of t)n.startsWith("*")?r+=1:n.startsWith(":")?r+=10:r+=100;return r}function ul(e){return[...e].sort((t,r)=>Qs(r)-Qs(t))}function tt(e,t){let r=t.length>1?t.replace(/\/+$/,"")||"/":t,n=ea(e,r);if(!n)return null;let o=[],a="",i={};for(let s of n.layers){a=cl(fl(a,s.consumed));let u={};for(let[c,f]of Object.entries(s.params))c in i||(u[c]=f),i[c]=f;o.push({route:s.route,component:s.route.component,params:u,pathname:a||"/"})}return{matched:o,params:i,pathname:t}}function ea(e,t){if(!e||e.length===0)return null;let r=ul(e);for(let n of r){let o=!!n.children&&n.children.length>0,a=et(n.path,t,!o);if(a){if(o){let i=ea(n.children,t);if(i)return{layers:[{route:n,params:a.params,consumed:a.path},...i.layers]};continue}return{layers:[{route:n,params:a.params,consumed:a.path}]}}}return null}function fl(e,t){if(!e)return t;if(t===e)return e;if(t.startsWith(e))return t;let r=e.replace(/\/$/,""),n=t.replace(/^\//,"");return`${r}/${n}`}function dl(e){let t=e,r="",n=t.indexOf("#");n!==-1&&(r=t.slice(n),t=t.slice(0,n));let o="",a=t.indexOf("?");return a!==-1&&(o=t.slice(a),t=t.slice(0,a)),{pathname:t||"/",search:o,hash:r}}function rr(e="/"){let t=[{path:e,state:null,key:Me()}],r=0,n="pop",o=new Set,a=()=>o.forEach(i=>i());return{get(){let{path:i,state:s,key:u}=t[r];return{...dl(i),state:s,key:u,action:n}},push(i,s=null){t=t.slice(0,r+1),t.push({path:i,state:s,key:Me()}),r=t.length-1,n="push",a()},replace(i,s=null){t[r]={path:i,state:s,key:Me()},n="replace",a()},go(i){let s=r+i;s<0||s>=t.length||(r=s,n="pop",a())},subscribe(i){return o.add(i),()=>o.delete(i)}}}function Le(){let e=typeof window<"u"?window:void 0,t=new Set,r="pop",n=()=>t.forEach(i=>i());e&&e.addEventListener("popstate",()=>(r="pop",n()));let o=i=>typeof i=="object"&&i!==null&&typeof i.fx=="string",a=()=>{let i=e.history.state;if(o(i))return i;let s={fx:Me(),usr:i??null};return e.history.replaceState(s,""),s};return{window:e!==void 0,get(){if(!e)return{pathname:"/",search:"",hash:"",state:null};let{pathname:i,search:s,hash:u}=e.location,{fx:c,usr:f}=a();return{pathname:i,search:s,hash:u,state:f,key:c,action:r}},push(i,s=null){e?.history.pushState({fx:Me(),usr:s},"",i),r="push",n()},replace(i,s=null){e?.history.replaceState({fx:Me(),usr:s},"",i),r="replace",n()},subscribe(i){return t.add(i),()=>t.delete(i)}}}function pl(e){let t={};return e&&new URLSearchParams(e.startsWith("?")?e.slice(1):e).forEach((n,o)=>t[o]=n),t}function yl(e,t){if(!t)return e||"/";let r=t.replace(/\/$/,"");return e===r?"/":e.startsWith(r+"/")?e.slice(r.length)||"/":e||"/"}function hl(e,t){return!t||/^https?:\/\//.test(e)?e:`${t.replace(/\/$/,"")}${e.startsWith("/")?e:"/"+e}`}function ta(e){let{routes:t,history:r,base:n}=e,o=new Set,a=()=>{let f=r.get();return{pathname:f.pathname,search:f.search,hash:f.hash,state:f.state,query:pl(f.search),...f.key!==void 0?{key:f.key}:{},...f.action!==void 0?{action:f.action}:{}}},i=f=>tt(t,yl(f,n)),s=(()=>{let f=a();return{location:f,match:i(f.pathname)}})(),u=()=>{let f=a();s={location:f,match:i(f.pathname)},o.forEach(l=>l(s))},c=r.subscribe(u);return{state(){return s},subscribe(f){return o.add(f),()=>o.delete(f)},navigate(f,l={}){let d=hl(f,n);l.replace?r.replace(d,l.state??null):r.push(d,l.state??null)},match(f){return i(f)},destroy(){c(),o.clear()}}}var ll,Me,Tn=F(()=>{"use strict";ll=0,Me=()=>`${Date.now().toString(36)}-${(ll++).toString(36)}`});function ra(e){return Pn.add(e),()=>{Pn.delete(e)}}function oa(e,t,r={}){let{ttl:n=1/0,staleWhileRevalidate:o=!0}=r;return(...a)=>{let i=r.cache??ct(),s=t+":"+JSON.stringify(a),u=()=>{let f=i.inflight.get(s);if(f)return f;let l=Promise.resolve(e(...a)).then(d=>(i.set(s,{value:d,timestamp:Date.now()}),i.inflight.delete(s),d),d=>{throw i.inflight.delete(s),d});return i.inflight.set(s,l),l},c=i.get(s);return c&&(n===1/0||Date.now()-c.timestamp<=n)?Promise.resolve(c.value):c&&o?(u().then(na,()=>{}),Promise.resolve(c.value)):u()}}function nr(e,t){let r=typeof e=="string"?[e]:Array.isArray(e)?e:null;ia(r??e,t??ct()),r&&!t&&ml(r)}function ia(e,t){let r=Array.isArray(e)?n=>e.some(o=>n===o||n.startsWith(o+":")):e;for(let n of[...t.keys()])r(n)&&t.delete(n);na()}function ml(e){try{localStorage.setItem(sa,JSON.stringify({names:e,at:Date.now()+Math.random()}))}catch{}}function aa(e,t){let[r]=fe(t||(()=>!0),e);return r}function ca(e){return Rn.has(e)||Rn.set(e,b(void 0)),Rn.get(e)}function ua(e){return Cn.has(e)||Cn.set(e,b([])),Cn.get(e)}function $n(e,t,r={}){let n=t||e.name||"action",o=async(...a)=>{let i=a.length>1?a:a[0],[,s]=ca(n),[,u]=ua(n),c,f=()=>u(y=>y.filter(p=>p!==c)),l=y=>{u(p=>p.map(v=>v===c?y:v)),c=y},d=()=>{s(void 0),f()},h=()=>(f(),o(...a));c={input:i,pending:!0,clear:d,retry:h},s(c),u(y=>[...y,c]);try{let y=await e(...a);s({input:i,result:y,pending:!1,clear:d,retry:h}),f();let p=typeof r.invalidates=="function"?r.invalidates(y):r.invalidates;for(let v of p??[])nr(v);return y}catch(y){let p={input:i,error:y,pending:!1,clear:d,retry:h};throw s(p),l(p),y}};return o.url=n,o.with=a=>$n((...i)=>e(a,...i),t,r),o}function fa(e){let[t]=ca(e.url);return t}function la(e){let[t]=ua(e.url);return t}function da(e){return e}var Pn,na,sa,Rn,Cn,gl,ay,Nn=F(()=>{"use strict";x();x();yn();Pn=new Set;na=()=>{for(let e of[...Pn])e()};sa="fluixi:revalidate";typeof window<"u"&&window.addEventListener("storage",e=>{if(!(e.key!==sa||!e.newValue))try{let t=JSON.parse(e.newValue).names;Array.isArray(t)&&t.every(r=>typeof r=="string")&&ia(t,ct())}catch{}});globalThis[Symbol.for("fluixi.revalidate")]=e=>nr(e);Rn=new Map;Cn=new Map;gl=Ge(void 0,"route-data"),ay=gl.Provider});var ga={};jn(ga,{A:()=>Wn,ActionForm:()=>Rl,Link:()=>sr,Outlet:()=>Ln,Redirect:()=>In,Router:()=>Mn,action:()=>$n,cache:()=>oa,createAsync:()=>aa,createBrowserHistory:()=>Le,createMemoryHistory:()=>rr,lazy:()=>Pe,matchPath:()=>et,matchRoutes:()=>tt,prefersReducedMotion:()=>xn,preloadRoutes:()=>Cl,revalidate:()=>nr,runWithOwner:()=>M,select:()=>_l,supportsViewTransitions:()=>An,useAction:()=>da,useIsRouting:()=>Sl,useLevelParams:()=>xl,useLinkNavigation:()=>Ol,useLocation:()=>nt,useMatch:()=>qn,useNavigate:()=>ir,useParam:()=>Dn,useParamSelector:()=>kl,useParams:()=>rt,useRouteData:()=>El,useRouter:()=>Ie,useSearchParams:()=>Vn,useSubmission:()=>fa,useSubmissions:()=>la});function vl(e,t,r){let n,o=e.route.data;if(typeof o=="function"){let f=!1;S(()=>{f=!0});let l=P(),d=H(Ae),h=!1,y=T=>{h||f||(h=!0,M(l,()=>{let E=!0;k(()=>{T(),E?E=!1:A(()=>{_()})})}))},p,[v,{refetch:_}]=fe(()=>{let T=A(r.params),E=A(r.location);p=!1;let C=o({params:()=>T,location:()=>(p=!0,E)},l,()=>f,y);return d?d.trackLoad(C):C});S(ra(()=>{A(()=>r.matched()[t]?.route)===e.route&&_()}));let O=A(()=>JSON.stringify(r.matched()[t]?.params??{})),Y=A(()=>r.location().search);k(()=>{let T=r.matched()[t],E=r.location().search;if(T?.route!==e.route)return;let C=JSON.stringify(T.params??{}),j=C!==O,ne=p!==!1&&E!==Y;O=C,Y=E,(j||ne)&&A(()=>{_()})}),n=()=>{let T=v.error;if(T!=null)throw T;let E=v;return E.state==="refreshing"?E.latest:v()},Object.defineProperty(n,"loading",{get:()=>v.loading}),Object.defineProperty(n,"state",{get:()=>v.state})}let a=()=>ha.Provider({value:n,get children(){return ya.Provider({value:e.params,get children(){return pa.Provider({value:{depth:t,...r},get children(){return J(e.component,{})}})}})}});if(!n)return{view:a(),ready:()=>!0};let i=n,s=()=>{let f=i.state;return f===void 0?i.loading:f==="pending"||f==="unresolved"},[u,c]=b(A(()=>!s()));return k(()=>c(!s())),{view:w(()=>u()?a():null),ready:u}}function ma(e){let t=e.depth+1,[r,n]=b(A(()=>e.matched()[t]?.component));k(()=>{let c=e.matched()[t]?.component;A(r)!==c&&n(()=>c)});let o=P(),a=null,i=null,s=c=>c?.dispose();S(()=>{s(a),s(i),a=i=null});let u=w(()=>{if(!r())return null;let f=A(()=>e.matched())[t];return M(o,()=>W(l=>({...vl(f,t,{matched:e.matched,params:e.params,location:e.location}),dispose:l})))});return w(()=>{let c=u();return c?(c===a||(i&&i!==c&&s(i),i=c,a&&!c.ready())||(s(a),a=c,i=null),a.view):(s(a),s(i),a=i=null,e.notFound?e.notFound():null)})}function wl(e){return e==null?bl():typeof e=="function"?J(e,{}):e}function bl(){let e=be("div");N(e,"class","fx-not-found"),N(e,"role","main"),N(e,"style","min-height:60vh;display:grid;place-content:center;gap:.25rem;text-align:center;font-family:system-ui,-apple-system,sans-serif");let t=be("h1");N(t,"style","margin:0;font-size:2.5rem;font-weight:700"),K(t,"404");let r=be("p");return N(r,"style","margin:0;opacity:.7"),K(r,"This page could not be found."),e.appendChild(t),e.appendChild(r),e}function Mn(e){let t=e.history??Le(),r=ta({routes:e.routes,base:e.base,history:t}),[n,o]=b(r.state()),[a,i]=b(!1),[s,u]=b(0),c=0,f=t.window?Gs(r.state().location):void 0,l=f?{id:0,location:r.state().location,from:void 0}:null,[d,h]=b(0),y=()=>{let T=or??e.transition??"auto";return or=void 0,T},p=r.subscribe(T=>{let E=++c,C=y();i(!0),f&&(f.leave(),l={id:E,location:T.location,from:A(n).location});let j=Bs((T.match?.matched??[]).map(xe=>xe.component).filter(Boolean)),ne=()=>{o(T);let xe=po();return E===c&&i(!1),f&&h(E),xe};if(!j){kn(C,ne);return}j.then(()=>{if(E===c)return kn(C,ne)})});S(()=>{p(),f?.dispose(),r.destroy(),c++});let v=w(()=>(n().match?.matched??[]).filter(T=>T.component)),_={router:r,location:w(()=>n().location),params:w(()=>n().match?.params??{}),isRouting:()=>a()||s()>0,trackLoad(T){return T&&typeof T.finally=="function"&&(u(E=>E+1),T.finally(()=>u(E=>E-1)).catch(()=>{})),T}};if(f){let T=typeof requestAnimationFrame=="function"?requestAnimationFrame:E=>setTimeout(E,0);k(()=>{let E=d();if(_.isRouting())return;let C=l;!C||C.id!==E||E!==c||(l=null,T(()=>{E===c&&f.arrive(C.location,C.from)}))})}let O={depth:-1,matched:v,params:_.params,location:_.location,notFound:()=>wl(e.notFound)},Y;return Ae.Provider({value:_,get children(){return Y??=ma(O)}})}function Ln(){let e=H(pa);return e?ma(e):null}function Sl(e={}){let t=H(Ae)?.isRouting??(()=>!1),r=e.delay??0;if(r<=0)return t;let[n,o]=b(!1);return k(()=>{if(!t()){o(!1);return}let a=setTimeout(()=>o(!0),r);S(()=>clearTimeout(a))}),()=>t()&&n()}function In(e){let t=H(Ae);if(t&&typeof window<"u"){let r=!1;S(()=>r=!0),queueMicrotask(()=>{r||t.router.navigate(e.to,{replace:e.replace!==!1})})}return null}function Ie(){let e=H(Ae);if(e)return e;if(typeof window>"u")return Al;throw new Error("[router] useRouter must be used within <Router>")}function rt(){let e=Ie().params;return w(()=>e(),{},{equals:(t,r)=>JSON.stringify(t)===JSON.stringify(r)})}function xl(){return H(ya)??{}}function Dn(e){let t=rt();return w(()=>t()[e])}function kl(e,t){let r=rt();return w(()=>e(r()),void 0,t?{equals:t}:void 0)}function qn(e){let t=nt();return w(()=>et(typeof e=="function"?e():e,t.pathname))}function Vn(){let e=nt(),t=ir();return[w(()=>e.query),(o,a)=>{let i=new URLSearchParams(e.search);for(let[u,c]of Object.entries(o))c===null?i.delete(u):i.set(u,c);let s=i.toString();t(e.pathname+(s?`?${s}`:""),a)}]}function _l(e,t){let r=(n,o)=>Se(n,o);return t!==void 0?w(()=>er(e(),t),void 0,{equals:r}):w(e,void 0,{equals:r})}function nt(){let{location:e}=Ie();return new Proxy({},{get:(t,r)=>e()[r],has:(t,r)=>r in e(),ownKeys:()=>Reflect.ownKeys(e()),getOwnPropertyDescriptor:(t,r)=>Object.getOwnPropertyDescriptor(e(),r)})}function Ol(e={}){let t=H(Ae);return r=>{if(!t||r.defaultPrevented||r.button!==0||r.metaKey||r.ctrlKey||r.shiftKey||r.altKey)return;let o=r.target?.closest?.("a");if(!o||!o.getAttribute("href")||o.target&&o.target!=="_self"||o.hasAttribute("download")||/(^|\s)external(\s|$)/.test(o.getAttribute("rel")??""))return;let a=new URL(o.href);a.protocol!=="http:"&&a.protocol!=="https:"||a.origin===window.location.origin&&(a.hash&&a.pathname===window.location.pathname&&a.search===window.location.search||e.shouldNavigate&&!e.shouldNavigate(a,o)||(r.preventDefault(),or=e.transition,t.router.navigate(a.pathname+a.search+a.hash,{replace:e.replace})))}}function ir(){let{router:e}=Ie();return(t,r)=>{or=r?.transition,e.navigate(t,r)}}function El(){return H(ha)??(()=>{})}function sr(e){let t=H(Ae),r=()=>t.router.navigate(ce(e.href)??"",{replace:ce(e.replace)}),n=be("a");N(n,"href",ce(e.href)??""),e.slot&&N(n,"slot",ce(e.slot));for(let a of Object.keys(e)){if(Tl.has(a))continue;let i=e[a];if(typeof i=="function"){if(/^on[A-Z]/.test(a))continue;let s=i,u=()=>{let c=s();c==null||c===!1?n.removeAttribute?.(a):N(n,a,String(c))};typeof n.addEventListener=="function"?k(u):u();continue}i!=null&&N(n,a,String(i))}if(typeof n.addEventListener=="function")n.addEventListener("click",a=>{a.metaKey||a.ctrlKey||a.shiftKey||a.altKey||t&&(a.preventDefault(),r())});else{let a=ce(e.className??e.class)??"";a&&N(n,"class",a)}typeof n.addEventListener=="function"&&k(()=>{let a=ce(e.href)??"";n.setAttribute("href",a);let i=ce(e.className??e.class)??"",s=ce(e.activeClass)??"",u=ce(e.active)??t?.location().pathname===a;n.className=[i,u?s:""].filter(Boolean).join(" ")});let o=e.children;return o!=null&&K(n,o),n}function Rl(e){let t=e.action,r=e.className??e.class,n=t.url??"",o=be("form");N(o,"method","post"),n&&N(o,"action",n),r&&N(o,"class",r);for(let i of Object.keys(e)){if(i==="action"||i==="children"||i==="class"||i==="className")continue;let s=e[i];s!=null&&typeof s!="function"&&N(o,i,String(s))}typeof o.addEventListener=="function"&&o.addEventListener("submit",i=>{i.preventDefault();let s={};new FormData(o).forEach((u,c)=>{s[c]=u}),Promise.resolve(t(s)).catch(()=>{})});let a=e.children;return a!=null&&K(o,a),o}async function Cl(e,t){let r=tt(e,t);if(!r)return;let n=[];for(let o of r.matched){let a=o.component;a&&typeof a.preload=="function"&&n.push(a.preload())}await Promise.all(n)}var Ae,pa,ya,ha,or,Al,ce,Tl,Wn,Hn=F(()=>{"use strict";x();_n();q();x();En();Ys();Zs();Tn();Nn();Tn();Nn();Zt();_n();x();Ae=ee(void 0,"router"),pa=ee(void 0,"outlet"),ya=ee(void 0,"route-params"),ha=ee(void 0,"route-data");Al={router:{navigate:()=>{}},location:()=>({pathname:"",search:"",hash:"",query:{}}),params:()=>({}),isRouting:()=>!1,trackLoad:e=>e};ce=e=>typeof e=="function"?e():e,Tl=new Set(["href","slot","class","className","active","activeClass","replace","children"]);Wn=sr});var $l={};jn($l,{$component:()=>fn,A:()=>Wn,ClientOnly:()=>an,DEV:()=>Je,Dynamic:()=>gs,ErrorBoundary:()=>bs,FRAMEWORK_NAME:()=>Vs,For:()=>ps,Fragment:()=>hn,Index:()=>ys,Link:()=>sr,Match:()=>hs,NoSsr:()=>ws,Outlet:()=>Ln,Portal:()=>vs,Redirect:()=>In,Router:()=>Mn,Show:()=>ds,Store:()=>wt,Suspense:()=>Xe,Switch:()=>ms,VERSION:()=>qs,addClass:()=>Hi,batch:()=>D,classMap:()=>Ss,cleanupDelegation:()=>Ps,composeProviders:()=>$s,createBrowserHistory:()=>Le,createComponent:()=>Ce,createComputed:()=>lo,createContext:()=>Ge,createDebounce:()=>So,createDeferred:()=>bo,createEffect:()=>k,createIsomorphicState:()=>Ms,createMemo:()=>w,createMemoryHistory:()=>rr,createProvider:()=>pn,createRenderEffect:()=>$,createResource:()=>fe,createRoot:()=>W,createSelector:()=>wo,createSignal:()=>b,createStore:()=>Tr,delegateEvents:()=>we,devOnly:()=>dn,getFrameworkInfo:()=>Nf,getOwner:()=>P,getSharedConfig:()=>un,hydrate:()=>jt,initDelegation:()=>Cs,insert:()=>K,isDOMNode:()=>Vt,isDev:()=>ln,isLitTemplateResult:()=>Fi,isRenderable:()=>Rs,jsx:()=>mn,jsxs:()=>Ds,lazy:()=>Pe,mount:()=>wa,onCleanup:()=>S,onMount:()=>Ut,onUnmount:()=>zt,portal:()=>Ts,read:()=>Io,reduce:()=>Lo,removeClass:()=>Ki,render:()=>$e,requireContext:()=>Ns,runWithOwner:()=>M,setAttribute:()=>N,setOwner:()=>uo,setProperty:()=>ve,spread:()=>us,startClient:()=>ba,styleMap:()=>As,toggleClass:()=>ji,untrack:()=>A,untrackStore:()=>Rr,useCallback:()=>Gt,useContext:()=>Ze,useEffect:()=>Ye,useEventListener:()=>Xt,useLocation:()=>nt,useMatch:()=>qn,useMemo:()=>Bt,useNavigate:()=>ir,useParam:()=>Dn,useParams:()=>rt,useReducer:()=>Yt,useRef:()=>Jt,useRouter:()=>Ie,useSearchParams:()=>Vn});x();x();var wr="1.0.0-alpha.97",No=wr.split(".")[0],Eo=`__fluixi_signal_state_v${No}__`,ac=`__fluixi_signal_builds_v${No}__`,cc=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)};function Mo(){return{consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:cc,onSuspend:null,onError:null,observer:null}}var vr=globalThis;function uc(e){let t=Mo(),r=e;for(let n of Object.keys(t))n in e||(r[n]=t[n]);return e}function fc(){let e=vr[Eo];return e?uc(e):vr[Eo]=Mo()}var R=fc();(vr[ac]??=[]).push(wr);function lc(e){return R.observer=e,()=>{R.observer===e&&(R.observer=null)}}var br=[],dc,To;function pc(e){let t=R.observer;t&&t.created(e.parents===void 0?{...e,parents:br,origin:e.origin??dc,scope:e.scope??To}:{...e,scope:e.scope??To})}function yc(e){return R.observer?(br.push(e),!0):!1}function hc(){br.pop()}function mc(e){R.observer?.ran?.(e)}function gc(e){R.observer?.disposed?.(e)}var vc="__FLUIXI_DEVTOOLS_HOOK__",Ro=globalThis[vc];if(typeof Ro?.inject=="function")try{Ro.inject({observeReactiveNodes:lc,version:wr})}catch{}function wc(){return R.observer!=null}var Co=0,Po=1,ut=2,bc=class{constructor(){this.observers=null,this.watchers=null,this.version=0}updateIfNecessary(){}track(){if(R.untracked)return;let e=R.consumer;e&&((this.observers??=new Set).add(e),(e.sources??=new Set).add(this))}};var Sc=class extends bc{constructor(e,t){super(),this._threw=!1,this._initialized=!1,this.state=ut,this.sources=null,this._fn=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){if(R.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===Po&&this.sources){for(let e of this.sources)if(e.updateIfNecessary(),this.state===ut)break}(this.state===ut||!this._initialized)&&this.recompute(),this.state=Co}recompute(){if(this.sources){for(let s of this.sources)s.observers?.delete(this);this.sources.clear()}let e=R.consumer,t=R.untracked,r=yc(this);R.consumer=this,R.untracked=!1;let n,o=!1,a;try{n=this._fn()}catch(s){o=!0,a=s,n=this._value}finally{R.consumer=e,R.untracked=t,r&&hc()}let i=!this._initialized||this._threw!==o||(o?a!==this._error:!this._equals(this._value,n));if(this._initialized=!0,this._threw=o,this._error=a,this._value=n,mc(this),i){if(this.version++,this.observers)for(let s of[...this.observers])s.markDirty(ut);$o(this)}}markDirty(e){if(this.state>=e)return;let t=this.state===Co;if(this.state=e,t){if(this.observers)for(let r of[...this.observers])r.markDirty(Po);$o(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};function $o(e){if(e.watchers)for(let t of[...e.watchers])t._notify(e)}function Ac(e){return R.onSuspend?(R.onSuspend(e,R.owner),!0):!1}function xc(){return R.owner}function kc(e,t){let r=R.owner;R.owner=e;try{return t()}finally{R.owner=r}}function _c(e){if(R.owner){if(R.owner.disposed){e();return}(R.owner.cleanups??=[]).push(e)}}function Oc(e){R.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function Ec(e){return!!e&&typeof e.then=="function"}Oc(()=>{});var Tc=Symbol.for("signal"),Rc=Symbol.for("memo");function Cc(e,t,r){let n=t,o=xc(),a=new Sc(()=>kc(o,()=>{try{return n=e(n)}catch(s){if(Ec(s))return Ac(s),n;throw s}}),{equals:r?.equals}),i=(()=>a.get());return Object.defineProperty(i,Tc,{value:!0,enumerable:!0}),Object.defineProperty(i,Rc,{value:!0,enumerable:!0}),pc({kind:"memo",node:a,handle:i,name:r?.name}),wc()&&_c(()=>gc(a)),i}function Lo(e,t,r,n){return Cc(()=>e().reduce(t,r),void 0,n)}function Io(e){let t=e;for(;typeof t=="function";)t=t();return t}x();var Er="1.0.0-alpha.97",Xo=Er.split(".")[0],Do=`__fluixi_signal_state_v${Xo}__`,Pc=`__fluixi_signal_builds_v${Xo}__`,$c=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)};function Go(){return{consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:$c,onSuspend:null,onError:null,observer:null}}var Sr=globalThis;function Nc(e){let t=Go(),r=e;for(let n of Object.keys(t))n in e||(r[n]=t[n]);return e}function Mc(){let e=Sr[Do];return e?Nc(e):Sr[Do]=Go()}var de=Mc();(Sr[Pc]??=[]).push(Er);function Lc(e){return de.observer=e,()=>{de.observer===e&&(de.observer=null)}}var Ic=[],ft;function Dc(e,t){if(!de.observer)return t();let r=ft;ft=e;try{return t()}finally{ft=r}}var qo;function qc(e){let t=de.observer;t&&t.created(e.parents===void 0?{...e,parents:Ic,origin:e.origin??ft,scope:e.scope??qo}:{...e,scope:e.scope??qo})}function Vo(e,t,r){de.observer?.moved?.(e,t,r)}function Wo(e){de.observer?.disposed?.(e)}var Vc="__FLUIXI_DEVTOOLS_HOOK__",Ho=globalThis[Vc];if(typeof Ho?.inject=="function")try{Ho.inject({observeReactiveNodes:Lc,version:Er})}catch{}function Zo(){return de.observer!=null}var pt=Symbol("store-raw"),Ko=Symbol("store-node"),jo=Symbol("store-has"),Fo=Symbol("store-self"),Uo=Symbol("store-track");var He=new WeakMap,Ar=new WeakMap,Ee=new WeakMap,yt=new WeakMap;function Wc(e,t){if(!Oe(e)||!Zo())return;let r=new Set,n=i=>{if(!(!Oe(i)||r.has(i))){r.add(i);for(let s of Object.values(i))n(s)}};n(yt.get(t)??t);let o=new Set,a=i=>{if(!Oe(i))return;let s=i;if(r.has(s)||o.has(s))return;o.add(s);let u=He.get(s);if(u){for(let c of u.keys.values())Wo(c);u.all&&Wo(u.all),He.delete(s),Ee.delete(s),Ar.delete(s)}for(let c of Object.values(s))a(c)};a(e)}var ht=(e,t,r)=>r?`${e}[${String(t)}]`:`${e}.${String(t)}`;function Qo(e,t,r){let n=t?.owner,o=n&&r!==void 0?ht(n.name,r,t?.array):void 0,[a,i]=Dc(n?.store,()=>b(e,o?{name:o}:void 0)),s=a;return s.$=i,s}function mt(e){let t=He.get(e);return t?t.owner||(t.owner=Ee.get(e)):He.set(e,t={keys:new Map,owner:Ee.get(e),array:Array.isArray(e)}),t}function zo(e,t,r){let n=e.keys.get(t);return n||e.keys.set(t,n=Qo(r,e,t)),n}function Hc(e,t,r,n){let o=Ee.get(e);if(o&&o.store===t&&o.name===r)return;let a={store:t,name:r};Ee.set(e,a),yt.set(e,yt.get(n)??n);let i=He.get(e);if(i&&(i.owner=a,!!Zo())){for(let[s,u]of i.keys)Vo(u,t,ht(r,s,i.array));i.all&&Vo(i.all,t,ht(r,"*",i.array))}}function Bo(e){let t=mt(e);(t.all||(t.all=Qo(void 0,t,"*")))()}function Jo(e,t){e.$(typeof t=="function"?()=>t:t)}function Oe(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 lt(e){if(!Oe(e))return e;let t=Ar.get(e);if(t)return t;let r=new Proxy(e,Kc);return Ar.set(e,r),r}var Kc={get(e,t,r){if(t===pt||t===Ko)return e;if(t===_e)return r;if(t===jo)return u=>u in e;if(t==="__proxy")return!0;if(t===Uo||t===Fo)return Bo(e),r;let n=e[t];if(typeof n=="function"&&!Object.prototype.hasOwnProperty.call(e,t))return n;let o=Object.getOwnPropertyDescriptor(e,t);if(o&&o.get)return o.get.call(r);let a=mt(e),i=zo(a,t,n),s=i();return Oe(s)?(a.owner&&Hc(s,i,ht(a.owner.name,t,a.array),e),lt(s)):s},set(){return!0},deleteProperty(e,t){return t in e&&te(e,t,void 0),!0},has(e,t){return t===pt||t===_e||t===Ko||t===jo||t===Fo||t===Uo?!0:(zo(mt(e),t,e[t])(),t in e)},ownKeys(e){return Bo(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e,t)}};function ei(e,t=new Set){if(e==null||typeof e!="object")return e;let r=e[pt]??e;if(t.has(r)||!Oe(r))return r;t.add(r);let n=!1,o=i=>{let s=ei(i,t);return s!==i&&(n=!0),s};if(Array.isArray(r)){let i=r.map(o);return n?i:r}let a={};for(let i of Object.keys(r))a[i]=o(r[i]);return n?a:r}function te(e,t,r){let n=ei(r),o=e[t];if(o===n&&(n!==void 0||t in e))return;let a=Array.isArray(e),i=a?e.length:0;n===void 0?delete e[t]:e[t]=n;let s=mt(e),u=s.keys.get(t);if(u&&Jo(u,n),Wc(o,e),a&&e.length!==i){let c=s.keys.get("length");c&&Jo(c,e.length)}s.all&&s.all.$(void 0)}function xr(e,t){return typeof e=="function"?e(t):e}function kr(e,t){for(let r of Object.keys(t)){let n=t[r],o=e[r];n&&typeof n=="object"&&!Array.isArray(n)&&o&&typeof o=="object"&&!Array.isArray(o)?kr(o,n):te(e,r,n)}}function vt(e){let t=[],r=e.replace(/\[([^\]]*)\]/g,".$1");for(let n of r.split("."))n.length&&t.push(n);return t}function ti(e,t,r){let n=t.length-1;for(let a=0;a<n;a++){let i=t[a];if(i==="*"){let u=t.slice(a+1);if(Array.isArray(e))for(let c=0;c<e.length;c++)ti(e[c],u,r);return}let s=e[i];(s==null||typeof s!="object")&&(s=/^\d+$/.test(t[a+1])?[]:{},te(e,i,s)),e=s}let o=t[n];if(o==="*"){if(Array.isArray(e))for(let a=0;a<e.length;a++)te(e,a,xr(r,e[a]));return}te(e,o,xr(r,e[o]))}function Yo(e,t,r){ti(e,vt(t),r)}function jc(e){return Array.isArray(e)&&e.length>0&&e.every(t=>Array.isArray(t)&&t.length>=2&&typeof t[0]=="string")}function dt(e,t){for(let r=e.length-1;r>=t.length;r--)te(e,String(r),void 0);e.length!==t.length&&te(e,"length",t.length);for(let r=0;r<t.length;r++)te(e,String(r),t[r])}function Fc(e,t){let r=t[0];if(typeof r=="function"&&t.length===1){let n=r(e);n&&n!==e&&kr(e,n);return}if(Array.isArray(r)&&t.length===1){if(jc(r)){for(let n of r)Yo(e,n[0],n[1]);return}if(Array.isArray(e)){dt(e,r);return}if(r.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(r&&typeof r=="object"&&!Array.isArray(r)&&t.length===1){kr(e,r);return}if(t.length>=3){_r(e,t.slice(0,-1),t[t.length-1]);return}Yo(e,String(r),t[1])}function Uc(e,t){if(typeof t=="function"){if(!Array.isArray(e))return[];let r=[];for(let n=0;n<e.length;n++)t(e[n],n)&&r.push(n);return r}if(Array.isArray(t))return Array.isArray(e)?t.map(Number):t.map(String);if(t&&typeof t=="object"&&("from"in t||"to"in t||"by"in t)){if(!Array.isArray(e))return[];let r=t.by??1,n=t.from??0,o=t.to??e.length-1,a=[];for(let i=n;i<=o;i+=r)i>=0&&i<e.length&&a.push(i);return a}return t==="*"?Array.isArray(e)?e.map((r,n)=>n):Object.keys(e??{}):[t]}function _r(e,t,r){if(e==null)return;let[n,...o]=t;if(typeof n=="string"){let i=vt(n);if(i.length>1){_r(e,[...i,...o],r);return}}let a=Uc(e,n);if(o.length===0){for(let i of a)te(e,i,xr(r,e[i]));return}for(let i of a){let s=e[i];if(s==null||typeof s!="object"){let u=o[0];s=typeof u=="number"||/^\d+$/.test(String(u))?[]:{},te(e,i,s)}_r(s,o,r)}}function Or(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(Or);let t={};for(let r of Object.keys(e))t[r]=Or(e[r]);return t}function le(e,t){let r=e;for(let n of vt(t)){if(r==null)return;r=r[n]}return r}var wt=class{constructor(e,t={immutable:!0}){this.options=t,this.root=e,this.set=((...r)=>D(()=>Fc(this.root,r))),e&&typeof e=="object"&&(Ee.set(e,{store:this,name:t.name??"store"}),yt.set(e,e)),qc({kind:"store",node:this,handle:()=>this.root,name:t.name})}get state(){return lt(this.root)}get proxy(){return lt(this.root)}get accessor(){return(()=>lt(this.root))}unwrap(){return this.root}getNode(e){return this.root&&this.root[e]}get(e){if(e==null||e==="")return gt(this.state);let t=this.state;for(let r of vt(e)){if(t==null)return;t=t[r]}return gt(t)}select(e){return w(()=>e(this.state))}subscribe(e){return k(()=>e(this.state))}watch(e,t){let r;return k(()=>{let n=e(this.state);Object.is(n,r)||(t(n,r),r=n)})}reactive(e){return w(()=>this.state[e])}produce(e){this.set((t=>{let r=Or(t);return e(r),r}))}reconcile(e,t={}){this.set(e)}push(e,...t){let r=le(this.root,e);this.set(e,r.concat(t))}pop(e){let t=le(this.root,e).slice(),r=t.pop();return this.set(e,t),r}shift(e){let t=le(this.root,e).slice(),r=t.shift();return this.set(e,t),r}splice(e,t,r,...n){let o=le(this.root,e).slice(),a=o.splice(t,r,...n);return this.set(e,o),a}insert(e,t,r){let n=le(this.root,e).slice();n.splice(t,0,r),this.set(e,n)}removeAt(e,t){let r=le(this.root,e).slice(),n=r.splice(t,1);return this.set(e,r),n}replace(e,t){if(arguments.length>=2){let n=le(this.root,String(e)),o=t;if(Array.isArray(n)&&Array.isArray(o)){dt(n,o);return}this.set(e,o);return}let r=this.root;if(Array.isArray(r)&&Array.isArray(e)){dt(r,e);return}this.set(e)}clear(e){let t=e===void 0?this.root:le(this.root,e);if(Array.isArray(t)){dt(t,[]);return}if(t&&typeof t=="object")for(let r of Object.keys(t))te(t,r,void 0)}toObservable(){let[e]=b(this.state);return e.toObservable()}dispose(){}},zc=["get","select","watch","subscribe","produce","reconcile","push","pop","shift","splice","insert","removeAt","replace","clear","unwrap","toObservable"];function Bc(e,t){for(let r of zc)e[r]=t[r].bind(t);e.$=t.reactive.bind(t)}function Tr(e,t={immutable:!0}){let r=new wt(e,t);return Bc(r.set,r),[r.proxy,r.set]}function Jc(e,t={}){return new wt(e,{...t,immutable:!1})}function gt(e){if(e==null||typeof e!="object")return e;let t=e[pt];return t!==void 0?t:e}function Rr(e){return A(()=>gt(e))}var Fl=Object.freeze({createStore:Tr,createMutableStore:Jc,batch:D,unwrap:gt,untrackStore:Rr});q();x();q();var xs="1.0.0-alpha.97";q();Ui(xs);q();q();q();x();var kf={context:null,owner:null};function un(){return kf}var Je=typeof process<"u"&&!1,cn=Symbol.for("fluixi-lifecycle");function ks(){let e=P();if(!e)return null;if(!e[cn]){let t={mounts:[],effects:[],scheduled:!1};e[cn]=t}return e[cn]}function _s(e){if(e.scheduled)return;if(V()){e.mounts=[],e.effects=[];return}e.scheduled=!0;let t=P();queueMicrotask(()=>{if(so(t)){e.mounts=[],e.effects=[];return}M(t,()=>{for(let r of e.mounts)try{let n=r();typeof n=="function"&&S(n)}catch(n){console.error("Error in onMount callback:",n)}for(let r of e.effects){let n;k(()=>{n&&n(),n=r()}),S(()=>{n&&n()})}e.mounts=[],e.effects=[]})})}function Ce(e,t){return J(e,t)}function fn(e,t){let r=typeof e=="function"?A(()=>e(t)):e,n=r!=null&&(typeof r=="function"||typeof r=="object");if(n)try{r.$name=e.name}catch{}return n&&!I(r)?Be(r):r}function Ut(e,t=!0){if(V())return;let r=ks();if(r){if(!t){r.scheduled||e();return}r.mounts.push(e),_s(r)}else{if(!t){e();return}k(()=>{let n=A(e);typeof n=="function"&&S(n)})}}function zt(e){S(e)}function Ye(e){let t=ks();if(t)t.effects.push(e),_s(t);else{let r;k(()=>{r&&r(),r=e()}),S(()=>{r&&r()})}}function Bt(e){return w(e)}function Jt(e){let t={current:e};return S(()=>{t.current=null}),t}function Yt(e,t){let[r,n]=b(t);return[r,a=>{n(e(r(),a))}]}function Xt(e,t,r,n){Ye(()=>{let o=e&&"current"in e?e.current:e;if(o)return o.addEventListener(t,r,n),()=>{o.removeEventListener(t,r,n)}})}function Gt(e){return e}function ln(){return Je}function dn(e){Je&&e()}x();q();function Os(e){return!!(e&&typeof e=="object"&&typeof e.then=="function"||e instanceof Promise)}var _f=ee(void 0,"suspense-list");function Xe(e){return J(Of,e)}function Of(e){let t=xo(),r=H(_f),n=r?r.register(t.inFallback):void 0;function o(l){return l==null||typeof l=="boolean"?null:typeof l=="function"&&se(l)&&!I(l)?l():l}let a=Xi(()=>o(e.fallback??null)),i=gr(t,()=>We(()=>e.children)),s=(l,d)=>{if(!(d>8))if(Array.isArray(l))for(let h of l)s(h,d+1);else typeof l=="function"&&I(l)&&s(l(),d+1)};gr(t,()=>{$(()=>s(i,0))});let[u,c]=b(void 0),f=Os(i);return f&&(t.increment(),i.then(l=>{c(()=>l),t.decrement()},()=>t.decrement())),w(()=>(n?n.showFallback():t.inFallback())?a:f?u():i)}Bi(Xe);Object.defineProperty(Xe,"__suspense",{value:!0,enumerable:!0});Zt();Zt();function $e(e,t,r={}){if(we(["click","input","change","submit"]),V())throw new Error("render() is for client-side only. Use renderToString() on server.");if(!t)throw new Error("Container element is required");let n;return W(o=>{n=o;let a=typeof e=="function"?e():e;t.textContent="",Wt(t),Ht(),K(t,()=>a)}),()=>{n&&(n(),n=void 0)}}function Ef(e){return e&&typeof e=="object"&&(e._$litType$!==void 0||e._$litDirective$!==void 0)}function Ts(e,t,r={}){let n=document.createElement("div");n.setAttribute("data-portal","true"),t.appendChild(n);let o=$e(e,n,r);return()=>{o(),t.contains(n)&&t.removeChild(n)}}function Rs(e){return!!(e==null||typeof e=="function"||Vt(e)||Ef(e)||Array.isArray(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean")}function Cs(){V()||we(["click","input","change","submit"])}function Ps(){V()}yn();x();q();var Tf="__fluixi_iso_states__",Rf="__iso:";function Cf(){return globalThis[Tf]??=new Map}function Pf(e){if(typeof window>"u")return;let t=on();return t?t[Rf+e]:void 0}function Ms(e,t){let r=Pf(e),n=r!==void 0?r:typeof window<"u"&&t.client?t.client():t.fallback,[o,a]=b(n,{name:e});return Cf().set(e,{server:t.server,set:a}),{value:o,set:a,key:e}}q();q();q();q();q();x();var hn=Symbol.for("fluixi.fragment"),Ls=typeof window>"u";function Is(e){return e==null||e===!1?null:Array.isArray(e)?e.map(Is).flat():e}function mn(e,t,r){if(e==null)return null;let n=t||{};if(r!==void 0&&(n.key=r),e===hn)return w(()=>Be(Is(n.children)));if(typeof e=="function"){let{type:o}=Ji(e);return e.$$typeof===Symbol.for("react.provider")||o==="provider"?e(n):Ls?{type:e,props:n}:w(()=>J(e,n),void 0,{name:"jsx component"})}return typeof e=="string"&&e.trim().length>0?$f(e,n):null}var Ds=mn;function $f(e,t){return Ls?{type:e,props:t||{}}:sn(e,t)}var qs="0.0.1",Vs="Fluixi";function Nf(){return{name:Vs,version:qs,features:{ssr:!0,hydration:!0,jsx:!0,litHtml:!0,signals:!0,fineGrained:!0,lazy:!0,hooks:!0,devMode:!0}}}q();var Mf=!1,Ws=new Map;function gn(e){Mf=e}function Lf(){Ws.clear()}function Hs(){if(typeof window>"u")return!1;let e=document.getElementById("__FLUIXI_HYDRATION__");if(!e||e.getAttribute("type")!=="application/json")return!1;try{let t=e.textContent||"{}",r=JSON.parse(t);for(let[n,o]of Object.entries(r))Ws.set(n,o);return!0}catch(t){return console.error("Failed to deserialize hydration data:",t),!1}}function vn(){if(typeof window>"u")return;let e=document.getElementById("__FLUIXI_HYDRATION__");e&&e.remove();let t=document.createTreeWalker(document.body,NodeFilter.SHOW_COMMENT,null),r=[],n;for(;n=t.nextNode();){let o=n,a=o.nodeValue||"";(a.startsWith("#")||a.startsWith("/"))&&r.push(o)}r.forEach(o=>o.remove()),Lf()}typeof window<"u"&&window.addEventListener("load",()=>{setTimeout(vn,100)});x();x();x();var If=Object.defineProperty,Df=(e,t)=>{for(var r in t)If(e,r,{get:t[r],enumerable:!0})};function ae(e){return typeof e=="function"?e():e}function qf(e){if(typeof e=="string")return e;let t=[];return t.push(e.index===!1?"noindex":"index"),t.push(e.follow===!1?"nofollow":"follow"),e.noarchive&&t.push("noarchive"),e.nosnippet&&t.push("nosnippet"),e.noimageindex&&t.push("noimageindex"),e.maxSnippet!=null&&t.push(`max-snippet:${e.maxSnippet}`),e.maxImagePreview&&t.push(`max-image-preview:${e.maxImagePreview}`),e.maxVideoPreview!=null&&t.push(`max-video-preview:${e.maxVideoPreview}`),t.join(", ")}function Ks(){let e=[],[t,r]=b(0);return{sources:e,version:t,push(n){return e.push(n),r(o=>o+1),()=>{let o=e.indexOf(n);o!==-1&&(e.splice(o,1),r(a=>a+1))}}}}var wn=globalThis[Symbol.for("fluixi.head")]??={active:null,scope:null};function js(e){wn.active=e}function Vf(){return wn.scope?.()??wn.active}function Ne(e){let t=Vf();if(!t)return globalThis.process?.env?.NODE_ENV!=="production"&&console.warn("[fluixi/head] useHead() called with no active head registry — ignored."),()=>{};let r=t.push(e);return typeof window<"u"&&P()&&S(r),r}function Qt(e){let t=5381;for(let r=0;r<e.length;r++)t=t*33^e.charCodeAt(r);return(t>>>0).toString(36)}function Wf(e){return e.charset!=null?"meta:charset":e.property?"meta:property:"+e.property:e.name?"meta:name:"+e.name:e["http-equiv"]?"meta:http-equiv:"+e["http-equiv"]:"meta:"+Qt(JSON.stringify(e))}function Hf(e,t){let r=typeof t=="string"?{url:t}:t;e.push({tag:"meta",key:"meta:property:og:image:"+r.url,attrs:{property:"og:image",content:r.url}}),r.secureUrl&&e.push({tag:"meta",key:"meta:property:og:image:secure:"+r.url,attrs:{property:"og:image:secure_url",content:r.secureUrl}}),r.type&&e.push({tag:"meta",key:"meta:property:og:image:type:"+r.url,attrs:{property:"og:image:type",content:r.type}}),r.width!=null&&e.push({tag:"meta",key:"meta:property:og:image:width:"+r.url,attrs:{property:"og:image:width",content:String(r.width)}}),r.height!=null&&e.push({tag:"meta",key:"meta:property:og:image:height:"+r.url,attrs:{property:"og:image:height",content:String(r.height)}}),r.alt&&e.push({tag:"meta",key:"meta:property:og:image:alt:"+r.url,attrs:{property:"og:image:alt",content:r.alt}})}function Kf(e,t){let r=(n,o)=>{o!=null&&t.push({tag:"meta",key:"meta:property:og:"+n,attrs:{property:"og:"+n,content:o}})};r("title",e.title),r("description",e.description),r("type",e.type),r("url",e.url),r("site_name",e.siteName),r("locale",e.locale);for(let n of e.localeAlternate??[])t.push({tag:"meta",key:"meta:property:og:locale:alt:"+n,attrs:{property:"og:locale:alternate",content:n}});if(e.image!=null){let n=Array.isArray(e.image)?e.image:[e.image];for(let o of n)Hf(t,o)}if(e.video){let n=typeof e.video=="string"?{url:e.video}:e.video;r("video",n.url),"type"in n&&n.type&&r("video:type",n.type),"width"in n&&n.width!=null&&r("video:width",String(n.width)),"height"in n&&n.height!=null&&r("video:height",String(n.height))}if(e.audio){let n=typeof e.audio=="string"?{url:e.audio}:e.audio;r("audio",n.url),"type"in n&&n.type&&r("audio:type",n.type)}if(e.article){let n=e.article;r("article:published_time",n.publishedTime),r("article:modified_time",n.modifiedTime),r("article:expiration_time",n.expirationTime),r("article:section",n.section);for(let o of[].concat(n.author??[]))t.push({tag:"meta",key:"meta:property:og:article:author:"+o,attrs:{property:"article:author",content:o}});for(let o of[].concat(n.tag??[]))t.push({tag:"meta",key:"meta:property:og:article:tag:"+o,attrs:{property:"article:tag",content:o}})}if(e.book){let n=e.book;r("book:isbn",n.isbn),r("book:release_date",n.releaseDate);for(let o of[].concat(n.author??[]))t.push({tag:"meta",key:"meta:property:og:book:author:"+o,attrs:{property:"book:author",content:o}});for(let o of[].concat(n.tag??[]))t.push({tag:"meta",key:"meta:property:og:book:tag:"+o,attrs:{property:"book:tag",content:o}})}if(e.profile){let n=e.profile;r("profile:first_name",n.firstName),r("profile:last_name",n.lastName),r("profile:username",n.username),r("profile:gender",n.gender)}}function jf(e,t){let r=(n,o)=>{o!=null&&t.push({tag:"meta",key:"meta:name:twitter:"+n,attrs:{name:"twitter:"+n,content:o}})};r("card",e.card),r("site",e.site),r("creator",e.creator),r("title",e.title),r("description",e.description),r("image",e.image),r("image:alt",e.imageAlt),r("player",e.player),e.playerWidth!=null&&r("player:width",String(e.playerWidth)),e.playerHeight!=null&&r("player:height",String(e.playerHeight)),e.app&&(r("app:name:iphone",e.app.name),r("app:id:iphone",e.app.idIphone),r("app:id:ipad",e.app.idIpad),r("app:id:googleplay",e.app.idGooglePlay))}function Ff(e,t){let r=(n,o)=>t.push({tag:"link",key:n,attrs:o});if(e.icon!=null){let n=typeof e.icon=="string"?[{url:e.icon}]:e.icon;for(let o of n)r("link:icon:"+o.url,{rel:"icon",href:o.url,...o.type?{type:o.type}:{},...o.sizes?{sizes:o.sizes}:{}})}if(e.apple!=null){let n=typeof e.apple=="string"?[{url:e.apple}]:e.apple;for(let o of n)r("link:apple-touch-icon:"+o.url,{rel:"apple-touch-icon",href:o.url,...o.sizes?{sizes:o.sizes}:{}})}e.mask&&r("link:mask-icon",{rel:"mask-icon",href:e.mask.url,...e.mask.color?{color:e.mask.color}:{}}),e.shortcut&&r("link:shortcut",{rel:"shortcut icon",href:e.shortcut}),e.msTileImage&&t.push({tag:"meta",key:"meta:name:msapplication-TileImage",attrs:{name:"msapplication-TileImage",content:e.msTileImage}}),e.msTileColor&&t.push({tag:"meta",key:"meta:name:msapplication-TileColor",attrs:{name:"msapplication-TileColor",content:e.msTileColor}})}function Uf(e,t,r){let n=(d,h)=>t.push({tag:"meta",key:d,attrs:h}),o=ae(e.title);o!==void 0&&(r.title=o),e.titleTemplate!==void 0&&(r.template=e.titleTemplate);let a=ae(e.lang);a!==void 0&&t.push({tag:"htmlAttr",key:"html:lang",name:"lang",value:a});for(let[d,h]of Object.entries(e.htmlAttrs??{})){let y=ae(h);y!==void 0&&t.push({tag:"htmlAttr",key:`html:${d}`,name:d,value:y})}e.charset!==void 0&&n("meta:charset",{charset:e.charset}),e.viewport!==void 0&&n("meta:name:viewport",{name:"viewport",content:e.viewport});let i=ae(e.description);i!==void 0&&n("meta:name:description",{name:"description",content:i});let s=ae(e.keywords);s!==void 0&&n("meta:name:keywords",{name:"keywords",content:Array.isArray(s)?s.join(", "):s}),e.author!==void 0&&n("meta:name:author",{name:"author",content:e.author}),e.robots!==void 0&&n("meta:name:robots",{name:"robots",content:qf(e.robots)}),e.generator!==void 0&&n("meta:name:generator",{name:"generator",content:e.generator}),e.applicationName!==void 0&&n("meta:name:application-name",{name:"application-name",content:e.applicationName}),e.referrer!==void 0&&n("meta:name:referrer",{name:"referrer",content:e.referrer});let u=ae(e.colorScheme);u!==void 0&&n("meta:name:color-scheme",{name:"color-scheme",content:u});let c=ae(e.themeColor);if(typeof c=="string")n("meta:name:theme-color",{name:"theme-color",content:c});else if(c)for(let{color:d,media:h}of c)n(`meta:name:theme-color${h?`:${h}`:""}`,h?{name:"theme-color",content:d,media:h}:{name:"theme-color",content:d});let f=ae(e.canonical);if(f!==void 0&&t.push({tag:"link",key:"link:rel:canonical",attrs:{rel:"canonical",href:f}}),e.manifest!==void 0&&t.push({tag:"link",key:"link:rel:manifest",attrs:{rel:"manifest",href:e.manifest}}),e.base!==void 0&&t.push({tag:"base",key:"base",attrs:{href:e.base}}),e.verification){let d={google:"google-site-verification",bing:"msvalidate.01",yandex:"yandex-verification",pinterest:"p:domain_verify"};for(let[h,y]of Object.entries(e.verification)){if(y==null)continue;let p=d[h]??h;n("meta:name:"+p,{name:p,content:y})}}for(let d of e.alternates??[])t.push({tag:"link",key:"link:alternate:hreflang:"+d.hreflang,attrs:{rel:"alternate",hreflang:d.hreflang,href:d.href}});for(let d of e.feeds??[])t.push({tag:"link",key:"link:alternate:feed:"+d.href,attrs:{rel:"alternate",type:d.type??"application/rss+xml",href:d.href,...d.title?{title:d.title}:{}}});e.og&&Kf(e.og,t),e.twitter&&jf(e.twitter,t),e.icons&&Ff(e.icons,t);let l=ae(e.jsonLd);if(l!==void 0){let d=Array.isArray(l)?l:[l];for(let h of d){let y=JSON.stringify(h);t.push({tag:"script",key:"script:ldjson:"+Qt(y),attrs:{type:"application/ld+json"},children:y})}}for(let d of e.meta??[]){let h={};for(let[y,p]of Object.entries(d))p!=null&&(h[y==="httpEquiv"?"http-equiv":y]=p);t.push({tag:"meta",key:Wf(h),attrs:h})}for(let d of e.link??[]){let h={};for(let[y,p]of Object.entries(d))p!=null&&(h[y]=p);t.push({tag:"link",key:"link:"+(h.rel??"")+":"+(h.href??Qt(JSON.stringify(h))),attrs:h})}for(let d of e.script??[]){let h={},y;for(let[p,v]of Object.entries(d))v!=null&&(p==="children"?y=v:h[p]=v);t.push({tag:"script",key:"script:"+(h.src??Qt((y??"")+JSON.stringify(h))),attrs:h,children:y})}}function zf(e,t){return typeof e=="function"?e(t):e.includes("%s")?e.replace("%s",t):e}function Bf(e){let t=[],r={};for(let a of e.sources){let i=typeof a=="function"?a():a;Uf(i,t,r)}r.title!==void 0&&t.push({tag:"title",key:"title",children:r.template?zf(r.template,r.title):r.title});let n=new Map,o={};for(let a of t){if(a.tag==="htmlAttr"){o[a.name]=a.value;continue}n.set(a.key,a)}return{tags:[...n.values()],htmlAttrs:o}}var bn="data-fh",Sn="data-fh-key";function Fs(e){for(let t=e.firstChild;t;t=t.nextSibling)if(t.nodeType===8&&t.data.startsWith("fh:")){t.parentNode?.removeChild(t);return}}function Us(e,t){for(let r of Array.from(e.attributes))r.name===bn||r.name===Sn||r.name in t||e.removeAttribute(r.name);for(let[r,n]of Object.entries(t))e.getAttribute(r)!==n&&e.setAttribute(r,n)}function Jf(e){let t=document.createElement(e.tag);return Us(t,e.attrs),t.setAttribute(bn,""),t.setAttribute(Sn,e.key),e.tag==="script"&&e.children!=null&&(t.textContent=e.children),t}function Yf(e,t){let r=document.head,n=new Map;for(let i of Array.from(r.querySelectorAll(`[${bn}]`))){let s=i.getAttribute(Sn);i.tagName!=="TITLE"&&s&&n.set(s,i)}let o=null,a=new Set;for(let i of e){if(i.tag==="title"){o=i.children;continue}if(i.tag==="htmlAttr")continue;a.add(i.key);let s=n.get(i.key);s&&s.tagName===i.tag.toUpperCase()?(Us(s,i.attrs),i.tag==="script"&&(s.textContent??"")!==(i.children??"")&&(s.textContent=i.children??"")):(s&&s.remove(),r.appendChild(Jf(i)))}for(let[i,s]of n)a.has(i)||s.remove();o!=null&&document.title!==o&&(document.title=o);for(let[i,s]of Object.entries(t))document.documentElement.getAttribute(i)!==s&&document.documentElement.setAttribute(i,s)}function zs(e){return W(t=>(k(()=>{e.version();let{tags:r,htmlAttrs:n}=Bf(e);Yf(r,n)}),S(()=>{}),t))}var Xf={};Df(Xf,{Base:()=>tl,JsonLD:()=>rl,Link:()=>Qf,Meta:()=>Zf,Script:()=>el,Title:()=>Gf});function Qe(e){return typeof e=="function"?e():e}function Gf(e){return Ne(()=>({title:Qe(e.children)})),null}function Zf(e){return Ne(()=>({meta:[{...e,content:Qe(e.content)}]})),null}function Qf(e){return Ne(()=>{let t={};for(let[r,n]of Object.entries(e))t[r]=Qe(n);return{link:[t]}}),null}function el(e){return Ne(()=>{let t={};for(let[r,n]of Object.entries(e))t[r]=Qe(n);return{script:[t]}}),null}function tl(e){return Ne({base:e.href}),null}function rl(e){return Ne(()=>({jsonLd:Qe(e.data)})),null}function wa(e,t){if(!t)throw new Error("Container element not found for mount()");nn(()=>e(),t)}var va=e=>w(()=>Ce(e));async function ba(e,t={}){let r=typeof t.root=="string"?document.querySelector(t.root):t.root??document.querySelector("#app");if(!r)throw new Error(`[Fluixi] Mount container not found: ${t.root??"#app"}`);let n=!!document.getElementById("__FLUIXI_HYDRATION__")||!!t.routes&&r.firstElementChild!=null,o=t.hydrate??n,a=Ks();if(js(a),Fs(r),o){Qi();try{if(t.routes&&t.routes.length){let{preloadRoutes:i}=await Promise.resolve().then(()=>(Hn(),ga));await i(t.routes,window.location.pathname)}Hs(),gn(!0),jt(()=>va(e),r),Pl()}finally{es()}setTimeout(()=>{gn(!1),os(r)&&typeof process<"u",en(),vn()},100)}else $e(va(e),r);zs(a)}function Pl(){if(typeof window>"u")return;let e=window;typeof e.__FX_REPLAY_STOP__=="function"&&e.__FX_REPLAY_STOP__();let t=e.__FX_REPLAY__;if(e.__FX_REPLAY__=void 0,e.__FX_REPLAY_STOP__=void 0,!(!Array.isArray(t)||t.length===0))for(let r of t){let n=r&&r.target;if(!n||n.isConnected===!1||typeof n.dispatchEvent!="function")continue;let o=r.type,a=o==="click"?new MouseEvent(o,{bubbles:!0,cancelable:!0}):new Event(o,{bubbles:!0,cancelable:!0});n.dispatchEvent(a)}}Hn();return Oa($l);})();
|
|
1
|
+
/*! @fluixi/core v1.0.0-alpha.99 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
|
+
"use strict";var Fluixi=(()=>{var ar=Object.defineProperty;var Aa=Object.getOwnPropertyDescriptor;var xa=Object.getOwnPropertyNames;var ka=Object.prototype.hasOwnProperty;var F=(e,t)=>()=>(e&&(t=e(e=0)),t);var jn=(e,t)=>{for(var r in t)ar(e,r,{get:t[r],enumerable:!0})},_a=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of xa(t))!ka.call(e,o)&&o!==r&&ar(e,o,{get:()=>t[o],enumerable:!(n=Aa(t,o))||n.enumerable});return e};var Oa=e=>_a(ar({},"__esModule",{value:!0}),e);function eo(){return{consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:Ea,onSuspend:null,onError:null,observer:null}}function Ta(e){let t=eo(),r=e;for(let n of Object.keys(t))n in e||(r[n]=t[n]);return e}function Ra(){let e=it[Fn];return e?Ta(e):it[Fn]=eo()}function to(){return[...new Set(it[Qn]??[])]}function Ca(e){return m.observer=e,()=>{m.observer===e&&(m.observer=null)}}function yr(e){let t=m.observer;t&&t.created(e.parents===void 0?{...e,parents:X,origin:e.origin??Pa,scope:e.scope??Un}:{...e,scope:e.scope??Un})}function $a(e){return m.observer?(X.push(e),!0):!1}function Na(){X.pop()}function Ma(e){m.observer?.ran?.(e)}function La(e,t){m.observer?.wrote?.(e,t)}function Z(e,t,r,n){let o=m.observer;!o?.bound||!X.length||o.bound(X[X.length-1],e,t,r,n)}function Q(e,t,r,n){let o=m.observer;!o?.directive||!X.length||o.directive(X[X.length-1],e,t,r,n)}function Ia(e){m.observer?.contextCreated?.(e)}function ur(e,t,r){let n=m.observer;!n?.context||!X.length||n.context(X[X.length-1],e,t,r)}function hr(e){m.observer?.disposed?.(e)}function ro(){return m.observer!=null}function fr(e){if(e.watchers)for(let t of[...e.watchers])t._notify(e)}function io(e){if(m.untracked)return e();m.untracked=!0;try{return e()}finally{m.untracked=!1}}function ue(e){let t=Ve(e);return e&&(e.owned??=[]).push(t),t}function ke(e,t=!0){qe(e,t)}function so(e){return!!e&&e.disposed===!0}function Ve(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function ee(e,t){let r=Symbol(t??"context");return Ia(r),{id:r,defaultValue:e,Provider:o=>{ur(r,"provide",o.value);let a=m.owner,i=Ve(a);(i.contexts=new Map).set(r,o.value),a&&(a.owned??=[]).push(i),m.owner=i;try{return o.children}finally{m.owner=a}}}}function H(e){let t=m.owner;for(;t;){if(t.contexts&&t.contexts.has(e.id)){let r=t.contexts.get(e.id);return ur(e.id,"read",r),r}t=t.parent}return ur(e.id,"read",e.defaultValue),e.defaultValue}function ao(e,t){let r=e;for(;r;){if(r.contexts&&r.contexts.has(t.id))return r.contexts.get(t.id);r=r.parent}return t.defaultValue}function co(e,t,r){let n=Ve(m.owner);(n.contexts=new Map).set(e.id,t),m.owner&&(m.owner.owned??=[]).push(n);let o=m.owner;m.owner=n;try{return r()}finally{m.owner=o}}function Wa(e){m.onSuspend=e}function Ha(e){return m.onSuspend?(m.onSuspend(e,m.owner),!0):!1}function Ka(e){m.onError=e}function P(){return m.owner}function uo(e){let t=m.owner;return m.owner=e,t}function M(e,t){let r=m.owner;m.owner=e;try{return t()}finally{m.owner=r}}function S(e){if(m.owner){if(m.owner.disposed){e();return}(m.owner.cleanups??=[]).push(e)}}function qe(e,t=!0){if(!e.disposed){if(e.owned){for(let r=e.owned.length-1;r>=0;r--)qe(e.owned[r]);e.owned=null}if(e.cleanups){for(let r=e.cleanups.length-1;r>=0;r--)e.cleanups[r]();e.cleanups=null}t&&(e.disposed=!0)}}function W(e){let t=Ve(m.owner);m.owner&&(m.owner.owned??=[]).push(t);let r=m.owner;m.owner=t;try{return io(()=>e(()=>qe(t)))}finally{m.owner=r}}function ja(e){m.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function Fa(e){e.queued||(e.queued=!0,m.queue.push(e),!m.scheduled&&m.batchDepth===0&&(m.scheduled=!0,m.hostSchedule(at)))}function at(){if(m.scheduled=!1,m.flushing)return;m.flushing=!0;let e=0,t=!1,r;try{for(;m.queue.length;){if(++e>1e5)throw new Error("[fluixi] effect flush did not settle (cycle?)");let n=m.queue;m.queue=[];for(let o of n)if(o.queued=!1,!o.disposed)try{o.run()}catch(a){t||(t=!0,r=a)}}}finally{m.flushing=!1}if(t)throw r}function Ua(){m.batchDepth===0&&at()}function za(e){m.batchDepth++;try{return e()}finally{--m.batchDepth===0&&at()}}function mr(e,t=!1,r){let n=new Ba(e,t,r);return()=>n.dispose()}function Ja(e){return!!e&&typeof e.then=="function"}function b(e,t){let r=new qa(e,{equals:t?.equals}),n=(()=>r.get()),o=(a=>{let i=typeof a=="function"?a(r.peek()):a;return r.set(i),Ua(),i});return Object.defineProperty(n,fo,{value:!0,enumerable:!0}),Object.defineProperty(n,Xa,{value:{get value(){return r.peek()},get version(){return r.version}},enumerable:!1}),yr({kind:"signal",node:r,handle:n,name:t?.name,set:o}),ro()&&S(()=>hr(r)),[n,o]}function w(e,t,r){let n=t,o=P(),a=new oo(()=>M(o,()=>{try{return n=e(n)}catch(s){if(Ja(s))return Ha(s),n;throw s}}),{equals:r?.equals}),i=(()=>a.get());return Object.defineProperty(i,fo,{value:!0,enumerable:!0}),Object.defineProperty(i,Ya,{value:!0,enumerable:!0}),yr({kind:"memo",node:a,handle:i,name:r?.name}),ro()&&S(()=>hr(a)),i}function k(e,t,r){let n=t;return mr(()=>{n=e(n)},!0,r?.name)}function lo(e,t){let r=t;mr(()=>{r=e(r)})}function $(e,t){let r=t;return mr(()=>{r=e(r)})}function D(e){return za(e)}function A(e){return io(e)}function po(){return at(),Promise.resolve()}function yo(e,t,r){let n=[];return S(()=>{for(let o of n)o.dispose();n=[]}),w(()=>{let o=e()||[];return A(()=>{if(o.length===0){for(let u of n)u.dispose();return n=[],r?.fallback?r.fallback():[]}let a=new Map;for(let u of n)a.has(u.item)||a.set(u.item,u);let i=[],s=new Set;for(let u=0;u<o.length;u++){let c=o[u],f=a.get(c);if(f&&!s.has(f))f.setIndex(u),i.push(f),s.add(f);else{let l,d,h;W(p=>{h=p;let[v,_]=b(u,{name:"row index"});d=_,l=t(c,v)});let y={item:c,rendered:l,dispose:h,setIndex:d};i.push(y),s.add(y)}}for(let u of n)s.has(u)||u.dispose();return n=i,i.map(u=>u.rendered)})},void 0,{name:"mapArray"})}function ho(e,t,r,n){let o=[],a=[];return S(()=>{for(let i of a)i.dispose();o=[],a=[]}),w(()=>{let i=e()||[];return A(()=>{if(i.length===0){for(let l of a)l.dispose();return o=[],a=[],n?.fallback?n.fallback():[]}let s=new Map;for(let l=0;l<o.length;l++)s.set(o[l],a[l]);let u=[],c=[],f=new Set;for(let l=0;l<i.length;l++){let d=t(i[l]),h=s.get(d);if(h&&!f.has(d))h.setIndex(l),u.push(h);else{let y,p,v;W(_=>{v=_;let[O,Y]=b(l,{name:"row index"});p=Y;let T=w(E=>{let j=(e()||[])[O()];return j??E},i[l]);y=r(T,O)}),u.push({rendered:y,dispose:v,setIndex:p})}c.push(d),f.add(d)}for(let[l,d]of s)f.has(l)||d.dispose();return o=c,a=u,u.map(l=>l.rendered)})},void 0,{name:"keyArray"})}function mo(e,t,r){let n=[];return S(()=>{for(let o of n)o.dispose();n=[]}),w(()=>{let o=e()||[];return A(()=>{if(o.length===0){for(let u of n)u.dispose();return n=[],r?.fallback?r.fallback():[]}let a=n.length,i=o.length;for(let u=a;u<i;u++){let c,f,l,d=o[u];W(h=>{l=h;let[y,p]=b(d);f=p,c=t(y,u)}),n.push({rendered:c,setItem:f,dispose:l})}for(let u=i;u<a;u++)n[u].dispose();i<a&&(n=n.slice(0,i));let s=Math.min(a,i);for(let u=0;u<s;u++)n[u].setItem(o[u]);return n.map(u=>u.rendered)})},void 0,{name:"indexArray"})}function I(e){return typeof e=="function"&&e[Qa]===!0}function ec(e){Yn&&Yn(e)}function go(e){lr=e}function tc(e){return lr?lr(e):void 0}function vo(e){dr=e}function rc(){return dr?dr():void 0}function nc(e,t){Xn&&Xn(e,t)}function Gn(){let e=new Map,t=new Map;return{get:r=>e.get(r),set:(r,n)=>{e.set(r,n)},delete:r=>{e.delete(r)},keys:()=>e.keys(),clear:()=>{e.clear(),t.clear()},inflight:t}}function ct(){let e=oc?.();return e||(typeof window>"u"?Gn():ic??=Gn())}function wo(e,t=(r,n)=>r===n){let r=new Map;return k(()=>{let n=e();for(let[o,a]of r){let[i,s]=a,u=t(o,n);i()!==u&&s(u)}}),n=>{let o=r.get(n);if(!o){let[a,i]=b(!1);o=[a,i],r.set(n,o);let s=e();i(t(n,s))}return o[0]()}}function bo(e,t){let[r,n]=b(e(),t);return k(()=>{let o=e();t?.timeoutMs?setTimeout(()=>n(()=>o),t.timeoutMs):typeof requestIdleCallback=="function"?requestIdleCallback(()=>n(()=>o)):Promise.resolve().then(()=>n(()=>o))}),r}function So(e,t){let r,n=(...o)=>{r!==void 0&&clearTimeout(r),r=setTimeout(()=>{r=void 0,e(...o)},t)};return S(()=>{r!==void 0&&clearTimeout(r)}),n}function sc(e){return!!e&&typeof e.then=="function"}function fe(e,t,r={}){let n,o;typeof t=="function"?(n=typeof e=="function"?e:()=>e,o=t):(n=()=>!0,o=e,t&&typeof t=="object"&&(r=t));let a=r.transport===!1?void 0:rc(),i=a!==void 0?tc(a):void 0,s=i!==void 0,[u,c]=b(i!==void 0?i.value:r.initialValue,{equals:!1}),[f,l]=b(void 0,{equals:!1}),[d,h]=b(i!==void 0||r.initialValue!==void 0?"ready":"unresolved",{equals:!1}),[y,p]=b(void 0,{equals:!1}),[v,_]=b(void 0,{equals:!1}),O=cr,Y=!1;k(()=>{let C=n();if(v(),C===!1||C===null||C===void 0){O=cr,D(()=>{h("unresolved"),p(void 0),l(void 0)});return}let j=Y;if(Y=!1,O!==cr&&C===O&&!j)return;if(O=C,s){s=!1;return}let ne=!1;S(()=>ne=!0);let xe=A(d),Sa=A(u),Kn=xe==="ready"||xe==="refreshing";D(()=>{h(Kn?"refreshing":"pending"),l(void 0)});try{let me=o(C,{value:Sa,refetching:Kn});sc(me)?(p(me),ec(me),me.then(ot=>{ne||(a!==void 0&&nc(a,ot),D(()=>{c(()=>ot),h("ready"),p(void 0)}))},ot=>{ne||D(()=>{l(ot),h("errored"),p(void 0)})})):D(()=>{c(()=>me),h("ready"),p(void 0)})}catch(me){if(ne)return;D(()=>{l(me),h("errored"),p(void 0)})}});let T=()=>{let C=d();return C==="pending"||C==="refreshing"},E=(()=>{let C=f();if(C)throw C;if(T()){let j=y();if(j)throw j}return u()});return Object.defineProperties(E,{state:{get:d},loading:{get:T},error:{get:f},latest:{get:u}}),Object.defineProperty(E,Symbol.for("resource"),{value:!0,enumerable:!0}),Object.defineProperty(E,Symbol.for("signal"),{value:!0,enumerable:!0}),[E,{mutate:c,refetch:()=>{Y=!0,_(void 0)}}]}function st(e){if(typeof e=="function"&&!e.length){let t=e();return I(t)?t:st(t)}if(Array.isArray(e)){let t=[];for(let r=0;r<e.length;r++){let n=st(e[r]);Array.isArray(n)?t.push.apply(t,n):t.push(n)}return t}return e}function We(e){let t=w(e);return Za?w(()=>st(t()),void 0,{name:"children"}):w(()=>st(t()))}function xo(){let[e,t]=b(0),r=0;return{increment:()=>t(r+=1),decrement:()=>t(r-=1),inFallback:()=>e()>0}}function gr(e,t){return co(Ao,e,t)}function _o(){let[e,t]=b(void 0,{equals:!1});return{error:e,reset:()=>t(()=>{}),setError:n=>t(()=>n)}}function Oo(e,t){return co(ko,e,t)}var pr,Zn,Fn,Qn,Ea,it,m,X,Pa,Un,Da,zn,Bn,Jn,De,no,qa,oo,Va,Ba,fo,Ya,Xa,Ga,Za,Qa,Yn,lr,dr,Xn,oc,ic,cr,Ao,ko,_e,x=F(()=>{"use strict";pr="1.0.0-alpha.99",Zn=pr.split(".")[0],Fn=`__fluixi_signal_state_v${Zn}__`,Qn=`__fluixi_signal_builds_v${Zn}__`,Ea=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)};it=globalThis;m=Ra();(it[Qn]??=[]).push(pr);X=[];Da="__FLUIXI_DEVTOOLS_HOOK__",zn=globalThis[Da];if(typeof zn?.inject=="function")try{zn.inject({observeReactiveNodes:Ca,version:pr})}catch{}Bn=0,Jn=1,De=2,no=class{constructor(){this.observers=null,this.watchers=null,this.version=0}updateIfNecessary(){}track(){if(m.untracked)return;let e=m.consumer;e&&((this.observers??=new Set).add(e),(e.sources??=new Set).add(this))}},qa=class extends no{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++,La(this,m.consumer),this.observers)for(let t of[...this.observers])t.markDirty(De);fr(this)}}peek(){return this._value}},oo=class extends no{constructor(e,t){super(),this._threw=!1,this._initialized=!1,this.state=De,this.sources=null,this._fn=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){if(m.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===Jn&&this.sources){for(let e of this.sources)if(e.updateIfNecessary(),this.state===De)break}(this.state===De||!this._initialized)&&this.recompute(),this.state=Bn}recompute(){if(this.sources){for(let s of this.sources)s.observers?.delete(this);this.sources.clear()}let e=m.consumer,t=m.untracked,r=$a(this);m.consumer=this,m.untracked=!1;let n,o=!1,a;try{n=this._fn()}catch(s){o=!0,a=s,n=this._value}finally{m.consumer=e,m.untracked=t,r&&Na()}let i=!this._initialized||this._threw!==o||(o?a!==this._error:!this._equals(this._value,n));if(this._initialized=!0,this._threw=o,this._error=a,this._value=n,Ma(this),i){if(this.version++,this.observers)for(let s of[...this.observers])s.markDirty(De);fr(this)}}markDirty(e){if(this.state>=e)return;let t=this.state===Bn;if(this.state=e,t){if(this.observers)for(let r of[...this.observers])r.markDirty(Jn);fr(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};Va=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()}};Ba=class{constructor(e,t=!1,r){this.queued=!1,this.disposed=!1,this.owner=Ve(m.owner),m.owner&&(m.owner.cleanups??=[]).push(()=>this.dispose()),this.computed=new oo(()=>{qe(this.owner,!1),M(this.owner,()=>{let n=e();typeof n=="function"&&(this.owner.cleanups??=[]).push(n)})}),yr({kind:"effect",node:this.computed,handle:this,internal:!t,...r?{name:r}:{}}),this.watcher=new Va(()=>Fa(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"&&m.onSuspend){m.onSuspend(e,this.owner);return}if(m.onError&&m.onError(e,this.owner))return;throw e}}}dispose(){this.disposed||(this.disposed=!0,hr(this.computed),this.watcher.unwatch(this.computed),qe(this.owner))}};ja(()=>{});fo=Symbol.for("signal"),Ya=Symbol.for("memo"),Xa=Symbol.for("signal-node");Ga=typeof window>"u"?!1:window.__FLUIXI_PROD__===!0,Za=typeof process>"u"?Ga:!1,Qa=Symbol.for("signal");Yn=null;lr=null;dr=null;Xn=null;oc=null;cr=Symbol();Ao=ee();Wa((e,t)=>{let r=ao(t,Ao);r&&(r.increment(),e.finally(()=>r.decrement()))});ko=ee();Ka((e,t)=>{let r=ao(t,ko);return r?(r.setError(e),!0):!1});_e=Symbol.for("fluixi-proxy")});var ri,ni=F(()=>{"use strict";ri="1.0.0-alpha.99"});function vi(){return{consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:Xc,onSuspend:null,onError:null,observer:null}}function Gc(e){let t=vi(),r=e;for(let n of Object.keys(t))n in e||(r[n]=t[n]);return e}function Zc(){let e=Cr[oi];return e?Gc(e):Cr[oi]=vi()}function Qc(e){return L.observer=e,()=>{L.observer===e&&(L.observer=null)}}function eu(e,t){if(!L.observer)return t();let r=bt;bt=e;try{return t()}finally{bt=r}}function tu(e){let t=L.observer;t&&t.created(e.parents===void 0?{...e,parents:ge,origin:e.origin??bt,scope:e.scope??ii}:{...e,scope:e.scope??ii})}function wi(e){let t=L.observer;!t?.props||!ge.length||!e||t.props(ge[ge.length-1],e)}function ru(e){L.observer?.contextCreated?.(e)}function nu(e,t,r){let n=L.observer;!n?.context||!ge.length||n.context(ge[ge.length-1],e,t,r)}function si(e,t,r){L.observer?.moved?.(e,t,r)}function ai(e){L.observer?.disposed?.(e)}function bi(){return L.observer!=null}function iu(e){if(L.untracked)return e();L.untracked=!0;try{return e()}finally{L.untracked=!1}}function su(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function Si(e,t){let r=Symbol(t??"context");return ru(r),{id:r,defaultValue:e,Provider:o=>{nu(r,"provide",o.value);let a=L.owner,i=su(a);(i.contexts=new Map).set(r,o.value),a&&(a.owned??=[]).push(i),L.owner=i;try{return o.children}finally{L.owner=a}}}}function Ai(e,t){let r=e;for(;r;){if(r.contexts&&r.contexts.has(t.id))return r.contexts.get(t.id);r=r.parent}return t.defaultValue}function au(e){L.onSuspend=e}function cu(e){L.onError=e}function uu(e){L.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function xi(e){return iu(e)}function ki(e){return typeof e=="function"&&e[fu]===!0}function pu(e,t){if(!Te(e)||!bi())return;let r=new Set,n=i=>{if(!(!Te(i)||r.has(i))){r.add(i);for(let s of Object.values(i))n(s)}};n(kt.get(t)??t);let o=new Set,a=i=>{if(!Te(i))return;let s=i;if(r.has(s)||o.has(s))return;o.add(s);let u=Ke.get(s);if(u){for(let c of u.keys.values())ai(c);u.all&&ai(u.all),Ke.delete(s),Re.delete(s),Pr.delete(s)}for(let c of Object.values(s))a(c)};a(e)}function _i(e,t,r){let n=t?.owner,o=n&&r!==void 0?_t(n.name,r,t?.array):void 0,[a,i]=eu(n?.store,()=>b(e,o?{name:o}:void 0)),s=a;return s.$=i,s}function Ot(e){let t=Ke.get(e);return t?t.owner||(t.owner=Re.get(e)):Ke.set(e,t={keys:new Map,owner:Re.get(e),array:Array.isArray(e)}),t}function pi(e,t,r){let n=e.keys.get(t);return n||e.keys.set(t,n=_i(r,e,t)),n}function yu(e,t,r,n){let o=Re.get(e);if(o&&o.store===t&&o.name===r)return;let a={store:t,name:r};Re.set(e,a),kt.set(e,kt.get(n)??n);let i=Ke.get(e);if(i&&(i.owner=a,!!bi())){for(let[s,u]of i.keys)si(u,t,_t(r,s,i.array));i.all&&si(i.all,t,_t(r,"*",i.array))}}function yi(e){let t=Ot(e);(t.all||(t.all=_i(void 0,t,"*")))()}function hi(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 St(e){if(!Te(e))return e;let t=Pr.get(e);if(t)return t;let r=new Proxy(e,hu);return Pr.set(e,r),r}function Oi(e,t=new Set){if(e==null||typeof e!="object")return e;let r=e[xt]??e;if(t.has(r)||!Te(r))return r;t.add(r);let n=!1,o=i=>{let s=Oi(i,t);return s!==i&&(n=!0),s};if(Array.isArray(r)){let i=r.map(o);return n?i:r}let a={};for(let i of Object.keys(r))a[i]=o(r[i]);return n?a:r}function re(e,t,r){let n=Oi(r),o=e[t];if(o===n&&(n!==void 0||t in e))return;let a=Array.isArray(e),i=a?e.length:0;n===void 0?delete e[t]:e[t]=n;let s=Ot(e),u=s.keys.get(t);if(u&&hi(u,n),pu(o,e),a&&e.length!==i){let c=s.keys.get("length");c&&hi(c,e.length)}s.all&&s.all.$(void 0)}function $r(e,t){return typeof e=="function"?e(t):e}function Nr(e,t){for(let r of Object.keys(t)){let n=t[r],o=e[r];n&&typeof n=="object"&&!Array.isArray(n)&&o&&typeof o=="object"&&!Array.isArray(o)?Nr(o,n):re(e,r,n)}}function Tt(e){let t=[],r=e.replace(/\[([^\]]*)\]/g,".$1");for(let n of r.split("."))n.length&&t.push(n);return t}function Ei(e,t,r){let n=t.length-1;for(let a=0;a<n;a++){let i=t[a];if(i==="*"){let u=t.slice(a+1);if(Array.isArray(e))for(let c=0;c<e.length;c++)Ei(e[c],u,r);return}let s=e[i];(s==null||typeof s!="object")&&(s=/^\d+$/.test(t[a+1])?[]:{},re(e,i,s)),e=s}let o=t[n];if(o==="*"){if(Array.isArray(e))for(let a=0;a<e.length;a++)re(e,a,$r(r,e[a]));return}re(e,o,$r(r,e[o]))}function mi(e,t,r){Ei(e,Tt(t),r)}function mu(e){return Array.isArray(e)&&e.length>0&&e.every(t=>Array.isArray(t)&&t.length>=2&&typeof t[0]=="string")}function At(e,t){for(let r=e.length-1;r>=t.length;r--)re(e,String(r),void 0);e.length!==t.length&&re(e,"length",t.length);for(let r=0;r<t.length;r++)re(e,String(r),t[r])}function gu(e,t){let r=t[0];if(typeof r=="function"&&t.length===1){let n=r(e);n&&n!==e&&Nr(e,n);return}if(Array.isArray(r)&&t.length===1){if(mu(r)){for(let n of r)mi(e,n[0],n[1]);return}if(Array.isArray(e)){At(e,r);return}if(r.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(r&&typeof r=="object"&&!Array.isArray(r)&&t.length===1){Nr(e,r);return}if(t.length>=3){Mr(e,t.slice(0,-1),t[t.length-1]);return}mi(e,String(r),t[1])}function vu(e,t){if(typeof t=="function"){if(!Array.isArray(e))return[];let r=[];for(let n=0;n<e.length;n++)t(e[n],n)&&r.push(n);return r}if(Array.isArray(t))return Array.isArray(e)?t.map(Number):t.map(String);if(t&&typeof t=="object"&&("from"in t||"to"in t||"by"in t)){if(!Array.isArray(e))return[];let r=t.by??1,n=t.from??0,o=t.to??e.length-1,a=[];for(let i=n;i<=o;i+=r)i>=0&&i<e.length&&a.push(i);return a}return t==="*"?Array.isArray(e)?e.map((r,n)=>n):Object.keys(e??{}):[t]}function Mr(e,t,r){if(e==null)return;let[n,...o]=t;if(typeof n=="string"){let i=Tt(n);if(i.length>1){Mr(e,[...i,...o],r);return}}let a=vu(e,n);if(o.length===0){for(let i of a)re(e,i,$r(r,e[i]));return}for(let i of a){let s=e[i];if(s==null||typeof s!="object"){let u=o[0];s=typeof u=="number"||/^\d+$/.test(String(u))?[]:{},re(e,i,s)}Mr(s,o,r)}}function Lr(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(Lr);let t={};for(let r of Object.keys(e))t[r]=Lr(e[r]);return t}function pe(e,t){let r=e;for(let n of Tt(t)){if(r==null)return;r=r[n]}return r}function bu(e,t){for(let r of wu)e[r]=t[r].bind(t);e.$=t.reactive.bind(t)}function Su(e,t={immutable:!0}){let r=new Ti(e,t);return bu(r.set,r),[r.proxy,r.set]}function Au(e,t={}){return new Ti(e,{...t,immutable:!1})}function Et(e){if(e==null||typeof e!="object")return e;let t=e[xt];return t!==void 0?t:e}function xu(e){return A(()=>Et(e))}var Ir,gi,oi,Yc,Xc,Cr,L,ge,bt,ii,ou,ci,Jl,fu,lu,du,xt,ui,fi,li,di,Ke,Pr,Re,kt,_t,hu,Ti,wu,Xl,Ri=F(()=>{"use strict";x();Ir="1.0.0-alpha.99",gi=Ir.split(".")[0],oi=`__fluixi_signal_state_v${gi}__`,Yc=`__fluixi_signal_builds_v${gi}__`,Xc=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)};Cr=globalThis;L=Zc();(Cr[Yc]??=[]).push(Ir);ge=[];ou="__FLUIXI_DEVTOOLS_HOOK__",ci=globalThis[ou];if(typeof ci?.inject=="function")try{ci.inject({observeReactiveNodes:Qc,version:Ir})}catch{}uu(()=>{});Jl=typeof window>"u"?!1:window.__FLUIXI_PROD__===!0,fu=Symbol.for("signal");lu=Si();au((e,t)=>{let r=Ai(t,lu);r&&(r.increment(),e.finally(()=>r.decrement()))});du=Si();cu((e,t)=>{let r=Ai(t,du);return r?(r.setError(e),!0):!1});xt=Symbol("store-raw"),ui=Symbol("store-node"),fi=Symbol("store-has"),li=Symbol("store-self"),di=Symbol("store-track"),Ke=new WeakMap,Pr=new WeakMap,Re=new WeakMap,kt=new WeakMap;_t=(e,t,r)=>r?`${e}[${String(t)}]`:`${e}.${String(t)}`;hu={get(e,t,r){if(t===xt||t===ui)return e;if(t===_e)return r;if(t===fi)return u=>u in e;if(t==="__proxy")return!0;if(t===di||t===li)return yi(e),r;let n=e[t];if(typeof n=="function"&&!Object.prototype.hasOwnProperty.call(e,t))return n;let o=Object.getOwnPropertyDescriptor(e,t);if(o&&o.get)return o.get.call(r);let a=Ot(e),i=pi(a,t,n),s=i();return Te(s)?(a.owner&&yu(s,i,_t(a.owner.name,t,a.array),e),St(s)):s},set(){return!0},deleteProperty(e,t){return t in e&&re(e,t,void 0),!0},has(e,t){return t===xt||t===_e||t===ui||t===fi||t===li||t===di?!0:(pi(Ot(e),t,e[t])(),t in e)},ownKeys(e){return yi(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e,t)}};Ti=class{constructor(e,t={immutable:!0}){this.options=t,this.root=e,this.set=((...r)=>D(()=>gu(this.root,r))),e&&typeof e=="object"&&(Re.set(e,{store:this,name:t.name??"store"}),kt.set(e,e)),tu({kind:"store",node:this,handle:()=>this.root,name:t.name})}get state(){return St(this.root)}get proxy(){return St(this.root)}get accessor(){return(()=>St(this.root))}unwrap(){return this.root}getNode(e){return this.root&&this.root[e]}get(e){if(e==null||e==="")return Et(this.state);let t=this.state;for(let r of Tt(e)){if(t==null)return;t=t[r]}return Et(t)}select(e){return w(()=>e(this.state))}subscribe(e){return k(()=>e(this.state))}watch(e,t){let r;return k(()=>{let n=e(this.state);Object.is(n,r)||(t(n,r),r=n)})}reactive(e){return w(()=>this.state[e])}produce(e){this.set((t=>{let r=Lr(t);return e(r),r}))}reconcile(e,t={}){this.set(e)}push(e,...t){let r=pe(this.root,e);this.set(e,r.concat(t))}pop(e){let t=pe(this.root,e).slice(),r=t.pop();return this.set(e,t),r}shift(e){let t=pe(this.root,e).slice(),r=t.shift();return this.set(e,t),r}splice(e,t,r,...n){let o=pe(this.root,e).slice(),a=o.splice(t,r,...n);return this.set(e,o),a}insert(e,t,r){let n=pe(this.root,e).slice();n.splice(t,0,r),this.set(e,n)}removeAt(e,t){let r=pe(this.root,e).slice(),n=r.splice(t,1);return this.set(e,r),n}replace(e,t){if(arguments.length>=2){let n=pe(this.root,String(e)),o=t;if(Array.isArray(n)&&Array.isArray(o)){At(n,o);return}this.set(e,o);return}let r=this.root;if(Array.isArray(r)&&Array.isArray(e)){At(r,e);return}this.set(e)}clear(e){let t=e===void 0?this.root:pe(this.root,e);if(Array.isArray(t)){At(t,[]);return}if(t&&typeof t=="object")for(let r of Object.keys(t))re(t,r,void 0)}toObservable(){let[e]=b(this.state);return e.toObservable()}dispose(){}},wu=["get","select","watch","subscribe","produce","reconcile","push","pop","shift","splice","insert","removeAt","replace","clear","unwrap","toObservable"];Xl=Object.freeze({createStore:Su,createMutableStore:Au,batch:D,unwrap:Et,untrackStore:xu})});function V(){return Kr.server}function Gr(){if(!Kr.nodes)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return Kr.nodes}function Zr(e){return e!=null&&e[qt]===!0?!0:typeof Node<"u"&&e instanceof Node}function Ou(e){return e!=null&&e[qt]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Eu(e){return e!=null&&e[qt]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}function Tu(e){return e.localName.includes("-")}function Ci(e,t,r,n=!1){if(r==null){e.removeAttribute(t);return}if(Tu(e)){if(V()){jr(e,t,r);return}e[t]=r;return}N(e,t,r,n)}function jr(e,t,r){let n=e[Ru]??={};n[t]=r,r==null||r===!1?e.removeAttribute(t):r===!0?e.setAttribute(t,""):(typeof r=="string"||typeof r=="number")&&e.setAttribute(t,String(r))}function Dr(e){return Cu.has(e)||e.startsWith("aria-")||e.startsWith("data-")}function Hi(e,...t){e.classList.add(...t)}function Ki(e,...t){e.classList.remove(...t)}function ji(e,...t){t.forEach(r=>e.classList.toggle(r))}function N(e,t,r,n=!1){if(r==null||r===!1){e.removeAttribute(t);return}if(r===!0){e.setAttribute(t,"");return}if(typeof r=="object"){e.setAttribute(t,JSON.stringify(r));return}e.setAttribute(t,String(r))}function Fi(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Vt(e){return e instanceof Node}function Ui(e){z.core=e}function Wt(e){z.core&&e.setAttribute("fluixi",z.core),e.setAttribute("fx-dom",z.dom),e.setAttribute("fx-reactive",z.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=z)}function Ht(){let e=to();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=[z.core,z.dom,z.reactive].filter(r=>r!==void 0);new Set(t).size<=1||console.warn(`[fluixi] package versions disagree: core ${z.core??"(absent)"}, dom ${z.dom}, reactive ${z.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 zi(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function Be(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function Bi(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function $u(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function Nu(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function Mu(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function Lu(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function Iu(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function Du(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function se(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function qu(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function Ji(e){return $u(e)?{type:"router",value:e}:Mu(e)?{type:"route",value:e}:Nu(e)?{type:"routes",value:e}:Lu(e)?{type:"outlet",value:e}:se(e)?{type:"component",value:e}:qu(e)?{type:"suspense",value:e}:Iu(e)?{type:"provider",value:e}:Du(e)?{type:"context",value:e}:{type:"none",value:e}}function Hu(){return Wu.store.getStore()}function Ku(e){Yi=e}function Fr(){return Yi}function $i(e,t){return g.active&&t.parentNode===e}function Qr(e){let t=g.parents.lastIndexOf(e);t!==-1&&(g.parents.length=t),g.cursor=e.nextSibling}function Ur(e,t){if(!e||e.parentNode==null)return t();let r=g.active,n=g.cursor,o=g.parents;g.active=!0,g.cursor=e,g.parents=[];try{return t()}finally{g.active=r,g.cursor=n,g.parents=o}}function Xi(e){if(!g.active)return e();let t=g.cursor,r=g.parents;g.active=!1,g.parents=[];try{return e()}finally{g.active=!0,g.cursor=t,g.parents=r}}function Gi(e){if(!g.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Qr(t)}function Zi(){let e=globalThis;return e[Symbol.for("fluixi.appHydration")]??={pending:0,waiting:new Set}}function Qi(){Zi().pending++}function es(){let e=Zi();if(e.pending>0&&e.pending--,e.pending>0)return;let t=[...e.waiting];e.waiting.clear();for(let r of t)r()}function ts(e){let t=e;for(;t;){let r=t.contexts?.get(zr);if(r)return r;if(!t.parent){let n={id:"",next:0};return(t.contexts??=new Map).set(zr,n),n}t=t.parent}return{id:"",next:0}}function rs(){return V()?Hu()?.hydrationKeys!==!1:g.active}function Ni(e){let t=3735928559,r=1103547991;for(let n=0;n<e.length;n++){let o=e.charCodeAt(n);t=Math.imul(t^o,2654435761),r=Math.imul(r^o,1597334677)}return t=Math.imul(t^t>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507)^Math.imul(t^t>>>13,3266489909),(4294967296*(2097151&r)+(t>>>0)).toString(36)}function ju(e){if(!rs())return null;let t=ts(P()),r=t.id+(t.next++).toString(36);return e?`${Ni(r)}-${e}`:Ni(r)}function Fu(e){let t=e.getAttribute(Fe)??"",r=t.indexOf("-");return r<0?"":t.slice(r+1)}function ns(e){let t=e.getAttribute(Fe);t&&B?.get(t)===e&&B.delete(t)}function Uu(){if(!rs())return null;let e=P();if(!e)return null;let t=ts(e),r={id:t.id+(t.next++).toString(36)+".",next:0},n=ue(e);return(n.contexts=new Map).set(zr,r),n}function zu(e){B??=new Map;for(let t of e.querySelectorAll(`[${Fe}]`)){let r=t.getAttribute(Fe);B.has(r)||B.set(r,t)}}function en(){B=null}function os(e){if(!B)return 0;let t=0;for(let[r,n]of B){if(!n.isConnected){B.delete(r);continue}e&&!e.contains(n)||n.parentElement?.closest("[data-fx-ssr]")||(B.delete(r),n.remove(),t++)}return t}function Bu(e,t){if(!e||!B)return null;let r=B.get(e);return!r||r.localName!==t.toLowerCase()?null:(B.delete(e),r)}function qr(e,t){return t&&(e[Yu]=t),e}function Mi(e){let t=P();t&&(e[Xu]=t)}function we(e){if(!V())for(let t of e)$t.has(t)||tn.has(t)||($t.add(t),Br.dispatch??=Zu,document.addEventListener(t,Br.dispatch))}function Zu(e){let t=`$$${e.type}`,r=e.composedPath&&e.composedPath()[0]||e.target;Object.defineProperty(e,"currentTarget",{configurable:!0,get:()=>r??document});try{for(;r;){let n=r[t];if(n&&!r.disabled&&(n(e),e.cancelBubble))return;r=r.host&&r.host!==r&&r.host instanceof Element?r.host:r.parentNode}}finally{delete e.currentTarget}}function Qu(e,t,r){if(e[`$$${t}`]=r,tn.has(t)){let n=`__fx_${t}`;if(!e[n]){let o=a=>{e[`$$${t}`]?.(a)};e.addEventListener(t,o),e[n]=o}return}$t.has(t)||we([t])}function Li(e,t){delete e[`$$${t}`];let r=`__fx_${t}`,n=e[r];n&&(e.removeEventListener(t,n),delete e[r])}function he(e,t=!1){if(V())return Gr().createText(e);if(g.active&&!t){let r=Fr()?.hydrateText(e);if(r)return r}return document.createTextNode(e)}function be(e,t=!1,r){let n=ju();if(V()){let o=Gr().createElement(e,t);return n&&o.setAttribute(Fe,n),o}if(g.active){let o=Bu(n,e);if(o)return Fr()?.enterElement(o),e.includes("-")&&Mi(o),r?qr(o,r):o;let a=Fr()?.hydrateElement(e);if(a)return e.includes("-")&&Mi(a),r?qr(a,r):a}return qr(t?document.createElementNS(Wi,e):document.createElement(e),r)}function ef(e,t){if(!g.active)return t();let r=Ur(e.nextSibling,t);if(typeof r=="function"){let n=r;return tf(n,(...a)=>g.active?Ur(e.nextSibling,()=>{let i=n(...a);for(;typeof i=="function";)i=i();return i}):n(...a))}return r}function tf(e,t){let r=e[Pt];return r!==void 0&&(t[Pt]=r),t}function rf(e){for(let t=e.nextSibling;t;t=t.nextSibling)if(t.nodeType===8&&t.data==="fx/")return t;throw new Error("[fluixi] template hole is missing its closing marker")}function nf(e,t){let r=[];for(let n=e.nextSibling;n&&n!==t;n=n.nextSibling)r.push(n);return r}function sf(e,t,r,n,o){let a=n,i=new Map,s=!1;return $(()=>{let c=s&&g.active;if(s=!0,!c)return u();g.active=!1;try{return u()}finally{g.active=!0}});function u(){Z(r??t,"content",void 0,e);let c;if(se(e)&&!I(e)){if(!i.has(e)){ie++;try{let f=e();i.set(e,f)}finally{ie--}}for(c=i.get(e);typeof c=="function"&&I(c);)c=c()}else for(c=e();typeof c=="function"&&I(c);)c=c();{let f=0;for(;typeof c=="function"&&f++<50;)if(se(c)){if(!i.has(c)){let l=c;ie++;try{let d=l();i.set(l,d)}finally{ie--}}c=i.get(c)}else if(I(c))c=c();else if(c=c(),typeof c!="function"||!I(c)&&!se(c))break}ie++;try{a=Nt(t,c,r,a,i),o(a)}finally{ie--}}}function K(e,t,r,n){if(ie>of)return console.error("[insert] Exceeded max call depth, possible infinite loop."),()=>null;let o=r!==void 0&&!r&&g.active;r!==void 0&&!r&&(r=he("",!0),o||e.appendChild(r));let a=()=>{if(!o||r.parentNode)return;let f=g.cursor;e.insertBefore(r,f&&f.parentNode===e?f:null)},i=n??null,s=f=>Array.isArray(f)&&f.some(l=>typeof l=="function"),u=f=>typeof f=="function"?f:()=>f;if(typeof t!="function"&&!s(t)){ie++;try{i=Nt(e,t,r,i)}finally{ie--}return a(),()=>i}let c=sf(u(t),e,r,i,f=>{i=f});return a(),()=>(c?.(),i)}function Nt(e,t,r,n,o){if(t==null||typeof t=="boolean")return ye(e,n,r);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return ye(e,n,r);if(Ct(t)){let i=he("",!0);return Array.isArray(n)?n.length>0?(e.replaceChild(i,n[0]),ye(e,n.slice(1),r)):U(e,i,r):n?e.replaceChild(i,n):U(e,i,r),t.then(s=>{i.parentNode===e&&Nt(e,s,i.nextSibling,i)}).catch(s=>{console.error("Error resolving promise in insertExpression:",s)}),i}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(n)){if(n.length===0){let s=he(t);return U(e,s,r),s}if(n.length===1&&n[0].nodeType===3)return n[0].data=t,n;n=ye(e,n,r)}if(n&&Eu(n))return n.data=t,n;let i=he(t);return n&&n.parentNode===e?e.replaceChild(i,n):$i(e,i)||U(e,i,r),i}if(Zr(t))return $i(e,t)?(Qr(t),t):Array.isArray(n)?(n.length===0?U(e,t,r):n[0].parentNode===e?(e.replaceChild(t,n[0]),ye(e,n.slice(1),r)):U(e,t,r),t):(n?n!==t&&(n.parentNode===e?e.replaceChild(t,n):U(e,t,r)):U(e,t,r),t);if(Array.isArray(t)){let i=[],s=Array.isArray(n)?n:n?[n]:[],u=[],c=new Set,f=()=>oe(t,i,e,r,!0,o,u,c);g.active&&s.length?Ur(s[0],f):f();let l=af(e,c.size?s.filter(d=>!c.has(d)):s,i,r);for(let d of u){if(d.wired)continue;let h=K(e,d.sig,d.marker);S(()=>ye(e,h()))}return l}if(a==="object"&&t!==null&&typeof t=="object"){let i=t;if("type"in i&&"props"in i){let s=i;if(typeof s.type=="function"){let u=s.type(s.props||{});return Nt(e,u,r,n)}}}return ye(e,n,r)}function oe(e,t,r,n,o=!0,a,i,s){for(let u=0;u<e.length;u++){let c=e[u];if(!(c==null||typeof c=="boolean")){for(;typeof c=="function"&&!Ct(c)&&!I(c)&&!se(c)&&(c=c(),!(c==null||typeof c=="boolean")););if(!(c==null||typeof c=="boolean")){if(typeof c=="function"){let f;for(se(c)&&!I(c)?(a||(a=new Map),a.has(c)||a.set(c,c()),f=a.get(c)):f=c();typeof f=="function"&&!Ct(f)&&!I(f)&&!se(f);)a||(a=new Map),a.has(f)||a.set(f,f()),f=a.get(f);if(f==null||typeof f=="boolean")continue;if(typeof f=="function"){if(I(f)){if(i){let d=he("",!0);if(t.push(d),g.active&&s&&g.cursor?.parentNode===r){let h=()=>g.cursor&&g.cursor.parentNode===r?g.cursor:null;r.insertBefore(d,h());let y=K(r,f,d),p=y();for(let v of Array.isArray(p)?p:p?[p]:[])s.add(v);r.insertBefore(d,h()),S(()=>ye(r,y())),i.push({marker:d,sig:f,wired:!0});continue}i.push({marker:d,sig:f});continue}let l=f();for(;typeof l=="function"&&I(l);)l=l();if(l==null||typeof l=="boolean")continue;Array.isArray(l)?oe(l,t,r,n,o,a):oe([l],t,r,n,o,a);continue}continue}Array.isArray(f)?oe(f,t,r,n,o,a,i,s):oe([f],t,r,n,o,a,i,s);continue}if(Ct(c)){let f=he("",!0);t.push(f),c.then(l=>{if(f.parentNode){let d=[];if(oe([l],d,f.parentNode,void 0,!1,a),d.length>0){f.parentNode.replaceChild(d[0],f);for(let h=1;h<d.length;h++)f.parentNode?.insertBefore(d[h],d[h-1].nextSibling)}}}).catch(l=>console.error("Error resolving promise in array:",l));continue}if(Array.isArray(c)){oe(c,t,r,n,o,a,i,s);continue}if(Zr(c)){g.active&&(g.cursor===c||g.parents.includes(c))&&Qr(c),t.push(c);continue}if(typeof c=="object"&&c!==null&&"type"in c&&"props"in c){let f=c;if(typeof f.type=="function"){let l=f.type(f.props||{});Array.isArray(l)?oe(l,t,r,n,!1,a):oe([l],t,r,n,!1,a);continue}}if(typeof c=="string"||typeof c=="number"){let f=String(c);if(f.trim()===""&&f!==" ")continue;t.push(he(f));continue}t.push(he(String(c)))}}}}function af(e,t,r,n){for(let l=0;l<r.length;l++){let d=r[l].parentNode;d!==null&&d!==e&&d.nodeType!==11&&(r=r.slice(),r[l]=r[l].cloneNode(!0))}let o=r.length,a=t.length,i=o,s=0,u=0,c=a>0?t[a-1].nextSibling??void 0:n,f=null;for(;s<a||u<i;){if(t[s]===r[u]){s++,u++;continue}for(;a>s&&i>u&&t[a-1]===r[i-1];)a--,i--;if(a===s){let l=i<o?u?r[u-1].nextSibling??void 0:r[i-u]:c;for(;u<i;)U(e,r[u++],l)}else if(i===u)for(;s<a;)(!f||!f.has(t[s]))&&t[s].parentNode===e&&e.removeChild(t[s]),s++;else if(t[s]===r[i-1]&&r[u]===t[a-1]){let l=t[--a].nextSibling;U(e,r[u++],t[s++].nextSibling),U(e,r[--i],l),t[a]=t[s-1]}else{if(!f){f=new Map;let d=u;for(;d<i;)f.set(r[d],d++)}let l=f.get(t[s]);if(l!=null)if(u<l&&l<i){let d=s,h=1;for(;++d<a&&d<i&&!(!f.has(t[d])||f.get(t[d])!==l+h);)h++;if(h>l-u){let y=t[s];for(;u<l;)U(e,r[u++],y)}else t[s].parentNode===e?e.replaceChild(r[u++],t[s++]):(U(e,r[u++],c),s++)}else s++;else t[s].parentNode===e&&e.removeChild(t[s]),s++}}return r}function ye(e,t,r){if(t)if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n].parentNode===e&&e.removeChild(t[n]);else t.parentNode===e&&e.removeChild(t);return null}function U(e,t,r){g.active&&t.parentNode===e||(r&&r.parentNode===e?e.insertBefore(t,r):e.appendChild(t))}function ve(e,t,r){r==null?delete e[t]:e[t]=r}function is(e,t,r){let n=r,o;return Array.isArray(r)&&(n=r[0],o=r[1]),typeof n!="function"?()=>{}:(e.addEventListener(t,n,o),()=>e.removeEventListener(t,n,o))}function ss(e,t){if(!t||typeof t!="function")return;let r=t[Pt]?.name;if(!r)return;let n=r.indexOf(":");n!==-1&&Q(e,r.slice(0,n),r.slice(n+1),t)}function Mt(e,t,r){let n=typeof r=="function"?A(()=>r()):r;if(!(!n||typeof n!="object"))for(let o of Object.keys(n))Q(e,t,o)}function as(e,t){let r=(n,o)=>{typeof n=="function"&&(Q(e,"use",n.name||"use",o),n(e,o??(()=>{})))};if(typeof t=="function"){r(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){r(t[0],t[1]);return}for(let n of t)Array.isArray(n)?r(n[0],n[1]):r(n)}}function Jr(e,t,r,n=!1){return ss(e,r),typeof r!="function"?(N(e,t,r,n),()=>{}):$(()=>{Z(e,"attribute",t,r);let o=typeof r=="function"?r():r;N(e,t,o,n)})}function Yr(e,t,r){return typeof r!="function"?(ve(e,t,r),()=>{}):(ss(e,r),$(()=>{Z(e,"property",t,r);let n=typeof r=="function"?r():r;ve(e,t,n)}))}function cs(e,t,r){return typeof r!="function"?(N(e,t,!!r),()=>{}):$(()=>{Z(e,"attribute",t,r);let n=r();N(e,t,!!n)})}function Lt(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){$(()=>{Z(e,"attribute","class",t),Lt(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 r=Object.keys(t).filter(n=>{let o=t[n];return typeof o=="function"?o():!!o}).join(" ");e.setAttribute("class",r);return}e.setAttribute("class",String(t))}function It(e,t,r){if(!(!t||typeof t!="object"))for(let n in t){let o=t[n],a=n.split(/\s+/).filter(Boolean);if(typeof o=="function"&&r)r.push($(()=>{let i=!!o();for(let s of a)e.classList.toggle(s,i)}));else{let i=!!(typeof o=="function"?o():o);for(let s of a)e.classList.toggle(s,i)}}}function Vr(e,t,r){t.includes("-")?r==null?e.removeProperty(t):e.setProperty(t,String(r)):e[t]=r??""}function je(e){for(;typeof e=="function";)e=e();return e}function Dt(e,t,r){let n=je(t),o=Wr.get(e);if(n==null){Wr.delete(e),e.removeAttribute("style");return}let a=new Set,i=s=>{if(typeof s=="function"&&r){r.push($(()=>i(je(s))));return}if(s=je(s),s!=null){if(typeof s=="string")e.style.cssText=s;else if(Array.isArray(s))for(let u of s)i(u);else if(typeof s=="object")for(let u in s){a.add(u);let c=s[u];typeof c=="function"&&r?r.push($(()=>Vr(e.style,u,je(c)))):Vr(e.style,u,je(c))}}};if(Array.isArray(n))for(let s of n)i(s);else i(n);if(o)for(let s of o)a.has(s)||Vr(e.style,s,null);Wr.set(e,a)}function us(e){let{element:t,props:r,prevProps:n=Ju,isSVG:o=!1,skipChildren:a=!1,isCustomElement:i,accessors:s}=e;if(!t||!Ou(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!r)return console.warn("[spread] Warning: props is undefined!"),()=>{};let u=o||t.namespaceURI===Wi,c=[];for(let f in r){if(a&&f==="children")continue;let l=r[f],d=n[f];if(l===d)continue;if(f==="ref"){rn(l,t);continue}if(f==="use"){as(t,l);continue}if(f.startsWith("on:")){c.push(is(t,f.slice(3),l));continue}if(f.startsWith("prop:")){Q(t,"prop",f.slice(5),l),c.push(Yr(t,f.slice(5),l));continue}if(f.startsWith("attr:")){Q(t,"attr",f.slice(5),l),c.push(Jr(t,f.slice(5),l,u));continue}if(f.startsWith("bool:")){Q(t,"bool",f.slice(5),l),c.push(cs(t,f.slice(5),l));continue}if(f==="class"||f==="className"){typeof l=="function"?c.push($(()=>{Z(t,"attribute","class",l),Lt(t,l())})):Lt(t,l);continue}if(f==="classList"){Mt(t,"class",l),typeof l=="function"?c.push($(()=>{Z(t,"attribute","class",l),It(t,l())})):It(t,l,c);continue}if(f==="style"){Mt(t,"style",l),typeof l=="function"?c.push($(()=>{Z(t,"attribute","style",l),Dt(t,l())})):Dt(t,l,c);continue}if(f.startsWith("on")){let v=f.slice(2).toLowerCase();d&&Li(t,v),l&&Qu(t,v,l);continue}let h=i??t.localName.includes("-"),y=Pi.has(f)||!u&&f in t||h&&!u&&!Dr(f);if(h&&!u&&!Dr(f)&&s!==void 0&&typeof l=="function"&&!s.includes(f)){V()?jr(t,f,l):ve(t,f,l);continue}if(h&&!u&&!Dr(f)&&V()){c.push($(()=>{let v=typeof l=="function"?l():r[f];for(;typeof v=="function"&&v.length===0;)v=v();jr(t,f,v)}));continue}typeof l=="function"?c.push(y?Yr(t,f,l):Jr(t,f,l,u)):c.push($(()=>y?ve(t,f,r[f]):N(t,f,r[f],u)))}for(let f in n)if(!(f in r))if(f.startsWith("on")){let l=f.slice(2).toLowerCase();Li(t,l)}else Pi.has(f)?ve(t,f,null):t.removeAttribute(f);return()=>{c.forEach(f=>f())}}function cf(e,t,r=!1){for(let n in t){let o=t[n];if(n==="ref"){rn(o,e);continue}if(n!=="children"){if(n==="use"){as(e,o);continue}if(n.startsWith("on:")){is(e,n.slice(3),o);continue}if(n.startsWith("prop:")){Q(e,"prop",n.slice(5),o),Yr(e,n.slice(5),o);continue}if(n.startsWith("attr:")){Q(e,"attr",n.slice(5),o),Jr(e,n.slice(5),o,r);continue}if(n.startsWith("bool:")){Q(e,"bool",n.slice(5),o),cs(e,n.slice(5),o);continue}if(n.startsWith("on")&&n.length>2){let a=n.slice(2).toLowerCase();if(typeof o=="function")if(tn.has(a)){e[`$$${a}`]=o;let i=`__fx_${a}`;if(!e[i]){let s=u=>{e[`$$${a}`]?.(u)};e.addEventListener(a,s),e[i]=s}}else e[`$$${a}`]=o,$t.has(a)||we([a]);continue}if(n==="class"||n==="className"){Lt(e,o);continue}if(n==="classList"){Mt(e,"class",o),typeof o=="function"?$(()=>{Z(e,"attribute","class",o),It(e,o())}):It(e,o,[]);continue}if(n==="style"){Mt(e,"style",o),typeof o=="function"?$(()=>{Z(e,"attribute","style",o),Dt(e,o())}):Dt(e,o,[]);continue}if(n==="innerHTML"){if(typeof o=="function"){let a=k(()=>{let i=o();for(;typeof i=="function";)i=i();e.innerHTML=i});S(()=>a())}else e.innerHTML=o;continue}if(n==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let a=k(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();document.activeElement!==e&&(e.value=i??"")});S(()=>{a()})}else $(()=>{document.activeElement!==e&&(e.value=t[n]??"")});continue}if(n==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let a=k(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();document.activeElement!==e&&(e.checked=i??"")});S(()=>{a()})}else $(()=>{document.activeElement!==e&&(e.checked=t[n]??"")});continue}if(n==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let a=!0,i=k(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();a?(a=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""});S(()=>{i()})}else{let a=!0;$(()=>{let i=t[n];a?(a=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""})}continue}if(typeof o=="function"){let a=k(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();Ci(e,n,i,r)});S(()=>{a()})}else $(()=>Ci(e,n,t[n],r))}}}function uf(e,...t){let r=new Set;for(let i of t)for(let s of i)r.add(s);let n=i=>({enumerable:!0,configurable:!0,get:()=>e[i]}),o=t.map(i=>{let s=new Set(i);return new Proxy({},{get:(u,c)=>s.has(c)?e[c]:void 0,has:(u,c)=>s.has(c)&&c in e,ownKeys:()=>Array.from(s).filter(u=>u in e),getOwnPropertyDescriptor:(u,c)=>s.has(c)&&c in e?n(c):void 0})}),a=new Proxy({},{get:(i,s)=>r.has(s)?void 0:e[s],has:(i,s)=>!r.has(s)&&s in e,ownKeys:()=>Reflect.ownKeys(e).filter(i=>!r.has(i)),getOwnPropertyDescriptor:(i,s)=>!r.has(s)&&s in e?n(s):void 0});return[...o,a]}function rn(e,t){if(!e)return;let r=e[Pt]?.name;if(Q(t,"ref",r||typeof e=="function"&&e.name||"ref",e),Zr(e)){let n=t,o=e;if(!n)return;typeof n=="function"?n(o):typeof n=="object"&&"current"in n&&(n.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}function ff(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function Ct(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function nn(e,t,r){if(!t)throw new Error("Container element is required");let n,o,a=[];return W(i=>{D(()=>{g.active||(t.textContent=""),Wt(t),Ht(),K(t,e)}),o=i}),()=>{o?.(),n?.(),a.forEach(i=>i()),t.textContent=""}}function J(e,t){let r=Uu();return r?M(r,()=>Di(e,t)):Di(e,t)}function Di(e,t){if(Ii.fn)return Ii.fn(e,t);t&&wi(t);let r=typeof e=="function"?xi(()=>e(t)):e,n=r!=null&&(typeof r=="function"||typeof r=="object");if(n)try{r.$name=e?.name}catch{}return n&&!ki(r)?Be(r):r}function on(){let e=globalThis.__FX_DATA__;if(e&&typeof e.nodeType!="number")return e;if(Hr!==void 0)return Hr;let t=null;if(typeof document<"u"){let r=document.getElementById(df)?.textContent;if(r)try{t=JSON.parse(r)}catch{t=null}}return Hr=t}function Kt(){for(;;){for(;g.cursor&&g.cursor.nodeType===3&&g.cursor.data==="";)g.cursor=g.cursor.nextSibling;if(g.cursor!=null||!g.parents.length)return;g.cursor=g.parents.pop().nextSibling}}function ze(e,t){let r=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 ${r}. 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 ls(e){return e.localName.includes("-")?e.hasAttribute("data-fx-ssr")||e[pf]===!0:!1}function yf(e){Kt();let t=g.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(ns(t),fs.has(e.toLowerCase())||ls(t)?g.cursor=t.nextSibling:(g.parents.push(t),g.cursor=t.firstChild),t):(Ue&&t&&ze(`<${e}>`,t),null)}function hf(e){fs.has(e.localName)||ls(e)?g.cursor=e.nextSibling:(g.parents.push(e),g.cursor=e.firstChild)}function mf(e,t){Kt();let r=g.cursor;if(r&&r.nodeType===1&&r.tagName.toLowerCase()===e.toLowerCase()){let n=Fu(r);return t&&n&&n!==t?(Ue&&ze(`<${e}> (another template)`,r),null):(ns(r),g.cursor=r.nextSibling,r)}return Ue&&r&&ze(`<${e}> (static)`,r),null}function gf(e){if(e===""){let r=g.cursor;return r&&r.nodeType===3&&r.data!==""?(g.cursor=r.nextSibling,r.data="",r):null}Kt();let t=g.cursor;if(t&&t.nodeType===3){let r=t.data;return r.length>e.length&&r.startsWith(e)?(g.cursor=t.splitText(e.length),t):(g.cursor=t.nextSibling,r!==e&&(t.data=e),t)}return Ue&&t&&ze(`text ${JSON.stringify(e.slice(0,24))}`,t),null}function vf(e){Kt();let t=g.cursor;return t&&t.nodeType===8&&t.data===e?(g.cursor=t.nextSibling,t):(Ue&&t&&ze(`marker <!--${e.slice(0,24)}-->`,t),null)}function wf(){qi||(qi=!0,Ku({hydrateElement:yf,hydrateText:gf,hydrateMarker:vf,hydrateStatic:mf,enterElement:hf}))}function jt(e,t,r){wf(),g.active=!0,g.cursor=t.firstChild,g.parents=[],en(),zu(t);let n=on(),o=r?.resourceNamespace,a=0;vo(()=>o?`${o}:r${a++}`:`r${a++}`),go(n?i=>i in n?{value:n[i]}:void 0:null);try{return nn(e,t)}finally{g.active=!1,g.cursor=null,g.parents=[]}}function sn(e,t={}){if(typeof e=="function")return J(e,t);if(typeof e!="string"||e.length===0)return null;let r=ff(e),n=be(e,r);return cf(n,t,r),bf(n,t),n}function bf(e,t){if(!t||t.children===void 0)return;let r=e.firstChild,n;g.active&&r?.nodeType===8&&r.data==="fx"?n=rf(r):(r=Vi("fx"),n=Vi("fx/"),e.appendChild(r),e.appendChild(n));let o=r;K(e,ef(o,()=>We(()=>t.children)),n,nf(o,n))}function Vi(e){return V()?Gr().createComment(e):document.createComment(e)}function Ft(e){return()=>{let t=e();return typeof t=="function"?t():t}}function Sf(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function ds(e){let t=Ft(()=>e.when),r=w(t,void 0,{name:"Show.when"}),n=w(()=>!!r(),void 0,{name:"Show.cond"}),o=P(),a=null,i=null,s=u=>{u!==i&&(a&&ke(a),a=ue(o),i=u)};return w(()=>{let u=n();return s(u?"when":"fallback"),M(a,()=>{if(!u)return e.fallback;let c=e.children;if(typeof c=="function"&&!Sf(c)){let f=c;if(f.length===0)return A(()=>f(A(r)));let l=r();return A(()=>f(l))}return c})},void 0,{name:"Show.result"})}function ps(e){let t=Ft(()=>e.each),r=()=>e.fallback??null,n=(o,a)=>{let i=e.children,s=Array.isArray(i)?i.map(u=>typeof u=="function"?u(o,a):u):typeof i=="function"?i(o,a):i;return Gi(s),s};return e.by?ho(t,e.by,(o,a)=>n(o,a),{fallback:r}):yo(t,(o,a)=>n(o,a),{fallback:r})}function ys(e){let t=Ft(()=>e.each);return mo(t,(r,n)=>{let o=e.children(r,n);return Gi(o),o},{fallback:()=>e.fallback??null})}function hs(e){return{[Xr]:!0,when:Ft(()=>e.when),get children(){return e.children}}}function ms(e){let t=Array.isArray(e.children)?e.children:[e.children],r=P(),n=null,o=-1,a=i=>{i!==o&&(n&&ke(n),n=ue(r),o=i)};return w(()=>{for(let i=0;i<t.length;i+=1){let u=t[i],c=0;for(;typeof u=="function"&&!u[Xr]&&c++<10;)u=u();if(!u||typeof u!="object"||u[Xr]!==!0)continue;let f=u.when();if(f)return a(i),M(n,()=>{let l=u.children;return typeof l=="function"?l(f):l})}return a(-2),M(n,()=>e.fallback??null)},void 0,{name:"Switch"})}function gs(e){let t=()=>{let s=e.component;return I(s)?s():s},[,r]=uf(e,["component"]),n=P(),o=null,a,i;return w(()=>{let s=t();return s===a||(o&&ke(o),o=ue(n),a=s,i=s==null?null:M(o,()=>A(()=>typeof s=="string"?sn(s,r):J(s,r)))),i},void 0,{name:"Dynamic"})}function vs(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,r,n;return W(o=>{r=o,n=document.createElement("div"),n.style.display="contents",t().appendChild(n),K(n,e.children)&&rn(e.ref,n)}),S(()=>{r(),n.remove()}),null}function an(e){if(V())return e.fallback??null;let t=g.active,[r,n]=b(!t);return t&&queueMicrotask(()=>n(!0)),w(()=>r()?e.children:e.fallback??null,void 0,{name:"client-only"})}function bs(e){let t=_o(),r=i=>!!i&&typeof i.then=="function",n=i=>typeof e.fallback=="function"?e.fallback(i,t.reset):e.fallback,o=i=>{if(r(i))throw i;return queueMicrotask(()=>t.setError(i)),null},a=i=>{if(Array.isArray(i))return i.map(a);if(typeof i!="function")return i;let s=i;return()=>{try{return a(s())}catch(u){return o(u)}}};return w(()=>{let i=t.error();if(i!==void 0)return n(i);try{return Oo(t,()=>{let s=e.children;return a(typeof s=="function"?s():s)})}catch(s){return o(s),n(s)}},void 0,{name:"ErrorBoundary"})}function Ss(e){return w(()=>{let t=typeof e=="function"?e():e,r=[];for(let[n,o]of Object.entries(t)){if(!n)continue;(typeof o=="function"?o():o)&&r.push(n)}return r.join(" ")},void 0,{name:"ClassMap"})}function Af(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function As(e){return w(()=>{let t=typeof e=="function"?e():e,r=[];for(let[n,o]of Object.entries(t)){if(!n)continue;let a=typeof o=="function"?o():o;a!=null&&r.push(`${Af(n)}: ${a}`)}return r.join("; ")},void 0,{name:"StyleMap"})}var qt,ku,_u,Kr,Wi,Ru,Pi,Cu,Ql,Pu,z,Rt,Vu,Wu,id,sd,ad,g,Yi,zr,Fe,B,Ju,Pt,Yu,Xu,Gu,Br,$t,tn,ie,of,Wr,lf,Ii,df,Hr,fs,Ue,pf,qi,Xr,ws,xf,q=F(()=>{"use strict";x();ni();x();x();x();Ri();x();x();x();x();x();x();x();x();x();x();x();x();x();qt=Symbol.for("fluixi.server-node"),ku=Symbol.for("fluixi.dom.server-host"),_u=globalThis,Kr=_u[ku]??={server:typeof document>"u",nodes:null};Wi="http://www.w3.org/2000/svg";Ru=Symbol.for("fluixi.serverProps");Pi=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]),Cu=new Set(["id","class","className","style","slot","part","exportparts","is","title","role","lang","dir","tabindex","hidden"]);Ql=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;Pu="1.0.0-alpha.99",z={dom:Pu,reactive:ri};Vu={getStore:()=>Rt,run(e,t){let r=Rt;Rt=e;try{return t()}finally{Rt=r}}},Wu=globalThis[Symbol.for("fluixi.requestStore")]??={store:Vu,async:!1},id=globalThis[Symbol.for("fluixi.requestEndHooks")]??=new WeakMap;sd=globalThis[Symbol.for("fluixi.requestLocals")]??=new WeakMap,ad=globalThis[Symbol.for("fluixi.responseHeaders")]??=new WeakMap,g={active:!1,cursor:null,parents:[]},Yi=null;zr=Symbol.for("fluixi.hydrationKeys"),Fe="data-hk";B=null;Ju={},Pt="__fx_at",Yu="__fx_loc";Xu=Symbol.for("fluixi.owner");Gu="__fluixi_delegated_events__",Br=globalThis[Gu]??={names:new Set},$t=Br.names,tn=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);ie=0,of=200;Wr=new WeakMap;lf="__fx_dom_create_component__",Ii=globalThis[lf]??={fn:null};df="__FX_DATA__";fs=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ue=typeof process<"u"&&process.env&&!1;pf=Symbol.for("fluixi.ownsContent");qi=!1;Xr=Symbol("match");ws=an;xf=qt});function Es(e){if(e!=null&&(typeof e=="object"||typeof e=="function"))try{e.$lazy=!0}catch{}return e}function Pe(e,t){let r,n,o;function a(){return n||(n=e().then(s=>r=s.default)),n}t?.preload&&a();let i=(s=>{if(r){let u=r;return Es(A(()=>u(s)))}if(!o){let[u]=fe(()=>a(),{transport:!1});if(o=u,u.error)throw u.error}return w(()=>{let u=o();return u?Es(J(u,s)):void 0})});return i.preload=()=>a().then(()=>{}),i.$lazy=!0,i.loader=e,i}var Zt=F(()=>{"use strict";q();x()});function Ge(e,t){let r=ee(e,t),n=o=>r.Provider({value:o.value,get children(){return o.children},debug:o.debug});return{id:r.id,Provider:zi(n),defaultValue:e}}function Ze(e){let t=H(e);return t!==void 0?t:e.defaultValue}function pn(e,t,r){let n=typeof t=="function"?t():t;return e.Provider({value:n,get children(){return r.children}})}function $s(e,t){return e.reduceRight((n,[o,a])=>({get children(){return pn(o,a,n)}}),t).children}function Ns(e,t){for(let r=P();r;r=r.parent)if(r.contexts?.has(e.id))return Ze(e);throw new Error(t??`[fluixi] No Provider for ${e.id.description??"this context"} above this component.`)}var yn=F(()=>{"use strict";q();x()});function An(){return typeof document<"u"&&typeof document.startViewTransition=="function"}function xn(){if(typeof window>"u"||typeof window.matchMedia!="function")return!1;try{return window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}function nl(e){return e!=="none"&&An()&&!xn()}function Bs(e){let t=[];for(let r of e){let n=r?.preload;if(typeof n=="function")try{let o=n();o&&typeof o.then=="function"&&t.push(o.catch(()=>{}))}catch{}}return t.length?Promise.all(t).then(()=>{}):null}function kn(e,t){if(!nl(e))return Promise.resolve(t()).then(()=>{});let r=document.startViewTransition;try{let n=r.call(document,()=>t());return n.finished?.catch(()=>{}),n.ready?.catch(()=>{}),n.updateCallbackDone.catch(()=>{})}catch{return Promise.resolve(t()).then(()=>{})}}var _n=F(()=>{"use strict"});function er(e,t,r={}){let{preserveStructure:n,multiple:o,throwOnError:a=!1,defaultValue:i,maxDepth:s=20}=r;if(!e||typeof e!="object")return i;if(!t)return e;if(Array.isArray(t))if(n){let f={};for(let l of t){let d=er(e,l,{...r,preserveStructure:!1});d!==void 0&&il(f,l,d)}return f}else return t.map(f=>er(e,f,{...r,preserveStructure:!1}));let u=On(t,{...r,throwOnError:a});if(u.length===0)return e;if(typeof n>"u"||n===!1){let f=sl(e,t);return o===!1&&Array.isArray(f)?f[0]:f===void 0&&i!==void 0?i:f}let c=G(e,u,0,s);return c===void 0&&i!==void 0?i:c}function sl(e,t,r={}){let{createMissing:n=!1,add:o=!1,debug:a=!1}=r,i=On(t),s=e,u=!1,c="",f=t;if(typeof s=="object"&&!Array.isArray(s)&&f.length>0&&s[f])return s=s[f],s;for(let l=0;l<i.length;l++){let d=i[l],h=i.length>1?l===i.length-1:!1;if(s===null&&!n)return;let y=i[l+1];switch(d.type){case"property":if(s&&typeof s=="object")if(Array.isArray(s)){if(typeof d.value=="number"){let p=d.value;if(n&&p>=s.length)for(let v=s.length;v<=p;v++)s.push(void 0);if(n&&(s[p]===null||s[p]===void 0)&&(!h||u)&&(y?s[p]=y.type==="index"||y.type==="slice"||y.type==="union"||y.type==="wildcard"?[]:{}:s[p]=null,u=!1),s=s[p],y){u=!0;continue}}else o?s.push({[String(d.value)]:null}):s=s.map(p=>p[String(d.value)]);if(y)continue;return Js(s)}else{if(s[c]&&c.split(".").length>=2){s=s[c];continue}if(n&&(s[String(d.value)]===null||s[String(d.value)]===void 0)&&(!h||u)&&(y?s[String(d.value)]=y.type==="index"||y.type==="slice"||y.type==="union"||y.type==="wildcard"?[]:{}:s[String(d.value)]=null,u=!1,s=s[String(d.value)],y)){u=!0;continue}if(s?(!s[String(d.value)]&&n&&(s[String(d.value)]=null),s=s[String(d.value)]):s={[String(d.value)]:null},y)continue}else if(n)s={},s[String(d.value)]=y.type==="index"||y.type==="slice"||y.type==="union"||y.type==="wildcard"||r.type==="array"?[]:{},s=s[String(d.value)];else return;break;case"index":case"wildcard":if(Array.isArray(s)){if(d.type==="index"){let p=d.value;if(p<0){s=s[s.length-Math.abs(p)];continue}if(n&&(p>=s.length||s[p]==null||s[p]==null)&&!h){for(let v=s.length;v<=p;v++)s.push(void 0);y&&(s[p]=y.type==="index"||y.type==="slice"||y.type==="union"||y.type==="wildcard"?[]:{})}s=s[p]}else if(!h)continue}else if(n){let p=i[l+1];s=[];let v=d.value;for(let _=0;_<=v;_++)s.push(void 0);s[v]=p.type==="index"||p.type==="slice"||p.type==="union"||p.type==="wildcard"||r.type==="array"?[]:{},s=s[v]}else{if(d.type==="index"&&typeof s=="object"&&s&&s[String(d.value)]!==void 0){s=s[String(d.value)];continue}if(typeof s=="object"){s=Object.values(s);continue}return}break;default:return}}return Js(s)}function Js(e){return Array.isArray(e)?e.filter(t=>typeof t<"u"):e}var tr,G,On,ol,il,En=F(()=>{"use strict";tr=e=>e==null||Array.isArray(e)||typeof e=="function"||e instanceof Date||e instanceof RegExp||e instanceof Map||e instanceof Set||e instanceof Error?!1:typeof e=="object",G=(e,t,r,n)=>{if(r>n)return;if(t.length===0)return e;let o=t[0],a=t.slice(1);if(o.type==="descendant"){let i=G(e,a,r+1,n);if(i!==void 0)return i;if(e&&typeof e=="object")if(Array.isArray(e)){let s=[];for(let u=0;u<e.length;u++){let c=G(e[u],t,r+1,n);c!==void 0&&(s[u]=c)}return s.length>0?s:void 0}else{let s={};for(let u in e)if(e.hasOwnProperty(u)){let c=G(e[u],t,r+1,n);c!==void 0&&(s[u]=c)}return Object.keys(s).length>0?s:void 0}return}switch(o.type){case"property":if(tr(e)&&o.value&&String(o.value)in e){let i=e[String(o.value)],s=G(i,a,r+1,n);if(s!==void 0)return{[String(o.value)]:s}}break;case"index":if(Array.isArray(e)){let i=o.value;if(i>=0&&i<e.length){let s=G(e[i],a,r+1,n);if(s!==void 0){let u=new Array(e.length).filter(c=>c!==void 0);return u[i]=s,u}}}else if(e&&typeof e=="object"){let i=String(o.value);if(i in e){let s=G(e[i],a,r+1,n);if(s!==void 0)return{[i]:s}}}break;case"wildcard":if(e&&typeof e=="object")if(Array.isArray(e)){let i=[],s=!1;for(let u=0;u<e.length;u++){let c=G(e[u],a,r+1,n);c!==void 0&&(i[u]=c,s=!0)}return s?i:void 0}else{let i={},s=!1;for(let u in e)if(e.hasOwnProperty(u)){let c=G(e[u],a,r+1,n);c!==void 0&&(i[u]=c,s=!0)}return s?i:void 0}break;case"slice":if(Array.isArray(e)){let[i,s]=o.value,u=Math.max(0,i),c=Math.min(e.length,s===1/0?e.length:s),f=[],l=!1;for(let d=u;d<c;d++){let h=G(e[d],a,r+1,n);h!==void 0&&(f[d]=h,l=!0)}return l?f:void 0}break;case"union":if(Array.isArray(e)){let i=o.value,s=[],u=!1;for(let c of i)if(c>=0&&c<e.length){let f=G(e[c],a,r+1,n);f!==void 0&&(s[c]=f,u=!0)}return u?s:void 0}break;case"filter":if(Array.isArray(e)){let i=o.value,s=[],u=!1;for(let c=0;c<e.length;c++)if(i(e[c])){let f=G(e[c],a,r+1,n);f!==void 0&&(s[c]=f,u=!0)}return u?s:void 0}break}},On=(e,t={})=>{let{type:r="auto",throwOnError:n=!1}=t;if(!e||typeof e!="string")return[];let o=[],a="",i=!1,s=!1,u="",c="",f=0,d=r==="auto"?(y=>y.includes("..")?"descendant":y.includes("[?(")?"filter":y.includes("[:")||y.includes("[0:")?"slice":y.includes("[,")||y.includes("[0,1]")?"union":y.includes("[*]")||y.includes(".*.")?"wildcard":y.includes("[]")?"array-wildcard":y.includes("[")&&y.includes("]")?"bracket":"dot")(e):r,h=y=>{let p=y.trim();if(p==="*"||p==="")return{type:"wildcard",value:p===""?"[]":"*",raw:p===""?"[]":y};if(p==="[]")return{type:"wildcard",value:"[]",raw:y};if(/^-?\d+$/.test(p))return{type:"index",value:parseInt(p,10),raw:y};if(p.includes(":")){let v=p.split(":").map(Y=>Y.trim()),_=v[0]===""?0:parseInt(v[0],10),O=v[1]===""?1/0:parseInt(v[1],10);if(isNaN(_)||isNaN(O)){if(n)throw new Error(`Invalid slice notation: ${y}`);return{type:"wildcard",value:"*",raw:y}}return{type:"slice",value:[_,O],raw:y}}if(p.includes(",")){let v=p.split(",").map(_=>{let O=parseInt(_.trim(),10);return isNaN(O)?-1:O}).filter(_=>_>=0);if(v.length===0){if(n)throw new Error(`Invalid union notation: ${y}`);return{type:"wildcard",value:"*",raw:y}}return{type:"union",value:v,raw:y}}if(p.startsWith("?(")&&p.endsWith(")")){let v=p.slice(2,-1);try{return{type:"filter",value:ol(v),raw:y}}catch(_){if(n)throw _;return{type:"wildcard",value:"*",raw:y}}}return p.startsWith('"')&&p.endsWith('"')||p.startsWith("'")&&p.endsWith("'")?{type:"property",value:p.slice(1,-1),raw:y}:{type:"property",value:p,raw:y}};for(let y=0;y<e.length;y++){let p=e[y],v=e[y+1];if((p==='"'||p==="'")&&!s){s=!0,u=p;continue}else if(p===u&&s){s=!1,u="",p==='"'||p==="'"||(i?c+=p:a+=p);continue}if(s){i?c+=p:a+=p;continue}if(p==="["&&!i){a&&(o.push({type:"property",value:a,raw:a}),a=""),i=!0,c="";continue}if(p==="]"&&i&&!s){i=!1;let O=h(c);o.push(O);continue}let _=o.length>0?o[o.length-1]:null;if(p==="."&&!i&&!s){if(v==="."){let O=e.split("..")[0];o.push({type:"property",value:O,raw:O}),o.push({type:"descendant",value:"..",raw:".."}),y++}else a&&(a==="*"?o.push({type:"wildcard",value:a,raw:a}):o.push({type:"property",value:a,raw:a}),a="");continue}if(i)c+=p;else if(_&&_.type!=="descendant")a+=p;else{let O=e.split(_?.raw)[1];O!==void 0?a=O:a+=p}}return a&&o.push({type:"property",value:a,raw:a}),o.map(y=>{if(y.type==="property"&&typeof y.value=="string"&&/^-?\d+$/.test(y.value)){let p=parseInt(y.value,10);if(!isNaN(p))return{...y,type:"index",value:p}}return y})},ol=e=>{let t=e.replace(/@\.([a-zA-Z_$][\w$]*)/g,(r,n)=>`item.${n}`).replace(/@/g,"item");try{return new Function("item",`return ${t}`)}catch{throw new Error(`Invalid filter expression: ${e}`)}},il=(e,t,r)=>{let n=On(t),o=e;for(let a=0;a<n.length;a++){let i=n[a],s=a===n.length-1;switch(i.type){case"property":if(s)o[String(i.value)]=r;else{if(!o[String(i.value)]){let c=n[a+1];o[String(i.value)]=c.type==="index"||c.type==="slice"||c.type==="union"||c.type==="wildcard"?[]:{}}o=o[String(i.value)]}break;case"index":Array.isArray(o)||(o=[]);let u=i.value;if(s){if(u>=o.length)for(let c=o.length;c<=u;c++)o.push(void 0);o[u]=r}else{if(!o[u]){let c=n[a+1];o[u]=c.type==="index"||c.type==="slice"||c.type==="union"||c.type==="wildcard"?[]:{}}o=o[u]}break;case"wildcard":if(Array.isArray(o))if(s)for(let c=0;c<o.length;c++)o[c]=r;else{let c=n[a+1];for(let f=0;f<o.length;f++)o[f]||(o[f]=c.type==="index"||c.type==="slice"||c.type==="union"||c.type==="wildcard"?[]:{});o.length>0&&(o=o[0])}break}}}});function al(e,t,r){let n=new Uint8Array(t.length);e:for(let o=0;o<e.length;o++){for(let a=0;a<t.length;a++)if(!n[a]&&Se(e[o],t[a],r)){n[a]=1;continue e}return!1}return!0}var Se,Ys=F(()=>{"use strict";En();Se=(e,t,r={})=>{if(e===t)return!0;if(e==null||t==null||typeof e!=typeof t)return!1;let n=Array.isArray(e),o=Array.isArray(t);if(n!==o)return!1;if(n&&o)return e.length!==t.length?!1:r.unordered?al(e,t,r):e.every((p,v)=>Se(p,t[v],r));if(typeof e!="object")return e===t;let a=e instanceof Date,i=t instanceof Date;if(a!==i)return!1;if(a)return e.getTime()===t.getTime();let s=e instanceof RegExp,u=t instanceof RegExp;if(s!==u)return!1;if(s)return e.toString()===t.toString();let c=e instanceof Map,f=t instanceof Map;if(c!==f)return!1;if(c){if(e.size!==t.size)return!1;for(let[p,v]of e)if(!t.has(p)||!Se(v,t.get(p),r))return!1;return!0}let l=e instanceof Set,d=t instanceof Set;if(l!==d)return!1;if(l){if(e.size!==t.size)return!1;let p=[...t],v=new Uint8Array(p.length);e:for(let _ of e){for(let O=0;O<p.length;O++)if(!v[O]&&Se(_,p[O],r)){v[O]=1;continue e}return!1}return!0}if(!tr(e)||!tr(t))return!1;let h=Object.keys(e),y=Object.keys(t);if(h.length!==y.length)return!1;for(let p of h)if(!Object.prototype.hasOwnProperty.call(t,p)||!Se(e[p],t[p],r))return!1;return!0}});function Gs(e){let r=(()=>{try{return JSON.parse(sessionStorage.getItem(Xs)??"{}")}catch{return{}}})(),n=()=>{let c=Object.keys(r);for(let f of c.slice(0,Math.max(0,c.length-100)))delete r[f];try{sessionStorage.setItem(Xs,JSON.stringify(r))}catch{}},o=e.key,a=()=>{o!==void 0&&(delete r[o],r[o]=window.scrollY,n())},i=history.scrollRestoration;history.scrollRestoration="manual",window.addEventListener("pagehide",a);let s=c=>window.scrollTo({top:c,left:0,behavior:"instant"}),u=c=>{if(!c||c==="#")return!1;let f=document.getElementById(decodeURIComponent(c.slice(1)));return f?.scrollIntoView({behavior:"instant"}),f!==null};return{leave:a,arrive(c,f){if(o=c.key,c.action==="pop"||f===void 0){let l=c.key===void 0?void 0:r[c.key];l!==void 0&&s(l);return}c.action==="replace"&&c.pathname===f.pathname||u(c.hash)||s(0)},dispose(){window.removeEventListener("pagehide",a),history.scrollRestoration=i}}}var Xs,Zs=F(()=>{"use strict";Xs="fx:scroll"});function cl(e){return e.startsWith("//")?e.replace(/^\/+/,"/"):e}function et(e,t,r=!1){let n=[];if(e===t)return{params:{},path:t};if(!r&&e==="/"&&t.startsWith("/"))return{params:{},path:"/"};let o=e.replace(/:([a-zA-Z0-9_]+)/g,(u,c)=>(n.push(c),"([^/]+)")).replace(/\*([a-zA-Z0-9_]*)/g,(u,c)=>(c&&n.push(c),"(.*)"));o.startsWith("/")||(o="/"+o),o===""&&(o="/");let a=new RegExp(`^${o}${r?"$":"(?=/|$)"}`),i=t.match(a);if(!i)return null;let s={};return n.forEach((u,c)=>{s[u]=i[c+1]}),{params:s,path:i[0]}}function Qs(e){let t=e.path.split("/").filter(Boolean);if(t.length===0)return 5;let r=0;for(let n of t)n.startsWith("*")?r+=1:n.startsWith(":")?r+=10:r+=100;return r}function ul(e){return[...e].sort((t,r)=>Qs(r)-Qs(t))}function tt(e,t){let r=t.length>1?t.replace(/\/+$/,"")||"/":t,n=ea(e,r);if(!n)return null;let o=[],a="",i={};for(let s of n.layers){a=cl(fl(a,s.consumed));let u={};for(let[c,f]of Object.entries(s.params))c in i||(u[c]=f),i[c]=f;o.push({route:s.route,component:s.route.component,params:u,pathname:a||"/"})}return{matched:o,params:i,pathname:t}}function ea(e,t){if(!e||e.length===0)return null;let r=ul(e);for(let n of r){let o=!!n.children&&n.children.length>0,a=et(n.path,t,!o);if(a){if(o){let i=ea(n.children,t);if(i)return{layers:[{route:n,params:a.params,consumed:a.path},...i.layers]};continue}return{layers:[{route:n,params:a.params,consumed:a.path}]}}}return null}function fl(e,t){if(!e)return t;if(t===e)return e;if(t.startsWith(e))return t;let r=e.replace(/\/$/,""),n=t.replace(/^\//,"");return`${r}/${n}`}function dl(e){let t=e,r="",n=t.indexOf("#");n!==-1&&(r=t.slice(n),t=t.slice(0,n));let o="",a=t.indexOf("?");return a!==-1&&(o=t.slice(a),t=t.slice(0,a)),{pathname:t||"/",search:o,hash:r}}function rr(e="/"){let t=[{path:e,state:null,key:Me()}],r=0,n="pop",o=new Set,a=()=>o.forEach(i=>i());return{get(){let{path:i,state:s,key:u}=t[r];return{...dl(i),state:s,key:u,action:n}},push(i,s=null){t=t.slice(0,r+1),t.push({path:i,state:s,key:Me()}),r=t.length-1,n="push",a()},replace(i,s=null){t[r]={path:i,state:s,key:Me()},n="replace",a()},go(i){let s=r+i;s<0||s>=t.length||(r=s,n="pop",a())},subscribe(i){return o.add(i),()=>o.delete(i)}}}function Le(){let e=typeof window<"u"?window:void 0,t=new Set,r="pop",n=()=>t.forEach(i=>i());e&&e.addEventListener("popstate",()=>(r="pop",n()));let o=i=>typeof i=="object"&&i!==null&&typeof i.fx=="string",a=()=>{let i=e.history.state;if(o(i))return i;let s={fx:Me(),usr:i??null};return e.history.replaceState(s,""),s};return{window:e!==void 0,get(){if(!e)return{pathname:"/",search:"",hash:"",state:null};let{pathname:i,search:s,hash:u}=e.location,{fx:c,usr:f}=a();return{pathname:i,search:s,hash:u,state:f,key:c,action:r}},push(i,s=null){e?.history.pushState({fx:Me(),usr:s},"",i),r="push",n()},replace(i,s=null){e?.history.replaceState({fx:Me(),usr:s},"",i),r="replace",n()},subscribe(i){return t.add(i),()=>t.delete(i)}}}function pl(e){let t={};return e&&new URLSearchParams(e.startsWith("?")?e.slice(1):e).forEach((n,o)=>t[o]=n),t}function yl(e,t){if(!t)return e||"/";let r=t.replace(/\/$/,"");return e===r?"/":e.startsWith(r+"/")?e.slice(r.length)||"/":e||"/"}function hl(e,t){return!t||/^https?:\/\//.test(e)?e:`${t.replace(/\/$/,"")}${e.startsWith("/")?e:"/"+e}`}function ta(e){let{routes:t,history:r,base:n}=e,o=new Set,a=()=>{let f=r.get();return{pathname:f.pathname,search:f.search,hash:f.hash,state:f.state,query:pl(f.search),...f.key!==void 0?{key:f.key}:{},...f.action!==void 0?{action:f.action}:{}}},i=f=>tt(t,yl(f,n)),s=(()=>{let f=a();return{location:f,match:i(f.pathname)}})(),u=()=>{let f=a();s={location:f,match:i(f.pathname)},o.forEach(l=>l(s))},c=r.subscribe(u);return{state(){return s},subscribe(f){return o.add(f),()=>o.delete(f)},navigate(f,l={}){let d=hl(f,n);l.replace?r.replace(d,l.state??null):r.push(d,l.state??null)},match(f){return i(f)},destroy(){c(),o.clear()}}}var ll,Me,Tn=F(()=>{"use strict";ll=0,Me=()=>`${Date.now().toString(36)}-${(ll++).toString(36)}`});function ra(e){return Pn.add(e),()=>{Pn.delete(e)}}function oa(e,t,r={}){let{ttl:n=1/0,staleWhileRevalidate:o=!0}=r;return(...a)=>{let i=r.cache??ct(),s=t+":"+JSON.stringify(a),u=()=>{let f=i.inflight.get(s);if(f)return f;let l=Promise.resolve(e(...a)).then(d=>(i.set(s,{value:d,timestamp:Date.now()}),i.inflight.delete(s),d),d=>{throw i.inflight.delete(s),d});return i.inflight.set(s,l),l},c=i.get(s);return c&&(n===1/0||Date.now()-c.timestamp<=n)?Promise.resolve(c.value):c&&o?(u().then(na,()=>{}),Promise.resolve(c.value)):u()}}function nr(e,t){let r=typeof e=="string"?[e]:Array.isArray(e)?e:null;ia(r??e,t??ct()),r&&!t&&ml(r)}function ia(e,t){let r=Array.isArray(e)?n=>e.some(o=>n===o||n.startsWith(o+":")):e;for(let n of[...t.keys()])r(n)&&t.delete(n);na()}function ml(e){try{localStorage.setItem(sa,JSON.stringify({names:e,at:Date.now()+Math.random()}))}catch{}}function aa(e,t){let[r]=fe(t||(()=>!0),e);return r}function ca(e){return Rn.has(e)||Rn.set(e,b(void 0)),Rn.get(e)}function ua(e){return Cn.has(e)||Cn.set(e,b([])),Cn.get(e)}function $n(e,t,r={}){let n=t||e.name||"action",o=async(...a)=>{let i=a.length>1?a:a[0],[,s]=ca(n),[,u]=ua(n),c,f=()=>u(y=>y.filter(p=>p!==c)),l=y=>{u(p=>p.map(v=>v===c?y:v)),c=y},d=()=>{s(void 0),f()},h=()=>(f(),o(...a));c={input:i,pending:!0,clear:d,retry:h},s(c),u(y=>[...y,c]);try{let y=await e(...a);s({input:i,result:y,pending:!1,clear:d,retry:h}),f();let p=typeof r.invalidates=="function"?r.invalidates(y):r.invalidates;for(let v of p??[])nr(v);return y}catch(y){let p={input:i,error:y,pending:!1,clear:d,retry:h};throw s(p),l(p),y}};return o.url=n,o.with=a=>$n((...i)=>e(a,...i),t,r),o}function fa(e){let[t]=ca(e.url);return t}function la(e){let[t]=ua(e.url);return t}function da(e){return e}var Pn,na,sa,Rn,Cn,gl,cy,Nn=F(()=>{"use strict";x();x();yn();Pn=new Set;na=()=>{for(let e of[...Pn])e()};sa="fluixi:revalidate";typeof window<"u"&&window.addEventListener("storage",e=>{if(!(e.key!==sa||!e.newValue))try{let t=JSON.parse(e.newValue).names;Array.isArray(t)&&t.every(r=>typeof r=="string")&&ia(t,ct())}catch{}});globalThis[Symbol.for("fluixi.revalidate")]=e=>nr(e);Rn=new Map;Cn=new Map;gl=Ge(void 0,"route-data"),cy=gl.Provider});var ga={};jn(ga,{A:()=>Wn,ActionForm:()=>Rl,Link:()=>sr,Outlet:()=>Ln,Redirect:()=>In,Router:()=>Mn,action:()=>$n,cache:()=>oa,createAsync:()=>aa,createBrowserHistory:()=>Le,createMemoryHistory:()=>rr,lazy:()=>Pe,matchPath:()=>et,matchRoutes:()=>tt,prefersReducedMotion:()=>xn,preloadRoutes:()=>Cl,revalidate:()=>nr,runWithOwner:()=>M,select:()=>_l,supportsViewTransitions:()=>An,useAction:()=>da,useIsRouting:()=>Sl,useLevelParams:()=>xl,useLinkNavigation:()=>Ol,useLocation:()=>nt,useMatch:()=>qn,useNavigate:()=>ir,useParam:()=>Dn,useParamSelector:()=>kl,useParams:()=>rt,useRouteData:()=>El,useRouter:()=>Ie,useSearchParams:()=>Vn,useSubmission:()=>fa,useSubmissions:()=>la});function vl(e,t,r){let n,o=e.route.data;if(typeof o=="function"){let f=!1;S(()=>{f=!0});let l=P(),d=H(Ae),h=!1,y=T=>{h||f||(h=!0,M(l,()=>{let E=!0;k(()=>{T(),E?E=!1:A(()=>{_()})})}))},p,[v,{refetch:_}]=fe(()=>{let T=A(r.params),E=A(r.location);p=!1;let C=o({params:()=>T,location:()=>(p=!0,E)},l,()=>f,y);return d?d.trackLoad(C):C});S(ra(()=>{A(()=>r.matched()[t]?.route)===e.route&&_()}));let O=A(()=>JSON.stringify(r.matched()[t]?.params??{})),Y=A(()=>r.location().search);k(()=>{let T=r.matched()[t],E=r.location().search;if(T?.route!==e.route)return;let C=JSON.stringify(T.params??{}),j=C!==O,ne=p!==!1&&E!==Y;O=C,Y=E,(j||ne)&&A(()=>{_()})}),n=()=>{let T=v.error;if(T!=null)throw T;let E=v;return E.state==="refreshing"?E.latest:v()},Object.defineProperty(n,"loading",{get:()=>v.loading}),Object.defineProperty(n,"state",{get:()=>v.state})}let a=()=>ha.Provider({value:n,get children(){return ya.Provider({value:e.params,get children(){return pa.Provider({value:{depth:t,...r},get children(){return J(e.component,{})}})}})}});if(!n)return{view:a(),ready:()=>!0};let i=n,s=()=>{let f=i.state;return f===void 0?i.loading:f==="pending"||f==="unresolved"},[u,c]=b(A(()=>!s()));return k(()=>c(!s())),{view:w(()=>u()?a():null),ready:u}}function ma(e){let t=e.depth+1,[r,n]=b(A(()=>e.matched()[t]?.component));k(()=>{let c=e.matched()[t]?.component;A(r)!==c&&n(()=>c)});let o=P(),a=null,i=null,s=c=>c?.dispose();S(()=>{s(a),s(i),a=i=null});let u=w(()=>{if(!r())return null;let f=A(()=>e.matched())[t];return M(o,()=>W(l=>({...vl(f,t,{matched:e.matched,params:e.params,location:e.location}),dispose:l})))});return w(()=>{let c=u();return c?(c===a||(i&&i!==c&&s(i),i=c,a&&!c.ready())||(s(a),a=c,i=null),a.view):(s(a),s(i),a=i=null,e.notFound?e.notFound():null)})}function wl(e){return e==null?bl():typeof e=="function"?J(e,{}):e}function bl(){let e=be("div");N(e,"class","fx-not-found"),N(e,"role","main"),N(e,"style","min-height:60vh;display:grid;place-content:center;gap:.25rem;text-align:center;font-family:system-ui,-apple-system,sans-serif");let t=be("h1");N(t,"style","margin:0;font-size:2.5rem;font-weight:700"),K(t,"404");let r=be("p");return N(r,"style","margin:0;opacity:.7"),K(r,"This page could not be found."),e.appendChild(t),e.appendChild(r),e}function Mn(e){let t=e.history??Le(),r=ta({routes:e.routes,base:e.base,history:t}),[n,o]=b(r.state()),[a,i]=b(!1),[s,u]=b(0),c=0,f=t.window?Gs(r.state().location):void 0,l=f?{id:0,location:r.state().location,from:void 0}:null,[d,h]=b(0),y=()=>{let T=or??e.transition??"auto";return or=void 0,T},p=r.subscribe(T=>{let E=++c,C=y();i(!0),f&&(f.leave(),l={id:E,location:T.location,from:A(n).location});let j=Bs((T.match?.matched??[]).map(xe=>xe.component).filter(Boolean)),ne=()=>{o(T);let xe=po();return E===c&&i(!1),f&&h(E),xe};if(!j){kn(C,ne);return}j.then(()=>{if(E===c)return kn(C,ne)})});S(()=>{p(),f?.dispose(),r.destroy(),c++});let v=w(()=>(n().match?.matched??[]).filter(T=>T.component)),_={router:r,location:w(()=>n().location),params:w(()=>n().match?.params??{}),isRouting:()=>a()||s()>0,trackLoad(T){return T&&typeof T.finally=="function"&&(u(E=>E+1),T.finally(()=>u(E=>E-1)).catch(()=>{})),T}};if(f){let T=typeof requestAnimationFrame=="function"?requestAnimationFrame:E=>setTimeout(E,0);k(()=>{let E=d();if(_.isRouting())return;let C=l;!C||C.id!==E||E!==c||(l=null,T(()=>{E===c&&f.arrive(C.location,C.from)}))})}let O={depth:-1,matched:v,params:_.params,location:_.location,notFound:()=>wl(e.notFound)},Y;return Ae.Provider({value:_,get children(){return Y??=ma(O)}})}function Ln(){let e=H(pa);return e?ma(e):null}function Sl(e={}){let t=H(Ae)?.isRouting??(()=>!1),r=e.delay??0;if(r<=0)return t;let[n,o]=b(!1);return k(()=>{if(!t()){o(!1);return}let a=setTimeout(()=>o(!0),r);S(()=>clearTimeout(a))}),()=>t()&&n()}function In(e){let t=H(Ae);if(t&&typeof window<"u"){let r=!1;S(()=>r=!0),queueMicrotask(()=>{r||t.router.navigate(e.to,{replace:e.replace!==!1})})}return null}function Ie(){let e=H(Ae);if(e)return e;if(typeof window>"u")return Al;throw new Error("[router] useRouter must be used within <Router>")}function rt(){let e=Ie().params;return w(()=>e(),{},{equals:(t,r)=>JSON.stringify(t)===JSON.stringify(r)})}function xl(){return H(ya)??{}}function Dn(e){let t=rt();return w(()=>t()[e])}function kl(e,t){let r=rt();return w(()=>e(r()),void 0,t?{equals:t}:void 0)}function qn(e){let t=nt();return w(()=>et(typeof e=="function"?e():e,t.pathname))}function Vn(){let e=nt(),t=ir();return[w(()=>e.query),(o,a)=>{let i=new URLSearchParams(e.search);for(let[u,c]of Object.entries(o))c===null?i.delete(u):i.set(u,c);let s=i.toString();t(e.pathname+(s?`?${s}`:""),a)}]}function _l(e,t){let r=(n,o)=>Se(n,o);return t!==void 0?w(()=>er(e(),t),void 0,{equals:r}):w(e,void 0,{equals:r})}function nt(){let{location:e}=Ie();return new Proxy({},{get:(t,r)=>e()[r],has:(t,r)=>r in e(),ownKeys:()=>Reflect.ownKeys(e()),getOwnPropertyDescriptor:(t,r)=>Object.getOwnPropertyDescriptor(e(),r)})}function Ol(e={}){let t=H(Ae);return r=>{if(!t||r.defaultPrevented||r.button!==0||r.metaKey||r.ctrlKey||r.shiftKey||r.altKey)return;let o=r.target?.closest?.("a");if(!o||!o.getAttribute("href")||o.target&&o.target!=="_self"||o.hasAttribute("download")||/(^|\s)external(\s|$)/.test(o.getAttribute("rel")??""))return;let a=new URL(o.href);a.protocol!=="http:"&&a.protocol!=="https:"||a.origin===window.location.origin&&(a.hash&&a.pathname===window.location.pathname&&a.search===window.location.search||e.shouldNavigate&&!e.shouldNavigate(a,o)||(r.preventDefault(),or=e.transition,t.router.navigate(a.pathname+a.search+a.hash,{replace:e.replace})))}}function ir(){let{router:e}=Ie();return(t,r)=>{or=r?.transition,e.navigate(t,r)}}function El(){return H(ha)??(()=>{})}function sr(e){let t=H(Ae),r=()=>t.router.navigate(ce(e.href)??"",{replace:ce(e.replace)}),n=be("a");N(n,"href",ce(e.href)??""),e.slot&&N(n,"slot",ce(e.slot));for(let a of Object.keys(e)){if(Tl.has(a))continue;let i=e[a];if(typeof i=="function"){if(/^on[A-Z]/.test(a))continue;let s=i,u=()=>{let c=s();c==null||c===!1?n.removeAttribute?.(a):N(n,a,String(c))};typeof n.addEventListener=="function"?k(u):u();continue}i!=null&&N(n,a,String(i))}if(typeof n.addEventListener=="function")n.addEventListener("click",a=>{a.metaKey||a.ctrlKey||a.shiftKey||a.altKey||t&&(a.preventDefault(),r())});else{let a=ce(e.className??e.class)??"";a&&N(n,"class",a)}typeof n.addEventListener=="function"&&k(()=>{let a=ce(e.href)??"";n.setAttribute("href",a);let i=ce(e.className??e.class)??"",s=ce(e.activeClass)??"",u=ce(e.active)??t?.location().pathname===a;n.className=[i,u?s:""].filter(Boolean).join(" ")});let o=e.children;return o!=null&&K(n,o),n}function Rl(e){let t=e.action,r=e.className??e.class,n=t.url??"",o=be("form");N(o,"method","post"),n&&N(o,"action",n),r&&N(o,"class",r);for(let i of Object.keys(e)){if(i==="action"||i==="children"||i==="class"||i==="className")continue;let s=e[i];s!=null&&typeof s!="function"&&N(o,i,String(s))}typeof o.addEventListener=="function"&&o.addEventListener("submit",i=>{i.preventDefault();let s={};new FormData(o).forEach((u,c)=>{s[c]=u}),Promise.resolve(t(s)).catch(()=>{})});let a=e.children;return a!=null&&K(o,a),o}async function Cl(e,t){let r=tt(e,t);if(!r)return;let n=[];for(let o of r.matched){let a=o.component;a&&typeof a.preload=="function"&&n.push(a.preload())}await Promise.all(n)}var Ae,pa,ya,ha,or,Al,ce,Tl,Wn,Hn=F(()=>{"use strict";x();_n();q();x();En();Ys();Zs();Tn();Nn();Tn();Nn();Zt();_n();x();Ae=ee(void 0,"router"),pa=ee(void 0,"outlet"),ya=ee(void 0,"route-params"),ha=ee(void 0,"route-data");Al={router:{navigate:()=>{}},location:()=>({pathname:"",search:"",hash:"",query:{}}),params:()=>({}),isRouting:()=>!1,trackLoad:e=>e};ce=e=>typeof e=="function"?e():e,Tl=new Set(["href","slot","class","className","active","activeClass","replace","children"]);Wn=sr});var $l={};jn($l,{$component:()=>fn,A:()=>Wn,ClientOnly:()=>an,DEV:()=>Je,Dynamic:()=>gs,ErrorBoundary:()=>bs,FRAMEWORK_NAME:()=>Vs,For:()=>ps,Fragment:()=>hn,Index:()=>ys,Link:()=>sr,Match:()=>hs,NoSsr:()=>ws,Outlet:()=>Ln,Portal:()=>vs,Redirect:()=>In,Router:()=>Mn,Show:()=>ds,Store:()=>wt,Suspense:()=>Xe,Switch:()=>ms,VERSION:()=>qs,addClass:()=>Hi,batch:()=>D,classMap:()=>Ss,cleanupDelegation:()=>Ps,composeProviders:()=>$s,createBrowserHistory:()=>Le,createComponent:()=>Ce,createComputed:()=>lo,createContext:()=>Ge,createDebounce:()=>So,createDeferred:()=>bo,createEffect:()=>k,createIsomorphicState:()=>Ms,createMemo:()=>w,createMemoryHistory:()=>rr,createProvider:()=>pn,createRenderEffect:()=>$,createResource:()=>fe,createRoot:()=>W,createSelector:()=>wo,createSignal:()=>b,createStore:()=>Tr,delegateEvents:()=>we,devOnly:()=>dn,getFrameworkInfo:()=>Nf,getOwner:()=>P,getSharedConfig:()=>un,hydrate:()=>jt,initDelegation:()=>Cs,insert:()=>K,isDOMNode:()=>Vt,isDev:()=>ln,isLitTemplateResult:()=>Fi,isRenderable:()=>Rs,jsx:()=>mn,jsxs:()=>Ds,lazy:()=>Pe,mount:()=>wa,onCleanup:()=>S,onMount:()=>Ut,onUnmount:()=>zt,portal:()=>Ts,read:()=>Io,reduce:()=>Lo,removeClass:()=>Ki,render:()=>$e,requireContext:()=>Ns,runWithOwner:()=>M,setAttribute:()=>N,setOwner:()=>uo,setProperty:()=>ve,spread:()=>us,startClient:()=>ba,styleMap:()=>As,toggleClass:()=>ji,untrack:()=>A,untrackStore:()=>Rr,useCallback:()=>Gt,useContext:()=>Ze,useEffect:()=>Ye,useEventListener:()=>Xt,useLocation:()=>nt,useMatch:()=>qn,useMemo:()=>Bt,useNavigate:()=>ir,useParam:()=>Dn,useParams:()=>rt,useReducer:()=>Yt,useRef:()=>Jt,useRouter:()=>Ie,useSearchParams:()=>Vn});x();x();var wr="1.0.0-alpha.99",No=wr.split(".")[0],Eo=`__fluixi_signal_state_v${No}__`,ac=`__fluixi_signal_builds_v${No}__`,cc=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)};function Mo(){return{consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:cc,onSuspend:null,onError:null,observer:null}}var vr=globalThis;function uc(e){let t=Mo(),r=e;for(let n of Object.keys(t))n in e||(r[n]=t[n]);return e}function fc(){let e=vr[Eo];return e?uc(e):vr[Eo]=Mo()}var R=fc();(vr[ac]??=[]).push(wr);function lc(e){return R.observer=e,()=>{R.observer===e&&(R.observer=null)}}var br=[],dc,To;function pc(e){let t=R.observer;t&&t.created(e.parents===void 0?{...e,parents:br,origin:e.origin??dc,scope:e.scope??To}:{...e,scope:e.scope??To})}function yc(e){return R.observer?(br.push(e),!0):!1}function hc(){br.pop()}function mc(e){R.observer?.ran?.(e)}function gc(e){R.observer?.disposed?.(e)}var vc="__FLUIXI_DEVTOOLS_HOOK__",Ro=globalThis[vc];if(typeof Ro?.inject=="function")try{Ro.inject({observeReactiveNodes:lc,version:wr})}catch{}function wc(){return R.observer!=null}var Co=0,Po=1,ut=2,bc=class{constructor(){this.observers=null,this.watchers=null,this.version=0}updateIfNecessary(){}track(){if(R.untracked)return;let e=R.consumer;e&&((this.observers??=new Set).add(e),(e.sources??=new Set).add(this))}};var Sc=class extends bc{constructor(e,t){super(),this._threw=!1,this._initialized=!1,this.state=ut,this.sources=null,this._fn=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){if(R.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===Po&&this.sources){for(let e of this.sources)if(e.updateIfNecessary(),this.state===ut)break}(this.state===ut||!this._initialized)&&this.recompute(),this.state=Co}recompute(){if(this.sources){for(let s of this.sources)s.observers?.delete(this);this.sources.clear()}let e=R.consumer,t=R.untracked,r=yc(this);R.consumer=this,R.untracked=!1;let n,o=!1,a;try{n=this._fn()}catch(s){o=!0,a=s,n=this._value}finally{R.consumer=e,R.untracked=t,r&&hc()}let i=!this._initialized||this._threw!==o||(o?a!==this._error:!this._equals(this._value,n));if(this._initialized=!0,this._threw=o,this._error=a,this._value=n,mc(this),i){if(this.version++,this.observers)for(let s of[...this.observers])s.markDirty(ut);$o(this)}}markDirty(e){if(this.state>=e)return;let t=this.state===Co;if(this.state=e,t){if(this.observers)for(let r of[...this.observers])r.markDirty(Po);$o(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};function $o(e){if(e.watchers)for(let t of[...e.watchers])t._notify(e)}function Ac(e){return R.onSuspend?(R.onSuspend(e,R.owner),!0):!1}function xc(){return R.owner}function kc(e,t){let r=R.owner;R.owner=e;try{return t()}finally{R.owner=r}}function _c(e){if(R.owner){if(R.owner.disposed){e();return}(R.owner.cleanups??=[]).push(e)}}function Oc(e){R.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function Ec(e){return!!e&&typeof e.then=="function"}Oc(()=>{});var Tc=Symbol.for("signal"),Rc=Symbol.for("memo");function Cc(e,t,r){let n=t,o=xc(),a=new Sc(()=>kc(o,()=>{try{return n=e(n)}catch(s){if(Ec(s))return Ac(s),n;throw s}}),{equals:r?.equals}),i=(()=>a.get());return Object.defineProperty(i,Tc,{value:!0,enumerable:!0}),Object.defineProperty(i,Rc,{value:!0,enumerable:!0}),pc({kind:"memo",node:a,handle:i,name:r?.name}),wc()&&_c(()=>gc(a)),i}function Lo(e,t,r,n){return Cc(()=>e().reduce(t,r),void 0,n)}function Io(e){let t=e;for(;typeof t=="function";)t=t();return t}x();var Er="1.0.0-alpha.99",Xo=Er.split(".")[0],Do=`__fluixi_signal_state_v${Xo}__`,Pc=`__fluixi_signal_builds_v${Xo}__`,$c=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)};function Go(){return{consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:$c,onSuspend:null,onError:null,observer:null}}var Sr=globalThis;function Nc(e){let t=Go(),r=e;for(let n of Object.keys(t))n in e||(r[n]=t[n]);return e}function Mc(){let e=Sr[Do];return e?Nc(e):Sr[Do]=Go()}var de=Mc();(Sr[Pc]??=[]).push(Er);function Lc(e){return de.observer=e,()=>{de.observer===e&&(de.observer=null)}}var Ic=[],ft;function Dc(e,t){if(!de.observer)return t();let r=ft;ft=e;try{return t()}finally{ft=r}}var qo;function qc(e){let t=de.observer;t&&t.created(e.parents===void 0?{...e,parents:Ic,origin:e.origin??ft,scope:e.scope??qo}:{...e,scope:e.scope??qo})}function Vo(e,t,r){de.observer?.moved?.(e,t,r)}function Wo(e){de.observer?.disposed?.(e)}var Vc="__FLUIXI_DEVTOOLS_HOOK__",Ho=globalThis[Vc];if(typeof Ho?.inject=="function")try{Ho.inject({observeReactiveNodes:Lc,version:Er})}catch{}function Zo(){return de.observer!=null}var pt=Symbol("store-raw"),Ko=Symbol("store-node"),jo=Symbol("store-has"),Fo=Symbol("store-self"),Uo=Symbol("store-track");var He=new WeakMap,Ar=new WeakMap,Ee=new WeakMap,yt=new WeakMap;function Wc(e,t){if(!Oe(e)||!Zo())return;let r=new Set,n=i=>{if(!(!Oe(i)||r.has(i))){r.add(i);for(let s of Object.values(i))n(s)}};n(yt.get(t)??t);let o=new Set,a=i=>{if(!Oe(i))return;let s=i;if(r.has(s)||o.has(s))return;o.add(s);let u=He.get(s);if(u){for(let c of u.keys.values())Wo(c);u.all&&Wo(u.all),He.delete(s),Ee.delete(s),Ar.delete(s)}for(let c of Object.values(s))a(c)};a(e)}var ht=(e,t,r)=>r?`${e}[${String(t)}]`:`${e}.${String(t)}`;function Qo(e,t,r){let n=t?.owner,o=n&&r!==void 0?ht(n.name,r,t?.array):void 0,[a,i]=Dc(n?.store,()=>b(e,o?{name:o}:void 0)),s=a;return s.$=i,s}function mt(e){let t=He.get(e);return t?t.owner||(t.owner=Ee.get(e)):He.set(e,t={keys:new Map,owner:Ee.get(e),array:Array.isArray(e)}),t}function zo(e,t,r){let n=e.keys.get(t);return n||e.keys.set(t,n=Qo(r,e,t)),n}function Hc(e,t,r,n){let o=Ee.get(e);if(o&&o.store===t&&o.name===r)return;let a={store:t,name:r};Ee.set(e,a),yt.set(e,yt.get(n)??n);let i=He.get(e);if(i&&(i.owner=a,!!Zo())){for(let[s,u]of i.keys)Vo(u,t,ht(r,s,i.array));i.all&&Vo(i.all,t,ht(r,"*",i.array))}}function Bo(e){let t=mt(e);(t.all||(t.all=Qo(void 0,t,"*")))()}function Jo(e,t){e.$(typeof t=="function"?()=>t:t)}function Oe(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 lt(e){if(!Oe(e))return e;let t=Ar.get(e);if(t)return t;let r=new Proxy(e,Kc);return Ar.set(e,r),r}var Kc={get(e,t,r){if(t===pt||t===Ko)return e;if(t===_e)return r;if(t===jo)return u=>u in e;if(t==="__proxy")return!0;if(t===Uo||t===Fo)return Bo(e),r;let n=e[t];if(typeof n=="function"&&!Object.prototype.hasOwnProperty.call(e,t))return n;let o=Object.getOwnPropertyDescriptor(e,t);if(o&&o.get)return o.get.call(r);let a=mt(e),i=zo(a,t,n),s=i();return Oe(s)?(a.owner&&Hc(s,i,ht(a.owner.name,t,a.array),e),lt(s)):s},set(){return!0},deleteProperty(e,t){return t in e&&te(e,t,void 0),!0},has(e,t){return t===pt||t===_e||t===Ko||t===jo||t===Fo||t===Uo?!0:(zo(mt(e),t,e[t])(),t in e)},ownKeys(e){return Bo(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e,t)}};function ei(e,t=new Set){if(e==null||typeof e!="object")return e;let r=e[pt]??e;if(t.has(r)||!Oe(r))return r;t.add(r);let n=!1,o=i=>{let s=ei(i,t);return s!==i&&(n=!0),s};if(Array.isArray(r)){let i=r.map(o);return n?i:r}let a={};for(let i of Object.keys(r))a[i]=o(r[i]);return n?a:r}function te(e,t,r){let n=ei(r),o=e[t];if(o===n&&(n!==void 0||t in e))return;let a=Array.isArray(e),i=a?e.length:0;n===void 0?delete e[t]:e[t]=n;let s=mt(e),u=s.keys.get(t);if(u&&Jo(u,n),Wc(o,e),a&&e.length!==i){let c=s.keys.get("length");c&&Jo(c,e.length)}s.all&&s.all.$(void 0)}function xr(e,t){return typeof e=="function"?e(t):e}function kr(e,t){for(let r of Object.keys(t)){let n=t[r],o=e[r];n&&typeof n=="object"&&!Array.isArray(n)&&o&&typeof o=="object"&&!Array.isArray(o)?kr(o,n):te(e,r,n)}}function vt(e){let t=[],r=e.replace(/\[([^\]]*)\]/g,".$1");for(let n of r.split("."))n.length&&t.push(n);return t}function ti(e,t,r){let n=t.length-1;for(let a=0;a<n;a++){let i=t[a];if(i==="*"){let u=t.slice(a+1);if(Array.isArray(e))for(let c=0;c<e.length;c++)ti(e[c],u,r);return}let s=e[i];(s==null||typeof s!="object")&&(s=/^\d+$/.test(t[a+1])?[]:{},te(e,i,s)),e=s}let o=t[n];if(o==="*"){if(Array.isArray(e))for(let a=0;a<e.length;a++)te(e,a,xr(r,e[a]));return}te(e,o,xr(r,e[o]))}function Yo(e,t,r){ti(e,vt(t),r)}function jc(e){return Array.isArray(e)&&e.length>0&&e.every(t=>Array.isArray(t)&&t.length>=2&&typeof t[0]=="string")}function dt(e,t){for(let r=e.length-1;r>=t.length;r--)te(e,String(r),void 0);e.length!==t.length&&te(e,"length",t.length);for(let r=0;r<t.length;r++)te(e,String(r),t[r])}function Fc(e,t){let r=t[0];if(typeof r=="function"&&t.length===1){let n=r(e);n&&n!==e&&kr(e,n);return}if(Array.isArray(r)&&t.length===1){if(jc(r)){for(let n of r)Yo(e,n[0],n[1]);return}if(Array.isArray(e)){dt(e,r);return}if(r.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(r&&typeof r=="object"&&!Array.isArray(r)&&t.length===1){kr(e,r);return}if(t.length>=3){_r(e,t.slice(0,-1),t[t.length-1]);return}Yo(e,String(r),t[1])}function Uc(e,t){if(typeof t=="function"){if(!Array.isArray(e))return[];let r=[];for(let n=0;n<e.length;n++)t(e[n],n)&&r.push(n);return r}if(Array.isArray(t))return Array.isArray(e)?t.map(Number):t.map(String);if(t&&typeof t=="object"&&("from"in t||"to"in t||"by"in t)){if(!Array.isArray(e))return[];let r=t.by??1,n=t.from??0,o=t.to??e.length-1,a=[];for(let i=n;i<=o;i+=r)i>=0&&i<e.length&&a.push(i);return a}return t==="*"?Array.isArray(e)?e.map((r,n)=>n):Object.keys(e??{}):[t]}function _r(e,t,r){if(e==null)return;let[n,...o]=t;if(typeof n=="string"){let i=vt(n);if(i.length>1){_r(e,[...i,...o],r);return}}let a=Uc(e,n);if(o.length===0){for(let i of a)te(e,i,xr(r,e[i]));return}for(let i of a){let s=e[i];if(s==null||typeof s!="object"){let u=o[0];s=typeof u=="number"||/^\d+$/.test(String(u))?[]:{},te(e,i,s)}_r(s,o,r)}}function Or(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(Or);let t={};for(let r of Object.keys(e))t[r]=Or(e[r]);return t}function le(e,t){let r=e;for(let n of vt(t)){if(r==null)return;r=r[n]}return r}var wt=class{constructor(e,t={immutable:!0}){this.options=t,this.root=e,this.set=((...r)=>D(()=>Fc(this.root,r))),e&&typeof e=="object"&&(Ee.set(e,{store:this,name:t.name??"store"}),yt.set(e,e)),qc({kind:"store",node:this,handle:()=>this.root,name:t.name})}get state(){return lt(this.root)}get proxy(){return lt(this.root)}get accessor(){return(()=>lt(this.root))}unwrap(){return this.root}getNode(e){return this.root&&this.root[e]}get(e){if(e==null||e==="")return gt(this.state);let t=this.state;for(let r of vt(e)){if(t==null)return;t=t[r]}return gt(t)}select(e){return w(()=>e(this.state))}subscribe(e){return k(()=>e(this.state))}watch(e,t){let r;return k(()=>{let n=e(this.state);Object.is(n,r)||(t(n,r),r=n)})}reactive(e){return w(()=>this.state[e])}produce(e){this.set((t=>{let r=Or(t);return e(r),r}))}reconcile(e,t={}){this.set(e)}push(e,...t){let r=le(this.root,e);this.set(e,r.concat(t))}pop(e){let t=le(this.root,e).slice(),r=t.pop();return this.set(e,t),r}shift(e){let t=le(this.root,e).slice(),r=t.shift();return this.set(e,t),r}splice(e,t,r,...n){let o=le(this.root,e).slice(),a=o.splice(t,r,...n);return this.set(e,o),a}insert(e,t,r){let n=le(this.root,e).slice();n.splice(t,0,r),this.set(e,n)}removeAt(e,t){let r=le(this.root,e).slice(),n=r.splice(t,1);return this.set(e,r),n}replace(e,t){if(arguments.length>=2){let n=le(this.root,String(e)),o=t;if(Array.isArray(n)&&Array.isArray(o)){dt(n,o);return}this.set(e,o);return}let r=this.root;if(Array.isArray(r)&&Array.isArray(e)){dt(r,e);return}this.set(e)}clear(e){let t=e===void 0?this.root:le(this.root,e);if(Array.isArray(t)){dt(t,[]);return}if(t&&typeof t=="object")for(let r of Object.keys(t))te(t,r,void 0)}toObservable(){let[e]=b(this.state);return e.toObservable()}dispose(){}},zc=["get","select","watch","subscribe","produce","reconcile","push","pop","shift","splice","insert","removeAt","replace","clear","unwrap","toObservable"];function Bc(e,t){for(let r of zc)e[r]=t[r].bind(t);e.$=t.reactive.bind(t)}function Tr(e,t={immutable:!0}){let r=new wt(e,t);return Bc(r.set,r),[r.proxy,r.set]}function Jc(e,t={}){return new wt(e,{...t,immutable:!1})}function gt(e){if(e==null||typeof e!="object")return e;let t=e[pt];return t!==void 0?t:e}function Rr(e){return A(()=>gt(e))}var Fl=Object.freeze({createStore:Tr,createMutableStore:Jc,batch:D,unwrap:gt,untrackStore:Rr});q();x();q();var xs="1.0.0-alpha.99";q();Ui(xs);q();q();q();x();var kf={context:null,owner:null};function un(){return kf}var Je=typeof process<"u"&&!1,cn=Symbol.for("fluixi-lifecycle");function ks(){let e=P();if(!e)return null;if(!e[cn]){let t={mounts:[],effects:[],scheduled:!1};e[cn]=t}return e[cn]}function _s(e){if(e.scheduled)return;if(V()){e.mounts=[],e.effects=[];return}e.scheduled=!0;let t=P();queueMicrotask(()=>{if(so(t)){e.mounts=[],e.effects=[];return}M(t,()=>{for(let r of e.mounts)try{let n=r();typeof n=="function"&&S(n)}catch(n){console.error("Error in onMount callback:",n)}for(let r of e.effects){let n;k(()=>{n&&n(),n=r()}),S(()=>{n&&n()})}e.mounts=[],e.effects=[]})})}function Ce(e,t){return J(e,t)}function fn(e,t){let r=typeof e=="function"?A(()=>e(t)):e,n=r!=null&&(typeof r=="function"||typeof r=="object");if(n)try{r.$name=e.name}catch{}return n&&!I(r)?Be(r):r}function Ut(e,t=!0){if(V())return;let r=ks();if(r){if(!t){r.scheduled||e();return}r.mounts.push(e),_s(r)}else{if(!t){e();return}k(()=>{let n=A(e);typeof n=="function"&&S(n)})}}function zt(e){S(e)}function Ye(e){let t=ks();if(t)t.effects.push(e),_s(t);else{let r;k(()=>{r&&r(),r=e()}),S(()=>{r&&r()})}}function Bt(e){return w(e)}function Jt(e){let t={current:e};return S(()=>{t.current=null}),t}function Yt(e,t){let[r,n]=b(t);return[r,a=>{n(e(r(),a))}]}function Xt(e,t,r,n){Ye(()=>{let o=e&&"current"in e?e.current:e;if(o)return o.addEventListener(t,r,n),()=>{o.removeEventListener(t,r,n)}})}function Gt(e){return e}function ln(){return Je}function dn(e){Je&&e()}x();q();function Os(e){return!!(e&&typeof e=="object"&&typeof e.then=="function"||e instanceof Promise)}var _f=ee(void 0,"suspense-list");function Xe(e){return J(Of,e)}function Of(e){let t=xo(),r=H(_f),n=r?r.register(t.inFallback):void 0;function o(l){return l==null||typeof l=="boolean"?null:typeof l=="function"&&se(l)&&!I(l)?l():l}let a=Xi(()=>o(e.fallback??null)),i=gr(t,()=>We(()=>e.children)),s=(l,d)=>{if(!(d>8))if(Array.isArray(l))for(let h of l)s(h,d+1);else typeof l=="function"&&I(l)&&s(l(),d+1)};gr(t,()=>{$(()=>s(i,0))});let[u,c]=b(void 0),f=Os(i);return f&&(t.increment(),i.then(l=>{c(()=>l),t.decrement()},()=>t.decrement())),w(()=>(n?n.showFallback():t.inFallback())?a:f?u():i)}Bi(Xe);Object.defineProperty(Xe,"__suspense",{value:!0,enumerable:!0});Zt();Zt();function $e(e,t,r={}){if(we(["click","input","change","submit"]),V())throw new Error("render() is for client-side only. Use renderToString() on server.");if(!t)throw new Error("Container element is required");let n;return W(o=>{n=o;let a=typeof e=="function"?e():e;t.textContent="",Wt(t),Ht(),K(t,()=>a)}),()=>{n&&(n(),n=void 0)}}function Ef(e){return e&&typeof e=="object"&&(e._$litType$!==void 0||e._$litDirective$!==void 0)}function Ts(e,t,r={}){let n=document.createElement("div");n.setAttribute("data-portal","true"),t.appendChild(n);let o=$e(e,n,r);return()=>{o(),t.contains(n)&&t.removeChild(n)}}function Rs(e){return!!(e==null||typeof e=="function"||Vt(e)||Ef(e)||Array.isArray(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean")}function Cs(){V()||we(["click","input","change","submit"])}function Ps(){V()}yn();x();q();var Tf="__fluixi_iso_states__",Rf="__iso:";function Cf(){return globalThis[Tf]??=new Map}function Pf(e){if(typeof window>"u")return;let t=on();return t?t[Rf+e]:void 0}function Ms(e,t){let r=Pf(e),n=r!==void 0?r:typeof window<"u"&&t.client?t.client():t.fallback,[o,a]=b(n,{name:e});return Cf().set(e,{server:t.server,set:a}),{value:o,set:a,key:e}}q();q();q();q();q();x();var hn=Symbol.for("fluixi.fragment"),Ls=typeof window>"u";function Is(e){return e==null||e===!1?null:Array.isArray(e)?e.map(Is).flat():e}function mn(e,t,r){if(e==null)return null;let n=t||{};if(r!==void 0&&(n.key=r),e===hn)return w(()=>Be(Is(n.children)));if(typeof e=="function"){let{type:o}=Ji(e);return e.$$typeof===Symbol.for("react.provider")||o==="provider"?e(n):Ls?{type:e,props:n}:w(()=>J(e,n),void 0,{name:"jsx component"})}return typeof e=="string"&&e.trim().length>0?$f(e,n):null}var Ds=mn;function $f(e,t){return Ls?{type:e,props:t||{}}:sn(e,t)}var qs="0.0.1",Vs="Fluixi";function Nf(){return{name:Vs,version:qs,features:{ssr:!0,hydration:!0,jsx:!0,litHtml:!0,signals:!0,fineGrained:!0,lazy:!0,hooks:!0,devMode:!0}}}q();var Mf=!1,Ws=new Map;function gn(e){Mf=e}function Lf(){Ws.clear()}function Hs(){if(typeof window>"u")return!1;let e=document.getElementById("__FLUIXI_HYDRATION__");if(!e||e.getAttribute("type")!=="application/json")return!1;try{let t=e.textContent||"{}",r=JSON.parse(t);for(let[n,o]of Object.entries(r))Ws.set(n,o);return!0}catch(t){return console.error("Failed to deserialize hydration data:",t),!1}}function vn(){if(typeof window>"u")return;let e=document.getElementById("__FLUIXI_HYDRATION__");e&&e.remove();let t=document.createTreeWalker(document.body,NodeFilter.SHOW_COMMENT,null),r=[],n;for(;n=t.nextNode();){let o=n,a=o.nodeValue||"";(a.startsWith("#")||a.startsWith("/"))&&r.push(o)}r.forEach(o=>o.remove()),Lf()}typeof window<"u"&&window.addEventListener("load",()=>{setTimeout(vn,100)});x();x();x();var If=Object.defineProperty,Df=(e,t)=>{for(var r in t)If(e,r,{get:t[r],enumerable:!0})};function ae(e){return typeof e=="function"?e():e}function qf(e){if(typeof e=="string")return e;let t=[];return t.push(e.index===!1?"noindex":"index"),t.push(e.follow===!1?"nofollow":"follow"),e.noarchive&&t.push("noarchive"),e.nosnippet&&t.push("nosnippet"),e.noimageindex&&t.push("noimageindex"),e.maxSnippet!=null&&t.push(`max-snippet:${e.maxSnippet}`),e.maxImagePreview&&t.push(`max-image-preview:${e.maxImagePreview}`),e.maxVideoPreview!=null&&t.push(`max-video-preview:${e.maxVideoPreview}`),t.join(", ")}function Ks(){let e=[],[t,r]=b(0);return{sources:e,version:t,push(n){return e.push(n),r(o=>o+1),()=>{let o=e.indexOf(n);o!==-1&&(e.splice(o,1),r(a=>a+1))}}}}var wn=globalThis[Symbol.for("fluixi.head")]??={active:null,scope:null};function js(e){wn.active=e}function Vf(){return wn.scope?.()??wn.active}function Ne(e){let t=Vf();if(!t)return globalThis.process?.env?.NODE_ENV!=="production"&&console.warn("[fluixi/head] useHead() called with no active head registry — ignored."),()=>{};let r=t.push(e);return typeof window<"u"&&P()&&S(r),r}function Qt(e){let t=5381;for(let r=0;r<e.length;r++)t=t*33^e.charCodeAt(r);return(t>>>0).toString(36)}function Wf(e){return e.charset!=null?"meta:charset":e.property?"meta:property:"+e.property:e.name?"meta:name:"+e.name:e["http-equiv"]?"meta:http-equiv:"+e["http-equiv"]:"meta:"+Qt(JSON.stringify(e))}function Hf(e,t){let r=typeof t=="string"?{url:t}:t;e.push({tag:"meta",key:"meta:property:og:image:"+r.url,attrs:{property:"og:image",content:r.url}}),r.secureUrl&&e.push({tag:"meta",key:"meta:property:og:image:secure:"+r.url,attrs:{property:"og:image:secure_url",content:r.secureUrl}}),r.type&&e.push({tag:"meta",key:"meta:property:og:image:type:"+r.url,attrs:{property:"og:image:type",content:r.type}}),r.width!=null&&e.push({tag:"meta",key:"meta:property:og:image:width:"+r.url,attrs:{property:"og:image:width",content:String(r.width)}}),r.height!=null&&e.push({tag:"meta",key:"meta:property:og:image:height:"+r.url,attrs:{property:"og:image:height",content:String(r.height)}}),r.alt&&e.push({tag:"meta",key:"meta:property:og:image:alt:"+r.url,attrs:{property:"og:image:alt",content:r.alt}})}function Kf(e,t){let r=(n,o)=>{o!=null&&t.push({tag:"meta",key:"meta:property:og:"+n,attrs:{property:"og:"+n,content:o}})};r("title",e.title),r("description",e.description),r("type",e.type),r("url",e.url),r("site_name",e.siteName),r("locale",e.locale);for(let n of e.localeAlternate??[])t.push({tag:"meta",key:"meta:property:og:locale:alt:"+n,attrs:{property:"og:locale:alternate",content:n}});if(e.image!=null){let n=Array.isArray(e.image)?e.image:[e.image];for(let o of n)Hf(t,o)}if(e.video){let n=typeof e.video=="string"?{url:e.video}:e.video;r("video",n.url),"type"in n&&n.type&&r("video:type",n.type),"width"in n&&n.width!=null&&r("video:width",String(n.width)),"height"in n&&n.height!=null&&r("video:height",String(n.height))}if(e.audio){let n=typeof e.audio=="string"?{url:e.audio}:e.audio;r("audio",n.url),"type"in n&&n.type&&r("audio:type",n.type)}if(e.article){let n=e.article;r("article:published_time",n.publishedTime),r("article:modified_time",n.modifiedTime),r("article:expiration_time",n.expirationTime),r("article:section",n.section);for(let o of[].concat(n.author??[]))t.push({tag:"meta",key:"meta:property:og:article:author:"+o,attrs:{property:"article:author",content:o}});for(let o of[].concat(n.tag??[]))t.push({tag:"meta",key:"meta:property:og:article:tag:"+o,attrs:{property:"article:tag",content:o}})}if(e.book){let n=e.book;r("book:isbn",n.isbn),r("book:release_date",n.releaseDate);for(let o of[].concat(n.author??[]))t.push({tag:"meta",key:"meta:property:og:book:author:"+o,attrs:{property:"book:author",content:o}});for(let o of[].concat(n.tag??[]))t.push({tag:"meta",key:"meta:property:og:book:tag:"+o,attrs:{property:"book:tag",content:o}})}if(e.profile){let n=e.profile;r("profile:first_name",n.firstName),r("profile:last_name",n.lastName),r("profile:username",n.username),r("profile:gender",n.gender)}}function jf(e,t){let r=(n,o)=>{o!=null&&t.push({tag:"meta",key:"meta:name:twitter:"+n,attrs:{name:"twitter:"+n,content:o}})};r("card",e.card),r("site",e.site),r("creator",e.creator),r("title",e.title),r("description",e.description),r("image",e.image),r("image:alt",e.imageAlt),r("player",e.player),e.playerWidth!=null&&r("player:width",String(e.playerWidth)),e.playerHeight!=null&&r("player:height",String(e.playerHeight)),e.app&&(r("app:name:iphone",e.app.name),r("app:id:iphone",e.app.idIphone),r("app:id:ipad",e.app.idIpad),r("app:id:googleplay",e.app.idGooglePlay))}function Ff(e,t){let r=(n,o)=>t.push({tag:"link",key:n,attrs:o});if(e.icon!=null){let n=typeof e.icon=="string"?[{url:e.icon}]:e.icon;for(let o of n)r("link:icon:"+o.url,{rel:"icon",href:o.url,...o.type?{type:o.type}:{},...o.sizes?{sizes:o.sizes}:{}})}if(e.apple!=null){let n=typeof e.apple=="string"?[{url:e.apple}]:e.apple;for(let o of n)r("link:apple-touch-icon:"+o.url,{rel:"apple-touch-icon",href:o.url,...o.sizes?{sizes:o.sizes}:{}})}e.mask&&r("link:mask-icon",{rel:"mask-icon",href:e.mask.url,...e.mask.color?{color:e.mask.color}:{}}),e.shortcut&&r("link:shortcut",{rel:"shortcut icon",href:e.shortcut}),e.msTileImage&&t.push({tag:"meta",key:"meta:name:msapplication-TileImage",attrs:{name:"msapplication-TileImage",content:e.msTileImage}}),e.msTileColor&&t.push({tag:"meta",key:"meta:name:msapplication-TileColor",attrs:{name:"msapplication-TileColor",content:e.msTileColor}})}function Uf(e,t,r){let n=(d,h)=>t.push({tag:"meta",key:d,attrs:h}),o=ae(e.title);o!==void 0&&(r.title=o),e.titleTemplate!==void 0&&(r.template=e.titleTemplate);let a=ae(e.lang);a!==void 0&&t.push({tag:"htmlAttr",key:"html:lang",name:"lang",value:a});for(let[d,h]of Object.entries(e.htmlAttrs??{})){let y=ae(h);y!==void 0&&t.push({tag:"htmlAttr",key:`html:${d}`,name:d,value:y})}e.charset!==void 0&&n("meta:charset",{charset:e.charset}),e.viewport!==void 0&&n("meta:name:viewport",{name:"viewport",content:e.viewport});let i=ae(e.description);i!==void 0&&n("meta:name:description",{name:"description",content:i});let s=ae(e.keywords);s!==void 0&&n("meta:name:keywords",{name:"keywords",content:Array.isArray(s)?s.join(", "):s}),e.author!==void 0&&n("meta:name:author",{name:"author",content:e.author}),e.robots!==void 0&&n("meta:name:robots",{name:"robots",content:qf(e.robots)}),e.generator!==void 0&&n("meta:name:generator",{name:"generator",content:e.generator}),e.applicationName!==void 0&&n("meta:name:application-name",{name:"application-name",content:e.applicationName}),e.referrer!==void 0&&n("meta:name:referrer",{name:"referrer",content:e.referrer});let u=ae(e.colorScheme);u!==void 0&&n("meta:name:color-scheme",{name:"color-scheme",content:u});let c=ae(e.themeColor);if(typeof c=="string")n("meta:name:theme-color",{name:"theme-color",content:c});else if(c)for(let{color:d,media:h}of c)n(`meta:name:theme-color${h?`:${h}`:""}`,h?{name:"theme-color",content:d,media:h}:{name:"theme-color",content:d});let f=ae(e.canonical);if(f!==void 0&&t.push({tag:"link",key:"link:rel:canonical",attrs:{rel:"canonical",href:f}}),e.manifest!==void 0&&t.push({tag:"link",key:"link:rel:manifest",attrs:{rel:"manifest",href:e.manifest}}),e.base!==void 0&&t.push({tag:"base",key:"base",attrs:{href:e.base}}),e.verification){let d={google:"google-site-verification",bing:"msvalidate.01",yandex:"yandex-verification",pinterest:"p:domain_verify"};for(let[h,y]of Object.entries(e.verification)){if(y==null)continue;let p=d[h]??h;n("meta:name:"+p,{name:p,content:y})}}for(let d of e.alternates??[])t.push({tag:"link",key:"link:alternate:hreflang:"+d.hreflang,attrs:{rel:"alternate",hreflang:d.hreflang,href:d.href}});for(let d of e.feeds??[])t.push({tag:"link",key:"link:alternate:feed:"+d.href,attrs:{rel:"alternate",type:d.type??"application/rss+xml",href:d.href,...d.title?{title:d.title}:{}}});e.og&&Kf(e.og,t),e.twitter&&jf(e.twitter,t),e.icons&&Ff(e.icons,t);let l=ae(e.jsonLd);if(l!==void 0){let d=Array.isArray(l)?l:[l];for(let h of d){let y=JSON.stringify(h);t.push({tag:"script",key:"script:ldjson:"+Qt(y),attrs:{type:"application/ld+json"},children:y})}}for(let d of e.meta??[]){let h={};for(let[y,p]of Object.entries(d))p!=null&&(h[y==="httpEquiv"?"http-equiv":y]=p);t.push({tag:"meta",key:Wf(h),attrs:h})}for(let d of e.link??[]){let h={};for(let[y,p]of Object.entries(d))p!=null&&(h[y]=p);t.push({tag:"link",key:"link:"+(h.rel??"")+":"+(h.href??Qt(JSON.stringify(h))),attrs:h})}for(let d of e.script??[]){let h={},y;for(let[p,v]of Object.entries(d))v!=null&&(p==="children"?y=v:h[p]=v);t.push({tag:"script",key:"script:"+(h.src??Qt((y??"")+JSON.stringify(h))),attrs:h,children:y})}}function zf(e,t){return typeof e=="function"?e(t):e.includes("%s")?e.replace("%s",t):e}function Bf(e){let t=[],r={};for(let a of e.sources){let i=typeof a=="function"?a():a;Uf(i,t,r)}r.title!==void 0&&t.push({tag:"title",key:"title",children:r.template?zf(r.template,r.title):r.title});let n=new Map,o={};for(let a of t){if(a.tag==="htmlAttr"){o[a.name]=a.value;continue}n.set(a.key,a)}return{tags:[...n.values()],htmlAttrs:o}}var bn="data-fh",Sn="data-fh-key";function Fs(e){for(let t=e.firstChild;t;t=t.nextSibling)if(t.nodeType===8&&t.data.startsWith("fh:")){t.parentNode?.removeChild(t);return}}function Us(e,t){for(let r of Array.from(e.attributes))r.name===bn||r.name===Sn||r.name in t||e.removeAttribute(r.name);for(let[r,n]of Object.entries(t))e.getAttribute(r)!==n&&e.setAttribute(r,n)}function Jf(e){let t=document.createElement(e.tag);return Us(t,e.attrs),t.setAttribute(bn,""),t.setAttribute(Sn,e.key),e.tag==="script"&&e.children!=null&&(t.textContent=e.children),t}function Yf(e,t){let r=document.head,n=new Map;for(let i of Array.from(r.querySelectorAll(`[${bn}]`))){let s=i.getAttribute(Sn);i.tagName!=="TITLE"&&s&&n.set(s,i)}let o=null,a=new Set;for(let i of e){if(i.tag==="title"){o=i.children;continue}if(i.tag==="htmlAttr")continue;a.add(i.key);let s=n.get(i.key);s&&s.tagName===i.tag.toUpperCase()?(Us(s,i.attrs),i.tag==="script"&&(s.textContent??"")!==(i.children??"")&&(s.textContent=i.children??"")):(s&&s.remove(),r.appendChild(Jf(i)))}for(let[i,s]of n)a.has(i)||s.remove();o!=null&&document.title!==o&&(document.title=o);for(let[i,s]of Object.entries(t))document.documentElement.getAttribute(i)!==s&&document.documentElement.setAttribute(i,s)}function zs(e){return W(t=>(k(()=>{e.version();let{tags:r,htmlAttrs:n}=Bf(e);Yf(r,n)}),S(()=>{}),t))}var Xf={};Df(Xf,{Base:()=>tl,JsonLD:()=>rl,Link:()=>Qf,Meta:()=>Zf,Script:()=>el,Title:()=>Gf});function Qe(e){return typeof e=="function"?e():e}function Gf(e){return Ne(()=>({title:Qe(e.children)})),null}function Zf(e){return Ne(()=>({meta:[{...e,content:Qe(e.content)}]})),null}function Qf(e){return Ne(()=>{let t={};for(let[r,n]of Object.entries(e))t[r]=Qe(n);return{link:[t]}}),null}function el(e){return Ne(()=>{let t={};for(let[r,n]of Object.entries(e))t[r]=Qe(n);return{script:[t]}}),null}function tl(e){return Ne({base:e.href}),null}function rl(e){return Ne(()=>({jsonLd:Qe(e.data)})),null}function wa(e,t){if(!t)throw new Error("Container element not found for mount()");nn(()=>e(),t)}var va=e=>w(()=>Ce(e));async function ba(e,t={}){let r=typeof t.root=="string"?document.querySelector(t.root):t.root??document.querySelector("#app");if(!r)throw new Error(`[Fluixi] Mount container not found: ${t.root??"#app"}`);let n=!!document.getElementById("__FLUIXI_HYDRATION__")||!!t.routes&&r.firstElementChild!=null,o=t.hydrate??n,a=Ks();if(js(a),Fs(r),o){Qi();try{if(t.routes&&t.routes.length){let{preloadRoutes:i}=await Promise.resolve().then(()=>(Hn(),ga));await i(t.routes,window.location.pathname)}Hs(),gn(!0),jt(()=>va(e),r),Pl()}finally{es()}setTimeout(()=>{gn(!1),os(r)&&typeof process<"u",en(),vn()},100)}else $e(va(e),r);zs(a)}function Pl(){if(typeof window>"u")return;let e=window;typeof e.__FX_REPLAY_STOP__=="function"&&e.__FX_REPLAY_STOP__();let t=e.__FX_REPLAY__;if(e.__FX_REPLAY__=void 0,e.__FX_REPLAY_STOP__=void 0,!(!Array.isArray(t)||t.length===0))for(let r of t){let n=r&&r.target;if(!n||n.isConnected===!1||typeof n.dispatchEvent!="function")continue;let o=r.type,a=o==="click"?new MouseEvent(o,{bubbles:!0,cancelable:!0}):new Event(o,{bubbles:!0,cancelable:!0});n.dispatchEvent(a)}}Hn();return Oa($l);})();
|