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