@fluixi/dom 1.0.0-alpha.80 → 1.0.0-alpha.81

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.
@@ -1 +1 @@
1
- "use strict";var FluixiDOM=(()=>{var yt=Object.defineProperty;var fo=Object.getOwnPropertyDescriptor;var po=Object.getOwnPropertyNames;var ho=Object.prototype.hasOwnProperty;var yo=(e,t)=>{for(var n in t)yt(e,n,{get:t[n],enumerable:!0})},mo=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of po(t))!ho.call(e,o)&&o!==n&&yt(e,o,{get:()=>t[o],enumerable:!(r=fo(t,o))||r.enumerable});return e};var go=e=>mo(yt({},"__esModule",{value:!0}),e);var Xi={};yo(Xi,{ClientOnly:()=>Xt,Dynamic:()=>Mr,ErrorBoundary:()=>jr,FX_DATA_ID:()=>le,For:()=>_r,Index:()=>Or,Island:()=>vr,JSX_PROPERTIES:()=>qe,Match:()=>kr,NoSsr:()=>qr,Portal:()=>Dr,SVG_ELEMENTS:()=>To,SVG_NAMESPACE:()=>ee,Show:()=>Cr,Switch:()=>Pr,VOID_ELEMENTS:()=>So,addClass:()=>No,addDelegatedEventListener:()=>Xn,addNativeEventListener:()=>kt,appendChildren:()=>qo,applyElementProp:()=>De,applyProps:()=>Dt,applyUse:()=>Pt,asComponent:()=>Et,asContext:()=>Rs,asOutlet:()=>As,asProvider:()=>Ns,asRoute:()=>Es,asRouter:()=>Ss,asRoutes:()=>Ts,asSuspense:()=>Cs,batch:()=>x,bindPair:()=>ei,captureHydrationCursor:()=>Bn,checkRenderType:()=>_s,classMap:()=>$r,cleanChildren:()=>U,cloneTemplate:()=>Yn,closest:()=>Ao,createComponent:()=>Ht,createComputed:()=>Tn,createContext:()=>Le,createDynamicElement:()=>ki,createEffect:()=>T,createElement:()=>Mo,createMemo:()=>m,createNativeElement:()=>Ot,createPortal:()=>Js,createRenderEffect:()=>b,createRequestContext:()=>ue,createResource:()=>Cn,createRoot:()=>k,createSignal:()=>g,createStore:()=>ht,createTemplate:()=>Jn,delegate:()=>Io,delegateEvents:()=>_t,effect:()=>kn,escapeFxJson:()=>Re,escapeHTML:()=>Zs,fnName:()=>Hs,generateID:()=>Ms,getAttribute:()=>Oo,getGlobal:()=>Xo,getLitEventName:()=>xo,getLocals:()=>zt,getOffset:()=>Lo,getRequestContext:()=>L,getRequestEvent:()=>nt,getRequestLocals:()=>rt,getServerData:()=>Ce,getStableElementId:()=>Ps,getStyle:()=>Po,handleRef:()=>Ae,hasClass:()=>_o,holeContent:()=>Vs,holeEnd:()=>Fs,holeScope:()=>Is,html:()=>Tr,hydrate:()=>ut,hydrateAdvancePast:()=>se,hydrateIslands:()=>Sr,indexArray:()=>He,initializeIntegration:()=>xi,insert:()=>$,insertExpression:()=>xe,intergartionInitialized:()=>vi,isAccessor:()=>Qs,isComponent:()=>M,isContext:()=>Vn,isCustomElement:()=>pn,isDOMNode:()=>Ko,isDelegatedEvent:()=>js,isDomElement:()=>ze,isDomNode:()=>X,isDomText:()=>Be,isEventHandler:()=>wo,isFunction:()=>$s,isIntegrationInitialized:()=>Si,isJSXTemplate:()=>Bo,isLitTemplateResult:()=>yn,isNativeElement:()=>Ys,isOutlet:()=>In,isPromise:()=>we,isProvider:()=>Fn,isReactElement:()=>Wo,isRoute:()=>Ln,isRouter:()=>jn,isRoutes:()=>$n,isSVGElement:()=>qt,isServer:()=>v,isSuspense:()=>Hn,isTemplateFactory:()=>zo,isVisible:()=>jo,iterateFn:()=>Us,keyArray:()=>Ve,makeArrayFlat:()=>Zn,mapArray:()=>Fe,memo:()=>On,mergeProps:()=>Gs,observeIntersection:()=>Vo,observeResize:()=>Ho,onCleanup:()=>S,query:()=>mt,queryAll:()=>Eo,registerCreateComponent:()=>wi,registerGlobal:()=>Go,removeAttribute:()=>ko,removeChildren:()=>Do,removeClass:()=>Ro,removeDelegatedEventListener:()=>Ct,render:()=>jt,renderToString:()=>nn,renderToStringAsync:()=>on,resetIntegration:()=>Ti,runHydrationAt:()=>be,runWithRequestContext:()=>ae,runWithoutHydration:()=>Kn,scrollIntoView:()=>$o,serializeNode:()=>D,serializeResourceData:()=>ct,setAttribute:()=>_,setClassList:()=>Te,setClassName:()=>Se,setDataRedactor:()=>rn,setDynamicAttribute:()=>Xe,setDynamicBoolAttribute:()=>Mt,setDynamicProperty:()=>Je,setProperty:()=>ve,setRequestStore:()=>Wt,setServerMode:()=>G,setStyle:()=>Ee,setStyles:()=>hn,shouldSetAsProperty:()=>vo,signal:()=>_n,splitProps:()=>Xs,spread:()=>Ks,store:()=>lo,styleMap:()=>Lr,svg:()=>Er,templateNode:()=>Ls,toAttributeName:()=>bo,toggleClass:()=>Co,untrack:()=>A,useContext:()=>xn,waitForElement:()=>Fo});function bo(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function wo(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function xo(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function vo(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),r={input:new Set(["value","checked","indeterminate"]),textarea:new Set(["value"]),select:new Set(["value"]),option:new Set(["selected","value"]),audio:new Set(["volume","currentTime","paused"]),video:new Set(["volume","currentTime","paused"]),img:new Set(["src","srcset"]),iframe:new Set(["src"]),a:new Set(["href"])};return n.has(t)||r[e]&&r[e].has(t)}var So=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),To=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),ee="http://www.w3.org/2000/svg";function pn(e){return e.localName.includes("-")}function De(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(pn(e)){e[t]=n;return}_(e,t,n,r)}var qe=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function mt(e,t=document){return t.querySelector(e)}function Eo(e,t=document){return Array.from(t.querySelectorAll(e))}function Ao(e,t){return e.closest(t)}function No(e,...t){e.classList.add(...t)}function Ro(e,...t){e.classList.remove(...t)}function Co(e,...t){t.forEach(n=>e.classList.toggle(n))}function _o(e,t){return e.classList.contains(t)}function _(e,t,n,r=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function Oo(e,t){return e.getAttribute(t)}function ko(e,t){e.removeAttribute(t)}function hn(e,t){Object.assign(e.style,t)}function Po(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function Mo(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,s])=>{if(o==="class"||o==="className")r.className=s;else if(o==="style"&&typeof s=="object")hn(r,s);else if(o.startsWith("on")&&typeof s=="function"){let i=o.slice(2).toLowerCase();r.addEventListener(i,s)}else _(r,o,s)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function Do(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function qo(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function jo(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function $o(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Lo(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function Io(e,t,n,r){let o=s=>{let i=s.target.closest(n);i&&e.contains(i)&&r(s,i)};return e.addEventListener(t,o),()=>{e.removeEventListener(t,o)}}function Fo(e,t=5e3){return new Promise((n,r)=>{let o=mt(e);if(o){n(o);return}let s=new MutationObserver(()=>{let a=mt(e);a&&(s.disconnect(),clearTimeout(i),n(a))});s.observe(document.body,{childList:!0,subtree:!0});let i=setTimeout(()=>{s.disconnect(),r(new Error(`Element ${e} not found within ${t}ms`))},t)})}function Vo(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(s=>{t(s.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function Ho(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Uo=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function Wo(e){return typeof e=="object"&&e!==null&&e.$$typeof===Uo}function yn(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function zo(e){if(typeof e!="function")return!1;try{let t=e();return yn(t)}catch{return!1}}function Bo(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Ko(e){return e instanceof Node}function Go(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function Xo(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}var Jo="__fluixi_signal_next_state__",Yo=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)},p=globalThis[Jo]??={consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:Yo,onSuspend:null,onError:null},mn=0,gn=1,ye=2,bn=class{constructor(){this.observers=null,this.watchers=null,this.version=0}updateIfNecessary(){}track(){if(p.untracked)return;let e=p.consumer;e&&((this.observers??=new Set).add(e),(e.sources??=new Set).add(this))}},Zo=class extends bn{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++,this.observers)for(let t of[...this.observers])t.markDirty(ye);bt(this)}}peek(){return this._value}},wn=class extends bn{constructor(e,t){super(),this._threw=!1,this._initialized=!1,this.state=ye,this.sources=null,this._fn=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){if(p.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===gn&&this.sources){for(let e of this.sources)if(e.updateIfNecessary(),this.state===ye)break}(this.state===ye||!this._initialized)&&this.recompute(),this.state=mn}recompute(){if(this.sources){for(let i of this.sources)i.observers?.delete(this);this.sources.clear()}let e=p.consumer,t=p.untracked;p.consumer=this,p.untracked=!1;let n,r=!1,o;try{n=this._fn()}catch(i){r=!0,o=i,n=this._value}finally{p.consumer=e,p.untracked=t}let s=!this._initialized||this._threw!==r||(r?o!==this._error:!this._equals(this._value,n));if(this._initialized=!0,this._threw=r,this._error=o,this._value=n,s){if(this.version++,this.observers)for(let i of[...this.observers])i.markDirty(ye);bt(this)}}markDirty(e){if(this.state>=e)return;let t=this.state===mn;if(this.state=e,t){if(this.observers)for(let n of[...this.observers])n.markDirty(gn);bt(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};function bt(e){if(e.watchers)for(let t of[...e.watchers])t._notify(e)}var Qo=class{constructor(e){this._watched=new Set,this._pending=new Set,this._notifyFn=e}watch(...e){for(let t of e)this._watched.add(t),(t.watchers??=new Set).add(this)}unwatch(...e){for(let t of e)this._watched.delete(t),t.watchers?.delete(this),this._pending.delete(t)}getPending(){let e=[...this._pending];return this._pending.clear(),e}_notify(e){if(!this._watched.has(e)||this._pending.has(e))return;let t=this._pending.size===0;this._pending.add(e),t&&this._notifyFn()}};function es(e){if(p.untracked)return e();p.untracked=!0;try{return e()}finally{p.untracked=!1}}function te(e){let t=$e(e);return e&&(e.owned??=[]).push(t),t}function ne(e,t=!0){me(e,t)}function $e(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function Le(e){let t=Symbol("context");return{id:t,defaultValue:e,Provider:n=>{let r=p.owner,o=$e(r);(o.contexts=new Map).set(t,n.value),r&&(r.owned??=[]).push(o),p.owner=o;try{return n.children}finally{p.owner=r}}}}function xn(e){let t=p.owner;for(;t;){if(t.contexts&&t.contexts.has(e.id))return t.contexts.get(e.id);t=t.parent}return e.defaultValue}function vn(e,t){let n=e;for(;n;){if(n.contexts&&n.contexts.has(t.id))return n.contexts.get(t.id);n=n.parent}return t.defaultValue}function ts(e){p.onSuspend=e}function ns(e){return p.onSuspend?(p.onSuspend(e,p.owner),!0):!1}function rs(e){p.onError=e}function I(){return p.owner}function O(e,t){let n=p.owner;p.owner=e;try{return t()}finally{p.owner=n}}function S(e){if(p.owner){if(p.owner.disposed){e();return}(p.owner.cleanups??=[]).push(e)}}function me(e,t=!0){if(!e.disposed){if(e.owned){for(let n=e.owned.length-1;n>=0;n--)me(e.owned[n]);e.owned=null}if(e.cleanups){for(let n=e.cleanups.length-1;n>=0;n--)e.cleanups[n]();e.cleanups=null}t&&(e.disposed=!0)}}function k(e){let t=$e(p.owner);p.owner&&(p.owner.owned??=[]).push(t);let n=p.owner;p.owner=t;try{return e(()=>me(t))}finally{p.owner=n}}function os(e){p.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function ss(e){e.queued||(e.queued=!0,p.queue.push(e),!p.scheduled&&p.batchDepth===0&&(p.scheduled=!0,p.hostSchedule(Ie)))}function Ie(){if(p.scheduled=!1,p.flushing)return;p.flushing=!0;let e=0;try{for(;p.queue.length;){if(++e>1e5)throw new Error("[fluixi] effect flush did not settle (cycle?)");let t=p.queue;p.queue=[];for(let n of t)n.queued=!1,n.disposed||n.run()}}finally{p.flushing=!1}}function is(){p.batchDepth===0&&Ie()}function us(e){p.batchDepth++;try{return e()}finally{--p.batchDepth===0&&Ie()}}var as=class{constructor(e){this.queued=!1,this.disposed=!1,this.owner=$e(p.owner),p.owner&&(p.owner.cleanups??=[]).push(()=>this.dispose()),this.computed=new wn(()=>{me(this.owner,!1),O(this.owner,()=>{let t=e();typeof t=="function"&&(this.owner.cleanups??=[]).push(t)})}),this.watcher=new Qo(()=>ss(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"&&p.onSuspend){p.onSuspend(e,this.owner);return}if(p.onError&&p.onError(e,this.owner))return;throw e}}}dispose(){this.disposed||(this.disposed=!0,this.watcher.unwatch(this.computed),me(this.owner))}};function Tt(e){let t=new as(e);return()=>t.dispose()}function ls(e){return!!e&&typeof e.then=="function"}os(()=>{});var Sn=Symbol.for("signal"),cs=Symbol.for("memo"),fs=Symbol.for("signal-node");function g(e,t){let n=new Zo(e,{equals:t?.equals}),r=(()=>n.get()),o=(s=>{let i=typeof s=="function"?s(n.peek()):s;return n.set(i),is(),i});return Object.defineProperty(r,Sn,{value:!0,enumerable:!0}),Object.defineProperty(r,fs,{value:{get value(){return n.peek()},get version(){return n.version}},enumerable:!1}),[r,o]}function m(e,t,n){let r=t,o=I(),s=new wn(()=>O(o,()=>{try{return r=e(r)}catch(a){if(ls(a))return ns(a),r;throw a}}),{equals:n?.equals}),i=(()=>s.get());return Object.defineProperty(i,Sn,{value:!0,enumerable:!0}),Object.defineProperty(i,cs,{value:!0,enumerable:!0}),i}function T(e,t){let n=t;return Tt(()=>{n=e(n)})}function Tn(e,t){let n=t;Tt(()=>{n=e(n)})}function b(e,t){let n=t;return Tt(()=>{n=e(n)})}function x(e){return us(e)}function A(e){return es(e)}function En(){return Ie(),Promise.resolve()}function Fe(e,t,n){let r=[];return S(()=>{for(let o of r)o.dispose();r=[]}),m(()=>{let o=e()||[];return A(()=>{if(o.length===0){for(let u of r)u.dispose();return r=[],n?.fallback?n.fallback():[]}let s=new Map;for(let u of r)s.has(u.item)||s.set(u.item,u);let i=[],a=new Set;for(let u=0;u<o.length;u++){let l=o[u],c=s.get(l);if(c&&!a.has(c))c.setIndex(u),i.push(c),a.add(c);else{let f,h,y;k(w=>{y=w;let[j,pe]=g(u);h=pe,f=t(l,j)});let N={item:l,rendered:f,dispose:y,setIndex:h};i.push(N),a.add(N)}}for(let u of r)a.has(u)||u.dispose();return r=i,i.map(u=>u.rendered)})})}function Ve(e,t,n,r){let o=[],s=[];return S(()=>{for(let i of s)i.dispose();o=[],s=[]}),m(()=>{let i=e()||[];return A(()=>{if(i.length===0){for(let f of s)f.dispose();return o=[],s=[],r?.fallback?r.fallback():[]}let a=new Map;for(let f=0;f<o.length;f++)a.set(o[f],s[f]);let u=[],l=[],c=new Set;for(let f=0;f<i.length;f++){let h=t(i[f]),y=a.get(h);if(y&&!c.has(h))y.setIndex(f),u.push(y);else{let N,w,j;k(pe=>{j=pe;let[B,he]=g(f);w=he;let Oe=m(Q=>(e()||[])[B()]??Q,i[f]);N=n(Oe,B)}),u.push({rendered:N,dispose:j,setIndex:w})}l.push(h),c.add(h)}for(let[f,h]of a)c.has(f)||h.dispose();return o=l,s=u,u.map(f=>f.rendered)})})}function He(e,t,n){let r=[];return S(()=>{for(let o of r)o.dispose();r=[]}),m(()=>{let o=e()||[];return A(()=>{if(o.length===0){for(let u of r)u.dispose();return r=[],n?.fallback?n.fallback():[]}let s=r.length,i=o.length;for(let u=s;u<i;u++){let l,c,f,h=o[u];k(y=>{f=y;let[N,w]=g(h);c=w,l=t(N,u)}),r.push({rendered:l,setItem:c,dispose:f})}for(let u=i;u<s;u++)r[u].dispose();i<s&&(r=r.slice(0,i));let a=Math.min(s,i);for(let u=0;u<a;u++)r[u].setItem(o[u]);return r.map(u=>u.rendered)})})}var ds=typeof window>"u"?!1:window.__FLUIXI_PROD__===!0,ps=typeof process>"u"?ds:!1,hs=Symbol.for("signal");function E(e){return typeof e=="function"&&e[hs]===!0}var wt=null;function An(e){wt=e}function ys(e){wt&&wt(e)}var xt=null;function Nn(e){xt=e}function ms(e){return xt?xt(e):void 0}var vt=null;function Ue(e){vt=e}function gs(){return vt?vt():void 0}var St=null;function Rn(e){St=e}function bs(e,t){St&&St(e,t)}function ws(e){return!!e&&typeof e.then=="function"}var gt=Symbol();function Cn(e,t,n={}){let r,o;typeof t=="function"?(r=typeof e=="function"?e:()=>e,o=t):(r=()=>!0,o=e,t&&typeof t=="object"&&(n=t));let s=n.transport===!1?void 0:gs(),i=s!==void 0?ms(s):void 0,a=i!==void 0,[u,l]=g(i!==void 0?i.value:n.initialValue,{equals:!1}),[c,f]=g(void 0,{equals:!1}),[h,y]=g(i!==void 0||n.initialValue!==void 0?"ready":"unresolved",{equals:!1}),[N,w]=g(void 0,{equals:!1}),[j,pe]=g(void 0,{equals:!1}),B=gt,he=!1;T(()=>{let R=r();if(j(),R===!1||R===null||R===void 0){B=gt,x(()=>{y("unresolved"),w(void 0),f(void 0)});return}let ke=he;if(he=!1,B!==gt&&R===B&&!ke)return;if(B=R,a){a=!1;return}let Pe=!1;S(()=>Pe=!0);let fn=A(h),co=A(u),dn=fn==="ready"||fn==="refreshing";x(()=>{y(dn?"refreshing":"pending"),f(void 0)});try{let K=o(R,{value:co,refetching:dn});ws(K)?(w(K),ys(K),K.then(Me=>{Pe||(s!==void 0&&bs(s,Me),x(()=>{l(()=>Me),y("ready"),w(void 0)}))},Me=>{Pe||x(()=>{f(Me),y("errored"),w(void 0)})})):x(()=>{l(()=>K),y("ready"),w(void 0)})}catch(K){if(Pe)return;x(()=>{f(K),y("errored"),w(void 0)})}});let Oe=()=>{let R=h();return R==="pending"||R==="refreshing"},Q=(()=>{let R=c();if(R)throw R;if(Oe()){let ke=N();if(ke)throw ke}return u()});return Object.defineProperties(Q,{state:{get:h},loading:{get:Oe},error:{get:c},latest:{get:u}}),Object.defineProperty(Q,Symbol.for("resource"),{value:!0,enumerable:!0}),Object.defineProperty(Q,Symbol.for("signal"),{value:!0,enumerable:!0}),[Q,{mutate:l,refetch:()=>{he=!0,pe(void 0)}}]}function je(e){if(typeof e=="function"&&!e.length){let t=e();return E(t)?t:je(t)}if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++){let r=je(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function We(e){let t=m(e);return ps?m(()=>je(t()),void 0,{name:"children"}):m(()=>je(t()))}var xs=Le();ts((e,t)=>{let n=vn(t,xs);n&&(n.increment(),e.finally(()=>n.decrement()))});var vs=Le();rs((e,t)=>{let n=vn(t,vs);return n?(n.setError(e),!0):!1});var re=Symbol.for("fluixi-proxy");function _n(e,t){let[n,r]=g(e,t);return Object.assign(n,{set:r})}function On(e,t,n){return m(e,t,n)}function kn(e,t){return T(e,t)}var Pn="1.0.0-alpha.80";var Mn="1.0.0-alpha.80";var P={dom:Pn,reactive:Mn};function Dn(e){P.core&&e.setAttribute("fluixi",P.core),e.setAttribute("fx-dom",P.dom),e.setAttribute("fx-reactive",P.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=P)}function qn(){let e=[P.core,P.dom,P.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${P.core??"(absent)"}, dom ${P.dom}, reactive ${P.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 Ss(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function Ts(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function Es(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function As(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function Ns(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function Rs(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function Et(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function Cs(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function jn(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function $n(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function Ln(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function In(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function Fn(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function Vn(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function M(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function Hn(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function _s(e){return jn(e)?{type:"router",value:e}:Ln(e)?{type:"route",value:e}:$n(e)?{type:"routes",value:e}:In(e)?{type:"outlet",value:e}:M(e)?{type:"component",value:e}:Hn(e)?{type:"suspense",value:e}:Fn(e)?{type:"provider",value:e}:Vn(e)?{type:"context",value:e}:{type:"none",value:e}}var v=typeof document>"u";function G(e){v=e}var ge=Symbol.for("fluixi.server-node"),At=null;function Un(e){At=e}function oe(){if(!At)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return At}function X(e){return e!=null&&e[ge]===!0?!0:typeof Node<"u"&&e instanceof Node}function ze(e){return e!=null&&e[ge]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Be(e){return e!=null&&e[ge]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var d={active:!1,cursor:null,parents:[]},Wn=null;function zn(e){Wn=e}function Ke(){return Wn}function Nt(e,t){return d.active&&t.parentNode===e}function Rt(e){let t=d.parents.lastIndexOf(e);t!==-1&&(d.parents.length=t),d.cursor=e.nextSibling}function Bn(){return d.active?d.cursor:null}function be(e,t){if(!e||e.parentNode==null)return t();let n=d.active,r=d.cursor,o=d.parents;d.active=!0,d.cursor=e,d.parents=[];try{return t()}finally{d.active=n,d.cursor=r,d.parents=o}}function Kn(e){if(!d.active)return e();let t=d.cursor,n=d.parents;d.active=!1,d.parents=[];try{return e()}finally{d.active=!0,d.cursor=t,d.parents=n}}function se(e){if(!d.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Rt(t)}function Os(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let r=0,o=e;for(;o=o.previousElementSibling;)o.tagName===e.tagName&&r++;n+=`:nth-of-type(${r+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function ks(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return`el_${Math.abs(t)}`}function Ps(e){return ks(Os(e))}var Ms=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Ds={};var Gn=new Map,Ge=new Set,Ye=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function _t(e){if(!v)for(let t of e)Ge.has(t)||Ye.has(t)||(Ge.add(t),document.addEventListener(t,qs))}function qs(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let r=n[t];if(r&&!n.disabled&&(r(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function Xn(e,t,n){if(e[`$$${t}`]=n,Ye.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=s=>{e[`$$${t}`]?.(s)};e.addEventListener(t,o),e[r]=o}return}Ge.has(t)||_t([t])}function Ct(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function js(e){return!Ye.has(e)}function $s(e){return typeof e=="function"}function W(e,t=!1){if(v)return oe().createText(e);if(d.active&&!t){let n=Ke()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function Ot(e,t=!1){if(v)return oe().createElement(e,t);if(d.active){let n=Ke()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(ee,e):document.createElement(e)}function Jn(e,t=!1){let n=Gn.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,Gn.set(e,r),r}function Ls(e,t,n=!1,r=!1){if(v){let o=oe();return n?o.parseTemplate(e,r):o.createRaw(e)}if(d.active){let o=Ke()?.hydrateStatic(t);if(o)return o}return Yn(Jn(e,r),r).firstChild}function Is(e,t){if(!d.active)return t();let n=be(e.nextSibling,t);if(typeof n=="function"){let r=n;return((...o)=>d.active?be(e.nextSibling,()=>r(...o)):r(...o))}return n}function Fs(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 Vs(e,t){let n=[];for(let r=e.nextSibling;r&&r!==t;r=r.nextSibling)n.push(r);return n}function Yn(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function Zn(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Zn(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Hs(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Us(e){if(E(e)||M(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!E(t)&&!M(t);)t=t();return t}var V=0,Ws=200;function zs(e,t,n,r,o){let s=r,i=new Map;return b(()=>{let a;if(M(e)&&!E(e)){if(!i.has(e)){V++;try{let u=e();i.set(e,u)}finally{V--}}for(a=i.get(e);typeof a=="function"&&E(a);)a=a()}else for(a=e();typeof a=="function"&&E(a);)a=a();{let u=0;for(;typeof a=="function"&&u++<50;)if(M(a)){if(!i.has(a)){let l=a;V++;try{let c=l();i.set(l,c)}finally{V--}}a=i.get(a)}else if(E(a))a=a();else if(a=a(),typeof a!="function"||!E(a)&&!M(a))break}V++;try{s=xe(t,a,n,s,i),o(s)}finally{V--}})}function $(e,t,n,r){if(V>Ws)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=W("",!0),e.appendChild(n));let o=r??null,s=u=>Array.isArray(u)&&u.some(l=>typeof l=="function"),i=u=>typeof u=="function"?u:()=>u;if(typeof t!="function"&&!s(t)){V++;try{o=xe(e,t,n,o)}finally{V--}return()=>o}let a=zs(i(t),e,n,o,u=>{o=u});return()=>(a?.(),o)}function xe(e,t,n,r,o){if(t==null||typeof t=="boolean")return U(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return U(e,r,n);if(we(t)){let i=W("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(i,r[0]),U(e,r.slice(1),n)):C(e,i,n):r?e.replaceChild(i,r):C(e,i,n),t.then(a=>{i.parentNode===e&&xe(e,a,i.nextSibling,i)}).catch(a=>{console.error("Error resolving promise in insertExpression:",a)}),i}let s=typeof t;if(s==="string"||s==="number"){if(s==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let a=W(t);return C(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=U(e,r,n)}if(r&&Be(r))return r.data=t,r;let i=W(t);return r&&r.parentNode===e?e.replaceChild(i,r):Nt(e,i)||C(e,i,n),i}if(X(t))return Nt(e,t)?(Rt(t),t):Array.isArray(r)?(r.length===0?C(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),U(e,r.slice(1),n)):C(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):C(e,t,n)):C(e,t,n),t);if(Array.isArray(t)){let i=[],a=Array.isArray(r)?r:r?[r]:[],u=[];F(t,i,e,n,!0,o,u);let l=Bs(e,a,i,n);for(let c of u){let f=$(e,c.sig,c.marker);S(()=>{U(e,f()),c.marker.parentNode===e&&e.removeChild(c.marker)})}return l}if(s==="object"&&t!==null&&typeof t=="object"){let i=t;if("type"in i&&"props"in i){let a=i;if(typeof a.type=="function"){let u=a.type(a.props||{});return xe(e,u,n,r)}}}return U(e,r,n)}function F(e,t,n,r,o=!0,s,i){for(let a=0;a<e.length;a++){let u=e[a];if(!(u==null||typeof u=="boolean")){for(;typeof u=="function"&&!we(u)&&!E(u)&&!M(u)&&(u=u(),!(u==null||typeof u=="boolean")););if(!(u==null||typeof u=="boolean")){if(typeof u=="function"){let l;for(M(u)&&!E(u)?(s||(s=new Map),s.has(u)||s.set(u,u()),l=s.get(u)):l=u();typeof l=="function"&&!we(l)&&!E(l)&&!M(l);)s||(s=new Map),s.has(l)||s.set(l,l()),l=s.get(l);if(l==null||typeof l=="boolean")continue;if(typeof l=="function"){if(E(l)){if(i){let f=W("",!0);t.push(f),i.push({marker:f,sig:l});continue}let c=l();for(;typeof c=="function"&&E(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?F(c,t,n,r,o,s):F([c],t,n,r,o,s);continue}continue}Array.isArray(l)?F(l,t,n,r,o,s,i):F([l],t,n,r,o,s,i);continue}if(we(u)){let l=W("",!0);t.push(l),u.then(c=>{if(l.parentNode){let f=[];if(F([c],f,l.parentNode,void 0,!1,s),f.length>0){l.parentNode.replaceChild(f[0],l);for(let h=1;h<f.length;h++)l.parentNode?.insertBefore(f[h],f[h-1].nextSibling)}}}).catch(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(u)){F(u,t,n,r,o,s,i);continue}if(X(u)){t.push(u);continue}if(typeof u=="object"&&u!==null&&"type"in u&&"props"in u){let l=u;if(typeof l.type=="function"){let c=l.type(l.props||{});Array.isArray(c)?F(c,t,n,r,!1,s):F([c],t,n,r,!1,s);continue}}if(typeof u=="string"||typeof u=="number"){let l=String(u);if(l.trim()===""&&l!==" ")continue;t.push(W(l));continue}t.push(W(String(u)))}}}}function Bs(e,t,n,r){for(let f=0;f<n.length;f++){let h=n[f].parentNode;h!==null&&h!==e&&h.nodeType!==11&&(n=n.slice(),n[f]=n[f].cloneNode(!0))}let o=n.length,s=t.length,i=o,a=0,u=0,l=s>0?t[s-1].nextSibling??void 0:r,c=null;for(;a<s||u<i;){if(t[a]===n[u]){a++,u++;continue}for(;s>a&&i>u&&t[s-1]===n[i-1];)s--,i--;if(s===a){let f=i<o?u?n[u-1].nextSibling??void 0:n[i-u]:l;for(;u<i;)C(e,n[u++],f)}else if(i===u)for(;a<s;)(!c||!c.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[i-1]&&n[u]===t[s-1]){let f=t[--s].nextSibling;C(e,n[u++],t[a++].nextSibling),C(e,n[--i],f),t[s]=t[a-1]}else{if(!c){c=new Map;let h=u;for(;h<i;)c.set(n[h],h++)}let f=c.get(t[a]);if(f!=null)if(u<f&&f<i){let h=a,y=1;for(;++h<s&&h<i&&!(!c.has(t[h])||c.get(t[h])!==f+y);)y++;if(y>f-u){let N=t[a];for(;u<f;)C(e,n[u++],N)}else t[a].parentNode===e?e.replaceChild(n[u++],t[a++]):(C(e,n[u++],l),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function U(e,t,n){if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r].parentNode===e&&e.removeChild(t[r]);else t.parentNode===e&&e.removeChild(t);return null}function C(e,t,n){d.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function ve(e,t,n){n==null?delete e[t]:e[t]=n}function kt(e,t,n){let r=n,o;return Array.isArray(n)&&(r=n[0],o=n[1]),typeof r!="function"?()=>{}:(e.addEventListener(t,r,o),()=>e.removeEventListener(t,r,o))}function Pt(e,t){let n=(r,o)=>{typeof r=="function"&&r(e,o??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let r of t)Array.isArray(r)?n(r[0],r[1]):n(r)}}function Xe(e,t,n,r=!1){return typeof n!="function"?(_(e,t,n,r),()=>{}):b(()=>{let o=typeof n=="function"?n():n;_(e,t,o,r)})}function Je(e,t,n){return typeof n!="function"?(ve(e,t,n),()=>{}):b(()=>{let r=typeof n=="function"?n():n;ve(e,t,r)})}function Mt(e,t,n){return typeof n!="function"?(_(e,t,!!n),()=>{}):b(()=>{let r=n();_(e,t,!!r)})}function Se(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){b(()=>Se(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(r=>{let o=t[r];return typeof o=="function"?o():!!o}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function Te(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],s=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push(b(()=>{let i=!!o();for(let a of s)e.classList.toggle(a,i)}));else{let i=!!(typeof o=="function"?o():o);for(let a of s)e.classList.toggle(a,i)}}}function Ee(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let r in n){let o=n[r];o==null?e.style[r]="":e.style[r]=o}}function Ks(e){let{element:t,props:n,prevProps:r=Ds,isSVG:o=!1,skipChildren:s=!1}=e;if(!t||!ze(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let i=o||t.namespaceURI===ee,a=[];for(let u in n){if(s&&u==="children")continue;let l=n[u],c=r[u];if(l===c)continue;if(u==="ref"){Ae(l,t);continue}if(u==="use"){Pt(t,l);continue}if(u.startsWith("on:")){a.push(kt(t,u.slice(3),l));continue}if(u.startsWith("prop:")){a.push(Je(t,u.slice(5),l));continue}if(u.startsWith("attr:")){a.push(Xe(t,u.slice(5),l,i));continue}if(u.startsWith("bool:")){a.push(Mt(t,u.slice(5),l));continue}if(u==="class"||u==="className"){typeof l=="function"?a.push(b(()=>Se(t,l()))):Se(t,l);continue}if(u==="classList"){typeof l=="function"?a.push(b(()=>Te(t,l()))):Te(t,l,a);continue}if(u==="style"){typeof l=="function"?a.push(b(()=>Ee(t,l()))):Ee(t,l);continue}if(u.startsWith("on")){let h=u.slice(2).toLowerCase();c&&Ct(t,h),l&&Xn(t,h,l);continue}let f=qe.has(u)||!i&&u in t;typeof l=="function"?a.push(f?Je(t,u,l):Xe(t,u,l,i)):a.push(b(()=>f?ve(t,u,n[u]):_(t,u,n[u],i)))}for(let u in r)if(!(u in n))if(u.startsWith("on")){let l=u.slice(2).toLowerCase();Ct(t,l)}else qe.has(u)?ve(t,u,null):t.removeAttribute(u);return()=>{a.forEach(u=>u())}}function Dt(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){Ae(o,e);continue}if(r!=="children"){if(r==="use"){Pt(e,o);continue}if(r.startsWith("on:")){kt(e,r.slice(3),o);continue}if(r.startsWith("prop:")){Je(e,r.slice(5),o);continue}if(r.startsWith("attr:")){Xe(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){Mt(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let s=r.slice(2).toLowerCase();if(typeof o=="function")if(Ye.has(s)){e[`$$${s}`]=o;let i=`__fx_${s}`;if(!e[i]){let a=u=>{e[`$$${s}`]?.(u)};e.addEventListener(s,a),e[i]=a}}else e[`$$${s}`]=o,Ge.has(s)||_t([s]);continue}if(r==="class"||r==="className"){Se(e,o);continue}if(r==="classList"){typeof o=="function"?b(()=>Te(e,o())):Te(e,o);continue}if(r==="style"){typeof o=="function"?b(()=>Ee(e,o())):Ee(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let s=T(()=>{let i=o();for(;typeof i=="function";)i=i();e.innerHTML=i});S(()=>s())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let s=T(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();document.activeElement!==e&&(e.value=i??"")});S(()=>{s()})}else b(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let s=T(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();document.activeElement!==e&&(e.checked=i??"")});S(()=>{s()})}else b(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let s=!0,i=T(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();s?(s=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});S(()=>{i()})}else{let s=!0;b(()=>{let i=t[r];s?(s=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""})}continue}if(typeof o=="function"){let s=T(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();De(e,r,i,n)});S(()=>{s()})}else b(()=>De(e,r,t[r],n))}}}function Gs(...e){let t=r=>{for(let o=e.length-1;o>=0;o--){let s=e[o];if(s&&r in s&&s[r]!==void 0)return s[r]}},n=r=>{for(let o of e)if(o&&r in o)return!0;return!1};return new Proxy({},{get:(r,o)=>t(o),has:(r,o)=>n(o),ownKeys:()=>{let r=new Set;for(let o of e)if(o)for(let s of Reflect.ownKeys(o))r.add(s);return[...r]},getOwnPropertyDescriptor:(r,o)=>n(o)?{enumerable:!0,configurable:!0,get:()=>t(o)}:void 0})}function Xs(e,...t){let n=new Set;for(let i of t)for(let a of i)n.add(a);let r=i=>({enumerable:!0,configurable:!0,get:()=>e[i]}),o=t.map(i=>{let a=new Set(i);return new Proxy({},{get:(u,l)=>a.has(l)?e[l]:void 0,has:(u,l)=>a.has(l)&&l in e,ownKeys:()=>Array.from(a).filter(u=>u in e),getOwnPropertyDescriptor:(u,l)=>a.has(l)&&l in e?r(l):void 0})}),s=new Proxy({},{get:(i,a)=>n.has(a)?void 0:e[a],has:(i,a)=>!n.has(a)&&a in e,ownKeys:()=>Reflect.ownKeys(e).filter(i=>!n.has(i)),getOwnPropertyDescriptor:(i,a)=>!n.has(a)&&a in e?r(a):void 0});return[...o,s]}function Ae(e,t){if(e){if(X(e)){let n=t,r=e;if(!n)return;typeof n=="function"?n(r):typeof n=="object"&&"current"in n&&(n.current=r);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function Js(e,t,n){let r=t||document.body,o=We(()=>e),s=[];return x(()=>{let i=b(()=>{let a=o();Array.isArray(a)?(a.forEach(u=>r.appendChild(u)),s.push(()=>{a.forEach(u=>{u.parentNode===r&&r.removeChild(u)})})):X(a)&&(r.appendChild(a),s.push(()=>{a.parentNode===r&&r.removeChild(a)}))});s.push(i),S(()=>{s.forEach(a=>a())})}),null}function Ys(e){return typeof e=="string"&&e.toLowerCase()===e}function qt(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 Zs(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function we(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Qs(e){return typeof e=="function"&&e.length===0&&E(e)}function jt(e,t,n){if(!t)throw new Error("Container element is required");let r,o,s=[];return k(i=>{x(()=>{d.active||(t.textContent=""),Dn(t),qn(),$(t,e)}),o=i}),()=>{o?.(),r?.(),s.forEach(i=>i()),t.textContent=""}}function ei(e){if(Array.isArray(e))return e;if(typeof e=="function"&&typeof e.set=="function")return[e,e.set];throw new TypeError("[fluixi] bind: needs a signal — either `signal(…)` or the `[get, set]` pair from `createSignal(…)`.")}var ti="__fluixi_signal_next_state__",ni=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)},H=globalThis[ti]??={consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:ni,onSuspend:null,onError:null};function ri(e){if(H.untracked)return e();H.untracked=!0;try{return e()}finally{H.untracked=!1}}function oi(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function lr(e){let t=Symbol("context");return{id:t,defaultValue:e,Provider:n=>{let r=H.owner,o=oi(r);(o.contexts=new Map).set(t,n.value),r&&(r.owned??=[]).push(o),H.owner=o;try{return n.children}finally{H.owner=r}}}}function cr(e,t){let n=e;for(;n;){if(n.contexts&&n.contexts.has(t.id))return n.contexts.get(t.id);n=n.parent}return t.defaultValue}function si(e){H.onSuspend=e}function ii(e){H.onError=e}function ui(e){H.hostSchedule=e??(t=>{Promise.resolve().then(t)})}ui(()=>{});function fr(e){return ri(e)}var vu=typeof window>"u"?!1:window.__FLUIXI_PROD__===!0;var ai=Symbol.for("signal");function dr(e){return typeof e=="function"&&e[ai]===!0}var li=lr();si((e,t)=>{let n=cr(t,li);n&&(n.increment(),e.finally(()=>n.decrement()))});var ci=lr();ii((e,t)=>{let n=cr(t,ci);return n?(n.setError(e),!0):!1});var Lt=Symbol("store-raw"),Qn=Symbol("store-node"),er=Symbol("store-has"),tr=Symbol("store-self"),nr=Symbol("store-track");var rr=new WeakMap,or=new WeakMap;function pr(e){let[t,n]=g(e),r=t;return r.$=n,r}function Qe(e){let t=rr.get(e);return t||rr.set(e,t={keys:new Map}),t}function sr(e,t,n){let r=e.keys.get(t);return r||e.keys.set(t,r=pr(n)),r}function ir(e){let t=Qe(e);(t.all||(t.all=pr()))()}function ur(e,t){e.$(typeof t=="function"?()=>t:t)}function hr(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 Ze(e){if(!hr(e))return e;let t=or.get(e);if(t)return t;let n=new Proxy(e,fi);return or.set(e,n),n}var fi={get(e,t,n){if(t===Lt||t===Qn)return e;if(t===re)return n;if(t===er)return i=>i in e;if(t==="__proxy")return!0;if(t===nr||t===tr)return ir(e),n;let r=e[t];if(typeof r=="function"&&!Object.prototype.hasOwnProperty.call(e,t))return r;let o=Object.getOwnPropertyDescriptor(e,t);if(o&&o.get)return o.get.call(n);let s=sr(Qe(e),t,r)();return hr(s)?Ze(s):s},set(){return!0},deleteProperty(e,t){return t in e&&Ne(e,t,void 0),!0},has(e,t){return t===Lt||t===re||t===Qn||t===er||t===tr||t===nr?!0:(sr(Qe(e),t,e[t])(),t in e)},ownKeys(e){return ir(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e,t)}};function Ne(e,t,n){if(e[t]===n&&(n!==void 0||t in e))return;let r=Array.isArray(e),o=r?e.length:0;n===void 0?delete e[t]:e[t]=n;let s=Qe(e),i=s.keys.get(t);if(i&&ur(i,n),r&&e.length!==o){let a=s.keys.get("length");a&&ur(a,e.length)}s.all&&s.all.$(void 0)}function ar(e,t){return typeof e=="function"?e(t):e}function It(e,t){for(let n of Object.keys(t)){let r=t[n],o=e[n];r&&typeof r=="object"&&!Array.isArray(r)&&o&&typeof o=="object"&&!Array.isArray(o)?It(o,r):Ne(e,n,r)}}function Vt(e){let t=[],n=e.replace(/\[([^\]]*)\]/g,".$1");for(let r of n.split("."))r.length&&t.push(r);return t}function yr(e,t,n){let r=t.length-1;for(let s=0;s<r;s++){let i=t[s];if(i==="*"){let u=t.slice(s+1);if(Array.isArray(e))for(let l=0;l<e.length;l++)yr(e[l],u,n);return}let a=e[i];(a==null||typeof a!="object")&&(a=/^\d+$/.test(t[s+1])?[]:{},Ne(e,i,a)),e=a}let o=t[r];if(o==="*"){if(Array.isArray(e))for(let s=0;s<e.length;s++)Ne(e,s,ar(n,e[s]));return}Ne(e,o,ar(n,e[o]))}function $t(e,t,n){yr(e,Vt(t),n)}function di(e,t){let n=t[0];if(typeof n=="function"&&t.length===1){let r=n(e);r&&r!==e&&It(e,r);return}if(Array.isArray(n)&&t.length===1){for(let r of n)Array.isArray(r)&&$t(e,r[0],r[1]);return}if(n&&typeof n=="object"&&!Array.isArray(n)&&t.length===1){It(e,n);return}if(Array.isArray(t[1])&&t.length>=3){$t(e,`${n}.${t[1].join(".")}`,t[2]);return}$t(e,String(n),t[1])}function Ft(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(Ft);let t={};for(let n of Object.keys(e))t[n]=Ft(e[n]);return t}function ie(e,t){let n=e;for(let r of Vt(t)){if(n==null)return;n=n[r]}return n}var mr=class{constructor(e,t={immutable:!0}){this.options=t,this.root=e,this.set=((...n)=>x(()=>di(this.root,n)))}get state(){return Ze(this.root)}get proxy(){return Ze(this.root)}get accessor(){return(()=>Ze(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 n of Vt(e)){if(t==null)return;t=t[n]}return et(t)}select(e){return m(()=>e(this.state))}subscribe(e){return T(()=>e(this.state))}watch(e,t){let n;return T(()=>{let r=e(this.state);Object.is(r,n)||(t(r,n),n=r)})}reactive(e){return m(()=>this.state[e])}produce(e){this.set((t=>{let n=Ft(t);return e(n),n}))}reconcile(e,t={}){this.set(e)}push(e,...t){let n=ie(this.root,e);this.set(e,n.concat(t))}pop(e){let t=ie(this.root,e).slice(),n=t.pop();return this.set(e,t),n}shift(e){let t=ie(this.root,e).slice(),n=t.shift();return this.set(e,t),n}splice(e,t,n,...r){let o=ie(this.root,e).slice(),s=o.splice(t,n,...r);return this.set(e,o),s}insert(e,t,n){let r=ie(this.root,e).slice();r.splice(t,0,n),this.set(e,r)}removeAt(e,t){let n=ie(this.root,e).slice(),r=n.splice(t,1);return this.set(e,n),r}toObservable(){let[e]=g(this.state);return e.toObservable()}dispose(){}},pi=["get","select","watch","subscribe","produce","reconcile","push","pop","shift","splice","insert","removeAt","unwrap","toObservable"];function hi(e,t){for(let n of pi)e[n]=t[n].bind(t);e.$=t.reactive.bind(t)}function yi(e,t={immutable:!0}){let n=new mr(e,t);return hi(n.set,n),[n.proxy,n.set]}function mi(e,t={}){return new mr(e,{...t,immutable:!1})}function et(e){if(e==null||typeof e!="object")return e;let t=e[Lt];return t!==void 0?t:e}function gi(e){return A(()=>et(e))}var Tu=Object.freeze({createStore:yi,createMutableStore:mi,batch:x,unwrap:et,untrackStore:gi});var bi="__fx_dom_create_component__",J=globalThis[bi]??={fn:null};function wi(e){J.fn=e}function xi(e={}){let t=e.signalSystem?.createComponent;t&&(J.fn=t)}function Ht(e,t){if(J.fn)return J.fn(e,t);let n=typeof e=="function"?fr(()=>e(t)):e;if(n!=null&&(typeof n=="function"||typeof n=="object")&&!dr(n)){try{n.$name=e?.name}catch{}return Et(n)}return n}var vi=()=>J.fn!==null,Si=()=>J.fn!==null;function Ti(){J.fn=null}var tt,br={getStore:()=>tt,run(e,t){let n=tt;tt=e;try{return t()}finally{tt=n}}},Ut=br;function Wt(e){Ut=e??br}function ue(e={}){e.locals||(e.locals=e.request?rt(e.request):{});let t=0,n=0,r=null,o=new Map,s=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${t++}`,nextResourceId:()=>{if(r===null)return`r${n++}`;let i=o.get(r)??0;return o.set(r,i+1),`${r}:r${i}`},nextIslandNamespace:i=>{let a=s.get(i)??0;return s.set(i,a+1),`${i}#${a}`},withResourceScope(i,a){let u=r;r=i;try{return a()}finally{r=u}},pending:new Set,data:new Map}}function ae(e,t){return Ut.run(e,t)}function L(){return Ut.getStore()}function nt(){return L()?.event}function zt(){let e=nt();return e?(e.locals||(e.locals={}),e.locals):{}}var gr=new WeakMap;function rt(e){let t=gr.get(e);return t||(t={},gr.set(e,t)),t}var le="__FX_DATA__";function Re(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var Bt;function Ce(){let e=globalThis.__FX_DATA__;if(e)return e;if(Bt!==void 0)return Bt;let t=null;if(typeof document<"u"){let n=document.getElementById(le)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return Bt=t}function ot(){for(;;){for(;d.cursor&&d.cursor.nodeType===3&&d.cursor.data==="";)d.cursor=d.cursor.nextSibling;if(d.cursor!=null||!d.parents.length)return;d.cursor=d.parents.pop().nextSibling}}var Ei=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),st=typeof process<"u"&&process.env&&!1;function it(e,t){let n=t.nodeType===1?`<${t.tagName.toLowerCase()}>`:t.nodeType===3?`text ${JSON.stringify((t.nodeValue??"").slice(0,24))}`:t.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${n}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function Ai(e){ot();let t=d.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Ei.has(e.toLowerCase())?d.cursor=t.nextSibling:(d.parents.push(t),d.cursor=t.firstChild),t):(st&&t&&it(`<${e}>`,t),null)}function Ni(e){ot();let t=d.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(d.cursor=t.nextSibling,t):(st&&t&&it(`<${e}> (static)`,t),null)}function Ri(e){if(e===""){let n=d.cursor;return n&&n.nodeType===3&&n.data!==""?(d.cursor=n.nextSibling,n.data="",n):null}ot();let t=d.cursor;return t&&t.nodeType===3?(d.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(st&&t&&it(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Ci(e){ot();let t=d.cursor;return t&&t.nodeType===8&&t.data===e?(d.cursor=t.nextSibling,t):(st&&t&&it(`marker <!--${e.slice(0,24)}-->`,t),null)}var wr=!1;function _i(){wr||(wr=!0,zn({hydrateElement:Ai,hydrateText:Ri,hydrateMarker:Ci,hydrateStatic:Ni}))}function ut(e,t,n){_i(),d.active=!0,d.cursor=t.firstChild,d.parents=[];let r=Ce(),o=n?.resourceNamespace,s=0;Ue(()=>o?`${o}:r${s++}`:`r${s++}`),Nn(r?i=>i in r?{value:r[i]}:void 0:null);try{return jt(e,t)}finally{d.active=!1,d.cursor=null,d.parents=[]}}var Kt="fluixi-island";function vr(e){let{component:t,props:n={},name:r}=e,o=Ot(Kt),s=r??t.name??"Island";_(o,"name",s),_(o,"props",JSON.stringify(n??{}));let i=v?L():void 0;if(i){let a=i.nextIslandNamespace(s);$(o,()=>i.withResourceScope(a,()=>t(n)))}else $(o,()=>t(n));return o}var xr=!1;function Oi(){if(xr||typeof document>"u")return;xr=!0;let e=document.createElement("style");e.textContent=`${Kt}{display:contents}`,document.head.appendChild(e)}function Sr(e){if(typeof document>"u")return;Oi();let t=document.querySelectorAll(Kt),n=new Map;t.forEach(r=>{let o=r.getAttribute("name")??"",s=n.get(o)??0;n.set(o,s+1);let i=e[o];if(!i){typeof process>"u"&&console.warn(`[fluixi] island "${o}" has no component in the registry — left static.`);return}let a={};try{a=JSON.parse(r.getAttribute("props")||"{}")}catch{}ut(()=>i(a),r,{resourceNamespace:`${o}#${s}`})})}function Tr(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function Er(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function ki(e,t={}){if(typeof e=="function")return Ht(e,t);if(typeof e!="string"||e.length===0)return null;let n=qt(e);if(v)return oe().createElement(e,n);let r=n?document.createElementNS(ee,e):document.createElement(e);return Dt(r,t,n),Pi(r,t),r}function Pi(e,t){if(!t||t.children===void 0)return;let n=We(()=>t.children),r=o=>{$(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}function Ar(e){return typeof e=="function"?e:(()=>e)}function z(e){return()=>{let t=e();return typeof t=="function"?t():t}}function Nr(e){return e!=null&&e!==!1}function Rr(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function Cr(e){let t=z(()=>e.when),n=m(t,void 0),r=m(n,void 0),o=I(),s=null,i=null,a=u=>{u!==i&&(s&&ne(s),s=te(o),i=u)};return m(()=>{let u=r();return a(u?"when":"fallback"),O(s,()=>{if(u){let l=e.children;return typeof l=="function"&&!Rr(l)?typeof n=="function"?A(()=>A(n)?l(n()):e.fallback):l(n):l}return e.fallback});return e.fallback??null},void 0,{name:"show"})}function _r(e){let t=z(()=>e.each),n=()=>e.fallback??null,r=(o,s)=>{let i=e.children,a=Array.isArray(i)?i.map(u=>typeof u=="function"?u(o,s):u):typeof i=="function"?i(o,s):i;return se(a),a};return e.by?Ve(t,e.by,(o,s)=>r(o,s),{fallback:n}):Fe(t,(o,s)=>r(o,s),{fallback:n})}function Or(e){let t=z(()=>e.each);return He(t,(n,r)=>{let o=e.children(n,r);return se(o),o},{fallback:()=>e.fallback??null})}var Gt=Symbol("match");function kr(e){return{[Gt]:!0,when:z(()=>e.when),get children(){return e.children}}}function Pr(e){let t=Array.isArray(e.children)?e.children:[e.children],n=I(),r=null,o=-1,s=i=>{i!==o&&(r&&ne(r),r=te(n),o=i)};return m(()=>{for(let i=0;i<t.length;i+=1){let u=t[i],l=0;for(;typeof u=="function"&&!u[Gt]&&l++<10;)u=u();if(!u||typeof u!="object"||u[Gt]!==!0)continue;let c=u.when();if(Nr(c))return s(i),O(r,()=>typeof u.children=="function"?u.children(c):u.children)}return s(-2),O(r,()=>e.fallback??null)})}function Mr(e){let t=Ar(e.component),{component:n,...r}=e,o=I(),s=null,i;return m(()=>{let a=t();return a!==i&&(s&&ne(s),s=te(o),i=a),a==null?null:typeof a=="string"?{tag:a,props:r}:O(s,()=>a(r))})}function Dr(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return k(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),$(r,e.children)&&Ae(e.ref,r)}),S(()=>{n(),r.remove()}),null}function Xt(e){if(v)return e.fallback??null;let t=d.active,[n,r]=g(!t);return t&&queueMicrotask(()=>r(!0)),m(()=>n()?e.children:e.fallback??null,void 0,{name:"client-only"})}var qr=Xt;function jr(e){let[t,n]=g(null),r=()=>n(null);return m(()=>{let o=t();if(o!==null)return typeof e.fallback=="function"?e.fallback(o,r):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(s){return n(s),typeof e.fallback=="function"?e.fallback(s,r):e.fallback}})}function $r(e){return m(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;(typeof o=="function"?o():o)&&n.push(r)}return n.join(" ")})}function Mi(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Lr(e){return m(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;let s=typeof o=="function"?o():o;s!=null&&n.push(`${Mi(r)}: ${s}`)}return n.join("; ")})}var lt=1,Zt=3,Qt=8,Ir;Ir=ge;var ce=class{constructor(){this[Ir]=!0;this.parentNode=null;this.childNodes=[]}get firstChild(){return this.childNodes[0]??null}get lastChild(){return this.childNodes[this.childNodes.length-1]??null}get nextSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>=0?t.childNodes[n+1]??null:null}get previousSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>0?t.childNodes[n-1]??null:null}get parentElement(){return this.parentNode}appendChild(t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes.push(t),t}insertBefore(t,n){if(n==null)return this.appendChild(t);t.parentNode&&t.parentNode.removeChild(t);let r=this.childNodes.indexOf(n);return t.parentNode=this,r<0?this.childNodes.push(t):this.childNodes.splice(r,0,t),t}removeChild(t){let n=this.childNodes.indexOf(t);return n>=0&&this.childNodes.splice(n,1),t.parentNode=null,t}replaceChild(t,n){let r=this.childNodes.indexOf(n);return r>=0&&(t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes[r]=t,n.parentNode=null),n}addEventListener(){}removeEventListener(){}},Y=class e extends ce{constructor(n){super();this.nodeType=Zt;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}get textContent(){return this.data}set textContent(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},at=class e extends ce{constructor(n){super();this.nodeType=lt;this.rawOuterHTML=n}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},fe=class e extends ce{constructor(n){super();this.nodeType=Qt;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},Jt=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},Yt=class{constructor(t){this.el=t}list(){let t=this.el.getAttribute("class");return t?t.split(/\s+/).filter(Boolean):[]}write(t){t.length?this.el.setAttribute("class",t.join(" ")):this.el.removeAttribute("class")}add(...t){let n=this.list();for(let r of t)n.includes(r)||n.push(r);this.write(n)}remove(...t){this.write(this.list().filter(n=>!t.includes(n)))}contains(t){return this.list().includes(t)}toggle(t,n){let r=this.contains(t),o=n===void 0?!r:n;return o?this.add(t):this.remove(t),o}},Z=class e extends ce{constructor(n,r=!1){super();this.nodeType=lt;this.attributes=new Map;this.style=new Jt;this.classList=new Yt(this);this.rawHTML=null;this.localName=n.toLowerCase(),this.tagName=r?n:n.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(n,r){this.attributes.set(n,String(r))}removeAttribute(n){this.attributes.delete(n)}getAttribute(n){return this.attributes.has(n)?this.attributes.get(n):null}hasAttribute(n){return this.attributes.has(n)}get id(){return this.getAttribute("id")??""}set id(n){n==null?this.removeAttribute("id"):this.setAttribute("id",n)}get className(){return this.getAttribute("class")??""}set className(n){n==null?this.removeAttribute("class"):this.setAttribute("class",n)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(n){n==null?this.removeAttribute("for"):this.setAttribute("for",n)}set value(n){n==null?this.removeAttribute("value"):this.setAttribute("value",String(n))}set checked(n){n?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(n){n?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(n){}get textContent(){return this.childNodes.map(n=>n.textContent??"").join("")}set textContent(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,n!=null&&n!==""&&this.appendChild(new Y(String(n)))}set innerText(n){this.textContent=n}set innerHTML(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=n==null?"":String(n)}cloneNode(n=!1){let r=new e(this.localName,this.isSVG);if(r.attributes=new Map(this.attributes),r.style.cssText=this.style.cssText,r.rawHTML=this.rawHTML,n)for(let o of this.childNodes)r.appendChild(o.cloneNode(!0));return r}};var Di=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Vr=/&/g,Hr=/</g,Ur=/>/g,qi=/"/g;function en(e){return e.replace(Vr,"&amp;").replace(Hr,"&lt;").replace(Ur,"&gt;")}function Fr(e){return e.replace(Vr,"&amp;").replace(qi,"&quot;").replace(Hr,"&lt;").replace(Ur,"&gt;")}function ji(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function $i(e){if(!e)return"";let t=[];e.cssText&&t.push(e.cssText.trim().replace(/;\s*$/,""));for(let n of Object.keys(e)){if(n==="cssText")continue;let r=e[n];r==null||r===""||t.push(`${ji(n)}: ${r}`)}return t.join("; ")}function Li(e){let t="",n=$i(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${Fr(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${Fr(o)}"`}return t}function D(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return en(e);if(typeof e=="number")return en(String(e));if(typeof e=="function")return D(e());if(Array.isArray(e))return e.map(D).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case Zt:return en(e.data??"");case Qt:return`<!--${e.data??""}-->`;case lt:{let t=e.localName,n=`<${t}${Li(e)}>`;if(Di.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(D).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(D).join(""):""}var Ii=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Fi={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function Wr(e){return e.replace(/&(#?\w+);/g,(t,n)=>Fi[n]??t)}var q=class extends Error{};function zr(e,t=!1){let n=0,r=[],o=[],s=l=>{let c=o[o.length-1];c?c.appendChild(l):r.push(l)};for(;n<e.length;){let l=e.indexOf("<",n);if(l===-1){a(e.slice(n));break}if(l>n&&a(e.slice(n,l)),e.startsWith("<!--",l)){let c=e.indexOf("-->",l);if(c===-1)throw new q(`unterminated comment at ${l}`);s(new fe(e.slice(l+4,c))),n=c+3;continue}if(e[l+1]==="/"){let c=e.indexOf(">",l);if(c===-1)throw new q(`unterminated closing tag at ${l}`);let f=e.slice(l+2,c).trim().toLowerCase(),h=o.pop();if(!h||h.localName!==f)throw new q(`</${f}> does not close <${h?.localName??"nothing"}>`);n=c+1;continue}n=u(l)}if(o.length>0)throw new q(`unclosed <${o[o.length-1].localName}>`);let i=r[0];if(r.length!==1||!(i instanceof Z))throw new q(`expected exactly one root element, got ${r.length}`);return i;function a(l){l!==""&&s(new Y(Wr(l)))}function u(l){let c=/[\s/>]/.exec(e.slice(l+1));if(!c)throw new q(`unterminated tag at ${l}`);let f=e.slice(l+1,l+1+c.index).toLowerCase(),h=new Z(f,t),y=l+1+c.index;for(;y<e.length;){for(;y<e.length&&/\s/.test(e[y]);)y++;if(e[y]===">"){y++;break}if(e[y]==="/"&&e[y+1]===">"){y+=2;break}let N=y;for(;y<e.length&&!/[\s=/>]/.test(e[y]);)y++;let w=e.slice(N,y);if(w==="")throw new q(`malformed attribute at ${y}`);if(e[y]==="="){if(e[y+1]!=='"')throw new q(`attribute ${w} must have a double-quoted value`);let j=e.indexOf('"',y+2);if(j===-1)throw new q(`unterminated value for ${w}`);h.setAttribute(w,Wr(e.slice(y+2,j))),y=j+1}else h.setAttribute(w,"")}return s(h),Ii.has(f)||o.push(h),y}}var Br=!1;function Gr(){Br||(Br=!0,Un({createElement:(e,t)=>new Z(e,t),createText:e=>new Y(e),createRaw:e=>new at(e),parseTemplate:(e,t)=>zr(e,t),createComment:e=>new fe(e)}))}function nn(e,t={}){let n=v;Gr(),G(!0);let r=ue(t.event);try{return ae(r,()=>k(o=>{try{let s=typeof e=="function"?e():e;return D(s)}finally{o()}}))}finally{G(n)}}var Kr=!1;function Vi(){Kr||(Kr=!0,An(e=>{L()?.pending.add(e)}),Ue(()=>L()?.nextResourceId()??""),Rn((e,t)=>{e&&L()?.data.set(e,t)}))}var tn=null;function rn(e){tn=e}function ct(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let s=o;if(tn)try{s=tn(o,r)}catch{continue}s!==void 0&&(typeof s=="function"||typeof s=="symbol"||(t[r]=s))}if(Object.keys(t).length===0)return"";let n=Re(JSON.stringify(t));return n==="{}"?"":`<script type="application/json" id="${le}">${n}<\/script>`}var Hi=50;async function on(e,t={}){let n=v;Gr(),G(!0),Vi();let r=ue(t.event);try{return await ae(r,async()=>{t.preload&&await t.preload(t.event);let o,s=null,i=()=>{};k(c=>{i=c,s=I(),o=typeof e=="function"?e():e});let a=()=>{try{O(s,()=>D(o))}catch{}};a();let u=0;for(;r.pending.size>0&&u++<Hi;){let c=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(c),await En(),a()}let l=O(s,()=>D(o))+ct(r);return i(),l})}finally{G(n)}}var un=Symbol("store-raw"),Xr=Symbol("store-node"),Jr=Symbol("store-has"),Yr=Symbol("store-self"),Zr=Symbol("store-track");var Qr=new WeakMap,eo=new WeakMap;function so(e){let[t,n]=g(e),r=t;return r.$=n,r}function dt(e){let t=Qr.get(e);return t||Qr.set(e,t={keys:new Map}),t}function to(e,t,n){let r=e.keys.get(t);return r||e.keys.set(t,r=so(n)),r}function no(e){let t=dt(e);(t.all||(t.all=so()))()}function ro(e,t){e.$(typeof t=="function"?()=>t:t)}function io(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 ft(e){if(!io(e))return e;let t=eo.get(e);if(t)return t;let n=new Proxy(e,Ui);return eo.set(e,n),n}var Ui={get(e,t,n){if(t===un||t===Xr)return e;if(t===re)return n;if(t===Jr)return i=>i in e;if(t==="__proxy")return!0;if(t===Zr||t===Yr)return no(e),n;let r=e[t];if(typeof r=="function"&&!Object.prototype.hasOwnProperty.call(e,t))return r;let o=Object.getOwnPropertyDescriptor(e,t);if(o&&o.get)return o.get.call(n);let s=to(dt(e),t,r)();return io(s)?ft(s):s},set(){return!0},deleteProperty(e,t){return t in e&&_e(e,t,void 0),!0},has(e,t){return t===un||t===re||t===Xr||t===Jr||t===Yr||t===Zr?!0:(to(dt(e),t,e[t])(),t in e)},ownKeys(e){return no(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e,t)}};function _e(e,t,n){if(e[t]===n&&(n!==void 0||t in e))return;let r=Array.isArray(e),o=r?e.length:0;n===void 0?delete e[t]:e[t]=n;let s=dt(e),i=s.keys.get(t);if(i&&ro(i,n),r&&e.length!==o){let a=s.keys.get("length");a&&ro(a,e.length)}s.all&&s.all.$(void 0)}function oo(e,t){return typeof e=="function"?e(t):e}function an(e,t){for(let n of Object.keys(t)){let r=t[n],o=e[n];r&&typeof r=="object"&&!Array.isArray(r)&&o&&typeof o=="object"&&!Array.isArray(o)?an(o,r):_e(e,n,r)}}function cn(e){let t=[],n=e.replace(/\[([^\]]*)\]/g,".$1");for(let r of n.split("."))r.length&&t.push(r);return t}function uo(e,t,n){let r=t.length-1;for(let s=0;s<r;s++){let i=t[s];if(i==="*"){let u=t.slice(s+1);if(Array.isArray(e))for(let l=0;l<e.length;l++)uo(e[l],u,n);return}let a=e[i];(a==null||typeof a!="object")&&(a=/^\d+$/.test(t[s+1])?[]:{},_e(e,i,a)),e=a}let o=t[r];if(o==="*"){if(Array.isArray(e))for(let s=0;s<e.length;s++)_e(e,s,oo(n,e[s]));return}_e(e,o,oo(n,e[o]))}function sn(e,t,n){uo(e,cn(t),n)}function Wi(e,t){let n=t[0];if(typeof n=="function"&&t.length===1){let r=n(e);r&&r!==e&&an(e,r);return}if(Array.isArray(n)&&t.length===1){for(let r of n)Array.isArray(r)&&sn(e,r[0],r[1]);return}if(n&&typeof n=="object"&&!Array.isArray(n)&&t.length===1){an(e,n);return}if(Array.isArray(t[1])&&t.length>=3){sn(e,`${n}.${t[1].join(".")}`,t[2]);return}sn(e,String(n),t[1])}function ln(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(ln);let t={};for(let n of Object.keys(e))t[n]=ln(e[n]);return t}function de(e,t){let n=e;for(let r of cn(t)){if(n==null)return;n=n[r]}return n}var ao=class{constructor(e,t={immutable:!0}){this.options=t,this.root=e,this.set=((...n)=>x(()=>Wi(this.root,n)))}get state(){return ft(this.root)}get proxy(){return ft(this.root)}get accessor(){return(()=>ft(this.root))}unwrap(){return this.root}getNode(e){return this.root&&this.root[e]}get(e){if(e==null||e==="")return pt(this.state);let t=this.state;for(let n of cn(e)){if(t==null)return;t=t[n]}return pt(t)}select(e){return m(()=>e(this.state))}subscribe(e){return T(()=>e(this.state))}watch(e,t){let n;return T(()=>{let r=e(this.state);Object.is(r,n)||(t(r,n),n=r)})}reactive(e){return m(()=>this.state[e])}produce(e){this.set((t=>{let n=ln(t);return e(n),n}))}reconcile(e,t={}){this.set(e)}push(e,...t){let n=de(this.root,e);this.set(e,n.concat(t))}pop(e){let t=de(this.root,e).slice(),n=t.pop();return this.set(e,t),n}shift(e){let t=de(this.root,e).slice(),n=t.shift();return this.set(e,t),n}splice(e,t,n,...r){let o=de(this.root,e).slice(),s=o.splice(t,n,...r);return this.set(e,o),s}insert(e,t,n){let r=de(this.root,e).slice();r.splice(t,0,n),this.set(e,r)}removeAt(e,t){let n=de(this.root,e).slice(),r=n.splice(t,1);return this.set(e,n),r}toObservable(){let[e]=g(this.state);return e.toObservable()}dispose(){}},zi=["get","select","watch","subscribe","produce","reconcile","push","pop","shift","splice","insert","removeAt","unwrap","toObservable"];function Bi(e,t){for(let n of zi)e[n]=t[n].bind(t);e.$=t.reactive.bind(t)}function ht(e,t={immutable:!0}){let n=new ao(e,t);return Bi(n.set,n),[n.proxy,n.set]}function Ki(e,t={}){return new ao(e,{...t,immutable:!1})}function pt(e){if(e==null||typeof e!="object")return e;let t=e[un];return t!==void 0?t:e}function Gi(e){return A(()=>pt(e))}var ql=Object.freeze({createStore:ht,createMutableStore:Ki,batch:x,unwrap:pt,untrackStore:Gi});function lo(e,t){let[n,r]=ht(e,t);return new Proxy(n,{get:(o,s)=>s==="set"?r:o[s],has:(o,s)=>s==="set"||Reflect.has(o,s)})}return go(Xi);})();
1
+ "use strict";var FluixiDOM=(()=>{var yt=Object.defineProperty;var fo=Object.getOwnPropertyDescriptor;var po=Object.getOwnPropertyNames;var ho=Object.prototype.hasOwnProperty;var yo=(e,t)=>{for(var n in t)yt(e,n,{get:t[n],enumerable:!0})},mo=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of po(t))!ho.call(e,o)&&o!==n&&yt(e,o,{get:()=>t[o],enumerable:!(r=fo(t,o))||r.enumerable});return e};var go=e=>mo(yt({},"__esModule",{value:!0}),e);var Xi={};yo(Xi,{ClientOnly:()=>Xt,Dynamic:()=>Mr,ErrorBoundary:()=>jr,FX_DATA_ID:()=>le,For:()=>_r,Index:()=>Or,Island:()=>vr,JSX_PROPERTIES:()=>qe,Match:()=>kr,NoSsr:()=>qr,Portal:()=>Dr,SVG_ELEMENTS:()=>To,SVG_NAMESPACE:()=>ee,Show:()=>Cr,Switch:()=>Pr,VOID_ELEMENTS:()=>So,addClass:()=>No,addDelegatedEventListener:()=>Xn,addNativeEventListener:()=>kt,appendChildren:()=>qo,applyElementProp:()=>De,applyProps:()=>Dt,applyUse:()=>Pt,asComponent:()=>Et,asContext:()=>Rs,asOutlet:()=>As,asProvider:()=>Ns,asRoute:()=>Es,asRouter:()=>Ss,asRoutes:()=>Ts,asSuspense:()=>Cs,batch:()=>x,bindPair:()=>ei,captureHydrationCursor:()=>Bn,checkRenderType:()=>_s,classMap:()=>$r,cleanChildren:()=>U,cloneTemplate:()=>Yn,closest:()=>Ao,createComponent:()=>Ht,createComputed:()=>Tn,createContext:()=>Le,createDynamicElement:()=>ki,createEffect:()=>T,createElement:()=>Mo,createMemo:()=>m,createNativeElement:()=>Ot,createPortal:()=>Js,createRenderEffect:()=>b,createRequestContext:()=>ue,createResource:()=>Cn,createRoot:()=>k,createSignal:()=>g,createStore:()=>ht,createTemplate:()=>Jn,delegate:()=>Io,delegateEvents:()=>_t,effect:()=>kn,escapeFxJson:()=>Re,escapeHTML:()=>Zs,fnName:()=>Hs,generateID:()=>Ms,getAttribute:()=>Oo,getGlobal:()=>Xo,getLitEventName:()=>xo,getLocals:()=>zt,getOffset:()=>Lo,getRequestContext:()=>L,getRequestEvent:()=>nt,getRequestLocals:()=>rt,getServerData:()=>Ce,getStableElementId:()=>Ps,getStyle:()=>Po,handleRef:()=>Ae,hasClass:()=>_o,holeContent:()=>Vs,holeEnd:()=>Fs,holeScope:()=>Is,html:()=>Tr,hydrate:()=>ut,hydrateAdvancePast:()=>se,hydrateIslands:()=>Sr,indexArray:()=>He,initializeIntegration:()=>xi,insert:()=>$,insertExpression:()=>xe,intergartionInitialized:()=>vi,isAccessor:()=>Qs,isComponent:()=>M,isContext:()=>Vn,isCustomElement:()=>pn,isDOMNode:()=>Ko,isDelegatedEvent:()=>js,isDomElement:()=>ze,isDomNode:()=>X,isDomText:()=>Be,isEventHandler:()=>wo,isFunction:()=>$s,isIntegrationInitialized:()=>Si,isJSXTemplate:()=>Bo,isLitTemplateResult:()=>yn,isNativeElement:()=>Ys,isOutlet:()=>In,isPromise:()=>we,isProvider:()=>Fn,isReactElement:()=>Wo,isRoute:()=>Ln,isRouter:()=>jn,isRoutes:()=>$n,isSVGElement:()=>qt,isServer:()=>v,isSuspense:()=>Hn,isTemplateFactory:()=>zo,isVisible:()=>jo,iterateFn:()=>Us,keyArray:()=>Ve,makeArrayFlat:()=>Zn,mapArray:()=>Fe,memo:()=>On,mergeProps:()=>Gs,observeIntersection:()=>Vo,observeResize:()=>Ho,onCleanup:()=>S,query:()=>mt,queryAll:()=>Eo,registerCreateComponent:()=>wi,registerGlobal:()=>Go,removeAttribute:()=>ko,removeChildren:()=>Do,removeClass:()=>Ro,removeDelegatedEventListener:()=>Ct,render:()=>jt,renderToString:()=>nn,renderToStringAsync:()=>on,resetIntegration:()=>Ti,runHydrationAt:()=>be,runWithRequestContext:()=>ae,runWithoutHydration:()=>Kn,scrollIntoView:()=>$o,serializeNode:()=>D,serializeResourceData:()=>ct,setAttribute:()=>_,setClassList:()=>Te,setClassName:()=>Se,setDataRedactor:()=>rn,setDynamicAttribute:()=>Xe,setDynamicBoolAttribute:()=>Mt,setDynamicProperty:()=>Je,setProperty:()=>ve,setRequestStore:()=>Wt,setServerMode:()=>G,setStyle:()=>Ee,setStyles:()=>hn,shouldSetAsProperty:()=>vo,signal:()=>_n,splitProps:()=>Xs,spread:()=>Ks,store:()=>lo,styleMap:()=>Lr,svg:()=>Er,templateNode:()=>Ls,toAttributeName:()=>bo,toggleClass:()=>Co,untrack:()=>A,useContext:()=>xn,waitForElement:()=>Fo});function bo(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function wo(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function xo(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function vo(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),r={input:new Set(["value","checked","indeterminate"]),textarea:new Set(["value"]),select:new Set(["value"]),option:new Set(["selected","value"]),audio:new Set(["volume","currentTime","paused"]),video:new Set(["volume","currentTime","paused"]),img:new Set(["src","srcset"]),iframe:new Set(["src"]),a:new Set(["href"])};return n.has(t)||r[e]&&r[e].has(t)}var So=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),To=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),ee="http://www.w3.org/2000/svg";function pn(e){return e.localName.includes("-")}function De(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(pn(e)){e[t]=n;return}_(e,t,n,r)}var qe=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function mt(e,t=document){return t.querySelector(e)}function Eo(e,t=document){return Array.from(t.querySelectorAll(e))}function Ao(e,t){return e.closest(t)}function No(e,...t){e.classList.add(...t)}function Ro(e,...t){e.classList.remove(...t)}function Co(e,...t){t.forEach(n=>e.classList.toggle(n))}function _o(e,t){return e.classList.contains(t)}function _(e,t,n,r=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function Oo(e,t){return e.getAttribute(t)}function ko(e,t){e.removeAttribute(t)}function hn(e,t){Object.assign(e.style,t)}function Po(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function Mo(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,s])=>{if(o==="class"||o==="className")r.className=s;else if(o==="style"&&typeof s=="object")hn(r,s);else if(o.startsWith("on")&&typeof s=="function"){let i=o.slice(2).toLowerCase();r.addEventListener(i,s)}else _(r,o,s)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function Do(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function qo(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function jo(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function $o(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Lo(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function Io(e,t,n,r){let o=s=>{let i=s.target.closest(n);i&&e.contains(i)&&r(s,i)};return e.addEventListener(t,o),()=>{e.removeEventListener(t,o)}}function Fo(e,t=5e3){return new Promise((n,r)=>{let o=mt(e);if(o){n(o);return}let s=new MutationObserver(()=>{let a=mt(e);a&&(s.disconnect(),clearTimeout(i),n(a))});s.observe(document.body,{childList:!0,subtree:!0});let i=setTimeout(()=>{s.disconnect(),r(new Error(`Element ${e} not found within ${t}ms`))},t)})}function Vo(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(s=>{t(s.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function Ho(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Uo=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function Wo(e){return typeof e=="object"&&e!==null&&e.$$typeof===Uo}function yn(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function zo(e){if(typeof e!="function")return!1;try{let t=e();return yn(t)}catch{return!1}}function Bo(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Ko(e){return e instanceof Node}function Go(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function Xo(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}var Jo="__fluixi_signal_next_state__",Yo=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)},p=globalThis[Jo]??={consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:Yo,onSuspend:null,onError:null},mn=0,gn=1,ye=2,bn=class{constructor(){this.observers=null,this.watchers=null,this.version=0}updateIfNecessary(){}track(){if(p.untracked)return;let e=p.consumer;e&&((this.observers??=new Set).add(e),(e.sources??=new Set).add(this))}},Zo=class extends bn{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++,this.observers)for(let t of[...this.observers])t.markDirty(ye);bt(this)}}peek(){return this._value}},wn=class extends bn{constructor(e,t){super(),this._threw=!1,this._initialized=!1,this.state=ye,this.sources=null,this._fn=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){if(p.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===gn&&this.sources){for(let e of this.sources)if(e.updateIfNecessary(),this.state===ye)break}(this.state===ye||!this._initialized)&&this.recompute(),this.state=mn}recompute(){if(this.sources){for(let i of this.sources)i.observers?.delete(this);this.sources.clear()}let e=p.consumer,t=p.untracked;p.consumer=this,p.untracked=!1;let n,r=!1,o;try{n=this._fn()}catch(i){r=!0,o=i,n=this._value}finally{p.consumer=e,p.untracked=t}let s=!this._initialized||this._threw!==r||(r?o!==this._error:!this._equals(this._value,n));if(this._initialized=!0,this._threw=r,this._error=o,this._value=n,s){if(this.version++,this.observers)for(let i of[...this.observers])i.markDirty(ye);bt(this)}}markDirty(e){if(this.state>=e)return;let t=this.state===mn;if(this.state=e,t){if(this.observers)for(let n of[...this.observers])n.markDirty(gn);bt(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};function bt(e){if(e.watchers)for(let t of[...e.watchers])t._notify(e)}var Qo=class{constructor(e){this._watched=new Set,this._pending=new Set,this._notifyFn=e}watch(...e){for(let t of e)this._watched.add(t),(t.watchers??=new Set).add(this)}unwatch(...e){for(let t of e)this._watched.delete(t),t.watchers?.delete(this),this._pending.delete(t)}getPending(){let e=[...this._pending];return this._pending.clear(),e}_notify(e){if(!this._watched.has(e)||this._pending.has(e))return;let t=this._pending.size===0;this._pending.add(e),t&&this._notifyFn()}};function es(e){if(p.untracked)return e();p.untracked=!0;try{return e()}finally{p.untracked=!1}}function te(e){let t=$e(e);return e&&(e.owned??=[]).push(t),t}function ne(e,t=!0){me(e,t)}function $e(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function Le(e){let t=Symbol("context");return{id:t,defaultValue:e,Provider:n=>{let r=p.owner,o=$e(r);(o.contexts=new Map).set(t,n.value),r&&(r.owned??=[]).push(o),p.owner=o;try{return n.children}finally{p.owner=r}}}}function xn(e){let t=p.owner;for(;t;){if(t.contexts&&t.contexts.has(e.id))return t.contexts.get(e.id);t=t.parent}return e.defaultValue}function vn(e,t){let n=e;for(;n;){if(n.contexts&&n.contexts.has(t.id))return n.contexts.get(t.id);n=n.parent}return t.defaultValue}function ts(e){p.onSuspend=e}function ns(e){return p.onSuspend?(p.onSuspend(e,p.owner),!0):!1}function rs(e){p.onError=e}function I(){return p.owner}function O(e,t){let n=p.owner;p.owner=e;try{return t()}finally{p.owner=n}}function S(e){if(p.owner){if(p.owner.disposed){e();return}(p.owner.cleanups??=[]).push(e)}}function me(e,t=!0){if(!e.disposed){if(e.owned){for(let n=e.owned.length-1;n>=0;n--)me(e.owned[n]);e.owned=null}if(e.cleanups){for(let n=e.cleanups.length-1;n>=0;n--)e.cleanups[n]();e.cleanups=null}t&&(e.disposed=!0)}}function k(e){let t=$e(p.owner);p.owner&&(p.owner.owned??=[]).push(t);let n=p.owner;p.owner=t;try{return e(()=>me(t))}finally{p.owner=n}}function os(e){p.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function ss(e){e.queued||(e.queued=!0,p.queue.push(e),!p.scheduled&&p.batchDepth===0&&(p.scheduled=!0,p.hostSchedule(Ie)))}function Ie(){if(p.scheduled=!1,p.flushing)return;p.flushing=!0;let e=0;try{for(;p.queue.length;){if(++e>1e5)throw new Error("[fluixi] effect flush did not settle (cycle?)");let t=p.queue;p.queue=[];for(let n of t)n.queued=!1,n.disposed||n.run()}}finally{p.flushing=!1}}function is(){p.batchDepth===0&&Ie()}function us(e){p.batchDepth++;try{return e()}finally{--p.batchDepth===0&&Ie()}}var as=class{constructor(e){this.queued=!1,this.disposed=!1,this.owner=$e(p.owner),p.owner&&(p.owner.cleanups??=[]).push(()=>this.dispose()),this.computed=new wn(()=>{me(this.owner,!1),O(this.owner,()=>{let t=e();typeof t=="function"&&(this.owner.cleanups??=[]).push(t)})}),this.watcher=new Qo(()=>ss(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"&&p.onSuspend){p.onSuspend(e,this.owner);return}if(p.onError&&p.onError(e,this.owner))return;throw e}}}dispose(){this.disposed||(this.disposed=!0,this.watcher.unwatch(this.computed),me(this.owner))}};function Tt(e){let t=new as(e);return()=>t.dispose()}function ls(e){return!!e&&typeof e.then=="function"}os(()=>{});var Sn=Symbol.for("signal"),cs=Symbol.for("memo"),fs=Symbol.for("signal-node");function g(e,t){let n=new Zo(e,{equals:t?.equals}),r=(()=>n.get()),o=(s=>{let i=typeof s=="function"?s(n.peek()):s;return n.set(i),is(),i});return Object.defineProperty(r,Sn,{value:!0,enumerable:!0}),Object.defineProperty(r,fs,{value:{get value(){return n.peek()},get version(){return n.version}},enumerable:!1}),[r,o]}function m(e,t,n){let r=t,o=I(),s=new wn(()=>O(o,()=>{try{return r=e(r)}catch(a){if(ls(a))return ns(a),r;throw a}}),{equals:n?.equals}),i=(()=>s.get());return Object.defineProperty(i,Sn,{value:!0,enumerable:!0}),Object.defineProperty(i,cs,{value:!0,enumerable:!0}),i}function T(e,t){let n=t;return Tt(()=>{n=e(n)})}function Tn(e,t){let n=t;Tt(()=>{n=e(n)})}function b(e,t){let n=t;return Tt(()=>{n=e(n)})}function x(e){return us(e)}function A(e){return es(e)}function En(){return Ie(),Promise.resolve()}function Fe(e,t,n){let r=[];return S(()=>{for(let o of r)o.dispose();r=[]}),m(()=>{let o=e()||[];return A(()=>{if(o.length===0){for(let u of r)u.dispose();return r=[],n?.fallback?n.fallback():[]}let s=new Map;for(let u of r)s.has(u.item)||s.set(u.item,u);let i=[],a=new Set;for(let u=0;u<o.length;u++){let l=o[u],c=s.get(l);if(c&&!a.has(c))c.setIndex(u),i.push(c),a.add(c);else{let f,h,y;k(w=>{y=w;let[j,pe]=g(u);h=pe,f=t(l,j)});let N={item:l,rendered:f,dispose:y,setIndex:h};i.push(N),a.add(N)}}for(let u of r)a.has(u)||u.dispose();return r=i,i.map(u=>u.rendered)})})}function Ve(e,t,n,r){let o=[],s=[];return S(()=>{for(let i of s)i.dispose();o=[],s=[]}),m(()=>{let i=e()||[];return A(()=>{if(i.length===0){for(let f of s)f.dispose();return o=[],s=[],r?.fallback?r.fallback():[]}let a=new Map;for(let f=0;f<o.length;f++)a.set(o[f],s[f]);let u=[],l=[],c=new Set;for(let f=0;f<i.length;f++){let h=t(i[f]),y=a.get(h);if(y&&!c.has(h))y.setIndex(f),u.push(y);else{let N,w,j;k(pe=>{j=pe;let[B,he]=g(f);w=he;let Oe=m(Q=>(e()||[])[B()]??Q,i[f]);N=n(Oe,B)}),u.push({rendered:N,dispose:j,setIndex:w})}l.push(h),c.add(h)}for(let[f,h]of a)c.has(f)||h.dispose();return o=l,s=u,u.map(f=>f.rendered)})})}function He(e,t,n){let r=[];return S(()=>{for(let o of r)o.dispose();r=[]}),m(()=>{let o=e()||[];return A(()=>{if(o.length===0){for(let u of r)u.dispose();return r=[],n?.fallback?n.fallback():[]}let s=r.length,i=o.length;for(let u=s;u<i;u++){let l,c,f,h=o[u];k(y=>{f=y;let[N,w]=g(h);c=w,l=t(N,u)}),r.push({rendered:l,setItem:c,dispose:f})}for(let u=i;u<s;u++)r[u].dispose();i<s&&(r=r.slice(0,i));let a=Math.min(s,i);for(let u=0;u<a;u++)r[u].setItem(o[u]);return r.map(u=>u.rendered)})})}var ds=typeof window>"u"?!1:window.__FLUIXI_PROD__===!0,ps=typeof process>"u"?ds:!1,hs=Symbol.for("signal");function E(e){return typeof e=="function"&&e[hs]===!0}var wt=null;function An(e){wt=e}function ys(e){wt&&wt(e)}var xt=null;function Nn(e){xt=e}function ms(e){return xt?xt(e):void 0}var vt=null;function Ue(e){vt=e}function gs(){return vt?vt():void 0}var St=null;function Rn(e){St=e}function bs(e,t){St&&St(e,t)}function ws(e){return!!e&&typeof e.then=="function"}var gt=Symbol();function Cn(e,t,n={}){let r,o;typeof t=="function"?(r=typeof e=="function"?e:()=>e,o=t):(r=()=>!0,o=e,t&&typeof t=="object"&&(n=t));let s=n.transport===!1?void 0:gs(),i=s!==void 0?ms(s):void 0,a=i!==void 0,[u,l]=g(i!==void 0?i.value:n.initialValue,{equals:!1}),[c,f]=g(void 0,{equals:!1}),[h,y]=g(i!==void 0||n.initialValue!==void 0?"ready":"unresolved",{equals:!1}),[N,w]=g(void 0,{equals:!1}),[j,pe]=g(void 0,{equals:!1}),B=gt,he=!1;T(()=>{let R=r();if(j(),R===!1||R===null||R===void 0){B=gt,x(()=>{y("unresolved"),w(void 0),f(void 0)});return}let ke=he;if(he=!1,B!==gt&&R===B&&!ke)return;if(B=R,a){a=!1;return}let Pe=!1;S(()=>Pe=!0);let fn=A(h),co=A(u),dn=fn==="ready"||fn==="refreshing";x(()=>{y(dn?"refreshing":"pending"),f(void 0)});try{let K=o(R,{value:co,refetching:dn});ws(K)?(w(K),ys(K),K.then(Me=>{Pe||(s!==void 0&&bs(s,Me),x(()=>{l(()=>Me),y("ready"),w(void 0)}))},Me=>{Pe||x(()=>{f(Me),y("errored"),w(void 0)})})):x(()=>{l(()=>K),y("ready"),w(void 0)})}catch(K){if(Pe)return;x(()=>{f(K),y("errored"),w(void 0)})}});let Oe=()=>{let R=h();return R==="pending"||R==="refreshing"},Q=(()=>{let R=c();if(R)throw R;if(Oe()){let ke=N();if(ke)throw ke}return u()});return Object.defineProperties(Q,{state:{get:h},loading:{get:Oe},error:{get:c},latest:{get:u}}),Object.defineProperty(Q,Symbol.for("resource"),{value:!0,enumerable:!0}),Object.defineProperty(Q,Symbol.for("signal"),{value:!0,enumerable:!0}),[Q,{mutate:l,refetch:()=>{he=!0,pe(void 0)}}]}function je(e){if(typeof e=="function"&&!e.length){let t=e();return E(t)?t:je(t)}if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++){let r=je(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function We(e){let t=m(e);return ps?m(()=>je(t()),void 0,{name:"children"}):m(()=>je(t()))}var xs=Le();ts((e,t)=>{let n=vn(t,xs);n&&(n.increment(),e.finally(()=>n.decrement()))});var vs=Le();rs((e,t)=>{let n=vn(t,vs);return n?(n.setError(e),!0):!1});var re=Symbol.for("fluixi-proxy");function _n(e,t){let[n,r]=g(e,t);return Object.assign(n,{set:r})}function On(e,t,n){return m(e,t,n)}function kn(e,t){return T(e,t)}var Pn="1.0.0-alpha.81";var Mn="1.0.0-alpha.81";var P={dom:Pn,reactive:Mn};function Dn(e){P.core&&e.setAttribute("fluixi",P.core),e.setAttribute("fx-dom",P.dom),e.setAttribute("fx-reactive",P.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=P)}function qn(){let e=[P.core,P.dom,P.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${P.core??"(absent)"}, dom ${P.dom}, reactive ${P.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 Ss(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function Ts(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function Es(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function As(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function Ns(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function Rs(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function Et(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function Cs(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function jn(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function $n(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function Ln(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function In(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function Fn(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function Vn(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function M(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function Hn(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function _s(e){return jn(e)?{type:"router",value:e}:Ln(e)?{type:"route",value:e}:$n(e)?{type:"routes",value:e}:In(e)?{type:"outlet",value:e}:M(e)?{type:"component",value:e}:Hn(e)?{type:"suspense",value:e}:Fn(e)?{type:"provider",value:e}:Vn(e)?{type:"context",value:e}:{type:"none",value:e}}var v=typeof document>"u";function G(e){v=e}var ge=Symbol.for("fluixi.server-node"),At=null;function Un(e){At=e}function oe(){if(!At)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return At}function X(e){return e!=null&&e[ge]===!0?!0:typeof Node<"u"&&e instanceof Node}function ze(e){return e!=null&&e[ge]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Be(e){return e!=null&&e[ge]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var d={active:!1,cursor:null,parents:[]},Wn=null;function zn(e){Wn=e}function Ke(){return Wn}function Nt(e,t){return d.active&&t.parentNode===e}function Rt(e){let t=d.parents.lastIndexOf(e);t!==-1&&(d.parents.length=t),d.cursor=e.nextSibling}function Bn(){return d.active?d.cursor:null}function be(e,t){if(!e||e.parentNode==null)return t();let n=d.active,r=d.cursor,o=d.parents;d.active=!0,d.cursor=e,d.parents=[];try{return t()}finally{d.active=n,d.cursor=r,d.parents=o}}function Kn(e){if(!d.active)return e();let t=d.cursor,n=d.parents;d.active=!1,d.parents=[];try{return e()}finally{d.active=!0,d.cursor=t,d.parents=n}}function se(e){if(!d.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Rt(t)}function Os(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let r=0,o=e;for(;o=o.previousElementSibling;)o.tagName===e.tagName&&r++;n+=`:nth-of-type(${r+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function ks(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return`el_${Math.abs(t)}`}function Ps(e){return ks(Os(e))}var Ms=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Ds={};var Gn=new Map,Ge=new Set,Ye=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function _t(e){if(!v)for(let t of e)Ge.has(t)||Ye.has(t)||(Ge.add(t),document.addEventListener(t,qs))}function qs(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let r=n[t];if(r&&!n.disabled&&(r(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function Xn(e,t,n){if(e[`$$${t}`]=n,Ye.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=s=>{e[`$$${t}`]?.(s)};e.addEventListener(t,o),e[r]=o}return}Ge.has(t)||_t([t])}function Ct(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function js(e){return!Ye.has(e)}function $s(e){return typeof e=="function"}function W(e,t=!1){if(v)return oe().createText(e);if(d.active&&!t){let n=Ke()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function Ot(e,t=!1){if(v)return oe().createElement(e,t);if(d.active){let n=Ke()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(ee,e):document.createElement(e)}function Jn(e,t=!1){let n=Gn.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,Gn.set(e,r),r}function Ls(e,t,n=!1,r=!1){if(v){let o=oe();return n?o.parseTemplate(e,r):o.createRaw(e)}if(d.active){let o=Ke()?.hydrateStatic(t);if(o)return o}return Yn(Jn(e,r),r).firstChild}function Is(e,t){if(!d.active)return t();let n=be(e.nextSibling,t);if(typeof n=="function"){let r=n;return((...o)=>d.active?be(e.nextSibling,()=>r(...o)):r(...o))}return n}function Fs(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 Vs(e,t){let n=[];for(let r=e.nextSibling;r&&r!==t;r=r.nextSibling)n.push(r);return n}function Yn(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function Zn(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Zn(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Hs(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Us(e){if(E(e)||M(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!E(t)&&!M(t);)t=t();return t}var V=0,Ws=200;function zs(e,t,n,r,o){let s=r,i=new Map;return b(()=>{let a;if(M(e)&&!E(e)){if(!i.has(e)){V++;try{let u=e();i.set(e,u)}finally{V--}}for(a=i.get(e);typeof a=="function"&&E(a);)a=a()}else for(a=e();typeof a=="function"&&E(a);)a=a();{let u=0;for(;typeof a=="function"&&u++<50;)if(M(a)){if(!i.has(a)){let l=a;V++;try{let c=l();i.set(l,c)}finally{V--}}a=i.get(a)}else if(E(a))a=a();else if(a=a(),typeof a!="function"||!E(a)&&!M(a))break}V++;try{s=xe(t,a,n,s,i),o(s)}finally{V--}})}function $(e,t,n,r){if(V>Ws)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=W("",!0),e.appendChild(n));let o=r??null,s=u=>Array.isArray(u)&&u.some(l=>typeof l=="function"),i=u=>typeof u=="function"?u:()=>u;if(typeof t!="function"&&!s(t)){V++;try{o=xe(e,t,n,o)}finally{V--}return()=>o}let a=zs(i(t),e,n,o,u=>{o=u});return()=>(a?.(),o)}function xe(e,t,n,r,o){if(t==null||typeof t=="boolean")return U(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return U(e,r,n);if(we(t)){let i=W("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(i,r[0]),U(e,r.slice(1),n)):C(e,i,n):r?e.replaceChild(i,r):C(e,i,n),t.then(a=>{i.parentNode===e&&xe(e,a,i.nextSibling,i)}).catch(a=>{console.error("Error resolving promise in insertExpression:",a)}),i}let s=typeof t;if(s==="string"||s==="number"){if(s==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let a=W(t);return C(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=U(e,r,n)}if(r&&Be(r))return r.data=t,r;let i=W(t);return r&&r.parentNode===e?e.replaceChild(i,r):Nt(e,i)||C(e,i,n),i}if(X(t))return Nt(e,t)?(Rt(t),t):Array.isArray(r)?(r.length===0?C(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),U(e,r.slice(1),n)):C(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):C(e,t,n)):C(e,t,n),t);if(Array.isArray(t)){let i=[],a=Array.isArray(r)?r:r?[r]:[],u=[];F(t,i,e,n,!0,o,u);let l=Bs(e,a,i,n);for(let c of u){let f=$(e,c.sig,c.marker);S(()=>{U(e,f()),c.marker.parentNode===e&&e.removeChild(c.marker)})}return l}if(s==="object"&&t!==null&&typeof t=="object"){let i=t;if("type"in i&&"props"in i){let a=i;if(typeof a.type=="function"){let u=a.type(a.props||{});return xe(e,u,n,r)}}}return U(e,r,n)}function F(e,t,n,r,o=!0,s,i){for(let a=0;a<e.length;a++){let u=e[a];if(!(u==null||typeof u=="boolean")){for(;typeof u=="function"&&!we(u)&&!E(u)&&!M(u)&&(u=u(),!(u==null||typeof u=="boolean")););if(!(u==null||typeof u=="boolean")){if(typeof u=="function"){let l;for(M(u)&&!E(u)?(s||(s=new Map),s.has(u)||s.set(u,u()),l=s.get(u)):l=u();typeof l=="function"&&!we(l)&&!E(l)&&!M(l);)s||(s=new Map),s.has(l)||s.set(l,l()),l=s.get(l);if(l==null||typeof l=="boolean")continue;if(typeof l=="function"){if(E(l)){if(i){let f=W("",!0);t.push(f),i.push({marker:f,sig:l});continue}let c=l();for(;typeof c=="function"&&E(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?F(c,t,n,r,o,s):F([c],t,n,r,o,s);continue}continue}Array.isArray(l)?F(l,t,n,r,o,s,i):F([l],t,n,r,o,s,i);continue}if(we(u)){let l=W("",!0);t.push(l),u.then(c=>{if(l.parentNode){let f=[];if(F([c],f,l.parentNode,void 0,!1,s),f.length>0){l.parentNode.replaceChild(f[0],l);for(let h=1;h<f.length;h++)l.parentNode?.insertBefore(f[h],f[h-1].nextSibling)}}}).catch(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(u)){F(u,t,n,r,o,s,i);continue}if(X(u)){t.push(u);continue}if(typeof u=="object"&&u!==null&&"type"in u&&"props"in u){let l=u;if(typeof l.type=="function"){let c=l.type(l.props||{});Array.isArray(c)?F(c,t,n,r,!1,s):F([c],t,n,r,!1,s);continue}}if(typeof u=="string"||typeof u=="number"){let l=String(u);if(l.trim()===""&&l!==" ")continue;t.push(W(l));continue}t.push(W(String(u)))}}}}function Bs(e,t,n,r){for(let f=0;f<n.length;f++){let h=n[f].parentNode;h!==null&&h!==e&&h.nodeType!==11&&(n=n.slice(),n[f]=n[f].cloneNode(!0))}let o=n.length,s=t.length,i=o,a=0,u=0,l=s>0?t[s-1].nextSibling??void 0:r,c=null;for(;a<s||u<i;){if(t[a]===n[u]){a++,u++;continue}for(;s>a&&i>u&&t[s-1]===n[i-1];)s--,i--;if(s===a){let f=i<o?u?n[u-1].nextSibling??void 0:n[i-u]:l;for(;u<i;)C(e,n[u++],f)}else if(i===u)for(;a<s;)(!c||!c.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[i-1]&&n[u]===t[s-1]){let f=t[--s].nextSibling;C(e,n[u++],t[a++].nextSibling),C(e,n[--i],f),t[s]=t[a-1]}else{if(!c){c=new Map;let h=u;for(;h<i;)c.set(n[h],h++)}let f=c.get(t[a]);if(f!=null)if(u<f&&f<i){let h=a,y=1;for(;++h<s&&h<i&&!(!c.has(t[h])||c.get(t[h])!==f+y);)y++;if(y>f-u){let N=t[a];for(;u<f;)C(e,n[u++],N)}else t[a].parentNode===e?e.replaceChild(n[u++],t[a++]):(C(e,n[u++],l),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function U(e,t,n){if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r].parentNode===e&&e.removeChild(t[r]);else t.parentNode===e&&e.removeChild(t);return null}function C(e,t,n){d.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function ve(e,t,n){n==null?delete e[t]:e[t]=n}function kt(e,t,n){let r=n,o;return Array.isArray(n)&&(r=n[0],o=n[1]),typeof r!="function"?()=>{}:(e.addEventListener(t,r,o),()=>e.removeEventListener(t,r,o))}function Pt(e,t){let n=(r,o)=>{typeof r=="function"&&r(e,o??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let r of t)Array.isArray(r)?n(r[0],r[1]):n(r)}}function Xe(e,t,n,r=!1){return typeof n!="function"?(_(e,t,n,r),()=>{}):b(()=>{let o=typeof n=="function"?n():n;_(e,t,o,r)})}function Je(e,t,n){return typeof n!="function"?(ve(e,t,n),()=>{}):b(()=>{let r=typeof n=="function"?n():n;ve(e,t,r)})}function Mt(e,t,n){return typeof n!="function"?(_(e,t,!!n),()=>{}):b(()=>{let r=n();_(e,t,!!r)})}function Se(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){b(()=>Se(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(r=>{let o=t[r];return typeof o=="function"?o():!!o}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function Te(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],s=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push(b(()=>{let i=!!o();for(let a of s)e.classList.toggle(a,i)}));else{let i=!!(typeof o=="function"?o():o);for(let a of s)e.classList.toggle(a,i)}}}function Ee(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let r in n){let o=n[r];o==null?e.style[r]="":e.style[r]=o}}function Ks(e){let{element:t,props:n,prevProps:r=Ds,isSVG:o=!1,skipChildren:s=!1}=e;if(!t||!ze(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let i=o||t.namespaceURI===ee,a=[];for(let u in n){if(s&&u==="children")continue;let l=n[u],c=r[u];if(l===c)continue;if(u==="ref"){Ae(l,t);continue}if(u==="use"){Pt(t,l);continue}if(u.startsWith("on:")){a.push(kt(t,u.slice(3),l));continue}if(u.startsWith("prop:")){a.push(Je(t,u.slice(5),l));continue}if(u.startsWith("attr:")){a.push(Xe(t,u.slice(5),l,i));continue}if(u.startsWith("bool:")){a.push(Mt(t,u.slice(5),l));continue}if(u==="class"||u==="className"){typeof l=="function"?a.push(b(()=>Se(t,l()))):Se(t,l);continue}if(u==="classList"){typeof l=="function"?a.push(b(()=>Te(t,l()))):Te(t,l,a);continue}if(u==="style"){typeof l=="function"?a.push(b(()=>Ee(t,l()))):Ee(t,l);continue}if(u.startsWith("on")){let h=u.slice(2).toLowerCase();c&&Ct(t,h),l&&Xn(t,h,l);continue}let f=qe.has(u)||!i&&u in t;typeof l=="function"?a.push(f?Je(t,u,l):Xe(t,u,l,i)):a.push(b(()=>f?ve(t,u,n[u]):_(t,u,n[u],i)))}for(let u in r)if(!(u in n))if(u.startsWith("on")){let l=u.slice(2).toLowerCase();Ct(t,l)}else qe.has(u)?ve(t,u,null):t.removeAttribute(u);return()=>{a.forEach(u=>u())}}function Dt(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){Ae(o,e);continue}if(r!=="children"){if(r==="use"){Pt(e,o);continue}if(r.startsWith("on:")){kt(e,r.slice(3),o);continue}if(r.startsWith("prop:")){Je(e,r.slice(5),o);continue}if(r.startsWith("attr:")){Xe(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){Mt(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let s=r.slice(2).toLowerCase();if(typeof o=="function")if(Ye.has(s)){e[`$$${s}`]=o;let i=`__fx_${s}`;if(!e[i]){let a=u=>{e[`$$${s}`]?.(u)};e.addEventListener(s,a),e[i]=a}}else e[`$$${s}`]=o,Ge.has(s)||_t([s]);continue}if(r==="class"||r==="className"){Se(e,o);continue}if(r==="classList"){typeof o=="function"?b(()=>Te(e,o())):Te(e,o);continue}if(r==="style"){typeof o=="function"?b(()=>Ee(e,o())):Ee(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let s=T(()=>{let i=o();for(;typeof i=="function";)i=i();e.innerHTML=i});S(()=>s())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let s=T(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();document.activeElement!==e&&(e.value=i??"")});S(()=>{s()})}else b(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let s=T(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();document.activeElement!==e&&(e.checked=i??"")});S(()=>{s()})}else b(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let s=!0,i=T(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();s?(s=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});S(()=>{i()})}else{let s=!0;b(()=>{let i=t[r];s?(s=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""})}continue}if(typeof o=="function"){let s=T(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();De(e,r,i,n)});S(()=>{s()})}else b(()=>De(e,r,t[r],n))}}}function Gs(...e){let t=r=>{for(let o=e.length-1;o>=0;o--){let s=e[o];if(s&&r in s&&s[r]!==void 0)return s[r]}},n=r=>{for(let o of e)if(o&&r in o)return!0;return!1};return new Proxy({},{get:(r,o)=>t(o),has:(r,o)=>n(o),ownKeys:()=>{let r=new Set;for(let o of e)if(o)for(let s of Reflect.ownKeys(o))r.add(s);return[...r]},getOwnPropertyDescriptor:(r,o)=>n(o)?{enumerable:!0,configurable:!0,get:()=>t(o)}:void 0})}function Xs(e,...t){let n=new Set;for(let i of t)for(let a of i)n.add(a);let r=i=>({enumerable:!0,configurable:!0,get:()=>e[i]}),o=t.map(i=>{let a=new Set(i);return new Proxy({},{get:(u,l)=>a.has(l)?e[l]:void 0,has:(u,l)=>a.has(l)&&l in e,ownKeys:()=>Array.from(a).filter(u=>u in e),getOwnPropertyDescriptor:(u,l)=>a.has(l)&&l in e?r(l):void 0})}),s=new Proxy({},{get:(i,a)=>n.has(a)?void 0:e[a],has:(i,a)=>!n.has(a)&&a in e,ownKeys:()=>Reflect.ownKeys(e).filter(i=>!n.has(i)),getOwnPropertyDescriptor:(i,a)=>!n.has(a)&&a in e?r(a):void 0});return[...o,s]}function Ae(e,t){if(e){if(X(e)){let n=t,r=e;if(!n)return;typeof n=="function"?n(r):typeof n=="object"&&"current"in n&&(n.current=r);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function Js(e,t,n){let r=t||document.body,o=We(()=>e),s=[];return x(()=>{let i=b(()=>{let a=o();Array.isArray(a)?(a.forEach(u=>r.appendChild(u)),s.push(()=>{a.forEach(u=>{u.parentNode===r&&r.removeChild(u)})})):X(a)&&(r.appendChild(a),s.push(()=>{a.parentNode===r&&r.removeChild(a)}))});s.push(i),S(()=>{s.forEach(a=>a())})}),null}function Ys(e){return typeof e=="string"&&e.toLowerCase()===e}function qt(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 Zs(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function we(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Qs(e){return typeof e=="function"&&e.length===0&&E(e)}function jt(e,t,n){if(!t)throw new Error("Container element is required");let r,o,s=[];return k(i=>{x(()=>{d.active||(t.textContent=""),Dn(t),qn(),$(t,e)}),o=i}),()=>{o?.(),r?.(),s.forEach(i=>i()),t.textContent=""}}function ei(e){if(Array.isArray(e))return e;if(typeof e=="function"&&typeof e.set=="function")return[e,e.set];throw new TypeError("[fluixi] bind: needs a signal — either `signal(…)` or the `[get, set]` pair from `createSignal(…)`.")}var ti="__fluixi_signal_next_state__",ni=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)},H=globalThis[ti]??={consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:ni,onSuspend:null,onError:null};function ri(e){if(H.untracked)return e();H.untracked=!0;try{return e()}finally{H.untracked=!1}}function oi(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function lr(e){let t=Symbol("context");return{id:t,defaultValue:e,Provider:n=>{let r=H.owner,o=oi(r);(o.contexts=new Map).set(t,n.value),r&&(r.owned??=[]).push(o),H.owner=o;try{return n.children}finally{H.owner=r}}}}function cr(e,t){let n=e;for(;n;){if(n.contexts&&n.contexts.has(t.id))return n.contexts.get(t.id);n=n.parent}return t.defaultValue}function si(e){H.onSuspend=e}function ii(e){H.onError=e}function ui(e){H.hostSchedule=e??(t=>{Promise.resolve().then(t)})}ui(()=>{});function fr(e){return ri(e)}var vu=typeof window>"u"?!1:window.__FLUIXI_PROD__===!0;var ai=Symbol.for("signal");function dr(e){return typeof e=="function"&&e[ai]===!0}var li=lr();si((e,t)=>{let n=cr(t,li);n&&(n.increment(),e.finally(()=>n.decrement()))});var ci=lr();ii((e,t)=>{let n=cr(t,ci);return n?(n.setError(e),!0):!1});var Lt=Symbol("store-raw"),Qn=Symbol("store-node"),er=Symbol("store-has"),tr=Symbol("store-self"),nr=Symbol("store-track");var rr=new WeakMap,or=new WeakMap;function pr(e){let[t,n]=g(e),r=t;return r.$=n,r}function Qe(e){let t=rr.get(e);return t||rr.set(e,t={keys:new Map}),t}function sr(e,t,n){let r=e.keys.get(t);return r||e.keys.set(t,r=pr(n)),r}function ir(e){let t=Qe(e);(t.all||(t.all=pr()))()}function ur(e,t){e.$(typeof t=="function"?()=>t:t)}function hr(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 Ze(e){if(!hr(e))return e;let t=or.get(e);if(t)return t;let n=new Proxy(e,fi);return or.set(e,n),n}var fi={get(e,t,n){if(t===Lt||t===Qn)return e;if(t===re)return n;if(t===er)return i=>i in e;if(t==="__proxy")return!0;if(t===nr||t===tr)return ir(e),n;let r=e[t];if(typeof r=="function"&&!Object.prototype.hasOwnProperty.call(e,t))return r;let o=Object.getOwnPropertyDescriptor(e,t);if(o&&o.get)return o.get.call(n);let s=sr(Qe(e),t,r)();return hr(s)?Ze(s):s},set(){return!0},deleteProperty(e,t){return t in e&&Ne(e,t,void 0),!0},has(e,t){return t===Lt||t===re||t===Qn||t===er||t===tr||t===nr?!0:(sr(Qe(e),t,e[t])(),t in e)},ownKeys(e){return ir(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e,t)}};function Ne(e,t,n){if(e[t]===n&&(n!==void 0||t in e))return;let r=Array.isArray(e),o=r?e.length:0;n===void 0?delete e[t]:e[t]=n;let s=Qe(e),i=s.keys.get(t);if(i&&ur(i,n),r&&e.length!==o){let a=s.keys.get("length");a&&ur(a,e.length)}s.all&&s.all.$(void 0)}function ar(e,t){return typeof e=="function"?e(t):e}function It(e,t){for(let n of Object.keys(t)){let r=t[n],o=e[n];r&&typeof r=="object"&&!Array.isArray(r)&&o&&typeof o=="object"&&!Array.isArray(o)?It(o,r):Ne(e,n,r)}}function Vt(e){let t=[],n=e.replace(/\[([^\]]*)\]/g,".$1");for(let r of n.split("."))r.length&&t.push(r);return t}function yr(e,t,n){let r=t.length-1;for(let s=0;s<r;s++){let i=t[s];if(i==="*"){let u=t.slice(s+1);if(Array.isArray(e))for(let l=0;l<e.length;l++)yr(e[l],u,n);return}let a=e[i];(a==null||typeof a!="object")&&(a=/^\d+$/.test(t[s+1])?[]:{},Ne(e,i,a)),e=a}let o=t[r];if(o==="*"){if(Array.isArray(e))for(let s=0;s<e.length;s++)Ne(e,s,ar(n,e[s]));return}Ne(e,o,ar(n,e[o]))}function $t(e,t,n){yr(e,Vt(t),n)}function di(e,t){let n=t[0];if(typeof n=="function"&&t.length===1){let r=n(e);r&&r!==e&&It(e,r);return}if(Array.isArray(n)&&t.length===1){for(let r of n)Array.isArray(r)&&$t(e,r[0],r[1]);return}if(n&&typeof n=="object"&&!Array.isArray(n)&&t.length===1){It(e,n);return}if(Array.isArray(t[1])&&t.length>=3){$t(e,`${n}.${t[1].join(".")}`,t[2]);return}$t(e,String(n),t[1])}function Ft(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(Ft);let t={};for(let n of Object.keys(e))t[n]=Ft(e[n]);return t}function ie(e,t){let n=e;for(let r of Vt(t)){if(n==null)return;n=n[r]}return n}var mr=class{constructor(e,t={immutable:!0}){this.options=t,this.root=e,this.set=((...n)=>x(()=>di(this.root,n)))}get state(){return Ze(this.root)}get proxy(){return Ze(this.root)}get accessor(){return(()=>Ze(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 n of Vt(e)){if(t==null)return;t=t[n]}return et(t)}select(e){return m(()=>e(this.state))}subscribe(e){return T(()=>e(this.state))}watch(e,t){let n;return T(()=>{let r=e(this.state);Object.is(r,n)||(t(r,n),n=r)})}reactive(e){return m(()=>this.state[e])}produce(e){this.set((t=>{let n=Ft(t);return e(n),n}))}reconcile(e,t={}){this.set(e)}push(e,...t){let n=ie(this.root,e);this.set(e,n.concat(t))}pop(e){let t=ie(this.root,e).slice(),n=t.pop();return this.set(e,t),n}shift(e){let t=ie(this.root,e).slice(),n=t.shift();return this.set(e,t),n}splice(e,t,n,...r){let o=ie(this.root,e).slice(),s=o.splice(t,n,...r);return this.set(e,o),s}insert(e,t,n){let r=ie(this.root,e).slice();r.splice(t,0,n),this.set(e,r)}removeAt(e,t){let n=ie(this.root,e).slice(),r=n.splice(t,1);return this.set(e,n),r}toObservable(){let[e]=g(this.state);return e.toObservable()}dispose(){}},pi=["get","select","watch","subscribe","produce","reconcile","push","pop","shift","splice","insert","removeAt","unwrap","toObservable"];function hi(e,t){for(let n of pi)e[n]=t[n].bind(t);e.$=t.reactive.bind(t)}function yi(e,t={immutable:!0}){let n=new mr(e,t);return hi(n.set,n),[n.proxy,n.set]}function mi(e,t={}){return new mr(e,{...t,immutable:!1})}function et(e){if(e==null||typeof e!="object")return e;let t=e[Lt];return t!==void 0?t:e}function gi(e){return A(()=>et(e))}var Tu=Object.freeze({createStore:yi,createMutableStore:mi,batch:x,unwrap:et,untrackStore:gi});var bi="__fx_dom_create_component__",J=globalThis[bi]??={fn:null};function wi(e){J.fn=e}function xi(e={}){let t=e.signalSystem?.createComponent;t&&(J.fn=t)}function Ht(e,t){if(J.fn)return J.fn(e,t);let n=typeof e=="function"?fr(()=>e(t)):e;if(n!=null&&(typeof n=="function"||typeof n=="object")&&!dr(n)){try{n.$name=e?.name}catch{}return Et(n)}return n}var vi=()=>J.fn!==null,Si=()=>J.fn!==null;function Ti(){J.fn=null}var tt,br={getStore:()=>tt,run(e,t){let n=tt;tt=e;try{return t()}finally{tt=n}}},Ut=br;function Wt(e){Ut=e??br}function ue(e={}){e.locals||(e.locals=e.request?rt(e.request):{});let t=0,n=0,r=null,o=new Map,s=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${t++}`,nextResourceId:()=>{if(r===null)return`r${n++}`;let i=o.get(r)??0;return o.set(r,i+1),`${r}:r${i}`},nextIslandNamespace:i=>{let a=s.get(i)??0;return s.set(i,a+1),`${i}#${a}`},withResourceScope(i,a){let u=r;r=i;try{return a()}finally{r=u}},pending:new Set,data:new Map}}function ae(e,t){return Ut.run(e,t)}function L(){return Ut.getStore()}function nt(){return L()?.event}function zt(){let e=nt();return e?(e.locals||(e.locals={}),e.locals):{}}var gr=new WeakMap;function rt(e){let t=gr.get(e);return t||(t={},gr.set(e,t)),t}var le="__FX_DATA__";function Re(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var Bt;function Ce(){let e=globalThis.__FX_DATA__;if(e)return e;if(Bt!==void 0)return Bt;let t=null;if(typeof document<"u"){let n=document.getElementById(le)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return Bt=t}function ot(){for(;;){for(;d.cursor&&d.cursor.nodeType===3&&d.cursor.data==="";)d.cursor=d.cursor.nextSibling;if(d.cursor!=null||!d.parents.length)return;d.cursor=d.parents.pop().nextSibling}}var Ei=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),st=typeof process<"u"&&process.env&&!1;function it(e,t){let n=t.nodeType===1?`<${t.tagName.toLowerCase()}>`:t.nodeType===3?`text ${JSON.stringify((t.nodeValue??"").slice(0,24))}`:t.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${n}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function Ai(e){ot();let t=d.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Ei.has(e.toLowerCase())?d.cursor=t.nextSibling:(d.parents.push(t),d.cursor=t.firstChild),t):(st&&t&&it(`<${e}>`,t),null)}function Ni(e){ot();let t=d.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(d.cursor=t.nextSibling,t):(st&&t&&it(`<${e}> (static)`,t),null)}function Ri(e){if(e===""){let n=d.cursor;return n&&n.nodeType===3&&n.data!==""?(d.cursor=n.nextSibling,n.data="",n):null}ot();let t=d.cursor;return t&&t.nodeType===3?(d.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(st&&t&&it(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Ci(e){ot();let t=d.cursor;return t&&t.nodeType===8&&t.data===e?(d.cursor=t.nextSibling,t):(st&&t&&it(`marker <!--${e.slice(0,24)}-->`,t),null)}var wr=!1;function _i(){wr||(wr=!0,zn({hydrateElement:Ai,hydrateText:Ri,hydrateMarker:Ci,hydrateStatic:Ni}))}function ut(e,t,n){_i(),d.active=!0,d.cursor=t.firstChild,d.parents=[];let r=Ce(),o=n?.resourceNamespace,s=0;Ue(()=>o?`${o}:r${s++}`:`r${s++}`),Nn(r?i=>i in r?{value:r[i]}:void 0:null);try{return jt(e,t)}finally{d.active=!1,d.cursor=null,d.parents=[]}}var Kt="fluixi-island";function vr(e){let{component:t,props:n={},name:r}=e,o=Ot(Kt),s=r??t.name??"Island";_(o,"name",s),_(o,"props",JSON.stringify(n??{}));let i=v?L():void 0;if(i){let a=i.nextIslandNamespace(s);$(o,()=>i.withResourceScope(a,()=>t(n)))}else $(o,()=>t(n));return o}var xr=!1;function Oi(){if(xr||typeof document>"u")return;xr=!0;let e=document.createElement("style");e.textContent=`${Kt}{display:contents}`,document.head.appendChild(e)}function Sr(e){if(typeof document>"u")return;Oi();let t=document.querySelectorAll(Kt),n=new Map;t.forEach(r=>{let o=r.getAttribute("name")??"",s=n.get(o)??0;n.set(o,s+1);let i=e[o];if(!i){typeof process>"u"&&console.warn(`[fluixi] island "${o}" has no component in the registry — left static.`);return}let a={};try{a=JSON.parse(r.getAttribute("props")||"{}")}catch{}ut(()=>i(a),r,{resourceNamespace:`${o}#${s}`})})}function Tr(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function Er(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function ki(e,t={}){if(typeof e=="function")return Ht(e,t);if(typeof e!="string"||e.length===0)return null;let n=qt(e);if(v)return oe().createElement(e,n);let r=n?document.createElementNS(ee,e):document.createElement(e);return Dt(r,t,n),Pi(r,t),r}function Pi(e,t){if(!t||t.children===void 0)return;let n=We(()=>t.children),r=o=>{$(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}function Ar(e){return typeof e=="function"?e:(()=>e)}function z(e){return()=>{let t=e();return typeof t=="function"?t():t}}function Nr(e){return e!=null&&e!==!1}function Rr(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function Cr(e){let t=z(()=>e.when),n=m(t,void 0),r=m(n,void 0),o=I(),s=null,i=null,a=u=>{u!==i&&(s&&ne(s),s=te(o),i=u)};return m(()=>{let u=r();return a(u?"when":"fallback"),O(s,()=>{if(u){let l=e.children;return typeof l=="function"&&!Rr(l)?typeof n=="function"?A(()=>A(n)?l(n()):e.fallback):l(n):l}return e.fallback});return e.fallback??null},void 0,{name:"show"})}function _r(e){let t=z(()=>e.each),n=()=>e.fallback??null,r=(o,s)=>{let i=e.children,a=Array.isArray(i)?i.map(u=>typeof u=="function"?u(o,s):u):typeof i=="function"?i(o,s):i;return se(a),a};return e.by?Ve(t,e.by,(o,s)=>r(o,s),{fallback:n}):Fe(t,(o,s)=>r(o,s),{fallback:n})}function Or(e){let t=z(()=>e.each);return He(t,(n,r)=>{let o=e.children(n,r);return se(o),o},{fallback:()=>e.fallback??null})}var Gt=Symbol("match");function kr(e){return{[Gt]:!0,when:z(()=>e.when),get children(){return e.children}}}function Pr(e){let t=Array.isArray(e.children)?e.children:[e.children],n=I(),r=null,o=-1,s=i=>{i!==o&&(r&&ne(r),r=te(n),o=i)};return m(()=>{for(let i=0;i<t.length;i+=1){let u=t[i],l=0;for(;typeof u=="function"&&!u[Gt]&&l++<10;)u=u();if(!u||typeof u!="object"||u[Gt]!==!0)continue;let c=u.when();if(Nr(c))return s(i),O(r,()=>typeof u.children=="function"?u.children(c):u.children)}return s(-2),O(r,()=>e.fallback??null)})}function Mr(e){let t=Ar(e.component),{component:n,...r}=e,o=I(),s=null,i;return m(()=>{let a=t();return a!==i&&(s&&ne(s),s=te(o),i=a),a==null?null:typeof a=="string"?{tag:a,props:r}:O(s,()=>a(r))})}function Dr(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return k(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),$(r,e.children)&&Ae(e.ref,r)}),S(()=>{n(),r.remove()}),null}function Xt(e){if(v)return e.fallback??null;let t=d.active,[n,r]=g(!t);return t&&queueMicrotask(()=>r(!0)),m(()=>n()?e.children:e.fallback??null,void 0,{name:"client-only"})}var qr=Xt;function jr(e){let[t,n]=g(null),r=()=>n(null);return m(()=>{let o=t();if(o!==null)return typeof e.fallback=="function"?e.fallback(o,r):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(s){return n(s),typeof e.fallback=="function"?e.fallback(s,r):e.fallback}})}function $r(e){return m(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;(typeof o=="function"?o():o)&&n.push(r)}return n.join(" ")})}function Mi(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Lr(e){return m(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;let s=typeof o=="function"?o():o;s!=null&&n.push(`${Mi(r)}: ${s}`)}return n.join("; ")})}var lt=1,Zt=3,Qt=8,Ir;Ir=ge;var ce=class{constructor(){this[Ir]=!0;this.parentNode=null;this.childNodes=[]}get firstChild(){return this.childNodes[0]??null}get lastChild(){return this.childNodes[this.childNodes.length-1]??null}get nextSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>=0?t.childNodes[n+1]??null:null}get previousSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>0?t.childNodes[n-1]??null:null}get parentElement(){return this.parentNode}appendChild(t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes.push(t),t}insertBefore(t,n){if(n==null)return this.appendChild(t);t.parentNode&&t.parentNode.removeChild(t);let r=this.childNodes.indexOf(n);return t.parentNode=this,r<0?this.childNodes.push(t):this.childNodes.splice(r,0,t),t}removeChild(t){let n=this.childNodes.indexOf(t);return n>=0&&this.childNodes.splice(n,1),t.parentNode=null,t}replaceChild(t,n){let r=this.childNodes.indexOf(n);return r>=0&&(t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes[r]=t,n.parentNode=null),n}addEventListener(){}removeEventListener(){}},Y=class e extends ce{constructor(n){super();this.nodeType=Zt;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}get textContent(){return this.data}set textContent(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},at=class e extends ce{constructor(n){super();this.nodeType=lt;this.rawOuterHTML=n}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},fe=class e extends ce{constructor(n){super();this.nodeType=Qt;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},Jt=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},Yt=class{constructor(t){this.el=t}list(){let t=this.el.getAttribute("class");return t?t.split(/\s+/).filter(Boolean):[]}write(t){t.length?this.el.setAttribute("class",t.join(" ")):this.el.removeAttribute("class")}add(...t){let n=this.list();for(let r of t)n.includes(r)||n.push(r);this.write(n)}remove(...t){this.write(this.list().filter(n=>!t.includes(n)))}contains(t){return this.list().includes(t)}toggle(t,n){let r=this.contains(t),o=n===void 0?!r:n;return o?this.add(t):this.remove(t),o}},Z=class e extends ce{constructor(n,r=!1){super();this.nodeType=lt;this.attributes=new Map;this.style=new Jt;this.classList=new Yt(this);this.rawHTML=null;this.localName=n.toLowerCase(),this.tagName=r?n:n.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(n,r){this.attributes.set(n,String(r))}removeAttribute(n){this.attributes.delete(n)}getAttribute(n){return this.attributes.has(n)?this.attributes.get(n):null}hasAttribute(n){return this.attributes.has(n)}get id(){return this.getAttribute("id")??""}set id(n){n==null?this.removeAttribute("id"):this.setAttribute("id",n)}get className(){return this.getAttribute("class")??""}set className(n){n==null?this.removeAttribute("class"):this.setAttribute("class",n)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(n){n==null?this.removeAttribute("for"):this.setAttribute("for",n)}set value(n){n==null?this.removeAttribute("value"):this.setAttribute("value",String(n))}set checked(n){n?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(n){n?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(n){}get textContent(){return this.childNodes.map(n=>n.textContent??"").join("")}set textContent(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,n!=null&&n!==""&&this.appendChild(new Y(String(n)))}set innerText(n){this.textContent=n}set innerHTML(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=n==null?"":String(n)}cloneNode(n=!1){let r=new e(this.localName,this.isSVG);if(r.attributes=new Map(this.attributes),r.style.cssText=this.style.cssText,r.rawHTML=this.rawHTML,n)for(let o of this.childNodes)r.appendChild(o.cloneNode(!0));return r}};var Di=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Vr=/&/g,Hr=/</g,Ur=/>/g,qi=/"/g;function en(e){return e.replace(Vr,"&amp;").replace(Hr,"&lt;").replace(Ur,"&gt;")}function Fr(e){return e.replace(Vr,"&amp;").replace(qi,"&quot;").replace(Hr,"&lt;").replace(Ur,"&gt;")}function ji(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function $i(e){if(!e)return"";let t=[];e.cssText&&t.push(e.cssText.trim().replace(/;\s*$/,""));for(let n of Object.keys(e)){if(n==="cssText")continue;let r=e[n];r==null||r===""||t.push(`${ji(n)}: ${r}`)}return t.join("; ")}function Li(e){let t="",n=$i(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${Fr(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${Fr(o)}"`}return t}function D(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return en(e);if(typeof e=="number")return en(String(e));if(typeof e=="function")return D(e());if(Array.isArray(e))return e.map(D).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case Zt:return en(e.data??"");case Qt:return`<!--${e.data??""}-->`;case lt:{let t=e.localName,n=`<${t}${Li(e)}>`;if(Di.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(D).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(D).join(""):""}var Ii=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Fi={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function Wr(e){return e.replace(/&(#?\w+);/g,(t,n)=>Fi[n]??t)}var q=class extends Error{};function zr(e,t=!1){let n=0,r=[],o=[],s=l=>{let c=o[o.length-1];c?c.appendChild(l):r.push(l)};for(;n<e.length;){let l=e.indexOf("<",n);if(l===-1){a(e.slice(n));break}if(l>n&&a(e.slice(n,l)),e.startsWith("<!--",l)){let c=e.indexOf("-->",l);if(c===-1)throw new q(`unterminated comment at ${l}`);s(new fe(e.slice(l+4,c))),n=c+3;continue}if(e[l+1]==="/"){let c=e.indexOf(">",l);if(c===-1)throw new q(`unterminated closing tag at ${l}`);let f=e.slice(l+2,c).trim().toLowerCase(),h=o.pop();if(!h||h.localName!==f)throw new q(`</${f}> does not close <${h?.localName??"nothing"}>`);n=c+1;continue}n=u(l)}if(o.length>0)throw new q(`unclosed <${o[o.length-1].localName}>`);let i=r[0];if(r.length!==1||!(i instanceof Z))throw new q(`expected exactly one root element, got ${r.length}`);return i;function a(l){l!==""&&s(new Y(Wr(l)))}function u(l){let c=/[\s/>]/.exec(e.slice(l+1));if(!c)throw new q(`unterminated tag at ${l}`);let f=e.slice(l+1,l+1+c.index).toLowerCase(),h=new Z(f,t),y=l+1+c.index;for(;y<e.length;){for(;y<e.length&&/\s/.test(e[y]);)y++;if(e[y]===">"){y++;break}if(e[y]==="/"&&e[y+1]===">"){y+=2;break}let N=y;for(;y<e.length&&!/[\s=/>]/.test(e[y]);)y++;let w=e.slice(N,y);if(w==="")throw new q(`malformed attribute at ${y}`);if(e[y]==="="){if(e[y+1]!=='"')throw new q(`attribute ${w} must have a double-quoted value`);let j=e.indexOf('"',y+2);if(j===-1)throw new q(`unterminated value for ${w}`);h.setAttribute(w,Wr(e.slice(y+2,j))),y=j+1}else h.setAttribute(w,"")}return s(h),Ii.has(f)||o.push(h),y}}var Br=!1;function Gr(){Br||(Br=!0,Un({createElement:(e,t)=>new Z(e,t),createText:e=>new Y(e),createRaw:e=>new at(e),parseTemplate:(e,t)=>zr(e,t),createComment:e=>new fe(e)}))}function nn(e,t={}){let n=v;Gr(),G(!0);let r=ue(t.event);try{return ae(r,()=>k(o=>{try{let s=typeof e=="function"?e():e;return D(s)}finally{o()}}))}finally{G(n)}}var Kr=!1;function Vi(){Kr||(Kr=!0,An(e=>{L()?.pending.add(e)}),Ue(()=>L()?.nextResourceId()??""),Rn((e,t)=>{e&&L()?.data.set(e,t)}))}var tn=null;function rn(e){tn=e}function ct(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let s=o;if(tn)try{s=tn(o,r)}catch{continue}s!==void 0&&(typeof s=="function"||typeof s=="symbol"||(t[r]=s))}if(Object.keys(t).length===0)return"";let n=Re(JSON.stringify(t));return n==="{}"?"":`<script type="application/json" id="${le}">${n}<\/script>`}var Hi=50;async function on(e,t={}){let n=v;Gr(),G(!0),Vi();let r=ue(t.event);try{return await ae(r,async()=>{t.preload&&await t.preload(t.event);let o,s=null,i=()=>{};k(c=>{i=c,s=I(),o=typeof e=="function"?e():e});let a=()=>{try{O(s,()=>D(o))}catch{}};a();let u=0;for(;r.pending.size>0&&u++<Hi;){let c=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(c),await En(),a()}let l=O(s,()=>D(o))+ct(r);return i(),l})}finally{G(n)}}var un=Symbol("store-raw"),Xr=Symbol("store-node"),Jr=Symbol("store-has"),Yr=Symbol("store-self"),Zr=Symbol("store-track");var Qr=new WeakMap,eo=new WeakMap;function so(e){let[t,n]=g(e),r=t;return r.$=n,r}function dt(e){let t=Qr.get(e);return t||Qr.set(e,t={keys:new Map}),t}function to(e,t,n){let r=e.keys.get(t);return r||e.keys.set(t,r=so(n)),r}function no(e){let t=dt(e);(t.all||(t.all=so()))()}function ro(e,t){e.$(typeof t=="function"?()=>t:t)}function io(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 ft(e){if(!io(e))return e;let t=eo.get(e);if(t)return t;let n=new Proxy(e,Ui);return eo.set(e,n),n}var Ui={get(e,t,n){if(t===un||t===Xr)return e;if(t===re)return n;if(t===Jr)return i=>i in e;if(t==="__proxy")return!0;if(t===Zr||t===Yr)return no(e),n;let r=e[t];if(typeof r=="function"&&!Object.prototype.hasOwnProperty.call(e,t))return r;let o=Object.getOwnPropertyDescriptor(e,t);if(o&&o.get)return o.get.call(n);let s=to(dt(e),t,r)();return io(s)?ft(s):s},set(){return!0},deleteProperty(e,t){return t in e&&_e(e,t,void 0),!0},has(e,t){return t===un||t===re||t===Xr||t===Jr||t===Yr||t===Zr?!0:(to(dt(e),t,e[t])(),t in e)},ownKeys(e){return no(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e,t)}};function _e(e,t,n){if(e[t]===n&&(n!==void 0||t in e))return;let r=Array.isArray(e),o=r?e.length:0;n===void 0?delete e[t]:e[t]=n;let s=dt(e),i=s.keys.get(t);if(i&&ro(i,n),r&&e.length!==o){let a=s.keys.get("length");a&&ro(a,e.length)}s.all&&s.all.$(void 0)}function oo(e,t){return typeof e=="function"?e(t):e}function an(e,t){for(let n of Object.keys(t)){let r=t[n],o=e[n];r&&typeof r=="object"&&!Array.isArray(r)&&o&&typeof o=="object"&&!Array.isArray(o)?an(o,r):_e(e,n,r)}}function cn(e){let t=[],n=e.replace(/\[([^\]]*)\]/g,".$1");for(let r of n.split("."))r.length&&t.push(r);return t}function uo(e,t,n){let r=t.length-1;for(let s=0;s<r;s++){let i=t[s];if(i==="*"){let u=t.slice(s+1);if(Array.isArray(e))for(let l=0;l<e.length;l++)uo(e[l],u,n);return}let a=e[i];(a==null||typeof a!="object")&&(a=/^\d+$/.test(t[s+1])?[]:{},_e(e,i,a)),e=a}let o=t[r];if(o==="*"){if(Array.isArray(e))for(let s=0;s<e.length;s++)_e(e,s,oo(n,e[s]));return}_e(e,o,oo(n,e[o]))}function sn(e,t,n){uo(e,cn(t),n)}function Wi(e,t){let n=t[0];if(typeof n=="function"&&t.length===1){let r=n(e);r&&r!==e&&an(e,r);return}if(Array.isArray(n)&&t.length===1){for(let r of n)Array.isArray(r)&&sn(e,r[0],r[1]);return}if(n&&typeof n=="object"&&!Array.isArray(n)&&t.length===1){an(e,n);return}if(Array.isArray(t[1])&&t.length>=3){sn(e,`${n}.${t[1].join(".")}`,t[2]);return}sn(e,String(n),t[1])}function ln(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(ln);let t={};for(let n of Object.keys(e))t[n]=ln(e[n]);return t}function de(e,t){let n=e;for(let r of cn(t)){if(n==null)return;n=n[r]}return n}var ao=class{constructor(e,t={immutable:!0}){this.options=t,this.root=e,this.set=((...n)=>x(()=>Wi(this.root,n)))}get state(){return ft(this.root)}get proxy(){return ft(this.root)}get accessor(){return(()=>ft(this.root))}unwrap(){return this.root}getNode(e){return this.root&&this.root[e]}get(e){if(e==null||e==="")return pt(this.state);let t=this.state;for(let n of cn(e)){if(t==null)return;t=t[n]}return pt(t)}select(e){return m(()=>e(this.state))}subscribe(e){return T(()=>e(this.state))}watch(e,t){let n;return T(()=>{let r=e(this.state);Object.is(r,n)||(t(r,n),n=r)})}reactive(e){return m(()=>this.state[e])}produce(e){this.set((t=>{let n=ln(t);return e(n),n}))}reconcile(e,t={}){this.set(e)}push(e,...t){let n=de(this.root,e);this.set(e,n.concat(t))}pop(e){let t=de(this.root,e).slice(),n=t.pop();return this.set(e,t),n}shift(e){let t=de(this.root,e).slice(),n=t.shift();return this.set(e,t),n}splice(e,t,n,...r){let o=de(this.root,e).slice(),s=o.splice(t,n,...r);return this.set(e,o),s}insert(e,t,n){let r=de(this.root,e).slice();r.splice(t,0,n),this.set(e,r)}removeAt(e,t){let n=de(this.root,e).slice(),r=n.splice(t,1);return this.set(e,n),r}toObservable(){let[e]=g(this.state);return e.toObservable()}dispose(){}},zi=["get","select","watch","subscribe","produce","reconcile","push","pop","shift","splice","insert","removeAt","unwrap","toObservable"];function Bi(e,t){for(let n of zi)e[n]=t[n].bind(t);e.$=t.reactive.bind(t)}function ht(e,t={immutable:!0}){let n=new ao(e,t);return Bi(n.set,n),[n.proxy,n.set]}function Ki(e,t={}){return new ao(e,{...t,immutable:!1})}function pt(e){if(e==null||typeof e!="object")return e;let t=e[un];return t!==void 0?t:e}function Gi(e){return A(()=>pt(e))}var ql=Object.freeze({createStore:ht,createMutableStore:Ki,batch:x,unwrap:pt,untrackStore:Gi});function lo(e,t){let[n,r]=ht(e,t);return new Proxy(n,{get:(o,s)=>s==="set"?r:o[s],has:(o,s)=>s==="set"||Reflect.has(o,s)})}return go(Xi);})();