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

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.
@@ -0,0 +1 @@
1
+ "use strict";var q=Object.defineProperty;var Be=Object.getOwnPropertyDescriptor;var ze=Object.getOwnPropertyNames;var qe=Object.prototype.hasOwnProperty;var Ge=(e,t)=>{for(var n in t)q(e,n,{get:t[n],enumerable:!0})},Xe=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ze(t))!qe.call(e,i)&&i!==n&&q(e,i,{get:()=>t[i],enumerable:!(r=Be(t,i))||r.enumerable});return e};var Je=e=>Xe(q({},"__esModule",{value:!0}),e);var ht={};Ge(ht,{Dynamic:()=>fe,ErrorBoundary:()=>de,For:()=>ie,Index:()=>se,Match:()=>ce,Portal:()=>ue,Show:()=>oe,Switch:()=>le,batch:()=>d.batch,classMap:()=>pe,createComponent:()=>Fe,createComputed:()=>d.createComputed,createContext:()=>d.createContext,createEffect:()=>d.createEffect,createElement:()=>he,createMemo:()=>d.createMemo,createRenderEffect:()=>d.createRenderEffect,createResource:()=>d.createResource,createRoot:()=>d.createRoot,createSignal:()=>d.createSignal,delegateEvents:()=>ee,effect:()=>d.effect,hydrate:()=>re,indexArray:()=>S.indexArray,insert:()=>k,keyArray:()=>S.keyArray,mapArray:()=>S.mapArray,memo:()=>d.memo,onCleanup:()=>d.onCleanup,render:()=>$,setAttribute:()=>w,setClassName:()=>L,setProperty:()=>R,setStyle:()=>I,signal:()=>d.signal,spread:()=>Oe,store:()=>d.store,styleMap:()=>ye,untrack:()=>d.untrack,useContext:()=>d.useContext});module.exports=Je(ht);var me="http://www.w3.org/2000/svg";var G=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function w(e,t,n,r=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function Ye(e,t){Object.assign(e.style,t)}function he(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([i,a])=>{if(i==="class"||i==="className")r.className=a;else if(i==="style"&&typeof a=="object")Ye(r,a);else if(i.startsWith("on")&&typeof a=="function"){let c=i.slice(2).toLowerCase();r.addEventListener(c,a)}else w(r,i,a)}),n.forEach(i=>{typeof i=="string"?r.appendChild(document.createTextNode(i)):r.appendChild(i)}),r}var gt=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;var b=require("@fluixi/reactive/signal");var xe="1.0.0-alpha.78";var ge=require("@fluixi/reactive/version"),g={dom:xe,reactive:ge.VERSION};function be(e){g.core&&e.setAttribute("fluixi",g.core),e.setAttribute("fx-dom",g.dom),e.setAttribute("fx-reactive",g.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=g)}function Te(){let e=[g.core,g.dom,g.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${g.core??"(absent)"}, dom ${g.dom}, reactive ${g.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function P(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var m=require("@fluixi/reactive/signal");var X=typeof document>"u";var J=Symbol.for("fluixi.server-node"),Ee=null;function we(){if(!Ee)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return Ee}function O(e){return e!=null&&e[J]===!0?!0:typeof Node<"u"&&e instanceof Node}function Ne(e){return e!=null&&e[J]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Ae(e){return e!=null&&e[J]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},Se=null;function ve(e){Se=e}function Ce(){return Se}function Y(e,t){return u.active&&t.parentNode===e}function Z(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function _(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Z(t)}var Ze={};var Q=new Set,Le=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function ee(e){if(!X)for(let t of e)Q.has(t)||Le.has(t)||(Q.add(t),document.addEventListener(t,Qe))}function Qe(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,Le.has(t)){let r=`__fx_${t}`;if(!e[r]){let i=a=>{e[`$$${t}`]?.(a)};e.addEventListener(t,i),e[r]=i}return}Q.has(t)||ee([t])}function Pe(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function v(e,t=!1){if(X)return we().createText(e);if(u.active&&!t){let n=Ce()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}var A=0,tt=200;function nt(e,t,n,r,i){let a=r,c=new Map;return(0,m.createRenderEffect)(()=>{let s;if(P(e)&&!(0,b.isSignal)(e)){if(!c.has(e)){A++;try{let o=e();c.set(e,o)}finally{A--}}for(s=c.get(e);typeof s=="function"&&(0,b.isSignal)(s);)s=s()}else for(s=e();typeof s=="function"&&(0,b.isSignal)(s);)s=s();{let o=0;for(;typeof s=="function"&&o++<50;)if(P(s)){if(!c.has(s)){let l=s;A++;try{let f=l();c.set(l,f)}finally{A--}}s=c.get(s)}else if((0,b.isSignal)(s))s=s();else if(s=s(),typeof s!="function"||!(0,b.isSignal)(s)&&!P(s))break}A++;try{a=D(t,s,n,a,c),i(a)}finally{A--}})}function k(e,t,n,r){if(A>tt)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=v("",!0),e.appendChild(n));let i=r??null,a=o=>Array.isArray(o)&&o.some(l=>typeof l=="function"),c=o=>typeof o=="function"?o:()=>o;if(typeof t!="function"&&!a(t)){A++;try{i=D(e,t,n,i)}finally{A--}return()=>i}let s=nt(c(t),e,n,i,o=>{i=o});return()=>(s?.(),i)}function D(e,t,n,r,i){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(F(t)){let c=v("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(c,r[0]),M(e,r.slice(1),n)):x(e,c,n):r?e.replaceChild(c,r):x(e,c,n),t.then(s=>{c.parentNode===e&&D(e,s,c.nextSibling,c)}).catch(s=>{console.error("Error resolving promise in insertExpression:",s)}),c}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let s=v(t);return x(e,s,n),s}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=M(e,r,n)}if(r&&Ae(r))return r.data=t,r;let c=v(t);return r&&r.parentNode===e?e.replaceChild(c,r):Y(e,c)||x(e,c,n),c}if(O(t))return Y(e,t)?(Z(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 c=[],s=Array.isArray(r)?r:r?[r]:[],o=[];N(t,c,e,n,!0,i,o);let l=rt(e,s,c,n);for(let f of o){let p=k(e,f.sig,f.marker);(0,m.onCleanup)(()=>{M(e,p()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return l}if(a==="object"&&t!==null&&typeof t=="object"){let c=t;if("type"in c&&"props"in c){let s=c;if(typeof s.type=="function"){let o=s.type(s.props||{});return D(e,o,n,r)}}}return M(e,r,n)}function N(e,t,n,r,i=!0,a,c){for(let s=0;s<e.length;s++){let o=e[s];if(!(o==null||typeof o=="boolean")){for(;typeof o=="function"&&!F(o)&&!(0,b.isSignal)(o)&&!P(o)&&(o=o(),!(o==null||typeof o=="boolean")););if(!(o==null||typeof o=="boolean")){if(typeof o=="function"){let l;for(P(o)&&!(0,b.isSignal)(o)?(a||(a=new Map),a.has(o)||a.set(o,o()),l=a.get(o)):l=o();typeof l=="function"&&!F(l)&&!(0,b.isSignal)(l)&&!P(l);)a||(a=new Map),a.has(l)||a.set(l,l()),l=a.get(l);if(l==null||typeof l=="boolean")continue;if(typeof l=="function"){if((0,b.isSignal)(l)){if(c){let p=v("",!0);t.push(p),c.push({marker:p,sig:l});continue}let f=l();for(;typeof f=="function"&&(0,b.isSignal)(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?N(f,t,n,r,i,a):N([f],t,n,r,i,a);continue}continue}Array.isArray(l)?N(l,t,n,r,i,a,c):N([l],t,n,r,i,a,c);continue}if(F(o)){let l=v("",!0);t.push(l),o.then(f=>{if(l.parentNode){let p=[];if(N([f],p,l.parentNode,void 0,!1,a),p.length>0){l.parentNode.replaceChild(p[0],l);for(let y=1;y<p.length;y++)l.parentNode?.insertBefore(p[y],p[y-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(o)){N(o,t,n,r,i,a,c);continue}if(O(o)){t.push(o);continue}if(typeof o=="object"&&o!==null&&"type"in o&&"props"in o){let l=o;if(typeof l.type=="function"){let f=l.type(l.props||{});Array.isArray(f)?N(f,t,n,r,!1,a):N([f],t,n,r,!1,a);continue}}if(typeof o=="string"||typeof o=="number"){let l=String(o);if(l.trim()===""&&l!==" ")continue;t.push(v(l));continue}t.push(v(String(o)))}}}}function rt(e,t,n,r){for(let p=0;p<n.length;p++){let y=n[p].parentNode;y!==null&&y!==e&&y.nodeType!==11&&(n=n.slice(),n[p]=n[p].cloneNode(!0))}let i=n.length,a=t.length,c=i,s=0,o=0,l=a>0?t[a-1].nextSibling??void 0:r,f=null;for(;s<a||o<c;){if(t[s]===n[o]){s++,o++;continue}for(;a>s&&c>o&&t[a-1]===n[c-1];)a--,c--;if(a===s){let p=c<i?o?n[o-1].nextSibling??void 0:n[c-o]:l;for(;o<c;)x(e,n[o++],p)}else if(c===o)for(;s<a;)(!f||!f.has(t[s]))&&t[s].parentNode===e&&e.removeChild(t[s]),s++;else if(t[s]===n[c-1]&&n[o]===t[a-1]){let p=t[--a].nextSibling;x(e,n[o++],t[s++].nextSibling),x(e,n[--c],p),t[a]=t[s-1]}else{if(!f){f=new Map;let y=o;for(;y<c;)f.set(n[y],y++)}let p=f.get(t[s]);if(p!=null)if(o<p&&p<c){let y=s,z=1;for(;++y<a&&y<c&&!(!f.has(t[y])||f.get(t[y])!==p+z);)z++;if(z>p-o){let Ke=t[s];for(;o<p;)x(e,n[o++],Ke)}else t[s].parentNode===e?e.replaceChild(n[o++],t[s++]):(x(e,n[o++],l),s++)}else s++;else t[s].parentNode===e&&e.removeChild(t[s]),s++}}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 R(e,t,n){n==null?delete e[t]:e[t]=n}function ot(e,t,n){let r=n,i;return Array.isArray(n)&&(r=n[0],i=n[1]),typeof r!="function"?()=>{}:(e.addEventListener(t,r,i),()=>e.removeEventListener(t,r,i))}function it(e,t){let n=(r,i)=>{typeof r=="function"&&r(e,i??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let r of t)Array.isArray(r)?n(r[0],r[1]):n(r)}}function Me(e,t,n,r=!1){return typeof n!="function"?(w(e,t,n,r),()=>{}):(0,m.createRenderEffect)(()=>{let i=typeof n=="function"?n():n;w(e,t,i,r)})}function Re(e,t,n){return typeof n!="function"?(R(e,t,n),()=>{}):(0,m.createRenderEffect)(()=>{let r=typeof n=="function"?n():n;R(e,t,r)})}function st(e,t,n){return typeof n!="function"?(w(e,t,!!n),()=>{}):(0,m.createRenderEffect)(()=>{let r=n();w(e,t,!!r)})}function L(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,m.createRenderEffect)(()=>L(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 i=t[r];return typeof i=="function"?i():!!i}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function ke(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let i=t[r],a=r.split(/\s+/).filter(Boolean);if(typeof i=="function"&&n)n.push((0,m.createRenderEffect)(()=>{let c=!!i();for(let s of a)e.classList.toggle(s,c)}));else{let c=!!(typeof i=="function"?i():i);for(let s of a)e.classList.toggle(s,c)}}}function I(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 i=n[r];i==null?e.style[r]="":e.style[r]=i}}function Oe(e){let{element:t,props:n,prevProps:r=Ze,isSVG:i=!1,skipChildren:a=!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 c=i||t.namespaceURI===me,s=[];for(let o in n){if(a&&o==="children")continue;let l=n[o],f=r[o];if(l===f)continue;if(o==="ref"){te(l,t);continue}if(o==="use"){it(t,l);continue}if(o.startsWith("on:")){s.push(ot(t,o.slice(3),l));continue}if(o.startsWith("prop:")){s.push(Re(t,o.slice(5),l));continue}if(o.startsWith("attr:")){s.push(Me(t,o.slice(5),l,c));continue}if(o.startsWith("bool:")){s.push(st(t,o.slice(5),l));continue}if(o==="class"||o==="className"){typeof l=="function"?s.push((0,m.createRenderEffect)(()=>L(t,l()))):L(t,l);continue}if(o==="classList"){typeof l=="function"?s.push((0,m.createRenderEffect)(()=>ke(t,l()))):ke(t,l,s);continue}if(o==="style"){typeof l=="function"?s.push((0,m.createRenderEffect)(()=>I(t,l()))):I(t,l);continue}if(o.startsWith("on")){let y=o.slice(2).toLowerCase();f&&Pe(t,y),l&&et(t,y,l);continue}let p=G.has(o)||!c&&o in t;typeof l=="function"?s.push(p?Re(t,o,l):Me(t,o,l,c)):s.push((0,m.createRenderEffect)(()=>p?R(t,o,n[o]):w(t,o,n[o],c)))}for(let o in r)if(!(o in n))if(o.startsWith("on")){let l=o.slice(2).toLowerCase();Pe(t,l)}else G.has(o)?R(t,o,null):t.removeAttribute(o);return()=>{s.forEach(o=>o())}}function te(e,t){if(e){if(O(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 F(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function $(e,t,n){if(!t)throw new Error("Container element is required");let r,i,a=[];return(0,m.createRoot)(c=>{(0,m.batch)(()=>{u.active||(t.textContent=""),be(t),Te(),k(t,e)}),i=c}),()=>{i?.(),r?.(),a.forEach(c=>c()),t.textContent=""}}var at="__fx_dom_create_component__",_e=globalThis[at]??={fn:null};function Fe(e,t){return _e.fn?_e.fn(e,t):(()=>e(t))}var j=require("@fluixi/reactive/signal");var ct="__FX_DATA__";var ne;function De(){let e=globalThis.__FX_DATA__;if(e)return e;if(ne!==void 0)return ne;let t=null;if(typeof document<"u"){let n=document.getElementById(ct)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return ne=t}function H(){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 lt=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),V=typeof process<"u"&&process.env&&!1;function U(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 ft(e){H();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(lt.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(V&&t&&U(`<${e}>`,t),null)}function ut(e){H();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(u.cursor=t.nextSibling,t):(V&&t&&U(`<${e}> (static)`,t),null)}function dt(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}H();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(V&&t&&U(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function pt(e){H();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(V&&t&&U(`marker <!--${e.slice(0,24)}-->`,t),null)}var Ie=!1;function yt(){Ie||(Ie=!0,ve({hydrateElement:ft,hydrateText:dt,hydrateMarker:pt,hydrateStatic:ut}))}function re(e,t,n){yt(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=De(),i=n?.resourceNamespace,a=0;(0,j.setResourceIdSource)(()=>i?`${i}:r${a++}`:`r${a++}`),(0,j.setServerDataGetter)(r?c=>c in r?{value:r[c]}:void 0:null);try{return $(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var h=require("@fluixi/reactive/signal");function $e(e){return typeof e=="function"?e:(()=>e)}function C(e){return()=>{let t=e();return typeof t=="function"?t():t}}function je(e){return e!=null&&e!==!1}function He(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function oe(e){let t=C(()=>e.when),n=(0,h.createMemo)(t,void 0),r=(0,h.createMemo)(n,void 0),i=(0,h.getOwner)(),a=null,c=null,s=o=>{o!==c&&(a&&(0,h.disposeScope)(a),a=(0,h.createChildOwner)(i),c=o)};return(0,h.createMemo)(()=>{let o=r();return s(o?"when":"fallback"),(0,h.runWithOwner)(a,()=>{if(o){let l=e.children;return typeof l=="function"&&!He(l)?typeof n=="function"?(0,h.untrack)(()=>(0,h.untrack)(n)?l(n()):e.fallback):l(n):l}return e.fallback});return e.fallback??null},void 0,{name:"show"})}var W=require("@fluixi/reactive/signal");function ie(e){let t=C(()=>e.each),n=()=>e.fallback??null,r=(i,a)=>{let c=e.children,s=Array.isArray(c)?c.map(o=>typeof o=="function"?o(i,a):o):typeof c=="function"?c(i,a):c;return _(s),s};return e.by?(0,W.keyArray)(t,e.by,(i,a)=>r(i,a),{fallback:n}):(0,W.mapArray)(t,(i,a)=>r(i,a),{fallback:n})}var Ve=require("@fluixi/reactive/signal");function se(e){let t=C(()=>e.each);return(0,Ve.indexArray)(t,(n,r)=>{let i=e.children(n,r);return _(i),i},{fallback:()=>e.fallback??null})}var S=require("@fluixi/reactive/signal");var T=require("@fluixi/reactive/signal");var ae=Symbol("match");function ce(e){return{[ae]:!0,when:C(()=>e.when),get children(){return e.children}}}function le(e){let t=Array.isArray(e.children)?e.children:[e.children],n=(0,T.getOwner)(),r=null,i=-1,a=c=>{c!==i&&(r&&(0,T.disposeScope)(r),r=(0,T.createChildOwner)(n),i=c)};return(0,T.createMemo)(()=>{for(let c=0;c<t.length;c+=1){let o=t[c],l=0;for(;typeof o=="function"&&!o[ae]&&l++<10;)o=o();if(!o||typeof o!="object"||o[ae]!==!0)continue;let f=o.when();if(je(f))return a(c),(0,T.runWithOwner)(r,()=>typeof o.children=="function"?o.children(f):o.children)}return a(-2),(0,T.runWithOwner)(r,()=>e.fallback??null)})}var E=require("@fluixi/reactive/signal");function fe(e){let t=$e(e.component),{component:n,...r}=e,i=(0,E.getOwner)(),a=null,c;return(0,E.createMemo)(()=>{let s=t();return s!==c&&(a&&(0,E.disposeScope)(a),a=(0,E.createChildOwner)(i),c=s),s==null?null:typeof s=="string"?{tag:s,props:r}:(0,E.runWithOwner)(a,()=>s(r))})}var K=require("@fluixi/reactive/signal");function ue(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return(0,K.createRoot)(i=>{n=i,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),k(r,e.children)&&te(e.ref,r)}),(0,K.onCleanup)(()=>{n(),r.remove()}),null}var B=require("@fluixi/reactive/signal");function de(e){let[t,n]=(0,B.createSignal)(null),r=()=>n(null);return(0,B.createMemo)(()=>{let i=t();if(i!==null)return typeof e.fallback=="function"?e.fallback(i,r):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(a){return n(a),typeof e.fallback=="function"?e.fallback(a,r):e.fallback}})}var Ue=require("@fluixi/reactive/signal");function pe(e){return(0,Ue.createMemo)(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,i]of Object.entries(t)){if(!r)continue;(typeof i=="function"?i():i)&&n.push(r)}return n.join(" ")})}var We=require("@fluixi/reactive/signal");function mt(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function ye(e){return(0,We.createMemo)(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,i]of Object.entries(t)){if(!r)continue;let a=typeof i=="function"?i():i;a!=null&&n.push(`${mt(r)}: ${a}`)}return n.join("; ")})}var d=require("@fluixi/reactive");
@@ -0,0 +1,20 @@
1
+ /**
2
+ * CDN entry: the browser half of the surface, without the SSR renderer.
3
+ *
4
+ * <script src="https://.../@fluixi/dom/dom-client.global.js"></script>
5
+ * const count = FluixiDOM.signal(0);
6
+ * FluixiDOM.render(() => App(), document.getElementById('root'));
7
+ *
8
+ * Same shape as `dom.global.js` and the same global name, minus the string renderer,
9
+ * node serialisation, template parsing and the request context. A `<script>` tag
10
+ * cannot tree-shake, so anything reachable from the entry ships — which makes the
11
+ * server half pure weight for a page that renders in a browser. Measured against the
12
+ * full build: 21.0 kB gzipped → 12.2 kB.
13
+ *
14
+ * `hydrate` stays: a page hydrating server-rendered HTML runs in the browser, and it
15
+ * is the one thing here that touches SSR output. Use `dom.global.js` if you actually
16
+ * render to a string in the browser, which is rare outside tests.
17
+ */
18
+ export { render, hydrate, insert, spread, createElement, createComponent, setAttribute, setProperty, setClassName, setStyle, classMap, styleMap, delegateEvents, Show, For, Index, Switch, Match, Portal, Dynamic, ErrorBoundary, mapArray, indexArray, keyArray, } from '../lib/index.js';
19
+ export { signal, memo, effect, store, createSignal, createMemo, createEffect, createComputed, createRenderEffect, createRoot, createResource, createContext, useContext, onCleanup, batch, untrack, } from '@fluixi/reactive';
20
+ //# sourceMappingURL=dom-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dom-client.d.ts","sourceRoot":"","sources":["../../src/cdn/dom-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAEL,MAAM,EACN,OAAO,EACP,MAAM,EACN,MAAM,EACN,aAAa,EACb,eAAe,EAEf,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,QAAQ,EAER,cAAc,EAEd,IAAI,EACJ,GAAG,EACH,KAAK,EACL,MAAM,EACN,KAAK,EACL,MAAM,EACN,OAAO,EACP,aAAa,EAEb,QAAQ,EACR,UAAU,EACV,QAAQ,GACT,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAEL,MAAM,EACN,IAAI,EACJ,MAAM,EACN,KAAK,EACL,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,cAAc,EACd,aAAa,EACb,UAAU,EACV,SAAS,EACT,KAAK,EACL,OAAO,GACR,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1 @@
1
+ "use strict";var FluixiDOM=(()=>{var Pe=Object.defineProperty;var Mn=Object.getOwnPropertyDescriptor;var Rn=Object.getOwnPropertyNames;var Dn=Object.prototype.hasOwnProperty;var jn=(e,t)=>{for(var n in t)Pe(e,n,{get:t[n],enumerable:!0})},In=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Rn(t))!Dn.call(e,i)&&i!==n&&Pe(e,i,{get:()=>t[i],enumerable:!(r=Mn(t,i))||r.enumerable});return e};var qn=e=>In(Pe({},"__esModule",{value:!0}),e);var eo={};jn(eo,{Dynamic:()=>Ge,ErrorBoundary:()=>Je,For:()=>Ue,Index:()=>We,Match:()=>Be,Portal:()=>Xe,Show:()=>He,Switch:()=>Ke,batch:()=>R,classMap:()=>Ye,createComponent:()=>Ut,createComputed:()=>wn,createContext:()=>Ne,createEffect:()=>_e,createElement:()=>ht,createMemo:()=>at,createRenderEffect:()=>xn,createResource:()=>vn,createRoot:()=>gn,createSignal:()=>D,delegateEvents:()=>Le,effect:()=>Tn,hydrate:()=>Ve,indexArray:()=>ne,insert:()=>K,keyArray:()=>te,mapArray:()=>ee,memo:()=>En,onCleanup:()=>st,render:()=>ge,setAttribute:()=>A,setClassName:()=>re,setProperty:()=>B,setStyle:()=>me,signal:()=>Sn,spread:()=>Vt,store:()=>kn,styleMap:()=>Ze,untrack:()=>Ee,useContext:()=>hn});var pt="http://www.w3.org/2000/svg";var Ce=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function A(e,t,n,r=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function Ln(e,t){Object.assign(e.style,t)}function ht(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([i,s])=>{if(i==="class"||i==="className")r.className=s;else if(i==="style"&&typeof s=="object")Ln(r,s);else if(i.startsWith("on")&&typeof s=="function"){let u=i.slice(2).toLowerCase();r.addEventListener(u,s)}else A(r,i,s)}),n.forEach(i=>{typeof i=="string"?r.appendChild(document.createTextNode(i)):r.appendChild(i)}),r}var no=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;var $n="__fluixi_signal_next_state__",Fn=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)},d=globalThis[$n]??={consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:Fn,onSuspend:null,onError:null},yt=0,mt=1,Y=2,gt=class{constructor(){this.observers=null,this.watchers=null,this.version=0}updateIfNecessary(){}track(){if(d.untracked)return;let e=d.consumer;e&&((this.observers??=new Set).add(e),(e.sources??=new Set).add(this))}},Vn=class extends gt{constructor(e,t){super(),this._value=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){return this.track(),this._value}set(e){if(!this._equals(this._value,e)){if(this._value=e,this.version++,this.observers)for(let t of[...this.observers])t.markDirty(Y);ke(this)}}peek(){return this._value}},bt=class extends gt{constructor(e,t){super(),this._threw=!1,this._initialized=!1,this.state=Y,this.sources=null,this._fn=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){if(d.consumer===this)throw new Error("Signal.Computed cannot read itself");if(this.track(),this.updateIfNecessary(),this._threw)throw this._error;return this._value}updateIfNecessary(){if(this.state===mt&&this.sources){for(let e of this.sources)if(e.updateIfNecessary(),this.state===Y)break}(this.state===Y||!this._initialized)&&this.recompute(),this.state=yt}recompute(){if(this.sources){for(let u of this.sources)u.observers?.delete(this);this.sources.clear()}let e=d.consumer,t=d.untracked;d.consumer=this,d.untracked=!1;let n,r=!1,i;try{n=this._fn()}catch(u){r=!0,i=u,n=this._value}finally{d.consumer=e,d.untracked=t}let s=!this._initialized||this._threw!==r||(r?i!==this._error:!this._equals(this._value,n));if(this._initialized=!0,this._threw=r,this._error=i,this._value=n,s){if(this.version++,this.observers)for(let u of[...this.observers])u.markDirty(Y);ke(this)}}markDirty(e){if(this.state>=e)return;let t=this.state===yt;if(this.state=e,t){if(this.observers)for(let n of[...this.observers])n.markDirty(mt);ke(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};function ke(e){if(e.watchers)for(let t of[...e.watchers])t._notify(e)}var Hn=class{constructor(e){this._watched=new Set,this._pending=new Set,this._notifyFn=e}watch(...e){for(let t of e)this._watched.add(t),(t.watchers??=new Set).add(this)}unwatch(...e){for(let t of e)this._watched.delete(t),t.watchers?.delete(this),this._pending.delete(t)}getPending(){let e=[...this._pending];return this._pending.clear(),e}_notify(e){if(!this._watched.has(e)||this._pending.has(e))return;let t=this._pending.size===0;this._pending.add(e),t&&this._notifyFn()}};function Un(e){if(d.untracked)return e();d.untracked=!0;try{return e()}finally{d.untracked=!1}}function W(e){let t=ce(e);return e&&(e.owned??=[]).push(t),t}function z(e,t=!0){Z(e,t)}function ce(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function wt(e){let t=Symbol("context");return{id:t,defaultValue:e,Provider:n=>{let r=d.owner,i=ce(r);(i.contexts=new Map).set(t,n.value),r&&(r.owned??=[]).push(i),d.owner=i;try{return n.children}finally{d.owner=r}}}}function xt(e,t){let n=e;for(;n;){if(n.contexts&&n.contexts.has(t.id))return n.contexts.get(t.id);n=n.parent}return t.defaultValue}function Wn(e){d.onSuspend=e}function zn(e){return d.onSuspend?(d.onSuspend(e,d.owner),!0):!1}function Bn(e){d.onError=e}function q(){return d.owner}function N(e,t){let n=d.owner;d.owner=e;try{return t()}finally{d.owner=n}}function L(e){if(d.owner){if(d.owner.disposed){e();return}(d.owner.cleanups??=[]).push(e)}}function Z(e,t=!0){if(!e.disposed){if(e.owned){for(let n=e.owned.length-1;n>=0;n--)Z(e.owned[n]);e.owned=null}if(e.cleanups){for(let n=e.cleanups.length-1;n>=0;n--)e.cleanups[n]();e.cleanups=null}t&&(e.disposed=!0)}}function $(e){let t=ce(d.owner);d.owner&&(d.owner.owned??=[]).push(t);let n=d.owner;d.owner=t;try{return e(()=>Z(t))}finally{d.owner=n}}function Kn(e){d.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function Gn(e){e.queued||(e.queued=!0,d.queue.push(e),!d.scheduled&&d.batchDepth===0&&(d.scheduled=!0,d.hostSchedule(Oe)))}function Oe(){if(d.scheduled=!1,d.flushing)return;d.flushing=!0;let e=0;try{for(;d.queue.length;){if(++e>1e5)throw new Error("[fluixi] effect flush did not settle (cycle?)");let t=d.queue;d.queue=[];for(let n of t)n.queued=!1,n.disposed||n.run()}}finally{d.flushing=!1}}function Xn(){d.batchDepth===0&&Oe()}function Jn(e){d.batchDepth++;try{return e()}finally{--d.batchDepth===0&&Oe()}}var Yn=class{constructor(e){this.queued=!1,this.disposed=!1,this.owner=ce(d.owner),d.owner&&(d.owner.cleanups??=[]).push(()=>this.dispose()),this.computed=new bt(()=>{Z(this.owner,!1),N(this.owner,()=>{let t=e();typeof t=="function"&&(this.owner.cleanups??=[]).push(t)})}),this.watcher=new Hn(()=>Gn(this)),this.run(),this.watcher.watch(this.computed)}run(){if(!this.disposed){this.watcher.getPending();try{this.computed.get()}catch(e){if(e&&typeof e.then=="function"&&d.onSuspend){d.onSuspend(e,this.owner);return}if(d.onError&&d.onError(e,this.owner))return;throw e}}}dispose(){this.disposed||(this.disposed=!0,this.watcher.unwatch(this.computed),Z(this.owner))}};function vt(e){let t=new Yn(e);return()=>t.dispose()}function Zn(e){return!!e&&typeof e.then=="function"}Kn(()=>{});var St=Symbol.for("signal"),Qn=Symbol.for("memo"),er=Symbol.for("signal-node");function C(e,t){let n=new Vn(e,{equals:t?.equals}),r=(()=>n.get()),i=(s=>{let u=typeof s=="function"?s(n.peek()):s;return n.set(u),Xn(),u});return Object.defineProperty(r,St,{value:!0,enumerable:!0}),Object.defineProperty(r,er,{value:{get value(){return n.peek()},get version(){return n.version}},enumerable:!1}),[r,i]}function m(e,t,n){let r=t,i=q(),s=new bt(()=>N(i,()=>{try{return r=e(r)}catch(l){if(Zn(l))return zn(l),r;throw l}}),{equals:n?.equals}),u=(()=>s.get());return Object.defineProperty(u,St,{value:!0,enumerable:!0}),Object.defineProperty(u,Qn,{value:!0,enumerable:!0}),u}function fe(e,t){let n=t;return vt(()=>{n=e(n)})}function S(e,t){let n=t;return vt(()=>{n=e(n)})}function Q(e){return Jn(e)}function k(e){return Un(e)}function ee(e,t,n){let r=[];return L(()=>{for(let i of r)i.dispose();r=[]}),m(()=>{let i=e()||[];return k(()=>{if(i.length===0){for(let o of r)o.dispose();return r=[],n?.fallback?n.fallback():[]}let s=new Map;for(let o of r)s.has(o.item)||s.set(o.item,o);let u=[],l=new Set;for(let o=0;o<i.length;o++){let a=i[o],p=s.get(a);if(p&&!l.has(p))p.setIndex(o),u.push(p),l.add(p);else{let c,y,g;$(b=>{g=b;let[H,X]=C(o);y=X,c=t(a,H)});let v={item:a,rendered:c,dispose:g,setIndex:y};u.push(v),l.add(v)}}for(let o of r)l.has(o)||o.dispose();return r=u,u.map(o=>o.rendered)})})}function te(e,t,n,r){let i=[],s=[];return L(()=>{for(let u of s)u.dispose();i=[],s=[]}),m(()=>{let u=e()||[];return k(()=>{if(u.length===0){for(let c of s)c.dispose();return i=[],s=[],r?.fallback?r.fallback():[]}let l=new Map;for(let c=0;c<i.length;c++)l.set(i[c],s[c]);let o=[],a=[],p=new Set;for(let c=0;c<u.length;c++){let y=t(u[c]),g=l.get(y);if(g&&!p.has(y))g.setIndex(c),o.push(g);else{let v,b,H;$(X=>{H=X;let[j,J]=C(c);b=J;let se=m(U=>(e()||[])[j()]??U,u[c]);v=n(se,j)}),o.push({rendered:v,dispose:H,setIndex:b})}a.push(y),p.add(y)}for(let[c,y]of l)p.has(c)||y.dispose();return i=a,s=o,o.map(c=>c.rendered)})})}function ne(e,t,n){let r=[];return L(()=>{for(let i of r)i.dispose();r=[]}),m(()=>{let i=e()||[];return k(()=>{if(i.length===0){for(let o of r)o.dispose();return r=[],n?.fallback?n.fallback():[]}let s=r.length,u=i.length;for(let o=s;o<u;o++){let a,p,c,y=i[o];$(g=>{c=g;let[v,b]=C(y);p=b,a=t(v,o)}),r.push({rendered:a,setItem:p,dispose:c})}for(let o=u;o<s;o++)r[o].dispose();u<s&&(r=r.slice(0,u));let l=Math.min(s,u);for(let o=0;o<l;o++)r[o].setItem(i[o]);return r.map(o=>o.rendered)})})}var tr=Symbol.for("signal");function E(e){return typeof e=="function"&&e[tr]===!0}var nr=null;function Et(e){nr=e}var rr=null;function Tt(e){rr=e}var or=wt();Wn((e,t)=>{let n=xt(t,or);n&&(n.increment(),e.finally(()=>n.decrement()))});var ir=wt();Bn((e,t)=>{let n=xt(t,ir);return n?(n.setError(e),!0):!1});var Me=Symbol.for("fluixi-proxy");var At="1.0.0-alpha.78";var Nt="1.0.0-alpha.78";var T={dom:At,reactive:Nt};function _t(e){T.core&&e.setAttribute("fluixi",T.core),e.setAttribute("fx-dom",T.dom),e.setAttribute("fx-reactive",T.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=T)}function Pt(){let e=[T.core,T.dom,T.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${T.core??"(absent)"}, dom ${T.dom}, reactive ${T.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function F(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var Re=typeof document>"u";var De=Symbol.for("fluixi.server-node"),Ct=null;function kt(){if(!Ct)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return Ct}function de(e){return e!=null&&e[De]===!0?!0:typeof Node<"u"&&e instanceof Node}function Ot(e){return e!=null&&e[De]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Mt(e){return e!=null&&e[De]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var h={active:!1,cursor:null,parents:[]},Rt=null;function Dt(e){Rt=e}function jt(){return Rt}function je(e,t){return h.active&&t.parentNode===e}function Ie(e){let t=h.parents.lastIndexOf(e);t!==-1&&(h.parents.length=t),h.cursor=e.nextSibling}function pe(e){if(!h.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Ie(t)}var sr={};var qe=new Set,Ft=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function Le(e){if(!Re)for(let t of e)qe.has(t)||Ft.has(t)||(qe.add(t),document.addEventListener(t,ur))}function ur(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 lr(e,t,n){if(e[`$$${t}`]=n,Ft.has(t)){let r=`__fx_${t}`;if(!e[r]){let i=s=>{e[`$$${t}`]?.(s)};e.addEventListener(t,i),e[r]=i}return}qe.has(t)||Le([t])}function It(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function O(e,t=!1){if(Re)return kt().createText(e);if(h.active&&!t){let n=jt()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}var P=0,ar=200;function cr(e,t,n,r,i){let s=r,u=new Map;return S(()=>{let l;if(F(e)&&!E(e)){if(!u.has(e)){P++;try{let o=e();u.set(e,o)}finally{P--}}for(l=u.get(e);typeof l=="function"&&E(l);)l=l()}else for(l=e();typeof l=="function"&&E(l);)l=l();{let o=0;for(;typeof l=="function"&&o++<50;)if(F(l)){if(!u.has(l)){let a=l;P++;try{let p=a();u.set(a,p)}finally{P--}}l=u.get(l)}else if(E(l))l=l();else if(l=l(),typeof l!="function"||!E(l)&&!F(l))break}P++;try{s=ye(t,l,n,s,u),i(s)}finally{P--}})}function K(e,t,n,r){if(P>ar)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=O("",!0),e.appendChild(n));let i=r??null,s=o=>Array.isArray(o)&&o.some(a=>typeof a=="function"),u=o=>typeof o=="function"?o:()=>o;if(typeof t!="function"&&!s(t)){P++;try{i=ye(e,t,n,i)}finally{P--}return()=>i}let l=cr(u(t),e,n,i,o=>{i=o});return()=>(l?.(),i)}function ye(e,t,n,r,i){if(t==null||typeof t=="boolean")return V(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return V(e,r,n);if(he(t)){let u=O("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(u,r[0]),V(e,r.slice(1),n)):x(e,u,n):r?e.replaceChild(u,r):x(e,u,n),t.then(l=>{u.parentNode===e&&ye(e,l,u.nextSibling,u)}).catch(l=>{console.error("Error resolving promise in insertExpression:",l)}),u}let s=typeof t;if(s==="string"||s==="number"){if(s==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let l=O(t);return x(e,l,n),l}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=V(e,r,n)}if(r&&Mt(r))return r.data=t,r;let u=O(t);return r&&r.parentNode===e?e.replaceChild(u,r):je(e,u)||x(e,u,n),u}if(de(t))return je(e,t)?(Ie(t),t):Array.isArray(r)?(r.length===0?x(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),V(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 u=[],l=Array.isArray(r)?r:r?[r]:[],o=[];_(t,u,e,n,!0,i,o);let a=fr(e,l,u,n);for(let p of o){let c=K(e,p.sig,p.marker);L(()=>{V(e,c()),p.marker.parentNode===e&&e.removeChild(p.marker)})}return a}if(s==="object"&&t!==null&&typeof t=="object"){let u=t;if("type"in u&&"props"in u){let l=u;if(typeof l.type=="function"){let o=l.type(l.props||{});return ye(e,o,n,r)}}}return V(e,r,n)}function _(e,t,n,r,i=!0,s,u){for(let l=0;l<e.length;l++){let o=e[l];if(!(o==null||typeof o=="boolean")){for(;typeof o=="function"&&!he(o)&&!E(o)&&!F(o)&&(o=o(),!(o==null||typeof o=="boolean")););if(!(o==null||typeof o=="boolean")){if(typeof o=="function"){let a;for(F(o)&&!E(o)?(s||(s=new Map),s.has(o)||s.set(o,o()),a=s.get(o)):a=o();typeof a=="function"&&!he(a)&&!E(a)&&!F(a);)s||(s=new Map),s.has(a)||s.set(a,a()),a=s.get(a);if(a==null||typeof a=="boolean")continue;if(typeof a=="function"){if(E(a)){if(u){let c=O("",!0);t.push(c),u.push({marker:c,sig:a});continue}let p=a();for(;typeof p=="function"&&E(p);)p=p();if(p==null||typeof p=="boolean")continue;Array.isArray(p)?_(p,t,n,r,i,s):_([p],t,n,r,i,s);continue}continue}Array.isArray(a)?_(a,t,n,r,i,s,u):_([a],t,n,r,i,s,u);continue}if(he(o)){let a=O("",!0);t.push(a),o.then(p=>{if(a.parentNode){let c=[];if(_([p],c,a.parentNode,void 0,!1,s),c.length>0){a.parentNode.replaceChild(c[0],a);for(let y=1;y<c.length;y++)a.parentNode?.insertBefore(c[y],c[y-1].nextSibling)}}}).catch(p=>console.error("Error resolving promise in array:",p));continue}if(Array.isArray(o)){_(o,t,n,r,i,s,u);continue}if(de(o)){t.push(o);continue}if(typeof o=="object"&&o!==null&&"type"in o&&"props"in o){let a=o;if(typeof a.type=="function"){let p=a.type(a.props||{});Array.isArray(p)?_(p,t,n,r,!1,s):_([p],t,n,r,!1,s);continue}}if(typeof o=="string"||typeof o=="number"){let a=String(o);if(a.trim()===""&&a!==" ")continue;t.push(O(a));continue}t.push(O(String(o)))}}}}function fr(e,t,n,r){for(let c=0;c<n.length;c++){let y=n[c].parentNode;y!==null&&y!==e&&y.nodeType!==11&&(n=n.slice(),n[c]=n[c].cloneNode(!0))}let i=n.length,s=t.length,u=i,l=0,o=0,a=s>0?t[s-1].nextSibling??void 0:r,p=null;for(;l<s||o<u;){if(t[l]===n[o]){l++,o++;continue}for(;s>l&&u>o&&t[s-1]===n[u-1];)s--,u--;if(s===l){let c=u<i?o?n[o-1].nextSibling??void 0:n[u-o]:a;for(;o<u;)x(e,n[o++],c)}else if(u===o)for(;l<s;)(!p||!p.has(t[l]))&&t[l].parentNode===e&&e.removeChild(t[l]),l++;else if(t[l]===n[u-1]&&n[o]===t[s-1]){let c=t[--s].nextSibling;x(e,n[o++],t[l++].nextSibling),x(e,n[--u],c),t[s]=t[l-1]}else{if(!p){p=new Map;let y=o;for(;y<u;)p.set(n[y],y++)}let c=p.get(t[l]);if(c!=null)if(o<c&&c<u){let y=l,g=1;for(;++y<s&&y<u&&!(!p.has(t[y])||p.get(t[y])!==c+g);)g++;if(g>c-o){let v=t[l];for(;o<c;)x(e,n[o++],v)}else t[l].parentNode===e?e.replaceChild(n[o++],t[l++]):(x(e,n[o++],a),l++)}else l++;else t[l].parentNode===e&&e.removeChild(t[l]),l++}}return n}function V(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){h.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 dr(e,t,n){let r=n,i;return Array.isArray(n)&&(r=n[0],i=n[1]),typeof r!="function"?()=>{}:(e.addEventListener(t,r,i),()=>e.removeEventListener(t,r,i))}function pr(e,t){let n=(r,i)=>{typeof r=="function"&&r(e,i??(()=>{}))};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 qt(e,t,n,r=!1){return typeof n!="function"?(A(e,t,n,r),()=>{}):S(()=>{let i=typeof n=="function"?n():n;A(e,t,i,r)})}function Lt(e,t,n){return typeof n!="function"?(B(e,t,n),()=>{}):S(()=>{let r=typeof n=="function"?n():n;B(e,t,r)})}function hr(e,t,n){return typeof n!="function"?(A(e,t,!!n),()=>{}):S(()=>{let r=n();A(e,t,!!r)})}function re(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){S(()=>re(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(r=>{let i=t[r];return typeof i=="function"?i():!!i}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function $t(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let i=t[r],s=r.split(/\s+/).filter(Boolean);if(typeof i=="function"&&n)n.push(S(()=>{let u=!!i();for(let l of s)e.classList.toggle(l,u)}));else{let u=!!(typeof i=="function"?i():i);for(let l of s)e.classList.toggle(l,u)}}}function me(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 i=n[r];i==null?e.style[r]="":e.style[r]=i}}function Vt(e){let{element:t,props:n,prevProps:r=sr,isSVG:i=!1,skipChildren:s=!1}=e;if(!t||!Ot(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let u=i||t.namespaceURI===pt,l=[];for(let o in n){if(s&&o==="children")continue;let a=n[o],p=r[o];if(a===p)continue;if(o==="ref"){$e(a,t);continue}if(o==="use"){pr(t,a);continue}if(o.startsWith("on:")){l.push(dr(t,o.slice(3),a));continue}if(o.startsWith("prop:")){l.push(Lt(t,o.slice(5),a));continue}if(o.startsWith("attr:")){l.push(qt(t,o.slice(5),a,u));continue}if(o.startsWith("bool:")){l.push(hr(t,o.slice(5),a));continue}if(o==="class"||o==="className"){typeof a=="function"?l.push(S(()=>re(t,a()))):re(t,a);continue}if(o==="classList"){typeof a=="function"?l.push(S(()=>$t(t,a()))):$t(t,a,l);continue}if(o==="style"){typeof a=="function"?l.push(S(()=>me(t,a()))):me(t,a);continue}if(o.startsWith("on")){let y=o.slice(2).toLowerCase();p&&It(t,y),a&&lr(t,y,a);continue}let c=Ce.has(o)||!u&&o in t;typeof a=="function"?l.push(c?Lt(t,o,a):qt(t,o,a,u)):l.push(S(()=>c?B(t,o,n[o]):A(t,o,n[o],u)))}for(let o in r)if(!(o in n))if(o.startsWith("on")){let a=o.slice(2).toLowerCase();It(t,a)}else Ce.has(o)?B(t,o,null):t.removeAttribute(o);return()=>{l.forEach(o=>o())}}function $e(e,t){if(e){if(de(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 he(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function ge(e,t,n){if(!t)throw new Error("Container element is required");let r,i,s=[];return $(u=>{Q(()=>{h.active||(t.textContent=""),_t(t),Pt(),K(t,e)}),i=u}),()=>{i?.(),r?.(),s.forEach(u=>u()),t.textContent=""}}var yr="__fx_dom_create_component__",Ht=globalThis[yr]??={fn:null};function Ut(e,t){return Ht.fn?Ht.fn(e,t):(()=>e(t))}var mr="__FX_DATA__";var Fe;function Wt(){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(mr)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return Fe=t}function be(){for(;;){for(;h.cursor&&h.cursor.nodeType===3&&h.cursor.data==="";)h.cursor=h.cursor.nextSibling;if(h.cursor!=null||!h.parents.length)return;h.cursor=h.parents.pop().nextSibling}}var gr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),we=typeof process<"u"&&process.env&&!1;function xe(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 br(e){be();let t=h.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(gr.has(e.toLowerCase())?h.cursor=t.nextSibling:(h.parents.push(t),h.cursor=t.firstChild),t):(we&&t&&xe(`<${e}>`,t),null)}function wr(e){be();let t=h.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(h.cursor=t.nextSibling,t):(we&&t&&xe(`<${e}> (static)`,t),null)}function xr(e){if(e===""){let n=h.cursor;return n&&n.nodeType===3&&n.data!==""?(h.cursor=n.nextSibling,n.data="",n):null}be();let t=h.cursor;return t&&t.nodeType===3?(h.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(we&&t&&xe(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function vr(e){be();let t=h.cursor;return t&&t.nodeType===8&&t.data===e?(h.cursor=t.nextSibling,t):(we&&t&&xe(`marker <!--${e.slice(0,24)}-->`,t),null)}var zt=!1;function Sr(){zt||(zt=!0,Dt({hydrateElement:br,hydrateText:xr,hydrateMarker:vr,hydrateStatic:wr}))}function Ve(e,t,n){Sr(),h.active=!0,h.cursor=t.firstChild,h.parents=[];let r=Wt(),i=n?.resourceNamespace,s=0;Tt(()=>i?`${i}:r${s++}`:`r${s++}`),Et(r?u=>u in r?{value:r[u]}:void 0:null);try{return ge(e,t)}finally{h.active=!1,h.cursor=null,h.parents=[]}}function Bt(e){return typeof e=="function"?e:(()=>e)}function M(e){return()=>{let t=e();return typeof t=="function"?t():t}}function Kt(e){return e!=null&&e!==!1}function Gt(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function He(e){let t=M(()=>e.when),n=m(t,void 0),r=m(n,void 0),i=q(),s=null,u=null,l=o=>{o!==u&&(s&&z(s),s=W(i),u=o)};return m(()=>{let o=r();return l(o?"when":"fallback"),N(s,()=>{if(o){let a=e.children;return typeof a=="function"&&!Gt(a)?typeof n=="function"?k(()=>k(n)?a(n()):e.fallback):a(n):a}return e.fallback});return e.fallback??null},void 0,{name:"show"})}function Ue(e){let t=M(()=>e.each),n=()=>e.fallback??null,r=(i,s)=>{let u=e.children,l=Array.isArray(u)?u.map(o=>typeof o=="function"?o(i,s):o):typeof u=="function"?u(i,s):u;return pe(l),l};return e.by?te(t,e.by,(i,s)=>r(i,s),{fallback:n}):ee(t,(i,s)=>r(i,s),{fallback:n})}function We(e){let t=M(()=>e.each);return ne(t,(n,r)=>{let i=e.children(n,r);return pe(i),i},{fallback:()=>e.fallback??null})}var ze=Symbol("match");function Be(e){return{[ze]:!0,when:M(()=>e.when),get children(){return e.children}}}function Ke(e){let t=Array.isArray(e.children)?e.children:[e.children],n=q(),r=null,i=-1,s=u=>{u!==i&&(r&&z(r),r=W(n),i=u)};return m(()=>{for(let u=0;u<t.length;u+=1){let o=t[u],a=0;for(;typeof o=="function"&&!o[ze]&&a++<10;)o=o();if(!o||typeof o!="object"||o[ze]!==!0)continue;let p=o.when();if(Kt(p))return s(u),N(r,()=>typeof o.children=="function"?o.children(p):o.children)}return s(-2),N(r,()=>e.fallback??null)})}function Ge(e){let t=Bt(e.component),{component:n,...r}=e,i=q(),s=null,u;return m(()=>{let l=t();return l!==u&&(s&&z(s),s=W(i),u=l),l==null?null:typeof l=="string"?{tag:l,props:r}:N(s,()=>l(r))})}function Xe(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return $(i=>{n=i,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),K(r,e.children)&&$e(e.ref,r)}),L(()=>{n(),r.remove()}),null}function Je(e){let[t,n]=C(null),r=()=>n(null);return m(()=>{let i=t();if(i!==null)return typeof e.fallback=="function"?e.fallback(i,r):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(s){return n(s),typeof e.fallback=="function"?e.fallback(s,r):e.fallback}})}function Ye(e){return m(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,i]of Object.entries(t)){if(!r)continue;(typeof i=="function"?i():i)&&n.push(r)}return n.join(" ")})}function Er(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Ze(e){return m(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,i]of Object.entries(t)){if(!r)continue;let s=typeof i=="function"?i():i;s!=null&&n.push(`${Er(r)}: ${s}`)}return n.join("; ")})}var Tr="__fluixi_signal_next_state__",Ar=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)},f=globalThis[Tr]??={consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:Ar,onSuspend:null,onError:null},Xt=0,Jt=1,oe=2,dn=class{constructor(){this.observers=null,this.watchers=null,this.version=0}updateIfNecessary(){}track(){if(f.untracked)return;let e=f.consumer;e&&((this.observers??=new Set).add(e),(e.sources??=new Set).add(this))}},Nr=class extends dn{constructor(e,t){super(),this._value=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){return this.track(),this._value}set(e){if(!this._equals(this._value,e)){if(this._value=e,this.version++,this.observers)for(let t of[...this.observers])t.markDirty(oe);tt(this)}}peek(){return this._value}},pn=class extends dn{constructor(e,t){super(),this._threw=!1,this._initialized=!1,this.state=oe,this.sources=null,this._fn=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){if(f.consumer===this)throw new Error("Signal.Computed cannot read itself");if(this.track(),this.updateIfNecessary(),this._threw)throw this._error;return this._value}updateIfNecessary(){if(this.state===Jt&&this.sources){for(let e of this.sources)if(e.updateIfNecessary(),this.state===oe)break}(this.state===oe||!this._initialized)&&this.recompute(),this.state=Xt}recompute(){if(this.sources){for(let u of this.sources)u.observers?.delete(this);this.sources.clear()}let e=f.consumer,t=f.untracked;f.consumer=this,f.untracked=!1;let n,r=!1,i;try{n=this._fn()}catch(u){r=!0,i=u,n=this._value}finally{f.consumer=e,f.untracked=t}let s=!this._initialized||this._threw!==r||(r?i!==this._error:!this._equals(this._value,n));if(this._initialized=!0,this._threw=r,this._error=i,this._value=n,s){if(this.version++,this.observers)for(let u of[...this.observers])u.markDirty(oe);tt(this)}}markDirty(e){if(this.state>=e)return;let t=this.state===Xt;if(this.state=e,t){if(this.observers)for(let n of[...this.observers])n.markDirty(Jt);tt(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};function tt(e){if(e.watchers)for(let t of[...e.watchers])t._notify(e)}var _r=class{constructor(e){this._watched=new Set,this._pending=new Set,this._notifyFn=e}watch(...e){for(let t of e)this._watched.add(t),(t.watchers??=new Set).add(this)}unwatch(...e){for(let t of e)this._watched.delete(t),t.watchers?.delete(this),this._pending.delete(t)}getPending(){let e=[...this._pending];return this._pending.clear(),e}_notify(e){if(!this._watched.has(e)||this._pending.has(e))return;let t=this._pending.size===0;this._pending.add(e),t&&this._notifyFn()}};function Pr(e){if(f.untracked)return e();f.untracked=!0;try{return e()}finally{f.untracked=!1}}function it(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function Ne(e){let t=Symbol("context");return{id:t,defaultValue:e,Provider:n=>{let r=f.owner,i=it(r);(i.contexts=new Map).set(t,n.value),r&&(r.owned??=[]).push(i),f.owner=i;try{return n.children}finally{f.owner=r}}}}function hn(e){let t=f.owner;for(;t;){if(t.contexts&&t.contexts.has(e.id))return t.contexts.get(e.id);t=t.parent}return e.defaultValue}function yn(e,t){let n=e;for(;n;){if(n.contexts&&n.contexts.has(t.id))return n.contexts.get(t.id);n=n.parent}return t.defaultValue}function Cr(e){f.onSuspend=e}function kr(e){return f.onSuspend?(f.onSuspend(e,f.owner),!0):!1}function Or(e){f.onError=e}function Mr(){return f.owner}function mn(e,t){let n=f.owner;f.owner=e;try{return t()}finally{f.owner=n}}function st(e){if(f.owner){if(f.owner.disposed){e();return}(f.owner.cleanups??=[]).push(e)}}function Se(e,t=!0){if(!e.disposed){if(e.owned){for(let n=e.owned.length-1;n>=0;n--)Se(e.owned[n]);e.owned=null}if(e.cleanups){for(let n=e.cleanups.length-1;n>=0;n--)e.cleanups[n]();e.cleanups=null}t&&(e.disposed=!0)}}function gn(e){let t=it(f.owner);f.owner&&(f.owner.owned??=[]).push(t);let n=f.owner;f.owner=t;try{return e(()=>Se(t))}finally{f.owner=n}}function Rr(e){f.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function Dr(e){e.queued||(e.queued=!0,f.queue.push(e),!f.scheduled&&f.batchDepth===0&&(f.scheduled=!0,f.hostSchedule(ut)))}function ut(){if(f.scheduled=!1,f.flushing)return;f.flushing=!0;let e=0;try{for(;f.queue.length;){if(++e>1e5)throw new Error("[fluixi] effect flush did not settle (cycle?)");let t=f.queue;f.queue=[];for(let n of t)n.queued=!1,n.disposed||n.run()}}finally{f.flushing=!1}}function jr(){f.batchDepth===0&&ut()}function Ir(e){f.batchDepth++;try{return e()}finally{--f.batchDepth===0&&ut()}}var qr=class{constructor(e){this.queued=!1,this.disposed=!1,this.owner=it(f.owner),f.owner&&(f.owner.cleanups??=[]).push(()=>this.dispose()),this.computed=new pn(()=>{Se(this.owner,!1),mn(this.owner,()=>{let t=e();typeof t=="function"&&(this.owner.cleanups??=[]).push(t)})}),this.watcher=new _r(()=>Dr(this)),this.run(),this.watcher.watch(this.computed)}run(){if(!this.disposed){this.watcher.getPending();try{this.computed.get()}catch(e){if(e&&typeof e.then=="function"&&f.onSuspend){f.onSuspend(e,this.owner);return}if(f.onError&&f.onError(e,this.owner))return;throw e}}}dispose(){this.disposed||(this.disposed=!0,this.watcher.unwatch(this.computed),Se(this.owner))}};function lt(e){let t=new qr(e);return()=>t.dispose()}function Lr(e){return!!e&&typeof e.then=="function"}Rr(()=>{});var bn=Symbol.for("signal"),$r=Symbol.for("memo"),Fr=Symbol.for("signal-node");function D(e,t){let n=new Nr(e,{equals:t?.equals}),r=(()=>n.get()),i=(s=>{let u=typeof s=="function"?s(n.peek()):s;return n.set(u),jr(),u});return Object.defineProperty(r,bn,{value:!0,enumerable:!0}),Object.defineProperty(r,Fr,{value:{get value(){return n.peek()},get version(){return n.version}},enumerable:!1}),[r,i]}function at(e,t,n){let r=t,i=Mr(),s=new pn(()=>mn(i,()=>{try{return r=e(r)}catch(l){if(Lr(l))return kr(l),r;throw l}}),{equals:n?.equals}),u=(()=>s.get());return Object.defineProperty(u,bn,{value:!0,enumerable:!0}),Object.defineProperty(u,$r,{value:!0,enumerable:!0}),u}function _e(e,t){let n=t;return lt(()=>{n=e(n)})}function wn(e,t){let n=t;lt(()=>{n=e(n)})}function xn(e,t){let n=t;return lt(()=>{n=e(n)})}function R(e){return Ir(e)}function Ee(e){return Pr(e)}var Yt=null;function Vr(e){Yt&&Yt(e)}var Zt=null;function Hr(e){return Zt?Zt(e):void 0}var Qt=null;function Ur(){return Qt?Qt():void 0}var en=null;function Wr(e,t){en&&en(e,t)}function zr(e){return!!e&&typeof e.then=="function"}var Qe=Symbol();function vn(e,t,n={}){let r,i;typeof t=="function"?(r=typeof e=="function"?e:()=>e,i=t):(r=()=>!0,i=e,t&&typeof t=="object"&&(n=t));let s=n.transport===!1?void 0:Ur(),u=s!==void 0?Hr(s):void 0,l=u!==void 0,[o,a]=D(u!==void 0?u.value:n.initialValue,{equals:!1}),[p,c]=D(void 0,{equals:!1}),[y,g]=D(u!==void 0||n.initialValue!==void 0?"ready":"unresolved",{equals:!1}),[v,b]=D(void 0,{equals:!1}),[H,X]=D(void 0,{equals:!1}),j=Qe,J=!1;_e(()=>{let w=r();if(H(),w===!1||w===null||w===void 0){j=Qe,R(()=>{g("unresolved"),b(void 0),c(void 0)});return}let ue=J;if(J=!1,j!==Qe&&w===j&&!ue)return;if(j=w,l){l=!1;return}let le=!1;st(()=>le=!0);let ft=Ee(y),On=Ee(o),dt=ft==="ready"||ft==="refreshing";R(()=>{g(dt?"refreshing":"pending"),c(void 0)});try{let I=i(w,{value:On,refetching:dt});zr(I)?(b(I),Vr(I),I.then(ae=>{le||(s!==void 0&&Wr(s,ae),R(()=>{a(()=>ae),g("ready"),b(void 0)}))},ae=>{le||R(()=>{c(ae),g("errored"),b(void 0)})})):R(()=>{a(()=>I),g("ready"),b(void 0)})}catch(I){if(le)return;R(()=>{c(I),g("errored"),b(void 0)})}});let se=()=>{let w=y();return w==="pending"||w==="refreshing"},U=(()=>{let w=p();if(w)throw w;if(se()){let ue=v();if(ue)throw ue}return o()});return Object.defineProperties(U,{state:{get:y},loading:{get:se},error:{get:p},latest:{get:o}}),Object.defineProperty(U,Symbol.for("resource"),{value:!0,enumerable:!0}),Object.defineProperty(U,Symbol.for("signal"),{value:!0,enumerable:!0}),[U,{mutate:a,refetch:()=>{J=!0,X(void 0)}}]}var Br=Ne();Cr((e,t)=>{let n=yn(t,Br);n&&(n.increment(),e.finally(()=>n.decrement()))});var Kr=Ne();Or((e,t)=>{let n=yn(t,Kr);return n?(n.setError(e),!0):!1});function Sn(e,t){let[n,r]=D(e,t);return Object.assign(n,{set:r})}function En(e,t,n){return at(e,t,n)}function Tn(e,t){return _e(e,t)}var nt=Symbol("store-raw"),tn=Symbol("store-node"),nn=Symbol("store-has"),rn=Symbol("store-self"),on=Symbol("store-track");var sn=new WeakMap,un=new WeakMap;function An(e){let[t,n]=C(e),r=t;return r.$=n,r}function Te(e){let t=sn.get(e);return t||sn.set(e,t={keys:new Map}),t}function ln(e,t,n){let r=e.keys.get(t);return r||e.keys.set(t,r=An(n)),r}function an(e){let t=Te(e);(t.all||(t.all=An()))()}function cn(e,t){e.$(typeof t=="function"?()=>t:t)}function Nn(e){if(e==null||typeof e!="object")return!1;if(Array.isArray(e))return!0;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function ve(e){if(!Nn(e))return e;let t=un.get(e);if(t)return t;let n=new Proxy(e,Gr);return un.set(e,n),n}var Gr={get(e,t,n){if(t===nt||t===tn)return e;if(t===Me)return n;if(t===nn)return u=>u in e;if(t==="__proxy")return!0;if(t===on||t===rn)return an(e),n;let r=e[t];if(typeof r=="function"&&!Object.prototype.hasOwnProperty.call(e,t))return r;let i=Object.getOwnPropertyDescriptor(e,t);if(i&&i.get)return i.get.call(n);let s=ln(Te(e),t,r)();return Nn(s)?ve(s):s},set(){return!0},deleteProperty(e,t){return t in e&&ie(e,t,void 0),!0},has(e,t){return t===nt||t===Me||t===tn||t===nn||t===rn||t===on?!0:(ln(Te(e),t,e[t])(),t in e)},ownKeys(e){return an(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e,t)}};function ie(e,t,n){if(e[t]===n&&(n!==void 0||t in e))return;let r=Array.isArray(e),i=r?e.length:0;n===void 0?delete e[t]:e[t]=n;let s=Te(e),u=s.keys.get(t);if(u&&cn(u,n),r&&e.length!==i){let l=s.keys.get("length");l&&cn(l,e.length)}s.all&&s.all.$(void 0)}function fn(e,t){return typeof e=="function"?e(t):e}function rt(e,t){for(let n of Object.keys(t)){let r=t[n],i=e[n];r&&typeof r=="object"&&!Array.isArray(r)&&i&&typeof i=="object"&&!Array.isArray(i)?rt(i,r):ie(e,n,r)}}function ct(e){let t=[],n=e.replace(/\[([^\]]*)\]/g,".$1");for(let r of n.split("."))r.length&&t.push(r);return t}function _n(e,t,n){let r=t.length-1;for(let s=0;s<r;s++){let u=t[s];if(u==="*"){let o=t.slice(s+1);if(Array.isArray(e))for(let a=0;a<e.length;a++)_n(e[a],o,n);return}let l=e[u];(l==null||typeof l!="object")&&(l=/^\d+$/.test(t[s+1])?[]:{},ie(e,u,l)),e=l}let i=t[r];if(i==="*"){if(Array.isArray(e))for(let s=0;s<e.length;s++)ie(e,s,fn(n,e[s]));return}ie(e,i,fn(n,e[i]))}function et(e,t,n){_n(e,ct(t),n)}function Xr(e,t){let n=t[0];if(typeof n=="function"&&t.length===1){let r=n(e);r&&r!==e&&rt(e,r);return}if(Array.isArray(n)&&t.length===1){for(let r of n)Array.isArray(r)&&et(e,r[0],r[1]);return}if(n&&typeof n=="object"&&!Array.isArray(n)&&t.length===1){rt(e,n);return}if(Array.isArray(t[1])&&t.length>=3){et(e,`${n}.${t[1].join(".")}`,t[2]);return}et(e,String(n),t[1])}function ot(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(ot);let t={};for(let n of Object.keys(e))t[n]=ot(e[n]);return t}function G(e,t){let n=e;for(let r of ct(t)){if(n==null)return;n=n[r]}return n}var Pn=class{constructor(e,t={immutable:!0}){this.options=t,this.root=e,this.set=((...n)=>Q(()=>Xr(this.root,n)))}get state(){return ve(this.root)}get proxy(){return ve(this.root)}get accessor(){return(()=>ve(this.root))}unwrap(){return this.root}getNode(e){return this.root&&this.root[e]}get(e){if(e==null||e==="")return Ae(this.state);let t=this.state;for(let n of ct(e)){if(t==null)return;t=t[n]}return Ae(t)}select(e){return m(()=>e(this.state))}subscribe(e){return fe(()=>e(this.state))}watch(e,t){let n;return fe(()=>{let r=e(this.state);Object.is(r,n)||(t(r,n),n=r)})}reactive(e){return m(()=>this.state[e])}produce(e){this.set((t=>{let n=ot(t);return e(n),n}))}reconcile(e,t={}){this.set(e)}push(e,...t){let n=G(this.root,e);this.set(e,n.concat(t))}pop(e){let t=G(this.root,e).slice(),n=t.pop();return this.set(e,t),n}shift(e){let t=G(this.root,e).slice(),n=t.shift();return this.set(e,t),n}splice(e,t,n,...r){let i=G(this.root,e).slice(),s=i.splice(t,n,...r);return this.set(e,i),s}insert(e,t,n){let r=G(this.root,e).slice();r.splice(t,0,n),this.set(e,r)}removeAt(e,t){let n=G(this.root,e).slice(),r=n.splice(t,1);return this.set(e,n),r}toObservable(){let[e]=C(this.state);return e.toObservable()}dispose(){}},Jr=["get","select","watch","subscribe","produce","reconcile","push","pop","shift","splice","insert","removeAt","unwrap","toObservable"];function Yr(e,t){for(let n of Jr)e[n]=t[n].bind(t);e.$=t.reactive.bind(t)}function Cn(e,t={immutable:!0}){let n=new Pn(e,t);return Yr(n.set,n),[n.proxy,n.set]}function Zr(e,t={}){return new Pn(e,{...t,immutable:!1})}function Ae(e){if(e==null||typeof e!="object")return e;let t=e[nt];return t!==void 0?t:e}function Qr(e){return k(()=>Ae(e))}var Fi=Object.freeze({createStore:Cn,createMutableStore:Zr,batch:Q,unwrap:Ae,untrackStore:Qr});function kn(e,t){let[n,r]=Cn(e,t);return new Proxy(n,{get:(i,s)=>s==="set"?r:i[s],has:(i,s)=>s==="set"||Reflect.has(i,s)})}return qn(eo);})();
@@ -0,0 +1,31 @@
1
+ /**
2
+ * CDN entry: the browser half of the surface, without the SSR renderer.
3
+ *
4
+ * <script src="https://.../@fluixi/dom/dom-client.global.js"></script>
5
+ * const count = FluixiDOM.signal(0);
6
+ * FluixiDOM.render(() => App(), document.getElementById('root'));
7
+ *
8
+ * Same shape as `dom.global.js` and the same global name, minus the string renderer,
9
+ * node serialisation, template parsing and the request context. A `<script>` tag
10
+ * cannot tree-shake, so anything reachable from the entry ships — which makes the
11
+ * server half pure weight for a page that renders in a browser. Measured against the
12
+ * full build: 21.0 kB gzipped → 12.2 kB.
13
+ *
14
+ * `hydrate` stays: a page hydrating server-rendered HTML runs in the browser, and it
15
+ * is the one thing here that touches SSR output. Use `dom.global.js` if you actually
16
+ * render to a string in the browser, which is rare outside tests.
17
+ */
18
+ export {
19
+ // rendering
20
+ render, hydrate, insert, spread, createElement, createComponent,
21
+ // attributes and properties
22
+ setAttribute, setProperty, setClassName, setStyle, classMap, styleMap,
23
+ // events
24
+ delegateEvents,
25
+ // control flow
26
+ Show, For, Index, Switch, Match, Portal, Dynamic, ErrorBoundary,
27
+ // lists
28
+ mapArray, indexArray, keyArray, } from '../lib/index.js';
29
+ export {
30
+ // reactive primitives — the short API and the tuple form, as the full entry does
31
+ signal, memo, effect, store, createSignal, createMemo, createEffect, createComputed, createRenderEffect, createRoot, createResource, createContext, useContext, onCleanup, batch, untrack, } from '@fluixi/reactive';
@@ -0,0 +1 @@
1
+ var G="http://www.w3.org/2000/svg";var D=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);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 ke(e,t){Object.assign(e.style,t)}function Le(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([s,a])=>{if(s==="class"||s==="className")r.className=a;else if(s==="style"&&typeof a=="object")ke(r,a);else if(s.startsWith("on")&&typeof a=="function"){let c=s.slice(2).toLowerCase();r.addEventListener(c,a)}else T(r,s,a)}),n.forEach(s=>{typeof s=="string"?r.appendChild(document.createTextNode(s)):r.appendChild(s)}),r}var Rt=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;import{isSignal as h}from"@fluixi/reactive/signal";var X="1.0.0-alpha.78";import{VERSION as Oe}from"@fluixi/reactive/version";var m={dom:X,reactive:Oe};function J(e){m.core&&e.setAttribute("fluixi",m.core),e.setAttribute("fx-dom",m.dom),e.setAttribute("fx-reactive",m.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=m)}function Y(){let e=[m.core,m.dom,m.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${m.core??"(absent)"}, dom ${m.dom}, reactive ${m.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function N(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}import{batch as _e,createEffect as zt,createRenderEffect as x,createRoot as Fe,onCleanup as De,readChildren as qt}from"@fluixi/reactive/signal";var I=typeof document>"u";var $=Symbol.for("fluixi.server-node"),Z=null;function Q(){if(!Z)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return Z}function C(e){return e!=null&&e[$]===!0?!0:typeof Node<"u"&&e instanceof Node}function ee(e){return e!=null&&e[$]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function te(e){return e!=null&&e[$]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},ne=null;function re(e){ne=e}function oe(){return ne}function j(e,t){return u.active&&t.parentNode===e}function H(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function P(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&H(t)}var Ie={};var V=new Set,le=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function fe(e){if(!I)for(let t of e)V.has(t)||le.has(t)||(V.add(t),document.addEventListener(t,$e))}function $e(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 je(e,t,n){if(e[`$$${t}`]=n,le.has(t)){let r=`__fx_${t}`;if(!e[r]){let s=a=>{e[`$$${t}`]?.(a)};e.addEventListener(t,s),e[r]=s}return}V.has(t)||fe([t])}function ie(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function E(e,t=!1){if(I)return Q().createText(e);if(u.active&&!t){let n=oe()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}var b=0,He=200;function Ve(e,t,n,r,s){let a=r,c=new Map;return x(()=>{let i;if(N(e)&&!h(e)){if(!c.has(e)){b++;try{let o=e();c.set(e,o)}finally{b--}}for(i=c.get(e);typeof i=="function"&&h(i);)i=i()}else for(i=e();typeof i=="function"&&h(i);)i=i();{let o=0;for(;typeof i=="function"&&o++<50;)if(N(i)){if(!c.has(i)){let l=i;b++;try{let f=l();c.set(l,f)}finally{b--}}i=c.get(i)}else if(h(i))i=i();else if(i=i(),typeof i!="function"||!h(i)&&!N(i))break}b++;try{a=R(t,i,n,a,c),s(a)}finally{b--}})}function v(e,t,n,r){if(b>He)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=E("",!0),e.appendChild(n));let s=r??null,a=o=>Array.isArray(o)&&o.some(l=>typeof l=="function"),c=o=>typeof o=="function"?o:()=>o;if(typeof t!="function"&&!a(t)){b++;try{s=R(e,t,n,s)}finally{b--}return()=>s}let i=Ve(c(t),e,n,s,o=>{s=o});return()=>(i?.(),s)}function R(e,t,n,r,s){if(t==null||typeof t=="boolean")return A(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return A(e,r,n);if(M(t)){let c=E("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(c,r[0]),A(e,r.slice(1),n)):y(e,c,n):r?e.replaceChild(c,r):y(e,c,n),t.then(i=>{c.parentNode===e&&R(e,i,c.nextSibling,c)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),c}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let i=E(t);return y(e,i,n),i}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=A(e,r,n)}if(r&&te(r))return r.data=t,r;let c=E(t);return r&&r.parentNode===e?e.replaceChild(c,r):j(e,c)||y(e,c,n),c}if(C(t))return j(e,t)?(H(t),t):Array.isArray(r)?(r.length===0?y(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),A(e,r.slice(1),n)):y(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):y(e,t,n)):y(e,t,n),t);if(Array.isArray(t)){let c=[],i=Array.isArray(r)?r:r?[r]:[],o=[];g(t,c,e,n,!0,s,o);let l=Ue(e,i,c,n);for(let f of o){let d=v(e,f.sig,f.marker);De(()=>{A(e,d()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return l}if(a==="object"&&t!==null&&typeof t=="object"){let c=t;if("type"in c&&"props"in c){let i=c;if(typeof i.type=="function"){let o=i.type(i.props||{});return R(e,o,n,r)}}}return A(e,r,n)}function g(e,t,n,r,s=!0,a,c){for(let i=0;i<e.length;i++){let o=e[i];if(!(o==null||typeof o=="boolean")){for(;typeof o=="function"&&!M(o)&&!h(o)&&!N(o)&&(o=o(),!(o==null||typeof o=="boolean")););if(!(o==null||typeof o=="boolean")){if(typeof o=="function"){let l;for(N(o)&&!h(o)?(a||(a=new Map),a.has(o)||a.set(o,o()),l=a.get(o)):l=o();typeof l=="function"&&!M(l)&&!h(l)&&!N(l);)a||(a=new Map),a.has(l)||a.set(l,l()),l=a.get(l);if(l==null||typeof l=="boolean")continue;if(typeof l=="function"){if(h(l)){if(c){let d=E("",!0);t.push(d),c.push({marker:d,sig:l});continue}let f=l();for(;typeof f=="function"&&h(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?g(f,t,n,r,s,a):g([f],t,n,r,s,a);continue}continue}Array.isArray(l)?g(l,t,n,r,s,a,c):g([l],t,n,r,s,a,c);continue}if(M(o)){let l=E("",!0);t.push(l),o.then(f=>{if(l.parentNode){let d=[];if(g([f],d,l.parentNode,void 0,!1,a),d.length>0){l.parentNode.replaceChild(d[0],l);for(let p=1;p<d.length;p++)l.parentNode?.insertBefore(d[p],d[p-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(o)){g(o,t,n,r,s,a,c);continue}if(C(o)){t.push(o);continue}if(typeof o=="object"&&o!==null&&"type"in o&&"props"in o){let l=o;if(typeof l.type=="function"){let f=l.type(l.props||{});Array.isArray(f)?g(f,t,n,r,!1,a):g([f],t,n,r,!1,a);continue}}if(typeof o=="string"||typeof o=="number"){let l=String(o);if(l.trim()===""&&l!==" ")continue;t.push(E(l));continue}t.push(E(String(o)))}}}}function Ue(e,t,n,r){for(let d=0;d<n.length;d++){let p=n[d].parentNode;p!==null&&p!==e&&p.nodeType!==11&&(n=n.slice(),n[d]=n[d].cloneNode(!0))}let s=n.length,a=t.length,c=s,i=0,o=0,l=a>0?t[a-1].nextSibling??void 0:r,f=null;for(;i<a||o<c;){if(t[i]===n[o]){i++,o++;continue}for(;a>i&&c>o&&t[a-1]===n[c-1];)a--,c--;if(a===i){let d=c<s?o?n[o-1].nextSibling??void 0:n[c-o]:l;for(;o<c;)y(e,n[o++],d)}else if(c===o)for(;i<a;)(!f||!f.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[c-1]&&n[o]===t[a-1]){let d=t[--a].nextSibling;y(e,n[o++],t[i++].nextSibling),y(e,n[--c],d),t[a]=t[i-1]}else{if(!f){f=new Map;let p=o;for(;p<c;)f.set(n[p],p++)}let d=f.get(t[i]);if(d!=null)if(o<d&&d<c){let p=i,F=1;for(;++p<a&&p<c&&!(!f.has(t[p])||f.get(t[p])!==d+F);)F++;if(F>d-o){let Re=t[i];for(;o<d;)y(e,n[o++],Re)}else t[i].parentNode===e?e.replaceChild(n[o++],t[i++]):(y(e,n[o++],l),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return n}function A(e,t,n){if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r].parentNode===e&&e.removeChild(t[r]);else t.parentNode===e&&e.removeChild(t);return null}function y(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function S(e,t,n){n==null?delete e[t]:e[t]=n}function We(e,t,n){let r=n,s;return Array.isArray(n)&&(r=n[0],s=n[1]),typeof r!="function"?()=>{}:(e.addEventListener(t,r,s),()=>e.removeEventListener(t,r,s))}function Ke(e,t){let n=(r,s)=>{typeof r=="function"&&r(e,s??(()=>{}))};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 se(e,t,n,r=!1){return typeof n!="function"?(T(e,t,n,r),()=>{}):x(()=>{let s=typeof n=="function"?n():n;T(e,t,s,r)})}function ae(e,t,n){return typeof n!="function"?(S(e,t,n),()=>{}):x(()=>{let r=typeof n=="function"?n():n;S(e,t,r)})}function Be(e,t,n){return typeof n!="function"?(T(e,t,!!n),()=>{}):x(()=>{let r=n();T(e,t,!!r)})}function k(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){x(()=>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 s=t[r];return typeof s=="function"?s():!!s}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function ce(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let s=t[r],a=r.split(/\s+/).filter(Boolean);if(typeof s=="function"&&n)n.push(x(()=>{let c=!!s();for(let i of a)e.classList.toggle(i,c)}));else{let c=!!(typeof s=="function"?s():s);for(let i of a)e.classList.toggle(i,c)}}}function U(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 s=n[r];s==null?e.style[r]="":e.style[r]=s}}function ze(e){let{element:t,props:n,prevProps:r=Ie,isSVG:s=!1,skipChildren:a=!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 c=s||t.namespaceURI===G,i=[];for(let o in n){if(a&&o==="children")continue;let l=n[o],f=r[o];if(l===f)continue;if(o==="ref"){W(l,t);continue}if(o==="use"){Ke(t,l);continue}if(o.startsWith("on:")){i.push(We(t,o.slice(3),l));continue}if(o.startsWith("prop:")){i.push(ae(t,o.slice(5),l));continue}if(o.startsWith("attr:")){i.push(se(t,o.slice(5),l,c));continue}if(o.startsWith("bool:")){i.push(Be(t,o.slice(5),l));continue}if(o==="class"||o==="className"){typeof l=="function"?i.push(x(()=>k(t,l()))):k(t,l);continue}if(o==="classList"){typeof l=="function"?i.push(x(()=>ce(t,l()))):ce(t,l,i);continue}if(o==="style"){typeof l=="function"?i.push(x(()=>U(t,l()))):U(t,l);continue}if(o.startsWith("on")){let p=o.slice(2).toLowerCase();f&&ie(t,p),l&&je(t,p,l);continue}let d=D.has(o)||!c&&o in t;typeof l=="function"?i.push(d?ae(t,o,l):se(t,o,l,c)):i.push(x(()=>d?S(t,o,n[o]):T(t,o,n[o],c)))}for(let o in r)if(!(o in n))if(o.startsWith("on")){let l=o.slice(2).toLowerCase();ie(t,l)}else D.has(o)?S(t,o,null):t.removeAttribute(o);return()=>{i.forEach(o=>o())}}function W(e,t){if(e){if(C(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 M(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function K(e,t,n){if(!t)throw new Error("Container element is required");let r,s,a=[];return Fe(c=>{_e(()=>{u.active||(t.textContent=""),J(t),Y(),v(t,e)}),s=c}),()=>{s?.(),r?.(),a.forEach(c=>c()),t.textContent=""}}var qe="__fx_dom_create_component__",ue=globalThis[qe]??={fn:null};function Ge(e,t){return ue.fn?ue.fn(e,t):(()=>e(t))}import{setResourceIdSource as Je,setServerDataGetter as Ye}from"@fluixi/reactive/signal";var Xe="__FX_DATA__";var B;function de(){let e=globalThis.__FX_DATA__;if(e)return e;if(B!==void 0)return B;let t=null;if(typeof document<"u"){let n=document.getElementById(Xe)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return B=t}function L(){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 Ze=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),O=typeof process<"u"&&process.env&&!1;function _(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 Qe(e){L();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Ze.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(O&&t&&_(`<${e}>`,t),null)}function et(e){L();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(u.cursor=t.nextSibling,t):(O&&t&&_(`<${e}> (static)`,t),null)}function tt(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}L();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(O&&t&&_(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function nt(e){L();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(O&&t&&_(`marker <!--${e.slice(0,24)}-->`,t),null)}var pe=!1;function rt(){pe||(pe=!0,re({hydrateElement:Qe,hydrateText:tt,hydrateMarker:nt,hydrateStatic:et}))}function ye(e,t,n){rt(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=de(),s=n?.resourceNamespace,a=0;Je(()=>s?`${s}:r${a++}`:`r${a++}`),Ye(r?c=>c in r?{value:r[c]}:void 0:null);try{return K(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}import{createChildOwner as ot,createMemo as z,disposeScope as it,getOwner as st,runWithOwner as at,untrack as ge}from"@fluixi/reactive/signal";function me(e){return typeof e=="function"?e:(()=>e)}function w(e){return()=>{let t=e();return typeof t=="function"?t():t}}function he(e){return e!=null&&e!==!1}function xe(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function be(e){let t=w(()=>e.when),n=z(t,void 0),r=z(n,void 0),s=st(),a=null,c=null,i=o=>{o!==c&&(a&&it(a),a=ot(s),c=o)};return z(()=>{let o=r();return i(o?"when":"fallback"),at(a,()=>{if(o){let l=e.children;return typeof l=="function"&&!xe(l)?typeof n=="function"?ge(()=>ge(n)?l(n()):e.fallback):l(n):l}return e.fallback});return e.fallback??null},void 0,{name:"show"})}import{mapArray as ct,keyArray as lt}from"@fluixi/reactive/signal";function Te(e){let t=w(()=>e.each),n=()=>e.fallback??null,r=(s,a)=>{let c=e.children,i=Array.isArray(c)?c.map(o=>typeof o=="function"?o(s,a):o):typeof c=="function"?c(s,a):c;return P(i),i};return e.by?lt(t,e.by,(s,a)=>r(s,a),{fallback:n}):ct(t,(s,a)=>r(s,a),{fallback:n})}import{indexArray as ft}from"@fluixi/reactive/signal";function Ee(e){let t=w(()=>e.each);return ft(t,(n,r)=>{let s=e.children(n,r);return P(s),s},{fallback:()=>e.fallback??null})}import{mapArray as Ct,keyArray as Pt,indexArray as Mt}from"@fluixi/reactive/signal";import{createMemo as ut,createChildOwner as dt,disposeScope as pt,getOwner as yt,runWithOwner as we}from"@fluixi/reactive/signal";var q=Symbol("match");function Ne(e){return{[q]:!0,when:w(()=>e.when),get children(){return e.children}}}function Ae(e){let t=Array.isArray(e.children)?e.children:[e.children],n=yt(),r=null,s=-1,a=c=>{c!==s&&(r&&pt(r),r=dt(n),s=c)};return ut(()=>{for(let c=0;c<t.length;c+=1){let o=t[c],l=0;for(;typeof o=="function"&&!o[q]&&l++<10;)o=o();if(!o||typeof o!="object"||o[q]!==!0)continue;let f=o.when();if(he(f))return a(c),we(r,()=>typeof o.children=="function"?o.children(f):o.children)}return a(-2),we(r,()=>e.fallback??null)})}import{createMemo as mt,createChildOwner as ht,disposeScope as xt,getOwner as gt,runWithOwner as bt}from"@fluixi/reactive/signal";function Se(e){let t=me(e.component),{component:n,...r}=e,s=gt(),a=null,c;return mt(()=>{let i=t();return i!==c&&(a&&xt(a),a=ht(s),c=i),i==null?null:typeof i=="string"?{tag:i,props:r}:bt(a,()=>i(r))})}import{createRoot as Tt,onCleanup as Et}from"@fluixi/reactive/signal";function ve(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return Tt(s=>{n=s,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),v(r,e.children)&&W(e.ref,r)}),Et(()=>{n(),r.remove()}),null}import{createMemo as wt,createSignal as Nt}from"@fluixi/reactive/signal";function Ce(e){let[t,n]=Nt(null),r=()=>n(null);return wt(()=>{let s=t();if(s!==null)return typeof e.fallback=="function"?e.fallback(s,r):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(a){return n(a),typeof e.fallback=="function"?e.fallback(a,r):e.fallback}})}import{createMemo as At}from"@fluixi/reactive/signal";function Pe(e){return At(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,s]of Object.entries(t)){if(!r)continue;(typeof s=="function"?s():s)&&n.push(r)}return n.join(" ")})}import{createMemo as St}from"@fluixi/reactive/signal";function vt(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Me(e){return St(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,s]of Object.entries(t)){if(!r)continue;let a=typeof s=="function"?s():s;a!=null&&n.push(`${vt(r)}: ${a}`)}return n.join("; ")})}import{signal as fr,memo as ur,effect as dr,store as pr,createSignal as yr,createMemo as mr,createEffect as hr,createComputed as xr,createRenderEffect as gr,createRoot as br,createResource as Tr,createContext as Er,useContext as wr,onCleanup as Nr,batch as Ar,untrack as Sr}from"@fluixi/reactive";export{Se as Dynamic,Ce as ErrorBoundary,Te as For,Ee as Index,Ne as Match,ve as Portal,be as Show,Ae as Switch,Ar as batch,Pe as classMap,Ge as createComponent,xr as createComputed,Er as createContext,hr as createEffect,Le as createElement,mr as createMemo,gr as createRenderEffect,Tr as createResource,br as createRoot,yr as createSignal,fe as delegateEvents,dr as effect,ye as hydrate,Mt as indexArray,v as insert,Pt as keyArray,Ct as mapArray,ur as memo,Nr as onCleanup,K as render,T as setAttribute,k as setClassName,S as setProperty,U as setStyle,fr as signal,ze as spread,pr as store,Me as styleMap,Sr as untrack,wr as useContext};
package/dist/cdn/dom.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var De=Object.defineProperty;var bn=Object.getOwnPropertyDescriptor;var En=Object.getOwnPropertyNames;var wn=Object.prototype.hasOwnProperty;var Nn=(e,t)=>{for(var n in t)De(e,n,{get:t[n],enumerable:!0})},Sn=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of En(t))!wn.call(e,o)&&o!==n&&De(e,o,{get:()=>t[o],enumerable:!(r=bn(t,o))||r.enumerable});return e};var vn=e=>Sn(De({},"__esModule",{value:!0}),e);var co={};Nn(co,{ClientOnly:()=>tt,Dynamic:()=>en,ErrorBoundary:()=>rn,FX_DATA_ID:()=>K,For:()=>Xt,Index:()=>Yt,Island:()=>Ft,JSX_PROPERTIES:()=>ce,Match:()=>Zt,NoSsr:()=>nn,Portal:()=>tn,SVG_ELEMENTS:()=>kn,SVG_NAMESPACE:()=>H,Show:()=>Gt,Switch:()=>Qt,VOID_ELEMENTS:()=>Pn,addClass:()=>Dn,addDelegatedEventListener:()=>Lt,addNativeEventListener:()=>Ve,appendChildren:()=>Wn,applyElementProp:()=>le,applyProps:()=>Be,applyUse:()=>We,asComponent:()=>ur,asContext:()=>cr,asOutlet:()=>ar,asProvider:()=>lr,asRoute:()=>sr,asRouter:()=>or,asRoutes:()=>ir,asSuspense:()=>fr,batch:()=>g.batch,bindPair:()=>Ir,captureHydrationCursor:()=>Mt,checkRenderType:()=>dr,classMap:()=>sn,cleanChildren:()=>O,cloneTemplate:()=>Dt,closest:()=>On,createComponent:()=>Ge,createComputed:()=>g.createComputed,createContext:()=>g.createContext,createDynamicElement:()=>Yr,createEffect:()=>g.createEffect,createElement:()=>Hn,createMemo:()=>g.createMemo,createNativeElement:()=>He,createPortal:()=>Or,createRenderEffect:()=>g.createRenderEffect,createRequestContext:()=>U,createResource:()=>g.createResource,createRoot:()=>g.createRoot,createSignal:()=>g.createSignal,createStore:()=>Tn.createStore,createTemplate:()=>Ot,delegate:()=>zn,delegateEvents:()=>Fe,escapeFxJson:()=>se,escapeHTML:()=>_r,fnName:()=>vr,generateID:()=>gr,getAttribute:()=>qn,getGlobal:()=>rr,getLitEventName:()=>Rn,getLocals:()=>Ye,getOffset:()=>Kn,getRequestContext:()=>M,getRequestEvent:()=>xe,getRequestLocals:()=>Te,getServerData:()=>ae,getStableElementId:()=>mr,getStyle:()=>Fn,handleRef:()=>ie,hasClass:()=>In,holeContent:()=>Sr,holeEnd:()=>Nr,holeScope:()=>wr,html:()=>Vt,hydrate:()=>Se,hydrateAdvancePast:()=>W,hydrateIslands:()=>Ht,indexArray:()=>z.indexArray,initializeIntegration:()=>Fr,insert:()=>R,insertExpression:()=>ee,intergartionInitialized:()=>Hr,isAccessor:()=>$r,isComponent:()=>S,isContext:()=>St,isCustomElement:()=>dt,isDOMNode:()=>tr,isDelegatedEvent:()=>Tr,isDomElement:()=>ue,isDomNode:()=>I,isDomText:()=>fe,isEventHandler:()=>Cn,isFunction:()=>br,isIntegrationInitialized:()=>Vr,isJSXTemplate:()=>er,isLitTemplateResult:()=>yt,isNativeElement:()=>Dr,isOutlet:()=>wt,isPromise:()=>Q,isProvider:()=>Nt,isReactElement:()=>Zn,isRoute:()=>Et,isRouter:()=>Tt,isRoutes:()=>bt,isSVGElement:()=>Ke,isServer:()=>h,isSuspense:()=>vt,isTemplateFactory:()=>Qn,isVisible:()=>Un,iterateFn:()=>Ar,keyArray:()=>z.keyArray,makeArrayFlat:()=>_t,mapArray:()=>z.mapArray,mergeProps:()=>kr,observeIntersection:()=>Xn,observeResize:()=>Jn,onCleanup:()=>g.onCleanup,query:()=>_e,queryAll:()=>Ln,registerCreateComponent:()=>jr,registerGlobal:()=>nr,removeAttribute:()=>jn,removeChildren:()=>Vn,removeClass:()=>_n,removeDelegatedEventListener:()=>je,render:()=>ze,renderToString:()=>ct,renderToStringAsync:()=>ft,resetIntegration:()=>Wr,runHydrationAt:()=>Z,runWithRequestContext:()=>B,runWithoutHydration:()=>Pt,scrollIntoView:()=>Bn,serializeNode:()=>A,serializeResourceData:()=>ke,setAttribute:()=>w,setClassList:()=>re,setClassName:()=>ne,setDataRedactor:()=>ut,setDynamicAttribute:()=>ye,setDynamicBoolAttribute:()=>Ue,setDynamicProperty:()=>me,setProperty:()=>te,setRequestStore:()=>Je,setServerMode:()=>$,setStyle:()=>oe,setStyles:()=>pt,shouldSetAsProperty:()=>Mn,splitProps:()=>Lr,spread:()=>Pr,styleMap:()=>ln,svg:()=>Wt,templateNode:()=>Er,toAttributeName:()=>An,toggleClass:()=>$n,untrack:()=>g.untrack,useContext:()=>g.useContext,waitForElement:()=>Gn});module.exports=vn(co);function An(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function Cn(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function Rn(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function Mn(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),r={input:new Set(["value","checked","indeterminate"]),textarea:new Set(["value"]),select:new Set(["value"]),option:new Set(["selected","value"]),audio:new Set(["volume","currentTime","paused"]),video:new Set(["volume","currentTime","paused"]),img:new Set(["src","srcset"]),iframe:new Set(["src"]),a:new Set(["href"])};return n.has(t)||r[e]&&r[e].has(t)}var Pn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),kn=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),H="http://www.w3.org/2000/svg";function dt(e){return e.localName.includes("-")}function le(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(dt(e)){e[t]=n;return}w(e,t,n,r)}var ce=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function _e(e,t=document){return t.querySelector(e)}function Ln(e,t=document){return Array.from(t.querySelectorAll(e))}function On(e,t){return e.closest(t)}function Dn(e,...t){e.classList.add(...t)}function _n(e,...t){e.classList.remove(...t)}function $n(e,...t){t.forEach(n=>e.classList.toggle(n))}function In(e,t){return e.classList.contains(t)}function w(e,t,n,r=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function qn(e,t){return e.getAttribute(t)}function jn(e,t){e.removeAttribute(t)}function pt(e,t){Object.assign(e.style,t)}function Fn(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function Hn(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,i])=>{if(o==="class"||o==="className")r.className=i;else if(o==="style"&&typeof i=="object")pt(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else w(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function Vn(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Wn(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function Un(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Bn(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Kn(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function zn(e,t,n,r){let o=i=>{let s=i.target.closest(n);s&&e.contains(s)&&r(i,s)};return e.addEventListener(t,o),()=>{e.removeEventListener(t,o)}}function Gn(e,t=5e3){return new Promise((n,r)=>{let o=_e(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=_e(e);a&&(i.disconnect(),clearTimeout(s),n(a))});i.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{i.disconnect(),r(new Error(`Element ${e} not found within ${t}ms`))},t)})}function Xn(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function Jn(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Yn=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function Zn(e){return typeof e=="object"&&e!==null&&e.$$typeof===Yn}function yt(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Qn(e){if(typeof e!="function")return!1;try{let t=e();return yt(t)}catch{return!1}}function er(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function tr(e){return e instanceof Node}function nr(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function rr(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}var T=require("@fluixi/reactive/signal");var mt="1.0.0-alpha.77";var gt=require("@fluixi/reactive"),N={dom:mt,reactive:gt.VERSION};function ht(e){N.core&&e.setAttribute("fluixi",N.core),e.setAttribute("fx-dom",N.dom),e.setAttribute("fx-reactive",N.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=N)}function xt(){let e=[N.core,N.dom,N.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${N.core??"(absent)"}, dom ${N.dom}, reactive ${N.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function or(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function ir(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function sr(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function ar(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function lr(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function cr(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function ur(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function fr(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function Tt(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function bt(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function Et(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function wt(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function Nt(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function St(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function S(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function vt(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function dr(e){return Tt(e)?{type:"router",value:e}:Et(e)?{type:"route",value:e}:bt(e)?{type:"routes",value:e}:wt(e)?{type:"outlet",value:e}:S(e)?{type:"component",value:e}:vt(e)?{type:"suspense",value:e}:Nt(e)?{type:"provider",value:e}:St(e)?{type:"context",value:e}:{type:"none",value:e}}var d=require("@fluixi/reactive/signal");var h=typeof document>"u";function $(e){h=e}var Y=Symbol.for("fluixi.server-node"),$e=null;function At(e){$e=e}function V(){if(!$e)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return $e}function I(e){return e!=null&&e[Y]===!0?!0:typeof Node<"u"&&e instanceof Node}function ue(e){return e!=null&&e[Y]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function fe(e){return e!=null&&e[Y]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},Ct=null;function Rt(e){Ct=e}function de(){return Ct}function Ie(e,t){return u.active&&t.parentNode===e}function qe(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function Mt(){return u.active?u.cursor:null}function Z(e,t){if(!e||e.parentNode==null)return t();let n=u.active,r=u.cursor,o=u.parents;u.active=!0,u.cursor=e,u.parents=[];try{return t()}finally{u.active=n,u.cursor=r,u.parents=o}}function Pt(e){if(!u.active)return e();let t=u.cursor,n=u.parents;u.active=!1,u.parents=[];try{return e()}finally{u.active=!0,u.cursor=t,u.parents=n}}function W(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&qe(t)}function pr(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let r=0,o=e;for(;o=o.previousElementSibling;)o.tagName===e.tagName&&r++;n+=`:nth-of-type(${r+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function yr(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return`el_${Math.abs(t)}`}function mr(e){return yr(pr(e))}var gr=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),hr={};var kt=new Map,pe=new Set,ge=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function Fe(e){if(!h)for(let t of e)pe.has(t)||ge.has(t)||(pe.add(t),document.addEventListener(t,xr))}function xr(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let r=n[t];if(r&&!n.disabled&&(r(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function Lt(e,t,n){if(e[`$$${t}`]=n,ge.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}pe.has(t)||Fe([t])}function je(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function Tr(e){return!ge.has(e)}function br(e){return typeof e=="function"}function D(e,t=!1){if(h)return V().createText(e);if(u.active&&!t){let n=de()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function He(e,t=!1){if(h)return V().createElement(e,t);if(u.active){let n=de()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(H,e):document.createElement(e)}function Ot(e,t=!1){let n=kt.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,kt.set(e,r),r}function Er(e,t,n=!1,r=!1){if(h){let o=V();return n?o.parseTemplate(e,r):o.createRaw(e)}if(u.active){let o=de()?.hydrateStatic(t);if(o)return o}return Dt(Ot(e,r),r).firstChild}function wr(e,t){if(!u.active)return t();let n=Z(e.nextSibling,t);if(typeof n=="function"){let r=n;return((...o)=>u.active?Z(e.nextSibling,()=>r(...o)):r(...o))}return n}function Nr(e){for(let t=e.nextSibling;t;t=t.nextSibling)if(t.nodeType===8&&t.data==="fx/")return t;throw new Error("[fluixi] template hole is missing its closing marker")}function Sr(e,t){let n=[];for(let r=e.nextSibling;r&&r!==t;r=r.nextSibling)n.push(r);return n}function Dt(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function _t(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?_t(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function vr(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Ar(e){if((0,T.isSignal)(e)||S(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,T.isSignal)(t)&&!S(t);)t=t();return t}var L=0,Cr=200;function Rr(e,t,n,r,o){let i=r,s=new Map;return(0,d.createRenderEffect)(()=>{let a;if(S(e)&&!(0,T.isSignal)(e)){if(!s.has(e)){L++;try{let l=e();s.set(e,l)}finally{L--}}for(a=s.get(e);typeof a=="function"&&(0,T.isSignal)(a);)a=a()}else for(a=e();typeof a=="function"&&(0,T.isSignal)(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(S(a)){if(!s.has(a)){let c=a;L++;try{let f=c();s.set(c,f)}finally{L--}}a=s.get(a)}else if((0,T.isSignal)(a))a=a();else if(a=a(),typeof a!="function"||!(0,T.isSignal)(a)&&!S(a))break}L++;try{i=ee(t,a,n,i,s),o(i)}finally{L--}})}function R(e,t,n,r){if(L>Cr)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=D("",!0),e.appendChild(n));let o=r??null,i=l=>Array.isArray(l)&&l.some(c=>typeof c=="function"),s=l=>typeof l=="function"?l:()=>l;if(typeof t!="function"&&!i(t)){L++;try{o=ee(e,t,n,o)}finally{L--}return()=>o}let a=Rr(s(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function ee(e,t,n,r,o){if(t==null||typeof t=="boolean")return O(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return O(e,r,n);if(Q(t)){let s=D("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),O(e,r.slice(1),n)):b(e,s,n):r?e.replaceChild(s,r):b(e,s,n),t.then(a=>{s.parentNode===e&&ee(e,a,s.nextSibling,s)}).catch(a=>{console.error("Error resolving promise in insertExpression:",a)}),s}let i=typeof t;if(i==="string"||i==="number"){if(i==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let a=D(t);return b(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=O(e,r,n)}if(r&&fe(r))return r.data=t,r;let s=D(t);return r&&r.parentNode===e?e.replaceChild(s,r):Ie(e,s)||b(e,s,n),s}if(I(t))return Ie(e,t)?(qe(t),t):Array.isArray(r)?(r.length===0?b(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),O(e,r.slice(1),n)):b(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):b(e,t,n)):b(e,t,n),t);if(Array.isArray(t)){let s=[],a=Array.isArray(r)?r:r?[r]:[],l=[];k(t,s,e,n,!0,o,l);let c=Mr(e,a,s,n);for(let f of l){let p=R(e,f.sig,f.marker);(0,d.onCleanup)(()=>{O(e,p()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(i==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let a=s;if(typeof a.type=="function"){let l=a.type(a.props||{});return ee(e,l,n,r)}}}return O(e,r,n)}function k(e,t,n,r,o=!0,i,s){for(let a=0;a<e.length;a++){let l=e[a];if(!(l==null||typeof l=="boolean")){for(;typeof l=="function"&&!Q(l)&&!(0,T.isSignal)(l)&&!S(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(S(l)&&!(0,T.isSignal)(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!Q(c)&&!(0,T.isSignal)(c)&&!S(c);)i||(i=new Map),i.has(c)||i.set(c,c()),c=i.get(c);if(c==null||typeof c=="boolean")continue;if(typeof c=="function"){if((0,T.isSignal)(c)){if(s){let p=D("",!0);t.push(p),s.push({marker:p,sig:c});continue}let f=c();for(;typeof f=="function"&&(0,T.isSignal)(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?k(f,t,n,r,o,i):k([f],t,n,r,o,i);continue}continue}Array.isArray(c)?k(c,t,n,r,o,i,s):k([c],t,n,r,o,i,s);continue}if(Q(l)){let c=D("",!0);t.push(c),l.then(f=>{if(c.parentNode){let p=[];if(k([f],p,c.parentNode,void 0,!1,i),p.length>0){c.parentNode.replaceChild(p[0],c);for(let y=1;y<p.length;y++)c.parentNode?.insertBefore(p[y],p[y-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){k(l,t,n,r,o,i,s);continue}if(I(l)){t.push(l);continue}if(typeof l=="object"&&l!==null&&"type"in l&&"props"in l){let c=l;if(typeof c.type=="function"){let f=c.type(c.props||{});Array.isArray(f)?k(f,t,n,r,!1,i):k([f],t,n,r,!1,i);continue}}if(typeof l=="string"||typeof l=="number"){let c=String(l);if(c.trim()===""&&c!==" ")continue;t.push(D(c));continue}t.push(D(String(l)))}}}}function Mr(e,t,n,r){for(let p=0;p<n.length;p++){let y=n[p].parentNode;y!==null&&y!==e&&y.nodeType!==11&&(n=n.slice(),n[p]=n[p].cloneNode(!0))}let o=n.length,i=t.length,s=o,a=0,l=0,c=i>0?t[i-1].nextSibling??void 0:r,f=null;for(;a<i||l<s;){if(t[a]===n[l]){a++,l++;continue}for(;i>a&&s>l&&t[i-1]===n[s-1];)i--,s--;if(i===a){let p=s<o?l?n[l-1].nextSibling??void 0:n[s-l]:c;for(;l<s;)b(e,n[l++],p)}else if(s===l)for(;a<i;)(!f||!f.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[s-1]&&n[l]===t[i-1]){let p=t[--i].nextSibling;b(e,n[l++],t[a++].nextSibling),b(e,n[--s],p),t[i]=t[a-1]}else{if(!f){f=new Map;let y=l;for(;y<s;)f.set(n[y],y++)}let p=f.get(t[a]);if(p!=null)if(l<p&&p<s){let y=a,m=1;for(;++y<i&&y<s&&!(!f.has(t[y])||f.get(t[y])!==p+m);)m++;if(m>p-l){let Le=t[a];for(;l<p;)b(e,n[l++],Le)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(b(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function O(e,t,n){if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r].parentNode===e&&e.removeChild(t[r]);else t.parentNode===e&&e.removeChild(t);return null}function b(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function te(e,t,n){n==null?delete e[t]:e[t]=n}function Ve(e,t,n){let r=n,o;return Array.isArray(n)&&(r=n[0],o=n[1]),typeof r!="function"?()=>{}:(e.addEventListener(t,r,o),()=>e.removeEventListener(t,r,o))}function We(e,t){let n=(r,o)=>{typeof r=="function"&&r(e,o??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let r of t)Array.isArray(r)?n(r[0],r[1]):n(r)}}function ye(e,t,n,r=!1){return typeof n!="function"?(w(e,t,n,r),()=>{}):(0,d.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;w(e,t,o,r)})}function me(e,t,n){return typeof n!="function"?(te(e,t,n),()=>{}):(0,d.createRenderEffect)(()=>{let r=typeof n=="function"?n():n;te(e,t,r)})}function Ue(e,t,n){return typeof n!="function"?(w(e,t,!!n),()=>{}):(0,d.createRenderEffect)(()=>{let r=n();w(e,t,!!r)})}function ne(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,d.createRenderEffect)(()=>ne(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(r=>{let o=t[r];return typeof o=="function"?o():!!o}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function re(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],i=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push((0,d.createRenderEffect)(()=>{let s=!!o();for(let a of i)e.classList.toggle(a,s)}));else{let s=!!(typeof o=="function"?o():o);for(let a of i)e.classList.toggle(a,s)}}}function oe(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let r in n){let o=n[r];o==null?e.style[r]="":e.style[r]=o}}function Pr(e){let{element:t,props:n,prevProps:r=hr,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!ue(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=o||t.namespaceURI===H,a=[];for(let l in n){if(i&&l==="children")continue;let c=n[l],f=r[l];if(c===f)continue;if(l==="ref"){ie(c,t);continue}if(l==="use"){We(t,c);continue}if(l.startsWith("on:")){a.push(Ve(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(me(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(ye(t,l.slice(5),c,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((0,d.createRenderEffect)(()=>ne(t,c()))):ne(t,c);continue}if(l==="classList"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>re(t,c()))):re(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>oe(t,c()))):oe(t,c);continue}if(l.startsWith("on")){let y=l.slice(2).toLowerCase();f&&je(t,y),c&&Lt(t,y,c);continue}let p=ce.has(l)||!s&&l in t;typeof c=="function"?a.push(p?me(t,l,c):ye(t,l,c,s)):a.push((0,d.createRenderEffect)(()=>p?te(t,l,n[l]):w(t,l,n[l],s)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();je(t,c)}else ce.has(l)?te(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function Be(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){ie(o,e);continue}if(r!=="children"){if(r==="use"){We(e,o);continue}if(r.startsWith("on:")){Ve(e,r.slice(3),o);continue}if(r.startsWith("prop:")){me(e,r.slice(5),o);continue}if(r.startsWith("attr:")){ye(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){Ue(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(ge.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,pe.has(i)||Fe([i]);continue}if(r==="class"||r==="className"){ne(e,o);continue}if(r==="classList"){typeof o=="function"?(0,d.createRenderEffect)(()=>re(e,o())):re(e,o);continue}if(r==="style"){typeof o=="function"?(0,d.createRenderEffect)(()=>oe(e,o())):oe(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let 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();le(e,r,s,n)});(0,d.onCleanup)(()=>{i()})}else(0,d.createRenderEffect)(()=>le(e,r,t[r],n))}}}function kr(...e){let t=r=>{for(let o=e.length-1;o>=0;o--){let 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 Lr(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 ie(e,t){if(e){if(I(e)){let n=t,r=e;if(!n)return;typeof n=="function"?n(r):typeof n=="object"&&"current"in n&&(n.current=r);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function Or(e,t,n){let r=t||document.body,o=(0,d.readChildren)(()=>e),i=[];return(0,d.batch)(()=>{let s=(0,d.createRenderEffect)(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),i.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):I(a)&&(r.appendChild(a),i.push(()=>{a.parentNode===r&&r.removeChild(a)}))});i.push(s),(0,d.onCleanup)(()=>{i.forEach(a=>a())})}),null}function Dr(e){return typeof e=="string"&&e.toLowerCase()===e}function Ke(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function _r(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Q(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function $r(e){return typeof e=="function"&&e.length===0&&(0,T.isSignal)(e)}function ze(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return(0,d.createRoot)(s=>{(0,d.batch)(()=>{u.active||(t.textContent=""),ht(t),xt(),R(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}function Ir(e){if(Array.isArray(e))return e;if(typeof e=="function"&&typeof e.set=="function")return[e,e.set];throw new TypeError("[fluixi] bind: needs a signal — either `signal(…)` or the `[get, set]` pair from `createSignal(…)`.")}var qr="__fx_dom_create_component__",q=globalThis[qr]??={fn:null};function jr(e){q.fn=e}function Fr(e={}){let t=e.signalSystem?.createComponent;t&&(q.fn=t)}function Ge(e,t){return q.fn?q.fn(e,t):(()=>e(t))}var Hr=()=>q.fn!==null,Vr=()=>q.fn!==null;function Wr(){q.fn=null}var he,It={getStore:()=>he,run(e,t){let n=he;he=e;try{return t()}finally{he=n}}},Xe=It;function Je(e){Xe=e??It}function U(e={}){e.locals||(e.locals=e.request?Te(e.request):{});let t=0,n=0,r=null,o=new Map,i=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${t++}`,nextResourceId:()=>{if(r===null)return`r${n++}`;let s=o.get(r)??0;return o.set(r,s+1),`${r}:r${s}`},nextIslandNamespace:s=>{let a=i.get(s)??0;return i.set(s,a+1),`${s}#${a}`},withResourceScope(s,a){let l=r;r=s;try{return a()}finally{r=l}},pending:new Set,data:new Map}}function B(e,t){return Xe.run(e,t)}function M(){return Xe.getStore()}function xe(){return M()?.event}function Ye(){let e=xe();return e?(e.locals||(e.locals={}),e.locals):{}}var $t=new WeakMap;function Te(e){let t=$t.get(e);return t||(t={},$t.set(e,t)),t}var be=require("@fluixi/reactive/signal");var K="__FX_DATA__";function se(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var Ze;function ae(){let e=globalThis.__FX_DATA__;if(e)return e;if(Ze!==void 0)return Ze;let t=null;if(typeof document<"u"){let n=document.getElementById(K)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return Ze=t}function Ee(){for(;;){for(;u.cursor&&u.cursor.nodeType===3&&u.cursor.data==="";)u.cursor=u.cursor.nextSibling;if(u.cursor!=null||!u.parents.length)return;u.cursor=u.parents.pop().nextSibling}}var Ur=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),we=typeof process<"u"&&process.env&&!1;function Ne(e,t){let n=t.nodeType===1?`<${t.tagName.toLowerCase()}>`:t.nodeType===3?`text ${JSON.stringify((t.nodeValue??"").slice(0,24))}`:t.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${n}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function Br(e){Ee();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Ur.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(we&&t&&Ne(`<${e}>`,t),null)}function Kr(e){Ee();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(u.cursor=t.nextSibling,t):(we&&t&&Ne(`<${e}> (static)`,t),null)}function zr(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}Ee();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(we&&t&&Ne(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Gr(e){Ee();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(we&&t&&Ne(`marker <!--${e.slice(0,24)}-->`,t),null)}var qt=!1;function Xr(){qt||(qt=!0,Rt({hydrateElement:Br,hydrateText:zr,hydrateMarker:Gr,hydrateStatic:Kr}))}function Se(e,t,n){Xr(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=ae(),o=n?.resourceNamespace,i=0;(0,be.setResourceIdSource)(()=>o?`${o}:r${i++}`:`r${i++}`),(0,be.setServerDataGetter)(r?s=>s in r?{value:r[s]}:void 0:null);try{return ze(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Qe="fluixi-island";function Ft(e){let{component:t,props:n={},name:r}=e,o=He(Qe),i=r??t.name??"Island";w(o,"name",i),w(o,"props",JSON.stringify(n??{}));let s=h?M():void 0;if(s){let a=s.nextIslandNamespace(i);R(o,()=>s.withResourceScope(a,()=>t(n)))}else R(o,()=>t(n));return o}var jt=!1;function Jr(){if(jt||typeof document>"u")return;jt=!0;let e=document.createElement("style");e.textContent=`${Qe}{display:contents}`,document.head.appendChild(e)}function Ht(e){if(typeof document>"u")return;Jr();let t=document.querySelectorAll(Qe),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{}Se(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}function Vt(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function Wt(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}var Ut=require("@fluixi/reactive/signal");function Yr(e,t={}){if(typeof e=="function")return Ge(e,t);if(typeof e!="string"||e.length===0)return null;let n=Ke(e);if(h)return V().createElement(e,n);let r=n?document.createElementNS(H,e):document.createElement(e);return Be(r,t,n),Zr(r,t),r}function Zr(e,t){if(!t||t.children===void 0)return;let n=(0,Ut.readChildren)(()=>t.children),r=o=>{R(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}var x=require("@fluixi/reactive/signal");function Bt(e){return typeof e=="function"?e:(()=>e)}function _(e){return()=>{let t=e();return typeof t=="function"?t():t}}function Kt(e){return e!=null&&e!==!1}function zt(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function Gt(e){let t=_(()=>e.when),n=(0,x.createMemo)(t,void 0),r=(0,x.createMemo)(n,void 0),o=(0,x.getOwner)(),i=null,s=null,a=l=>{l!==s&&(i&&(0,x.disposeScope)(i),i=(0,x.createChildOwner)(o),s=l)};return(0,x.createMemo)(()=>{let l=r();return a(l?"when":"fallback"),(0,x.runWithOwner)(i,()=>{if(l){let c=e.children;return typeof c=="function"&&!zt(c)?typeof n=="function"?(0,x.untrack)(()=>(0,x.untrack)(n)?c(n()):e.fallback):c(n):c}return e.fallback});return e.fallback??null},void 0,{name:"show"})}var ve=require("@fluixi/reactive/signal");function Xt(e){let t=_(()=>e.each),n=()=>e.fallback??null,r=(o,i)=>{let s=e.children,a=Array.isArray(s)?s.map(l=>typeof l=="function"?l(o,i):l):typeof s=="function"?s(o,i):s;return W(a),a};return e.by?(0,ve.keyArray)(t,e.by,(o,i)=>r(o,i),{fallback:n}):(0,ve.mapArray)(t,(o,i)=>r(o,i),{fallback:n})}var Jt=require("@fluixi/reactive/signal");function Yt(e){let t=_(()=>e.each);return(0,Jt.indexArray)(t,(n,r)=>{let o=e.children(n,r);return W(o),o},{fallback:()=>e.fallback??null})}var z=require("@fluixi/reactive/signal");var v=require("@fluixi/reactive/signal");var et=Symbol("match");function Zt(e){return{[et]:!0,when:_(()=>e.when),get children(){return e.children}}}function Qt(e){let t=Array.isArray(e.children)?e.children:[e.children],n=(0,v.getOwner)(),r=null,o=-1,i=s=>{s!==o&&(r&&(0,v.disposeScope)(r),r=(0,v.createChildOwner)(n),o=s)};return(0,v.createMemo)(()=>{for(let s=0;s<t.length;s+=1){let l=t[s],c=0;for(;typeof l=="function"&&!l[et]&&c++<10;)l=l();if(!l||typeof l!="object"||l[et]!==!0)continue;let f=l.when();if(Kt(f))return i(s),(0,v.runWithOwner)(r,()=>typeof l.children=="function"?l.children(f):l.children)}return i(-2),(0,v.runWithOwner)(r,()=>e.fallback??null)})}var P=require("@fluixi/reactive/signal");function en(e){let t=Bt(e.component),{component:n,...r}=e,o=(0,P.getOwner)(),i=null,s;return(0,P.createMemo)(()=>{let a=t();return a!==s&&(i&&(0,P.disposeScope)(i),i=(0,P.createChildOwner)(o),s=a),a==null?null:typeof a=="string"?{tag:a,props:r}:(0,P.runWithOwner)(i,()=>a(r))})}var Ae=require("@fluixi/reactive/signal");function tn(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return(0,Ae.createRoot)(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),R(r,e.children)&&ie(e.ref,r)}),(0,Ae.onCleanup)(()=>{n(),r.remove()}),null}var Ce=require("@fluixi/reactive/signal");function tt(e){if(h)return e.fallback??null;let t=u.active,[n,r]=(0,Ce.createSignal)(!t);return t&&queueMicrotask(()=>r(!0)),(0,Ce.createMemo)(()=>n()?e.children:e.fallback??null,void 0,{name:"client-only"})}var nn=tt;var Re=require("@fluixi/reactive/signal");function rn(e){let[t,n]=(0,Re.createSignal)(null),r=()=>n(null);return(0,Re.createMemo)(()=>{let o=t();if(o!==null)return typeof e.fallback=="function"?e.fallback(o,r):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(i){return n(i),typeof e.fallback=="function"?e.fallback(i,r):e.fallback}})}var on=require("@fluixi/reactive/signal");function sn(e){return(0,on.createMemo)(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;(typeof o=="function"?o():o)&&n.push(r)}return n.join(" ")})}var an=require("@fluixi/reactive/signal");function Qr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function ln(e){return(0,an.createMemo)(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;let i=typeof o=="function"?o():o;i!=null&&n.push(`${Qr(r)}: ${i}`)}return n.join("; ")})}var Pe=1,ot=3,it=8,cn;cn=Y;var G=class{constructor(){this[cn]=!0;this.parentNode=null;this.childNodes=[]}get firstChild(){return this.childNodes[0]??null}get lastChild(){return this.childNodes[this.childNodes.length-1]??null}get nextSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>=0?t.childNodes[n+1]??null:null}get previousSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>0?t.childNodes[n-1]??null:null}get parentElement(){return this.parentNode}appendChild(t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes.push(t),t}insertBefore(t,n){if(n==null)return this.appendChild(t);t.parentNode&&t.parentNode.removeChild(t);let r=this.childNodes.indexOf(n);return t.parentNode=this,r<0?this.childNodes.push(t):this.childNodes.splice(r,0,t),t}removeChild(t){let n=this.childNodes.indexOf(t);return n>=0&&this.childNodes.splice(n,1),t.parentNode=null,t}replaceChild(t,n){let r=this.childNodes.indexOf(n);return r>=0&&(t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes[r]=t,n.parentNode=null),n}addEventListener(){}removeEventListener(){}},j=class e extends G{constructor(n){super();this.nodeType=ot;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}get textContent(){return this.data}set textContent(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},Me=class e extends G{constructor(n){super();this.nodeType=Pe;this.rawOuterHTML=n}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},X=class e extends G{constructor(n){super();this.nodeType=it;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},nt=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},rt=class{constructor(t){this.el=t}list(){let t=this.el.getAttribute("class");return t?t.split(/\s+/).filter(Boolean):[]}write(t){t.length?this.el.setAttribute("class",t.join(" ")):this.el.removeAttribute("class")}add(...t){let n=this.list();for(let r of t)n.includes(r)||n.push(r);this.write(n)}remove(...t){this.write(this.list().filter(n=>!t.includes(n)))}contains(t){return this.list().includes(t)}toggle(t,n){let r=this.contains(t),o=n===void 0?!r:n;return o?this.add(t):this.remove(t),o}},F=class e extends G{constructor(n,r=!1){super();this.nodeType=Pe;this.attributes=new Map;this.style=new nt;this.classList=new rt(this);this.rawHTML=null;this.localName=n.toLowerCase(),this.tagName=r?n:n.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(n,r){this.attributes.set(n,String(r))}removeAttribute(n){this.attributes.delete(n)}getAttribute(n){return this.attributes.has(n)?this.attributes.get(n):null}hasAttribute(n){return this.attributes.has(n)}get id(){return this.getAttribute("id")??""}set id(n){n==null?this.removeAttribute("id"):this.setAttribute("id",n)}get className(){return this.getAttribute("class")??""}set className(n){n==null?this.removeAttribute("class"):this.setAttribute("class",n)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(n){n==null?this.removeAttribute("for"):this.setAttribute("for",n)}set value(n){n==null?this.removeAttribute("value"):this.setAttribute("value",String(n))}set checked(n){n?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(n){n?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(n){}get textContent(){return this.childNodes.map(n=>n.textContent??"").join("")}set textContent(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,n!=null&&n!==""&&this.appendChild(new j(String(n)))}set innerText(n){this.textContent=n}set innerHTML(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=n==null?"":String(n)}cloneNode(n=!1){let r=new e(this.localName,this.isSVG);if(r.attributes=new Map(this.attributes),r.style.cssText=this.style.cssText,r.rawHTML=this.rawHTML,n)for(let o of this.childNodes)r.appendChild(o.cloneNode(!0));return r}};var eo=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),fn=/&/g,dn=/</g,pn=/>/g,to=/"/g;function st(e){return e.replace(fn,"&amp;").replace(dn,"&lt;").replace(pn,"&gt;")}function un(e){return e.replace(fn,"&amp;").replace(to,"&quot;").replace(dn,"&lt;").replace(pn,"&gt;")}function no(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function ro(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(`${no(n)}: ${r}`)}return t.join("; ")}function oo(e){let t="",n=ro(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${un(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${un(o)}"`}return t}function A(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return st(e);if(typeof e=="number")return st(String(e));if(typeof e=="function")return A(e());if(Array.isArray(e))return e.map(A).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case ot:return st(e.data??"");case it:return`<!--${e.data??""}-->`;case Pe:{let t=e.localName,n=`<${t}${oo(e)}>`;if(eo.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(A).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(A).join(""):""}var lt=require("@fluixi/reactive/signal"),E=require("@fluixi/reactive/signal");var io=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),so={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function yn(e){return e.replace(/&(#?\w+);/g,(t,n)=>so[n]??t)}var C=class extends Error{};function mn(e,t=!1){let n=0,r=[],o=[],i=c=>{let f=o[o.length-1];f?f.appendChild(c):r.push(c)};for(;n<e.length;){let c=e.indexOf("<",n);if(c===-1){a(e.slice(n));break}if(c>n&&a(e.slice(n,c)),e.startsWith("<!--",c)){let f=e.indexOf("-->",c);if(f===-1)throw new C(`unterminated comment at ${c}`);i(new X(e.slice(c+4,f))),n=f+3;continue}if(e[c+1]==="/"){let f=e.indexOf(">",c);if(f===-1)throw new C(`unterminated closing tag at ${c}`);let p=e.slice(c+2,f).trim().toLowerCase(),y=o.pop();if(!y||y.localName!==p)throw new C(`</${p}> does not close <${y?.localName??"nothing"}>`);n=f+1;continue}n=l(c)}if(o.length>0)throw new C(`unclosed <${o[o.length-1].localName}>`);let s=r[0];if(r.length!==1||!(s instanceof F))throw new C(`expected exactly one root element, got ${r.length}`);return s;function a(c){c!==""&&i(new j(yn(c)))}function l(c){let f=/[\s/>]/.exec(e.slice(c+1));if(!f)throw new C(`unterminated tag at ${c}`);let p=e.slice(c+1,c+1+f.index).toLowerCase(),y=new F(p,t),m=c+1+f.index;for(;m<e.length;){for(;m<e.length&&/\s/.test(e[m]);)m++;if(e[m]===">"){m++;break}if(e[m]==="/"&&e[m+1]===">"){m+=2;break}let Le=m;for(;m<e.length&&!/[\s=/>]/.test(e[m]);)m++;let J=e.slice(Le,m);if(J==="")throw new C(`malformed attribute at ${m}`);if(e[m]==="="){if(e[m+1]!=='"')throw new C(`attribute ${J} must have a double-quoted value`);let Oe=e.indexOf('"',m+2);if(Oe===-1)throw new C(`unterminated value for ${J}`);y.setAttribute(J,yn(e.slice(m+2,Oe))),m=Oe+1}else y.setAttribute(J,"")}return i(y),io.has(p)||o.push(y),m}}var gn=!1;function xn(){gn||(gn=!0,At({createElement:(e,t)=>new F(e,t),createText:e=>new j(e),createRaw:e=>new Me(e),parseTemplate:(e,t)=>mn(e,t),createComment:e=>new X(e)}))}function ct(e,t={}){let n=h;xn(),$(!0);let r=U(t.event);try{return B(r,()=>(0,lt.createRoot)(o=>{try{let i=typeof e=="function"?e():e;return A(i)}finally{o()}}))}finally{$(n)}}var hn=!1;function ao(){hn||(hn=!0,(0,E.setResourceTracker)(e=>{M()?.pending.add(e)}),(0,E.setResourceIdSource)(()=>M()?.nextResourceId()??""),(0,E.setResourceDataSink)((e,t)=>{e&&M()?.data.set(e,t)}))}var at=null;function ut(e){at=e}function ke(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(at)try{i=at(o,r)}catch{continue}i!==void 0&&(typeof i=="function"||typeof i=="symbol"||(t[r]=i))}if(Object.keys(t).length===0)return"";let n=se(JSON.stringify(t));return n==="{}"?"":`<script type="application/json" id="${K}">${n}<\/script>`}var lo=50;async function ft(e,t={}){let n=h;xn(),$(!0),ao();let r=U(t.event);try{return await B(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};(0,lt.createRoot)(f=>{s=f,i=(0,E.getOwner)(),o=typeof e=="function"?e():e});let a=()=>{try{(0,E.runWithOwner)(i,()=>A(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<lo;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await(0,E.flush)(),a()}let c=(0,E.runWithOwner)(i,()=>A(o))+ke(r);return s(),c})}finally{$(n)}}var g=require("@fluixi/reactive/signal"),Tn=require("@fluixi/reactive/store");
1
+ "use strict";var _e=Object.defineProperty;var wn=Object.getOwnPropertyDescriptor;var Nn=Object.getOwnPropertyNames;var Sn=Object.prototype.hasOwnProperty;var vn=(e,t)=>{for(var n in t)_e(e,n,{get:t[n],enumerable:!0})},An=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Nn(t))!Sn.call(e,o)&&o!==n&&_e(e,o,{get:()=>t[o],enumerable:!(r=wn(t,o))||r.enumerable});return e};var Cn=e=>An(_e({},"__esModule",{value:!0}),e);var fo={};vn(fo,{ClientOnly:()=>nt,Dynamic:()=>tn,ErrorBoundary:()=>on,FX_DATA_ID:()=>K,For:()=>Jt,Index:()=>Zt,Island:()=>Ht,JSX_PROPERTIES:()=>ue,Match:()=>Qt,NoSsr:()=>rn,Portal:()=>nn,SVG_ELEMENTS:()=>On,SVG_NAMESPACE:()=>H,Show:()=>Xt,Switch:()=>en,VOID_ELEMENTS:()=>Ln,addClass:()=>$n,addDelegatedEventListener:()=>Ot,addNativeEventListener:()=>We,appendChildren:()=>Bn,applyElementProp:()=>ce,applyProps:()=>Ke,applyUse:()=>Ue,asComponent:()=>dr,asContext:()=>fr,asOutlet:()=>cr,asProvider:()=>ur,asRoute:()=>lr,asRouter:()=>sr,asRoutes:()=>ar,asSuspense:()=>pr,batch:()=>g.batch,bindPair:()=>jr,captureHydrationCursor:()=>Pt,checkRenderType:()=>yr,classMap:()=>an,cleanChildren:()=>O,cloneTemplate:()=>_t,closest:()=>_n,createComponent:()=>Xe,createComputed:()=>g.createComputed,createContext:()=>g.createContext,createDynamicElement:()=>Qr,createEffect:()=>g.createEffect,createElement:()=>Wn,createMemo:()=>g.createMemo,createNativeElement:()=>Ve,createPortal:()=>_r,createRenderEffect:()=>g.createRenderEffect,createRequestContext:()=>U,createResource:()=>g.createResource,createRoot:()=>g.createRoot,createSignal:()=>g.createSignal,createStore:()=>En.createStore,createTemplate:()=>Dt,delegate:()=>Xn,delegateEvents:()=>He,effect:()=>J.effect,escapeFxJson:()=>ae,escapeHTML:()=>Ir,fnName:()=>Cr,generateID:()=>xr,getAttribute:()=>Fn,getGlobal:()=>ir,getLitEventName:()=>Pn,getLocals:()=>Ze,getOffset:()=>Gn,getRequestContext:()=>M,getRequestEvent:()=>Te,getRequestLocals:()=>be,getServerData:()=>le,getStableElementId:()=>hr,getStyle:()=>Vn,handleRef:()=>se,hasClass:()=>jn,holeContent:()=>Ar,holeEnd:()=>vr,holeScope:()=>Sr,html:()=>Wt,hydrate:()=>ve,hydrateAdvancePast:()=>W,hydrateIslands:()=>Vt,indexArray:()=>z.indexArray,initializeIntegration:()=>Vr,insert:()=>R,insertExpression:()=>te,intergartionInitialized:()=>Wr,isAccessor:()=>qr,isComponent:()=>S,isContext:()=>vt,isCustomElement:()=>pt,isDOMNode:()=>rr,isDelegatedEvent:()=>Er,isDomElement:()=>fe,isDomNode:()=>I,isDomText:()=>de,isEventHandler:()=>Mn,isFunction:()=>wr,isIntegrationInitialized:()=>Ur,isJSXTemplate:()=>nr,isLitTemplateResult:()=>mt,isNativeElement:()=>$r,isOutlet:()=>Nt,isPromise:()=>ee,isProvider:()=>St,isReactElement:()=>er,isRoute:()=>wt,isRouter:()=>bt,isRoutes:()=>Et,isSVGElement:()=>ze,isServer:()=>h,isSuspense:()=>At,isTemplateFactory:()=>tr,isVisible:()=>Kn,iterateFn:()=>Rr,keyArray:()=>z.keyArray,makeArrayFlat:()=>$t,mapArray:()=>z.mapArray,memo:()=>J.memo,mergeProps:()=>Or,observeIntersection:()=>Yn,observeResize:()=>Zn,onCleanup:()=>g.onCleanup,query:()=>$e,queryAll:()=>Dn,registerCreateComponent:()=>Hr,registerGlobal:()=>or,removeAttribute:()=>Hn,removeChildren:()=>Un,removeClass:()=>In,removeDelegatedEventListener:()=>Fe,render:()=>Ge,renderToString:()=>ut,renderToStringAsync:()=>dt,resetIntegration:()=>Br,runHydrationAt:()=>Q,runWithRequestContext:()=>B,runWithoutHydration:()=>kt,scrollIntoView:()=>zn,serializeNode:()=>A,serializeResourceData:()=>Le,setAttribute:()=>w,setClassList:()=>oe,setClassName:()=>re,setDataRedactor:()=>ft,setDynamicAttribute:()=>me,setDynamicBoolAttribute:()=>Be,setDynamicProperty:()=>ge,setProperty:()=>ne,setRequestStore:()=>Ye,setServerMode:()=>$,setStyle:()=>ie,setStyles:()=>yt,shouldSetAsProperty:()=>kn,signal:()=>J.signal,splitProps:()=>Dr,spread:()=>Lr,store:()=>bn.store,styleMap:()=>cn,svg:()=>Ut,templateNode:()=>Nr,toAttributeName:()=>Rn,toggleClass:()=>qn,untrack:()=>g.untrack,useContext:()=>g.useContext,waitForElement:()=>Jn});module.exports=Cn(fo);function Rn(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function Mn(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function Pn(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function kn(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),r={input:new Set(["value","checked","indeterminate"]),textarea:new Set(["value"]),select:new Set(["value"]),option:new Set(["selected","value"]),audio:new Set(["volume","currentTime","paused"]),video:new Set(["volume","currentTime","paused"]),img:new Set(["src","srcset"]),iframe:new Set(["src"]),a:new Set(["href"])};return n.has(t)||r[e]&&r[e].has(t)}var Ln=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),On=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),H="http://www.w3.org/2000/svg";function pt(e){return e.localName.includes("-")}function ce(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(pt(e)){e[t]=n;return}w(e,t,n,r)}var ue=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function $e(e,t=document){return t.querySelector(e)}function Dn(e,t=document){return Array.from(t.querySelectorAll(e))}function _n(e,t){return e.closest(t)}function $n(e,...t){e.classList.add(...t)}function In(e,...t){e.classList.remove(...t)}function qn(e,...t){t.forEach(n=>e.classList.toggle(n))}function jn(e,t){return e.classList.contains(t)}function w(e,t,n,r=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function Fn(e,t){return e.getAttribute(t)}function Hn(e,t){e.removeAttribute(t)}function yt(e,t){Object.assign(e.style,t)}function Vn(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function Wn(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,i])=>{if(o==="class"||o==="className")r.className=i;else if(o==="style"&&typeof i=="object")yt(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else w(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function Un(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Bn(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function Kn(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function zn(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Gn(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function Xn(e,t,n,r){let o=i=>{let s=i.target.closest(n);s&&e.contains(s)&&r(i,s)};return e.addEventListener(t,o),()=>{e.removeEventListener(t,o)}}function Jn(e,t=5e3){return new Promise((n,r)=>{let o=$e(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=$e(e);a&&(i.disconnect(),clearTimeout(s),n(a))});i.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{i.disconnect(),r(new Error(`Element ${e} not found within ${t}ms`))},t)})}function Yn(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function Zn(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Qn=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function er(e){return typeof e=="object"&&e!==null&&e.$$typeof===Qn}function mt(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function tr(e){if(typeof e!="function")return!1;try{let t=e();return mt(t)}catch{return!1}}function nr(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function rr(e){return e instanceof Node}function or(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function ir(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}var T=require("@fluixi/reactive/signal");var gt="1.0.0-alpha.78";var ht=require("@fluixi/reactive/version"),N={dom:gt,reactive:ht.VERSION};function xt(e){N.core&&e.setAttribute("fluixi",N.core),e.setAttribute("fx-dom",N.dom),e.setAttribute("fx-reactive",N.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=N)}function Tt(){let e=[N.core,N.dom,N.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${N.core??"(absent)"}, dom ${N.dom}, reactive ${N.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function sr(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function ar(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function lr(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function cr(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function ur(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function fr(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function dr(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function pr(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function bt(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function Et(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function wt(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function Nt(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function St(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function vt(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function S(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function At(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function yr(e){return bt(e)?{type:"router",value:e}:wt(e)?{type:"route",value:e}:Et(e)?{type:"routes",value:e}:Nt(e)?{type:"outlet",value:e}:S(e)?{type:"component",value:e}:At(e)?{type:"suspense",value:e}:St(e)?{type:"provider",value:e}:vt(e)?{type:"context",value:e}:{type:"none",value:e}}var d=require("@fluixi/reactive/signal");var h=typeof document>"u";function $(e){h=e}var Z=Symbol.for("fluixi.server-node"),Ie=null;function Ct(e){Ie=e}function V(){if(!Ie)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return Ie}function I(e){return e!=null&&e[Z]===!0?!0:typeof Node<"u"&&e instanceof Node}function fe(e){return e!=null&&e[Z]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function de(e){return e!=null&&e[Z]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},Rt=null;function Mt(e){Rt=e}function pe(){return Rt}function qe(e,t){return u.active&&t.parentNode===e}function je(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function Pt(){return u.active?u.cursor:null}function Q(e,t){if(!e||e.parentNode==null)return t();let n=u.active,r=u.cursor,o=u.parents;u.active=!0,u.cursor=e,u.parents=[];try{return t()}finally{u.active=n,u.cursor=r,u.parents=o}}function kt(e){if(!u.active)return e();let t=u.cursor,n=u.parents;u.active=!1,u.parents=[];try{return e()}finally{u.active=!0,u.cursor=t,u.parents=n}}function W(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&je(t)}function mr(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let r=0,o=e;for(;o=o.previousElementSibling;)o.tagName===e.tagName&&r++;n+=`:nth-of-type(${r+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function gr(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return`el_${Math.abs(t)}`}function hr(e){return gr(mr(e))}var xr=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Tr={};var Lt=new Map,ye=new Set,he=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function He(e){if(!h)for(let t of e)ye.has(t)||he.has(t)||(ye.add(t),document.addEventListener(t,br))}function br(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let r=n[t];if(r&&!n.disabled&&(r(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function Ot(e,t,n){if(e[`$$${t}`]=n,he.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}ye.has(t)||He([t])}function Fe(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function Er(e){return!he.has(e)}function wr(e){return typeof e=="function"}function D(e,t=!1){if(h)return V().createText(e);if(u.active&&!t){let n=pe()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function Ve(e,t=!1){if(h)return V().createElement(e,t);if(u.active){let n=pe()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(H,e):document.createElement(e)}function Dt(e,t=!1){let n=Lt.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,Lt.set(e,r),r}function Nr(e,t,n=!1,r=!1){if(h){let o=V();return n?o.parseTemplate(e,r):o.createRaw(e)}if(u.active){let o=pe()?.hydrateStatic(t);if(o)return o}return _t(Dt(e,r),r).firstChild}function Sr(e,t){if(!u.active)return t();let n=Q(e.nextSibling,t);if(typeof n=="function"){let r=n;return((...o)=>u.active?Q(e.nextSibling,()=>r(...o)):r(...o))}return n}function vr(e){for(let t=e.nextSibling;t;t=t.nextSibling)if(t.nodeType===8&&t.data==="fx/")return t;throw new Error("[fluixi] template hole is missing its closing marker")}function Ar(e,t){let n=[];for(let r=e.nextSibling;r&&r!==t;r=r.nextSibling)n.push(r);return n}function _t(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function $t(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?$t(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Cr(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Rr(e){if((0,T.isSignal)(e)||S(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,T.isSignal)(t)&&!S(t);)t=t();return t}var L=0,Mr=200;function Pr(e,t,n,r,o){let i=r,s=new Map;return(0,d.createRenderEffect)(()=>{let a;if(S(e)&&!(0,T.isSignal)(e)){if(!s.has(e)){L++;try{let l=e();s.set(e,l)}finally{L--}}for(a=s.get(e);typeof a=="function"&&(0,T.isSignal)(a);)a=a()}else for(a=e();typeof a=="function"&&(0,T.isSignal)(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(S(a)){if(!s.has(a)){let c=a;L++;try{let f=c();s.set(c,f)}finally{L--}}a=s.get(a)}else if((0,T.isSignal)(a))a=a();else if(a=a(),typeof a!="function"||!(0,T.isSignal)(a)&&!S(a))break}L++;try{i=te(t,a,n,i,s),o(i)}finally{L--}})}function R(e,t,n,r){if(L>Mr)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=D("",!0),e.appendChild(n));let o=r??null,i=l=>Array.isArray(l)&&l.some(c=>typeof c=="function"),s=l=>typeof l=="function"?l:()=>l;if(typeof t!="function"&&!i(t)){L++;try{o=te(e,t,n,o)}finally{L--}return()=>o}let a=Pr(s(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function te(e,t,n,r,o){if(t==null||typeof t=="boolean")return O(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return O(e,r,n);if(ee(t)){let s=D("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),O(e,r.slice(1),n)):b(e,s,n):r?e.replaceChild(s,r):b(e,s,n),t.then(a=>{s.parentNode===e&&te(e,a,s.nextSibling,s)}).catch(a=>{console.error("Error resolving promise in insertExpression:",a)}),s}let i=typeof t;if(i==="string"||i==="number"){if(i==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let a=D(t);return b(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=O(e,r,n)}if(r&&de(r))return r.data=t,r;let s=D(t);return r&&r.parentNode===e?e.replaceChild(s,r):qe(e,s)||b(e,s,n),s}if(I(t))return qe(e,t)?(je(t),t):Array.isArray(r)?(r.length===0?b(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),O(e,r.slice(1),n)):b(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):b(e,t,n)):b(e,t,n),t);if(Array.isArray(t)){let s=[],a=Array.isArray(r)?r:r?[r]:[],l=[];k(t,s,e,n,!0,o,l);let c=kr(e,a,s,n);for(let f of l){let p=R(e,f.sig,f.marker);(0,d.onCleanup)(()=>{O(e,p()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(i==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let a=s;if(typeof a.type=="function"){let l=a.type(a.props||{});return te(e,l,n,r)}}}return O(e,r,n)}function k(e,t,n,r,o=!0,i,s){for(let a=0;a<e.length;a++){let l=e[a];if(!(l==null||typeof l=="boolean")){for(;typeof l=="function"&&!ee(l)&&!(0,T.isSignal)(l)&&!S(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(S(l)&&!(0,T.isSignal)(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!ee(c)&&!(0,T.isSignal)(c)&&!S(c);)i||(i=new Map),i.has(c)||i.set(c,c()),c=i.get(c);if(c==null||typeof c=="boolean")continue;if(typeof c=="function"){if((0,T.isSignal)(c)){if(s){let p=D("",!0);t.push(p),s.push({marker:p,sig:c});continue}let f=c();for(;typeof f=="function"&&(0,T.isSignal)(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?k(f,t,n,r,o,i):k([f],t,n,r,o,i);continue}continue}Array.isArray(c)?k(c,t,n,r,o,i,s):k([c],t,n,r,o,i,s);continue}if(ee(l)){let c=D("",!0);t.push(c),l.then(f=>{if(c.parentNode){let p=[];if(k([f],p,c.parentNode,void 0,!1,i),p.length>0){c.parentNode.replaceChild(p[0],c);for(let y=1;y<p.length;y++)c.parentNode?.insertBefore(p[y],p[y-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){k(l,t,n,r,o,i,s);continue}if(I(l)){t.push(l);continue}if(typeof l=="object"&&l!==null&&"type"in l&&"props"in l){let c=l;if(typeof c.type=="function"){let f=c.type(c.props||{});Array.isArray(f)?k(f,t,n,r,!1,i):k([f],t,n,r,!1,i);continue}}if(typeof l=="string"||typeof l=="number"){let c=String(l);if(c.trim()===""&&c!==" ")continue;t.push(D(c));continue}t.push(D(String(l)))}}}}function kr(e,t,n,r){for(let p=0;p<n.length;p++){let y=n[p].parentNode;y!==null&&y!==e&&y.nodeType!==11&&(n=n.slice(),n[p]=n[p].cloneNode(!0))}let o=n.length,i=t.length,s=o,a=0,l=0,c=i>0?t[i-1].nextSibling??void 0:r,f=null;for(;a<i||l<s;){if(t[a]===n[l]){a++,l++;continue}for(;i>a&&s>l&&t[i-1]===n[s-1];)i--,s--;if(i===a){let p=s<o?l?n[l-1].nextSibling??void 0:n[s-l]:c;for(;l<s;)b(e,n[l++],p)}else if(s===l)for(;a<i;)(!f||!f.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[s-1]&&n[l]===t[i-1]){let p=t[--i].nextSibling;b(e,n[l++],t[a++].nextSibling),b(e,n[--s],p),t[i]=t[a-1]}else{if(!f){f=new Map;let y=l;for(;y<s;)f.set(n[y],y++)}let p=f.get(t[a]);if(p!=null)if(l<p&&p<s){let y=a,m=1;for(;++y<i&&y<s&&!(!f.has(t[y])||f.get(t[y])!==p+m);)m++;if(m>p-l){let Oe=t[a];for(;l<p;)b(e,n[l++],Oe)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(b(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function O(e,t,n){if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r].parentNode===e&&e.removeChild(t[r]);else t.parentNode===e&&e.removeChild(t);return null}function b(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function ne(e,t,n){n==null?delete e[t]:e[t]=n}function We(e,t,n){let r=n,o;return Array.isArray(n)&&(r=n[0],o=n[1]),typeof r!="function"?()=>{}:(e.addEventListener(t,r,o),()=>e.removeEventListener(t,r,o))}function Ue(e,t){let n=(r,o)=>{typeof r=="function"&&r(e,o??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let r of t)Array.isArray(r)?n(r[0],r[1]):n(r)}}function me(e,t,n,r=!1){return typeof n!="function"?(w(e,t,n,r),()=>{}):(0,d.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;w(e,t,o,r)})}function ge(e,t,n){return typeof n!="function"?(ne(e,t,n),()=>{}):(0,d.createRenderEffect)(()=>{let r=typeof n=="function"?n():n;ne(e,t,r)})}function Be(e,t,n){return typeof n!="function"?(w(e,t,!!n),()=>{}):(0,d.createRenderEffect)(()=>{let r=n();w(e,t,!!r)})}function re(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,d.createRenderEffect)(()=>re(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(r=>{let o=t[r];return typeof o=="function"?o():!!o}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function oe(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],i=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push((0,d.createRenderEffect)(()=>{let s=!!o();for(let a of i)e.classList.toggle(a,s)}));else{let s=!!(typeof o=="function"?o():o);for(let a of i)e.classList.toggle(a,s)}}}function ie(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let r in n){let o=n[r];o==null?e.style[r]="":e.style[r]=o}}function Lr(e){let{element:t,props:n,prevProps:r=Tr,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!fe(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=o||t.namespaceURI===H,a=[];for(let l in n){if(i&&l==="children")continue;let c=n[l],f=r[l];if(c===f)continue;if(l==="ref"){se(c,t);continue}if(l==="use"){Ue(t,c);continue}if(l.startsWith("on:")){a.push(We(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(ge(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(me(t,l.slice(5),c,s));continue}if(l.startsWith("bool:")){a.push(Be(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>re(t,c()))):re(t,c);continue}if(l==="classList"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>oe(t,c()))):oe(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>ie(t,c()))):ie(t,c);continue}if(l.startsWith("on")){let y=l.slice(2).toLowerCase();f&&Fe(t,y),c&&Ot(t,y,c);continue}let p=ue.has(l)||!s&&l in t;typeof c=="function"?a.push(p?ge(t,l,c):me(t,l,c,s)):a.push((0,d.createRenderEffect)(()=>p?ne(t,l,n[l]):w(t,l,n[l],s)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();Fe(t,c)}else ue.has(l)?ne(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function Ke(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){se(o,e);continue}if(r!=="children"){if(r==="use"){Ue(e,o);continue}if(r.startsWith("on:")){We(e,r.slice(3),o);continue}if(r.startsWith("prop:")){ge(e,r.slice(5),o);continue}if(r.startsWith("attr:")){me(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){Be(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(he.has(i)){e[`$$${i}`]=o;let s=`__fx_${i}`;if(!e[s]){let a=l=>{e[`$$${i}`]?.(l)};e.addEventListener(i,a),e[s]=a}}else e[`$$${i}`]=o,ye.has(i)||He([i]);continue}if(r==="class"||r==="className"){re(e,o);continue}if(r==="classList"){typeof o=="function"?(0,d.createRenderEffect)(()=>oe(e,o())):oe(e,o);continue}if(r==="style"){typeof o=="function"?(0,d.createRenderEffect)(()=>ie(e,o())):ie(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});(0,d.onCleanup)(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});(0,d.onCleanup)(()=>{i()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});(0,d.onCleanup)(()=>{i()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=(0,d.createEffect)(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});(0,d.onCleanup)(()=>{s()})}else{let i=!0;(0,d.createRenderEffect)(()=>{let s=t[r];i?(i=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();ce(e,r,s,n)});(0,d.onCleanup)(()=>{i()})}else(0,d.createRenderEffect)(()=>ce(e,r,t[r],n))}}}function Or(...e){let t=r=>{for(let o=e.length-1;o>=0;o--){let i=e[o];if(i&&r in i&&i[r]!==void 0)return i[r]}},n=r=>{for(let o of e)if(o&&r in o)return!0;return!1};return new Proxy({},{get:(r,o)=>t(o),has:(r,o)=>n(o),ownKeys:()=>{let r=new Set;for(let o of e)if(o)for(let i of Reflect.ownKeys(o))r.add(i);return[...r]},getOwnPropertyDescriptor:(r,o)=>n(o)?{enumerable:!0,configurable:!0,get:()=>t(o)}:void 0})}function Dr(e,...t){let n=new Set;for(let s of t)for(let a of s)n.add(a);let r=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),o=t.map(s=>{let a=new Set(s);return new Proxy({},{get:(l,c)=>a.has(c)?e[c]:void 0,has:(l,c)=>a.has(c)&&c in e,ownKeys:()=>Array.from(a).filter(l=>l in e),getOwnPropertyDescriptor:(l,c)=>a.has(c)&&c in e?r(c):void 0})}),i=new Proxy({},{get:(s,a)=>n.has(a)?void 0:e[a],has:(s,a)=>!n.has(a)&&a in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,a)=>!n.has(a)&&a in e?r(a):void 0});return[...o,i]}function se(e,t){if(e){if(I(e)){let n=t,r=e;if(!n)return;typeof n=="function"?n(r):typeof n=="object"&&"current"in n&&(n.current=r);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function _r(e,t,n){let r=t||document.body,o=(0,d.readChildren)(()=>e),i=[];return(0,d.batch)(()=>{let s=(0,d.createRenderEffect)(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),i.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):I(a)&&(r.appendChild(a),i.push(()=>{a.parentNode===r&&r.removeChild(a)}))});i.push(s),(0,d.onCleanup)(()=>{i.forEach(a=>a())})}),null}function $r(e){return typeof e=="string"&&e.toLowerCase()===e}function ze(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function Ir(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function ee(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function qr(e){return typeof e=="function"&&e.length===0&&(0,T.isSignal)(e)}function Ge(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return(0,d.createRoot)(s=>{(0,d.batch)(()=>{u.active||(t.textContent=""),xt(t),Tt(),R(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}function jr(e){if(Array.isArray(e))return e;if(typeof e=="function"&&typeof e.set=="function")return[e,e.set];throw new TypeError("[fluixi] bind: needs a signal — either `signal(…)` or the `[get, set]` pair from `createSignal(…)`.")}var Fr="__fx_dom_create_component__",q=globalThis[Fr]??={fn:null};function Hr(e){q.fn=e}function Vr(e={}){let t=e.signalSystem?.createComponent;t&&(q.fn=t)}function Xe(e,t){return q.fn?q.fn(e,t):(()=>e(t))}var Wr=()=>q.fn!==null,Ur=()=>q.fn!==null;function Br(){q.fn=null}var xe,qt={getStore:()=>xe,run(e,t){let n=xe;xe=e;try{return t()}finally{xe=n}}},Je=qt;function Ye(e){Je=e??qt}function U(e={}){e.locals||(e.locals=e.request?be(e.request):{});let t=0,n=0,r=null,o=new Map,i=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${t++}`,nextResourceId:()=>{if(r===null)return`r${n++}`;let s=o.get(r)??0;return o.set(r,s+1),`${r}:r${s}`},nextIslandNamespace:s=>{let a=i.get(s)??0;return i.set(s,a+1),`${s}#${a}`},withResourceScope(s,a){let l=r;r=s;try{return a()}finally{r=l}},pending:new Set,data:new Map}}function B(e,t){return Je.run(e,t)}function M(){return Je.getStore()}function Te(){return M()?.event}function Ze(){let e=Te();return e?(e.locals||(e.locals={}),e.locals):{}}var It=new WeakMap;function be(e){let t=It.get(e);return t||(t={},It.set(e,t)),t}var Ee=require("@fluixi/reactive/signal");var K="__FX_DATA__";function ae(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var Qe;function le(){let e=globalThis.__FX_DATA__;if(e)return e;if(Qe!==void 0)return Qe;let t=null;if(typeof document<"u"){let n=document.getElementById(K)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return Qe=t}function we(){for(;;){for(;u.cursor&&u.cursor.nodeType===3&&u.cursor.data==="";)u.cursor=u.cursor.nextSibling;if(u.cursor!=null||!u.parents.length)return;u.cursor=u.parents.pop().nextSibling}}var Kr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ne=typeof process<"u"&&process.env&&!1;function Se(e,t){let n=t.nodeType===1?`<${t.tagName.toLowerCase()}>`:t.nodeType===3?`text ${JSON.stringify((t.nodeValue??"").slice(0,24))}`:t.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${n}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function zr(e){we();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Kr.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(Ne&&t&&Se(`<${e}>`,t),null)}function Gr(e){we();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(u.cursor=t.nextSibling,t):(Ne&&t&&Se(`<${e}> (static)`,t),null)}function Xr(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}we();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(Ne&&t&&Se(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Jr(e){we();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(Ne&&t&&Se(`marker <!--${e.slice(0,24)}-->`,t),null)}var jt=!1;function Yr(){jt||(jt=!0,Mt({hydrateElement:zr,hydrateText:Xr,hydrateMarker:Jr,hydrateStatic:Gr}))}function ve(e,t,n){Yr(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=le(),o=n?.resourceNamespace,i=0;(0,Ee.setResourceIdSource)(()=>o?`${o}:r${i++}`:`r${i++}`),(0,Ee.setServerDataGetter)(r?s=>s in r?{value:r[s]}:void 0:null);try{return Ge(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var et="fluixi-island";function Ht(e){let{component:t,props:n={},name:r}=e,o=Ve(et),i=r??t.name??"Island";w(o,"name",i),w(o,"props",JSON.stringify(n??{}));let s=h?M():void 0;if(s){let a=s.nextIslandNamespace(i);R(o,()=>s.withResourceScope(a,()=>t(n)))}else R(o,()=>t(n));return o}var Ft=!1;function Zr(){if(Ft||typeof document>"u")return;Ft=!0;let e=document.createElement("style");e.textContent=`${et}{display:contents}`,document.head.appendChild(e)}function Vt(e){if(typeof document>"u")return;Zr();let t=document.querySelectorAll(et),n=new Map;t.forEach(r=>{let o=r.getAttribute("name")??"",i=n.get(o)??0;n.set(o,i+1);let s=e[o];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${o}" has no component in the registry — left static.`);return}let a={};try{a=JSON.parse(r.getAttribute("props")||"{}")}catch{}ve(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}function Wt(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function Ut(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}var Bt=require("@fluixi/reactive/signal");function Qr(e,t={}){if(typeof e=="function")return Xe(e,t);if(typeof e!="string"||e.length===0)return null;let n=ze(e);if(h)return V().createElement(e,n);let r=n?document.createElementNS(H,e):document.createElement(e);return Ke(r,t,n),eo(r,t),r}function eo(e,t){if(!t||t.children===void 0)return;let n=(0,Bt.readChildren)(()=>t.children),r=o=>{R(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}var x=require("@fluixi/reactive/signal");function Kt(e){return typeof e=="function"?e:(()=>e)}function _(e){return()=>{let t=e();return typeof t=="function"?t():t}}function zt(e){return e!=null&&e!==!1}function Gt(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function Xt(e){let t=_(()=>e.when),n=(0,x.createMemo)(t,void 0),r=(0,x.createMemo)(n,void 0),o=(0,x.getOwner)(),i=null,s=null,a=l=>{l!==s&&(i&&(0,x.disposeScope)(i),i=(0,x.createChildOwner)(o),s=l)};return(0,x.createMemo)(()=>{let l=r();return a(l?"when":"fallback"),(0,x.runWithOwner)(i,()=>{if(l){let c=e.children;return typeof c=="function"&&!Gt(c)?typeof n=="function"?(0,x.untrack)(()=>(0,x.untrack)(n)?c(n()):e.fallback):c(n):c}return e.fallback});return e.fallback??null},void 0,{name:"show"})}var Ae=require("@fluixi/reactive/signal");function Jt(e){let t=_(()=>e.each),n=()=>e.fallback??null,r=(o,i)=>{let s=e.children,a=Array.isArray(s)?s.map(l=>typeof l=="function"?l(o,i):l):typeof s=="function"?s(o,i):s;return W(a),a};return e.by?(0,Ae.keyArray)(t,e.by,(o,i)=>r(o,i),{fallback:n}):(0,Ae.mapArray)(t,(o,i)=>r(o,i),{fallback:n})}var Yt=require("@fluixi/reactive/signal");function Zt(e){let t=_(()=>e.each);return(0,Yt.indexArray)(t,(n,r)=>{let o=e.children(n,r);return W(o),o},{fallback:()=>e.fallback??null})}var z=require("@fluixi/reactive/signal");var v=require("@fluixi/reactive/signal");var tt=Symbol("match");function Qt(e){return{[tt]:!0,when:_(()=>e.when),get children(){return e.children}}}function en(e){let t=Array.isArray(e.children)?e.children:[e.children],n=(0,v.getOwner)(),r=null,o=-1,i=s=>{s!==o&&(r&&(0,v.disposeScope)(r),r=(0,v.createChildOwner)(n),o=s)};return(0,v.createMemo)(()=>{for(let s=0;s<t.length;s+=1){let l=t[s],c=0;for(;typeof l=="function"&&!l[tt]&&c++<10;)l=l();if(!l||typeof l!="object"||l[tt]!==!0)continue;let f=l.when();if(zt(f))return i(s),(0,v.runWithOwner)(r,()=>typeof l.children=="function"?l.children(f):l.children)}return i(-2),(0,v.runWithOwner)(r,()=>e.fallback??null)})}var P=require("@fluixi/reactive/signal");function tn(e){let t=Kt(e.component),{component:n,...r}=e,o=(0,P.getOwner)(),i=null,s;return(0,P.createMemo)(()=>{let a=t();return a!==s&&(i&&(0,P.disposeScope)(i),i=(0,P.createChildOwner)(o),s=a),a==null?null:typeof a=="string"?{tag:a,props:r}:(0,P.runWithOwner)(i,()=>a(r))})}var Ce=require("@fluixi/reactive/signal");function nn(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return(0,Ce.createRoot)(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),R(r,e.children)&&se(e.ref,r)}),(0,Ce.onCleanup)(()=>{n(),r.remove()}),null}var Re=require("@fluixi/reactive/signal");function nt(e){if(h)return e.fallback??null;let t=u.active,[n,r]=(0,Re.createSignal)(!t);return t&&queueMicrotask(()=>r(!0)),(0,Re.createMemo)(()=>n()?e.children:e.fallback??null,void 0,{name:"client-only"})}var rn=nt;var Me=require("@fluixi/reactive/signal");function on(e){let[t,n]=(0,Me.createSignal)(null),r=()=>n(null);return(0,Me.createMemo)(()=>{let o=t();if(o!==null)return typeof e.fallback=="function"?e.fallback(o,r):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(i){return n(i),typeof e.fallback=="function"?e.fallback(i,r):e.fallback}})}var sn=require("@fluixi/reactive/signal");function an(e){return(0,sn.createMemo)(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;(typeof o=="function"?o():o)&&n.push(r)}return n.join(" ")})}var ln=require("@fluixi/reactive/signal");function to(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function cn(e){return(0,ln.createMemo)(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;let i=typeof o=="function"?o():o;i!=null&&n.push(`${to(r)}: ${i}`)}return n.join("; ")})}var ke=1,it=3,st=8,un;un=Z;var G=class{constructor(){this[un]=!0;this.parentNode=null;this.childNodes=[]}get firstChild(){return this.childNodes[0]??null}get lastChild(){return this.childNodes[this.childNodes.length-1]??null}get nextSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>=0?t.childNodes[n+1]??null:null}get previousSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>0?t.childNodes[n-1]??null:null}get parentElement(){return this.parentNode}appendChild(t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes.push(t),t}insertBefore(t,n){if(n==null)return this.appendChild(t);t.parentNode&&t.parentNode.removeChild(t);let r=this.childNodes.indexOf(n);return t.parentNode=this,r<0?this.childNodes.push(t):this.childNodes.splice(r,0,t),t}removeChild(t){let n=this.childNodes.indexOf(t);return n>=0&&this.childNodes.splice(n,1),t.parentNode=null,t}replaceChild(t,n){let r=this.childNodes.indexOf(n);return r>=0&&(t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes[r]=t,n.parentNode=null),n}addEventListener(){}removeEventListener(){}},j=class e extends G{constructor(n){super();this.nodeType=it;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}get textContent(){return this.data}set textContent(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},Pe=class e extends G{constructor(n){super();this.nodeType=ke;this.rawOuterHTML=n}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},X=class e extends G{constructor(n){super();this.nodeType=st;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},rt=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},ot=class{constructor(t){this.el=t}list(){let t=this.el.getAttribute("class");return t?t.split(/\s+/).filter(Boolean):[]}write(t){t.length?this.el.setAttribute("class",t.join(" ")):this.el.removeAttribute("class")}add(...t){let n=this.list();for(let r of t)n.includes(r)||n.push(r);this.write(n)}remove(...t){this.write(this.list().filter(n=>!t.includes(n)))}contains(t){return this.list().includes(t)}toggle(t,n){let r=this.contains(t),o=n===void 0?!r:n;return o?this.add(t):this.remove(t),o}},F=class e extends G{constructor(n,r=!1){super();this.nodeType=ke;this.attributes=new Map;this.style=new rt;this.classList=new ot(this);this.rawHTML=null;this.localName=n.toLowerCase(),this.tagName=r?n:n.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(n,r){this.attributes.set(n,String(r))}removeAttribute(n){this.attributes.delete(n)}getAttribute(n){return this.attributes.has(n)?this.attributes.get(n):null}hasAttribute(n){return this.attributes.has(n)}get id(){return this.getAttribute("id")??""}set id(n){n==null?this.removeAttribute("id"):this.setAttribute("id",n)}get className(){return this.getAttribute("class")??""}set className(n){n==null?this.removeAttribute("class"):this.setAttribute("class",n)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(n){n==null?this.removeAttribute("for"):this.setAttribute("for",n)}set value(n){n==null?this.removeAttribute("value"):this.setAttribute("value",String(n))}set checked(n){n?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(n){n?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(n){}get textContent(){return this.childNodes.map(n=>n.textContent??"").join("")}set textContent(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,n!=null&&n!==""&&this.appendChild(new j(String(n)))}set innerText(n){this.textContent=n}set innerHTML(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=n==null?"":String(n)}cloneNode(n=!1){let r=new e(this.localName,this.isSVG);if(r.attributes=new Map(this.attributes),r.style.cssText=this.style.cssText,r.rawHTML=this.rawHTML,n)for(let o of this.childNodes)r.appendChild(o.cloneNode(!0));return r}};var no=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),dn=/&/g,pn=/</g,yn=/>/g,ro=/"/g;function at(e){return e.replace(dn,"&amp;").replace(pn,"&lt;").replace(yn,"&gt;")}function fn(e){return e.replace(dn,"&amp;").replace(ro,"&quot;").replace(pn,"&lt;").replace(yn,"&gt;")}function oo(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function io(e){if(!e)return"";let t=[];e.cssText&&t.push(e.cssText.trim().replace(/;\s*$/,""));for(let n of Object.keys(e)){if(n==="cssText")continue;let r=e[n];r==null||r===""||t.push(`${oo(n)}: ${r}`)}return t.join("; ")}function so(e){let t="",n=io(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${fn(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${fn(o)}"`}return t}function A(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return at(e);if(typeof e=="number")return at(String(e));if(typeof e=="function")return A(e());if(Array.isArray(e))return e.map(A).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case it:return at(e.data??"");case st:return`<!--${e.data??""}-->`;case ke:{let t=e.localName,n=`<${t}${so(e)}>`;if(no.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(A).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(A).join(""):""}var ct=require("@fluixi/reactive/signal"),E=require("@fluixi/reactive/signal");var ao=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),lo={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function mn(e){return e.replace(/&(#?\w+);/g,(t,n)=>lo[n]??t)}var C=class extends Error{};function gn(e,t=!1){let n=0,r=[],o=[],i=c=>{let f=o[o.length-1];f?f.appendChild(c):r.push(c)};for(;n<e.length;){let c=e.indexOf("<",n);if(c===-1){a(e.slice(n));break}if(c>n&&a(e.slice(n,c)),e.startsWith("<!--",c)){let f=e.indexOf("-->",c);if(f===-1)throw new C(`unterminated comment at ${c}`);i(new X(e.slice(c+4,f))),n=f+3;continue}if(e[c+1]==="/"){let f=e.indexOf(">",c);if(f===-1)throw new C(`unterminated closing tag at ${c}`);let p=e.slice(c+2,f).trim().toLowerCase(),y=o.pop();if(!y||y.localName!==p)throw new C(`</${p}> does not close <${y?.localName??"nothing"}>`);n=f+1;continue}n=l(c)}if(o.length>0)throw new C(`unclosed <${o[o.length-1].localName}>`);let s=r[0];if(r.length!==1||!(s instanceof F))throw new C(`expected exactly one root element, got ${r.length}`);return s;function a(c){c!==""&&i(new j(mn(c)))}function l(c){let f=/[\s/>]/.exec(e.slice(c+1));if(!f)throw new C(`unterminated tag at ${c}`);let p=e.slice(c+1,c+1+f.index).toLowerCase(),y=new F(p,t),m=c+1+f.index;for(;m<e.length;){for(;m<e.length&&/\s/.test(e[m]);)m++;if(e[m]===">"){m++;break}if(e[m]==="/"&&e[m+1]===">"){m+=2;break}let Oe=m;for(;m<e.length&&!/[\s=/>]/.test(e[m]);)m++;let Y=e.slice(Oe,m);if(Y==="")throw new C(`malformed attribute at ${m}`);if(e[m]==="="){if(e[m+1]!=='"')throw new C(`attribute ${Y} must have a double-quoted value`);let De=e.indexOf('"',m+2);if(De===-1)throw new C(`unterminated value for ${Y}`);y.setAttribute(Y,mn(e.slice(m+2,De))),m=De+1}else y.setAttribute(Y,"")}return i(y),ao.has(p)||o.push(y),m}}var hn=!1;function Tn(){hn||(hn=!0,Ct({createElement:(e,t)=>new F(e,t),createText:e=>new j(e),createRaw:e=>new Pe(e),parseTemplate:(e,t)=>gn(e,t),createComment:e=>new X(e)}))}function ut(e,t={}){let n=h;Tn(),$(!0);let r=U(t.event);try{return B(r,()=>(0,ct.createRoot)(o=>{try{let i=typeof e=="function"?e():e;return A(i)}finally{o()}}))}finally{$(n)}}var xn=!1;function co(){xn||(xn=!0,(0,E.setResourceTracker)(e=>{M()?.pending.add(e)}),(0,E.setResourceIdSource)(()=>M()?.nextResourceId()??""),(0,E.setResourceDataSink)((e,t)=>{e&&M()?.data.set(e,t)}))}var lt=null;function ft(e){lt=e}function Le(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(lt)try{i=lt(o,r)}catch{continue}i!==void 0&&(typeof i=="function"||typeof i=="symbol"||(t[r]=i))}if(Object.keys(t).length===0)return"";let n=ae(JSON.stringify(t));return n==="{}"?"":`<script type="application/json" id="${K}">${n}<\/script>`}var uo=50;async function dt(e,t={}){let n=h;Tn(),$(!0),co();let r=U(t.event);try{return await B(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};(0,ct.createRoot)(f=>{s=f,i=(0,E.getOwner)(),o=typeof e=="function"?e():e});let a=()=>{try{(0,E.runWithOwner)(i,()=>A(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<uo;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await(0,E.flush)(),a()}let c=(0,E.runWithOwner)(i,()=>A(o))+Le(r);return s(),c})}finally{$(n)}}var J=require("@fluixi/reactive/signal"),bn=require("@fluixi/reactive/store"),g=require("@fluixi/reactive/signal"),En=require("@fluixi/reactive/store");
package/dist/cdn/dom.d.ts CHANGED
@@ -11,6 +11,8 @@
11
11
  * everything hangs off window.FluixiDOM.
12
12
  */
13
13
  export * from '../lib/index.js';
14
+ export { signal, memo, effect } from '@fluixi/reactive/signal';
15
+ export { store } from '@fluixi/reactive/store';
14
16
  export { createSignal, createMemo, createEffect, createComputed, createRenderEffect, createRoot, createResource, createContext, useContext, onCleanup, batch, untrack, } from '@fluixi/reactive/signal';
15
17
  export { createStore } from '@fluixi/reactive/store';
16
18
  //# sourceMappingURL=dom.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/cdn/dom.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,cAAc,iBAAiB,CAAC;AAChC,OAAO,EACL,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,cAAc,EACd,aAAa,EACb,UAAU,EACV,SAAS,EACT,KAAK,EACL,OAAO,GACR,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/cdn/dom.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,cAAc,iBAAiB,CAAC;AAKhC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAK/C,OAAO,EACL,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,cAAc,EACd,aAAa,EACb,UAAU,EACV,SAAS,EACT,KAAK,EACL,OAAO,GACR,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC"}