@fluixi/dom 1.0.0-alpha.78 → 1.0.0-alpha.79

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