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

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.
@@ -1 +1 @@
1
- import{isSignal as m}from"@fluixi/reactive/signal";var P="http://www.w3.org/2000/svg";function Y(e){return e.localName.includes("-")}function O(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(Y(e)){e[t]=n;return}T(e,t,n,o)}function T(e,t,n,o=!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))}var ye=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function E(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}import{batch as Ae,createEffect as A,createRenderEffect as p,createRoot as ve,onCleanup as S,readChildren as Ce}from"@fluixi/reactive/signal";var w=typeof document>"u";var F=Symbol.for("fluixi.server-node"),j=null;function v(){if(!j)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return j}function C(e){return e!=null&&e[F]===!0?!0:typeof Node<"u"&&e instanceof Node}function $(e){return e!=null&&e[F]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var b={active:!1,cursor:null,parents:[]},Z=null;function I(){return Z}function H(e,t){return b.active&&t.parentNode===e}function k(e){let t=b.parents.lastIndexOf(e);t!==-1&&(b.parents.length=t),b.cursor=e.nextSibling}var D=new Set,K=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function Q(e){if(!w)for(let t of e)D.has(t)||K.has(t)||(D.add(t),document.addEventListener(t,ee))}function ee(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let o=n[t];if(o&&!n.disabled&&(o(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function h(e,t=!1){if(w)return v().createText(e);if(b.active&&!t){let n=I()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}var x=0,te=200;function ne(e,t,n,o,f){let a=o,r=new Map;return p(()=>{let i;if(E(e)&&!m(e)){if(!r.has(e)){x++;try{let s=e();r.set(e,s)}finally{x--}}for(i=r.get(e);typeof i=="function"&&m(i);)i=i()}else for(i=e();typeof i=="function"&&m(i);)i=i();{let s=0;for(;typeof i=="function"&&s++<50;)if(E(i)){if(!r.has(i)){let l=i;x++;try{let u=l();r.set(l,u)}finally{x--}}i=r.get(i)}else if(m(i))i=i();else if(i=i(),typeof i!="function"||!m(i)&&!E(i))break}x++;try{a=R(t,i,n,a,r),f(a)}finally{x--}})}function _(e,t,n,o){if(x>te)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=h("",!0),e.appendChild(n));let f=o??null,a=s=>Array.isArray(s)&&s.some(l=>typeof l=="function"),r=s=>typeof s=="function"?s:()=>s;if(typeof t!="function"&&!a(t)){x++;try{f=R(e,t,n,f)}finally{x--}return()=>f}let i=ne(r(t),e,n,f,s=>{f=s});return()=>(i?.(),f)}function R(e,t,n,o,f){if(t==null||typeof t=="boolean")return N(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return N(e,o,n);if(L(t)){let r=h("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(r,o[0]),N(e,o.slice(1),n)):y(e,r,n):o?e.replaceChild(r,o):y(e,r,n),t.then(i=>{r.parentNode===e&&R(e,i,r.nextSibling,r)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),r}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let i=h(t);return y(e,i,n),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=N(e,o,n)}if(o&&$(o))return o.data=t,o;let r=h(t);return o&&o.parentNode===e?e.replaceChild(r,o):H(e,r)||y(e,r,n),r}if(C(t))return H(e,t)?(k(t),t):Array.isArray(o)?(o.length===0?y(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),N(e,o.slice(1),n)):y(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):y(e,t,n)):y(e,t,n),t);if(Array.isArray(t)){let r=[],i=Array.isArray(o)?o:o?[o]:[],s=[];g(t,r,e,n,!0,f,s);let l=oe(e,i,r,n);for(let u of s){let c=_(e,u.sig,u.marker);S(()=>{N(e,c()),u.marker.parentNode===e&&e.removeChild(u.marker)})}return l}if(a==="object"&&t!==null&&typeof t=="object"){let r=t;if("type"in r&&"props"in r){let i=r;if(typeof i.type=="function"){let s=i.type(i.props||{});return R(e,s,n,o)}}}return N(e,o,n)}function g(e,t,n,o,f=!0,a,r){for(let i=0;i<e.length;i++){let s=e[i];if(!(s==null||typeof s=="boolean")){for(;typeof s=="function"&&!L(s)&&!m(s)&&!E(s)&&(s=s(),!(s==null||typeof s=="boolean")););if(!(s==null||typeof s=="boolean")){if(typeof s=="function"){let l;for(E(s)&&!m(s)?(a||(a=new Map),a.has(s)||a.set(s,s()),l=a.get(s)):l=s();typeof l=="function"&&!L(l)&&!m(l)&&!E(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(m(l)){if(r){let c=h("",!0);t.push(c),r.push({marker:c,sig:l});continue}let u=l();for(;typeof u=="function"&&m(u);)u=u();if(u==null||typeof u=="boolean")continue;Array.isArray(u)?g(u,t,n,o,f,a):g([u],t,n,o,f,a);continue}continue}Array.isArray(l)?g(l,t,n,o,f,a,r):g([l],t,n,o,f,a,r);continue}if(L(s)){let l=h("",!0);t.push(l),s.then(u=>{if(l.parentNode){let c=[];if(g([u],c,l.parentNode,void 0,!1,a),c.length>0){l.parentNode.replaceChild(c[0],l);for(let d=1;d<c.length;d++)l.parentNode?.insertBefore(c[d],c[d-1].nextSibling)}}}).catch(u=>console.error("Error resolving promise in array:",u));continue}if(Array.isArray(s)){g(s,t,n,o,f,a,r);continue}if(C(s)){t.push(s);continue}if(typeof s=="object"&&s!==null&&"type"in s&&"props"in s){let l=s;if(typeof l.type=="function"){let u=l.type(l.props||{});Array.isArray(u)?g(u,t,n,o,!1,a):g([u],t,n,o,!1,a);continue}}if(typeof s=="string"||typeof s=="number"){let l=String(s);if(l.trim()===""&&l!==" ")continue;t.push(h(l));continue}t.push(h(String(s)))}}}}function oe(e,t,n,o){for(let c=0;c<n.length;c++){let d=n[c].parentNode;d!==null&&d!==e&&d.nodeType!==11&&(n=n.slice(),n[c]=n[c].cloneNode(!0))}let f=n.length,a=t.length,r=f,i=0,s=0,l=a>0?t[a-1].nextSibling??void 0:o,u=null;for(;i<a||s<r;){if(t[i]===n[s]){i++,s++;continue}for(;a>i&&r>s&&t[a-1]===n[r-1];)a--,r--;if(a===i){let c=r<f?s?n[s-1].nextSibling??void 0:n[r-s]:l;for(;s<r;)y(e,n[s++],c)}else if(r===s)for(;i<a;)(!u||!u.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[r-1]&&n[s]===t[a-1]){let c=t[--a].nextSibling;y(e,n[s++],t[i++].nextSibling),y(e,n[--r],c),t[a]=t[i-1]}else{if(!u){u=new Map;let d=s;for(;d<r;)u.set(n[d],d++)}let c=u.get(t[i]);if(c!=null)if(s<c&&c<r){let d=i,M=1;for(;++d<a&&d<r&&!(!u.has(t[d])||u.get(t[d])!==c+M);)M++;if(M>c-s){let J=t[i];for(;s<c;)y(e,n[s++],J)}else t[i].parentNode===e?e.replaceChild(n[s++],t[i++]):(y(e,n[s++],l),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return n}function N(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function y(e,t,n){b.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function W(e,t,n){n==null?delete e[t]:e[t]=n}function re(e,t,n){let o=n,f;return Array.isArray(n)&&(o=n[0],f=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,f),()=>e.removeEventListener(t,o,f))}function ie(e,t){let n=(o,f)=>{typeof o=="function"&&o(e,f??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function se(e,t,n,o=!1){return typeof n!="function"?(T(e,t,n,o),()=>{}):p(()=>{let f=typeof n=="function"?n():n;T(e,t,f,o)})}function fe(e,t,n){return typeof n!="function"?(W(e,t,n),()=>{}):p(()=>{let o=typeof n=="function"?n():n;W(e,t,o)})}function ae(e,t,n){return typeof n!="function"?(T(e,t,!!n),()=>{}):p(()=>{let o=n();T(e,t,!!o)})}function B(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){p(()=>B(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(o=>{let f=t[o];return typeof f=="function"?f():!!f}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function V(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let f=t[o],a=o.split(/\s+/).filter(Boolean);if(typeof f=="function"&&n)n.push(p(()=>{let r=!!f();for(let i of a)e.classList.toggle(i,r)}));else{let r=!!(typeof f=="function"?f():f);for(let i of a)e.classList.toggle(i,r)}}}function q(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 o in n){let f=n[o];f==null?e.style[o]="":e.style[o]=f}}function G(e,t,n=!1){for(let o in t){let f=t[o];if(o==="ref"){le(f,e);continue}if(o!=="children"){if(o==="use"){ie(e,f);continue}if(o.startsWith("on:")){re(e,o.slice(3),f);continue}if(o.startsWith("prop:")){fe(e,o.slice(5),f);continue}if(o.startsWith("attr:")){se(e,o.slice(5),f,n);continue}if(o.startsWith("bool:")){ae(e,o.slice(5),f);continue}if(o.startsWith("on")&&o.length>2){let a=o.slice(2).toLowerCase();if(typeof f=="function")if(K.has(a)){e[`$$${a}`]=f;let r=`__fx_${a}`;if(!e[r]){let i=s=>{e[`$$${a}`]?.(s)};e.addEventListener(a,i),e[r]=i}}else e[`$$${a}`]=f,D.has(a)||Q([a]);continue}if(o==="class"||o==="className"){B(e,f);continue}if(o==="classList"){typeof f=="function"?p(()=>V(e,f())):V(e,f);continue}if(o==="style"){typeof f=="function"?p(()=>q(e,f())):q(e,f);continue}if(o==="innerHTML"){if(typeof f=="function"){let a=A(()=>{let r=f();for(;typeof r=="function";)r=r();e.innerHTML=r});S(()=>a())}else e.innerHTML=f;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof f=="function"){let a=A(()=>{let r=f();for(;typeof r=="function"&&r.length===0;)r=r();document.activeElement!==e&&(e.value=r??"")});S(()=>{a()})}else p(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof f=="function"){let a=A(()=>{let r=f();for(;typeof r=="function"&&r.length===0;)r=r();document.activeElement!==e&&(e.checked=r??"")});S(()=>{a()})}else p(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof f=="function"){let a=!0,r=A(()=>{let i=f();for(;typeof i=="function"&&i.length===0;)i=i();a?(a=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});S(()=>{r()})}else{let a=!0;p(()=>{let r=t[o];a?(a=!1,queueMicrotask(()=>{e.value=r??""})):e.value=r??""})}continue}if(typeof f=="function"){let a=A(()=>{let r=f();for(;typeof r=="function"&&r.length===0;)r=r();O(e,o,r,n)});S(()=>{a()})}else p(()=>O(e,o,t[o],n))}}}function le(e,t){if(e){if(C(e)){let n=t,o=e;if(!n)return;typeof n=="function"?n(o):typeof n=="object"&&"current"in n&&(n.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function z(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 L(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}var ue="__fx_dom_create_component__",U=globalThis[ue]??={fn:null};function X(e,t){return U.fn?U.fn(e,t):(()=>e(t))}import{readChildren as ce}from"@fluixi/reactive/signal";function $e(e,t={}){if(typeof e=="function")return X(e,t);if(typeof e!="string"||e.length===0)return null;let n=z(e);if(w)return v().createElement(e,n);let o=n?document.createElementNS(P,e):document.createElement(e);return G(o,t,n),de(o,t),o}function de(e,t){if(!t||t.children===void 0)return;let n=ce(()=>t.children),o=f=>{_(e,f,typeof f=="function"?null:void 0)};Array.isArray(n)?n.forEach(o):o(n)}export{$e as createDynamicElement};
1
+ import{isSignal as m}from"@fluixi/reactive/signal";var P="http://www.w3.org/2000/svg";function Z(e){return e.localName.includes("-")}function O(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(Z(e)){e[t]=n;return}N(e,t,n,o)}function N(e,t,n,o=!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))}var ge=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function j(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function E(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}import{batch as Le,createEffect as A,createRenderEffect as p,createRoot as Re,onCleanup as S,readChildren as Me}from"@fluixi/reactive/signal";var w=typeof document>"u";var F=Symbol.for("fluixi.server-node"),$=null;function v(){if(!$)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return $}function C(e){return e!=null&&e[F]===!0?!0:typeof Node<"u"&&e instanceof Node}function I(e){return e!=null&&e[F]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var b={active:!1,cursor:null,parents:[]},Q=null;function k(){return Q}function H(e,t){return b.active&&t.parentNode===e}function W(e){let t=b.parents.lastIndexOf(e);t!==-1&&(b.parents.length=t),b.cursor=e.nextSibling}var D=new Set,B=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function ee(e){if(!w)for(let t of e)D.has(t)||B.has(t)||(D.add(t),document.addEventListener(t,te))}function te(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let o=n[t];if(o&&!n.disabled&&(o(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function h(e,t=!1){if(w)return v().createText(e);if(b.active&&!t){let n=k()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}var x=0,ne=200;function oe(e,t,n,o,f){let a=o,r=new Map;return p(()=>{let i;if(E(e)&&!m(e)){if(!r.has(e)){x++;try{let s=e();r.set(e,s)}finally{x--}}for(i=r.get(e);typeof i=="function"&&m(i);)i=i()}else for(i=e();typeof i=="function"&&m(i);)i=i();{let s=0;for(;typeof i=="function"&&s++<50;)if(E(i)){if(!r.has(i)){let l=i;x++;try{let u=l();r.set(l,u)}finally{x--}}i=r.get(i)}else if(m(i))i=i();else if(i=i(),typeof i!="function"||!m(i)&&!E(i))break}x++;try{a=R(t,i,n,a,r),f(a)}finally{x--}})}function _(e,t,n,o){if(x>ne)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=h("",!0),e.appendChild(n));let f=o??null,a=s=>Array.isArray(s)&&s.some(l=>typeof l=="function"),r=s=>typeof s=="function"?s:()=>s;if(typeof t!="function"&&!a(t)){x++;try{f=R(e,t,n,f)}finally{x--}return()=>f}let i=oe(r(t),e,n,f,s=>{f=s});return()=>(i?.(),f)}function R(e,t,n,o,f){if(t==null||typeof t=="boolean")return T(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return T(e,o,n);if(L(t)){let r=h("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(r,o[0]),T(e,o.slice(1),n)):y(e,r,n):o?e.replaceChild(r,o):y(e,r,n),t.then(i=>{r.parentNode===e&&R(e,i,r.nextSibling,r)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),r}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let i=h(t);return y(e,i,n),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=T(e,o,n)}if(o&&I(o))return o.data=t,o;let r=h(t);return o&&o.parentNode===e?e.replaceChild(r,o):H(e,r)||y(e,r,n),r}if(C(t))return H(e,t)?(W(t),t):Array.isArray(o)?(o.length===0?y(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),T(e,o.slice(1),n)):y(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):y(e,t,n)):y(e,t,n),t);if(Array.isArray(t)){let r=[],i=Array.isArray(o)?o:o?[o]:[],s=[];g(t,r,e,n,!0,f,s);let l=re(e,i,r,n);for(let u of s){let c=_(e,u.sig,u.marker);S(()=>{T(e,c()),u.marker.parentNode===e&&e.removeChild(u.marker)})}return l}if(a==="object"&&t!==null&&typeof t=="object"){let r=t;if("type"in r&&"props"in r){let i=r;if(typeof i.type=="function"){let s=i.type(i.props||{});return R(e,s,n,o)}}}return T(e,o,n)}function g(e,t,n,o,f=!0,a,r){for(let i=0;i<e.length;i++){let s=e[i];if(!(s==null||typeof s=="boolean")){for(;typeof s=="function"&&!L(s)&&!m(s)&&!E(s)&&(s=s(),!(s==null||typeof s=="boolean")););if(!(s==null||typeof s=="boolean")){if(typeof s=="function"){let l;for(E(s)&&!m(s)?(a||(a=new Map),a.has(s)||a.set(s,s()),l=a.get(s)):l=s();typeof l=="function"&&!L(l)&&!m(l)&&!E(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(m(l)){if(r){let c=h("",!0);t.push(c),r.push({marker:c,sig:l});continue}let u=l();for(;typeof u=="function"&&m(u);)u=u();if(u==null||typeof u=="boolean")continue;Array.isArray(u)?g(u,t,n,o,f,a):g([u],t,n,o,f,a);continue}continue}Array.isArray(l)?g(l,t,n,o,f,a,r):g([l],t,n,o,f,a,r);continue}if(L(s)){let l=h("",!0);t.push(l),s.then(u=>{if(l.parentNode){let c=[];if(g([u],c,l.parentNode,void 0,!1,a),c.length>0){l.parentNode.replaceChild(c[0],l);for(let d=1;d<c.length;d++)l.parentNode?.insertBefore(c[d],c[d-1].nextSibling)}}}).catch(u=>console.error("Error resolving promise in array:",u));continue}if(Array.isArray(s)){g(s,t,n,o,f,a,r);continue}if(C(s)){t.push(s);continue}if(typeof s=="object"&&s!==null&&"type"in s&&"props"in s){let l=s;if(typeof l.type=="function"){let u=l.type(l.props||{});Array.isArray(u)?g(u,t,n,o,!1,a):g([u],t,n,o,!1,a);continue}}if(typeof s=="string"||typeof s=="number"){let l=String(s);if(l.trim()===""&&l!==" ")continue;t.push(h(l));continue}t.push(h(String(s)))}}}}function re(e,t,n,o){for(let c=0;c<n.length;c++){let d=n[c].parentNode;d!==null&&d!==e&&d.nodeType!==11&&(n=n.slice(),n[c]=n[c].cloneNode(!0))}let f=n.length,a=t.length,r=f,i=0,s=0,l=a>0?t[a-1].nextSibling??void 0:o,u=null;for(;i<a||s<r;){if(t[i]===n[s]){i++,s++;continue}for(;a>i&&r>s&&t[a-1]===n[r-1];)a--,r--;if(a===i){let c=r<f?s?n[s-1].nextSibling??void 0:n[r-s]:l;for(;s<r;)y(e,n[s++],c)}else if(r===s)for(;i<a;)(!u||!u.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[r-1]&&n[s]===t[a-1]){let c=t[--a].nextSibling;y(e,n[s++],t[i++].nextSibling),y(e,n[--r],c),t[a]=t[i-1]}else{if(!u){u=new Map;let d=s;for(;d<r;)u.set(n[d],d++)}let c=u.get(t[i]);if(c!=null)if(s<c&&c<r){let d=i,M=1;for(;++d<a&&d<r&&!(!u.has(t[d])||u.get(t[d])!==c+M);)M++;if(M>c-s){let Y=t[i];for(;s<c;)y(e,n[s++],Y)}else t[i].parentNode===e?e.replaceChild(n[s++],t[i++]):(y(e,n[s++],l),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return n}function T(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function y(e,t,n){b.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function V(e,t,n){n==null?delete e[t]:e[t]=n}function ie(e,t,n){let o=n,f;return Array.isArray(n)&&(o=n[0],f=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,f),()=>e.removeEventListener(t,o,f))}function se(e,t){let n=(o,f)=>{typeof o=="function"&&o(e,f??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function fe(e,t,n,o=!1){return typeof n!="function"?(N(e,t,n,o),()=>{}):p(()=>{let f=typeof n=="function"?n():n;N(e,t,f,o)})}function ae(e,t,n){return typeof n!="function"?(V(e,t,n),()=>{}):p(()=>{let o=typeof n=="function"?n():n;V(e,t,o)})}function le(e,t,n){return typeof n!="function"?(N(e,t,!!n),()=>{}):p(()=>{let o=n();N(e,t,!!o)})}function G(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){p(()=>G(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(o=>{let f=t[o];return typeof f=="function"?f():!!f}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function q(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let f=t[o],a=o.split(/\s+/).filter(Boolean);if(typeof f=="function"&&n)n.push(p(()=>{let r=!!f();for(let i of a)e.classList.toggle(i,r)}));else{let r=!!(typeof f=="function"?f():f);for(let i of a)e.classList.toggle(i,r)}}}function K(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 o in n){let f=n[o];f==null?e.style[o]="":e.style[o]=f}}function U(e,t,n=!1){for(let o in t){let f=t[o];if(o==="ref"){ue(f,e);continue}if(o!=="children"){if(o==="use"){se(e,f);continue}if(o.startsWith("on:")){ie(e,o.slice(3),f);continue}if(o.startsWith("prop:")){ae(e,o.slice(5),f);continue}if(o.startsWith("attr:")){fe(e,o.slice(5),f,n);continue}if(o.startsWith("bool:")){le(e,o.slice(5),f);continue}if(o.startsWith("on")&&o.length>2){let a=o.slice(2).toLowerCase();if(typeof f=="function")if(B.has(a)){e[`$$${a}`]=f;let r=`__fx_${a}`;if(!e[r]){let i=s=>{e[`$$${a}`]?.(s)};e.addEventListener(a,i),e[r]=i}}else e[`$$${a}`]=f,D.has(a)||ee([a]);continue}if(o==="class"||o==="className"){G(e,f);continue}if(o==="classList"){typeof f=="function"?p(()=>q(e,f())):q(e,f);continue}if(o==="style"){typeof f=="function"?p(()=>K(e,f())):K(e,f);continue}if(o==="innerHTML"){if(typeof f=="function"){let a=A(()=>{let r=f();for(;typeof r=="function";)r=r();e.innerHTML=r});S(()=>a())}else e.innerHTML=f;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof f=="function"){let a=A(()=>{let r=f();for(;typeof r=="function"&&r.length===0;)r=r();document.activeElement!==e&&(e.value=r??"")});S(()=>{a()})}else p(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof f=="function"){let a=A(()=>{let r=f();for(;typeof r=="function"&&r.length===0;)r=r();document.activeElement!==e&&(e.checked=r??"")});S(()=>{a()})}else p(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof f=="function"){let a=!0,r=A(()=>{let i=f();for(;typeof i=="function"&&i.length===0;)i=i();a?(a=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});S(()=>{r()})}else{let a=!0;p(()=>{let r=t[o];a?(a=!1,queueMicrotask(()=>{e.value=r??""})):e.value=r??""})}continue}if(typeof f=="function"){let a=A(()=>{let r=f();for(;typeof r=="function"&&r.length===0;)r=r();O(e,o,r,n)});S(()=>{a()})}else p(()=>O(e,o,t[o],n))}}}function ue(e,t){if(e){if(C(e)){let n=t,o=e;if(!n)return;typeof n=="function"?n(o):typeof n=="object"&&"current"in n&&(n.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function z(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 L(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}import{untrack as ce,isSignal as de}from"@fluixi/reactive";var ye="__fx_dom_create_component__",X=globalThis[ye]??={fn:null};function J(e,t){if(X.fn)return X.fn(e,t);let n=typeof e=="function"?ce(()=>e(t)):e;if(n!=null&&(typeof n=="function"||typeof n=="object")&&!de(n)){try{n.$name=e?.name}catch{}return j(n)}return n}import{readChildren as pe}from"@fluixi/reactive/signal";function qe(e,t={}){if(typeof e=="function")return J(e,t);if(typeof e!="string"||e.length===0)return null;let n=z(e);if(w)return v().createElement(e,n);let o=n?document.createElementNS(P,e):document.createElement(e);return U(o,t,n),me(o,t),o}function me(e,t){if(!t||t.children===void 0)return;let n=pe(()=>t.children),o=f=>{_(e,f,typeof f=="function"?null:void 0)};Array.isArray(n)?n.forEach(o):o(n)}export{qe as createDynamicElement};
@@ -1 +1 @@
1
- "use strict";var _=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var ee=Object.prototype.hasOwnProperty;var ne=(n,e)=>{for(var t in e)_(n,t,{get:e[t],enumerable:!0})},te=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of Z(e))!ee.call(n,c)&&c!==t&&_(n,c,{get:()=>e[c],enumerable:!(i=Q(e,c))||i.enumerable});return n};var oe=n=>te(_({},"__esModule",{value:!0}),n);var he={};ne(he,{hydrate:()=>pe});module.exports=oe(he);var x=require("@fluixi/reactive/signal");var $="1.0.0-alpha.78";var D=require("@fluixi/reactive/version"),h={dom:$,reactive:D.VERSION};function O(n){h.core&&n.setAttribute("fluixi",h.core),n.setAttribute("fx-dom",h.dom),n.setAttribute("fx-reactive",h.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=h)}function F(){let n=[h.core,h.dom,h.reactive].filter(e=>e!==void 0);new Set(n).size<=1||console.warn(`[fluixi] package versions disagree — core ${h.core??"(absent)"}, dom ${h.dom}, reactive ${h.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 E(n){return typeof n=="function"&&n[Symbol.for("fluixi-component")]===!0}var g=require("@fluixi/reactive/signal");var j=typeof document>"u";var V=Symbol.for("fluixi.server-node"),H=null;function I(){if(!H)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return H}function L(n){return n!=null&&n[V]===!0?!0:typeof Node<"u"&&n instanceof Node}function W(n){return n!=null&&n[V]===!0?n.nodeType===3:typeof Text<"u"&&n instanceof Text}var u={active:!1,cursor:null,parents:[]},K=null;function B(n){K=n}function X(){return K}function R(n,e){return u.active&&e.parentNode===n}function q(n){let e=u.parents.lastIndexOf(n);e!==-1&&(u.parents.length=e),u.cursor=n.nextSibling}function b(n,e=!1){if(j)return I().createText(n);if(u.active&&!e){let t=X()?.hydrateText(n);if(t)return t}return document.createTextNode(n)}var N=0,re=200;function ie(n,e,t,i,c){let f=i,s=new Map;return(0,g.createRenderEffect)(()=>{let r;if(E(n)&&!(0,x.isSignal)(n)){if(!s.has(n)){N++;try{let o=n();s.set(n,o)}finally{N--}}for(r=s.get(n);typeof r=="function"&&(0,x.isSignal)(r);)r=r()}else for(r=n();typeof r=="function"&&(0,x.isSignal)(r);)r=r();{let o=0;for(;typeof r=="function"&&o++<50;)if(E(r)){if(!s.has(r)){let a=r;N++;try{let l=a();s.set(a,l)}finally{N--}}r=s.get(r)}else if((0,x.isSignal)(r))r=r();else if(r=r(),typeof r!="function"||!(0,x.isSignal)(r)&&!E(r))break}N++;try{f=S(e,r,t,f,s),c(f)}finally{N--}})}function J(n,e,t,i){if(N>re)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;t!==void 0&&!t&&(t=b("",!0),n.appendChild(t));let c=i??null,f=o=>Array.isArray(o)&&o.some(a=>typeof a=="function"),s=o=>typeof o=="function"?o:()=>o;if(typeof e!="function"&&!f(e)){N++;try{c=S(n,e,t,c)}finally{N--}return()=>c}let r=ie(s(e),n,t,c,o=>{c=o});return()=>(r?.(),c)}function S(n,e,t,i,c){if(e==null||typeof e=="boolean")return T(n,i,t);if(typeof e=="function")for(;typeof e=="function";)e=e();if(e==null||typeof e=="boolean")return T(n,i,t);if(w(e)){let s=b("",!0);return Array.isArray(i)?i.length>0?(n.replaceChild(s,i[0]),T(n,i.slice(1),t)):p(n,s,t):i?n.replaceChild(s,i):p(n,s,t),e.then(r=>{s.parentNode===n&&S(n,r,s.nextSibling,s)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),s}let f=typeof e;if(f==="string"||f==="number"){if(f==="number"&&(e=String(e)),Array.isArray(i)){if(i.length===0){let r=b(e);return p(n,r,t),r}if(i.length===1&&i[0].nodeType===3)return i[0].data=e,i;i=T(n,i,t)}if(i&&W(i))return i.data=e,i;let s=b(e);return i&&i.parentNode===n?n.replaceChild(s,i):R(n,s)||p(n,s,t),s}if(L(e))return R(n,e)?(q(e),e):Array.isArray(i)?(i.length===0?p(n,e,t):i[0].parentNode===n?(n.replaceChild(e,i[0]),T(n,i.slice(1),t)):p(n,e,t),e):(i?i!==e&&(i.parentNode===n?n.replaceChild(e,i):p(n,e,t)):p(n,e,t),e);if(Array.isArray(e)){let s=[],r=Array.isArray(i)?i:i?[i]:[],o=[];m(e,s,n,t,!0,c,o);let a=se(n,r,s,t);for(let l of o){let d=J(n,l.sig,l.marker);(0,g.onCleanup)(()=>{T(n,d()),l.marker.parentNode===n&&n.removeChild(l.marker)})}return a}if(f==="object"&&e!==null&&typeof e=="object"){let s=e;if("type"in s&&"props"in s){let r=s;if(typeof r.type=="function"){let o=r.type(r.props||{});return S(n,o,t,i)}}}return T(n,i,t)}function m(n,e,t,i,c=!0,f,s){for(let r=0;r<n.length;r++){let o=n[r];if(!(o==null||typeof o=="boolean")){for(;typeof o=="function"&&!w(o)&&!(0,x.isSignal)(o)&&!E(o)&&(o=o(),!(o==null||typeof o=="boolean")););if(!(o==null||typeof o=="boolean")){if(typeof o=="function"){let a;for(E(o)&&!(0,x.isSignal)(o)?(f||(f=new Map),f.has(o)||f.set(o,o()),a=f.get(o)):a=o();typeof a=="function"&&!w(a)&&!(0,x.isSignal)(a)&&!E(a);)f||(f=new Map),f.has(a)||f.set(a,a()),a=f.get(a);if(a==null||typeof a=="boolean")continue;if(typeof a=="function"){if((0,x.isSignal)(a)){if(s){let d=b("",!0);e.push(d),s.push({marker:d,sig:a});continue}let l=a();for(;typeof l=="function"&&(0,x.isSignal)(l);)l=l();if(l==null||typeof l=="boolean")continue;Array.isArray(l)?m(l,e,t,i,c,f):m([l],e,t,i,c,f);continue}continue}Array.isArray(a)?m(a,e,t,i,c,f,s):m([a],e,t,i,c,f,s);continue}if(w(o)){let a=b("",!0);e.push(a),o.then(l=>{if(a.parentNode){let d=[];if(m([l],d,a.parentNode,void 0,!1,f),d.length>0){a.parentNode.replaceChild(d[0],a);for(let y=1;y<d.length;y++)a.parentNode?.insertBefore(d[y],d[y-1].nextSibling)}}}).catch(l=>console.error("Error resolving promise in array:",l));continue}if(Array.isArray(o)){m(o,e,t,i,c,f,s);continue}if(L(o)){e.push(o);continue}if(typeof o=="object"&&o!==null&&"type"in o&&"props"in o){let a=o;if(typeof a.type=="function"){let l=a.type(a.props||{});Array.isArray(l)?m(l,e,t,i,!1,f):m([l],e,t,i,!1,f);continue}}if(typeof o=="string"||typeof o=="number"){let a=String(o);if(a.trim()===""&&a!==" ")continue;e.push(b(a));continue}e.push(b(String(o)))}}}}function se(n,e,t,i){for(let d=0;d<t.length;d++){let y=t[d].parentNode;y!==null&&y!==n&&y.nodeType!==11&&(t=t.slice(),t[d]=t[d].cloneNode(!0))}let c=t.length,f=e.length,s=c,r=0,o=0,a=f>0?e[f-1].nextSibling??void 0:i,l=null;for(;r<f||o<s;){if(e[r]===t[o]){r++,o++;continue}for(;f>r&&s>o&&e[f-1]===t[s-1];)f--,s--;if(f===r){let d=s<c?o?t[o-1].nextSibling??void 0:t[s-o]:a;for(;o<s;)p(n,t[o++],d)}else if(s===o)for(;r<f;)(!l||!l.has(e[r]))&&e[r].parentNode===n&&n.removeChild(e[r]),r++;else if(e[r]===t[s-1]&&t[o]===e[f-1]){let d=e[--f].nextSibling;p(n,t[o++],e[r++].nextSibling),p(n,t[--s],d),e[f]=e[r-1]}else{if(!l){l=new Map;let y=o;for(;y<s;)l.set(t[y],y++)}let d=l.get(e[r]);if(d!=null)if(o<d&&d<s){let y=r,k=1;for(;++y<f&&y<s&&!(!l.has(e[y])||l.get(e[y])!==d+k);)k++;if(k>d-o){let Y=e[r];for(;o<d;)p(n,t[o++],Y)}else e[r].parentNode===n?n.replaceChild(t[o++],e[r++]):(p(n,t[o++],a),r++)}else r++;else e[r].parentNode===n&&n.removeChild(e[r]),r++}}return t}function T(n,e,t){if(e)if(Array.isArray(e))for(let i=0;i<e.length;i++)e[i].parentNode===n&&n.removeChild(e[i]);else e.parentNode===n&&n.removeChild(e);return null}function p(n,e,t){u.active&&e.parentNode===n||(t&&t.parentNode===n?n.insertBefore(e,t):n.appendChild(e))}function w(n){return n!=null&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"||n instanceof Promise}function U(n,e,t){if(!e)throw new Error("Container element is required");let i,c,f=[];return(0,g.createRoot)(s=>{(0,g.batch)(()=>{u.active||(e.textContent=""),O(e),F(),J(e,n)}),c=s}),()=>{c?.(),i?.(),f.forEach(s=>s()),e.textContent=""}}var A=require("@fluixi/reactive/signal");var fe="__FX_DATA__";var M;function z(){let n=globalThis.__FX_DATA__;if(n)return n;if(M!==void 0)return M;let e=null;if(typeof document<"u"){let t=document.getElementById(fe)?.textContent;if(t)try{e=JSON.parse(t)}catch{e=null}}return M=e}function v(){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 ae=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),C=typeof process<"u"&&process.env&&!1;function P(n,e){let t=e.nodeType===1?`<${e.tagName.toLowerCase()}>`:e.nodeType===3?`text ${JSON.stringify((e.nodeValue??"").slice(0,24))}`:e.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${n} but the server DOM has ${t}. 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 ue(n){v();let e=u.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===n.toLowerCase()?(ae.has(n.toLowerCase())?u.cursor=e.nextSibling:(u.parents.push(e),u.cursor=e.firstChild),e):(C&&e&&P(`<${n}>`,e),null)}function le(n){v();let e=u.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===n.toLowerCase()?(u.cursor=e.nextSibling,e):(C&&e&&P(`<${n}> (static)`,e),null)}function ce(n){if(n===""){let t=u.cursor;return t&&t.nodeType===3&&t.data!==""?(u.cursor=t.nextSibling,t.data="",t):null}v();let e=u.cursor;return e&&e.nodeType===3?(u.cursor=e.nextSibling,e.nodeValue!==n&&(e.nodeValue=n),e):(C&&e&&P(`text ${JSON.stringify(n.slice(0,24))}`,e),null)}function de(n){v();let e=u.cursor;return e&&e.nodeType===8&&e.data===n?(u.cursor=e.nextSibling,e):(C&&e&&P(`marker <!--${n.slice(0,24)}-->`,e),null)}var G=!1;function ye(){G||(G=!0,B({hydrateElement:ue,hydrateText:ce,hydrateMarker:de,hydrateStatic:le}))}function pe(n,e,t){ye(),u.active=!0,u.cursor=e.firstChild,u.parents=[];let i=z(),c=t?.resourceNamespace,f=0;(0,A.setResourceIdSource)(()=>c?`${c}:r${f++}`:`r${f++}`),(0,A.setServerDataGetter)(i?s=>s in i?{value:i[s]}:void 0:null);try{return U(n,e)}finally{u.active=!1,u.cursor=null,u.parents=[]}}
1
+ "use strict";var _=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var ee=Object.prototype.hasOwnProperty;var ne=(n,e)=>{for(var t in e)_(n,t,{get:e[t],enumerable:!0})},te=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of Z(e))!ee.call(n,c)&&c!==t&&_(n,c,{get:()=>e[c],enumerable:!(i=Q(e,c))||i.enumerable});return n};var oe=n=>te(_({},"__esModule",{value:!0}),n);var he={};ne(he,{hydrate:()=>pe});module.exports=oe(he);var x=require("@fluixi/reactive/signal");var $="1.0.0-alpha.80";var D=require("@fluixi/reactive/version"),h={dom:$,reactive:D.VERSION};function O(n){h.core&&n.setAttribute("fluixi",h.core),n.setAttribute("fx-dom",h.dom),n.setAttribute("fx-reactive",h.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=h)}function F(){let n=[h.core,h.dom,h.reactive].filter(e=>e!==void 0);new Set(n).size<=1||console.warn(`[fluixi] package versions disagree — core ${h.core??"(absent)"}, dom ${h.dom}, reactive ${h.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 E(n){return typeof n=="function"&&n[Symbol.for("fluixi-component")]===!0}var g=require("@fluixi/reactive/signal");var j=typeof document>"u";var V=Symbol.for("fluixi.server-node"),H=null;function I(){if(!H)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return H}function L(n){return n!=null&&n[V]===!0?!0:typeof Node<"u"&&n instanceof Node}function W(n){return n!=null&&n[V]===!0?n.nodeType===3:typeof Text<"u"&&n instanceof Text}var u={active:!1,cursor:null,parents:[]},K=null;function B(n){K=n}function X(){return K}function R(n,e){return u.active&&e.parentNode===n}function q(n){let e=u.parents.lastIndexOf(n);e!==-1&&(u.parents.length=e),u.cursor=n.nextSibling}function b(n,e=!1){if(j)return I().createText(n);if(u.active&&!e){let t=X()?.hydrateText(n);if(t)return t}return document.createTextNode(n)}var N=0,re=200;function ie(n,e,t,i,c){let f=i,s=new Map;return(0,g.createRenderEffect)(()=>{let r;if(E(n)&&!(0,x.isSignal)(n)){if(!s.has(n)){N++;try{let o=n();s.set(n,o)}finally{N--}}for(r=s.get(n);typeof r=="function"&&(0,x.isSignal)(r);)r=r()}else for(r=n();typeof r=="function"&&(0,x.isSignal)(r);)r=r();{let o=0;for(;typeof r=="function"&&o++<50;)if(E(r)){if(!s.has(r)){let a=r;N++;try{let l=a();s.set(a,l)}finally{N--}}r=s.get(r)}else if((0,x.isSignal)(r))r=r();else if(r=r(),typeof r!="function"||!(0,x.isSignal)(r)&&!E(r))break}N++;try{f=S(e,r,t,f,s),c(f)}finally{N--}})}function J(n,e,t,i){if(N>re)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;t!==void 0&&!t&&(t=b("",!0),n.appendChild(t));let c=i??null,f=o=>Array.isArray(o)&&o.some(a=>typeof a=="function"),s=o=>typeof o=="function"?o:()=>o;if(typeof e!="function"&&!f(e)){N++;try{c=S(n,e,t,c)}finally{N--}return()=>c}let r=ie(s(e),n,t,c,o=>{c=o});return()=>(r?.(),c)}function S(n,e,t,i,c){if(e==null||typeof e=="boolean")return T(n,i,t);if(typeof e=="function")for(;typeof e=="function";)e=e();if(e==null||typeof e=="boolean")return T(n,i,t);if(w(e)){let s=b("",!0);return Array.isArray(i)?i.length>0?(n.replaceChild(s,i[0]),T(n,i.slice(1),t)):p(n,s,t):i?n.replaceChild(s,i):p(n,s,t),e.then(r=>{s.parentNode===n&&S(n,r,s.nextSibling,s)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),s}let f=typeof e;if(f==="string"||f==="number"){if(f==="number"&&(e=String(e)),Array.isArray(i)){if(i.length===0){let r=b(e);return p(n,r,t),r}if(i.length===1&&i[0].nodeType===3)return i[0].data=e,i;i=T(n,i,t)}if(i&&W(i))return i.data=e,i;let s=b(e);return i&&i.parentNode===n?n.replaceChild(s,i):R(n,s)||p(n,s,t),s}if(L(e))return R(n,e)?(q(e),e):Array.isArray(i)?(i.length===0?p(n,e,t):i[0].parentNode===n?(n.replaceChild(e,i[0]),T(n,i.slice(1),t)):p(n,e,t),e):(i?i!==e&&(i.parentNode===n?n.replaceChild(e,i):p(n,e,t)):p(n,e,t),e);if(Array.isArray(e)){let s=[],r=Array.isArray(i)?i:i?[i]:[],o=[];m(e,s,n,t,!0,c,o);let a=se(n,r,s,t);for(let l of o){let d=J(n,l.sig,l.marker);(0,g.onCleanup)(()=>{T(n,d()),l.marker.parentNode===n&&n.removeChild(l.marker)})}return a}if(f==="object"&&e!==null&&typeof e=="object"){let s=e;if("type"in s&&"props"in s){let r=s;if(typeof r.type=="function"){let o=r.type(r.props||{});return S(n,o,t,i)}}}return T(n,i,t)}function m(n,e,t,i,c=!0,f,s){for(let r=0;r<n.length;r++){let o=n[r];if(!(o==null||typeof o=="boolean")){for(;typeof o=="function"&&!w(o)&&!(0,x.isSignal)(o)&&!E(o)&&(o=o(),!(o==null||typeof o=="boolean")););if(!(o==null||typeof o=="boolean")){if(typeof o=="function"){let a;for(E(o)&&!(0,x.isSignal)(o)?(f||(f=new Map),f.has(o)||f.set(o,o()),a=f.get(o)):a=o();typeof a=="function"&&!w(a)&&!(0,x.isSignal)(a)&&!E(a);)f||(f=new Map),f.has(a)||f.set(a,a()),a=f.get(a);if(a==null||typeof a=="boolean")continue;if(typeof a=="function"){if((0,x.isSignal)(a)){if(s){let d=b("",!0);e.push(d),s.push({marker:d,sig:a});continue}let l=a();for(;typeof l=="function"&&(0,x.isSignal)(l);)l=l();if(l==null||typeof l=="boolean")continue;Array.isArray(l)?m(l,e,t,i,c,f):m([l],e,t,i,c,f);continue}continue}Array.isArray(a)?m(a,e,t,i,c,f,s):m([a],e,t,i,c,f,s);continue}if(w(o)){let a=b("",!0);e.push(a),o.then(l=>{if(a.parentNode){let d=[];if(m([l],d,a.parentNode,void 0,!1,f),d.length>0){a.parentNode.replaceChild(d[0],a);for(let y=1;y<d.length;y++)a.parentNode?.insertBefore(d[y],d[y-1].nextSibling)}}}).catch(l=>console.error("Error resolving promise in array:",l));continue}if(Array.isArray(o)){m(o,e,t,i,c,f,s);continue}if(L(o)){e.push(o);continue}if(typeof o=="object"&&o!==null&&"type"in o&&"props"in o){let a=o;if(typeof a.type=="function"){let l=a.type(a.props||{});Array.isArray(l)?m(l,e,t,i,!1,f):m([l],e,t,i,!1,f);continue}}if(typeof o=="string"||typeof o=="number"){let a=String(o);if(a.trim()===""&&a!==" ")continue;e.push(b(a));continue}e.push(b(String(o)))}}}}function se(n,e,t,i){for(let d=0;d<t.length;d++){let y=t[d].parentNode;y!==null&&y!==n&&y.nodeType!==11&&(t=t.slice(),t[d]=t[d].cloneNode(!0))}let c=t.length,f=e.length,s=c,r=0,o=0,a=f>0?e[f-1].nextSibling??void 0:i,l=null;for(;r<f||o<s;){if(e[r]===t[o]){r++,o++;continue}for(;f>r&&s>o&&e[f-1]===t[s-1];)f--,s--;if(f===r){let d=s<c?o?t[o-1].nextSibling??void 0:t[s-o]:a;for(;o<s;)p(n,t[o++],d)}else if(s===o)for(;r<f;)(!l||!l.has(e[r]))&&e[r].parentNode===n&&n.removeChild(e[r]),r++;else if(e[r]===t[s-1]&&t[o]===e[f-1]){let d=e[--f].nextSibling;p(n,t[o++],e[r++].nextSibling),p(n,t[--s],d),e[f]=e[r-1]}else{if(!l){l=new Map;let y=o;for(;y<s;)l.set(t[y],y++)}let d=l.get(e[r]);if(d!=null)if(o<d&&d<s){let y=r,k=1;for(;++y<f&&y<s&&!(!l.has(e[y])||l.get(e[y])!==d+k);)k++;if(k>d-o){let Y=e[r];for(;o<d;)p(n,t[o++],Y)}else e[r].parentNode===n?n.replaceChild(t[o++],e[r++]):(p(n,t[o++],a),r++)}else r++;else e[r].parentNode===n&&n.removeChild(e[r]),r++}}return t}function T(n,e,t){if(e)if(Array.isArray(e))for(let i=0;i<e.length;i++)e[i].parentNode===n&&n.removeChild(e[i]);else e.parentNode===n&&n.removeChild(e);return null}function p(n,e,t){u.active&&e.parentNode===n||(t&&t.parentNode===n?n.insertBefore(e,t):n.appendChild(e))}function w(n){return n!=null&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"||n instanceof Promise}function U(n,e,t){if(!e)throw new Error("Container element is required");let i,c,f=[];return(0,g.createRoot)(s=>{(0,g.batch)(()=>{u.active||(e.textContent=""),O(e),F(),J(e,n)}),c=s}),()=>{c?.(),i?.(),f.forEach(s=>s()),e.textContent=""}}var A=require("@fluixi/reactive/signal");var fe="__FX_DATA__";var M;function z(){let n=globalThis.__FX_DATA__;if(n)return n;if(M!==void 0)return M;let e=null;if(typeof document<"u"){let t=document.getElementById(fe)?.textContent;if(t)try{e=JSON.parse(t)}catch{e=null}}return M=e}function v(){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 ae=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),C=typeof process<"u"&&process.env&&!1;function P(n,e){let t=e.nodeType===1?`<${e.tagName.toLowerCase()}>`:e.nodeType===3?`text ${JSON.stringify((e.nodeValue??"").slice(0,24))}`:e.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${n} but the server DOM has ${t}. 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 ue(n){v();let e=u.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===n.toLowerCase()?(ae.has(n.toLowerCase())?u.cursor=e.nextSibling:(u.parents.push(e),u.cursor=e.firstChild),e):(C&&e&&P(`<${n}>`,e),null)}function le(n){v();let e=u.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===n.toLowerCase()?(u.cursor=e.nextSibling,e):(C&&e&&P(`<${n}> (static)`,e),null)}function ce(n){if(n===""){let t=u.cursor;return t&&t.nodeType===3&&t.data!==""?(u.cursor=t.nextSibling,t.data="",t):null}v();let e=u.cursor;return e&&e.nodeType===3?(u.cursor=e.nextSibling,e.nodeValue!==n&&(e.nodeValue=n),e):(C&&e&&P(`text ${JSON.stringify(n.slice(0,24))}`,e),null)}function de(n){v();let e=u.cursor;return e&&e.nodeType===8&&e.data===n?(u.cursor=e.nextSibling,e):(C&&e&&P(`marker <!--${n.slice(0,24)}-->`,e),null)}var G=!1;function ye(){G||(G=!0,B({hydrateElement:ue,hydrateText:ce,hydrateMarker:de,hydrateStatic:le}))}function pe(n,e,t){ye(),u.active=!0,u.cursor=e.firstChild,u.parents=[];let i=z(),c=t?.resourceNamespace,f=0;(0,A.setResourceIdSource)(()=>c?`${c}:r${f++}`:`r${f++}`),(0,A.setServerDataGetter)(i?s=>s in i?{value:i[s]}:void 0:null);try{return U(n,e)}finally{u.active=!1,u.cursor=null,u.parents=[]}}
@@ -1 +1 @@
1
- import{isSignal as x}from"@fluixi/reactive/signal";var L="1.0.0-alpha.78";import{VERSION as U}from"@fluixi/reactive/version";var h={dom:L,reactive:U};function R(n){h.core&&n.setAttribute("fluixi",h.core),n.setAttribute("fx-dom",h.dom),n.setAttribute("fx-reactive",h.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=h)}function M(){let n=[h.core,h.dom,h.reactive].filter(e=>e!==void 0);new Set(n).size<=1||console.warn(`[fluixi] package versions disagree — core ${h.core??"(absent)"}, dom ${h.dom}, reactive ${h.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 b(n){return typeof n=="function"&&n[Symbol.for("fluixi-component")]===!0}import{batch as z,createEffect as Se,createRenderEffect as G,createRoot as Y,onCleanup as Q,readChildren as Ae}from"@fluixi/reactive/signal";var D=typeof document>"u";var O=Symbol.for("fluixi.server-node"),$=null;function F(){if(!$)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return $}function P(n){return n!=null&&n[O]===!0?!0:typeof Node<"u"&&n instanceof Node}function H(n){return n!=null&&n[O]===!0?n.nodeType===3:typeof Text<"u"&&n instanceof Text}var u={active:!1,cursor:null,parents:[]},j=null;function V(n){j=n}function I(){return j}function k(n,e){return u.active&&e.parentNode===n}function W(n){let e=u.parents.lastIndexOf(n);e!==-1&&(u.parents.length=e),u.cursor=n.nextSibling}function N(n,e=!1){if(D)return F().createText(n);if(u.active&&!e){let t=I()?.hydrateText(n);if(t)return t}return document.createTextNode(n)}var m=0,Z=200;function ee(n,e,t,i,d){let f=i,s=new Map;return G(()=>{let r;if(b(n)&&!x(n)){if(!s.has(n)){m++;try{let o=n();s.set(n,o)}finally{m--}}for(r=s.get(n);typeof r=="function"&&x(r);)r=r()}else for(r=n();typeof r=="function"&&x(r);)r=r();{let o=0;for(;typeof r=="function"&&o++<50;)if(b(r)){if(!s.has(r)){let a=r;m++;try{let l=a();s.set(a,l)}finally{m--}}r=s.get(r)}else if(x(r))r=r();else if(r=r(),typeof r!="function"||!x(r)&&!b(r))break}m++;try{f=w(e,r,t,f,s),d(f)}finally{m--}})}function K(n,e,t,i){if(m>Z)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;t!==void 0&&!t&&(t=N("",!0),n.appendChild(t));let d=i??null,f=o=>Array.isArray(o)&&o.some(a=>typeof a=="function"),s=o=>typeof o=="function"?o:()=>o;if(typeof e!="function"&&!f(e)){m++;try{d=w(n,e,t,d)}finally{m--}return()=>d}let r=ee(s(e),n,t,d,o=>{d=o});return()=>(r?.(),d)}function w(n,e,t,i,d){if(e==null||typeof e=="boolean")return E(n,i,t);if(typeof e=="function")for(;typeof e=="function";)e=e();if(e==null||typeof e=="boolean")return E(n,i,t);if(T(e)){let s=N("",!0);return Array.isArray(i)?i.length>0?(n.replaceChild(s,i[0]),E(n,i.slice(1),t)):p(n,s,t):i?n.replaceChild(s,i):p(n,s,t),e.then(r=>{s.parentNode===n&&w(n,r,s.nextSibling,s)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),s}let f=typeof e;if(f==="string"||f==="number"){if(f==="number"&&(e=String(e)),Array.isArray(i)){if(i.length===0){let r=N(e);return p(n,r,t),r}if(i.length===1&&i[0].nodeType===3)return i[0].data=e,i;i=E(n,i,t)}if(i&&H(i))return i.data=e,i;let s=N(e);return i&&i.parentNode===n?n.replaceChild(s,i):k(n,s)||p(n,s,t),s}if(P(e))return k(n,e)?(W(e),e):Array.isArray(i)?(i.length===0?p(n,e,t):i[0].parentNode===n?(n.replaceChild(e,i[0]),E(n,i.slice(1),t)):p(n,e,t),e):(i?i!==e&&(i.parentNode===n?n.replaceChild(e,i):p(n,e,t)):p(n,e,t),e);if(Array.isArray(e)){let s=[],r=Array.isArray(i)?i:i?[i]:[],o=[];g(e,s,n,t,!0,d,o);let a=ne(n,r,s,t);for(let l of o){let c=K(n,l.sig,l.marker);Q(()=>{E(n,c()),l.marker.parentNode===n&&n.removeChild(l.marker)})}return a}if(f==="object"&&e!==null&&typeof e=="object"){let s=e;if("type"in s&&"props"in s){let r=s;if(typeof r.type=="function"){let o=r.type(r.props||{});return w(n,o,t,i)}}}return E(n,i,t)}function g(n,e,t,i,d=!0,f,s){for(let r=0;r<n.length;r++){let o=n[r];if(!(o==null||typeof o=="boolean")){for(;typeof o=="function"&&!T(o)&&!x(o)&&!b(o)&&(o=o(),!(o==null||typeof o=="boolean")););if(!(o==null||typeof o=="boolean")){if(typeof o=="function"){let a;for(b(o)&&!x(o)?(f||(f=new Map),f.has(o)||f.set(o,o()),a=f.get(o)):a=o();typeof a=="function"&&!T(a)&&!x(a)&&!b(a);)f||(f=new Map),f.has(a)||f.set(a,a()),a=f.get(a);if(a==null||typeof a=="boolean")continue;if(typeof a=="function"){if(x(a)){if(s){let c=N("",!0);e.push(c),s.push({marker:c,sig:a});continue}let l=a();for(;typeof l=="function"&&x(l);)l=l();if(l==null||typeof l=="boolean")continue;Array.isArray(l)?g(l,e,t,i,d,f):g([l],e,t,i,d,f);continue}continue}Array.isArray(a)?g(a,e,t,i,d,f,s):g([a],e,t,i,d,f,s);continue}if(T(o)){let a=N("",!0);e.push(a),o.then(l=>{if(a.parentNode){let c=[];if(g([l],c,a.parentNode,void 0,!1,f),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(l=>console.error("Error resolving promise in array:",l));continue}if(Array.isArray(o)){g(o,e,t,i,d,f,s);continue}if(P(o)){e.push(o);continue}if(typeof o=="object"&&o!==null&&"type"in o&&"props"in o){let a=o;if(typeof a.type=="function"){let l=a.type(a.props||{});Array.isArray(l)?g(l,e,t,i,!1,f):g([l],e,t,i,!1,f);continue}}if(typeof o=="string"||typeof o=="number"){let a=String(o);if(a.trim()===""&&a!==" ")continue;e.push(N(a));continue}e.push(N(String(o)))}}}}function ne(n,e,t,i){for(let c=0;c<t.length;c++){let y=t[c].parentNode;y!==null&&y!==n&&y.nodeType!==11&&(t=t.slice(),t[c]=t[c].cloneNode(!0))}let d=t.length,f=e.length,s=d,r=0,o=0,a=f>0?e[f-1].nextSibling??void 0:i,l=null;for(;r<f||o<s;){if(e[r]===t[o]){r++,o++;continue}for(;f>r&&s>o&&e[f-1]===t[s-1];)f--,s--;if(f===r){let c=s<d?o?t[o-1].nextSibling??void 0:t[s-o]:a;for(;o<s;)p(n,t[o++],c)}else if(s===o)for(;r<f;)(!l||!l.has(e[r]))&&e[r].parentNode===n&&n.removeChild(e[r]),r++;else if(e[r]===t[s-1]&&t[o]===e[f-1]){let c=e[--f].nextSibling;p(n,t[o++],e[r++].nextSibling),p(n,t[--s],c),e[f]=e[r-1]}else{if(!l){l=new Map;let y=o;for(;y<s;)l.set(t[y],y++)}let c=l.get(e[r]);if(c!=null)if(o<c&&c<s){let y=r,C=1;for(;++y<f&&y<s&&!(!l.has(e[y])||l.get(e[y])!==c+C);)C++;if(C>c-o){let J=e[r];for(;o<c;)p(n,t[o++],J)}else e[r].parentNode===n?n.replaceChild(t[o++],e[r++]):(p(n,t[o++],a),r++)}else r++;else e[r].parentNode===n&&n.removeChild(e[r]),r++}}return t}function E(n,e,t){if(e)if(Array.isArray(e))for(let i=0;i<e.length;i++)e[i].parentNode===n&&n.removeChild(e[i]);else e.parentNode===n&&n.removeChild(e);return null}function p(n,e,t){u.active&&e.parentNode===n||(t&&t.parentNode===n?n.insertBefore(e,t):n.appendChild(e))}function T(n){return n!=null&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"||n instanceof Promise}function B(n,e,t){if(!e)throw new Error("Container element is required");let i,d,f=[];return Y(s=>{z(()=>{u.active||(e.textContent=""),R(e),M(),K(e,n)}),d=s}),()=>{d?.(),i?.(),f.forEach(s=>s()),e.textContent=""}}import{setResourceIdSource as oe,setServerDataGetter as re}from"@fluixi/reactive/signal";var te="__FX_DATA__";var _;function X(){let n=globalThis.__FX_DATA__;if(n)return n;if(_!==void 0)return _;let e=null;if(typeof document<"u"){let t=document.getElementById(te)?.textContent;if(t)try{e=JSON.parse(t)}catch{e=null}}return _=e}function S(){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 ie=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),A=typeof process<"u"&&process.env&&!1;function v(n,e){let t=e.nodeType===1?`<${e.tagName.toLowerCase()}>`:e.nodeType===3?`text ${JSON.stringify((e.nodeValue??"").slice(0,24))}`:e.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${n} but the server DOM has ${t}. 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 se(n){S();let e=u.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===n.toLowerCase()?(ie.has(n.toLowerCase())?u.cursor=e.nextSibling:(u.parents.push(e),u.cursor=e.firstChild),e):(A&&e&&v(`<${n}>`,e),null)}function fe(n){S();let e=u.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===n.toLowerCase()?(u.cursor=e.nextSibling,e):(A&&e&&v(`<${n}> (static)`,e),null)}function ae(n){if(n===""){let t=u.cursor;return t&&t.nodeType===3&&t.data!==""?(u.cursor=t.nextSibling,t.data="",t):null}S();let e=u.cursor;return e&&e.nodeType===3?(u.cursor=e.nextSibling,e.nodeValue!==n&&(e.nodeValue=n),e):(A&&e&&v(`text ${JSON.stringify(n.slice(0,24))}`,e),null)}function ue(n){S();let e=u.cursor;return e&&e.nodeType===8&&e.data===n?(u.cursor=e.nextSibling,e):(A&&e&&v(`marker <!--${n.slice(0,24)}-->`,e),null)}var q=!1;function le(){q||(q=!0,V({hydrateElement:se,hydrateText:ae,hydrateMarker:ue,hydrateStatic:fe}))}function De(n,e,t){le(),u.active=!0,u.cursor=e.firstChild,u.parents=[];let i=X(),d=t?.resourceNamespace,f=0;oe(()=>d?`${d}:r${f++}`:`r${f++}`),re(i?s=>s in i?{value:i[s]}:void 0:null);try{return B(n,e)}finally{u.active=!1,u.cursor=null,u.parents=[]}}export{De as hydrate};
1
+ import{isSignal as x}from"@fluixi/reactive/signal";var L="1.0.0-alpha.80";import{VERSION as U}from"@fluixi/reactive/version";var h={dom:L,reactive:U};function R(n){h.core&&n.setAttribute("fluixi",h.core),n.setAttribute("fx-dom",h.dom),n.setAttribute("fx-reactive",h.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=h)}function M(){let n=[h.core,h.dom,h.reactive].filter(e=>e!==void 0);new Set(n).size<=1||console.warn(`[fluixi] package versions disagree — core ${h.core??"(absent)"}, dom ${h.dom}, reactive ${h.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 b(n){return typeof n=="function"&&n[Symbol.for("fluixi-component")]===!0}import{batch as z,createEffect as Se,createRenderEffect as G,createRoot as Y,onCleanup as Q,readChildren as Ae}from"@fluixi/reactive/signal";var D=typeof document>"u";var O=Symbol.for("fluixi.server-node"),$=null;function F(){if(!$)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return $}function P(n){return n!=null&&n[O]===!0?!0:typeof Node<"u"&&n instanceof Node}function H(n){return n!=null&&n[O]===!0?n.nodeType===3:typeof Text<"u"&&n instanceof Text}var u={active:!1,cursor:null,parents:[]},j=null;function V(n){j=n}function I(){return j}function k(n,e){return u.active&&e.parentNode===n}function W(n){let e=u.parents.lastIndexOf(n);e!==-1&&(u.parents.length=e),u.cursor=n.nextSibling}function N(n,e=!1){if(D)return F().createText(n);if(u.active&&!e){let t=I()?.hydrateText(n);if(t)return t}return document.createTextNode(n)}var m=0,Z=200;function ee(n,e,t,i,d){let f=i,s=new Map;return G(()=>{let r;if(b(n)&&!x(n)){if(!s.has(n)){m++;try{let o=n();s.set(n,o)}finally{m--}}for(r=s.get(n);typeof r=="function"&&x(r);)r=r()}else for(r=n();typeof r=="function"&&x(r);)r=r();{let o=0;for(;typeof r=="function"&&o++<50;)if(b(r)){if(!s.has(r)){let a=r;m++;try{let l=a();s.set(a,l)}finally{m--}}r=s.get(r)}else if(x(r))r=r();else if(r=r(),typeof r!="function"||!x(r)&&!b(r))break}m++;try{f=w(e,r,t,f,s),d(f)}finally{m--}})}function K(n,e,t,i){if(m>Z)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;t!==void 0&&!t&&(t=N("",!0),n.appendChild(t));let d=i??null,f=o=>Array.isArray(o)&&o.some(a=>typeof a=="function"),s=o=>typeof o=="function"?o:()=>o;if(typeof e!="function"&&!f(e)){m++;try{d=w(n,e,t,d)}finally{m--}return()=>d}let r=ee(s(e),n,t,d,o=>{d=o});return()=>(r?.(),d)}function w(n,e,t,i,d){if(e==null||typeof e=="boolean")return E(n,i,t);if(typeof e=="function")for(;typeof e=="function";)e=e();if(e==null||typeof e=="boolean")return E(n,i,t);if(T(e)){let s=N("",!0);return Array.isArray(i)?i.length>0?(n.replaceChild(s,i[0]),E(n,i.slice(1),t)):p(n,s,t):i?n.replaceChild(s,i):p(n,s,t),e.then(r=>{s.parentNode===n&&w(n,r,s.nextSibling,s)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),s}let f=typeof e;if(f==="string"||f==="number"){if(f==="number"&&(e=String(e)),Array.isArray(i)){if(i.length===0){let r=N(e);return p(n,r,t),r}if(i.length===1&&i[0].nodeType===3)return i[0].data=e,i;i=E(n,i,t)}if(i&&H(i))return i.data=e,i;let s=N(e);return i&&i.parentNode===n?n.replaceChild(s,i):k(n,s)||p(n,s,t),s}if(P(e))return k(n,e)?(W(e),e):Array.isArray(i)?(i.length===0?p(n,e,t):i[0].parentNode===n?(n.replaceChild(e,i[0]),E(n,i.slice(1),t)):p(n,e,t),e):(i?i!==e&&(i.parentNode===n?n.replaceChild(e,i):p(n,e,t)):p(n,e,t),e);if(Array.isArray(e)){let s=[],r=Array.isArray(i)?i:i?[i]:[],o=[];g(e,s,n,t,!0,d,o);let a=ne(n,r,s,t);for(let l of o){let c=K(n,l.sig,l.marker);Q(()=>{E(n,c()),l.marker.parentNode===n&&n.removeChild(l.marker)})}return a}if(f==="object"&&e!==null&&typeof e=="object"){let s=e;if("type"in s&&"props"in s){let r=s;if(typeof r.type=="function"){let o=r.type(r.props||{});return w(n,o,t,i)}}}return E(n,i,t)}function g(n,e,t,i,d=!0,f,s){for(let r=0;r<n.length;r++){let o=n[r];if(!(o==null||typeof o=="boolean")){for(;typeof o=="function"&&!T(o)&&!x(o)&&!b(o)&&(o=o(),!(o==null||typeof o=="boolean")););if(!(o==null||typeof o=="boolean")){if(typeof o=="function"){let a;for(b(o)&&!x(o)?(f||(f=new Map),f.has(o)||f.set(o,o()),a=f.get(o)):a=o();typeof a=="function"&&!T(a)&&!x(a)&&!b(a);)f||(f=new Map),f.has(a)||f.set(a,a()),a=f.get(a);if(a==null||typeof a=="boolean")continue;if(typeof a=="function"){if(x(a)){if(s){let c=N("",!0);e.push(c),s.push({marker:c,sig:a});continue}let l=a();for(;typeof l=="function"&&x(l);)l=l();if(l==null||typeof l=="boolean")continue;Array.isArray(l)?g(l,e,t,i,d,f):g([l],e,t,i,d,f);continue}continue}Array.isArray(a)?g(a,e,t,i,d,f,s):g([a],e,t,i,d,f,s);continue}if(T(o)){let a=N("",!0);e.push(a),o.then(l=>{if(a.parentNode){let c=[];if(g([l],c,a.parentNode,void 0,!1,f),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(l=>console.error("Error resolving promise in array:",l));continue}if(Array.isArray(o)){g(o,e,t,i,d,f,s);continue}if(P(o)){e.push(o);continue}if(typeof o=="object"&&o!==null&&"type"in o&&"props"in o){let a=o;if(typeof a.type=="function"){let l=a.type(a.props||{});Array.isArray(l)?g(l,e,t,i,!1,f):g([l],e,t,i,!1,f);continue}}if(typeof o=="string"||typeof o=="number"){let a=String(o);if(a.trim()===""&&a!==" ")continue;e.push(N(a));continue}e.push(N(String(o)))}}}}function ne(n,e,t,i){for(let c=0;c<t.length;c++){let y=t[c].parentNode;y!==null&&y!==n&&y.nodeType!==11&&(t=t.slice(),t[c]=t[c].cloneNode(!0))}let d=t.length,f=e.length,s=d,r=0,o=0,a=f>0?e[f-1].nextSibling??void 0:i,l=null;for(;r<f||o<s;){if(e[r]===t[o]){r++,o++;continue}for(;f>r&&s>o&&e[f-1]===t[s-1];)f--,s--;if(f===r){let c=s<d?o?t[o-1].nextSibling??void 0:t[s-o]:a;for(;o<s;)p(n,t[o++],c)}else if(s===o)for(;r<f;)(!l||!l.has(e[r]))&&e[r].parentNode===n&&n.removeChild(e[r]),r++;else if(e[r]===t[s-1]&&t[o]===e[f-1]){let c=e[--f].nextSibling;p(n,t[o++],e[r++].nextSibling),p(n,t[--s],c),e[f]=e[r-1]}else{if(!l){l=new Map;let y=o;for(;y<s;)l.set(t[y],y++)}let c=l.get(e[r]);if(c!=null)if(o<c&&c<s){let y=r,C=1;for(;++y<f&&y<s&&!(!l.has(e[y])||l.get(e[y])!==c+C);)C++;if(C>c-o){let J=e[r];for(;o<c;)p(n,t[o++],J)}else e[r].parentNode===n?n.replaceChild(t[o++],e[r++]):(p(n,t[o++],a),r++)}else r++;else e[r].parentNode===n&&n.removeChild(e[r]),r++}}return t}function E(n,e,t){if(e)if(Array.isArray(e))for(let i=0;i<e.length;i++)e[i].parentNode===n&&n.removeChild(e[i]);else e.parentNode===n&&n.removeChild(e);return null}function p(n,e,t){u.active&&e.parentNode===n||(t&&t.parentNode===n?n.insertBefore(e,t):n.appendChild(e))}function T(n){return n!=null&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"||n instanceof Promise}function B(n,e,t){if(!e)throw new Error("Container element is required");let i,d,f=[];return Y(s=>{z(()=>{u.active||(e.textContent=""),R(e),M(),K(e,n)}),d=s}),()=>{d?.(),i?.(),f.forEach(s=>s()),e.textContent=""}}import{setResourceIdSource as oe,setServerDataGetter as re}from"@fluixi/reactive/signal";var te="__FX_DATA__";var _;function X(){let n=globalThis.__FX_DATA__;if(n)return n;if(_!==void 0)return _;let e=null;if(typeof document<"u"){let t=document.getElementById(te)?.textContent;if(t)try{e=JSON.parse(t)}catch{e=null}}return _=e}function S(){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 ie=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),A=typeof process<"u"&&process.env&&!1;function v(n,e){let t=e.nodeType===1?`<${e.tagName.toLowerCase()}>`:e.nodeType===3?`text ${JSON.stringify((e.nodeValue??"").slice(0,24))}`:e.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${n} but the server DOM has ${t}. 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 se(n){S();let e=u.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===n.toLowerCase()?(ie.has(n.toLowerCase())?u.cursor=e.nextSibling:(u.parents.push(e),u.cursor=e.firstChild),e):(A&&e&&v(`<${n}>`,e),null)}function fe(n){S();let e=u.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===n.toLowerCase()?(u.cursor=e.nextSibling,e):(A&&e&&v(`<${n}> (static)`,e),null)}function ae(n){if(n===""){let t=u.cursor;return t&&t.nodeType===3&&t.data!==""?(u.cursor=t.nextSibling,t.data="",t):null}S();let e=u.cursor;return e&&e.nodeType===3?(u.cursor=e.nextSibling,e.nodeValue!==n&&(e.nodeValue=n),e):(A&&e&&v(`text ${JSON.stringify(n.slice(0,24))}`,e),null)}function ue(n){S();let e=u.cursor;return e&&e.nodeType===8&&e.data===n?(u.cursor=e.nextSibling,e):(A&&e&&v(`marker <!--${n.slice(0,24)}-->`,e),null)}var q=!1;function le(){q||(q=!0,V({hydrateElement:se,hydrateText:ae,hydrateMarker:ue,hydrateStatic:fe}))}function De(n,e,t){le(),u.active=!0,u.cursor=e.firstChild,u.parents=[];let i=X(),d=t?.resourceNamespace,f=0;oe(()=>d?`${d}:r${f++}`:`r${f++}`),re(i?s=>s in i?{value:i[s]}:void 0:null);try{return B(n,e)}finally{u.active=!1,u.cursor=null,u.parents=[]}}export{De as hydrate};
@@ -1 +1 @@
1
- "use strict";var Q=Object.defineProperty;var je=Object.getOwnPropertyDescriptor;var qe=Object.getOwnPropertyNames;var Ve=Object.prototype.hasOwnProperty;var We=(e,t)=>{for(var n in t)Q(e,n,{get:t[n],enumerable:!0})},Ke=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of qe(t))!Ve.call(e,r)&&r!==n&&Q(e,r,{get:()=>t[r],enumerable:!(o=je(t,r))||o.enumerable});return e};var Be=e=>Ke(Q({},"__esModule",{value:!0}),e);var mn={};We(mn,{Island:()=>De,JSX_PROPERTIES:()=>D,SVG_ELEMENTS:()=>Ye,SVG_NAMESPACE:()=>O,VOID_ELEMENTS:()=>Ue,addClass:()=>et,addDelegatedEventListener:()=>Le,addNativeEventListener:()=>ae,appendChildren:()=>ut,applyElementProp:()=>k,applyProps:()=>Vt,applyUse:()=>fe,bindPair:()=>Ut,captureHydrationCursor:()=>ve,cleanChildren:()=>w,cloneTemplate:()=>Me,closest:()=>Qe,createComponent:()=>en,createElement:()=>at,createNativeElement:()=>se,createPortal:()=>Bt,createTemplate:()=>Pe,delegate:()=>pt,delegateEvents:()=>ie,escapeHTML:()=>Xt,fnName:()=>kt,generateID:()=>At,getAttribute:()=>rt,getGlobal:()=>wt,getLitEventName:()=>Xe,getOffset:()=>dt,getStableElementId:()=>Ct,getStyle:()=>st,handleRef:()=>le,hasClass:()=>ot,holeContent:()=>Ot,holeEnd:()=>$t,holeScope:()=>It,hydrate:()=>Y,hydrateAdvancePast:()=>Ae,hydrateIslands:()=>Fe,initializeIntegration:()=>Qt,insert:()=>A,insertExpression:()=>P,intergartionInitialized:()=>tn,isAccessor:()=>zt,isCustomElement:()=>ye,isDOMNode:()=>Nt,isDelegatedEvent:()=>Pt,isDomElement:()=>H,isDomNode:()=>v,isDomText:()=>j,isEventHandler:()=>Je,isFunction:()=>Mt,isIntegrationInitialized:()=>nn,isJSXTemplate:()=>bt,isLitTemplateResult:()=>ge,isNativeElement:()=>Gt,isPromise:()=>L,isReactElement:()=>ht,isSVGElement:()=>Jt,isServer:()=>E,isTemplateFactory:()=>Et,isVisible:()=>lt,iterateFn:()=>Dt,makeArrayFlat:()=>_e,mergeProps:()=>Wt,observeIntersection:()=>mt,observeResize:()=>gt,query:()=>ee,queryAll:()=>Ze,registerCreateComponent:()=>Zt,registerGlobal:()=>Tt,removeAttribute:()=>it,removeChildren:()=>ft,removeClass:()=>tt,removeDelegatedEventListener:()=>re,render:()=>ce,resetIntegration:()=>on,runHydrationAt:()=>R,runWithoutHydration:()=>Ce,scrollIntoView:()=>ct,setAttribute:()=>x,setClassList:()=>I,setClassName:()=>_,setDynamicAttribute:()=>W,setDynamicBoolAttribute:()=>ue,setDynamicProperty:()=>K,setProperty:()=>M,setServerMode:()=>Te,setStyle:()=>$,setStyles:()=>me,shouldSetAsProperty:()=>ze,splitProps:()=>Kt,spread:()=>qt,templateNode:()=>_t,toAttributeName:()=>Ge,toggleClass:()=>nt,waitForElement:()=>yt});module.exports=Be(mn);function Ge(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function Je(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function Xe(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function ze(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),o={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)||o[e]&&o[e].has(t)}var Ue=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ye=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),O="http://www.w3.org/2000/svg";function ye(e){return e.localName.includes("-")}function k(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(ye(e)){e[t]=n;return}x(e,t,n,o)}var D=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function ee(e,t=document){return t.querySelector(e)}function Ze(e,t=document){return Array.from(t.querySelectorAll(e))}function Qe(e,t){return e.closest(t)}function et(e,...t){e.classList.add(...t)}function tt(e,...t){e.classList.remove(...t)}function nt(e,...t){t.forEach(n=>e.classList.toggle(n))}function ot(e,t){return e.classList.contains(t)}function x(e,t,n,o=!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 rt(e,t){return e.getAttribute(t)}function it(e,t){e.removeAttribute(t)}function me(e,t){Object.assign(e.style,t)}function st(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function at(e,t={},...n){let o=document.createElement(e);return Object.entries(t).forEach(([r,f])=>{if(r==="class"||r==="className")o.className=f;else if(r==="style"&&typeof f=="object")me(o,f);else if(r.startsWith("on")&&typeof f=="function"){let s=r.slice(2).toLowerCase();o.addEventListener(s,f)}else x(o,r,f)}),n.forEach(r=>{typeof r=="string"?o.appendChild(document.createTextNode(r)):o.appendChild(r)}),o}function ft(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function ut(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function lt(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function ct(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function dt(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function pt(e,t,n,o){let r=f=>{let s=f.target.closest(n);s&&e.contains(s)&&o(f,s)};return e.addEventListener(t,r),()=>{e.removeEventListener(t,r)}}function yt(e,t=5e3){return new Promise((n,o)=>{let r=ee(e);if(r){n(r);return}let f=new MutationObserver(()=>{let i=ee(e);i&&(f.disconnect(),clearTimeout(s),n(i))});f.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{f.disconnect(),o(new Error(`Element ${e} not found within ${t}ms`))},t)})}function mt(e,t,n={}){let o=new IntersectionObserver(r=>{r.forEach(f=>{t(f.isIntersecting)})},n);return o.observe(e),()=>{o.disconnect()}}function gt(e,t){let n=new ResizeObserver(o=>{o.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var xt=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function ht(e){return typeof e=="object"&&e!==null&&e.$$typeof===xt}function ge(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Et(e){if(typeof e!="function")return!1;try{let t=e();return ge(t)}catch{return!1}}function bt(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Nt(e){return e instanceof Node}function Tt(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function wt(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}var m=require("@fluixi/reactive/signal");var xe="1.0.0-alpha.78";var he=require("@fluixi/reactive/version"),h={dom:xe,reactive:he.VERSION};function Ee(e){h.core&&e.setAttribute("fluixi",h.core),e.setAttribute("fx-dom",h.dom),e.setAttribute("fx-reactive",h.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=h)}function be(){let e=[h.core,h.dom,h.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${h.core??"(absent)"}, dom ${h.dom}, reactive ${h.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 b(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var c=require("@fluixi/reactive/signal");var E=typeof document>"u";function Te(e){E=e}var te=Symbol.for("fluixi.server-node"),Ne=null;function F(){if(!Ne)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return Ne}function v(e){return e!=null&&e[te]===!0?!0:typeof Node<"u"&&e instanceof Node}function H(e){return e!=null&&e[te]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function j(e){return e!=null&&e[te]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var l={active:!1,cursor:null,parents:[]},we=null;function Se(e){we=e}function q(){return we}function ne(e,t){return l.active&&t.parentNode===e}function oe(e){let t=l.parents.lastIndexOf(e);t!==-1&&(l.parents.length=t),l.cursor=e.nextSibling}function ve(){return l.active?l.cursor:null}function R(e,t){if(!e||e.parentNode==null)return t();let n=l.active,o=l.cursor,r=l.parents;l.active=!0,l.cursor=e,l.parents=[];try{return t()}finally{l.active=n,l.cursor=o,l.parents=r}}function Ce(e){if(!l.active)return e();let t=l.cursor,n=l.parents;l.active=!1,l.parents=[];try{return e()}finally{l.active=!0,l.cursor=t,l.parents=n}}function Ae(e){if(!l.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&oe(t)}function St(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 o=0,r=e;for(;r=r.previousElementSibling;)r.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function vt(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 Ct(e){return vt(St(e))}var At=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Rt={};var Re=new Map,V=new Set,B=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function ie(e){if(!E)for(let t of e)V.has(t)||B.has(t)||(V.add(t),document.addEventListener(t,Lt))}function Lt(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let o=n[t];if(o&&!n.disabled&&(o(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function Le(e,t,n){if(e[`$$${t}`]=n,B.has(t)){let o=`__fx_${t}`;if(!e[o]){let r=f=>{e[`$$${t}`]?.(f)};e.addEventListener(t,r),e[o]=r}return}V.has(t)||ie([t])}function re(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function Pt(e){return!B.has(e)}function Mt(e){return typeof e=="function"}function S(e,t=!1){if(E)return F().createText(e);if(l.active&&!t){let n=q()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function se(e,t=!1){if(E)return F().createElement(e,t);if(l.active){let n=q()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(O,e):document.createElement(e)}function Pe(e,t=!1){let n=Re.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,Re.set(e,o),o}function _t(e,t,n=!1,o=!1){if(E){let r=F();return n?r.parseTemplate(e,o):r.createRaw(e)}if(l.active){let r=q()?.hydrateStatic(t);if(r)return r}return Me(Pe(e,o),o).firstChild}function It(e,t){if(!l.active)return t();let n=R(e.nextSibling,t);if(typeof n=="function"){let o=n;return((...r)=>l.active?R(e.nextSibling,()=>o(...r)):o(...r))}return n}function $t(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 Ot(e,t){let n=[];for(let o=e.nextSibling;o&&o!==t;o=o.nextSibling)n.push(o);return n}function Me(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function _e(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?_e(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function kt(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Dt(e){if((0,m.isSignal)(e)||b(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,m.isSignal)(t)&&!b(t);)t=t();return t}var T=0,Ft=200;function Ht(e,t,n,o,r){let f=o,s=new Map;return(0,c.createRenderEffect)(()=>{let i;if(b(e)&&!(0,m.isSignal)(e)){if(!s.has(e)){T++;try{let a=e();s.set(e,a)}finally{T--}}for(i=s.get(e);typeof i=="function"&&(0,m.isSignal)(i);)i=i()}else for(i=e();typeof i=="function"&&(0,m.isSignal)(i);)i=i();{let a=0;for(;typeof i=="function"&&a++<50;)if(b(i)){if(!s.has(i)){let u=i;T++;try{let d=u();s.set(u,d)}finally{T--}}i=s.get(i)}else if((0,m.isSignal)(i))i=i();else if(i=i(),typeof i!="function"||!(0,m.isSignal)(i)&&!b(i))break}T++;try{f=P(t,i,n,f,s),r(f)}finally{T--}})}function A(e,t,n,o){if(T>Ft)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=S("",!0),e.appendChild(n));let r=o??null,f=a=>Array.isArray(a)&&a.some(u=>typeof u=="function"),s=a=>typeof a=="function"?a:()=>a;if(typeof t!="function"&&!f(t)){T++;try{r=P(e,t,n,r)}finally{T--}return()=>r}let i=Ht(s(t),e,n,r,a=>{r=a});return()=>(i?.(),r)}function P(e,t,n,o,r){if(t==null||typeof t=="boolean")return w(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return w(e,o,n);if(L(t)){let s=S("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(s,o[0]),w(e,o.slice(1),n)):g(e,s,n):o?e.replaceChild(s,o):g(e,s,n),t.then(i=>{s.parentNode===e&&P(e,i,s.nextSibling,s)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),s}let f=typeof t;if(f==="string"||f==="number"){if(f==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let i=S(t);return g(e,i,n),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=w(e,o,n)}if(o&&j(o))return o.data=t,o;let s=S(t);return o&&o.parentNode===e?e.replaceChild(s,o):ne(e,s)||g(e,s,n),s}if(v(t))return ne(e,t)?(oe(t),t):Array.isArray(o)?(o.length===0?g(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),w(e,o.slice(1),n)):g(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):g(e,t,n)):g(e,t,n),t);if(Array.isArray(t)){let s=[],i=Array.isArray(o)?o:o?[o]:[],a=[];N(t,s,e,n,!0,r,a);let u=jt(e,i,s,n);for(let d of a){let p=A(e,d.sig,d.marker);(0,c.onCleanup)(()=>{w(e,p()),d.marker.parentNode===e&&e.removeChild(d.marker)})}return u}if(f==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let i=s;if(typeof i.type=="function"){let a=i.type(i.props||{});return P(e,a,n,o)}}}return w(e,o,n)}function N(e,t,n,o,r=!0,f,s){for(let i=0;i<e.length;i++){let a=e[i];if(!(a==null||typeof a=="boolean")){for(;typeof a=="function"&&!L(a)&&!(0,m.isSignal)(a)&&!b(a)&&(a=a(),!(a==null||typeof a=="boolean")););if(!(a==null||typeof a=="boolean")){if(typeof a=="function"){let u;for(b(a)&&!(0,m.isSignal)(a)?(f||(f=new Map),f.has(a)||f.set(a,a()),u=f.get(a)):u=a();typeof u=="function"&&!L(u)&&!(0,m.isSignal)(u)&&!b(u);)f||(f=new Map),f.has(u)||f.set(u,u()),u=f.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if((0,m.isSignal)(u)){if(s){let p=S("",!0);t.push(p),s.push({marker:p,sig:u});continue}let d=u();for(;typeof d=="function"&&(0,m.isSignal)(d);)d=d();if(d==null||typeof d=="boolean")continue;Array.isArray(d)?N(d,t,n,o,r,f):N([d],t,n,o,r,f);continue}continue}Array.isArray(u)?N(u,t,n,o,r,f,s):N([u],t,n,o,r,f,s);continue}if(L(a)){let u=S("",!0);t.push(u),a.then(d=>{if(u.parentNode){let p=[];if(N([d],p,u.parentNode,void 0,!1,f),p.length>0){u.parentNode.replaceChild(p[0],u);for(let y=1;y<p.length;y++)u.parentNode?.insertBefore(p[y],p[y-1].nextSibling)}}}).catch(d=>console.error("Error resolving promise in array:",d));continue}if(Array.isArray(a)){N(a,t,n,o,r,f,s);continue}if(v(a)){t.push(a);continue}if(typeof a=="object"&&a!==null&&"type"in a&&"props"in a){let u=a;if(typeof u.type=="function"){let d=u.type(u.props||{});Array.isArray(d)?N(d,t,n,o,!1,f):N([d],t,n,o,!1,f);continue}}if(typeof a=="string"||typeof a=="number"){let u=String(a);if(u.trim()===""&&u!==" ")continue;t.push(S(u));continue}t.push(S(String(a)))}}}}function jt(e,t,n,o){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 r=n.length,f=t.length,s=r,i=0,a=0,u=f>0?t[f-1].nextSibling??void 0:o,d=null;for(;i<f||a<s;){if(t[i]===n[a]){i++,a++;continue}for(;f>i&&s>a&&t[f-1]===n[s-1];)f--,s--;if(f===i){let p=s<r?a?n[a-1].nextSibling??void 0:n[s-a]:u;for(;a<s;)g(e,n[a++],p)}else if(s===a)for(;i<f;)(!d||!d.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[s-1]&&n[a]===t[f-1]){let p=t[--f].nextSibling;g(e,n[a++],t[i++].nextSibling),g(e,n[--s],p),t[f]=t[i-1]}else{if(!d){d=new Map;let y=a;for(;y<s;)d.set(n[y],y++)}let p=d.get(t[i]);if(p!=null)if(a<p&&p<s){let y=i,Z=1;for(;++y<f&&y<s&&!(!d.has(t[y])||d.get(t[y])!==p+Z);)Z++;if(Z>p-a){let He=t[i];for(;a<p;)g(e,n[a++],He)}else t[i].parentNode===e?e.replaceChild(n[a++],t[i++]):(g(e,n[a++],u),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return n}function w(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function g(e,t,n){l.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function M(e,t,n){n==null?delete e[t]:e[t]=n}function ae(e,t,n){let o=n,r;return Array.isArray(n)&&(o=n[0],r=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,r),()=>e.removeEventListener(t,o,r))}function fe(e,t){let n=(o,r)=>{typeof o=="function"&&o(e,r??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function W(e,t,n,o=!1){return typeof n!="function"?(x(e,t,n,o),()=>{}):(0,c.createRenderEffect)(()=>{let r=typeof n=="function"?n():n;x(e,t,r,o)})}function K(e,t,n){return typeof n!="function"?(M(e,t,n),()=>{}):(0,c.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;M(e,t,o)})}function ue(e,t,n){return typeof n!="function"?(x(e,t,!!n),()=>{}):(0,c.createRenderEffect)(()=>{let o=n();x(e,t,!!o)})}function _(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,c.createRenderEffect)(()=>_(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(o=>{let r=t[o];return typeof r=="function"?r():!!r}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function I(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let r=t[o],f=o.split(/\s+/).filter(Boolean);if(typeof r=="function"&&n)n.push((0,c.createRenderEffect)(()=>{let s=!!r();for(let i of f)e.classList.toggle(i,s)}));else{let s=!!(typeof r=="function"?r():r);for(let i of f)e.classList.toggle(i,s)}}}function $(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 o in n){let r=n[o];r==null?e.style[o]="":e.style[o]=r}}function qt(e){let{element:t,props:n,prevProps:o=Rt,isSVG:r=!1,skipChildren:f=!1}=e;if(!t||!H(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=r||t.namespaceURI===O,i=[];for(let a in n){if(f&&a==="children")continue;let u=n[a],d=o[a];if(u===d)continue;if(a==="ref"){le(u,t);continue}if(a==="use"){fe(t,u);continue}if(a.startsWith("on:")){i.push(ae(t,a.slice(3),u));continue}if(a.startsWith("prop:")){i.push(K(t,a.slice(5),u));continue}if(a.startsWith("attr:")){i.push(W(t,a.slice(5),u,s));continue}if(a.startsWith("bool:")){i.push(ue(t,a.slice(5),u));continue}if(a==="class"||a==="className"){typeof u=="function"?i.push((0,c.createRenderEffect)(()=>_(t,u()))):_(t,u);continue}if(a==="classList"){typeof u=="function"?i.push((0,c.createRenderEffect)(()=>I(t,u()))):I(t,u,i);continue}if(a==="style"){typeof u=="function"?i.push((0,c.createRenderEffect)(()=>$(t,u()))):$(t,u);continue}if(a.startsWith("on")){let y=a.slice(2).toLowerCase();d&&re(t,y),u&&Le(t,y,u);continue}let p=D.has(a)||!s&&a in t;typeof u=="function"?i.push(p?K(t,a,u):W(t,a,u,s)):i.push((0,c.createRenderEffect)(()=>p?M(t,a,n[a]):x(t,a,n[a],s)))}for(let a in o)if(!(a in n))if(a.startsWith("on")){let u=a.slice(2).toLowerCase();re(t,u)}else D.has(a)?M(t,a,null):t.removeAttribute(a);return()=>{i.forEach(a=>a())}}function Vt(e,t,n=!1){for(let o in t){let r=t[o];if(o==="ref"){le(r,e);continue}if(o!=="children"){if(o==="use"){fe(e,r);continue}if(o.startsWith("on:")){ae(e,o.slice(3),r);continue}if(o.startsWith("prop:")){K(e,o.slice(5),r);continue}if(o.startsWith("attr:")){W(e,o.slice(5),r,n);continue}if(o.startsWith("bool:")){ue(e,o.slice(5),r);continue}if(o.startsWith("on")&&o.length>2){let f=o.slice(2).toLowerCase();if(typeof r=="function")if(B.has(f)){e[`$$${f}`]=r;let s=`__fx_${f}`;if(!e[s]){let i=a=>{e[`$$${f}`]?.(a)};e.addEventListener(f,i),e[s]=i}}else e[`$$${f}`]=r,V.has(f)||ie([f]);continue}if(o==="class"||o==="className"){_(e,r);continue}if(o==="classList"){typeof r=="function"?(0,c.createRenderEffect)(()=>I(e,r())):I(e,r);continue}if(o==="style"){typeof r=="function"?(0,c.createRenderEffect)(()=>$(e,r())):$(e,r);continue}if(o==="innerHTML"){if(typeof r=="function"){let f=(0,c.createEffect)(()=>{let s=r();for(;typeof s=="function";)s=s();e.innerHTML=s});(0,c.onCleanup)(()=>f())}else e.innerHTML=r;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof r=="function"){let f=(0,c.createEffect)(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});(0,c.onCleanup)(()=>{f()})}else(0,c.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof r=="function"){let f=(0,c.createEffect)(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});(0,c.onCleanup)(()=>{f()})}else(0,c.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof r=="function"){let f=!0,s=(0,c.createEffect)(()=>{let i=r();for(;typeof i=="function"&&i.length===0;)i=i();f?(f=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});(0,c.onCleanup)(()=>{s()})}else{let f=!0;(0,c.createRenderEffect)(()=>{let s=t[o];f?(f=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof r=="function"){let f=(0,c.createEffect)(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();k(e,o,s,n)});(0,c.onCleanup)(()=>{f()})}else(0,c.createRenderEffect)(()=>k(e,o,t[o],n))}}}function Wt(...e){let t=o=>{for(let r=e.length-1;r>=0;r--){let f=e[r];if(f&&o in f&&f[o]!==void 0)return f[o]}},n=o=>{for(let r of e)if(r&&o in r)return!0;return!1};return new Proxy({},{get:(o,r)=>t(r),has:(o,r)=>n(r),ownKeys:()=>{let o=new Set;for(let r of e)if(r)for(let f of Reflect.ownKeys(r))o.add(f);return[...o]},getOwnPropertyDescriptor:(o,r)=>n(r)?{enumerable:!0,configurable:!0,get:()=>t(r)}:void 0})}function Kt(e,...t){let n=new Set;for(let s of t)for(let i of s)n.add(i);let o=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),r=t.map(s=>{let i=new Set(s);return new Proxy({},{get:(a,u)=>i.has(u)?e[u]:void 0,has:(a,u)=>i.has(u)&&u in e,ownKeys:()=>Array.from(i).filter(a=>a in e),getOwnPropertyDescriptor:(a,u)=>i.has(u)&&u in e?o(u):void 0})}),f=new Proxy({},{get:(s,i)=>n.has(i)?void 0:e[i],has:(s,i)=>!n.has(i)&&i in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,i)=>!n.has(i)&&i in e?o(i):void 0});return[...r,f]}function le(e,t){if(e){if(v(e)){let n=t,o=e;if(!n)return;typeof n=="function"?n(o):typeof n=="object"&&"current"in n&&(n.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function Bt(e,t,n){let o=t||document.body,r=(0,c.readChildren)(()=>e),f=[];return(0,c.batch)(()=>{let s=(0,c.createRenderEffect)(()=>{let i=r();Array.isArray(i)?(i.forEach(a=>o.appendChild(a)),f.push(()=>{i.forEach(a=>{a.parentNode===o&&o.removeChild(a)})})):v(i)&&(o.appendChild(i),f.push(()=>{i.parentNode===o&&o.removeChild(i)}))});f.push(s),(0,c.onCleanup)(()=>{f.forEach(i=>i())})}),null}function Gt(e){return typeof e=="string"&&e.toLowerCase()===e}function Jt(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 Xt(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function L(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function zt(e){return typeof e=="function"&&e.length===0&&(0,m.isSignal)(e)}function ce(e,t,n){if(!t)throw new Error("Container element is required");let o,r,f=[];return(0,c.createRoot)(s=>{(0,c.batch)(()=>{l.active||(t.textContent=""),Ee(t),be(),A(t,e)}),r=s}),()=>{r?.(),o?.(),f.forEach(s=>s()),t.textContent=""}}function Ut(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 Yt="__fx_dom_create_component__",C=globalThis[Yt]??={fn:null};function Zt(e){C.fn=e}function Qt(e={}){let t=e.signalSystem?.createComponent;t&&(C.fn=t)}function en(e,t){return C.fn?C.fn(e,t):(()=>e(t))}var tn=()=>C.fn!==null,nn=()=>C.fn!==null;function on(){C.fn=null}var G,rn={getStore:()=>G,run(e,t){let n=G;G=e;try{return t()}finally{G=n}}},sn=rn;function Ie(){return sn.getStore()}var J=require("@fluixi/reactive/signal");var an="__FX_DATA__";var de;function $e(){let e=globalThis.__FX_DATA__;if(e)return e;if(de!==void 0)return de;let t=null;if(typeof document<"u"){let n=document.getElementById(an)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return de=t}function X(){for(;;){for(;l.cursor&&l.cursor.nodeType===3&&l.cursor.data==="";)l.cursor=l.cursor.nextSibling;if(l.cursor!=null||!l.parents.length)return;l.cursor=l.parents.pop().nextSibling}}var fn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),z=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 un(e){X();let t=l.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(fn.has(e.toLowerCase())?l.cursor=t.nextSibling:(l.parents.push(t),l.cursor=t.firstChild),t):(z&&t&&U(`<${e}>`,t),null)}function ln(e){X();let t=l.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(l.cursor=t.nextSibling,t):(z&&t&&U(`<${e}> (static)`,t),null)}function cn(e){if(e===""){let n=l.cursor;return n&&n.nodeType===3&&n.data!==""?(l.cursor=n.nextSibling,n.data="",n):null}X();let t=l.cursor;return t&&t.nodeType===3?(l.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(z&&t&&U(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function dn(e){X();let t=l.cursor;return t&&t.nodeType===8&&t.data===e?(l.cursor=t.nextSibling,t):(z&&t&&U(`marker <!--${e.slice(0,24)}-->`,t),null)}var Oe=!1;function pn(){Oe||(Oe=!0,Se({hydrateElement:un,hydrateText:cn,hydrateMarker:dn,hydrateStatic:ln}))}function Y(e,t,n){pn(),l.active=!0,l.cursor=t.firstChild,l.parents=[];let o=$e(),r=n?.resourceNamespace,f=0;(0,J.setResourceIdSource)(()=>r?`${r}:r${f++}`:`r${f++}`),(0,J.setServerDataGetter)(o?s=>s in o?{value:o[s]}:void 0:null);try{return ce(e,t)}finally{l.active=!1,l.cursor=null,l.parents=[]}}var pe="fluixi-island";function De(e){let{component:t,props:n={},name:o}=e,r=se(pe),f=o??t.name??"Island";x(r,"name",f),x(r,"props",JSON.stringify(n??{}));let s=E?Ie():void 0;if(s){let i=s.nextIslandNamespace(f);A(r,()=>s.withResourceScope(i,()=>t(n)))}else A(r,()=>t(n));return r}var ke=!1;function yn(){if(ke||typeof document>"u")return;ke=!0;let e=document.createElement("style");e.textContent=`${pe}{display:contents}`,document.head.appendChild(e)}function Fe(e){if(typeof document>"u")return;yn();let t=document.querySelectorAll(pe),n=new Map;t.forEach(o=>{let r=o.getAttribute("name")??"",f=n.get(r)??0;n.set(r,f+1);let s=e[r];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${r}" has no component in the registry — left static.`);return}let i={};try{i=JSON.parse(o.getAttribute("props")||"{}")}catch{}Y(()=>s(i),o,{resourceNamespace:`${r}#${f}`})})}
1
+ "use strict";var ee=Object.defineProperty;var Ve=Object.getOwnPropertyDescriptor;var We=Object.getOwnPropertyNames;var Ke=Object.prototype.hasOwnProperty;var Be=(e,t)=>{for(var n in t)ee(e,n,{get:t[n],enumerable:!0})},Ge=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of We(t))!Ke.call(e,r)&&r!==n&&ee(e,r,{get:()=>t[r],enumerable:!(o=Ve(t,r))||o.enumerable});return e};var Je=e=>Ge(ee({},"__esModule",{value:!0}),e);var xn={};Be(xn,{Island:()=>He,JSX_PROPERTIES:()=>D,SVG_ELEMENTS:()=>Qe,SVG_NAMESPACE:()=>O,VOID_ELEMENTS:()=>Ze,addClass:()=>nt,addDelegatedEventListener:()=>Me,addNativeEventListener:()=>fe,appendChildren:()=>ct,applyElementProp:()=>k,applyProps:()=>Kt,applyUse:()=>ue,bindPair:()=>Zt,captureHydrationCursor:()=>Ae,cleanChildren:()=>w,cloneTemplate:()=>$e,closest:()=>tt,createComponent:()=>nn,createElement:()=>ut,createNativeElement:()=>ae,createPortal:()=>Jt,createTemplate:()=>_e,delegate:()=>mt,delegateEvents:()=>se,escapeHTML:()=>Ut,fnName:()=>Ft,generateID:()=>Lt,getAttribute:()=>st,getGlobal:()=>vt,getLitEventName:()=>Ue,getOffset:()=>yt,getStableElementId:()=>Rt,getStyle:()=>ft,handleRef:()=>ce,hasClass:()=>it,holeContent:()=>Dt,holeEnd:()=>kt,holeScope:()=>Ot,hydrate:()=>Z,hydrateAdvancePast:()=>Le,hydrateIslands:()=>je,initializeIntegration:()=>tn,insert:()=>A,insertExpression:()=>P,intergartionInitialized:()=>on,isAccessor:()=>Yt,isCustomElement:()=>me,isDOMNode:()=>wt,isDelegatedEvent:()=>_t,isDomElement:()=>H,isDomNode:()=>v,isDomText:()=>j,isEventHandler:()=>ze,isFunction:()=>$t,isIntegrationInitialized:()=>rn,isJSXTemplate:()=>Tt,isLitTemplateResult:()=>xe,isNativeElement:()=>Xt,isPromise:()=>L,isReactElement:()=>bt,isSVGElement:()=>zt,isServer:()=>E,isTemplateFactory:()=>Nt,isVisible:()=>dt,iterateFn:()=>Ht,makeArrayFlat:()=>Ie,mergeProps:()=>Bt,observeIntersection:()=>xt,observeResize:()=>ht,query:()=>te,queryAll:()=>et,registerCreateComponent:()=>en,registerGlobal:()=>St,removeAttribute:()=>at,removeChildren:()=>lt,removeClass:()=>ot,removeDelegatedEventListener:()=>ie,render:()=>de,resetIntegration:()=>sn,runHydrationAt:()=>R,runWithoutHydration:()=>Re,scrollIntoView:()=>pt,setAttribute:()=>x,setClassList:()=>$,setClassName:()=>_,setDynamicAttribute:()=>W,setDynamicBoolAttribute:()=>le,setDynamicProperty:()=>K,setProperty:()=>M,setServerMode:()=>Se,setStyle:()=>I,setStyles:()=>ge,shouldSetAsProperty:()=>Ye,splitProps:()=>Gt,spread:()=>Wt,templateNode:()=>It,toAttributeName:()=>Xe,toggleClass:()=>rt,waitForElement:()=>gt});module.exports=Je(xn);function Xe(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function ze(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function Ue(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function Ye(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),o={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)||o[e]&&o[e].has(t)}var Ze=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Qe=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),O="http://www.w3.org/2000/svg";function me(e){return e.localName.includes("-")}function k(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(me(e)){e[t]=n;return}x(e,t,n,o)}var D=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function te(e,t=document){return t.querySelector(e)}function et(e,t=document){return Array.from(t.querySelectorAll(e))}function tt(e,t){return e.closest(t)}function nt(e,...t){e.classList.add(...t)}function ot(e,...t){e.classList.remove(...t)}function rt(e,...t){t.forEach(n=>e.classList.toggle(n))}function it(e,t){return e.classList.contains(t)}function x(e,t,n,o=!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 st(e,t){return e.getAttribute(t)}function at(e,t){e.removeAttribute(t)}function ge(e,t){Object.assign(e.style,t)}function ft(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function ut(e,t={},...n){let o=document.createElement(e);return Object.entries(t).forEach(([r,f])=>{if(r==="class"||r==="className")o.className=f;else if(r==="style"&&typeof f=="object")ge(o,f);else if(r.startsWith("on")&&typeof f=="function"){let s=r.slice(2).toLowerCase();o.addEventListener(s,f)}else x(o,r,f)}),n.forEach(r=>{typeof r=="string"?o.appendChild(document.createTextNode(r)):o.appendChild(r)}),o}function lt(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function ct(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function dt(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function pt(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function yt(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function mt(e,t,n,o){let r=f=>{let s=f.target.closest(n);s&&e.contains(s)&&o(f,s)};return e.addEventListener(t,r),()=>{e.removeEventListener(t,r)}}function gt(e,t=5e3){return new Promise((n,o)=>{let r=te(e);if(r){n(r);return}let f=new MutationObserver(()=>{let i=te(e);i&&(f.disconnect(),clearTimeout(s),n(i))});f.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{f.disconnect(),o(new Error(`Element ${e} not found within ${t}ms`))},t)})}function xt(e,t,n={}){let o=new IntersectionObserver(r=>{r.forEach(f=>{t(f.isIntersecting)})},n);return o.observe(e),()=>{o.disconnect()}}function ht(e,t){let n=new ResizeObserver(o=>{o.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Et=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function bt(e){return typeof e=="object"&&e!==null&&e.$$typeof===Et}function xe(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Nt(e){if(typeof e!="function")return!1;try{let t=e();return xe(t)}catch{return!1}}function Tt(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function wt(e){return e instanceof Node}function St(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function vt(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}var m=require("@fluixi/reactive/signal");var he="1.0.0-alpha.80";var Ee=require("@fluixi/reactive/version"),h={dom:he,reactive:Ee.VERSION};function be(e){h.core&&e.setAttribute("fluixi",h.core),e.setAttribute("fx-dom",h.dom),e.setAttribute("fx-reactive",h.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=h)}function Ne(){let e=[h.core,h.dom,h.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${h.core??"(absent)"}, dom ${h.dom}, reactive ${h.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 Te(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function b(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var c=require("@fluixi/reactive/signal");var E=typeof document>"u";function Se(e){E=e}var ne=Symbol.for("fluixi.server-node"),we=null;function F(){if(!we)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return we}function v(e){return e!=null&&e[ne]===!0?!0:typeof Node<"u"&&e instanceof Node}function H(e){return e!=null&&e[ne]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function j(e){return e!=null&&e[ne]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var l={active:!1,cursor:null,parents:[]},ve=null;function Ce(e){ve=e}function q(){return ve}function oe(e,t){return l.active&&t.parentNode===e}function re(e){let t=l.parents.lastIndexOf(e);t!==-1&&(l.parents.length=t),l.cursor=e.nextSibling}function Ae(){return l.active?l.cursor:null}function R(e,t){if(!e||e.parentNode==null)return t();let n=l.active,o=l.cursor,r=l.parents;l.active=!0,l.cursor=e,l.parents=[];try{return t()}finally{l.active=n,l.cursor=o,l.parents=r}}function Re(e){if(!l.active)return e();let t=l.cursor,n=l.parents;l.active=!1,l.parents=[];try{return e()}finally{l.active=!0,l.cursor=t,l.parents=n}}function Le(e){if(!l.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&re(t)}function Ct(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 o=0,r=e;for(;r=r.previousElementSibling;)r.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function At(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 Rt(e){return At(Ct(e))}var Lt=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Pt={};var Pe=new Map,V=new Set,B=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function se(e){if(!E)for(let t of e)V.has(t)||B.has(t)||(V.add(t),document.addEventListener(t,Mt))}function Mt(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let o=n[t];if(o&&!n.disabled&&(o(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function Me(e,t,n){if(e[`$$${t}`]=n,B.has(t)){let o=`__fx_${t}`;if(!e[o]){let r=f=>{e[`$$${t}`]?.(f)};e.addEventListener(t,r),e[o]=r}return}V.has(t)||se([t])}function ie(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function _t(e){return!B.has(e)}function $t(e){return typeof e=="function"}function S(e,t=!1){if(E)return F().createText(e);if(l.active&&!t){let n=q()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function ae(e,t=!1){if(E)return F().createElement(e,t);if(l.active){let n=q()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(O,e):document.createElement(e)}function _e(e,t=!1){let n=Pe.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,Pe.set(e,o),o}function It(e,t,n=!1,o=!1){if(E){let r=F();return n?r.parseTemplate(e,o):r.createRaw(e)}if(l.active){let r=q()?.hydrateStatic(t);if(r)return r}return $e(_e(e,o),o).firstChild}function Ot(e,t){if(!l.active)return t();let n=R(e.nextSibling,t);if(typeof n=="function"){let o=n;return((...r)=>l.active?R(e.nextSibling,()=>o(...r)):o(...r))}return n}function kt(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 Dt(e,t){let n=[];for(let o=e.nextSibling;o&&o!==t;o=o.nextSibling)n.push(o);return n}function $e(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function Ie(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Ie(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Ft(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Ht(e){if((0,m.isSignal)(e)||b(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,m.isSignal)(t)&&!b(t);)t=t();return t}var T=0,jt=200;function qt(e,t,n,o,r){let f=o,s=new Map;return(0,c.createRenderEffect)(()=>{let i;if(b(e)&&!(0,m.isSignal)(e)){if(!s.has(e)){T++;try{let a=e();s.set(e,a)}finally{T--}}for(i=s.get(e);typeof i=="function"&&(0,m.isSignal)(i);)i=i()}else for(i=e();typeof i=="function"&&(0,m.isSignal)(i);)i=i();{let a=0;for(;typeof i=="function"&&a++<50;)if(b(i)){if(!s.has(i)){let u=i;T++;try{let d=u();s.set(u,d)}finally{T--}}i=s.get(i)}else if((0,m.isSignal)(i))i=i();else if(i=i(),typeof i!="function"||!(0,m.isSignal)(i)&&!b(i))break}T++;try{f=P(t,i,n,f,s),r(f)}finally{T--}})}function A(e,t,n,o){if(T>jt)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=S("",!0),e.appendChild(n));let r=o??null,f=a=>Array.isArray(a)&&a.some(u=>typeof u=="function"),s=a=>typeof a=="function"?a:()=>a;if(typeof t!="function"&&!f(t)){T++;try{r=P(e,t,n,r)}finally{T--}return()=>r}let i=qt(s(t),e,n,r,a=>{r=a});return()=>(i?.(),r)}function P(e,t,n,o,r){if(t==null||typeof t=="boolean")return w(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return w(e,o,n);if(L(t)){let s=S("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(s,o[0]),w(e,o.slice(1),n)):g(e,s,n):o?e.replaceChild(s,o):g(e,s,n),t.then(i=>{s.parentNode===e&&P(e,i,s.nextSibling,s)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),s}let f=typeof t;if(f==="string"||f==="number"){if(f==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let i=S(t);return g(e,i,n),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=w(e,o,n)}if(o&&j(o))return o.data=t,o;let s=S(t);return o&&o.parentNode===e?e.replaceChild(s,o):oe(e,s)||g(e,s,n),s}if(v(t))return oe(e,t)?(re(t),t):Array.isArray(o)?(o.length===0?g(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),w(e,o.slice(1),n)):g(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):g(e,t,n)):g(e,t,n),t);if(Array.isArray(t)){let s=[],i=Array.isArray(o)?o:o?[o]:[],a=[];N(t,s,e,n,!0,r,a);let u=Vt(e,i,s,n);for(let d of a){let p=A(e,d.sig,d.marker);(0,c.onCleanup)(()=>{w(e,p()),d.marker.parentNode===e&&e.removeChild(d.marker)})}return u}if(f==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let i=s;if(typeof i.type=="function"){let a=i.type(i.props||{});return P(e,a,n,o)}}}return w(e,o,n)}function N(e,t,n,o,r=!0,f,s){for(let i=0;i<e.length;i++){let a=e[i];if(!(a==null||typeof a=="boolean")){for(;typeof a=="function"&&!L(a)&&!(0,m.isSignal)(a)&&!b(a)&&(a=a(),!(a==null||typeof a=="boolean")););if(!(a==null||typeof a=="boolean")){if(typeof a=="function"){let u;for(b(a)&&!(0,m.isSignal)(a)?(f||(f=new Map),f.has(a)||f.set(a,a()),u=f.get(a)):u=a();typeof u=="function"&&!L(u)&&!(0,m.isSignal)(u)&&!b(u);)f||(f=new Map),f.has(u)||f.set(u,u()),u=f.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if((0,m.isSignal)(u)){if(s){let p=S("",!0);t.push(p),s.push({marker:p,sig:u});continue}let d=u();for(;typeof d=="function"&&(0,m.isSignal)(d);)d=d();if(d==null||typeof d=="boolean")continue;Array.isArray(d)?N(d,t,n,o,r,f):N([d],t,n,o,r,f);continue}continue}Array.isArray(u)?N(u,t,n,o,r,f,s):N([u],t,n,o,r,f,s);continue}if(L(a)){let u=S("",!0);t.push(u),a.then(d=>{if(u.parentNode){let p=[];if(N([d],p,u.parentNode,void 0,!1,f),p.length>0){u.parentNode.replaceChild(p[0],u);for(let y=1;y<p.length;y++)u.parentNode?.insertBefore(p[y],p[y-1].nextSibling)}}}).catch(d=>console.error("Error resolving promise in array:",d));continue}if(Array.isArray(a)){N(a,t,n,o,r,f,s);continue}if(v(a)){t.push(a);continue}if(typeof a=="object"&&a!==null&&"type"in a&&"props"in a){let u=a;if(typeof u.type=="function"){let d=u.type(u.props||{});Array.isArray(d)?N(d,t,n,o,!1,f):N([d],t,n,o,!1,f);continue}}if(typeof a=="string"||typeof a=="number"){let u=String(a);if(u.trim()===""&&u!==" ")continue;t.push(S(u));continue}t.push(S(String(a)))}}}}function Vt(e,t,n,o){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 r=n.length,f=t.length,s=r,i=0,a=0,u=f>0?t[f-1].nextSibling??void 0:o,d=null;for(;i<f||a<s;){if(t[i]===n[a]){i++,a++;continue}for(;f>i&&s>a&&t[f-1]===n[s-1];)f--,s--;if(f===i){let p=s<r?a?n[a-1].nextSibling??void 0:n[s-a]:u;for(;a<s;)g(e,n[a++],p)}else if(s===a)for(;i<f;)(!d||!d.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[s-1]&&n[a]===t[f-1]){let p=t[--f].nextSibling;g(e,n[a++],t[i++].nextSibling),g(e,n[--s],p),t[f]=t[i-1]}else{if(!d){d=new Map;let y=a;for(;y<s;)d.set(n[y],y++)}let p=d.get(t[i]);if(p!=null)if(a<p&&p<s){let y=i,Q=1;for(;++y<f&&y<s&&!(!d.has(t[y])||d.get(t[y])!==p+Q);)Q++;if(Q>p-a){let qe=t[i];for(;a<p;)g(e,n[a++],qe)}else t[i].parentNode===e?e.replaceChild(n[a++],t[i++]):(g(e,n[a++],u),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return n}function w(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function g(e,t,n){l.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function M(e,t,n){n==null?delete e[t]:e[t]=n}function fe(e,t,n){let o=n,r;return Array.isArray(n)&&(o=n[0],r=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,r),()=>e.removeEventListener(t,o,r))}function ue(e,t){let n=(o,r)=>{typeof o=="function"&&o(e,r??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function W(e,t,n,o=!1){return typeof n!="function"?(x(e,t,n,o),()=>{}):(0,c.createRenderEffect)(()=>{let r=typeof n=="function"?n():n;x(e,t,r,o)})}function K(e,t,n){return typeof n!="function"?(M(e,t,n),()=>{}):(0,c.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;M(e,t,o)})}function le(e,t,n){return typeof n!="function"?(x(e,t,!!n),()=>{}):(0,c.createRenderEffect)(()=>{let o=n();x(e,t,!!o)})}function _(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,c.createRenderEffect)(()=>_(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(o=>{let r=t[o];return typeof r=="function"?r():!!r}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function $(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let r=t[o],f=o.split(/\s+/).filter(Boolean);if(typeof r=="function"&&n)n.push((0,c.createRenderEffect)(()=>{let s=!!r();for(let i of f)e.classList.toggle(i,s)}));else{let s=!!(typeof r=="function"?r():r);for(let i of f)e.classList.toggle(i,s)}}}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 o in n){let r=n[o];r==null?e.style[o]="":e.style[o]=r}}function Wt(e){let{element:t,props:n,prevProps:o=Pt,isSVG:r=!1,skipChildren:f=!1}=e;if(!t||!H(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=r||t.namespaceURI===O,i=[];for(let a in n){if(f&&a==="children")continue;let u=n[a],d=o[a];if(u===d)continue;if(a==="ref"){ce(u,t);continue}if(a==="use"){ue(t,u);continue}if(a.startsWith("on:")){i.push(fe(t,a.slice(3),u));continue}if(a.startsWith("prop:")){i.push(K(t,a.slice(5),u));continue}if(a.startsWith("attr:")){i.push(W(t,a.slice(5),u,s));continue}if(a.startsWith("bool:")){i.push(le(t,a.slice(5),u));continue}if(a==="class"||a==="className"){typeof u=="function"?i.push((0,c.createRenderEffect)(()=>_(t,u()))):_(t,u);continue}if(a==="classList"){typeof u=="function"?i.push((0,c.createRenderEffect)(()=>$(t,u()))):$(t,u,i);continue}if(a==="style"){typeof u=="function"?i.push((0,c.createRenderEffect)(()=>I(t,u()))):I(t,u);continue}if(a.startsWith("on")){let y=a.slice(2).toLowerCase();d&&ie(t,y),u&&Me(t,y,u);continue}let p=D.has(a)||!s&&a in t;typeof u=="function"?i.push(p?K(t,a,u):W(t,a,u,s)):i.push((0,c.createRenderEffect)(()=>p?M(t,a,n[a]):x(t,a,n[a],s)))}for(let a in o)if(!(a in n))if(a.startsWith("on")){let u=a.slice(2).toLowerCase();ie(t,u)}else D.has(a)?M(t,a,null):t.removeAttribute(a);return()=>{i.forEach(a=>a())}}function Kt(e,t,n=!1){for(let o in t){let r=t[o];if(o==="ref"){ce(r,e);continue}if(o!=="children"){if(o==="use"){ue(e,r);continue}if(o.startsWith("on:")){fe(e,o.slice(3),r);continue}if(o.startsWith("prop:")){K(e,o.slice(5),r);continue}if(o.startsWith("attr:")){W(e,o.slice(5),r,n);continue}if(o.startsWith("bool:")){le(e,o.slice(5),r);continue}if(o.startsWith("on")&&o.length>2){let f=o.slice(2).toLowerCase();if(typeof r=="function")if(B.has(f)){e[`$$${f}`]=r;let s=`__fx_${f}`;if(!e[s]){let i=a=>{e[`$$${f}`]?.(a)};e.addEventListener(f,i),e[s]=i}}else e[`$$${f}`]=r,V.has(f)||se([f]);continue}if(o==="class"||o==="className"){_(e,r);continue}if(o==="classList"){typeof r=="function"?(0,c.createRenderEffect)(()=>$(e,r())):$(e,r);continue}if(o==="style"){typeof r=="function"?(0,c.createRenderEffect)(()=>I(e,r())):I(e,r);continue}if(o==="innerHTML"){if(typeof r=="function"){let f=(0,c.createEffect)(()=>{let s=r();for(;typeof s=="function";)s=s();e.innerHTML=s});(0,c.onCleanup)(()=>f())}else e.innerHTML=r;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof r=="function"){let f=(0,c.createEffect)(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});(0,c.onCleanup)(()=>{f()})}else(0,c.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof r=="function"){let f=(0,c.createEffect)(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});(0,c.onCleanup)(()=>{f()})}else(0,c.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof r=="function"){let f=!0,s=(0,c.createEffect)(()=>{let i=r();for(;typeof i=="function"&&i.length===0;)i=i();f?(f=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});(0,c.onCleanup)(()=>{s()})}else{let f=!0;(0,c.createRenderEffect)(()=>{let s=t[o];f?(f=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof r=="function"){let f=(0,c.createEffect)(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();k(e,o,s,n)});(0,c.onCleanup)(()=>{f()})}else(0,c.createRenderEffect)(()=>k(e,o,t[o],n))}}}function Bt(...e){let t=o=>{for(let r=e.length-1;r>=0;r--){let f=e[r];if(f&&o in f&&f[o]!==void 0)return f[o]}},n=o=>{for(let r of e)if(r&&o in r)return!0;return!1};return new Proxy({},{get:(o,r)=>t(r),has:(o,r)=>n(r),ownKeys:()=>{let o=new Set;for(let r of e)if(r)for(let f of Reflect.ownKeys(r))o.add(f);return[...o]},getOwnPropertyDescriptor:(o,r)=>n(r)?{enumerable:!0,configurable:!0,get:()=>t(r)}:void 0})}function Gt(e,...t){let n=new Set;for(let s of t)for(let i of s)n.add(i);let o=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),r=t.map(s=>{let i=new Set(s);return new Proxy({},{get:(a,u)=>i.has(u)?e[u]:void 0,has:(a,u)=>i.has(u)&&u in e,ownKeys:()=>Array.from(i).filter(a=>a in e),getOwnPropertyDescriptor:(a,u)=>i.has(u)&&u in e?o(u):void 0})}),f=new Proxy({},{get:(s,i)=>n.has(i)?void 0:e[i],has:(s,i)=>!n.has(i)&&i in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,i)=>!n.has(i)&&i in e?o(i):void 0});return[...r,f]}function ce(e,t){if(e){if(v(e)){let n=t,o=e;if(!n)return;typeof n=="function"?n(o):typeof n=="object"&&"current"in n&&(n.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function Jt(e,t,n){let o=t||document.body,r=(0,c.readChildren)(()=>e),f=[];return(0,c.batch)(()=>{let s=(0,c.createRenderEffect)(()=>{let i=r();Array.isArray(i)?(i.forEach(a=>o.appendChild(a)),f.push(()=>{i.forEach(a=>{a.parentNode===o&&o.removeChild(a)})})):v(i)&&(o.appendChild(i),f.push(()=>{i.parentNode===o&&o.removeChild(i)}))});f.push(s),(0,c.onCleanup)(()=>{f.forEach(i=>i())})}),null}function Xt(e){return typeof e=="string"&&e.toLowerCase()===e}function zt(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 Ut(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function L(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Yt(e){return typeof e=="function"&&e.length===0&&(0,m.isSignal)(e)}function de(e,t,n){if(!t)throw new Error("Container element is required");let o,r,f=[];return(0,c.createRoot)(s=>{(0,c.batch)(()=>{l.active||(t.textContent=""),be(t),Ne(),A(t,e)}),r=s}),()=>{r?.(),o?.(),f.forEach(s=>s()),t.textContent=""}}function Zt(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 G=require("@fluixi/reactive");var Qt="__fx_dom_create_component__",C=globalThis[Qt]??={fn:null};function en(e){C.fn=e}function tn(e={}){let t=e.signalSystem?.createComponent;t&&(C.fn=t)}function nn(e,t){if(C.fn)return C.fn(e,t);let n=typeof e=="function"?(0,G.untrack)(()=>e(t)):e;if(n!=null&&(typeof n=="function"||typeof n=="object")&&!(0,G.isSignal)(n)){try{n.$name=e?.name}catch{}return Te(n)}return n}var on=()=>C.fn!==null,rn=()=>C.fn!==null;function sn(){C.fn=null}var J,an={getStore:()=>J,run(e,t){let n=J;J=e;try{return t()}finally{J=n}}},fn=an;function Oe(){return fn.getStore()}var X=require("@fluixi/reactive/signal");var un="__FX_DATA__";var pe;function ke(){let e=globalThis.__FX_DATA__;if(e)return e;if(pe!==void 0)return pe;let t=null;if(typeof document<"u"){let n=document.getElementById(un)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return pe=t}function z(){for(;;){for(;l.cursor&&l.cursor.nodeType===3&&l.cursor.data==="";)l.cursor=l.cursor.nextSibling;if(l.cursor!=null||!l.parents.length)return;l.cursor=l.parents.pop().nextSibling}}var ln=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),U=typeof process<"u"&&process.env&&!1;function Y(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 cn(e){z();let t=l.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(ln.has(e.toLowerCase())?l.cursor=t.nextSibling:(l.parents.push(t),l.cursor=t.firstChild),t):(U&&t&&Y(`<${e}>`,t),null)}function dn(e){z();let t=l.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(l.cursor=t.nextSibling,t):(U&&t&&Y(`<${e}> (static)`,t),null)}function pn(e){if(e===""){let n=l.cursor;return n&&n.nodeType===3&&n.data!==""?(l.cursor=n.nextSibling,n.data="",n):null}z();let t=l.cursor;return t&&t.nodeType===3?(l.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(U&&t&&Y(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function yn(e){z();let t=l.cursor;return t&&t.nodeType===8&&t.data===e?(l.cursor=t.nextSibling,t):(U&&t&&Y(`marker <!--${e.slice(0,24)}-->`,t),null)}var De=!1;function mn(){De||(De=!0,Ce({hydrateElement:cn,hydrateText:pn,hydrateMarker:yn,hydrateStatic:dn}))}function Z(e,t,n){mn(),l.active=!0,l.cursor=t.firstChild,l.parents=[];let o=ke(),r=n?.resourceNamespace,f=0;(0,X.setResourceIdSource)(()=>r?`${r}:r${f++}`:`r${f++}`),(0,X.setServerDataGetter)(o?s=>s in o?{value:o[s]}:void 0:null);try{return de(e,t)}finally{l.active=!1,l.cursor=null,l.parents=[]}}var ye="fluixi-island";function He(e){let{component:t,props:n={},name:o}=e,r=ae(ye),f=o??t.name??"Island";x(r,"name",f),x(r,"props",JSON.stringify(n??{}));let s=E?Oe():void 0;if(s){let i=s.nextIslandNamespace(f);A(r,()=>s.withResourceScope(i,()=>t(n)))}else A(r,()=>t(n));return r}var Fe=!1;function gn(){if(Fe||typeof document>"u")return;Fe=!0;let e=document.createElement("style");e.textContent=`${ye}{display:contents}`,document.head.appendChild(e)}function je(e){if(typeof document>"u")return;gn();let t=document.querySelectorAll(ye),n=new Map;t.forEach(o=>{let r=o.getAttribute("name")??"",f=n.get(r)??0;n.set(r,f+1);let s=e[r];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${r}" has no component in the registry — left static.`);return}let i={};try{i=JSON.parse(o.getAttribute("props")||"{}")}catch{}Z(()=>s(i),o,{resourceNamespace:`${r}#${f}`})})}
@@ -1 +1 @@
1
- function lt(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function ct(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function dt(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function pt(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),o={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)||o[e]&&o[e].has(t)}var yt=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),mt=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),G="http://www.w3.org/2000/svg";function Ae(e){return e.localName.includes("-")}function J(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(Ae(e)){e[t]=n;return}x(e,t,n,o)}var X=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function ie(e,t=document){return t.querySelector(e)}function gt(e,t=document){return Array.from(t.querySelectorAll(e))}function xt(e,t){return e.closest(t)}function ht(e,...t){e.classList.add(...t)}function Et(e,...t){e.classList.remove(...t)}function bt(e,...t){t.forEach(n=>e.classList.toggle(n))}function Nt(e,t){return e.classList.contains(t)}function x(e,t,n,o=!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 Tt(e,t){return e.getAttribute(t)}function wt(e,t){e.removeAttribute(t)}function Re(e,t){Object.assign(e.style,t)}function St(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function vt(e,t={},...n){let o=document.createElement(e);return Object.entries(t).forEach(([r,f])=>{if(r==="class"||r==="className")o.className=f;else if(r==="style"&&typeof f=="object")Re(o,f);else if(r.startsWith("on")&&typeof f=="function"){let s=r.slice(2).toLowerCase();o.addEventListener(s,f)}else x(o,r,f)}),n.forEach(r=>{typeof r=="string"?o.appendChild(document.createTextNode(r)):o.appendChild(r)}),o}function Ct(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function At(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function Rt(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Lt(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Pt(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function Mt(e,t,n,o){let r=f=>{let s=f.target.closest(n);s&&e.contains(s)&&o(f,s)};return e.addEventListener(t,r),()=>{e.removeEventListener(t,r)}}function _t(e,t=5e3){return new Promise((n,o)=>{let r=ie(e);if(r){n(r);return}let f=new MutationObserver(()=>{let i=ie(e);i&&(f.disconnect(),clearTimeout(s),n(i))});f.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{f.disconnect(),o(new Error(`Element ${e} not found within ${t}ms`))},t)})}function It(e,t,n={}){let o=new IntersectionObserver(r=>{r.forEach(f=>{t(f.isIntersecting)})},n);return o.observe(e),()=>{o.disconnect()}}function $t(e,t){let n=new ResizeObserver(o=>{o.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Le=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function Ot(e){return typeof e=="object"&&e!==null&&e.$$typeof===Le}function Pe(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function kt(e){if(typeof e!="function")return!1;try{let t=e();return Pe(t)}catch{return!1}}function Dt(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Ft(e){return e instanceof Node}function Ht(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function jt(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as g}from"@fluixi/reactive/signal";var se="1.0.0-alpha.78";import{VERSION as Me}from"@fluixi/reactive/version";var h={dom:se,reactive:Me};function ae(e){h.core&&e.setAttribute("fluixi",h.core),e.setAttribute("fx-dom",h.dom),e.setAttribute("fx-reactive",h.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=h)}function fe(){let e=[h.core,h.dom,h.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${h.core??"(absent)"}, dom ${h.dom}, reactive ${h.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 E(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}import{batch as ye,createEffect as R,createRenderEffect as y,createRoot as ke,onCleanup as v,readChildren as De}from"@fluixi/reactive/signal";var b=typeof document>"u";function _e(e){b=e}var z=Symbol.for("fluixi.server-node"),ue=null;function P(){if(!ue)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return ue}function A(e){return e!=null&&e[z]===!0?!0:typeof Node<"u"&&e instanceof Node}function U(e){return e!=null&&e[z]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Y(e){return e!=null&&e[z]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var l={active:!1,cursor:null,parents:[]},le=null;function ce(e){le=e}function M(){return le}function Z(e,t){return l.active&&t.parentNode===e}function Q(e){let t=l.parents.lastIndexOf(e);t!==-1&&(l.parents.length=t),l.cursor=e.nextSibling}function Ie(){return l.active?l.cursor:null}function _(e,t){if(!e||e.parentNode==null)return t();let n=l.active,o=l.cursor,r=l.parents;l.active=!0,l.cursor=e,l.parents=[];try{return t()}finally{l.active=n,l.cursor=o,l.parents=r}}function $e(e){if(!l.active)return e();let t=l.cursor,n=l.parents;l.active=!1,l.parents=[];try{return e()}finally{l.active=!0,l.cursor=t,l.parents=n}}function Oe(e){if(!l.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Q(t)}function Fe(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 o=0,r=e;for(;r=r.previousElementSibling;)r.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function He(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 on(e){return He(Fe(e))}var rn=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),je={};var de=new Map,$=new Set,j=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function me(e){if(!b)for(let t of e)$.has(t)||j.has(t)||($.add(t),document.addEventListener(t,qe))}function qe(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let o=n[t];if(o&&!n.disabled&&(o(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function Ve(e,t,n){if(e[`$$${t}`]=n,j.has(t)){let o=`__fx_${t}`;if(!e[o]){let r=f=>{e[`$$${t}`]?.(f)};e.addEventListener(t,r),e[o]=r}return}$.has(t)||me([t])}function pe(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function sn(e){return!j.has(e)}function an(e){return typeof e=="function"}function w(e,t=!1){if(b)return P().createText(e);if(l.active&&!t){let n=M()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function ge(e,t=!1){if(b)return P().createElement(e,t);if(l.active){let n=M()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(G,e):document.createElement(e)}function We(e,t=!1){let n=de.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,de.set(e,o),o}function fn(e,t,n=!1,o=!1){if(b){let r=P();return n?r.parseTemplate(e,o):r.createRaw(e)}if(l.active){let r=M()?.hydrateStatic(t);if(r)return r}return Ke(We(e,o),o).firstChild}function un(e,t){if(!l.active)return t();let n=_(e.nextSibling,t);if(typeof n=="function"){let o=n;return((...r)=>l.active?_(e.nextSibling,()=>o(...r)):o(...r))}return n}function ln(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 cn(e,t){let n=[];for(let o=e.nextSibling;o&&o!==t;o=o.nextSibling)n.push(o);return n}function Ke(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function Be(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Be(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function dn(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function pn(e){if(g(e)||E(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!g(t)&&!E(t);)t=t();return t}var T=0,Ge=200;function Je(e,t,n,o,r){let f=o,s=new Map;return y(()=>{let i;if(E(e)&&!g(e)){if(!s.has(e)){T++;try{let a=e();s.set(e,a)}finally{T--}}for(i=s.get(e);typeof i=="function"&&g(i);)i=i()}else for(i=e();typeof i=="function"&&g(i);)i=i();{let a=0;for(;typeof i=="function"&&a++<50;)if(E(i)){if(!s.has(i)){let u=i;T++;try{let c=u();s.set(u,c)}finally{T--}}i=s.get(i)}else if(g(i))i=i();else if(i=i(),typeof i!="function"||!g(i)&&!E(i))break}T++;try{f=O(t,i,n,f,s),r(f)}finally{T--}})}function L(e,t,n,o){if(T>Ge)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=w("",!0),e.appendChild(n));let r=o??null,f=a=>Array.isArray(a)&&a.some(u=>typeof u=="function"),s=a=>typeof a=="function"?a:()=>a;if(typeof t!="function"&&!f(t)){T++;try{r=O(e,t,n,r)}finally{T--}return()=>r}let i=Je(s(t),e,n,r,a=>{r=a});return()=>(i?.(),r)}function O(e,t,n,o,r){if(t==null||typeof t=="boolean")return S(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return S(e,o,n);if(I(t)){let s=w("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(s,o[0]),S(e,o.slice(1),n)):m(e,s,n):o?e.replaceChild(s,o):m(e,s,n),t.then(i=>{s.parentNode===e&&O(e,i,s.nextSibling,s)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),s}let f=typeof t;if(f==="string"||f==="number"){if(f==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let i=w(t);return m(e,i,n),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=S(e,o,n)}if(o&&Y(o))return o.data=t,o;let s=w(t);return o&&o.parentNode===e?e.replaceChild(s,o):Z(e,s)||m(e,s,n),s}if(A(t))return Z(e,t)?(Q(t),t):Array.isArray(o)?(o.length===0?m(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),S(e,o.slice(1),n)):m(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):m(e,t,n)):m(e,t,n),t);if(Array.isArray(t)){let s=[],i=Array.isArray(o)?o:o?[o]:[],a=[];N(t,s,e,n,!0,r,a);let u=Xe(e,i,s,n);for(let c of a){let d=L(e,c.sig,c.marker);v(()=>{S(e,d()),c.marker.parentNode===e&&e.removeChild(c.marker)})}return u}if(f==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let i=s;if(typeof i.type=="function"){let a=i.type(i.props||{});return O(e,a,n,o)}}}return S(e,o,n)}function N(e,t,n,o,r=!0,f,s){for(let i=0;i<e.length;i++){let a=e[i];if(!(a==null||typeof a=="boolean")){for(;typeof a=="function"&&!I(a)&&!g(a)&&!E(a)&&(a=a(),!(a==null||typeof a=="boolean")););if(!(a==null||typeof a=="boolean")){if(typeof a=="function"){let u;for(E(a)&&!g(a)?(f||(f=new Map),f.has(a)||f.set(a,a()),u=f.get(a)):u=a();typeof u=="function"&&!I(u)&&!g(u)&&!E(u);)f||(f=new Map),f.has(u)||f.set(u,u()),u=f.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if(g(u)){if(s){let d=w("",!0);t.push(d),s.push({marker:d,sig:u});continue}let c=u();for(;typeof c=="function"&&g(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?N(c,t,n,o,r,f):N([c],t,n,o,r,f);continue}continue}Array.isArray(u)?N(u,t,n,o,r,f,s):N([u],t,n,o,r,f,s);continue}if(I(a)){let u=w("",!0);t.push(u),a.then(c=>{if(u.parentNode){let d=[];if(N([c],d,u.parentNode,void 0,!1,f),d.length>0){u.parentNode.replaceChild(d[0],u);for(let p=1;p<d.length;p++)u.parentNode?.insertBefore(d[p],d[p-1].nextSibling)}}}).catch(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(a)){N(a,t,n,o,r,f,s);continue}if(A(a)){t.push(a);continue}if(typeof a=="object"&&a!==null&&"type"in a&&"props"in a){let u=a;if(typeof u.type=="function"){let c=u.type(u.props||{});Array.isArray(c)?N(c,t,n,o,!1,f):N([c],t,n,o,!1,f);continue}}if(typeof a=="string"||typeof a=="number"){let u=String(a);if(u.trim()===""&&u!==" ")continue;t.push(w(u));continue}t.push(w(String(a)))}}}}function Xe(e,t,n,o){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 r=n.length,f=t.length,s=r,i=0,a=0,u=f>0?t[f-1].nextSibling??void 0:o,c=null;for(;i<f||a<s;){if(t[i]===n[a]){i++,a++;continue}for(;f>i&&s>a&&t[f-1]===n[s-1];)f--,s--;if(f===i){let d=s<r?a?n[a-1].nextSibling??void 0:n[s-a]:u;for(;a<s;)m(e,n[a++],d)}else if(s===a)for(;i<f;)(!c||!c.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[s-1]&&n[a]===t[f-1]){let d=t[--f].nextSibling;m(e,n[a++],t[i++].nextSibling),m(e,n[--s],d),t[f]=t[i-1]}else{if(!c){c=new Map;let p=a;for(;p<s;)c.set(n[p],p++)}let d=c.get(t[i]);if(d!=null)if(a<d&&d<s){let p=i,B=1;for(;++p<f&&p<s&&!(!c.has(t[p])||c.get(t[p])!==d+B);)B++;if(B>d-a){let Ce=t[i];for(;a<d;)m(e,n[a++],Ce)}else t[i].parentNode===e?e.replaceChild(n[a++],t[i++]):(m(e,n[a++],u),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return n}function S(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function m(e,t,n){l.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function k(e,t,n){n==null?delete e[t]:e[t]=n}function xe(e,t,n){let o=n,r;return Array.isArray(n)&&(o=n[0],r=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,r),()=>e.removeEventListener(t,o,r))}function he(e,t){let n=(o,r)=>{typeof o=="function"&&o(e,r??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function ee(e,t,n,o=!1){return typeof n!="function"?(x(e,t,n,o),()=>{}):y(()=>{let r=typeof n=="function"?n():n;x(e,t,r,o)})}function te(e,t,n){return typeof n!="function"?(k(e,t,n),()=>{}):y(()=>{let o=typeof n=="function"?n():n;k(e,t,o)})}function Ee(e,t,n){return typeof n!="function"?(x(e,t,!!n),()=>{}):y(()=>{let o=n();x(e,t,!!o)})}function D(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){y(()=>D(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(o=>{let r=t[o];return typeof r=="function"?r():!!r}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function F(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let r=t[o],f=o.split(/\s+/).filter(Boolean);if(typeof r=="function"&&n)n.push(y(()=>{let s=!!r();for(let i of f)e.classList.toggle(i,s)}));else{let s=!!(typeof r=="function"?r():r);for(let i of f)e.classList.toggle(i,s)}}}function H(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 o in n){let r=n[o];r==null?e.style[o]="":e.style[o]=r}}function yn(e){let{element:t,props:n,prevProps:o=je,isSVG:r=!1,skipChildren:f=!1}=e;if(!t||!U(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=r||t.namespaceURI===G,i=[];for(let a in n){if(f&&a==="children")continue;let u=n[a],c=o[a];if(u===c)continue;if(a==="ref"){be(u,t);continue}if(a==="use"){he(t,u);continue}if(a.startsWith("on:")){i.push(xe(t,a.slice(3),u));continue}if(a.startsWith("prop:")){i.push(te(t,a.slice(5),u));continue}if(a.startsWith("attr:")){i.push(ee(t,a.slice(5),u,s));continue}if(a.startsWith("bool:")){i.push(Ee(t,a.slice(5),u));continue}if(a==="class"||a==="className"){typeof u=="function"?i.push(y(()=>D(t,u()))):D(t,u);continue}if(a==="classList"){typeof u=="function"?i.push(y(()=>F(t,u()))):F(t,u,i);continue}if(a==="style"){typeof u=="function"?i.push(y(()=>H(t,u()))):H(t,u);continue}if(a.startsWith("on")){let p=a.slice(2).toLowerCase();c&&pe(t,p),u&&Ve(t,p,u);continue}let d=X.has(a)||!s&&a in t;typeof u=="function"?i.push(d?te(t,a,u):ee(t,a,u,s)):i.push(y(()=>d?k(t,a,n[a]):x(t,a,n[a],s)))}for(let a in o)if(!(a in n))if(a.startsWith("on")){let u=a.slice(2).toLowerCase();pe(t,u)}else X.has(a)?k(t,a,null):t.removeAttribute(a);return()=>{i.forEach(a=>a())}}function mn(e,t,n=!1){for(let o in t){let r=t[o];if(o==="ref"){be(r,e);continue}if(o!=="children"){if(o==="use"){he(e,r);continue}if(o.startsWith("on:")){xe(e,o.slice(3),r);continue}if(o.startsWith("prop:")){te(e,o.slice(5),r);continue}if(o.startsWith("attr:")){ee(e,o.slice(5),r,n);continue}if(o.startsWith("bool:")){Ee(e,o.slice(5),r);continue}if(o.startsWith("on")&&o.length>2){let f=o.slice(2).toLowerCase();if(typeof r=="function")if(j.has(f)){e[`$$${f}`]=r;let s=`__fx_${f}`;if(!e[s]){let i=a=>{e[`$$${f}`]?.(a)};e.addEventListener(f,i),e[s]=i}}else e[`$$${f}`]=r,$.has(f)||me([f]);continue}if(o==="class"||o==="className"){D(e,r);continue}if(o==="classList"){typeof r=="function"?y(()=>F(e,r())):F(e,r);continue}if(o==="style"){typeof r=="function"?y(()=>H(e,r())):H(e,r);continue}if(o==="innerHTML"){if(typeof r=="function"){let f=R(()=>{let s=r();for(;typeof s=="function";)s=s();e.innerHTML=s});v(()=>f())}else e.innerHTML=r;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof r=="function"){let f=R(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});v(()=>{f()})}else y(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof r=="function"){let f=R(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});v(()=>{f()})}else y(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof r=="function"){let f=!0,s=R(()=>{let i=r();for(;typeof i=="function"&&i.length===0;)i=i();f?(f=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});v(()=>{s()})}else{let f=!0;y(()=>{let s=t[o];f?(f=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof r=="function"){let f=R(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();J(e,o,s,n)});v(()=>{f()})}else y(()=>J(e,o,t[o],n))}}}function gn(...e){let t=o=>{for(let r=e.length-1;r>=0;r--){let f=e[r];if(f&&o in f&&f[o]!==void 0)return f[o]}},n=o=>{for(let r of e)if(r&&o in r)return!0;return!1};return new Proxy({},{get:(o,r)=>t(r),has:(o,r)=>n(r),ownKeys:()=>{let o=new Set;for(let r of e)if(r)for(let f of Reflect.ownKeys(r))o.add(f);return[...o]},getOwnPropertyDescriptor:(o,r)=>n(r)?{enumerable:!0,configurable:!0,get:()=>t(r)}:void 0})}function xn(e,...t){let n=new Set;for(let s of t)for(let i of s)n.add(i);let o=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),r=t.map(s=>{let i=new Set(s);return new Proxy({},{get:(a,u)=>i.has(u)?e[u]:void 0,has:(a,u)=>i.has(u)&&u in e,ownKeys:()=>Array.from(i).filter(a=>a in e),getOwnPropertyDescriptor:(a,u)=>i.has(u)&&u in e?o(u):void 0})}),f=new Proxy({},{get:(s,i)=>n.has(i)?void 0:e[i],has:(s,i)=>!n.has(i)&&i in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,i)=>!n.has(i)&&i in e?o(i):void 0});return[...r,f]}function be(e,t){if(e){if(A(e)){let n=t,o=e;if(!n)return;typeof n=="function"?n(o):typeof n=="object"&&"current"in n&&(n.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function hn(e,t,n){let o=t||document.body,r=De(()=>e),f=[];return ye(()=>{let s=y(()=>{let i=r();Array.isArray(i)?(i.forEach(a=>o.appendChild(a)),f.push(()=>{i.forEach(a=>{a.parentNode===o&&o.removeChild(a)})})):A(i)&&(o.appendChild(i),f.push(()=>{i.parentNode===o&&o.removeChild(i)}))});f.push(s),v(()=>{f.forEach(i=>i())})}),null}function En(e){return typeof e=="string"&&e.toLowerCase()===e}function bn(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 Nn(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function I(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Tn(e){return typeof e=="function"&&e.length===0&&g(e)}function Ne(e,t,n){if(!t)throw new Error("Container element is required");let o,r,f=[];return ke(s=>{ye(()=>{l.active||(t.textContent=""),ae(t),fe(),L(t,e)}),r=s}),()=>{r?.(),o?.(),f.forEach(s=>s()),t.textContent=""}}function wn(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 ze="__fx_dom_create_component__",C=globalThis[ze]??={fn:null};function vn(e){C.fn=e}function Cn(e={}){let t=e.signalSystem?.createComponent;t&&(C.fn=t)}function An(e,t){return C.fn?C.fn(e,t):(()=>e(t))}var Rn=()=>C.fn!==null,Ln=()=>C.fn!==null;function Pn(){C.fn=null}var q,Ue={getStore:()=>q,run(e,t){let n=q;q=e;try{return t()}finally{q=n}}},Ye=Ue;function Te(){return Ye.getStore()}import{setResourceIdSource as Qe,setServerDataGetter as et}from"@fluixi/reactive/signal";var Ze="__FX_DATA__";var ne;function we(){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(Ze)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return ne=t}function V(){for(;;){for(;l.cursor&&l.cursor.nodeType===3&&l.cursor.data==="";)l.cursor=l.cursor.nextSibling;if(l.cursor!=null||!l.parents.length)return;l.cursor=l.parents.pop().nextSibling}}var tt=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),W=typeof process<"u"&&process.env&&!1;function K(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 nt(e){V();let t=l.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(tt.has(e.toLowerCase())?l.cursor=t.nextSibling:(l.parents.push(t),l.cursor=t.firstChild),t):(W&&t&&K(`<${e}>`,t),null)}function ot(e){V();let t=l.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(l.cursor=t.nextSibling,t):(W&&t&&K(`<${e}> (static)`,t),null)}function rt(e){if(e===""){let n=l.cursor;return n&&n.nodeType===3&&n.data!==""?(l.cursor=n.nextSibling,n.data="",n):null}V();let t=l.cursor;return t&&t.nodeType===3?(l.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(W&&t&&K(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function it(e){V();let t=l.cursor;return t&&t.nodeType===8&&t.data===e?(l.cursor=t.nextSibling,t):(W&&t&&K(`marker <!--${e.slice(0,24)}-->`,t),null)}var Se=!1;function st(){Se||(Se=!0,ce({hydrateElement:nt,hydrateText:rt,hydrateMarker:it,hydrateStatic:ot}))}function oe(e,t,n){st(),l.active=!0,l.cursor=t.firstChild,l.parents=[];let o=we(),r=n?.resourceNamespace,f=0;Qe(()=>r?`${r}:r${f++}`:`r${f++}`),et(o?s=>s in o?{value:o[s]}:void 0:null);try{return Ne(e,t)}finally{l.active=!1,l.cursor=null,l.parents=[]}}var re="fluixi-island";function at(e){let{component:t,props:n={},name:o}=e,r=ge(re),f=o??t.name??"Island";x(r,"name",f),x(r,"props",JSON.stringify(n??{}));let s=b?Te():void 0;if(s){let i=s.nextIslandNamespace(f);L(r,()=>s.withResourceScope(i,()=>t(n)))}else L(r,()=>t(n));return r}var ve=!1;function ft(){if(ve||typeof document>"u")return;ve=!0;let e=document.createElement("style");e.textContent=`${re}{display:contents}`,document.head.appendChild(e)}function ut(e){if(typeof document>"u")return;ft();let t=document.querySelectorAll(re),n=new Map;t.forEach(o=>{let r=o.getAttribute("name")??"",f=n.get(r)??0;n.set(r,f+1);let s=e[r];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${r}" has no component in the registry — left static.`);return}let i={};try{i=JSON.parse(o.getAttribute("props")||"{}")}catch{}oe(()=>s(i),o,{resourceNamespace:`${r}#${f}`})})}export{at as Island,X as JSX_PROPERTIES,mt as SVG_ELEMENTS,G as SVG_NAMESPACE,yt as VOID_ELEMENTS,ht as addClass,Ve as addDelegatedEventListener,xe as addNativeEventListener,At as appendChildren,J as applyElementProp,mn as applyProps,he as applyUse,wn as bindPair,Ie as captureHydrationCursor,S as cleanChildren,Ke as cloneTemplate,xt as closest,An as createComponent,vt as createElement,ge as createNativeElement,hn as createPortal,We as createTemplate,Mt as delegate,me as delegateEvents,Nn as escapeHTML,dn as fnName,rn as generateID,Tt as getAttribute,jt as getGlobal,dt as getLitEventName,Pt as getOffset,on as getStableElementId,St as getStyle,be as handleRef,Nt as hasClass,cn as holeContent,ln as holeEnd,un as holeScope,oe as hydrate,Oe as hydrateAdvancePast,ut as hydrateIslands,Cn as initializeIntegration,L as insert,O as insertExpression,Rn as intergartionInitialized,Tn as isAccessor,Ae as isCustomElement,Ft as isDOMNode,sn as isDelegatedEvent,U as isDomElement,A as isDomNode,Y as isDomText,ct as isEventHandler,an as isFunction,Ln as isIntegrationInitialized,Dt as isJSXTemplate,Pe as isLitTemplateResult,En as isNativeElement,I as isPromise,Ot as isReactElement,bn as isSVGElement,b as isServer,kt as isTemplateFactory,Rt as isVisible,pn as iterateFn,Be as makeArrayFlat,gn as mergeProps,It as observeIntersection,$t as observeResize,ie as query,gt as queryAll,vn as registerCreateComponent,Ht as registerGlobal,wt as removeAttribute,Ct as removeChildren,Et as removeClass,pe as removeDelegatedEventListener,Ne as render,Pn as resetIntegration,_ as runHydrationAt,$e as runWithoutHydration,Lt as scrollIntoView,x as setAttribute,F as setClassList,D as setClassName,ee as setDynamicAttribute,Ee as setDynamicBoolAttribute,te as setDynamicProperty,k as setProperty,_e as setServerMode,H as setStyle,Re as setStyles,pt as shouldSetAsProperty,xn as splitProps,yn as spread,fn as templateNode,lt as toAttributeName,bt as toggleClass,_t as waitForElement};
1
+ function pt(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function yt(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function mt(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function gt(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),o={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)||o[e]&&o[e].has(t)}var xt=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ht=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),G="http://www.w3.org/2000/svg";function Re(e){return e.localName.includes("-")}function J(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(Re(e)){e[t]=n;return}x(e,t,n,o)}var X=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function ie(e,t=document){return t.querySelector(e)}function Et(e,t=document){return Array.from(t.querySelectorAll(e))}function bt(e,t){return e.closest(t)}function Nt(e,...t){e.classList.add(...t)}function Tt(e,...t){e.classList.remove(...t)}function wt(e,...t){t.forEach(n=>e.classList.toggle(n))}function St(e,t){return e.classList.contains(t)}function x(e,t,n,o=!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 vt(e,t){return e.getAttribute(t)}function Ct(e,t){e.removeAttribute(t)}function Le(e,t){Object.assign(e.style,t)}function At(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function Rt(e,t={},...n){let o=document.createElement(e);return Object.entries(t).forEach(([r,f])=>{if(r==="class"||r==="className")o.className=f;else if(r==="style"&&typeof f=="object")Le(o,f);else if(r.startsWith("on")&&typeof f=="function"){let s=r.slice(2).toLowerCase();o.addEventListener(s,f)}else x(o,r,f)}),n.forEach(r=>{typeof r=="string"?o.appendChild(document.createTextNode(r)):o.appendChild(r)}),o}function Lt(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Pt(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function Mt(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function _t(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function $t(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function It(e,t,n,o){let r=f=>{let s=f.target.closest(n);s&&e.contains(s)&&o(f,s)};return e.addEventListener(t,r),()=>{e.removeEventListener(t,r)}}function Ot(e,t=5e3){return new Promise((n,o)=>{let r=ie(e);if(r){n(r);return}let f=new MutationObserver(()=>{let i=ie(e);i&&(f.disconnect(),clearTimeout(s),n(i))});f.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{f.disconnect(),o(new Error(`Element ${e} not found within ${t}ms`))},t)})}function kt(e,t,n={}){let o=new IntersectionObserver(r=>{r.forEach(f=>{t(f.isIntersecting)})},n);return o.observe(e),()=>{o.disconnect()}}function Dt(e,t){let n=new ResizeObserver(o=>{o.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Pe=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function Ft(e){return typeof e=="object"&&e!==null&&e.$$typeof===Pe}function Me(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Ht(e){if(typeof e!="function")return!1;try{let t=e();return Me(t)}catch{return!1}}function jt(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function qt(e){return e instanceof Node}function Vt(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function Wt(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as g}from"@fluixi/reactive/signal";var se="1.0.0-alpha.80";import{VERSION as _e}from"@fluixi/reactive/version";var h={dom:se,reactive:_e};function ae(e){h.core&&e.setAttribute("fluixi",h.core),e.setAttribute("fx-dom",h.dom),e.setAttribute("fx-reactive",h.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=h)}function fe(){let e=[h.core,h.dom,h.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${h.core??"(absent)"}, dom ${h.dom}, reactive ${h.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 ue(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function E(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}import{batch as me,createEffect as R,createRenderEffect as y,createRoot as De,onCleanup as v,readChildren as Fe}from"@fluixi/reactive/signal";var b=typeof document>"u";function $e(e){b=e}var z=Symbol.for("fluixi.server-node"),le=null;function P(){if(!le)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return le}function A(e){return e!=null&&e[z]===!0?!0:typeof Node<"u"&&e instanceof Node}function U(e){return e!=null&&e[z]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Y(e){return e!=null&&e[z]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var l={active:!1,cursor:null,parents:[]},ce=null;function de(e){ce=e}function M(){return ce}function Z(e,t){return l.active&&t.parentNode===e}function Q(e){let t=l.parents.lastIndexOf(e);t!==-1&&(l.parents.length=t),l.cursor=e.nextSibling}function Ie(){return l.active?l.cursor:null}function _(e,t){if(!e||e.parentNode==null)return t();let n=l.active,o=l.cursor,r=l.parents;l.active=!0,l.cursor=e,l.parents=[];try{return t()}finally{l.active=n,l.cursor=o,l.parents=r}}function Oe(e){if(!l.active)return e();let t=l.cursor,n=l.parents;l.active=!1,l.parents=[];try{return e()}finally{l.active=!0,l.cursor=t,l.parents=n}}function ke(e){if(!l.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Q(t)}function He(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 o=0,r=e;for(;r=r.previousElementSibling;)r.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function je(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 an(e){return je(He(e))}var fn=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),qe={};var pe=new Map,I=new Set,j=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function ge(e){if(!b)for(let t of e)I.has(t)||j.has(t)||(I.add(t),document.addEventListener(t,Ve))}function Ve(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let o=n[t];if(o&&!n.disabled&&(o(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function We(e,t,n){if(e[`$$${t}`]=n,j.has(t)){let o=`__fx_${t}`;if(!e[o]){let r=f=>{e[`$$${t}`]?.(f)};e.addEventListener(t,r),e[o]=r}return}I.has(t)||ge([t])}function ye(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function un(e){return!j.has(e)}function ln(e){return typeof e=="function"}function w(e,t=!1){if(b)return P().createText(e);if(l.active&&!t){let n=M()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function xe(e,t=!1){if(b)return P().createElement(e,t);if(l.active){let n=M()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(G,e):document.createElement(e)}function Ke(e,t=!1){let n=pe.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,pe.set(e,o),o}function cn(e,t,n=!1,o=!1){if(b){let r=P();return n?r.parseTemplate(e,o):r.createRaw(e)}if(l.active){let r=M()?.hydrateStatic(t);if(r)return r}return Be(Ke(e,o),o).firstChild}function dn(e,t){if(!l.active)return t();let n=_(e.nextSibling,t);if(typeof n=="function"){let o=n;return((...r)=>l.active?_(e.nextSibling,()=>o(...r)):o(...r))}return n}function pn(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 yn(e,t){let n=[];for(let o=e.nextSibling;o&&o!==t;o=o.nextSibling)n.push(o);return n}function Be(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function Ge(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Ge(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function mn(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function gn(e){if(g(e)||E(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!g(t)&&!E(t);)t=t();return t}var T=0,Je=200;function Xe(e,t,n,o,r){let f=o,s=new Map;return y(()=>{let i;if(E(e)&&!g(e)){if(!s.has(e)){T++;try{let a=e();s.set(e,a)}finally{T--}}for(i=s.get(e);typeof i=="function"&&g(i);)i=i()}else for(i=e();typeof i=="function"&&g(i);)i=i();{let a=0;for(;typeof i=="function"&&a++<50;)if(E(i)){if(!s.has(i)){let u=i;T++;try{let c=u();s.set(u,c)}finally{T--}}i=s.get(i)}else if(g(i))i=i();else if(i=i(),typeof i!="function"||!g(i)&&!E(i))break}T++;try{f=O(t,i,n,f,s),r(f)}finally{T--}})}function L(e,t,n,o){if(T>Je)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=w("",!0),e.appendChild(n));let r=o??null,f=a=>Array.isArray(a)&&a.some(u=>typeof u=="function"),s=a=>typeof a=="function"?a:()=>a;if(typeof t!="function"&&!f(t)){T++;try{r=O(e,t,n,r)}finally{T--}return()=>r}let i=Xe(s(t),e,n,r,a=>{r=a});return()=>(i?.(),r)}function O(e,t,n,o,r){if(t==null||typeof t=="boolean")return S(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return S(e,o,n);if($(t)){let s=w("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(s,o[0]),S(e,o.slice(1),n)):m(e,s,n):o?e.replaceChild(s,o):m(e,s,n),t.then(i=>{s.parentNode===e&&O(e,i,s.nextSibling,s)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),s}let f=typeof t;if(f==="string"||f==="number"){if(f==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let i=w(t);return m(e,i,n),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=S(e,o,n)}if(o&&Y(o))return o.data=t,o;let s=w(t);return o&&o.parentNode===e?e.replaceChild(s,o):Z(e,s)||m(e,s,n),s}if(A(t))return Z(e,t)?(Q(t),t):Array.isArray(o)?(o.length===0?m(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),S(e,o.slice(1),n)):m(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):m(e,t,n)):m(e,t,n),t);if(Array.isArray(t)){let s=[],i=Array.isArray(o)?o:o?[o]:[],a=[];N(t,s,e,n,!0,r,a);let u=ze(e,i,s,n);for(let c of a){let d=L(e,c.sig,c.marker);v(()=>{S(e,d()),c.marker.parentNode===e&&e.removeChild(c.marker)})}return u}if(f==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let i=s;if(typeof i.type=="function"){let a=i.type(i.props||{});return O(e,a,n,o)}}}return S(e,o,n)}function N(e,t,n,o,r=!0,f,s){for(let i=0;i<e.length;i++){let a=e[i];if(!(a==null||typeof a=="boolean")){for(;typeof a=="function"&&!$(a)&&!g(a)&&!E(a)&&(a=a(),!(a==null||typeof a=="boolean")););if(!(a==null||typeof a=="boolean")){if(typeof a=="function"){let u;for(E(a)&&!g(a)?(f||(f=new Map),f.has(a)||f.set(a,a()),u=f.get(a)):u=a();typeof u=="function"&&!$(u)&&!g(u)&&!E(u);)f||(f=new Map),f.has(u)||f.set(u,u()),u=f.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if(g(u)){if(s){let d=w("",!0);t.push(d),s.push({marker:d,sig:u});continue}let c=u();for(;typeof c=="function"&&g(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?N(c,t,n,o,r,f):N([c],t,n,o,r,f);continue}continue}Array.isArray(u)?N(u,t,n,o,r,f,s):N([u],t,n,o,r,f,s);continue}if($(a)){let u=w("",!0);t.push(u),a.then(c=>{if(u.parentNode){let d=[];if(N([c],d,u.parentNode,void 0,!1,f),d.length>0){u.parentNode.replaceChild(d[0],u);for(let p=1;p<d.length;p++)u.parentNode?.insertBefore(d[p],d[p-1].nextSibling)}}}).catch(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(a)){N(a,t,n,o,r,f,s);continue}if(A(a)){t.push(a);continue}if(typeof a=="object"&&a!==null&&"type"in a&&"props"in a){let u=a;if(typeof u.type=="function"){let c=u.type(u.props||{});Array.isArray(c)?N(c,t,n,o,!1,f):N([c],t,n,o,!1,f);continue}}if(typeof a=="string"||typeof a=="number"){let u=String(a);if(u.trim()===""&&u!==" ")continue;t.push(w(u));continue}t.push(w(String(a)))}}}}function ze(e,t,n,o){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 r=n.length,f=t.length,s=r,i=0,a=0,u=f>0?t[f-1].nextSibling??void 0:o,c=null;for(;i<f||a<s;){if(t[i]===n[a]){i++,a++;continue}for(;f>i&&s>a&&t[f-1]===n[s-1];)f--,s--;if(f===i){let d=s<r?a?n[a-1].nextSibling??void 0:n[s-a]:u;for(;a<s;)m(e,n[a++],d)}else if(s===a)for(;i<f;)(!c||!c.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[s-1]&&n[a]===t[f-1]){let d=t[--f].nextSibling;m(e,n[a++],t[i++].nextSibling),m(e,n[--s],d),t[f]=t[i-1]}else{if(!c){c=new Map;let p=a;for(;p<s;)c.set(n[p],p++)}let d=c.get(t[i]);if(d!=null)if(a<d&&d<s){let p=i,B=1;for(;++p<f&&p<s&&!(!c.has(t[p])||c.get(t[p])!==d+B);)B++;if(B>d-a){let Ae=t[i];for(;a<d;)m(e,n[a++],Ae)}else t[i].parentNode===e?e.replaceChild(n[a++],t[i++]):(m(e,n[a++],u),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return n}function S(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function m(e,t,n){l.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function k(e,t,n){n==null?delete e[t]:e[t]=n}function he(e,t,n){let o=n,r;return Array.isArray(n)&&(o=n[0],r=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,r),()=>e.removeEventListener(t,o,r))}function Ee(e,t){let n=(o,r)=>{typeof o=="function"&&o(e,r??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function ee(e,t,n,o=!1){return typeof n!="function"?(x(e,t,n,o),()=>{}):y(()=>{let r=typeof n=="function"?n():n;x(e,t,r,o)})}function te(e,t,n){return typeof n!="function"?(k(e,t,n),()=>{}):y(()=>{let o=typeof n=="function"?n():n;k(e,t,o)})}function be(e,t,n){return typeof n!="function"?(x(e,t,!!n),()=>{}):y(()=>{let o=n();x(e,t,!!o)})}function D(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){y(()=>D(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(o=>{let r=t[o];return typeof r=="function"?r():!!r}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function F(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let r=t[o],f=o.split(/\s+/).filter(Boolean);if(typeof r=="function"&&n)n.push(y(()=>{let s=!!r();for(let i of f)e.classList.toggle(i,s)}));else{let s=!!(typeof r=="function"?r():r);for(let i of f)e.classList.toggle(i,s)}}}function H(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 o in n){let r=n[o];r==null?e.style[o]="":e.style[o]=r}}function xn(e){let{element:t,props:n,prevProps:o=qe,isSVG:r=!1,skipChildren:f=!1}=e;if(!t||!U(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=r||t.namespaceURI===G,i=[];for(let a in n){if(f&&a==="children")continue;let u=n[a],c=o[a];if(u===c)continue;if(a==="ref"){Ne(u,t);continue}if(a==="use"){Ee(t,u);continue}if(a.startsWith("on:")){i.push(he(t,a.slice(3),u));continue}if(a.startsWith("prop:")){i.push(te(t,a.slice(5),u));continue}if(a.startsWith("attr:")){i.push(ee(t,a.slice(5),u,s));continue}if(a.startsWith("bool:")){i.push(be(t,a.slice(5),u));continue}if(a==="class"||a==="className"){typeof u=="function"?i.push(y(()=>D(t,u()))):D(t,u);continue}if(a==="classList"){typeof u=="function"?i.push(y(()=>F(t,u()))):F(t,u,i);continue}if(a==="style"){typeof u=="function"?i.push(y(()=>H(t,u()))):H(t,u);continue}if(a.startsWith("on")){let p=a.slice(2).toLowerCase();c&&ye(t,p),u&&We(t,p,u);continue}let d=X.has(a)||!s&&a in t;typeof u=="function"?i.push(d?te(t,a,u):ee(t,a,u,s)):i.push(y(()=>d?k(t,a,n[a]):x(t,a,n[a],s)))}for(let a in o)if(!(a in n))if(a.startsWith("on")){let u=a.slice(2).toLowerCase();ye(t,u)}else X.has(a)?k(t,a,null):t.removeAttribute(a);return()=>{i.forEach(a=>a())}}function hn(e,t,n=!1){for(let o in t){let r=t[o];if(o==="ref"){Ne(r,e);continue}if(o!=="children"){if(o==="use"){Ee(e,r);continue}if(o.startsWith("on:")){he(e,o.slice(3),r);continue}if(o.startsWith("prop:")){te(e,o.slice(5),r);continue}if(o.startsWith("attr:")){ee(e,o.slice(5),r,n);continue}if(o.startsWith("bool:")){be(e,o.slice(5),r);continue}if(o.startsWith("on")&&o.length>2){let f=o.slice(2).toLowerCase();if(typeof r=="function")if(j.has(f)){e[`$$${f}`]=r;let s=`__fx_${f}`;if(!e[s]){let i=a=>{e[`$$${f}`]?.(a)};e.addEventListener(f,i),e[s]=i}}else e[`$$${f}`]=r,I.has(f)||ge([f]);continue}if(o==="class"||o==="className"){D(e,r);continue}if(o==="classList"){typeof r=="function"?y(()=>F(e,r())):F(e,r);continue}if(o==="style"){typeof r=="function"?y(()=>H(e,r())):H(e,r);continue}if(o==="innerHTML"){if(typeof r=="function"){let f=R(()=>{let s=r();for(;typeof s=="function";)s=s();e.innerHTML=s});v(()=>f())}else e.innerHTML=r;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof r=="function"){let f=R(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});v(()=>{f()})}else y(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof r=="function"){let f=R(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});v(()=>{f()})}else y(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof r=="function"){let f=!0,s=R(()=>{let i=r();for(;typeof i=="function"&&i.length===0;)i=i();f?(f=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});v(()=>{s()})}else{let f=!0;y(()=>{let s=t[o];f?(f=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof r=="function"){let f=R(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();J(e,o,s,n)});v(()=>{f()})}else y(()=>J(e,o,t[o],n))}}}function En(...e){let t=o=>{for(let r=e.length-1;r>=0;r--){let f=e[r];if(f&&o in f&&f[o]!==void 0)return f[o]}},n=o=>{for(let r of e)if(r&&o in r)return!0;return!1};return new Proxy({},{get:(o,r)=>t(r),has:(o,r)=>n(r),ownKeys:()=>{let o=new Set;for(let r of e)if(r)for(let f of Reflect.ownKeys(r))o.add(f);return[...o]},getOwnPropertyDescriptor:(o,r)=>n(r)?{enumerable:!0,configurable:!0,get:()=>t(r)}:void 0})}function bn(e,...t){let n=new Set;for(let s of t)for(let i of s)n.add(i);let o=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),r=t.map(s=>{let i=new Set(s);return new Proxy({},{get:(a,u)=>i.has(u)?e[u]:void 0,has:(a,u)=>i.has(u)&&u in e,ownKeys:()=>Array.from(i).filter(a=>a in e),getOwnPropertyDescriptor:(a,u)=>i.has(u)&&u in e?o(u):void 0})}),f=new Proxy({},{get:(s,i)=>n.has(i)?void 0:e[i],has:(s,i)=>!n.has(i)&&i in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,i)=>!n.has(i)&&i in e?o(i):void 0});return[...r,f]}function Ne(e,t){if(e){if(A(e)){let n=t,o=e;if(!n)return;typeof n=="function"?n(o):typeof n=="object"&&"current"in n&&(n.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function Nn(e,t,n){let o=t||document.body,r=Fe(()=>e),f=[];return me(()=>{let s=y(()=>{let i=r();Array.isArray(i)?(i.forEach(a=>o.appendChild(a)),f.push(()=>{i.forEach(a=>{a.parentNode===o&&o.removeChild(a)})})):A(i)&&(o.appendChild(i),f.push(()=>{i.parentNode===o&&o.removeChild(i)}))});f.push(s),v(()=>{f.forEach(i=>i())})}),null}function Tn(e){return typeof e=="string"&&e.toLowerCase()===e}function wn(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 Sn(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function $(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function vn(e){return typeof e=="function"&&e.length===0&&g(e)}function Te(e,t,n){if(!t)throw new Error("Container element is required");let o,r,f=[];return De(s=>{me(()=>{l.active||(t.textContent=""),ae(t),fe(),L(t,e)}),r=s}),()=>{r?.(),o?.(),f.forEach(s=>s()),t.textContent=""}}function Cn(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(…)`.")}import{untrack as Ue,isSignal as Ye}from"@fluixi/reactive";var Ze="__fx_dom_create_component__",C=globalThis[Ze]??={fn:null};function Pn(e){C.fn=e}function Mn(e={}){let t=e.signalSystem?.createComponent;t&&(C.fn=t)}function _n(e,t){if(C.fn)return C.fn(e,t);let n=typeof e=="function"?Ue(()=>e(t)):e;if(n!=null&&(typeof n=="function"||typeof n=="object")&&!Ye(n)){try{n.$name=e?.name}catch{}return ue(n)}return n}var $n=()=>C.fn!==null,In=()=>C.fn!==null;function On(){C.fn=null}var q,Qe={getStore:()=>q,run(e,t){let n=q;q=e;try{return t()}finally{q=n}}},et=Qe;function we(){return et.getStore()}import{setResourceIdSource as nt,setServerDataGetter as ot}from"@fluixi/reactive/signal";var tt="__FX_DATA__";var ne;function Se(){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(tt)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return ne=t}function V(){for(;;){for(;l.cursor&&l.cursor.nodeType===3&&l.cursor.data==="";)l.cursor=l.cursor.nextSibling;if(l.cursor!=null||!l.parents.length)return;l.cursor=l.parents.pop().nextSibling}}var rt=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),W=typeof process<"u"&&process.env&&!1;function K(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 it(e){V();let t=l.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(rt.has(e.toLowerCase())?l.cursor=t.nextSibling:(l.parents.push(t),l.cursor=t.firstChild),t):(W&&t&&K(`<${e}>`,t),null)}function st(e){V();let t=l.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(l.cursor=t.nextSibling,t):(W&&t&&K(`<${e}> (static)`,t),null)}function at(e){if(e===""){let n=l.cursor;return n&&n.nodeType===3&&n.data!==""?(l.cursor=n.nextSibling,n.data="",n):null}V();let t=l.cursor;return t&&t.nodeType===3?(l.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(W&&t&&K(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function ft(e){V();let t=l.cursor;return t&&t.nodeType===8&&t.data===e?(l.cursor=t.nextSibling,t):(W&&t&&K(`marker <!--${e.slice(0,24)}-->`,t),null)}var ve=!1;function ut(){ve||(ve=!0,de({hydrateElement:it,hydrateText:at,hydrateMarker:ft,hydrateStatic:st}))}function oe(e,t,n){ut(),l.active=!0,l.cursor=t.firstChild,l.parents=[];let o=Se(),r=n?.resourceNamespace,f=0;nt(()=>r?`${r}:r${f++}`:`r${f++}`),ot(o?s=>s in o?{value:o[s]}:void 0:null);try{return Te(e,t)}finally{l.active=!1,l.cursor=null,l.parents=[]}}var re="fluixi-island";function lt(e){let{component:t,props:n={},name:o}=e,r=xe(re),f=o??t.name??"Island";x(r,"name",f),x(r,"props",JSON.stringify(n??{}));let s=b?we():void 0;if(s){let i=s.nextIslandNamespace(f);L(r,()=>s.withResourceScope(i,()=>t(n)))}else L(r,()=>t(n));return r}var Ce=!1;function ct(){if(Ce||typeof document>"u")return;Ce=!0;let e=document.createElement("style");e.textContent=`${re}{display:contents}`,document.head.appendChild(e)}function dt(e){if(typeof document>"u")return;ct();let t=document.querySelectorAll(re),n=new Map;t.forEach(o=>{let r=o.getAttribute("name")??"",f=n.get(r)??0;n.set(r,f+1);let s=e[r];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${r}" has no component in the registry — left static.`);return}let i={};try{i=JSON.parse(o.getAttribute("props")||"{}")}catch{}oe(()=>s(i),o,{resourceNamespace:`${r}#${f}`})})}export{lt as Island,X as JSX_PROPERTIES,ht as SVG_ELEMENTS,G as SVG_NAMESPACE,xt as VOID_ELEMENTS,Nt as addClass,We as addDelegatedEventListener,he as addNativeEventListener,Pt as appendChildren,J as applyElementProp,hn as applyProps,Ee as applyUse,Cn as bindPair,Ie as captureHydrationCursor,S as cleanChildren,Be as cloneTemplate,bt as closest,_n as createComponent,Rt as createElement,xe as createNativeElement,Nn as createPortal,Ke as createTemplate,It as delegate,ge as delegateEvents,Sn as escapeHTML,mn as fnName,fn as generateID,vt as getAttribute,Wt as getGlobal,mt as getLitEventName,$t as getOffset,an as getStableElementId,At as getStyle,Ne as handleRef,St as hasClass,yn as holeContent,pn as holeEnd,dn as holeScope,oe as hydrate,ke as hydrateAdvancePast,dt as hydrateIslands,Mn as initializeIntegration,L as insert,O as insertExpression,$n as intergartionInitialized,vn as isAccessor,Re as isCustomElement,qt as isDOMNode,un as isDelegatedEvent,U as isDomElement,A as isDomNode,Y as isDomText,yt as isEventHandler,ln as isFunction,In as isIntegrationInitialized,jt as isJSXTemplate,Me as isLitTemplateResult,Tn as isNativeElement,$ as isPromise,Ft as isReactElement,wn as isSVGElement,b as isServer,Ht as isTemplateFactory,Mt as isVisible,gn as iterateFn,Ge as makeArrayFlat,En as mergeProps,kt as observeIntersection,Dt as observeResize,ie as query,Et as queryAll,Pn as registerCreateComponent,Vt as registerGlobal,Ct as removeAttribute,Lt as removeChildren,Tt as removeClass,ye as removeDelegatedEventListener,Te as render,On as resetIntegration,_ as runHydrationAt,Oe as runWithoutHydration,_t as scrollIntoView,x as setAttribute,F as setClassList,D as setClassName,ee as setDynamicAttribute,be as setDynamicBoolAttribute,te as setDynamicProperty,k as setProperty,$e as setServerMode,H as setStyle,Le as setStyles,gt as shouldSetAsProperty,bn as splitProps,xn as spread,cn as templateNode,pt as toAttributeName,wt as toggleClass,Ot as waitForElement};
@@ -1 +1 @@
1
- "use strict";var a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var f=(e,n)=>{for(var r in n)a(e,r,{get:n[r],enumerable:!0})},c=(e,n,r,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of s(n))!l.call(e,o)&&o!==r&&a(e,o,{get:()=>n[o],enumerable:!(i=p(n,o))||i.enumerable});return e};var y=e=>c(a({},"__esModule",{value:!0}),e);var I={};f(I,{createComponent:()=>g,initializeIntegration:()=>u,intergartionInitialized:()=>d,isIntegrationInitialized:()=>x,registerCreateComponent:()=>C,resetIntegration:()=>_});module.exports=y(I);var m="__fx_dom_create_component__",t=globalThis[m]??={fn:null};function C(e){t.fn=e}function u(e={}){let n=e.signalSystem?.createComponent;n&&(t.fn=n)}function g(e,n){return t.fn?t.fn(e,n):(()=>e(n))}var d=()=>t.fn!==null,x=()=>t.fn!==null;function _(){t.fn=null}
1
+ "use strict";var u=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var a=(t,e)=>{for(var n in e)u(t,n,{get:e[n],enumerable:!0})},m=(t,e,n,f)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of c(e))!s.call(t,o)&&o!==n&&u(t,o,{get:()=>e[o],enumerable:!(f=y(e,o))||f.enumerable});return t};var x=t=>m(u({},"__esModule",{value:!0}),t);var O={};a(O,{createComponent:()=>C,initializeIntegration:()=>d,intergartionInitialized:()=>S,isIntegrationInitialized:()=>g,registerCreateComponent:()=>b,resetIntegration:()=>R});module.exports=x(O);var i=require("@fluixi/reactive");function p(t){return typeof t!="function"||Object.defineProperty(t,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),t}var l="__fx_dom_create_component__",r=globalThis[l]??={fn:null};function b(t){r.fn=t}function d(t={}){let e=t.signalSystem?.createComponent;e&&(r.fn=e)}function C(t,e){if(r.fn)return r.fn(t,e);let n=typeof t=="function"?(0,i.untrack)(()=>t(e)):t;if(n!=null&&(typeof n=="function"||typeof n=="object")&&!(0,i.isSignal)(n)){try{n.$name=t?.name}catch{}return p(n)}return n}var S=()=>r.fn!==null,g=()=>r.fn!==null;function R(){r.fn=null}
@@ -1 +1 @@
1
- {"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../src/lib/dom/integration.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAE5D,KAAK,iBAAiB,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,EAAE,KAAK,CAAC,EAAE,GAAG,KAAK,GAAG,CAAC;AAO7D,MAAM,WAAW,kBAAkB;IAEjC,YAAY,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,iBAAiB,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7E,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACnC;AAED,wBAAgB,uBAAuB,CAAC,eAAe,EAAE,iBAAiB,GAAG,IAAI,CAEhF;AAGD,wBAAgB,qBAAqB,CAAC,OAAO,GAAE,kBAAuB,GAAG,IAAI,CAG5E;AAED,wBAAgB,eAAe,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,GAAG,EAAE,CAAC,GAAG,GAAG,EACrE,IAAI,EAAE,CAAC,EACP,KAAK,CAAC,EAAE,CAAC,GAAG,SAAS,GACpB,yBAAyB,CAAC,CAAC,EAAE,CAAC,CAAC,CAGjC;AAED,eAAO,MAAM,uBAAuB,QAAO,OAA4B,CAAC;AACxE,eAAO,MAAM,wBAAwB,QAAO,OAA4B,CAAC;AAEzE,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC"}
1
+ {"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../src/lib/dom/integration.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAE5D,KAAK,iBAAiB,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,EAAE,KAAK,CAAC,EAAE,GAAG,KAAK,GAAG,CAAC;AAO7D,MAAM,WAAW,kBAAkB;IAEjC,YAAY,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,iBAAiB,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7E,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACnC;AAED,wBAAgB,uBAAuB,CAAC,eAAe,EAAE,iBAAiB,GAAG,IAAI,CAEhF;AAGD,wBAAgB,qBAAqB,CAAC,OAAO,GAAE,kBAAuB,GAAG,IAAI,CAG5E;AAED,wBAAgB,eAAe,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,GAAG,EAAE,CAAC,GAAG,GAAG,EACrE,IAAI,EAAE,CAAC,EACP,KAAK,CAAC,EAAE,CAAC,GAAG,SAAS,GACpB,yBAAyB,CAAC,CAAC,EAAE,CAAC,CAAC,CAsBjC;AAED,eAAO,MAAM,uBAAuB,QAAO,OAA4B,CAAC;AACxE,eAAO,MAAM,wBAAwB,QAAO,OAA4B,CAAC;AAEzE,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC"}
@@ -1,6 +1,9 @@
1
- // createComponent lives in @fluixi/core, not the reactive core, so the runtime
2
- // can't import it core registers it here at startup. Everything else the runtime
3
- // needs comes straight from @fluixi/reactive (shared globalThis graph, no bridge).
1
+ // createComponent lives here. It used to live in core and be registered through the
2
+ // slot below, which left the runtime with a fallback that re-invoked a component on
3
+ // every read a list rebuilt every node whenever it changed, and only for consumers
4
+ // who had not loaded core. The slot stays so a host can still override it.
5
+ import { untrack, isSignal } from '@fluixi/reactive';
6
+ import { asComponent } from '../component/modifiers.js';
4
7
  // On globalThis so every bundled copy shares the slot.
5
8
  const _slotKey = '__fx_dom_create_component__';
6
9
  const _slot = (globalThis[_slotKey] ??= { fn: null });
@@ -16,7 +19,23 @@ export function initializeIntegration(options = {}) {
16
19
  export function createComponent(Comp, props) {
17
20
  if (_slot.fn)
18
21
  return _slot.fn(Comp, props);
19
- return (() => Comp(props));
22
+ // Untracked: a component reading a signal while it is created must not make its
23
+ // caller depend on that signal, or the caller re-runs and rebuilds the subtree.
24
+ const component = typeof Comp === 'function' ? untrack(() => Comp(props)) : Comp;
25
+ // Primitives cannot carry properties, and a signal must not be stamped as a
26
+ // component or the runtime caches it as a static thunk.
27
+ if (component != null &&
28
+ (typeof component === 'function' || typeof component === 'object') &&
29
+ !isSignal(component)) {
30
+ try {
31
+ component['$name'] = Comp?.name;
32
+ }
33
+ catch {
34
+ /* frozen or exotic object */
35
+ }
36
+ return asComponent(component);
37
+ }
38
+ return component;
20
39
  }
21
40
  export const intergartionInitialized = () => _slot.fn !== null;
22
41
  export const isIntegrationInitialized = () => _slot.fn !== null;
@@ -1 +1 @@
1
- var o="__fx_dom_create_component__",n=globalThis[o]??={fn:null};function r(e){n.fn=e}function a(e={}){let t=e.signalSystem?.createComponent;t&&(n.fn=t)}function i(e,t){return n.fn?n.fn(e,t):(()=>e(t))}var p=()=>n.fn!==null,s=()=>n.fn!==null;function l(){n.fn=null}export{i as createComponent,a as initializeIntegration,p as intergartionInitialized,s as isIntegrationInitialized,r as registerCreateComponent,l as resetIntegration};
1
+ import{untrack as i,isSignal as u}from"@fluixi/reactive";function o(t){return typeof t!="function"||Object.defineProperty(t,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),t}var f="__fx_dom_create_component__",n=globalThis[f]??={fn:null};function s(t){n.fn=t}function a(t={}){let r=t.signalSystem?.createComponent;r&&(n.fn=r)}function m(t,r){if(n.fn)return n.fn(t,r);let e=typeof t=="function"?i(()=>t(r)):t;if(e!=null&&(typeof e=="function"||typeof e=="object")&&!u(e)){try{e.$name=t?.name}catch{}return o(e)}return e}var x=()=>n.fn!==null,l=()=>n.fn!==null;function b(){n.fn=null}export{m as createComponent,a as initializeIntegration,x as intergartionInitialized,l as isIntegrationInitialized,s as registerCreateComponent,b as resetIntegration};