@fluixi/dom 1.0.0-alpha.70 → 1.0.0-alpha.71

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