@fluixi/dom 1.0.0-alpha.66 → 1.0.0-alpha.68
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/element/attributes.d.ts +6 -6
- package/dist/lib/element/attributes.d.ts.map +1 -1
- package/dist/lib/flow/client-only.cjs +1 -0
- package/dist/lib/flow/client-only.d.ts +44 -0
- package/dist/lib/flow/client-only.d.ts.map +1 -0
- package/dist/lib/flow/client-only.js +46 -0
- package/dist/lib/flow/client-only.mjs +1 -0
- package/dist/lib/flow/dynamic.cjs +1 -1
- package/dist/lib/flow/dynamic.d.ts.map +1 -1
- package/dist/lib/flow/dynamic.js +15 -2
- package/dist/lib/flow/dynamic.mjs +1 -1
- package/dist/lib/flow/index.cjs +1 -1
- package/dist/lib/flow/index.d.ts +2 -0
- package/dist/lib/flow/index.d.ts.map +1 -1
- package/dist/lib/flow/index.js +1 -0
- package/dist/lib/flow/index.mjs +1 -1
- package/dist/lib/flow/show.cjs +1 -1
- package/dist/lib/flow/show.d.ts.map +1 -1
- package/dist/lib/flow/show.js +37 -15
- package/dist/lib/flow/show.mjs +1 -1
- package/dist/lib/flow/switch.cjs +1 -1
- package/dist/lib/flow/switch.d.ts.map +1 -1
- package/dist/lib/flow/switch.js +31 -7
- package/dist/lib/flow/switch.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/lib/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var xe=Object.defineProperty;var Qt=Object.getOwnPropertyDescriptor;var en=Object.getOwnPropertyNames;var tn=Object.prototype.hasOwnProperty;var nn=(e,t)=>{for(var n in t)xe(e,n,{get:t[n],enumerable:!0})},rn=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of en(t))!tn.call(e,o)&&o!==n&&xe(e,o,{get:()=>t[o],enumerable:!(r=Qt(t,o))||r.enumerable});return e};var on=e=>rn(xe({},"__esModule",{value:!0}),e);var jr={};nn(jr,{Dynamic:()=>jt,ErrorBoundary:()=>Ht,FX_DATA_ID:()=>I,For:()=>Dt,Index:()=>_t,Island:()=>St,JSX_PROPERTIES:()=>Q,Match:()=>$t,Portal:()=>Ft,SVG_ELEMENTS:()=>fn,SVG_NAMESPACE:()=>k,Show:()=>Lt,Switch:()=>It,VOID_ELEMENTS:()=>un,addClass:()=>yn,addDelegatedEventListener:()=>gt,addNativeEventListener:()=>Re,appendChildren:()=>Sn,applyElementProp:()=>Z,applyProps:()=>Pe,applyUse:()=>Ce,asComponent:()=>Wn,asContext:()=>Un,asOutlet:()=>Hn,asProvider:()=>Vn,asRoute:()=>Fn,asRouter:()=>qn,asRoutes:()=>jn,asSuspense:()=>Kn,captureHydrationCursor:()=>pt,checkRenderType:()=>Bn,classMap:()=>Ut,cleanChildren:()=>w,cloneTemplate:()=>nr,closest:()=>pn,createComponent:()=>ke,createDynamicElement:()=>Rr,createElement:()=>En,createNativeElement:()=>we,createPortal:()=>fr,createRequestContext:()=>O,createTemplate:()=>tr,delegate:()=>Rn,delegateEvents:()=>Ae,escapeFxJson:()=>G,escapeHTML:()=>pr,fnName:()=>rr,generateID:()=>Jn,getAttribute:()=>xn,getGlobal:()=>In,getLitEventName:()=>ln,getLocals:()=>$e,getOffset:()=>wn,getRequestContext:()=>S,getRequestEvent:()=>ae,getRequestLocals:()=>le,getServerData:()=>X,getStableElementId:()=>Xn,getStyle:()=>bn,handleRef:()=>z,hasClass:()=>gn,html:()=>At,hydrate:()=>ue,hydrateAdvancePast:()=>_,hydrateIslands:()=>vt,indexArray:()=>q.indexArray,initializeIntegration:()=>gr,insert:()=>N,insertExpression:()=>V,intergartionInitialized:()=>xr,isAccessor:()=>yr,isComponent:()=>b,isContext:()=>lt,isCustomElement:()=>et,isDOMNode:()=>On,isDelegatedEvent:()=>Qn,isDomElement:()=>ee,isDomNode:()=>P,isDomText:()=>te,isEventHandler:()=>an,isFunction:()=>er,isIntegrationInitialized:()=>Tr,isJSXTemplate:()=>_n,isLitTemplateResult:()=>nt,isNativeElement:()=>dr,isOutlet:()=>st,isPromise:()=>H,isProvider:()=>at,isReactElement:()=>Dn,isRoute:()=>it,isRouter:()=>rt,isRoutes:()=>ot,isSVGElement:()=>Le,isServer:()=>m,isSuspense:()=>ct,isTemplateFactory:()=>kn,isVisible:()=>vn,iterateFn:()=>or,keyArray:()=>q.keyArray,makeArrayFlat:()=>xt,mapArray:()=>q.mapArray,mergeProps:()=>cr,observeIntersection:()=>Mn,observeResize:()=>Pn,query:()=>Te,queryAll:()=>dn,registerCreateComponent:()=>hr,registerGlobal:()=>$n,removeAttribute:()=>Tn,removeChildren:()=>Nn,removeClass:()=>mn,removeDelegatedEventListener:()=>ve,render:()=>De,renderToString:()=>Ye,renderToStringAsync:()=>Qe,resetIntegration:()=>br,runHydrationAt:()=>yt,runWithRequestContext:()=>$,runWithoutHydration:()=>mt,scrollIntoView:()=>An,serializeNode:()=>E,serializeResourceData:()=>he,setAttribute:()=>T,setClassList:()=>K,setClassName:()=>W,setDataRedactor:()=>Ze,setDynamicAttribute:()=>re,setDynamicBoolAttribute:()=>Me,setDynamicProperty:()=>oe,setProperty:()=>U,setRequestStore:()=>Oe,setServerMode:()=>M,setStyle:()=>B,setStyles:()=>tt,shouldSetAsProperty:()=>cn,splitProps:()=>ur,spread:()=>lr,styleMap:()=>Kt,svg:()=>wt,toAttributeName:()=>sn,toggleClass:()=>hn,waitForElement:()=>Cn});module.exports=on(jr);function sn(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function an(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function ln(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function cn(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 un=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),fn=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"]),k="http://www.w3.org/2000/svg";function et(e){return e.localName.includes("-")}function Z(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(et(e)){e[t]=n;return}T(e,t,n,r)}var Q=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function Te(e,t=document){return t.querySelector(e)}function dn(e,t=document){return Array.from(t.querySelectorAll(e))}function pn(e,t){return e.closest(t)}function yn(e,...t){e.classList.add(...t)}function mn(e,...t){e.classList.remove(...t)}function hn(e,...t){t.forEach(n=>e.classList.toggle(n))}function gn(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 xn(e,t){return e.getAttribute(t)}function Tn(e,t){e.removeAttribute(t)}function tt(e,t){Object.assign(e.style,t)}function bn(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function En(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")tt(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 Nn(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Sn(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function vn(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function An(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function wn(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function Rn(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 Cn(e,t=5e3){return new Promise((n,r)=>{let o=Te(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=Te(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 Mn(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function Pn(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Ln=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function Dn(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ln}function nt(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function kn(e){if(typeof e!="function")return!1;try{let t=e();return nt(t)}catch{return!1}}function _n(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function On(e){return e instanceof Node}function $n(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function In(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 qn(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function jn(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function Fn(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function Hn(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function Vn(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function Un(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function Wn(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function Kn(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function rt(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function ot(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function it(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function st(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function at(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function lt(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function b(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function ct(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function Bn(e){return rt(e)?{type:"router",value:e}:it(e)?{type:"route",value:e}:ot(e)?{type:"routes",value:e}:st(e)?{type:"outlet",value:e}:b(e)?{type:"component",value:e}:ct(e)?{type:"suspense",value:e}:at(e)?{type:"provider",value:e}:lt(e)?{type:"context",value:e}:{type:"none",value:e}}var d=require("@fluixi/reactive/signal");var m=typeof document>"u";function M(e){m=e}var j=Symbol.for("fluixi.server-node"),be=null;function ut(e){be=e}function F(){if(!be)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return be}function P(e){return e!=null&&e[j]===!0?!0:typeof Node<"u"&&e instanceof Node}function ee(e){return e!=null&&e[j]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function te(e){return e!=null&&e[j]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},ft=null;function dt(e){ft=e}function Ee(){return ft}function Ne(e,t){return u.active&&t.parentNode===e}function Se(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function pt(){return u.active?u.cursor:null}function yt(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 mt(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 _(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Se(t)}function zn(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 Gn(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 Xn(e){return Gn(zn(e))}var Jn=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Yn={};var ht=new Map,ne=new Set,ie=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function Ae(e){if(!m)for(let t of e)ne.has(t)||ie.has(t)||(ne.add(t),document.addEventListener(t,Zn))}function Zn(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 gt(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}ne.has(t)||Ae([t])}function ve(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function Qn(e){return!ie.has(e)}function er(e){return typeof e=="function"}function R(e,t=!1){if(m)return F().createText(e);if(u.active&&!t){let n=Ee()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function we(e,t=!1){if(m)return F().createElement(e,t);if(u.active){let n=Ee()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(k,e):document.createElement(e)}function tr(e,t=!1){let n=ht.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,ht.set(e,r),r}function nr(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function xt(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?xt(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function rr(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function or(e){if((0,h.isSignal)(e)||b(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,h.isSignal)(t)&&!b(t);)t=t();return t}var A=0,ir=200;function sr(e,t,n,r,o){let i=r,s=new Map;return(0,d.createRenderEffect)(()=>{let a;if(b(e)&&!(0,h.isSignal)(e)){if(!s.has(e)){A++;try{let l=e();s.set(e,l)}finally{A--}}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(b(a)){if(!s.has(a)){let c=a;A++;try{let f=c();s.set(c,f)}finally{A--}}a=s.get(a)}else if((0,h.isSignal)(a))a=a();else if(a=a(),typeof a!="function"||!(0,h.isSignal)(a)&&!b(a))break}A++;try{i=V(t,a,n,i,s),o(i)}finally{A--}})}function N(e,t,n,r){if(A>ir)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)){A++;try{o=V(e,t,n,null)}finally{A--}return()=>o}let a=sr(s(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function V(e,t,n,r,o){if(t==null||typeof t=="boolean")return w(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return w(e,r,n);if(H(t)){let s=R("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),w(e,r.slice(1),n)):g(e,s,n):r?e.replaceChild(s,r):g(e,s,n),t.then(a=>{s.parentNode===e&&V(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=w(e,r,n)}if(r&&te(r))return r.data=t,r;let s=R(t);return r&&r.parentNode===e?e.replaceChild(s,r):Ne(e,s)||g(e,s,n),s}if(P(t))return Ne(e,t)?(Se(t),t):Array.isArray(r)?(r.length===0?g(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),w(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=ar(e,a,s,n);for(let f of l){let p=N(e,f.sig,f.marker);(0,d.onCleanup)(()=>{w(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 V(e,l,n,r)}}}return w(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"&&!H(l)&&!(0,h.isSignal)(l)&&!b(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(b(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"&&!H(c)&&!(0,h.isSignal)(c)&&!b(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(H(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 y=1;y<p.length;y++)c.parentNode?.insertBefore(p[y],p[y-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){v(l,t,n,r,o,i,s);continue}if(P(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 ar(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 y=l;for(;y<s;)f.set(n[y],y++)}let p=f.get(t[a]);if(p!=null)if(l<p&&p<s){let y=a,ge=1;for(;++y<i&&y<s&&!(!f.has(t[y])||f.get(t[y])!==p+ge);)ge++;if(ge>p-l){let Zt=t[a];for(;l<p;)g(e,n[l++],Zt)}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 w(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 U(e,t,n){n==null?delete e[t]:e[t]=n}function Re(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 Ce(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 re(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 oe(e,t,n){return typeof n!="function"?(U(e,t,n),()=>{}):(0,d.createRenderEffect)(()=>{let r=typeof n=="function"?n():n;U(e,t,r)})}function Me(e,t,n){return typeof n!="function"?(T(e,t,!!n),()=>{}):(0,d.createRenderEffect)(()=>{let r=n();T(e,t,!!r)})}function W(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,d.createRenderEffect)(()=>W(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 K(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 B(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let r in n){let o=n[r];o==null?e.style[r]="":e.style[r]=o}}function lr(e){let{element:t,props:n,prevProps:r=Yn,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!ee(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===k,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"){z(c,t);continue}if(l==="use"){Ce(t,c);continue}if(l.startsWith("on:")){a.push(Re(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(oe(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(re(t,l.slice(5),c,s));continue}if(l.startsWith("bool:")){a.push(Me(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>W(t,c()))):W(t,c);continue}if(l==="classList"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>K(t,c()))):K(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>B(t,c()))):B(t,c);continue}if(l.startsWith("on")){let y=l.slice(2).toLowerCase();f&&ve(t,y),c&>(t,y,c);continue}let p=Q.has(l)||!s&&l in t;typeof c=="function"?a.push(p?oe(t,l,c):re(t,l,c,s)):a.push((0,d.createRenderEffect)(()=>p?U(t,l,n[l]):T(t,l,n[l],s)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();ve(t,c)}else Q.has(l)?U(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function Pe(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){z(o,e);continue}if(r!=="children"){if(r==="use"){Ce(e,o);continue}if(r.startsWith("on:")){Re(e,r.slice(3),o);continue}if(r.startsWith("prop:")){oe(e,r.slice(5),o);continue}if(r.startsWith("attr:")){re(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){Me(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,ne.has(i)||Ae([i]);continue}if(r==="class"||r==="className"){W(e,o);continue}if(r==="classList"){typeof o=="function"?(0,d.createRenderEffect)(()=>K(e,o())):K(e,o);continue}if(r==="style"){typeof o=="function"?(0,d.createRenderEffect)(()=>B(e,o())):B(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();Z(e,r,s,n)});(0,d.onCleanup)(()=>{i()})}else(0,d.createRenderEffect)(()=>Z(e,r,t[r],n))}}}function cr(...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 ur(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 z(e,t){if(e){if(P(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 fr(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)})})):P(a)&&(r.appendChild(a),i.push(()=>{a.parentNode===r&&r.removeChild(a)}))});i.push(s),(0,d.onCleanup)(()=>{i.forEach(a=>a())})}),null}function dr(e){return typeof e=="string"&&e.toLowerCase()===e}function Le(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 H(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 De(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=""),N(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}var mr="__fx_dom_create_component__",L=globalThis[mr]??={fn:null};function hr(e){L.fn=e}function gr(e={}){let t=e.signalSystem?.createComponent;t&&(L.fn=t)}function ke(e,t){return L.fn?L.fn(e,t):(()=>e(t))}var xr=()=>L.fn!==null,Tr=()=>L.fn!==null;function br(){L.fn=null}var se,bt={getStore:()=>se,run(e,t){let n=se;se=e;try{return t()}finally{se=n}}},_e=bt;function Oe(e){_e=e??bt}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 _e.run(e,t)}function S(){return _e.getStore()}function ae(){return S()?.event}function $e(){let e=ae();return e?(e.locals||(e.locals={}),e.locals):{}}var Tt=new WeakMap;function le(e){let t=Tt.get(e);return t||(t={},Tt.set(e,t)),t}var ce=require("@fluixi/reactive/signal");var I="__FX_DATA__";function G(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var Ie;function X(){let e=globalThis.__FX_DATA__;if(e)return e;if(Ie!==void 0)return Ie;let t=null;if(typeof document<"u"){let n=document.getElementById(I)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return Ie=t}function qe(){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"]),je=typeof process<"u"&&process.env&&!1;function Fe(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 Nr(e){qe();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):(je&&t&&Fe(`<${e}>`,t),null)}function Sr(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}qe();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(je&&t&&Fe(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function vr(e){qe();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(je&&t&&Fe(`marker <!--${e.slice(0,24)}-->`,t),null)}var Et=!1;function Ar(){Et||(Et=!0,dt({hydrateElement:Nr,hydrateText:Sr,hydrateMarker:vr}))}function ue(e,t,n){Ar(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=X(),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 De(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var He="fluixi-island";function St(e){let{component:t,props:n={},name:r}=e,o=we(He),i=r??t.name??"Island";T(o,"name",i),T(o,"props",JSON.stringify(n??{}));let s=m?S():void 0;if(s){let a=s.nextIslandNamespace(i);N(o,()=>s.withResourceScope(a,()=>t(n)))}else N(o,()=>t(n));return o}var Nt=!1;function wr(){if(Nt||typeof document>"u")return;Nt=!0;let e=document.createElement("style");e.textContent=`${He}{display:contents}`,document.head.appendChild(e)}function vt(e){if(typeof document>"u")return;wr();let t=document.querySelectorAll(He),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 At(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function wt(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}var Rt=require("@fluixi/reactive/signal");function Rr(e,t={}){if(typeof e=="function")return ke(e,t);if(typeof e!="string"||e.length===0)return null;let n=Le(e);if(m)return F().createElement(e,n);let r=n?document.createElementNS(k,e):document.createElement(e);return Pe(r,t,n),Cr(r,t),r}function Cr(e,t){if(!t||t.children===void 0)return;let n=(0,Rt.readChildren)(()=>t.children),r=o=>{N(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}var D=require("@fluixi/reactive/signal");function Ct(e){return typeof e=="function"?e:(()=>e)}function C(e){return()=>{let t=e();return typeof t=="function"?t():t}}function Mt(e){return e!=null&&e!==!1}function Pt(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function Lt(e){let t=C(()=>e.when),n=(0,D.createMemo)(t,void 0),r=(0,D.createMemo)(n,void 0);return(0,D.createMemo)(()=>{if(r()){let i=e.children;return typeof i=="function"&&!Pt(i)?typeof n=="function"?(0,D.untrack)(()=>(0,D.untrack)(n)?i(n()):e.fallback):i(n):i}return e.fallback},void 0,{name:"show"})}var fe=require("@fluixi/reactive/signal");function Dt(e){let t=C(()=>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 _(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 kt=require("@fluixi/reactive/signal");function _t(e){let t=C(()=>e.each);return(0,kt.indexArray)(t,(n,r)=>{let o=e.children(n,r);return _(o),o},{fallback:()=>e.fallback??null})}var q=require("@fluixi/reactive/signal");var Ot=require("@fluixi/reactive/signal");var Ve=Symbol("match");function $t(e){return{[Ve]:!0,when:C(()=>e.when),children:e.children}}function It(e){let t=Array.isArray(e.children)?e.children:[e.children];return(0,Ot.createMemo)(()=>{for(let n of t){let r=n,o=0;for(;typeof r=="function"&&!r[Ve]&&o++<10;)r=r();if(!r||typeof r!="object"||r[Ve]!==!0)continue;let i=r.when();if(Mt(i))return typeof r.children=="function"?r.children(i):r.children}return e.fallback??null})}var qt=require("@fluixi/reactive/signal");function jt(e){let t=Ct(e.component),{component:n,...r}=e;return(0,qt.createMemo)(()=>{let o=t();return o==null?null:typeof o=="string"?{tag:o,props:r}:o(r)})}var de=require("@fluixi/reactive/signal");function Ft(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),N(r,e.children)&&z(e.ref,r)}),(0,de.onCleanup)(()=>{n(),r.remove()}),null}var pe=require("@fluixi/reactive/signal");function Ht(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 Vt=require("@fluixi/reactive/signal");function Ut(e){return(0,Vt.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 Wt=require("@fluixi/reactive/signal");function Mr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Kt(e){return(0,Wt.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(`${Mr(r)}: ${i}`)}return n.join("; ")})}var Ke=1,Be=3,ze=8,Bt;Bt=j;var J=class{constructor(){this[Bt]=!0;this.parentNode=null;this.childNodes=[]}get firstChild(){return this.childNodes[0]??null}get lastChild(){return this.childNodes[this.childNodes.length-1]??null}get nextSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>=0?t.childNodes[n+1]??null:null}get previousSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>0?t.childNodes[n-1]??null:null}get parentElement(){return this.parentNode}appendChild(t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes.push(t),t}insertBefore(t,n){if(n==null)return this.appendChild(t);t.parentNode&&t.parentNode.removeChild(t);let r=this.childNodes.indexOf(n);return t.parentNode=this,r<0?this.childNodes.push(t):this.childNodes.splice(r,0,t),t}removeChild(t){let n=this.childNodes.indexOf(t);return n>=0&&this.childNodes.splice(n,1),t.parentNode=null,t}replaceChild(t,n){let r=this.childNodes.indexOf(n);return r>=0&&(t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes[r]=t,n.parentNode=null),n}addEventListener(){}removeEventListener(){}},Y=class e extends J{constructor(n){super();this.nodeType=Be;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 J{constructor(n){super();this.nodeType=ze;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},Ue=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},We=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 J{constructor(n,r=!1){super();this.nodeType=Ke;this.attributes=new Map;this.style=new Ue;this.classList=new We(this);this.rawHTML=null;this.localName=n.toLowerCase(),this.tagName=r?n:n.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(n,r){this.attributes.set(n,String(r))}removeAttribute(n){this.attributes.delete(n)}getAttribute(n){return this.attributes.has(n)?this.attributes.get(n):null}hasAttribute(n){return this.attributes.has(n)}get id(){return this.getAttribute("id")??""}set id(n){n==null?this.removeAttribute("id"):this.setAttribute("id",n)}get className(){return this.getAttribute("class")??""}set className(n){n==null?this.removeAttribute("class"):this.setAttribute("class",n)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(n){n==null?this.removeAttribute("for"):this.setAttribute("for",n)}set value(n){n==null?this.removeAttribute("value"):this.setAttribute("value",String(n))}set checked(n){n?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(n){n?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(n){}get textContent(){return this.childNodes.map(n=>n.textContent??"").join("")}set textContent(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,n!=null&&n!==""&&this.appendChild(new Y(String(n)))}set innerText(n){this.textContent=n}set innerHTML(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=n==null?"":String(n)}cloneNode(n=!1){let r=new e(this.localName,this.isSVG);if(r.attributes=new Map(this.attributes),r.style.cssText=this.style.cssText,r.rawHTML=this.rawHTML,n)for(let o of this.childNodes)r.appendChild(o.cloneNode(!0));return r}};var Pr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Gt=/&/g,Lr=/</g,Dr=/>/g,kr=/"/g;function Ge(e){return e.replace(Gt,"&").replace(Lr,"<").replace(Dr,">")}function zt(e){return e.replace(Gt,"&").replace(kr,""")}function _r(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function Or(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 $r(e){let t="",n=Or(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${zt(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${zt(o)}"`}return t}function E(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return Ge(e);if(typeof e=="number")return Ge(String(e));if(typeof e=="function")return E(e());if(Array.isArray(e))return e.map(E).join("");switch(e.nodeType){case Be:return Ge(e.data??"");case ze:return`<!--${e.data??""}-->`;case Ke:{let t=e.localName,n=`<${t}${$r(e)}>`;if(Pr.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 Je=require("@fluixi/reactive/signal"),x=require("@fluixi/reactive/signal");var Xt=!1;function Yt(){Xt||(Xt=!0,ut({createElement:(e,t)=>new me(e,t),createText:e=>new Y(e),createComment:e=>new ye(e)}))}function Ye(e,t={}){let n=m;Yt(),M(!0);let r=O(t.event);try{return $(r,()=>(0,Je.createRoot)(o=>{try{let i=typeof e=="function"?e():e;return E(i)}finally{o()}}))}finally{M(n)}}var Jt=!1;function Ir(){Jt||(Jt=!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 Xe=null;function Ze(e){Xe=e}function he(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(Xe)try{i=Xe(o,r)}catch{continue}i!==void 0&&(t[r]=i)}if(Object.keys(t).length===0)return"";let n=G(JSON.stringify(t));return`<script type="application/json" id="${I}">${n}<\/script>`}var qr=50;async function Qe(e,t={}){let n=m;Yt(),M(!0),Ir();let r=O(t.event);try{return await $(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};(0,Je.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++<qr;){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{M(n)}}
|
|
1
|
+
"use strict";var Ee=Object.defineProperty;var nn=Object.getOwnPropertyDescriptor;var rn=Object.getOwnPropertyNames;var on=Object.prototype.hasOwnProperty;var sn=(e,t)=>{for(var n in t)Ee(e,n,{get:t[n],enumerable:!0})},an=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of rn(t))!on.call(e,o)&&o!==n&&Ee(e,o,{get:()=>t[o],enumerable:!(r=nn(t,o))||r.enumerable});return e};var ln=e=>an(Ee({},"__esModule",{value:!0}),e);var Vr={};sn(Vr,{ClientOnly:()=>Ke,Dynamic:()=>Ht,ErrorBoundary:()=>Ut,FX_DATA_ID:()=>j,For:()=>$t,Index:()=>It,Island:()=>Ct,JSX_PROPERTIES:()=>te,Match:()=>jt,NoSsr:()=>Wt,Portal:()=>Vt,SVG_ELEMENTS:()=>yn,SVG_NAMESPACE:()=>_,Show:()=>_t,Switch:()=>Ft,VOID_ELEMENTS:()=>pn,addClass:()=>gn,addDelegatedEventListener:()=>Et,addNativeEventListener:()=>Pe,appendChildren:()=>An,applyElementProp:()=>ee,applyProps:()=>ke,applyUse:()=>Le,asComponent:()=>zn,asContext:()=>Kn,asOutlet:()=>Un,asProvider:()=>Bn,asRoute:()=>Wn,asRouter:()=>Hn,asRoutes:()=>Vn,asSuspense:()=>Gn,captureHydrationCursor:()=>gt,checkRenderType:()=>Xn,classMap:()=>Kt,cleanChildren:()=>M,cloneTemplate:()=>ir,closest:()=>hn,createComponent:()=>$e,createDynamicElement:()=>Pr,createElement:()=>wn,createNativeElement:()=>Me,createPortal:()=>yr,createRequestContext:()=>q,createTemplate:()=>or,delegate:()=>Pn,delegateEvents:()=>Re,escapeFxJson:()=>J,escapeHTML:()=>hr,fnName:()=>sr,generateID:()=>Qn,getAttribute:()=>En,getGlobal:()=>Fn,getLitEventName:()=>fn,getLocals:()=>je,getOffset:()=>Mn,getRequestContext:()=>v,getRequestEvent:()=>ce,getRequestLocals:()=>ue,getServerData:()=>Y,getStableElementId:()=>Zn,getStyle:()=>Sn,handleRef:()=>X,hasClass:()=>bn,html:()=>Mt,hydrate:()=>de,hydrateAdvancePast:()=>$,hydrateIslands:()=>Rt,indexArray:()=>F.indexArray,initializeIntegration:()=>br,insert:()=>w,insertExpression:()=>U,intergartionInitialized:()=>Er,isAccessor:()=>gr,isComponent:()=>E,isContext:()=>dt,isCustomElement:()=>ot,isDOMNode:()=>In,isDelegatedEvent:()=>nr,isDomElement:()=>ne,isDomNode:()=>k,isDomText:()=>re,isEventHandler:()=>un,isFunction:()=>rr,isIntegrationInitialized:()=>Nr,isJSXTemplate:()=>qn,isLitTemplateResult:()=>st,isNativeElement:()=>mr,isOutlet:()=>ut,isPromise:()=>W,isProvider:()=>ft,isReactElement:()=>_n,isRoute:()=>ct,isRouter:()=>at,isRoutes:()=>lt,isSVGElement:()=>De,isServer:()=>m,isSuspense:()=>pt,isTemplateFactory:()=>$n,isVisible:()=>Cn,iterateFn:()=>ar,keyArray:()=>F.keyArray,makeArrayFlat:()=>Nt,mapArray:()=>F.mapArray,mergeProps:()=>dr,observeIntersection:()=>On,observeResize:()=>kn,query:()=>Ne,queryAll:()=>mn,registerCreateComponent:()=>Tr,registerGlobal:()=>jn,removeAttribute:()=>Nn,removeChildren:()=>vn,removeClass:()=>xn,removeDelegatedEventListener:()=>Ce,render:()=>_e,renderToString:()=>tt,renderToStringAsync:()=>rt,resetIntegration:()=>Sr,runHydrationAt:()=>xt,runWithRequestContext:()=>I,runWithoutHydration:()=>Tt,scrollIntoView:()=>Rn,serializeNode:()=>S,serializeResourceData:()=>Te,setAttribute:()=>b,setClassList:()=>z,setClassName:()=>K,setDataRedactor:()=>nt,setDynamicAttribute:()=>ie,setDynamicBoolAttribute:()=>Oe,setDynamicProperty:()=>se,setProperty:()=>B,setRequestStore:()=>Ie,setServerMode:()=>O,setStyle:()=>G,setStyles:()=>it,shouldSetAsProperty:()=>dn,splitProps:()=>pr,spread:()=>fr,styleMap:()=>Gt,svg:()=>Pt,toAttributeName:()=>cn,toggleClass:()=>Tn,waitForElement:()=>Ln});module.exports=ln(Vr);function cn(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function un(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function fn(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function dn(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),r={input:new Set(["value","checked","indeterminate"]),textarea:new Set(["value"]),select:new Set(["value"]),option:new Set(["selected","value"]),audio:new Set(["volume","currentTime","paused"]),video:new Set(["volume","currentTime","paused"]),img:new Set(["src","srcset"]),iframe:new Set(["src"]),a:new Set(["href"])};return n.has(t)||r[e]&&r[e].has(t)}var pn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),yn=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"]),_="http://www.w3.org/2000/svg";function ot(e){return e.localName.includes("-")}function ee(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(ot(e)){e[t]=n;return}b(e,t,n,r)}var te=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function Ne(e,t=document){return t.querySelector(e)}function mn(e,t=document){return Array.from(t.querySelectorAll(e))}function hn(e,t){return e.closest(t)}function gn(e,...t){e.classList.add(...t)}function xn(e,...t){e.classList.remove(...t)}function Tn(e,...t){t.forEach(n=>e.classList.toggle(n))}function bn(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 En(e,t){return e.getAttribute(t)}function Nn(e,t){e.removeAttribute(t)}function it(e,t){Object.assign(e.style,t)}function Sn(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function wn(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,s])=>{if(o==="class"||o==="className")r.className=s;else if(o==="style"&&typeof s=="object")it(r,s);else if(o.startsWith("on")&&typeof s=="function"){let i=o.slice(2).toLowerCase();r.addEventListener(i,s)}else b(r,o,s)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function vn(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function An(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function Cn(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Rn(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Mn(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function Pn(e,t,n,r){let o=s=>{let i=s.target.closest(n);i&&e.contains(i)&&r(s,i)};return e.addEventListener(t,o),()=>{e.removeEventListener(t,o)}}function Ln(e,t=5e3){return new Promise((n,r)=>{let o=Ne(e);if(o){n(o);return}let s=new MutationObserver(()=>{let a=Ne(e);a&&(s.disconnect(),clearTimeout(i),n(a))});s.observe(document.body,{childList:!0,subtree:!0});let i=setTimeout(()=>{s.disconnect(),r(new Error(`Element ${e} not found within ${t}ms`))},t)})}function On(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(s=>{t(s.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function kn(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Dn=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function _n(e){return typeof e=="object"&&e!==null&&e.$$typeof===Dn}function st(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function $n(e){if(typeof e!="function")return!1;try{let t=e();return st(t)}catch{return!1}}function qn(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function In(e){return e instanceof Node}function jn(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function Fn(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}var g=require("@fluixi/reactive/signal");function Hn(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function Vn(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function Wn(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function Un(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function Bn(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function Kn(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function zn(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function Gn(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function at(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function lt(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function ct(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function ut(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function ft(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function dt(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 pt(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function Xn(e){return at(e)?{type:"router",value:e}:ct(e)?{type:"route",value:e}:lt(e)?{type:"routes",value:e}:ut(e)?{type:"outlet",value:e}:E(e)?{type:"component",value:e}:pt(e)?{type:"suspense",value:e}:ft(e)?{type:"provider",value:e}:dt(e)?{type:"context",value:e}:{type:"none",value:e}}var d=require("@fluixi/reactive/signal");var m=typeof document>"u";function O(e){m=e}var H=Symbol.for("fluixi.server-node"),Se=null;function yt(e){Se=e}function V(){if(!Se)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return Se}function k(e){return e!=null&&e[H]===!0?!0:typeof Node<"u"&&e instanceof Node}function ne(e){return e!=null&&e[H]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function re(e){return e!=null&&e[H]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},mt=null;function ht(e){mt=e}function we(){return mt}function ve(e,t){return u.active&&t.parentNode===e}function Ae(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function gt(){return u.active?u.cursor:null}function xt(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 Tt(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 $(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Ae(t)}function Jn(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 Yn(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 Zn(e){return Yn(Jn(e))}var Qn=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),er={};var bt=new Map,oe=new Set,ae=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function Re(e){if(!m)for(let t of e)oe.has(t)||ae.has(t)||(oe.add(t),document.addEventListener(t,tr))}function tr(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 Et(e,t,n){if(e[`$$${t}`]=n,ae.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=s=>{e[`$$${t}`]?.(s)};e.addEventListener(t,o),e[r]=o}return}oe.has(t)||Re([t])}function Ce(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function nr(e){return!ae.has(e)}function rr(e){return typeof e=="function"}function P(e,t=!1){if(m)return V().createText(e);if(u.active&&!t){let n=we()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function Me(e,t=!1){if(m)return V().createElement(e,t);if(u.active){let n=we()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(_,e):document.createElement(e)}function or(e,t=!1){let n=bt.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,bt.set(e,r),r}function ir(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function Nt(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Nt(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function sr(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function ar(e){if((0,g.isSignal)(e)||E(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,g.isSignal)(t)&&!E(t);)t=t();return t}var R=0,lr=200;function cr(e,t,n,r,o){let s=r,i=new Map;return(0,d.createRenderEffect)(()=>{let a;if(E(e)&&!(0,g.isSignal)(e)){if(!i.has(e)){R++;try{let l=e();i.set(e,l)}finally{R--}}for(a=i.get(e);typeof a=="function"&&(0,g.isSignal)(a);)a=a()}else for(a=e();typeof a=="function"&&(0,g.isSignal)(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(E(a)){if(!i.has(a)){let c=a;R++;try{let f=c();i.set(c,f)}finally{R--}}a=i.get(a)}else if((0,g.isSignal)(a))a=a();else if(a=a(),typeof a!="function"||!(0,g.isSignal)(a)&&!E(a))break}R++;try{s=U(t,a,n,s,i),o(s)}finally{R--}})}function w(e,t,n,r){if(R>lr)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=P("",!0),e.appendChild(n));let o=r??null,s=l=>Array.isArray(l)&&l.some(c=>typeof c=="function"),i=l=>typeof l=="function"?l:()=>l;if(typeof t!="function"&&!s(t)){R++;try{o=U(e,t,n,null)}finally{R--}return()=>o}let a=cr(i(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function U(e,t,n,r,o){if(t==null||typeof t=="boolean")return M(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return M(e,r,n);if(W(t)){let i=P("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(i,r[0]),M(e,r.slice(1),n)):x(e,i,n):r?e.replaceChild(i,r):x(e,i,n),t.then(a=>{i.parentNode===e&&U(e,a,i.nextSibling,i)}).catch(a=>{console.error("Error resolving promise in insertExpression:",a)}),i}let s=typeof t;if(s==="string"||s==="number"){if(s==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let a=P(t);return x(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=M(e,r,n)}if(r&&re(r))return r.data=t,r;let i=P(t);return r&&r.parentNode===e?e.replaceChild(i,r):ve(e,i)||x(e,i,n),i}if(k(t))return ve(e,t)?(Ae(t),t):Array.isArray(r)?(r.length===0?x(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),M(e,r.slice(1),n)):x(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):x(e,t,n)):x(e,t,n),t);if(Array.isArray(t)){let i=[],a=Array.isArray(r)?r:r?[r]:[],l=[];C(t,i,e,n,!0,o,l);let c=ur(e,a,i,n);for(let f of l){let p=w(e,f.sig,f.marker);(0,d.onCleanup)(()=>{M(e,p()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(s==="object"&&t!==null&&typeof t=="object"){let i=t;if("type"in i&&"props"in i){let a=i;if(typeof a.type=="function"){let l=a.type(a.props||{});return U(e,l,n,r)}}}return M(e,r,n)}function C(e,t,n,r,o=!0,s,i){for(let a=0;a<e.length;a++){let l=e[a];if(!(l==null||typeof l=="boolean")){for(;typeof l=="function"&&!W(l)&&!(0,g.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,g.isSignal)(l)?(s||(s=new Map),s.has(l)||s.set(l,l()),c=s.get(l)):c=l();typeof c=="function"&&!W(c)&&!(0,g.isSignal)(c)&&!E(c);)s||(s=new Map),s.has(c)||s.set(c,c()),c=s.get(c);if(c==null||typeof c=="boolean")continue;if(typeof c=="function"){if((0,g.isSignal)(c)){if(i){let p=P("",!0);t.push(p),i.push({marker:p,sig:c});continue}let f=c();for(;typeof f=="function"&&(0,g.isSignal)(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?C(f,t,n,r,o,s):C([f],t,n,r,o,s);continue}continue}Array.isArray(c)?C(c,t,n,r,o,s,i):C([c],t,n,r,o,s,i);continue}if(W(l)){let c=P("",!0);t.push(c),l.then(f=>{if(c.parentNode){let p=[];if(C([f],p,c.parentNode,void 0,!1,s),p.length>0){c.parentNode.replaceChild(p[0],c);for(let y=1;y<p.length;y++)c.parentNode?.insertBefore(p[y],p[y-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){C(l,t,n,r,o,s,i);continue}if(k(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)?C(f,t,n,r,!1,s):C([f],t,n,r,!1,s);continue}}if(typeof l=="string"||typeof l=="number"){let c=String(l);if(c.trim()===""&&c!==" ")continue;t.push(P(c));continue}t.push(P(String(l)))}}}}function ur(e,t,n,r){for(let p=0;p<n.length;p++)n[p].parentNode!==null&&n[p].parentNode!==e&&(n=n.slice(),n[p]=n[p].cloneNode(!0));let o=n.length,s=t.length,i=o,a=0,l=0,c=s>0?t[s-1].nextSibling??void 0:r,f=null;for(;a<s||l<i;){if(t[a]===n[l]){a++,l++;continue}for(;s>a&&i>l&&t[s-1]===n[i-1];)s--,i--;if(s===a){let p=i<o?l?n[l-1].nextSibling??void 0:n[i-l]:c;for(;l<i;)x(e,n[l++],p)}else if(i===l)for(;a<s;)(!f||!f.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[i-1]&&n[l]===t[s-1]){let p=t[--s].nextSibling;x(e,n[l++],t[a++].nextSibling),x(e,n[--i],p),t[s]=t[a-1]}else{if(!f){f=new Map;let y=l;for(;y<i;)f.set(n[y],y++)}let p=f.get(t[a]);if(p!=null)if(l<p&&p<i){let y=a,be=1;for(;++y<s&&y<i&&!(!f.has(t[y])||f.get(t[y])!==p+be);)be++;if(be>p-l){let tn=t[a];for(;l<p;)x(e,n[l++],tn)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(x(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function M(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 x(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function B(e,t,n){n==null?delete e[t]:e[t]=n}function Pe(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 Le(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 ie(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 se(e,t,n){return typeof n!="function"?(B(e,t,n),()=>{}):(0,d.createRenderEffect)(()=>{let r=typeof n=="function"?n():n;B(e,t,r)})}function Oe(e,t,n){return typeof n!="function"?(b(e,t,!!n),()=>{}):(0,d.createRenderEffect)(()=>{let r=n();b(e,t,!!r)})}function K(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,d.createRenderEffect)(()=>K(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 z(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],s=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push((0,d.createRenderEffect)(()=>{let i=!!o();for(let a of s)e.classList.toggle(a,i)}));else{let i=!!(typeof o=="function"?o():o);for(let a of s)e.classList.toggle(a,i)}}}function G(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 fr(e){let{element:t,props:n,prevProps:r=er,isSVG:o=!1,skipChildren:s=!1}=e;if(!t||!ne(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let i=o||t.namespaceURI===_,a=[];for(let l in n){if(s&&l==="children")continue;let c=n[l],f=r[l];if(c===f)continue;if(l==="ref"){X(c,t);continue}if(l==="use"){Le(t,c);continue}if(l.startsWith("on:")){a.push(Pe(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(se(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(ie(t,l.slice(5),c,i));continue}if(l.startsWith("bool:")){a.push(Oe(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>K(t,c()))):K(t,c);continue}if(l==="classList"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>z(t,c()))):z(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>G(t,c()))):G(t,c);continue}if(l.startsWith("on")){let y=l.slice(2).toLowerCase();f&&Ce(t,y),c&&Et(t,y,c);continue}let p=te.has(l)||!i&&l in t;typeof c=="function"?a.push(p?se(t,l,c):ie(t,l,c,i)):a.push((0,d.createRenderEffect)(()=>p?B(t,l,n[l]):b(t,l,n[l],i)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();Ce(t,c)}else te.has(l)?B(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function ke(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){X(o,e);continue}if(r!=="children"){if(r==="use"){Le(e,o);continue}if(r.startsWith("on:")){Pe(e,r.slice(3),o);continue}if(r.startsWith("prop:")){se(e,r.slice(5),o);continue}if(r.startsWith("attr:")){ie(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){Oe(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let s=r.slice(2).toLowerCase();if(typeof o=="function")if(ae.has(s)){e[`$$${s}`]=o;let i=`__fx_${s}`;if(!e[i]){let a=l=>{e[`$$${s}`]?.(l)};e.addEventListener(s,a),e[i]=a}}else e[`$$${s}`]=o,oe.has(s)||Re([s]);continue}if(r==="class"||r==="className"){K(e,o);continue}if(r==="classList"){typeof o=="function"?(0,d.createRenderEffect)(()=>z(e,o())):z(e,o);continue}if(r==="style"){typeof o=="function"?(0,d.createRenderEffect)(()=>G(e,o())):G(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let s=(0,d.createEffect)(()=>{let i=o();for(;typeof i=="function";)i=i();e.innerHTML=i});(0,d.onCleanup)(()=>s())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let s=(0,d.createEffect)(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();document.activeElement!==e&&(e.value=i??"")});(0,d.onCleanup)(()=>{s()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let s=(0,d.createEffect)(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();document.activeElement!==e&&(e.checked=i??"")});(0,d.onCleanup)(()=>{s()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let s=!0,i=(0,d.createEffect)(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();s?(s=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});(0,d.onCleanup)(()=>{i()})}else{let s=!0;(0,d.createRenderEffect)(()=>{let i=t[r];s?(s=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""})}continue}if(typeof o=="function"){let s=(0,d.createEffect)(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();ee(e,r,i,n)});(0,d.onCleanup)(()=>{s()})}else(0,d.createRenderEffect)(()=>ee(e,r,t[r],n))}}}function dr(...e){let t=r=>{for(let o=e.length-1;o>=0;o--){let s=e[o];if(s&&r in s&&s[r]!==void 0)return s[r]}},n=r=>{for(let o of e)if(o&&r in o)return!0;return!1};return new Proxy({},{get:(r,o)=>t(o),has:(r,o)=>n(o),ownKeys:()=>{let r=new Set;for(let o of e)if(o)for(let s of Reflect.ownKeys(o))r.add(s);return[...r]},getOwnPropertyDescriptor:(r,o)=>n(o)?{enumerable:!0,configurable:!0,get:()=>t(o)}:void 0})}function pr(e,...t){let n=new Set;for(let i of t)for(let a of i)n.add(a);let r=i=>({enumerable:!0,configurable:!0,get:()=>e[i]}),o=t.map(i=>{let a=new Set(i);return new Proxy({},{get:(l,c)=>a.has(c)?e[c]:void 0,has:(l,c)=>a.has(c)&&c in e,ownKeys:()=>Array.from(a).filter(l=>l in e),getOwnPropertyDescriptor:(l,c)=>a.has(c)&&c in e?r(c):void 0})}),s=new Proxy({},{get:(i,a)=>n.has(a)?void 0:e[a],has:(i,a)=>!n.has(a)&&a in e,ownKeys:()=>Reflect.ownKeys(e).filter(i=>!n.has(i)),getOwnPropertyDescriptor:(i,a)=>!n.has(a)&&a in e?r(a):void 0});return[...o,s]}function X(e,t){if(e){if(k(e)){let n=t,r=e;if(!n)return;typeof n=="function"?n(r):typeof n=="object"&&"current"in n&&(n.current=r);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function yr(e,t,n){let r=t||document.body,o=(0,d.readChildren)(()=>e),s=[];return(0,d.batch)(()=>{let i=(0,d.createRenderEffect)(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),s.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):k(a)&&(r.appendChild(a),s.push(()=>{a.parentNode===r&&r.removeChild(a)}))});s.push(i),(0,d.onCleanup)(()=>{s.forEach(a=>a())})}),null}function mr(e){return typeof e=="string"&&e.toLowerCase()===e}function De(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 hr(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function W(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function gr(e){return typeof e=="function"&&e.length===0&&(0,g.isSignal)(e)}function _e(e,t,n){if(!t)throw new Error("Container element is required");let r,o,s=[];return(0,d.createRoot)(i=>{(0,d.batch)(()=>{u.active||(t.textContent=""),w(t,e)}),o=i}),()=>{o?.(),r?.(),s.forEach(i=>i()),t.textContent=""}}var xr="__fx_dom_create_component__",D=globalThis[xr]??={fn:null};function Tr(e){D.fn=e}function br(e={}){let t=e.signalSystem?.createComponent;t&&(D.fn=t)}function $e(e,t){return D.fn?D.fn(e,t):(()=>e(t))}var Er=()=>D.fn!==null,Nr=()=>D.fn!==null;function Sr(){D.fn=null}var le,wt={getStore:()=>le,run(e,t){let n=le;le=e;try{return t()}finally{le=n}}},qe=wt;function Ie(e){qe=e??wt}function q(e={}){e.locals||(e.locals=e.request?ue(e.request):{});let t=0,n=0,r=null,o=new Map,s=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${t++}`,nextResourceId:()=>{if(r===null)return`r${n++}`;let i=o.get(r)??0;return o.set(r,i+1),`${r}:r${i}`},nextIslandNamespace:i=>{let a=s.get(i)??0;return s.set(i,a+1),`${i}#${a}`},withResourceScope(i,a){let l=r;r=i;try{return a()}finally{r=l}},pending:new Set,data:new Map}}function I(e,t){return qe.run(e,t)}function v(){return qe.getStore()}function ce(){return v()?.event}function je(){let e=ce();return e?(e.locals||(e.locals={}),e.locals):{}}var St=new WeakMap;function ue(e){let t=St.get(e);return t||(t={},St.set(e,t)),t}var fe=require("@fluixi/reactive/signal");var j="__FX_DATA__";function J(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var Fe;function Y(){let e=globalThis.__FX_DATA__;if(e)return e;if(Fe!==void 0)return Fe;let t=null;if(typeof document<"u"){let n=document.getElementById(j)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return Fe=t}function He(){for(;;){for(;u.cursor&&u.cursor.nodeType===3&&u.cursor.data==="";)u.cursor=u.cursor.nextSibling;if(u.cursor!=null||!u.parents.length)return;u.cursor=u.parents.pop().nextSibling}}var wr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ve=typeof process<"u"&&process.env&&!1;function We(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 vr(e){He();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(wr.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(Ve&&t&&We(`<${e}>`,t),null)}function Ar(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}He();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(Ve&&t&&We(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Cr(e){He();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(Ve&&t&&We(`marker <!--${e.slice(0,24)}-->`,t),null)}var vt=!1;function Rr(){vt||(vt=!0,ht({hydrateElement:vr,hydrateText:Ar,hydrateMarker:Cr}))}function de(e,t,n){Rr(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=Y(),o=n?.resourceNamespace,s=0;(0,fe.setResourceIdSource)(()=>o?`${o}:r${s++}`:`r${s++}`),(0,fe.setServerDataGetter)(r?i=>i in r?{value:r[i]}:void 0:null);try{return _e(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Ue="fluixi-island";function Ct(e){let{component:t,props:n={},name:r}=e,o=Me(Ue),s=r??t.name??"Island";b(o,"name",s),b(o,"props",JSON.stringify(n??{}));let i=m?v():void 0;if(i){let a=i.nextIslandNamespace(s);w(o,()=>i.withResourceScope(a,()=>t(n)))}else w(o,()=>t(n));return o}var At=!1;function Mr(){if(At||typeof document>"u")return;At=!0;let e=document.createElement("style");e.textContent=`${Ue}{display:contents}`,document.head.appendChild(e)}function Rt(e){if(typeof document>"u")return;Mr();let t=document.querySelectorAll(Ue),n=new Map;t.forEach(r=>{let o=r.getAttribute("name")??"",s=n.get(o)??0;n.set(o,s+1);let i=e[o];if(!i){typeof process>"u"&&console.warn(`[fluixi] island "${o}" has no component in the registry — left static.`);return}let a={};try{a=JSON.parse(r.getAttribute("props")||"{}")}catch{}de(()=>i(a),r,{resourceNamespace:`${o}#${s}`})})}function Mt(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function Pt(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}var Lt=require("@fluixi/reactive/signal");function Pr(e,t={}){if(typeof e=="function")return $e(e,t);if(typeof e!="string"||e.length===0)return null;let n=De(e);if(m)return V().createElement(e,n);let r=n?document.createElementNS(_,e):document.createElement(e);return ke(r,t,n),Lr(r,t),r}function Lr(e,t){if(!t||t.children===void 0)return;let n=(0,Lt.readChildren)(()=>t.children),r=o=>{w(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}var h=require("@fluixi/reactive/signal");function Ot(e){return typeof e=="function"?e:(()=>e)}function L(e){return()=>{let t=e();return typeof t=="function"?t():t}}function kt(e){return e!=null&&e!==!1}function Dt(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function _t(e){let t=L(()=>e.when),n=(0,h.createMemo)(t,void 0),r=(0,h.createMemo)(n,void 0),o=(0,h.getOwner)(),s=null,i=null,a=l=>{l!==i&&(s&&(0,h.disposeScope)(s),s=(0,h.createChildOwner)(o),i=l)};return(0,h.createMemo)(()=>{let l=r();return a(l?"when":"fallback"),(0,h.runWithOwner)(s,()=>{if(l){let c=e.children;return typeof c=="function"&&!Dt(c)?typeof n=="function"?(0,h.untrack)(()=>(0,h.untrack)(n)?c(n()):e.fallback):c(n):c}return e.fallback});return e.fallback??null},void 0,{name:"show"})}var pe=require("@fluixi/reactive/signal");function $t(e){let t=L(()=>e.each),n=()=>e.fallback??null,r=(o,s)=>{let i=e.children,a=Array.isArray(i)?i.map(l=>typeof l=="function"?l(o,s):l):typeof i=="function"?i(o,s):i;return $(a),a};return e.by?(0,pe.keyArray)(t,e.by,(o,s)=>r(o,s),{fallback:n}):(0,pe.mapArray)(t,(o,s)=>r(o,s),{fallback:n})}var qt=require("@fluixi/reactive/signal");function It(e){let t=L(()=>e.each);return(0,qt.indexArray)(t,(n,r)=>{let o=e.children(n,r);return $(o),o},{fallback:()=>e.fallback??null})}var F=require("@fluixi/reactive/signal");var N=require("@fluixi/reactive/signal");var Be=Symbol("match");function jt(e){return{[Be]:!0,when:L(()=>e.when),get children(){return e.children}}}function Ft(e){let t=Array.isArray(e.children)?e.children:[e.children],n=(0,N.getOwner)(),r=null,o=-1,s=i=>{i!==o&&(r&&(0,N.disposeScope)(r),r=(0,N.createChildOwner)(n),o=i)};return(0,N.createMemo)(()=>{for(let i=0;i<t.length;i+=1){let l=t[i],c=0;for(;typeof l=="function"&&!l[Be]&&c++<10;)l=l();if(!l||typeof l!="object"||l[Be]!==!0)continue;let f=l.when();if(kt(f))return s(i),(0,N.runWithOwner)(r,()=>typeof l.children=="function"?l.children(f):l.children)}return s(-2),(0,N.runWithOwner)(r,()=>e.fallback??null)})}var A=require("@fluixi/reactive/signal");function Ht(e){let t=Ot(e.component),{component:n,...r}=e,o=(0,A.getOwner)(),s=null,i;return(0,A.createMemo)(()=>{let a=t();return a!==i&&(s&&(0,A.disposeScope)(s),s=(0,A.createChildOwner)(o),i=a),a==null?null:typeof a=="string"?{tag:a,props:r}:(0,A.runWithOwner)(s,()=>a(r))})}var ye=require("@fluixi/reactive/signal");function Vt(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return(0,ye.createRoot)(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),w(r,e.children)&&X(e.ref,r)}),(0,ye.onCleanup)(()=>{n(),r.remove()}),null}var me=require("@fluixi/reactive/signal");function Ke(e){if(m)return e.fallback??null;let t=u.active,[n,r]=(0,me.createSignal)(!t);return t&&queueMicrotask(()=>r(!0)),(0,me.createMemo)(()=>n()?e.children:e.fallback??null,void 0,{name:"client-only"})}var Wt=Ke;var he=require("@fluixi/reactive/signal");function Ut(e){let[t,n]=(0,he.createSignal)(null),r=()=>n(null);return(0,he.createMemo)(()=>{let o=t();if(o!==null)return typeof e.fallback=="function"?e.fallback(o,r):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(s){return n(s),typeof e.fallback=="function"?e.fallback(s,r):e.fallback}})}var Bt=require("@fluixi/reactive/signal");function Kt(e){return(0,Bt.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 zt=require("@fluixi/reactive/signal");function Or(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Gt(e){return(0,zt.createMemo)(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;let s=typeof o=="function"?o():o;s!=null&&n.push(`${Or(r)}: ${s}`)}return n.join("; ")})}var Xe=1,Je=3,Ye=8,Xt;Xt=H;var Z=class{constructor(){this[Xt]=!0;this.parentNode=null;this.childNodes=[]}get firstChild(){return this.childNodes[0]??null}get lastChild(){return this.childNodes[this.childNodes.length-1]??null}get nextSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>=0?t.childNodes[n+1]??null:null}get previousSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>0?t.childNodes[n-1]??null:null}get parentElement(){return this.parentNode}appendChild(t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes.push(t),t}insertBefore(t,n){if(n==null)return this.appendChild(t);t.parentNode&&t.parentNode.removeChild(t);let r=this.childNodes.indexOf(n);return t.parentNode=this,r<0?this.childNodes.push(t):this.childNodes.splice(r,0,t),t}removeChild(t){let n=this.childNodes.indexOf(t);return n>=0&&this.childNodes.splice(n,1),t.parentNode=null,t}replaceChild(t,n){let r=this.childNodes.indexOf(n);return r>=0&&(t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes[r]=t,n.parentNode=null),n}addEventListener(){}removeEventListener(){}},Q=class e extends Z{constructor(n){super();this.nodeType=Je;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)}},ge=class e extends Z{constructor(n){super();this.nodeType=Ye;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},ze=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},Ge=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}},xe=class e extends Z{constructor(n,r=!1){super();this.nodeType=Xe;this.attributes=new Map;this.style=new ze;this.classList=new Ge(this);this.rawHTML=null;this.localName=n.toLowerCase(),this.tagName=r?n:n.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(n,r){this.attributes.set(n,String(r))}removeAttribute(n){this.attributes.delete(n)}getAttribute(n){return this.attributes.has(n)?this.attributes.get(n):null}hasAttribute(n){return this.attributes.has(n)}get id(){return this.getAttribute("id")??""}set id(n){n==null?this.removeAttribute("id"):this.setAttribute("id",n)}get className(){return this.getAttribute("class")??""}set className(n){n==null?this.removeAttribute("class"):this.setAttribute("class",n)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(n){n==null?this.removeAttribute("for"):this.setAttribute("for",n)}set value(n){n==null?this.removeAttribute("value"):this.setAttribute("value",String(n))}set checked(n){n?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(n){n?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(n){}get textContent(){return this.childNodes.map(n=>n.textContent??"").join("")}set textContent(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,n!=null&&n!==""&&this.appendChild(new Q(String(n)))}set innerText(n){this.textContent=n}set innerHTML(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=n==null?"":String(n)}cloneNode(n=!1){let r=new e(this.localName,this.isSVG);if(r.attributes=new Map(this.attributes),r.style.cssText=this.style.cssText,r.rawHTML=this.rawHTML,n)for(let o of this.childNodes)r.appendChild(o.cloneNode(!0));return r}};var kr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Yt=/&/g,Dr=/</g,_r=/>/g,$r=/"/g;function Ze(e){return e.replace(Yt,"&").replace(Dr,"<").replace(_r,">")}function Jt(e){return e.replace(Yt,"&").replace($r,""")}function qr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function Ir(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(`${qr(n)}: ${r}`)}return t.join("; ")}function jr(e){let t="",n=Ir(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${Jt(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${Jt(o)}"`}return t}function S(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 S(e());if(Array.isArray(e))return e.map(S).join("");switch(e.nodeType){case Je:return Ze(e.data??"");case Ye:return`<!--${e.data??""}-->`;case Xe:{let t=e.localName,n=`<${t}${jr(e)}>`;if(kr.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(S).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(S).join(""):""}var et=require("@fluixi/reactive/signal"),T=require("@fluixi/reactive/signal");var Zt=!1;function en(){Zt||(Zt=!0,yt({createElement:(e,t)=>new xe(e,t),createText:e=>new Q(e),createComment:e=>new ge(e)}))}function tt(e,t={}){let n=m;en(),O(!0);let r=q(t.event);try{return I(r,()=>(0,et.createRoot)(o=>{try{let s=typeof e=="function"?e():e;return S(s)}finally{o()}}))}finally{O(n)}}var Qt=!1;function Fr(){Qt||(Qt=!0,(0,T.setResourceTracker)(e=>{v()?.pending.add(e)}),(0,T.setResourceIdSource)(()=>v()?.nextResourceId()??""),(0,T.setResourceDataSink)((e,t)=>{e&&v()?.data.set(e,t)}))}var Qe=null;function nt(e){Qe=e}function Te(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let s=o;if(Qe)try{s=Qe(o,r)}catch{continue}s!==void 0&&(t[r]=s)}if(Object.keys(t).length===0)return"";let n=J(JSON.stringify(t));return`<script type="application/json" id="${j}">${n}<\/script>`}var Hr=50;async function rt(e,t={}){let n=m;en(),O(!0),Fr();let r=q(t.event);try{return await I(r,async()=>{t.preload&&await t.preload(t.event);let o,s=null,i=()=>{};(0,et.createRoot)(f=>{i=f,s=(0,T.getOwner)(),o=typeof e=="function"?e():e});let a=()=>{try{(0,T.runWithOwner)(s,()=>S(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<Hr;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await(0,T.flush)(),a()}let c=(0,T.runWithOwner)(s,()=>S(o))+Te(r);return i(),c})}finally{O(n)}}
|
package/dist/lib/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function jn(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function Fn(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function Hn(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function Vn(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 Un=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Wn=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"]),D="http://www.w3.org/2000/svg";function ht(e){return e.localName.includes("-")}function re(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(ht(e)){e[t]=n;return}x(e,t,n,r)}var oe=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function De(e,t=document){return t.querySelector(e)}function Kn(e,t=document){return Array.from(t.querySelectorAll(e))}function Bn(e,t){return e.closest(t)}function zn(e,...t){e.classList.add(...t)}function Gn(e,...t){e.classList.remove(...t)}function Xn(e,...t){t.forEach(n=>e.classList.toggle(n))}function Jn(e,t){return e.classList.contains(t)}function x(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 Yn(e,t){return e.getAttribute(t)}function Zn(e,t){e.removeAttribute(t)}function gt(e,t){Object.assign(e.style,t)}function Qn(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function er(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")gt(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else x(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function tr(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function nr(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function rr(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function or(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function ir(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function sr(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 ar(e,t=5e3){return new Promise((n,r)=>{let o=De(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=De(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 lr(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function cr(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var xt=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function ur(e){return typeof e=="object"&&e!==null&&e.$$typeof===xt}function Tt(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function fr(e){if(typeof e!="function")return!1;try{let t=e();return Tt(t)}catch{return!1}}function dr(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function pr(e){return e instanceof Node}function yr(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function mr(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as g}from"@fluixi/reactive/signal";function gr(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function xr(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function Tr(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function br(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function Er(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function Nr(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function Sr(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function vr(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function bt(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function Et(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function Nt(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function St(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function vt(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function At(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function T(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function wt(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function Ar(e){return bt(e)?{type:"router",value:e}:Nt(e)?{type:"route",value:e}:Et(e)?{type:"routes",value:e}:St(e)?{type:"outlet",value:e}:T(e)?{type:"component",value:e}:wt(e)?{type:"suspense",value:e}:vt(e)?{type:"provider",value:e}:At(e)?{type:"context",value:e}:{type:"none",value:e}}import{batch as qe,createEffect as $,createRenderEffect as p,createRoot as Pt,onCleanup as C,readChildren as Lt}from"@fluixi/reactive/signal";var m=typeof document>"u";function P(e){m=e}var k=Symbol.for("fluixi.server-node"),ie=null;function ke(e){ie=e}function _(){if(!ie)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return ie}function L(e){return e!=null&&e[k]===!0?!0:typeof Node<"u"&&e instanceof Node}function se(e){return e!=null&&e[k]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function ae(e){return e!=null&&e[k]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},_e=null;function Oe(e){_e=e}function le(){return _e}function ce(e,t){return u.active&&t.parentNode===e}function ue(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function Rt(){return u.active?u.cursor:null}function Ct(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 Mt(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 O(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&ue(t)}function Dt(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 kt(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 $r(e){return kt(Dt(e))}var Ir=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),_t={};var $e=new Map,U=new Set,X=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function je(e){if(!m)for(let t of e)U.has(t)||X.has(t)||(U.add(t),document.addEventListener(t,Ot))}function Ot(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 $t(e,t,n){if(e[`$$${t}`]=n,X.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}U.has(t)||je([t])}function Ie(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function qr(e){return!X.has(e)}function jr(e){return typeof e=="function"}function A(e,t=!1){if(m)return _().createText(e);if(u.active&&!t){let n=le()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function Fe(e,t=!1){if(m)return _().createElement(e,t);if(u.active){let n=le()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(D,e):document.createElement(e)}function Fr(e,t=!1){let n=$e.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,$e.set(e,r),r}function Hr(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function It(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?It(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Vr(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Ur(e){if(g(e)||T(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!g(t)&&!T(t);)t=t();return t}var N=0,qt=200;function jt(e,t,n,r,o){let i=r,s=new Map;return p(()=>{let a;if(T(e)&&!g(e)){if(!s.has(e)){N++;try{let l=e();s.set(e,l)}finally{N--}}for(a=s.get(e);typeof a=="function"&&g(a);)a=a()}else for(a=e();typeof a=="function"&&g(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(T(a)){if(!s.has(a)){let c=a;N++;try{let f=c();s.set(c,f)}finally{N--}}a=s.get(a)}else if(g(a))a=a();else if(a=a(),typeof a!="function"||!g(a)&&!T(a))break}N++;try{i=W(t,a,n,i,s),o(i)}finally{N--}})}function S(e,t,n,r){if(N>qt)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=A("",!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)){N++;try{o=W(e,t,n,null)}finally{N--}return()=>o}let a=jt(s(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function W(e,t,n,r,o){if(t==null||typeof t=="boolean")return R(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return R(e,r,n);if(V(t)){let s=A("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),R(e,r.slice(1),n)):h(e,s,n):r?e.replaceChild(s,r):h(e,s,n),t.then(a=>{s.parentNode===e&&W(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=A(t);return h(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=R(e,r,n)}if(r&&ae(r))return r.data=t,r;let s=A(t);return r&&r.parentNode===e?e.replaceChild(s,r):ce(e,s)||h(e,s,n),s}if(L(t))return ce(e,t)?(ue(t),t):Array.isArray(r)?(r.length===0?h(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),R(e,r.slice(1),n)):h(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):h(e,t,n)):h(e,t,n),t);if(Array.isArray(t)){let s=[],a=Array.isArray(r)?r:r?[r]:[],l=[];E(t,s,e,n,!0,o,l);let c=Ft(e,a,s,n);for(let f of l){let d=S(e,f.sig,f.marker);C(()=>{R(e,d()),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 W(e,l,n,r)}}}return R(e,r,n)}function E(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"&&!V(l)&&!g(l)&&!T(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(T(l)&&!g(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!V(c)&&!g(c)&&!T(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(g(c)){if(s){let d=A("",!0);t.push(d),s.push({marker:d,sig:c});continue}let f=c();for(;typeof f=="function"&&g(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?E(f,t,n,r,o,i):E([f],t,n,r,o,i);continue}continue}Array.isArray(c)?E(c,t,n,r,o,i,s):E([c],t,n,r,o,i,s);continue}if(V(l)){let c=A("",!0);t.push(c),l.then(f=>{if(c.parentNode){let d=[];if(E([f],d,c.parentNode,void 0,!1,i),d.length>0){c.parentNode.replaceChild(d[0],c);for(let y=1;y<d.length;y++)c.parentNode?.insertBefore(d[y],d[y-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){E(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)?E(f,t,n,r,!1,i):E([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(A(c));continue}t.push(A(String(l)))}}}}function Ft(e,t,n,r){for(let d=0;d<n.length;d++)n[d].parentNode!==null&&n[d].parentNode!==e&&(n=n.slice(),n[d]=n[d].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 d=s<o?l?n[l-1].nextSibling??void 0:n[s-l]:c;for(;l<s;)h(e,n[l++],d)}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 d=t[--i].nextSibling;h(e,n[l++],t[a++].nextSibling),h(e,n[--s],d),t[i]=t[a-1]}else{if(!f){f=new Map;let y=l;for(;y<s;)f.set(n[y],y++)}let d=f.get(t[a]);if(d!=null)if(l<d&&d<s){let y=a,ne=1;for(;++y<i&&y<s&&!(!f.has(t[y])||f.get(t[y])!==d+ne);)ne++;if(ne>d-l){let mt=t[a];for(;l<d;)h(e,n[l++],mt)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(h(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function R(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 h(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function K(e,t,n){n==null?delete e[t]:e[t]=n}function He(e,t,n){let r=n,o;return Array.isArray(n)&&(r=n[0],o=n[1]),typeof r!="function"?()=>{}:(e.addEventListener(t,r,o),()=>e.removeEventListener(t,r,o))}function Ve(e,t){let n=(r,o)=>{typeof r=="function"&&r(e,o??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let r of t)Array.isArray(r)?n(r[0],r[1]):n(r)}}function fe(e,t,n,r=!1){return typeof n!="function"?(x(e,t,n,r),()=>{}):p(()=>{let o=typeof n=="function"?n():n;x(e,t,o,r)})}function de(e,t,n){return typeof n!="function"?(K(e,t,n),()=>{}):p(()=>{let r=typeof n=="function"?n():n;K(e,t,r)})}function Ue(e,t,n){return typeof n!="function"?(x(e,t,!!n),()=>{}):p(()=>{let r=n();x(e,t,!!r)})}function B(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){p(()=>B(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 z(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(p(()=>{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 G(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 Wr(e){let{element:t,props:n,prevProps:r=_t,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!se(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===D,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"){J(c,t);continue}if(l==="use"){Ve(t,c);continue}if(l.startsWith("on:")){a.push(He(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(de(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(fe(t,l.slice(5),c,s));continue}if(l.startsWith("bool:")){a.push(Ue(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push(p(()=>B(t,c()))):B(t,c);continue}if(l==="classList"){typeof c=="function"?a.push(p(()=>z(t,c()))):z(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push(p(()=>G(t,c()))):G(t,c);continue}if(l.startsWith("on")){let y=l.slice(2).toLowerCase();f&&Ie(t,y),c&&$t(t,y,c);continue}let d=oe.has(l)||!s&&l in t;typeof c=="function"?a.push(d?de(t,l,c):fe(t,l,c,s)):a.push(p(()=>d?K(t,l,n[l]):x(t,l,n[l],s)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();Ie(t,c)}else oe.has(l)?K(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function We(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){J(o,e);continue}if(r!=="children"){if(r==="use"){Ve(e,o);continue}if(r.startsWith("on:")){He(e,r.slice(3),o);continue}if(r.startsWith("prop:")){de(e,r.slice(5),o);continue}if(r.startsWith("attr:")){fe(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){Ue(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(X.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,U.has(i)||je([i]);continue}if(r==="class"||r==="className"){B(e,o);continue}if(r==="classList"){typeof o=="function"?p(()=>z(e,o())):z(e,o);continue}if(r==="style"){typeof o=="function"?p(()=>G(e,o())):G(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=$(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});C(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=$(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});C(()=>{i()})}else p(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=$(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});C(()=>{i()})}else p(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=$(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});C(()=>{s()})}else{let i=!0;p(()=>{let s=t[r];i?(i=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof o=="function"){let i=$(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();re(e,r,s,n)});C(()=>{i()})}else p(()=>re(e,r,t[r],n))}}}function Kr(...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 Br(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 J(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 zr(e,t,n){let r=t||document.body,o=Lt(()=>e),i=[];return qe(()=>{let s=p(()=>{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),C(()=>{i.forEach(a=>a())})}),null}function Gr(e){return typeof e=="string"&&e.toLowerCase()===e}function Ke(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function Xr(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function V(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Jr(e){return typeof e=="function"&&e.length===0&&g(e)}function Be(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return Pt(s=>{qe(()=>{u.active||(t.textContent=""),S(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}var Ht="__fx_dom_create_component__",M=globalThis[Ht]??={fn:null};function Zr(e){M.fn=e}function Qr(e={}){let t=e.signalSystem?.createComponent;t&&(M.fn=t)}function ze(e,t){return M.fn?M.fn(e,t):(()=>e(t))}var eo=()=>M.fn!==null,to=()=>M.fn!==null;function no(){M.fn=null}var Y,Xe={getStore:()=>Y,run(e,t){let n=Y;Y=e;try{return t()}finally{Y=n}}},pe=Xe;function Je(e){pe=e??Xe}function I(e={}){e.locals||(e.locals=e.request?me(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 q(e,t){return pe.run(e,t)}function v(){return pe.getStore()}function ye(){return v()?.event}function Ye(){let e=ye();return e?(e.locals||(e.locals={}),e.locals):{}}var Ge=new WeakMap;function me(e){let t=Ge.get(e);return t||(t={},Ge.set(e,t)),t}import{setResourceIdSource as Vt,setServerDataGetter as Ut}from"@fluixi/reactive/signal";var j="__FX_DATA__";function Z(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var he;function Q(){let e=globalThis.__FX_DATA__;if(e)return e;if(he!==void 0)return he;let t=null;if(typeof document<"u"){let n=document.getElementById(j)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return he=t}function ge(){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 Wt=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),xe=typeof process<"u"&&process.env&&!1;function Te(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 Kt(e){ge();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Wt.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(xe&&t&&Te(`<${e}>`,t),null)}function Bt(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}ge();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(xe&&t&&Te(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function zt(e){ge();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(xe&&t&&Te(`marker <!--${e.slice(0,24)}-->`,t),null)}var Ze=!1;function Gt(){Ze||(Ze=!0,Oe({hydrateElement:Kt,hydrateText:Bt,hydrateMarker:zt}))}function be(e,t,n){Gt(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=Q(),o=n?.resourceNamespace,i=0;Vt(()=>o?`${o}:r${i++}`:`r${i++}`),Ut(r?s=>s in r?{value:r[s]}:void 0:null);try{return Be(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Ee="fluixi-island";function Xt(e){let{component:t,props:n={},name:r}=e,o=Fe(Ee),i=r??t.name??"Island";x(o,"name",i),x(o,"props",JSON.stringify(n??{}));let s=m?v():void 0;if(s){let a=s.nextIslandNamespace(i);S(o,()=>s.withResourceScope(a,()=>t(n)))}else S(o,()=>t(n));return o}var Qe=!1;function Jt(){if(Qe||typeof document>"u")return;Qe=!0;let e=document.createElement("style");e.textContent=`${Ee}{display:contents}`,document.head.appendChild(e)}function Yt(e){if(typeof document>"u")return;Jt();let t=document.querySelectorAll(Ee),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{}be(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}function Zt(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function Qt(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}import{readChildren as en}from"@fluixi/reactive/signal";function Do(e,t={}){if(typeof e=="function")return ze(e,t);if(typeof e!="string"||e.length===0)return null;let n=Ke(e);if(m)return _().createElement(e,n);let r=n?document.createElementNS(D,e):document.createElement(e);return We(r,t,n),tn(r,t),r}function tn(e,t){if(!t||t.children===void 0)return;let n=en(()=>t.children),r=o=>{S(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}import{createMemo as Ne,untrack as rt}from"@fluixi/reactive/signal";function et(e){return typeof e=="function"?e:(()=>e)}function w(e){return()=>{let t=e();return typeof t=="function"?t():t}}function tt(e){return e!=null&&e!==!1}function nt(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function nn(e){let t=w(()=>e.when),n=Ne(t,void 0),r=Ne(n,void 0);return Ne(()=>{if(r()){let i=e.children;return typeof i=="function"&&!nt(i)?typeof n=="function"?rt(()=>rt(n)?i(n()):e.fallback):i(n):i}return e.fallback},void 0,{name:"show"})}import{mapArray as rn,keyArray as on}from"@fluixi/reactive/signal";function sn(e){let t=w(()=>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 O(a),a};return e.by?on(t,e.by,(o,i)=>r(o,i),{fallback:n}):rn(t,(o,i)=>r(o,i),{fallback:n})}import{indexArray as an}from"@fluixi/reactive/signal";function ln(e){let t=w(()=>e.each);return an(t,(n,r)=>{let o=e.children(n,r);return O(o),o},{fallback:()=>e.fallback??null})}import{mapArray as vi,keyArray as Ai,indexArray as wi}from"@fluixi/reactive/signal";import{createMemo as cn}from"@fluixi/reactive/signal";var Se=Symbol("match");function un(e){return{[Se]:!0,when:w(()=>e.when),children:e.children}}function fn(e){let t=Array.isArray(e.children)?e.children:[e.children];return cn(()=>{for(let n of t){let r=n,o=0;for(;typeof r=="function"&&!r[Se]&&o++<10;)r=r();if(!r||typeof r!="object"||r[Se]!==!0)continue;let i=r.when();if(tt(i))return typeof r.children=="function"?r.children(i):r.children}return e.fallback??null})}import{createMemo as dn}from"@fluixi/reactive/signal";function pn(e){let t=et(e.component),{component:n,...r}=e;return dn(()=>{let o=t();return o==null?null:typeof o=="string"?{tag:o,props:r}:o(r)})}import{createRoot as yn,onCleanup as mn}from"@fluixi/reactive/signal";function hn(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return yn(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),S(r,e.children)&&J(e.ref,r)}),mn(()=>{n(),r.remove()}),null}import{createMemo as gn,createSignal as xn}from"@fluixi/reactive/signal";function Tn(e){let[t,n]=xn(null),r=()=>n(null);return gn(()=>{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}})}import{createMemo as bn}from"@fluixi/reactive/signal";function En(e){return bn(()=>{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(" ")})}import{createMemo as Nn}from"@fluixi/reactive/signal";function Sn(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function vn(e){return Nn(()=>{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(`${Sn(r)}: ${i}`)}return n.join("; ")})}var we=1,Re=3,Ce=8,ot;ot=k;var F=class{constructor(){this[ot]=!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(){}},H=class e extends F{constructor(n){super();this.nodeType=Re;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)}},ee=class e extends F{constructor(n){super();this.nodeType=Ce;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},ve=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},Ae=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}},te=class e extends F{constructor(n,r=!1){super();this.nodeType=we;this.attributes=new Map;this.style=new ve;this.classList=new Ae(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 H(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 An=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),st=/&/g,wn=/</g,Rn=/>/g,Cn=/"/g;function Me(e){return e.replace(st,"&").replace(wn,"<").replace(Rn,">")}function it(e){return e.replace(st,"&").replace(Cn,""")}function Mn(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function Pn(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(`${Mn(n)}: ${r}`)}return t.join("; ")}function Ln(e){let t="",n=Pn(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${it(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${it(o)}"`}return t}function b(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return Me(e);if(typeof e=="number")return Me(String(e));if(typeof e=="function")return b(e());if(Array.isArray(e))return e.map(b).join("");switch(e.nodeType){case Re:return Me(e.data??"");case Ce:return`<!--${e.data??""}-->`;case we:{let t=e.localName,n=`<${t}${Ln(e)}>`;if(An.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(b).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(b).join(""):""}import{createRoot as ut}from"@fluixi/reactive/signal";import{setResourceTracker as Dn,setResourceIdSource as kn,setResourceDataSink as _n,getOwner as On,runWithOwner as at,flush as $n}from"@fluixi/reactive/signal";var lt=!1;function ft(){lt||(lt=!0,ke({createElement:(e,t)=>new te(e,t),createText:e=>new H(e),createComment:e=>new ee(e)}))}function dt(e,t={}){let n=m;ft(),P(!0);let r=I(t.event);try{return q(r,()=>ut(o=>{try{let i=typeof e=="function"?e():e;return b(i)}finally{o()}}))}finally{P(n)}}var ct=!1;function In(){ct||(ct=!0,Dn(e=>{v()?.pending.add(e)}),kn(()=>v()?.nextResourceId()??""),_n((e,t)=>{e&&v()?.data.set(e,t)}))}var Pe=null;function pt(e){Pe=e}function Le(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(Pe)try{i=Pe(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="${j}">${n}<\/script>`}var qn=50;async function yt(e,t={}){let n=m;ft(),P(!0),In();let r=I(t.event);try{return await q(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};ut(f=>{s=f,i=On(),o=typeof e=="function"?e():e});let a=()=>{try{at(i,()=>b(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<qn;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await $n(),a()}let c=at(i,()=>b(o))+Le(r);return s(),c})}finally{P(n)}}export{pn as Dynamic,Tn as ErrorBoundary,j as FX_DATA_ID,sn as For,ln as Index,Xt as Island,oe as JSX_PROPERTIES,un as Match,hn as Portal,Wn as SVG_ELEMENTS,D as SVG_NAMESPACE,nn as Show,fn as Switch,Un as VOID_ELEMENTS,zn as addClass,$t as addDelegatedEventListener,He as addNativeEventListener,nr as appendChildren,re as applyElementProp,We as applyProps,Ve as applyUse,Sr as asComponent,Nr as asContext,br as asOutlet,Er as asProvider,Tr as asRoute,gr as asRouter,xr as asRoutes,vr as asSuspense,Rt as captureHydrationCursor,Ar as checkRenderType,En as classMap,R as cleanChildren,Hr as cloneTemplate,Bn as closest,ze as createComponent,Do as createDynamicElement,er as createElement,Fe as createNativeElement,zr as createPortal,I as createRequestContext,Fr as createTemplate,sr as delegate,je as delegateEvents,Z as escapeFxJson,Xr as escapeHTML,Vr as fnName,Ir as generateID,Yn as getAttribute,mr as getGlobal,Hn as getLitEventName,Ye as getLocals,ir as getOffset,v as getRequestContext,ye as getRequestEvent,me as getRequestLocals,Q as getServerData,$r as getStableElementId,Qn as getStyle,J as handleRef,Jn as hasClass,Zt as html,be as hydrate,O as hydrateAdvancePast,Yt as hydrateIslands,wi as indexArray,Qr as initializeIntegration,S as insert,W as insertExpression,eo as intergartionInitialized,Jr as isAccessor,T as isComponent,At as isContext,ht as isCustomElement,pr as isDOMNode,qr as isDelegatedEvent,se as isDomElement,L as isDomNode,ae as isDomText,Fn as isEventHandler,jr as isFunction,to as isIntegrationInitialized,dr as isJSXTemplate,Tt as isLitTemplateResult,Gr as isNativeElement,St as isOutlet,V as isPromise,vt as isProvider,ur as isReactElement,Nt as isRoute,bt as isRouter,Et as isRoutes,Ke as isSVGElement,m as isServer,wt as isSuspense,fr as isTemplateFactory,rr as isVisible,Ur as iterateFn,Ai as keyArray,It as makeArrayFlat,vi as mapArray,Kr as mergeProps,lr as observeIntersection,cr as observeResize,De as query,Kn as queryAll,Zr as registerCreateComponent,yr as registerGlobal,Zn as removeAttribute,tr as removeChildren,Gn as removeClass,Ie as removeDelegatedEventListener,Be as render,dt as renderToString,yt as renderToStringAsync,no as resetIntegration,Ct as runHydrationAt,q as runWithRequestContext,Mt as runWithoutHydration,or as scrollIntoView,b as serializeNode,Le as serializeResourceData,x as setAttribute,z as setClassList,B as setClassName,pt as setDataRedactor,fe as setDynamicAttribute,Ue as setDynamicBoolAttribute,de as setDynamicProperty,K as setProperty,Je as setRequestStore,P as setServerMode,G as setStyle,gt as setStyles,Vn as shouldSetAsProperty,Br as splitProps,Wr as spread,vn as styleMap,Qt as svg,jn as toAttributeName,Xn as toggleClass,ar as waitForElement};
|
|
1
|
+
function tr(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function nr(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function rr(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function or(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 ir=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),sr=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"]),O="http://www.w3.org/2000/svg";function xt(e){return e.localName.includes("-")}function re(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(xt(e)){e[t]=n;return}x(e,t,n,r)}var oe=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function Oe(e,t=document){return t.querySelector(e)}function ar(e,t=document){return Array.from(t.querySelectorAll(e))}function lr(e,t){return e.closest(t)}function cr(e,...t){e.classList.add(...t)}function ur(e,...t){e.classList.remove(...t)}function fr(e,...t){t.forEach(n=>e.classList.toggle(n))}function dr(e,t){return e.classList.contains(t)}function x(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 yr(e,t){e.removeAttribute(t)}function Tt(e,t){Object.assign(e.style,t)}function mr(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function hr(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,s])=>{if(o==="class"||o==="className")r.className=s;else if(o==="style"&&typeof s=="object")Tt(r,s);else if(o.startsWith("on")&&typeof s=="function"){let i=o.slice(2).toLowerCase();r.addEventListener(i,s)}else x(r,o,s)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function gr(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function xr(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function Tr(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function br(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Er(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function Nr(e,t,n,r){let o=s=>{let i=s.target.closest(n);i&&e.contains(i)&&r(s,i)};return e.addEventListener(t,o),()=>{e.removeEventListener(t,o)}}function Sr(e,t=5e3){return new Promise((n,r)=>{let o=Oe(e);if(o){n(o);return}let s=new MutationObserver(()=>{let a=Oe(e);a&&(s.disconnect(),clearTimeout(i),n(a))});s.observe(document.body,{childList:!0,subtree:!0});let i=setTimeout(()=>{s.disconnect(),r(new Error(`Element ${e} not found within ${t}ms`))},t)})}function wr(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(s=>{t(s.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function vr(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var bt=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function Ar(e){return typeof e=="object"&&e!==null&&e.$$typeof===bt}function Et(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Cr(e){if(typeof e!="function")return!1;try{let t=e();return Et(t)}catch{return!1}}function Rr(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Mr(e){return e instanceof Node}function Pr(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function Lr(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as g}from"@fluixi/reactive/signal";function kr(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function Dr(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function _r(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function $r(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function qr(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function Ir(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function jr(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function Fr(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function Nt(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function St(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function wt(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function vt(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function At(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function Ct(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function T(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function Rt(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function Hr(e){return Nt(e)?{type:"router",value:e}:wt(e)?{type:"route",value:e}:St(e)?{type:"routes",value:e}:vt(e)?{type:"outlet",value:e}:T(e)?{type:"component",value:e}:Rt(e)?{type:"suspense",value:e}:At(e)?{type:"provider",value:e}:Ct(e)?{type:"context",value:e}:{type:"none",value:e}}import{batch as Ie,createEffect as $,createRenderEffect as p,createRoot as Ot,onCleanup as R,readChildren as kt}from"@fluixi/reactive/signal";var m=typeof document>"u";function P(e){m=e}var k=Symbol.for("fluixi.server-node"),ie=null;function ke(e){ie=e}function D(){if(!ie)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return ie}function L(e){return e!=null&&e[k]===!0?!0:typeof Node<"u"&&e instanceof Node}function se(e){return e!=null&&e[k]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function ae(e){return e!=null&&e[k]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},De=null;function _e(e){De=e}function le(){return De}function ce(e,t){return u.active&&t.parentNode===e}function ue(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function Mt(){return u.active?u.cursor:null}function Pt(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 Lt(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 _(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&ue(t)}function Dt(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 _t(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 Zr(e){return _t(Dt(e))}var Qr=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),$t={};var $e=new Map,W=new Set,X=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function je(e){if(!m)for(let t of e)W.has(t)||X.has(t)||(W.add(t),document.addEventListener(t,qt))}function qt(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 It(e,t,n){if(e[`$$${t}`]=n,X.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=s=>{e[`$$${t}`]?.(s)};e.addEventListener(t,o),e[r]=o}return}W.has(t)||je([t])}function qe(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function eo(e){return!X.has(e)}function to(e){return typeof e=="function"}function v(e,t=!1){if(m)return D().createText(e);if(u.active&&!t){let n=le()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function Fe(e,t=!1){if(m)return D().createElement(e,t);if(u.active){let n=le()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(O,e):document.createElement(e)}function no(e,t=!1){let n=$e.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,$e.set(e,r),r}function ro(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function jt(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?jt(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function oo(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function io(e){if(g(e)||T(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!g(t)&&!T(t);)t=t();return t}var N=0,Ft=200;function Ht(e,t,n,r,o){let s=r,i=new Map;return p(()=>{let a;if(T(e)&&!g(e)){if(!i.has(e)){N++;try{let l=e();i.set(e,l)}finally{N--}}for(a=i.get(e);typeof a=="function"&&g(a);)a=a()}else for(a=e();typeof a=="function"&&g(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(T(a)){if(!i.has(a)){let c=a;N++;try{let f=c();i.set(c,f)}finally{N--}}a=i.get(a)}else if(g(a))a=a();else if(a=a(),typeof a!="function"||!g(a)&&!T(a))break}N++;try{s=U(t,a,n,s,i),o(s)}finally{N--}})}function S(e,t,n,r){if(N>Ft)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=v("",!0),e.appendChild(n));let o=r??null,s=l=>Array.isArray(l)&&l.some(c=>typeof c=="function"),i=l=>typeof l=="function"?l:()=>l;if(typeof t!="function"&&!s(t)){N++;try{o=U(e,t,n,null)}finally{N--}return()=>o}let a=Ht(i(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function U(e,t,n,r,o){if(t==null||typeof t=="boolean")return C(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return C(e,r,n);if(V(t)){let i=v("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(i,r[0]),C(e,r.slice(1),n)):h(e,i,n):r?e.replaceChild(i,r):h(e,i,n),t.then(a=>{i.parentNode===e&&U(e,a,i.nextSibling,i)}).catch(a=>{console.error("Error resolving promise in insertExpression:",a)}),i}let s=typeof t;if(s==="string"||s==="number"){if(s==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let a=v(t);return h(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=C(e,r,n)}if(r&&ae(r))return r.data=t,r;let i=v(t);return r&&r.parentNode===e?e.replaceChild(i,r):ce(e,i)||h(e,i,n),i}if(L(t))return ce(e,t)?(ue(t),t):Array.isArray(r)?(r.length===0?h(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),C(e,r.slice(1),n)):h(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):h(e,t,n)):h(e,t,n),t);if(Array.isArray(t)){let i=[],a=Array.isArray(r)?r:r?[r]:[],l=[];E(t,i,e,n,!0,o,l);let c=Vt(e,a,i,n);for(let f of l){let d=S(e,f.sig,f.marker);R(()=>{C(e,d()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(s==="object"&&t!==null&&typeof t=="object"){let i=t;if("type"in i&&"props"in i){let a=i;if(typeof a.type=="function"){let l=a.type(a.props||{});return U(e,l,n,r)}}}return C(e,r,n)}function E(e,t,n,r,o=!0,s,i){for(let a=0;a<e.length;a++){let l=e[a];if(!(l==null||typeof l=="boolean")){for(;typeof l=="function"&&!V(l)&&!g(l)&&!T(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(T(l)&&!g(l)?(s||(s=new Map),s.has(l)||s.set(l,l()),c=s.get(l)):c=l();typeof c=="function"&&!V(c)&&!g(c)&&!T(c);)s||(s=new Map),s.has(c)||s.set(c,c()),c=s.get(c);if(c==null||typeof c=="boolean")continue;if(typeof c=="function"){if(g(c)){if(i){let d=v("",!0);t.push(d),i.push({marker:d,sig:c});continue}let f=c();for(;typeof f=="function"&&g(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?E(f,t,n,r,o,s):E([f],t,n,r,o,s);continue}continue}Array.isArray(c)?E(c,t,n,r,o,s,i):E([c],t,n,r,o,s,i);continue}if(V(l)){let c=v("",!0);t.push(c),l.then(f=>{if(c.parentNode){let d=[];if(E([f],d,c.parentNode,void 0,!1,s),d.length>0){c.parentNode.replaceChild(d[0],c);for(let y=1;y<d.length;y++)c.parentNode?.insertBefore(d[y],d[y-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){E(l,t,n,r,o,s,i);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)?E(f,t,n,r,!1,s):E([f],t,n,r,!1,s);continue}}if(typeof l=="string"||typeof l=="number"){let c=String(l);if(c.trim()===""&&c!==" ")continue;t.push(v(c));continue}t.push(v(String(l)))}}}}function Vt(e,t,n,r){for(let d=0;d<n.length;d++)n[d].parentNode!==null&&n[d].parentNode!==e&&(n=n.slice(),n[d]=n[d].cloneNode(!0));let o=n.length,s=t.length,i=o,a=0,l=0,c=s>0?t[s-1].nextSibling??void 0:r,f=null;for(;a<s||l<i;){if(t[a]===n[l]){a++,l++;continue}for(;s>a&&i>l&&t[s-1]===n[i-1];)s--,i--;if(s===a){let d=i<o?l?n[l-1].nextSibling??void 0:n[i-l]:c;for(;l<i;)h(e,n[l++],d)}else if(i===l)for(;a<s;)(!f||!f.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[i-1]&&n[l]===t[s-1]){let d=t[--s].nextSibling;h(e,n[l++],t[a++].nextSibling),h(e,n[--i],d),t[s]=t[a-1]}else{if(!f){f=new Map;let y=l;for(;y<i;)f.set(n[y],y++)}let d=f.get(t[a]);if(d!=null)if(l<d&&d<i){let y=a,ne=1;for(;++y<s&&y<i&&!(!f.has(t[y])||f.get(t[y])!==d+ne);)ne++;if(ne>d-l){let gt=t[a];for(;l<d;)h(e,n[l++],gt)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(h(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function C(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 h(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function B(e,t,n){n==null?delete e[t]:e[t]=n}function He(e,t,n){let r=n,o;return Array.isArray(n)&&(r=n[0],o=n[1]),typeof r!="function"?()=>{}:(e.addEventListener(t,r,o),()=>e.removeEventListener(t,r,o))}function Ve(e,t){let n=(r,o)=>{typeof r=="function"&&r(e,o??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let r of t)Array.isArray(r)?n(r[0],r[1]):n(r)}}function fe(e,t,n,r=!1){return typeof n!="function"?(x(e,t,n,r),()=>{}):p(()=>{let o=typeof n=="function"?n():n;x(e,t,o,r)})}function de(e,t,n){return typeof n!="function"?(B(e,t,n),()=>{}):p(()=>{let r=typeof n=="function"?n():n;B(e,t,r)})}function We(e,t,n){return typeof n!="function"?(x(e,t,!!n),()=>{}):p(()=>{let r=n();x(e,t,!!r)})}function K(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){p(()=>K(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 z(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],s=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push(p(()=>{let i=!!o();for(let a of s)e.classList.toggle(a,i)}));else{let i=!!(typeof o=="function"?o():o);for(let a of s)e.classList.toggle(a,i)}}}function G(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 so(e){let{element:t,props:n,prevProps:r=$t,isSVG:o=!1,skipChildren:s=!1}=e;if(!t||!se(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let i=o||t.namespaceURI===O,a=[];for(let l in n){if(s&&l==="children")continue;let c=n[l],f=r[l];if(c===f)continue;if(l==="ref"){J(c,t);continue}if(l==="use"){Ve(t,c);continue}if(l.startsWith("on:")){a.push(He(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(de(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(fe(t,l.slice(5),c,i));continue}if(l.startsWith("bool:")){a.push(We(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push(p(()=>K(t,c()))):K(t,c);continue}if(l==="classList"){typeof c=="function"?a.push(p(()=>z(t,c()))):z(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push(p(()=>G(t,c()))):G(t,c);continue}if(l.startsWith("on")){let y=l.slice(2).toLowerCase();f&&qe(t,y),c&&It(t,y,c);continue}let d=oe.has(l)||!i&&l in t;typeof c=="function"?a.push(d?de(t,l,c):fe(t,l,c,i)):a.push(p(()=>d?B(t,l,n[l]):x(t,l,n[l],i)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();qe(t,c)}else oe.has(l)?B(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function Ue(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){J(o,e);continue}if(r!=="children"){if(r==="use"){Ve(e,o);continue}if(r.startsWith("on:")){He(e,r.slice(3),o);continue}if(r.startsWith("prop:")){de(e,r.slice(5),o);continue}if(r.startsWith("attr:")){fe(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){We(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let s=r.slice(2).toLowerCase();if(typeof o=="function")if(X.has(s)){e[`$$${s}`]=o;let i=`__fx_${s}`;if(!e[i]){let a=l=>{e[`$$${s}`]?.(l)};e.addEventListener(s,a),e[i]=a}}else e[`$$${s}`]=o,W.has(s)||je([s]);continue}if(r==="class"||r==="className"){K(e,o);continue}if(r==="classList"){typeof o=="function"?p(()=>z(e,o())):z(e,o);continue}if(r==="style"){typeof o=="function"?p(()=>G(e,o())):G(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let s=$(()=>{let i=o();for(;typeof i=="function";)i=i();e.innerHTML=i});R(()=>s())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let s=$(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();document.activeElement!==e&&(e.value=i??"")});R(()=>{s()})}else p(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let s=$(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();document.activeElement!==e&&(e.checked=i??"")});R(()=>{s()})}else p(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let s=!0,i=$(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();s?(s=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});R(()=>{i()})}else{let s=!0;p(()=>{let i=t[r];s?(s=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""})}continue}if(typeof o=="function"){let s=$(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();re(e,r,i,n)});R(()=>{s()})}else p(()=>re(e,r,t[r],n))}}}function ao(...e){let t=r=>{for(let o=e.length-1;o>=0;o--){let s=e[o];if(s&&r in s&&s[r]!==void 0)return s[r]}},n=r=>{for(let o of e)if(o&&r in o)return!0;return!1};return new Proxy({},{get:(r,o)=>t(o),has:(r,o)=>n(o),ownKeys:()=>{let r=new Set;for(let o of e)if(o)for(let s of Reflect.ownKeys(o))r.add(s);return[...r]},getOwnPropertyDescriptor:(r,o)=>n(o)?{enumerable:!0,configurable:!0,get:()=>t(o)}:void 0})}function lo(e,...t){let n=new Set;for(let i of t)for(let a of i)n.add(a);let r=i=>({enumerable:!0,configurable:!0,get:()=>e[i]}),o=t.map(i=>{let a=new Set(i);return new Proxy({},{get:(l,c)=>a.has(c)?e[c]:void 0,has:(l,c)=>a.has(c)&&c in e,ownKeys:()=>Array.from(a).filter(l=>l in e),getOwnPropertyDescriptor:(l,c)=>a.has(c)&&c in e?r(c):void 0})}),s=new Proxy({},{get:(i,a)=>n.has(a)?void 0:e[a],has:(i,a)=>!n.has(a)&&a in e,ownKeys:()=>Reflect.ownKeys(e).filter(i=>!n.has(i)),getOwnPropertyDescriptor:(i,a)=>!n.has(a)&&a in e?r(a):void 0});return[...o,s]}function J(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 co(e,t,n){let r=t||document.body,o=kt(()=>e),s=[];return Ie(()=>{let i=p(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),s.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):L(a)&&(r.appendChild(a),s.push(()=>{a.parentNode===r&&r.removeChild(a)}))});s.push(i),R(()=>{s.forEach(a=>a())})}),null}function uo(e){return typeof e=="string"&&e.toLowerCase()===e}function Be(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function fo(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function V(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function po(e){return typeof e=="function"&&e.length===0&&g(e)}function Ke(e,t,n){if(!t)throw new Error("Container element is required");let r,o,s=[];return Ot(i=>{Ie(()=>{u.active||(t.textContent=""),S(t,e)}),o=i}),()=>{o?.(),r?.(),s.forEach(i=>i()),t.textContent=""}}var Wt="__fx_dom_create_component__",M=globalThis[Wt]??={fn:null};function mo(e){M.fn=e}function ho(e={}){let t=e.signalSystem?.createComponent;t&&(M.fn=t)}function ze(e,t){return M.fn?M.fn(e,t):(()=>e(t))}var go=()=>M.fn!==null,xo=()=>M.fn!==null;function To(){M.fn=null}var Y,Xe={getStore:()=>Y,run(e,t){let n=Y;Y=e;try{return t()}finally{Y=n}}},pe=Xe;function Je(e){pe=e??Xe}function q(e={}){e.locals||(e.locals=e.request?me(e.request):{});let t=0,n=0,r=null,o=new Map,s=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${t++}`,nextResourceId:()=>{if(r===null)return`r${n++}`;let i=o.get(r)??0;return o.set(r,i+1),`${r}:r${i}`},nextIslandNamespace:i=>{let a=s.get(i)??0;return s.set(i,a+1),`${i}#${a}`},withResourceScope(i,a){let l=r;r=i;try{return a()}finally{r=l}},pending:new Set,data:new Map}}function I(e,t){return pe.run(e,t)}function w(){return pe.getStore()}function ye(){return w()?.event}function Ye(){let e=ye();return e?(e.locals||(e.locals={}),e.locals):{}}var Ge=new WeakMap;function me(e){let t=Ge.get(e);return t||(t={},Ge.set(e,t)),t}import{setResourceIdSource as Ut,setServerDataGetter as Bt}from"@fluixi/reactive/signal";var j="__FX_DATA__";function Z(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var he;function Q(){let e=globalThis.__FX_DATA__;if(e)return e;if(he!==void 0)return he;let t=null;if(typeof document<"u"){let n=document.getElementById(j)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return he=t}function ge(){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 Kt=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),xe=typeof process<"u"&&process.env&&!1;function Te(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 zt(e){ge();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Kt.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(xe&&t&&Te(`<${e}>`,t),null)}function Gt(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}ge();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(xe&&t&&Te(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Xt(e){ge();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(xe&&t&&Te(`marker <!--${e.slice(0,24)}-->`,t),null)}var Ze=!1;function Jt(){Ze||(Ze=!0,_e({hydrateElement:zt,hydrateText:Gt,hydrateMarker:Xt}))}function be(e,t,n){Jt(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=Q(),o=n?.resourceNamespace,s=0;Ut(()=>o?`${o}:r${s++}`:`r${s++}`),Bt(r?i=>i in r?{value:r[i]}:void 0:null);try{return Ke(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Ee="fluixi-island";function Yt(e){let{component:t,props:n={},name:r}=e,o=Fe(Ee),s=r??t.name??"Island";x(o,"name",s),x(o,"props",JSON.stringify(n??{}));let i=m?w():void 0;if(i){let a=i.nextIslandNamespace(s);S(o,()=>i.withResourceScope(a,()=>t(n)))}else S(o,()=>t(n));return o}var Qe=!1;function Zt(){if(Qe||typeof document>"u")return;Qe=!0;let e=document.createElement("style");e.textContent=`${Ee}{display:contents}`,document.head.appendChild(e)}function Qt(e){if(typeof document>"u")return;Zt();let t=document.querySelectorAll(Ee),n=new Map;t.forEach(r=>{let o=r.getAttribute("name")??"",s=n.get(o)??0;n.set(o,s+1);let i=e[o];if(!i){typeof process>"u"&&console.warn(`[fluixi] island "${o}" has no component in the registry — left static.`);return}let a={};try{a=JSON.parse(r.getAttribute("props")||"{}")}catch{}be(()=>i(a),r,{resourceNamespace:`${o}#${s}`})})}function en(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function tn(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}import{readChildren as nn}from"@fluixi/reactive/signal";function Go(e,t={}){if(typeof e=="function")return ze(e,t);if(typeof e!="string"||e.length===0)return null;let n=Be(e);if(m)return D().createElement(e,n);let r=n?document.createElementNS(O,e):document.createElement(e);return Ue(r,t,n),rn(r,t),r}function rn(e,t){if(!t||t.children===void 0)return;let n=nn(()=>t.children),r=o=>{S(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}import{createChildOwner as on,createMemo as Ne,disposeScope as sn,getOwner as an,runWithOwner as ln,untrack as rt}from"@fluixi/reactive/signal";function et(e){return typeof e=="function"?e:(()=>e)}function A(e){return()=>{let t=e();return typeof t=="function"?t():t}}function tt(e){return e!=null&&e!==!1}function nt(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function cn(e){let t=A(()=>e.when),n=Ne(t,void 0),r=Ne(n,void 0),o=an(),s=null,i=null,a=l=>{l!==i&&(s&&sn(s),s=on(o),i=l)};return Ne(()=>{let l=r();return a(l?"when":"fallback"),ln(s,()=>{if(l){let c=e.children;return typeof c=="function"&&!nt(c)?typeof n=="function"?rt(()=>rt(n)?c(n()):e.fallback):c(n):c}return e.fallback});return e.fallback??null},void 0,{name:"show"})}import{mapArray as un,keyArray as fn}from"@fluixi/reactive/signal";function dn(e){let t=A(()=>e.each),n=()=>e.fallback??null,r=(o,s)=>{let i=e.children,a=Array.isArray(i)?i.map(l=>typeof l=="function"?l(o,s):l):typeof i=="function"?i(o,s):i;return _(a),a};return e.by?fn(t,e.by,(o,s)=>r(o,s),{fallback:n}):un(t,(o,s)=>r(o,s),{fallback:n})}import{indexArray as pn}from"@fluixi/reactive/signal";function yn(e){let t=A(()=>e.each);return pn(t,(n,r)=>{let o=e.children(n,r);return _(o),o},{fallback:()=>e.fallback??null})}import{mapArray as Ui,keyArray as Bi,indexArray as Ki}from"@fluixi/reactive/signal";import{createMemo as mn,createChildOwner as hn,disposeScope as gn,getOwner as xn,runWithOwner as ot}from"@fluixi/reactive/signal";var Se=Symbol("match");function Tn(e){return{[Se]:!0,when:A(()=>e.when),get children(){return e.children}}}function bn(e){let t=Array.isArray(e.children)?e.children:[e.children],n=xn(),r=null,o=-1,s=i=>{i!==o&&(r&&gn(r),r=hn(n),o=i)};return mn(()=>{for(let i=0;i<t.length;i+=1){let l=t[i],c=0;for(;typeof l=="function"&&!l[Se]&&c++<10;)l=l();if(!l||typeof l!="object"||l[Se]!==!0)continue;let f=l.when();if(tt(f))return s(i),ot(r,()=>typeof l.children=="function"?l.children(f):l.children)}return s(-2),ot(r,()=>e.fallback??null)})}import{createMemo as En,createChildOwner as Nn,disposeScope as Sn,getOwner as wn,runWithOwner as vn}from"@fluixi/reactive/signal";function An(e){let t=et(e.component),{component:n,...r}=e,o=wn(),s=null,i;return En(()=>{let a=t();return a!==i&&(s&&Sn(s),s=Nn(o),i=a),a==null?null:typeof a=="string"?{tag:a,props:r}:vn(s,()=>a(r))})}import{createRoot as Cn,onCleanup as Rn}from"@fluixi/reactive/signal";function Mn(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return Cn(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),S(r,e.children)&&J(e.ref,r)}),Rn(()=>{n(),r.remove()}),null}import{createMemo as Pn,createSignal as Ln}from"@fluixi/reactive/signal";function it(e){if(m)return e.fallback??null;let t=u.active,[n,r]=Ln(!t);return t&&queueMicrotask(()=>r(!0)),Pn(()=>n()?e.children:e.fallback??null,void 0,{name:"client-only"})}var On=it;import{createMemo as kn,createSignal as Dn}from"@fluixi/reactive/signal";function _n(e){let[t,n]=Dn(null),r=()=>n(null);return kn(()=>{let o=t();if(o!==null)return typeof e.fallback=="function"?e.fallback(o,r):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(s){return n(s),typeof e.fallback=="function"?e.fallback(s,r):e.fallback}})}import{createMemo as $n}from"@fluixi/reactive/signal";function qn(e){return $n(()=>{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(" ")})}import{createMemo as In}from"@fluixi/reactive/signal";function jn(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Fn(e){return In(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;let s=typeof o=="function"?o():o;s!=null&&n.push(`${jn(r)}: ${s}`)}return n.join("; ")})}var Ae=1,Ce=3,Re=8,st;st=k;var F=class{constructor(){this[st]=!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(){}},H=class e extends F{constructor(n){super();this.nodeType=Ce;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)}},ee=class e extends F{constructor(n){super();this.nodeType=Re;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},we=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}},te=class e extends F{constructor(n,r=!1){super();this.nodeType=Ae;this.attributes=new Map;this.style=new we;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 H(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 Hn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),lt=/&/g,Vn=/</g,Wn=/>/g,Un=/"/g;function Me(e){return e.replace(lt,"&").replace(Vn,"<").replace(Wn,">")}function at(e){return e.replace(lt,"&").replace(Un,""")}function Bn(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function Kn(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(`${Bn(n)}: ${r}`)}return t.join("; ")}function zn(e){let t="",n=Kn(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${at(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${at(o)}"`}return t}function b(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return Me(e);if(typeof e=="number")return Me(String(e));if(typeof e=="function")return b(e());if(Array.isArray(e))return e.map(b).join("");switch(e.nodeType){case Ce:return Me(e.data??"");case Re:return`<!--${e.data??""}-->`;case Ae:{let t=e.localName,n=`<${t}${zn(e)}>`;if(Hn.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(b).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(b).join(""):""}import{createRoot as dt}from"@fluixi/reactive/signal";import{setResourceTracker as Gn,setResourceIdSource as Xn,setResourceDataSink as Jn,getOwner as Yn,runWithOwner as ct,flush as Zn}from"@fluixi/reactive/signal";var ut=!1;function pt(){ut||(ut=!0,ke({createElement:(e,t)=>new te(e,t),createText:e=>new H(e),createComment:e=>new ee(e)}))}function yt(e,t={}){let n=m;pt(),P(!0);let r=q(t.event);try{return I(r,()=>dt(o=>{try{let s=typeof e=="function"?e():e;return b(s)}finally{o()}}))}finally{P(n)}}var ft=!1;function Qn(){ft||(ft=!0,Gn(e=>{w()?.pending.add(e)}),Xn(()=>w()?.nextResourceId()??""),Jn((e,t)=>{e&&w()?.data.set(e,t)}))}var Pe=null;function mt(e){Pe=e}function Le(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let s=o;if(Pe)try{s=Pe(o,r)}catch{continue}s!==void 0&&(t[r]=s)}if(Object.keys(t).length===0)return"";let n=Z(JSON.stringify(t));return`<script type="application/json" id="${j}">${n}<\/script>`}var er=50;async function ht(e,t={}){let n=m;pt(),P(!0),Qn();let r=q(t.event);try{return await I(r,async()=>{t.preload&&await t.preload(t.event);let o,s=null,i=()=>{};dt(f=>{i=f,s=Yn(),o=typeof e=="function"?e():e});let a=()=>{try{ct(s,()=>b(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<er;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await Zn(),a()}let c=ct(s,()=>b(o))+Le(r);return i(),c})}finally{P(n)}}export{it as ClientOnly,An as Dynamic,_n as ErrorBoundary,j as FX_DATA_ID,dn as For,yn as Index,Yt as Island,oe as JSX_PROPERTIES,Tn as Match,On as NoSsr,Mn as Portal,sr as SVG_ELEMENTS,O as SVG_NAMESPACE,cn as Show,bn as Switch,ir as VOID_ELEMENTS,cr as addClass,It as addDelegatedEventListener,He as addNativeEventListener,xr as appendChildren,re as applyElementProp,Ue as applyProps,Ve as applyUse,jr as asComponent,Ir as asContext,$r as asOutlet,qr as asProvider,_r as asRoute,kr as asRouter,Dr as asRoutes,Fr as asSuspense,Mt as captureHydrationCursor,Hr as checkRenderType,qn as classMap,C as cleanChildren,ro as cloneTemplate,lr as closest,ze as createComponent,Go as createDynamicElement,hr as createElement,Fe as createNativeElement,co as createPortal,q as createRequestContext,no as createTemplate,Nr as delegate,je as delegateEvents,Z as escapeFxJson,fo as escapeHTML,oo as fnName,Qr as generateID,pr as getAttribute,Lr as getGlobal,rr as getLitEventName,Ye as getLocals,Er as getOffset,w as getRequestContext,ye as getRequestEvent,me as getRequestLocals,Q as getServerData,Zr as getStableElementId,mr as getStyle,J as handleRef,dr as hasClass,en as html,be as hydrate,_ as hydrateAdvancePast,Qt as hydrateIslands,Ki as indexArray,ho as initializeIntegration,S as insert,U as insertExpression,go as intergartionInitialized,po as isAccessor,T as isComponent,Ct as isContext,xt as isCustomElement,Mr as isDOMNode,eo as isDelegatedEvent,se as isDomElement,L as isDomNode,ae as isDomText,nr as isEventHandler,to as isFunction,xo as isIntegrationInitialized,Rr as isJSXTemplate,Et as isLitTemplateResult,uo as isNativeElement,vt as isOutlet,V as isPromise,At as isProvider,Ar as isReactElement,wt as isRoute,Nt as isRouter,St as isRoutes,Be as isSVGElement,m as isServer,Rt as isSuspense,Cr as isTemplateFactory,Tr as isVisible,io as iterateFn,Bi as keyArray,jt as makeArrayFlat,Ui as mapArray,ao as mergeProps,wr as observeIntersection,vr as observeResize,Oe as query,ar as queryAll,mo as registerCreateComponent,Pr as registerGlobal,yr as removeAttribute,gr as removeChildren,ur as removeClass,qe as removeDelegatedEventListener,Ke as render,yt as renderToString,ht as renderToStringAsync,To as resetIntegration,Pt as runHydrationAt,I as runWithRequestContext,Lt as runWithoutHydration,br as scrollIntoView,b as serializeNode,Le as serializeResourceData,x as setAttribute,z as setClassList,K as setClassName,mt as setDataRedactor,fe as setDynamicAttribute,We as setDynamicBoolAttribute,de as setDynamicProperty,B as setProperty,Je as setRequestStore,P as setServerMode,G as setStyle,Tt as setStyles,or as shouldSetAsProperty,lo as splitProps,so as spread,Fn as styleMap,tn as svg,tr as toAttributeName,fr as toggleClass,Sr as waitForElement};
|